Commit f4046e4d authored by Janis Born's avatar Janis Born
Browse files

fix some uses of const begin and end iterators

parent 011fdc97
Pipeline #459 passed with stage
...@@ -473,7 +473,7 @@ class VectorT { ...@@ -473,7 +473,7 @@ class VectorT {
/// compute L1 (Manhattan) norm /// compute L1 (Manhattan) norm
Scalar l1_norm() const { Scalar l1_norm() const {
return std::accumulate( return std::accumulate(
values_.cbegin() + 1, values_.end(), values_[0]); values_.cbegin() + 1, values_.cend(), values_[0]);
} }
/// compute l8_norm /// compute l8_norm
...@@ -523,7 +523,7 @@ class VectorT { ...@@ -523,7 +523,7 @@ class VectorT {
/// return absolute arithmetic mean /// return absolute arithmetic mean
Scalar mean_abs() const { Scalar mean_abs() const {
return std::accumulate(values_.cbegin() + 1, values_.end(), return std::accumulate(values_.cbegin() + 1, values_.cend(),
std::abs(values_[0]), std::abs(values_[0]),
[](const Scalar &l, const Scalar &r) { [](const Scalar &l, const Scalar &r) {
return l + std::abs(r); return l + std::abs(r);
......
Supports Markdown
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