is_sparse.h 1005 B

123456789101112131415161718192021222324252627282930313233343536
  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_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. // Template:
  19. // T,DerivedA defines scalar type
  20. // Inputs:
  21. // A matrix in question
  22. // Returns true if A is represented with a sparse matrix
  23. template <typename T>
  24. IGL_INLINE bool is_sparse(
  25. const Eigen::SparseMatrix<T> & A);
  26. template <typename DerivedA>
  27. IGL_INLINE bool is_sparse(
  28. const Eigen::PlainObjectBase<DerivedA>& A);
  29. }
  30. #ifdef IGL_HEADER_ONLY
  31. # include "is_sparse.cpp"
  32. #endif
  33. #endif