any.cpp 945 B

1234567891011121314151617181920212223242526
  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. #include "any.h"
  9. #include "redux.h"
  10. template <typename AType, typename DerivedB>
  11. IGL_INLINE void igl::any(
  12. const Eigen::SparseMatrix<AType> & A,
  13. const int dim,
  14. Eigen::PlainObjectBase<DerivedB>& B)
  15. {
  16. typedef typename DerivedB::Scalar Scalar;
  17. igl::redux(A,dim,[](Scalar a, Scalar b){ return a || b!=0;},B);
  18. }
  19. #ifdef IGL_STATIC_LIBRARY
  20. // Explicit template instantiation
  21. // generated by autoexplicit.sh
  22. template void igl::any<bool, Eigen::Array<bool, -1, 1, 0, -1, 1> >(Eigen::SparseMatrix<bool, 0, int> const&, int, Eigen::PlainObjectBase<Eigen::Array<bool, -1, 1, 0, -1, 1> >&);
  23. #endif