find_zero.h 748 B

12345678910111213141516171819202122232425262728
  1. #ifndef IGL_FIND_ZERO_H
  2. #define IGL_FIND_ZERO_H
  3. #include "igl_inline.h"
  4. #include <Eigen/Core>
  5. #include <Eigen/Sparse>
  6. namespace igl
  7. {
  8. // Find the first zero (whether implicit or explicitly stored) in the
  9. // rows/columns of a matrix.
  10. // Inputs:
  11. // A m by n sparse matrix
  12. // dim dimension along which to check for any (1 or 2)
  13. // Output:
  14. // I n-long vector (if dim == 1) {m means no zeros found}
  15. // or
  16. // I m-long vector (if dim == 2) {n means no zeros found}
  17. //
  18. template <typename AType, typename DerivedI>
  19. IGL_INLINE void find_zero(
  20. const Eigen::SparseMatrix<AType> & A,
  21. const int dim,
  22. Eigen::PlainObjectBase<DerivedI> & I);
  23. }
  24. #ifndef IGL_STATIC_LIBRARY
  25. # include "find_zero.cpp"
  26. #endif
  27. #endif