any.h 943 B

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