barycenter.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2013 Alec Jacobson <[email protected]>
  4. //
  5. // This Source Code Form is subject to the terms of the Mozilla Public License
  6. // v. 2.0. If a copy of the MPL was not distributed with this file, You can
  7. // obtain one at http://mozilla.org/MPL/2.0/.
  8. #ifndef IGL_BARYCENTER_H
  9. #define IGL_BARYCENTER_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Dense>
  12. namespace igl
  13. {
  14. /// Computes the barycenter of every simplex.
  15. ///
  16. /// @param[in] V #V x dim matrix of vertex coordinates
  17. /// @param[in] F #F x simplex_size matrix of indices of simplex corners into V
  18. /// @param[out] BC #F x dim matrix of 3d vertices
  19. ///
  20. template <
  21. typename DerivedV,
  22. typename DerivedF,
  23. typename DerivedBC>
  24. IGL_INLINE void barycenter(
  25. const Eigen::MatrixBase<DerivedV> & V,
  26. const Eigen::MatrixBase<DerivedF> & F,
  27. Eigen::PlainObjectBase<DerivedBC> & BC);
  28. }
  29. #ifndef IGL_STATIC_LIBRARY
  30. # include "barycenter.cpp"
  31. #endif
  32. #endif