Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext

Function template transform

boost::compute::transform

Synopsis

// In header: <boost/compute/algorithm/transform.hpp>


template<typename InputIterator, typename OutputIterator, 
         typename UnaryOperator> 
  OutputIterator 
  transform(InputIterator first, InputIterator last, OutputIterator result, 
            UnaryOperator op, 
            command_queue & queue = system::default_queue());

Description

Transforms the elements in the range [first, last) using operator op and stores the results in the range beginning at result.

For example, to calculate the absolute value for each element in a vector:


Space complexity: \Omega(1)

See Also:

copy()


PrevUpHomeNext