Skip to content

Commit 00c6f1d

Browse files
authored
Merge pull request #103 from jgopel/transform-inclusive-scan-docs
Add documentation to transform_inclusive_scan and transform_exclusive_scan
2 parents da8ea58 + 6b7a38f commit 00c6f1d

File tree

3 files changed

+54
-2
lines changed

3 files changed

+54
-2
lines changed

Diff for: doc/algorithm.qbk

+10-2
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,16 @@ Generate an increasing series
106106
Apply a functor to the elements of a sequence
107107
[endsect:for_each_n]
108108

109+
[section:transform_inclusive_scan transform_inclusive_scan]
110+
[*[^[link boost.algorithm.transform_inclusive_scan transform_inclusive_scan] ] ]
111+
Transform each element in a range then combine adjacent elements to create an output range. Inclusive scaning means that the nth input is present in the nth output.
112+
[endsect:transform_inclusive_scan]
113+
114+
[section:transform_exclusive_scan transform_exclusive_scan]
115+
[*[^[link boost.algorithm.transform_exclusive_scan transform_exclusive_scan] ] ]
116+
Transform each element in a range then combine adjacent elements to create an output range. Exclusive scanning means that the nth input is not present in the nth output.
117+
[endsect:transform_exclusive_scan]
118+
109119
[endsect:CXX17_inner_algorithms]
110120

111121
[endsect:CXX17]
@@ -234,8 +244,6 @@ Raise a value to an integral power ([^constexpr] since C++14)
234244
* [*[^[link header.boost.algorithm.cxx17.exclusive_scan_hpp exclusive_scan] ] ]
235245
* [*[^[link header.boost.algorithm.cxx17.inclusive_scan_hpp inclusive_scan] ] ]
236246
* [*[^[link header.boost.algorithm.cxx17.reduce_hpp reduce] ] ]
237-
* [*[^[link header.boost.algorithm.cxx17.transform_exclusive_scan_hpp transform_exclusive_scan] ] ]
238-
* [*[^[link header.boost.algorithm.cxx17.transform_inclusive_scan_hpp transform_inclusive_scan] ] ]
239247
* [*[^[link header.boost.algorithm.cxx17.transform_reduce_hpp transform_reduce] ] ]
240248

241249
[endsect:not_yet_documented_cxx17_algos]

Diff for: include/boost/algorithm/cxx17/transform_exclusive_scan.hpp

+15
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,21 @@
2222

2323
namespace boost { namespace algorithm {
2424

25+
/// \fn transform_exclusive_scan ( InputIterator first, InputIterator last, OutputIterator result, BinaryOperation bOp, UnaryOperation uOp, T init )
26+
/// \brief Transforms elements from the input range with uOp and then combines
27+
/// those transformed elements with bOp such that the n-1th element and the nth
28+
/// element are combined. Exclusivity means that the nth element is not
29+
/// included in the nth combination.
30+
/// \return The updated output iterator
31+
///
32+
/// \param first The start of the input sequence
33+
/// \param last The end of the input sequence
34+
/// \param result The output iterator to write the results into
35+
/// \param bOp The operation for combining transformed input elements
36+
/// \param uOp The operation for transforming input elements
37+
/// \param init The initial value
38+
///
39+
/// \note This function is part of the C++17 standard library
2540
template<class InputIterator, class OutputIterator, class T,
2641
class BinaryOperation, class UnaryOperation>
2742
OutputIterator transform_exclusive_scan(InputIterator first, InputIterator last,

Diff for: include/boost/algorithm/cxx17/transform_inclusive_scan.hpp

+29
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,21 @@
2222

2323
namespace boost { namespace algorithm {
2424

25+
/// \fn transform_inclusive_scan ( InputIterator first, InputIterator last, OutputIterator result, BinaryOperation bOp, UnaryOperation uOp, T init )
26+
/// \brief Transforms elements from the input range with uOp and then combines
27+
/// those transformed elements with bOp such that the n-1th element and the nth
28+
/// element are combined. Inclusivity means that the nth element is included in
29+
/// the nth combination.
30+
/// \return The updated output iterator
31+
///
32+
/// \param first The start of the input sequence
33+
/// \param last The end of the input sequence
34+
/// \param result The output iterator to write the results into
35+
/// \param bOp The operation for combining transformed input elements
36+
/// \param uOp The operation for transforming input elements
37+
/// \param init The initial value
38+
///
39+
/// \note This function is part of the C++17 standard library
2540
template<class InputIterator, class OutputIterator,
2641
class BinaryOperation, class UnaryOperation, class T>
2742
OutputIterator transform_inclusive_scan(InputIterator first, InputIterator last,
@@ -37,6 +52,20 @@ OutputIterator transform_inclusive_scan(InputIterator first, InputIterator last,
3752
return result;
3853
}
3954

55+
/// \fn transform_inclusive_scan ( InputIterator first, InputIterator last, OutputIterator result, BinaryOperation bOp, UnaryOperation uOp, T init )
56+
/// \brief Transforms elements from the input range with uOp and then combines
57+
/// those transformed elements with bOp such that the n-1th element and the nth
58+
/// element are combined. Inclusivity means that the nth element is included in
59+
/// the nth combination. The first value will be used as the init.
60+
/// \return The updated output iterator
61+
///
62+
/// \param first The start of the input sequence
63+
/// \param last The end of the input sequence
64+
/// \param result The output iterator to write the results into
65+
/// \param bOp The operation for combining transformed input elements
66+
/// \param uOp The operation for transforming input elements
67+
///
68+
/// \note This function is part of the C++17 standard library
4069
template<class InputIterator, class OutputIterator,
4170
class BinaryOperation, class UnaryOperation>
4271
OutputIterator transform_inclusive_scan(InputIterator first, InputIterator last,

0 commit comments

Comments
 (0)