1
0
Fork 0
mirror of https://github.com/bolero-MURAKAMI/Sprout synced 2025-08-03 12:49:50 +00:00

add range::unstable_accumulate, range::unstable_inner_product

This commit is contained in:
bolero-MURAKAMI 2012-12-22 22:06:21 +09:00
parent 26dd9dabca
commit 6a6fc03806
3 changed files with 58 additions and 0 deletions

View file

@ -0,0 +1,26 @@
#ifndef SPROUT_RANGE_NUMERIC_UNSTABLE_ACCUMLATE_HPP
#define SPROUT_RANGE_NUMERIC_UNSTABLE_ACCUMLATE_HPP
#include <sprout/config.hpp>
#include <sprout/numeric/unstable_accumulate.hpp>
namespace sprout {
namespace range {
//
// unstable_accumulate
//
template<typename Range, typename T, typename BinaryOperation>
inline SPROUT_CONSTEXPR T
unstable_accumulate(Range const& range, T init, BinaryOperation binary_op) {
return sprout::unstable_accumulate(sprout::begin(range), sprout::end(range), init, binary_op);
}
template<typename Range, typename T>
inline SPROUT_CONSTEXPR T
unstable_accumulate(Range const& range, T init) {
return sprout::unstable_accumulate(sprout::begin(range), sprout::end(range), init);
}
} // namespace range
} // namespace sprout
#endif // #ifndef SPROUT_RANGE_NUMERIC_UNSTABLE_ACCUMLATE_HPP