| Home | Libraries | People | FAQ | More

## 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: \Omega(1)
Space complexity when binary operator is recognized as associative: \Omega(n)