full.cpp 1.3 KB

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