full.cpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #include "full.h"
  2. template <typename T,typename DerivedB>
  3. IGL_INLINE void igl::full(
  4. const Eigen::SparseMatrix<T> & A,
  5. Eigen::PlainObjectBase<DerivedB>& B)
  6. {
  7. assert(false && "Obsolete. Just call B = Matrix(A)");
  8. using namespace Eigen;
  9. B = PlainObjectBase<DerivedB >::Zero(A.rows(),A.cols());
  10. // Iterate over outside
  11. for(int k=0; k<A.outerSize(); ++k)
  12. {
  13. // Iterate over inside
  14. for(typename SparseMatrix<T>::InnerIterator it (A,k); it; ++it)
  15. {
  16. B(it.row(),it.col()) = it.value();
  17. }
  18. }
  19. }
  20. template <typename DerivedA,typename DerivedB>
  21. IGL_INLINE void igl::full(
  22. const Eigen::PlainObjectBase<DerivedA>& A,
  23. Eigen::PlainObjectBase<DerivedB>& B)
  24. {
  25. assert(false && "Obsolete. Just call B = Matrix(A)");
  26. B = A;
  27. }
  28. #ifndef IGL_HEADER_ONLY
  29. // Explicit template specialization
  30. // generated by autoexplicit.sh
  31. template void igl::full<Eigen::Matrix<double, -1, -1, 0, -1, -1>, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
  32. // generated by autoexplicit.sh
  33. template void igl::full<double, Eigen::Matrix<double, -1, -1, 0, -1, -1> >(Eigen::SparseMatrix<double, 0, int> const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
  34. #endif