Commit b4c4234d authored by Paul's avatar Paul
Browse files

Fix vec_reduce

parent 172f47f5
...@@ -153,9 +153,9 @@ constexpr auto vec_reduce(T x, Op op) ...@@ -153,9 +153,9 @@ constexpr auto vec_reduce(T x, Op op)
return x; return x;
else else
{ {
vec_type<T> result = 0; vec_type<T> result = x[0];
for(int i = 1; i < vec_size<T>(); i++) for(int i = 1; i < vec_size<T>(); i++)
result = op(x[i - 1], x[i]); result = op(result, x[i]);
return result; return result;
} }
} }
......
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