max.h 702 B

123456789101112131415161718192021222324252627
  1. #ifndef IGL_MAX_H
  2. #define IGL_MAX_H
  3. #include "igl_inline.h"
  4. #include <Eigen/Core>
  5. #include <Eigen/Sparse>
  6. namespace igl
  7. {
  8. // Inputs:
  9. // X m by n matrix
  10. // dim dimension along which to take max
  11. // Outputs:
  12. // Y n-long vector (if dim == 1)
  13. // or
  14. // Y m-long vector (if dim == 2)
  15. // I vector the same size as Y containing the indices along dim of maximum
  16. // entries
  17. template <typename AType, typename DerivedB, typename DerivedI>
  18. IGL_INLINE void max(
  19. const Eigen::SparseMatrix<AType> & A,
  20. const int dim,
  21. Eigen::PlainObjectBase<DerivedB> & B,
  22. Eigen::PlainObjectBase<DerivedI> & I);
  23. }
  24. #ifndef IGL_STATIC_LIBRARY
  25. # include "max.cpp"
  26. #endif
  27. #endif