min.h 703 B

12345678910111213141516171819202122232425262728
  1. #ifndef IGL_MIN_H
  2. #define IGL_MIN_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 min
  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 minimum
  16. // entries
  17. template <typename AType, typename DerivedB, typename DerivedI>
  18. IGL_INLINE void min(
  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 "min.cpp"
  26. #endif
  27. #endif