Bolt  1.3
C++ template library with support for OpenCL
Functions
AMP-Transformed Prefix Sums

Functions

template<typename InputIterator , typename OutputIterator , typename UnaryFunction , typename BinaryFunction >
OutputIterator bolt::amp::transform_inclusive_scan (control &ctl, InputIterator first, InputIterator last, OutputIterator result, UnaryFunction unary_op, BinaryFunction binary_op)
 transform_inclusive_scan performs, on a sequence, the transformation defined by a unary operator, then the inclusive scan defined by a binary operator.
 
template<typename InputIterator , typename OutputIterator , typename UnaryFunction , typename BinaryFunction >
OutputIterator bolt::amp::transform_inclusive_scan (InputIterator first, InputIterator last, OutputIterator result, UnaryFunction unary_op, BinaryFunction binary_op)
 
template<typename InputIterator , typename OutputIterator , typename UnaryFunction , typename T , typename BinaryFunction >
OutputIterator bolt::amp::transform_exclusive_scan (control &ctl, InputIterator first, InputIterator last, OutputIterator result, UnaryFunction unary_op, T init, BinaryFunction binary_op)
 transform_exclusive_scan performs, on a sequence, the transformation defined by a unary operator, then the exclusive scan defined by a binary operator.
 
template<typename InputIterator , typename OutputIterator , typename UnaryFunction , typename T , typename BinaryFunction >
OutputIterator bolt::amp::transform_exclusive_scan (InputIterator first, InputIterator last, OutputIterator result, UnaryFunction unary_op, T init, BinaryFunction binary_op)
 

Detailed Description

Function Documentation

template<typename InputIterator , typename OutputIterator , typename UnaryFunction , typename T , typename BinaryFunction >
OutputIterator bolt::amp::transform_exclusive_scan ( control &  ctl,
InputIterator  first,
InputIterator  last,
OutputIterator  result,
UnaryFunction  unary_op,
init,
BinaryFunction  binary_op 
)

transform_exclusive_scan performs, on a sequence, the transformation defined by a unary operator, then the exclusive scan defined by a binary operator.

Parameters
ctlOptional Bolt control object, to describe the environment under which the function runs.
firstThe first element of the input sequence.
lastThe last element of the input sequence.
resultThe first element of the output sequence.
unary_opUnary operator for transformation.
initThe value used to initialize the output scan sequence.
binary_opBinary operator for scanning transformed elements.
Template Parameters
InputIteratoris a model of Input Iterator.
OutputIteratoris a model of Output Iterator.
UnaryFunctionis a model of Unary Function which takes as input InputIterator's value_type and whose return type is convertible to BinaryFunction's input types.
Tis convertible to OutputIterator's value_type.
BinaryFunctionis a model of Binary Function which takes as input two values convertible from UnaryFunction's return type and whose return type is convertible to OutputIterator's value_type.
Returns
result+(last-first).
...
bolt::amp::square<int> sqInt;
...
int a[10] = {1, -2, 3, -4, 5, -6, 7, -8, 9, -10};
bolt::amp::transform_exclusive_scan( ctrl, a, a+10, a, sqInt, 0, plInt );
// a => { 0, 1, 5, 14, 30, 55, 91, 140, 204, 285}
See Also
transform
exclusive_scan
http://www.sgi.com/tech/stl/transform.html
http://www.sgi.com/tech/stl/partial_sum.html
http://www.sgi.com/tech/stl/InputIterator.html
http://www.sgi.com/tech/stl/OutputIterator.html
http://www.sgi.com/tech/stl/UnaryFunction.html
http://www.sgi.com/tech/stl/BinaryFunction.html
template<typename InputIterator , typename OutputIterator , typename UnaryFunction , typename BinaryFunction >
OutputIterator bolt::amp::transform_inclusive_scan ( control &  ctl,
InputIterator  first,
InputIterator  last,
OutputIterator  result,
UnaryFunction  unary_op,
BinaryFunction  binary_op 
)

transform_inclusive_scan performs, on a sequence, the transformation defined by a unary operator, then the inclusive scan defined by a binary operator.

Parameters
ctlOptional Bolt control object, to describe the environment under which the function runs.
firstThe first element of the input sequence.
lastThe last element of the input sequence.
resultThe first element of the output sequence.
unary_opUnary operator for transformation.
binary_opBinary operator for scanning transformed elements.
Template Parameters
InputIteratoris a model of Input Iterator.
OutputIteratoris a model of Output Iterator.
UnaryFunctionis a model of Unary Function which takes as input InputIterator's value_type and whose return type is convertible to BinaryFunction's input types.
BinaryFunctionis a model of Binary Function which takes as input two values convertible from UnaryFunction's return type and whose return type is convertible to OutputIterator's value_type.
Returns
result+(last-first).
...
bolt::amp::square<int> sqInt;
...
int a[10] = {1, -2, 3, -4, 5, -6, 7, -8, 9, -10};
bolt::amp::transform_inclusive_scan( ctrl, a, a+10, a, sqInt, plInt );
// a => {1, 5, 14, 30, 55, 91, 140, 204, 285, 385}
See Also
transform
inclusive_scan
http://www.sgi.com/tech/stl/transform.html
http://www.sgi.com/tech/stl/partial_sum.html
http://www.sgi.com/tech/stl/InputIterator.html
http://www.sgi.com/tech/stl/OutputIterator.html
http://www.sgi.com/tech/stl/UnaryFunction.html
http://www.sgi.com/tech/stl/BinaryFunction.html