any.cpp 718 B

123456789101112131415161718192021222324
  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. template <typename AType, typename DerivedB>
  10. IGL_INLINE void igl::any(
  11. const Eigen::SparseMatrix<AType> & A,
  12. const int dim,
  13. Eigen::PlainObjectBase<DerivedB>& B)
  14. {
  15. typedef typename DerivedB::Scalar Scalar;
  16. igl::redux(A,dim,[](Scalar a, Scalar b){ return a || b!=0;},B);
  17. }
  18. #ifdef IGL_STATIC_LIBRARY
  19. // Explicit template specialization
  20. #endif