dot_row.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2014 Daniele Panozzo <daniele.panozzo@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_DOT_ROW_H
  9. #define IGL_DOT_ROW_H
  10. #include "igl/igl_inline.h"
  11. #include <Eigen/Core>
  12. namespace igl
  13. {
  14. // Compute the dot product between each row of A and B
  15. // Templates:
  16. // DerivedV derived from vertex positions matrix type: i.e. MatrixXd
  17. // DerivedF derived from face indices matrix type: i.e. MatrixXi
  18. // Inputs:
  19. // A eigen matrix r by c
  20. // B eigen matrix r by c
  21. // Outputs:
  22. // d a column vector with r entries that contains the dot product of each corresponding row of A and B
  23. //
  24. // See also: adjacency_matrix
  25. template <typename DerivedV>
  26. IGL_INLINE Eigen::PlainObjectBase<DerivedV> dot_row(
  27. const Eigen::PlainObjectBase<DerivedV>& A,
  28. const Eigen::PlainObjectBase<DerivedV>& B
  29. );
  30. }
  31. #ifdef IGL_HEADER_ONLY
  32. # include "dot_row.cpp"
  33. #endif
  34. #endif