Skip to content
Snippets Groups Projects
Commit 268c1eac authored by Rainer Kartmann's avatar Rainer Kartmann
Browse files

Reuse mean function

parent f19c1790
No related branches found
No related tags found
No related merge requests found
......@@ -7,6 +7,7 @@
#include <SimoxUtility/error/SimoxError.h>
#include <SimoxUtility/math/mean.h>
namespace simox::math
......@@ -51,13 +52,7 @@ namespace detail
Float mean(const std::vector<Float>& values)
{
detail::check_not_empty(values);
Float sum = 0;
for (Float v : values)
{
sum += v;
}
return sum / values.size();
return simox::math::mean(values.begin(), values.end());
}
template <typename Float>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment