full.cpp 535 B

12345678910111213141516171819202122
  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. #endif