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 for the latest Boost documentation.
PrevUpHomeNext

Function inner_product

boost::compute::inner_product

Synopsis

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


template<typename InputIterator1, typename InputIterator2, typename T> 
  T inner_product(InputIterator1 first1, InputIterator1 last1, 
                  InputIterator2 first2, T init, 
                  command_queue & queue = system::default_queue());
template<typename InputIterator1, typename InputIterator2, typename T, 
         typename BinaryAccumulateFunction, typename BinaryTransformFunction> 
  T inner_product(InputIterator1 first1, InputIterator1 last1, 
                  InputIterator2 first2, T init, 
                  BinaryAccumulateFunction accumulate_function, 
                  BinaryTransformFunction transform_function, 
                  command_queue & queue = system::default_queue());

Description

Returns the inner product of the elements in the range [first1, last1) with the elements in the range beginning at first2.

Space complexity: (1)
Space complexity when binary operator is recognized as associative: (n)


PrevUpHomeNext