cppreference.com > C++ Algorithms > inner_product inner_product Syntax:
      #include <algorithm>
      TYPE inner_product( iterator start1, iterator end1, iterator start2, TYPE val );
      TYPE inner_product( iterator start1, iterator end1, iterator start2, TYPE val, BinaryFunction f1, BinaryFunction f2 );
The inner_product() function computes the inner product of [start1,end1) and a range of the same size starting at start2. inner_product() runs in linear time. Related topics: accumulate adjacent_difference count partial_sum