Commit cdfd266c authored by Hans-Christian Ebke's avatar Hans-Christian Ebke
Browse files

C++11: Using std::inner_product for VectorT::operator|.

parent 14dffb83
......@@ -376,13 +376,10 @@ class VectorT {
/// \see OpenMesh::dot
template<typename OtherScalar>
auto operator|(const VectorT<OtherScalar, DIM>& _rhs) const ->
decltype(this->values_[0] * _rhs[0]) {
decltype(*data() * *_rhs.data()) {
auto p = values_[0] * _rhs[0];
for (int i = 1; i < DIM; ++i) {
p += values_[i] * _rhs[i];
}
return p;
return std::inner_product(data() + 1, data() + DIM, _rhs.data() + 1,
*data() * *_rhs.data());
}
//------------------------------------------------------------ euclidean norm
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment