2 Copyright 2010 Neil Groves
3 Distributed under the Boost Software License, Version 1.0.
4 (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 [section:inner_product inner_product]
11 template<class SinglePassRange1,
12 class SinglePassRange2,
14 Value inner_product( const SinglePassRange1& rng1,
15 const SinglePassRange2& rng2,
18 template<class SinglePassRange1,
19 class SinglePassRange2,
21 class BinaryOperation1,
22 class BinaryOperation2>
23 Value inner_product( const SinglePassRange1& rng1,
24 const SinglePassRange2& rng2,
27 BinaryOperation2 op2 );
32 `inner_product` calculates a generalised inner product of the range `rng1` and `rng2`.
34 For further information on the `inner_product` algorithm please see __sgi_inner_product__.
38 Defined in the header file `boost/range/numeric.hpp`
40 [heading Requirements]
42 [heading For the first version]
44 # `SinglePassRange1` is a model of the __single_pass_range__ Concept.
45 # `SinglePassRange2` is a model of the __single_pass_range__ Concept.
46 # `Value` is a model of the `AssignableConcept`.
47 # If `x` is an object of type `Value`, `y` is an object of `SinglePassRange1`'s value
48 type, and `z` is an object of `SinglePassRange2`'s value type, then `x + y * z`
50 # The result type of the expression `x + y * z` is convertible to `Value`.
52 [heading For the second version]
54 # `SinglePassRange1` is a model of the __single_pass_range__ Concept.
55 # `SinglePassRange2` is a model of the __single_pass_range__ Concept.
56 # `Value` is a model of the `AssignableConcept`.
57 # `BinaryOperation1` is a model of the `BinaryFunctionConcept`.
58 # `BinaryOperation2` is a model of the `BinaryFunctionConcept`.
59 # The value type of `SinglePassRange1` is convertible to the first argument type of `BinaryOperation2`.
60 # The value type of `SinglePassRange2` is convertible to the second argument type of `BinaryOperation2`.
61 # `Value` is convertible to the value type of `BinaryOperation1`.
62 # The return type of `BinaryOperation2` is convertible to the second argument type of `BinaryOperation1`.
63 # The return type of `BinaryOperation1` is convertible to `Value`.
65 [heading Precondition:]
67 `distance(rng2) >= distance(rng1)` is a valid range.
71 Linear. Exactly `distance(rng)`.