is_sparse.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2013 Alec Jacobson <[email protected]>
  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_IS_SPARSE_H
  9. #define IGL_IS_SPARSE_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. /// Determine if a matrix A is sparse
  17. ///
  18. /// @tparam T,DerivedA defines scalar type
  19. /// @param[in] A matrix in question
  20. /// @return true if A is represented with a sparse matrix
  21. ///
  22. /// \deprecated should probably use `std::type_info`
  23. template <typename T>
  24. IGL_INLINE bool is_sparse(
  25. const Eigen::SparseMatrix<T> & A);
  26. /// \overload
  27. template <typename DerivedA>
  28. IGL_INLINE bool is_sparse(
  29. const Eigen::MatrixBase<DerivedA>& A);
  30. }
  31. #ifndef IGL_STATIC_LIBRARY
  32. # include "is_sparse.cpp"
  33. #endif
  34. #endif