any.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2016 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_ANY_H
  9. #define IGL_ANY_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Core>
  12. #include <Eigen/Sparse>
  13. namespace igl
  14. {
  15. /// Check whether any values are logically true along a dimension.
  16. ///
  17. /// \note Dense matrices use: A.rowwise().any() or A.colwise().any()
  18. ///
  19. /// @param[in] A m by n sparse matrix
  20. /// @param[in] dim dimension along which to check for any (1 or 2)
  21. /// @param[out] B n-long vector (if dim == 1)
  22. /// or m-long vector (if dim == 2)
  23. ///
  24. template <typename AType, typename DerivedB>
  25. IGL_INLINE void any(
  26. const Eigen::SparseMatrix<AType> & A,
  27. const int dim,
  28. Eigen::PlainObjectBase<DerivedB>& B);
  29. }
  30. #ifndef IGL_STATIC_LIBRARY
  31. # include "any.cpp"
  32. #endif
  33. #endif