Standard C++ Library Reference ISO/IEC (VERSION3)
New
<numeric>
Include the STL standard header <numeric> to define several template functions useful for
computing numeric values. The descriptions of these templates employ a number of
conventions common to all algorithms.
namespace std {
template<class InIt, class Ty>
Ty accumulate(InIt first, InIt last, Ty val);
template<class InIt, class Ty, class Fn2>
Ty accumulate(InIt first, InIt last, Ty val, Fn2 func);
template<class InIt1, class InIt2, class Ty>
Ty inner_product(InIt1 first1, InIt1 last1,
Init2 first2, Ty val);
template<class InIt1, class InIt2, class Ty,
class Fn21, class Fn22>
Ty inner_product(InIt1 first1, InIt1 last1,
Init2 first2, Ty val, Fn21 func1, Fn22 func2);
template<class InIt, class OutIt>
OutIt partial_sum(InIt first, InIt last,
OutIt result);
template<class InIt, class OutIt, class Fn2>
OutIt partial_sum(InIt first, InIt last,
OutIt result, Fn2 func);
template<class InIt, class OutIt>
OutIt adjacent_difference(InIt first, InIt last,
OutIt result);
template<class InIt, class OutIt, class Fn2>
OutIt adjacent_difference(InIt first, InIt last,
OutIt result, Fn2 func);
};
accumulate
template<class InIt, class Ty>
Ty accumulate(InIt first, InIt last, Ty val);
template<class InIt, class Ty, class Fn2>
Ty accumulate(InIt first, InIt last, Ty val, Fn2 func);