]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/range/doc/reference/numeric/partial_sum.qbk
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / range / doc / reference / numeric / partial_sum.qbk
1 [/
2 Copyright 2010 Neil Groves
3 Distributed under the Boost Software License, Version 1.0.
4 (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5 /]
6 [section:partial_sum partial_sum]
7
8 [heading Prototype]
9
10 ``
11 template<class SinglePassRange,
12 class OutputIterator>
13 OutputIterator partial_sum(const SinglePassRange& rng,
14 OutputIterator out_it);
15
16 template<class SinglePassRange,
17 class OutputIterator,
18 class BinaryOperation>
19 OutputIterator partial_sum(const SinglePassRange& rng,
20 OutputIterator out_it,
21 BinaryOperation op);
22 ``
23
24 [heading Description]
25
26 `partial_sum` calculates a generalised partial sum of `rng` in the same manner as
27 `std::partial_sum(boost::begin(rng), boost::end(rng), out_it)`. See __sgi_partial_sum__.
28
29
30 [heading Definition]
31
32 Defined in the header file `boost/range/numeric.hpp`
33
34 [heading Requirements]
35
36 [heading For the first version]
37
38 # `SinglePassRange` is a model of the __single_pass_range__ Concept.
39 # `OutputIterator` is a model of the `OutputIteratorConcept`.
40 # If `x` and `y` are objects of `SinglePassRange`'s value type, then `x + y` is defined.
41 # The return type of `x + y` is convertible to the value type of `SinglePassRange`.
42 # The value type of `SinglePassRange` is convertible to a type in `OutputIterator`'s set of value types.
43
44 [heading For the second version]
45
46 # `SinglePassRange` is a model of the __single_pass_range__ Concept.
47 # `OutputIterator` is a model of the `OutputIteratorConcept`.
48 # `BinaryOperation` is a model of the `BinaryFunctionConcept`.
49 # The result type of `BinaryOperation` is convertible to the value type of `SinglePassRange`.
50 # The value type of `SinglePassRange` is convertible to a type in `OutputIterator`'s set of value types.
51
52 [heading Precondition:]
53
54 `[result, result + distance(rng))` is a valid range.
55
56 [heading Complexity]
57
58 Linear. If `empty(rng)` then zero applications, otherwise `distance(rng) - 1` applications are performed.
59
60 [endsect]