You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should implement a reduce algorithm that will reduce a grb::vector to a single value or reduce a grb::matrix to a single value, or vector by row or column.
We had a long discussion in this week's meeting about the API for reduce, and whether to
Default an initial value to T{}, as in std::reduce
Always require an initial value
Default the initial value to grb::monoid_traits<Fn, T>::identity() when the binary operator passed in is a monoid.
At some point we should implement this full algorithm, but for now I am leaving this unimplemented as it is fairly trivial to use std::reduce at the moment, as shown below.
grb::matrix<float> x = ...;
grb::values_view view(x);
float sum = std::reduce(view.begin(), view.end(), float(0), grb::plus{});
The text was updated successfully, but these errors were encountered:
We should implement a
reduce
algorithm that will reduce agrb::vector
to a single value or reduce agrb::matrix
to a single value, or vector by row or column.We had a long discussion in this week's meeting about the API for reduce, and whether to
T{}
, as instd::reduce
grb::monoid_traits<Fn, T>::identity()
when the binary operator passed in is a monoid.At some point we should implement this full algorithm, but for now I am leaving this unimplemented as it is fairly trivial to use
std::reduce
at the moment, as shown below.The text was updated successfully, but these errors were encountered: