mod.h 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2015 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_MOD_H
  9. #define IGL_MOD_H
  10. #include "igl_inline.h"
  11. #include "PlainMatrix.h"
  12. #include <Eigen/Core>
  13. namespace igl
  14. {
  15. /// Compute elementwise mod: B = A % base
  16. ///
  17. /// @param[in] A m by n matrix
  18. /// @param[in] base number to mod against
  19. /// @param[out] B m by n matrix
  20. template <typename DerivedA, typename DerivedB>
  21. IGL_INLINE void mod(
  22. const Eigen::MatrixBase<DerivedA> & A,
  23. const int base,
  24. Eigen::PlainObjectBase<DerivedB> & B);
  25. /// \overload
  26. template <typename DerivedA>
  27. IGL_INLINE igl::PlainMatrix<DerivedA> mod(
  28. const Eigen::MatrixBase<DerivedA> & A, const int base);
  29. }
  30. #ifndef IGL_STATIC_LIBRARY
  31. #include "mod.cpp"
  32. #endif
  33. #endif