当前头文件是数值库(Numeric library)的部分内容。

数值库(参考手册) ​数值库(标准)

  • iota C++11 将顺序递增(Sequentially increasing)的值填充到指定范围 [first,last) 的元素中
    accumulate 累加(Sums up)指定范围的元素
    inner_product 计算两个范围的内积(Inner product)
    adjacent_difference 计算范围中相邻元素的差(Difference)
    partial_sum 计算范围中的元素的部分和
  • namespace std {
        template <class InputIterator, class T>
            T accumulate(InputIterator first, InputIterator last, T init);
        template <class InputIterator, class T, class BinaryOperation>
            T accumulate(InputIterator first, InputIterator last, T init,
                BinaryOperation binary_op);
     
        template <class InputIterator1, class InputIterator2, class T>
            T inner_product(InputIterator1 first1, InputIterator1 last1,
                InputIterator2 first2, T init);
        template <class InputIterator1, class InputIterator2, class T,
                class BinaryOperation1, class BinaryOperation2>
            T inner_product(InputIterator1 first1, InputIterator1 last1,
                InputIterator2 first2, T init,
                BinaryOperation1 binary_op1,
                BinaryOperation2 binary_op2);
     
        template <class InputIterator, class OutputIterator>
            OutputIterator partial_sum(InputIterator first,
                InputIterator last,
                OutputIterator result);
        template <class InputIterator, class OutputIterator,
                class BinaryOperation>
            OutputIterator partial_sum(InputIterator first,
                InputIterator last,
                OutputIterator result,
                BinaryOperation binary_op);
        template <class InputIterator, class OutputIterator>
            OutputIterator adjacent_difference(InputIterator first,
                InputIterator last,
                OutputIterator result);
        template <class InputIterator, class OutputIterator,
                class BinaryOperation>
            OutputIterator adjacent_difference(InputIterator first,
                InputIterator last,
                OutputIterator result,
                BinaryOperation binary_op);
     
        template <class ForwardIterator, class T>
            void iota(ForwardIterator first, ForwardIterator last, T value);
    }