normalize_row_lengths.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  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. // Normalize the rows in A so that their lengths are each 1 and place the new
  18. // entries in B
  19. // Inputs:
  20. // A #rows by k input matrix
  21. // Outputs:
  22. // B #rows by k input matrix, can be the same as A
  23. template <typename DerivedV>
  24. IGL_INLINE void normalize_row_lengths(
  25. const Eigen::PlainObjectBase<DerivedV>& A,
  26. Eigen::PlainObjectBase<DerivedV> & B);
  27. }
  28. #ifdef IGL_HEADER_ONLY
  29. # include "normalize_row_lengths.cpp"
  30. #endif
  31. #endif