normalize_row_lengths.cpp 1.1 KB

1234567891011121314151617181920212223
  1. #include "normalize_row_lengths.h"
  2. template <typename DerivedV>
  3. IGL_INLINE void igl::normalize_row_lengths(
  4. const Eigen::PlainObjectBase<DerivedV>& A,
  5. Eigen::PlainObjectBase<DerivedV> & B)
  6. {
  7. // Resize output
  8. B.resize(A.rows(),A.cols());
  9. // loop over rows
  10. for(int i = 0; i < A.rows();i++)
  11. {
  12. B.row(i) = A.row(i).normalized();
  13. }
  14. }
  15. #ifndef IGL_HEADER_ONLY
  16. // Explicit template specialization
  17. // generated by autoexplicit.sh
  18. template void igl::normalize_row_lengths<Eigen::Matrix<double, -1, -1, 0, -1, -1> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> >&);
  19. template void igl::normalize_row_lengths<Eigen::Matrix<double, -1, 3, 1, -1, 3> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 1, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 1, -1, 3> >&);
  20. template void igl::normalize_row_lengths<Eigen::Matrix<double, -1, 3, 0, -1, 3> >(Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> > const&, Eigen::PlainObjectBase<Eigen::Matrix<double, -1, 3, 0, -1, 3> >&);
  21. #endif