Commit 11e7e0d0 authored by Ted Themistokleous's avatar Ted Themistokleous
Browse files

Remove binary op multiply() and rev_partial_sum from algorithm.hpp

Was added to implement calculate strides() for array creation via shape() but
needed to use forward iterators instead since we didn't implement reverse iterators.

Removing since it's not needed but could be used still if needed.
parent c4d73c7a
......@@ -44,15 +44,6 @@ struct greater
}
};
struct multiplies
{
template<class T>
constexpr T operator()(const T &lhs, const T &rhs) const
{
return lhs * rhs;
}
};
template <class InputIt, class T, class BinaryOperation>
constexpr T accumulate(InputIt first, InputIt last, T init, BinaryOperation op)
{
......@@ -63,24 +54,6 @@ constexpr T accumulate(InputIt first, InputIt last, T init, BinaryOperation op)
return init;
}
template<class InputIt, class OutputIt, class BinaryOperation>
constexpr OutputIt partial_sum(InputIt first, InputIt last,
OutputIt d_first, BinaryOperation op)
{
if (first == last)
return d_first;
typename std::iterator_traits<InputIt>::value_type sum = *first;
*d_first = sum;
while (++first != last)
{
sum = op(std::move(sum), *first); // std::move since C++20
*++d_first = sum;
}
return ++d_first;
}
template <class InputIt, class OutputIt>
constexpr OutputIt copy(InputIt first, InputIt last, OutputIt d_first)
{
......
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