dot_row.cpp 831 B

1234567891011121314151617181920212223242526272829303132
  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. #include "igl/dot_row.h"
  9. using namespace Eigen;
  10. namespace igl
  11. {
  12. template <typename DerivedV>
  13. IGL_INLINE Eigen::PlainObjectBase<DerivedV> dot_row(
  14. const Eigen::PlainObjectBase<DerivedV>& A,
  15. const Eigen::PlainObjectBase<DerivedV>& B
  16. )
  17. {
  18. assert(A.rows() == B.rows());
  19. assert(A.cols() == B.cols());
  20. return (A.array() * B.array()).rowwise().sum();
  21. }
  22. }
  23. #ifndef IGL_HEADER_ONLY
  24. // Explicit template specialization
  25. // generated by autoexplicit.sh
  26. #endif