full.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2013 Alec Jacobson <alecjacobson@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_FULL_H
  9. #define IGL_FULL_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. // This is totally unnecessary. You can just call MatrixXd B = MatrixXd(A);
  17. //
  18. // Convert a sparsematrix into a full one
  19. //
  20. // Templates:
  21. // T should be a eigen sparse matrix primitive type like int or double
  22. // Input:
  23. // A m by n sparse matrix
  24. // Output:
  25. // B m by n dense/full matrix
  26. template <typename T,typename DerivedB>
  27. IGL_INLINE void full(
  28. const Eigen::SparseMatrix<T> & A,
  29. Eigen::PlainObjectBase<DerivedB> & B);
  30. // If already full then this will just be a copy by assignment
  31. template <typename DerivedA,typename DerivedB>
  32. IGL_INLINE void full(
  33. const Eigen::PlainObjectBase<DerivedA>& A,
  34. Eigen::PlainObjectBase<DerivedB>& B);
  35. }
  36. #ifndef IGL_STATIC_LIBRARY
  37. # include "full.cpp"
  38. #endif
  39. #endif