normalize_row_lengths.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2013 Alec Jacobson <alecjacobson@gmail.com>
  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_NORMALIZE_ROW_LENGTHS_H
  9. #define IGL_NORMALIZE_ROW_LENGTHS_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Core>
  12. // History:
  13. // March 24, 2012: Alec changed function name from normalize_rows to
  14. // normalize_row_lengths to avoid confusion with normalize_row_sums
  15. namespace igl
  16. {
  17. // Obsolete: just use A.rowwise().normalize() or B=A.rowwise().normalized();
  18. //
  19. // Normalize the rows in A so that their lengths are each 1 and place the new
  20. // entries in B
  21. // Inputs:
  22. // A #rows by k input matrix
  23. // Outputs:
  24. // B #rows by k input matrix, can be the same as A
  25. template <typename DerivedV>
  26. IGL_INLINE void normalize_row_lengths(
  27. const Eigen::PlainObjectBase<DerivedV>& A,
  28. Eigen::PlainObjectBase<DerivedV> & B);
  29. }
  30. #ifndef IGL_STATIC_LIBRARY
  31. # include "normalize_row_lengths.cpp"
  32. #endif
  33. #endif