sparse_AtA_fast.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2017 Daniele Panozzo <daniele.panozzo@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_SPARSE_ATA_FAST_H
  9. #define IGL_SPARSE_ATA_FAST_H
  10. #include "igl_inline.h"
  11. #define EIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET
  12. #include <Eigen/Dense>
  13. #include <Eigen/Sparse>
  14. namespace igl
  15. {
  16. struct sparse_AtA_fast_data
  17. {
  18. // Weights
  19. Eigen::VectorXd W;
  20. // Flatten composition rules
  21. std::vector<int> I_row;
  22. std::vector<int> I_col;
  23. std::vector<double> I_w;
  24. // For each entry of AtA, points to the beginning
  25. // of the composition rules
  26. std::vector<int> I_outer;
  27. };
  28. IGL_INLINE void sparse_AtA_fast_precompute(
  29. const Eigen::SparseMatrix<double>& A,
  30. Eigen::SparseMatrix<double>& AtA,
  31. sparse_AtA_fast_data& data);
  32. IGL_INLINE void sparse_AtA_fast(
  33. const Eigen::SparseMatrix<double>& A,
  34. Eigen::SparseMatrix<double>& AtA,
  35. const sparse_AtA_fast_data& data);
  36. }
  37. #ifndef IGL_STATIC_LIBRARY
  38. # include "sparse_AtA_fast.cpp"
  39. #endif
  40. #endif