normalize_row_sums.h 586 B

123456789101112131415161718192021222324
  1. #ifndef IGL_NORMALIZE_ROW_SUMS_H
  2. #define IGL_NORMALIZE_ROW_SUMS_H
  3. #include "igl_inline.h"
  4. #include <Eigen/Core>
  5. namespace igl
  6. {
  7. // Normalize the rows in A so that their sums are each 1 and place the new
  8. // entries in B
  9. // Inputs:
  10. // A #rows by k input matrix
  11. // Outputs:
  12. // B #rows by k input matrix, can be the same as A
  13. template <typename DerivedA, typename DerivedB>
  14. IGL_INLINE void normalize_row_sums(
  15. const Eigen::MatrixBase<DerivedA>& A,
  16. Eigen::MatrixBase<DerivedB> & B);
  17. }
  18. #ifdef IGL_HEADER_ONLY
  19. # include "normalize_row_sums.cpp"
  20. #endif
  21. #endif