3#ifndef TETL_NUMERIC_PARTIAL_SUM_HPP
4#define TETL_NUMERIC_PARTIAL_SUM_HPP
6#include <etl/_functional/plus.hpp>
7#include <etl/_utility/move.hpp>
24template <
typename InputIt,
typename OutputIt,
typename BinaryOperation>
25constexpr auto partial_sum(InputIt first, InputIt last, OutputIt destination, BinaryOperation op) -> OutputIt
34 while (++first != last) {
35 sum = op(
etl::move(sum), *first);
43template <
typename InputIt,
typename OutputIt>
44constexpr auto partial_sum(InputIt first, InputIt last, OutputIt destination) -> OutputIt
46 return etl::partial_sum(first, last, destination,
etl::
plus<>());
constexpr auto partial_sum(InputIt first, InputIt last, OutputIt destination) -> OutputIt
Definition partial_sum.hpp:44
constexpr auto partial_sum(InputIt first, InputIt last, OutputIt destination, BinaryOperation op) -> OutputIt
Computes the partial sums of the elements in the subranges of the range [first, last) and writes them...
Definition partial_sum.hpp:25
Definition adjacent_find.hpp:9
Function object for performing addition. Effectively calls operator+ on two instances of type T....
Definition plus.hpp:15