A.2.10. Numeric Algorithms
The numeric algorithms are defined in the numeric header. These algorithms require input iterators; if the algorithm writes output, it uses an output iterator for the destination.
accumulate(beg, end, init)accumulate(beg, end, init, binaryOp)
Returns the sum of all the values in the input range. The summation starts with the initial value specified by init. The return type is the same type as the type of init. The first version applies the + operator for the element type; the second version applies the specified binary operation.
inner_product(beg1, end1, beg2, init)inner_product(beg1, end1, beg2, init, binOp1, binOp2)
Returns the sum of the elements generated as the product of two sequences. The two sequences are processed ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access