covariance_scatter_matrix.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2013 Alec Jacobson <alecjacobson@gmail.com>
  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. // Inputs:
  18. // V #V by Vdim list of initial domain positions
  19. // F #F by 3 list of triangle indices into V
  20. // energy ARAPEnergyType enum value defining which energy is being used.
  21. // See ARAPEnergyType.h for valid options and explanations.
  22. // Outputs:
  23. // CSM dim*#V/#F by dim*#V sparse matrix containing special laplacians along
  24. // the diagonal so that when multiplied by V gives covariance matrix
  25. // elements, can be used to speed up covariance matrix computation
  26. IGL_INLINE void covariance_scatter_matrix(
  27. const Eigen::MatrixXd & V,
  28. const Eigen::MatrixXi & F,
  29. const ARAPEnergyType energy,
  30. Eigen::SparseMatrix<double>& CSM);
  31. }
  32. #ifndef IGL_STATIC_LIBRARY
  33. #include "covariance_scatter_matrix.cpp"
  34. #endif
  35. #endif