dot_row.cpp 1.0 KB

1234567891011121314151617181920212223242526
  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. template <typename DerivedV>
  10. IGL_INLINE Eigen::PlainObjectBase<DerivedV> igl::dot_row(
  11. const Eigen::PlainObjectBase<DerivedV>& A,
  12. const Eigen::PlainObjectBase<DerivedV>& B
  13. )
  14. {
  15. assert(A.rows() == B.rows());
  16. assert(A.cols() == B.cols());
  17. return (A.array() * B.array()).rowwise().sum();
  18. }
  19. #ifdef IGL_STATIC_LIBRARY
  20. // Explicit template specialization
  21. // generated by autoexplicit.sh
  22. template Eigen::PlainObjectBase<Eigen::Matrix<double, -1, -1, 0, -1, -1> > igl::dot_row<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> > const&);
  23. #endif