covariance_scatter_matrix.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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_COVARIANCE_SCATTER_MATRIX_H
  9. #define IGL_COVARIANCE_SCATTER_MATRIX_H
  10. #include "igl_inline.h"
  11. #include "ARAPEnergyType.h"
  12. #include <Eigen/Dense>
  13. #include <Eigen/Sparse>
  14. namespace igl
  15. {
  16. /// Construct the covariance scatter matrix for a given arap energy
  17. ///
  18. /// @param[in] V #V by Vdim list of initial domain positions
  19. /// @param[in] F #F by 3 list of triangle indices into V
  20. /// @param[in] energy ARAPEnergyType enum value defining which energy is being used.
  21. /// See ARAPEnergyType.h for valid options and explanations.
  22. /// @param[out] CSM dim*#V/#F by dim*#V sparse matrix containing special laplacians along
  23. /// the diagonal so that when multiplied by V gives covariance matrix
  24. /// elements, can be used to speed up covariance matrix computation
  25. ///
  26. /// \see arap_linear_block, arap, ARAPEnergyType
  27. template <
  28. typename DerivedV,
  29. typename DerivedF,
  30. typename CSM_type>
  31. IGL_INLINE void covariance_scatter_matrix(
  32. const Eigen::MatrixBase<DerivedV> & V,
  33. const Eigen::MatrixBase<DerivedF> & F,
  34. const ARAPEnergyType energy,
  35. Eigen::SparseMatrix<CSM_type>& CSM);
  36. }
  37. #ifndef IGL_STATIC_LIBRARY
  38. #include "covariance_scatter_matrix.cpp"
  39. #endif
  40. #endif