cotmatrix_intrinsic.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2018 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_COTMATRIX_INTRINSIC_H
  9. #define IGL_COTMATRIX_INTRINSIC_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Dense>
  12. #include <Eigen/Sparse>
  13. namespace igl
  14. {
  15. /// Constructs the cotangent stiffness matrix (discrete laplacian) for a given
  16. /// mesh with faces F and edge lengths l.
  17. ///
  18. /// @param[in] l #F by 3 list of (half-)edge lengths
  19. /// @param[in] F #F by 3 list of face indices into some (not necessarily
  20. /// determined/embedable) list of vertex positions V. It is assumed #V ==
  21. /// F.maxCoeff()+1
  22. /// @param[out] L #V by #V sparse Laplacian matrix
  23. ///
  24. /// \see cotmatrix, intrinsic_delaunay_cotmatrix
  25. template <typename Derivedl, typename DerivedF, typename Scalar>
  26. IGL_INLINE void cotmatrix_intrinsic(
  27. const Eigen::MatrixBase<Derivedl> & l,
  28. const Eigen::MatrixBase<DerivedF> & F,
  29. Eigen::SparseMatrix<Scalar>& L);
  30. }
  31. #ifndef IGL_STATIC_LIBRARY
  32. # include "cotmatrix_intrinsic.cpp"
  33. #endif
  34. #endif