inner_product

template<class InIt1, class InIt2, class T>
    T inner_product(InIt1 first1, InIt1 last1,
        Init2 first2, T val);
template<class InIt1, class InIt2, class T,
    class Pred1, class Pred2>
    T inner_product(InIt1 first1, InIt1 last1,
        Init2 first2, T val, Pred1 pr1, Pred2 pr2);

The first template function repeatedly replaces val with val + (*I1 * *I2), for each value of the InIt1 iterator I1 in the interval [first1, last2). In each case, the InIt2 iterator I2 equals first2 + (I1 - first1). The function returns val.

The second template function repeatedly replaces val with pr1(val, pr2(*I1, *I2)), for each value of the InIt1 iterator I1 in the interval [first1, last2). In each case, the InIt2 iterator I2 equals first2 + (I1 - first1). The function returns val.