any.h 989 B

1234567891011121314151617181920212223242526272829303132333435
  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. #include <Eigen/Core>
  12. #include <Eigen/Sparse>
  13. namespace igl
  14. {
  15. // For Dense matrices use: A.rowwise().any() or A.colwise().any()
  16. //
  17. // Inputs:
  18. // A m by n sparse matrix
  19. // dim dimension along which to check for any (1 or 2)
  20. // Output:
  21. // B n-long vector (if dim == 1)
  22. // or
  23. // B m-long vector (if dim == 2)
  24. //
  25. template <typename AType, typename DerivedB>
  26. IGL_INLINE void any(
  27. const Eigen::SparseMatrix<AType> & A,
  28. const int dim,
  29. Eigen::PlainObjectBase<DerivedB>& B);
  30. }
  31. #ifndef IGL_STATIC_LIBRARY
  32. # include "any.cpp"
  33. #endif
  34. #endif