full.cpp 687 B

123456789101112131415161718192021222324
  1. #include "full.h"
  2. template <typename T>
  3. IGL_INLINE void igl::full(
  4. const Eigen::SparseMatrix<T> & A,
  5. Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic> & B)
  6. {
  7. B = Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic>::Zero(A.rows(),A.cols());
  8. // Iterate over outside
  9. for(int k=0; k<A.outerSize(); ++k)
  10. {
  11. // Iterate over inside
  12. for(typename Eigen::SparseMatrix<T>::InnerIterator it (A,k); it; ++it)
  13. {
  14. B(it.row(),it.col()) = it.value();
  15. }
  16. }
  17. }
  18. #ifndef IGL_HEADER_ONLY
  19. // Explicit template specialization
  20. // generated by autoexplicit.sh
  21. template void igl::full<double>(Eigen::SparseMatrix<double, 0, int> const&, Eigen::Matrix<double, -1, -1, 0, -1, -1>&);
  22. #endif