Warning, /include/c++/v1/__cxx03/numeric is written in an unsupported language. File is not indexed.
0001 // -*- C++ -*-
0002 //===----------------------------------------------------------------------===//
0003 //
0004 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0005 // See https://llvm.org/LICENSE.txt for license information.
0006 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0007 //
0008 //===----------------------------------------------------------------------===//
0009
0010 #ifndef _LIBCPP___CXX03_NUMERIC
0011 #define _LIBCPP___CXX03_NUMERIC
0012
0013 /*
0014 numeric synopsis
0015
0016 namespace std
0017 {
0018
0019 template <class InputIterator, class T>
0020 constexpr T // constexpr since C++20
0021 accumulate(InputIterator first, InputIterator last, T init);
0022
0023 template <class InputIterator, class T, class BinaryOperation>
0024 constexpr T // constexpr since C++20
0025 accumulate(InputIterator first, InputIterator last, T init, BinaryOperation binary_op);
0026
0027 template<class InputIterator>
0028 constexpr typename iterator_traits<InputIterator>::value_type // constexpr since C++20
0029 reduce(InputIterator first, InputIterator last); // C++17
0030
0031 template<class InputIterator, class T>
0032 constexpr T // constexpr since C++20
0033 reduce(InputIterator first, InputIterator last, T init); // C++17
0034
0035 template<class InputIterator, class T, class BinaryOperation>
0036 constexpr T // constexpr since C++20
0037 reduce(InputIterator first, InputIterator last, T init, BinaryOperation binary_op); // C++17
0038
0039 template <class InputIterator1, class InputIterator2, class T>
0040 constexpr T // constexpr since C++20
0041 inner_product(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, T init);
0042
0043 template <class InputIterator1, class InputIterator2, class T, class BinaryOperation1, class BinaryOperation2>
0044 constexpr T // constexpr since C++20
0045 inner_product(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2,
0046 T init, BinaryOperation1 binary_op1, BinaryOperation2 binary_op2);
0047
0048
0049 template<class InputIterator1, class InputIterator2, class T>
0050 constexpr T // constexpr since C++20
0051 transform_reduce(InputIterator1 first1, InputIterator1 last1,
0052 InputIterator2 first2, T init); // C++17
0053
0054 template<class InputIterator1, class InputIterator2, class T, class BinaryOperation1, class BinaryOperation2>
0055 constexpr T // constexpr since C++20
0056 transform_reduce(InputIterator1 first1, InputIterator1 last1,
0057 InputIterator2 first2, T init,
0058 BinaryOperation1 binary_op1, BinaryOperation2 binary_op2); // C++17
0059
0060 template<class InputIterator, class T, class BinaryOperation, class UnaryOperation>
0061 constexpr T // constexpr since C++20
0062 transform_reduce(InputIterator first, InputIterator last, T init,
0063 BinaryOperation binary_op, UnaryOperation unary_op); // C++17
0064
0065 template <class InputIterator, class OutputIterator>
0066 constexpr OutputIterator // constexpr since C++20
0067 partial_sum(InputIterator first, InputIterator last, OutputIterator result);
0068
0069 template <class InputIterator, class OutputIterator, class BinaryOperation>
0070 constexpr OutputIterator // constexpr since C++20
0071 partial_sum(InputIterator first, InputIterator last, OutputIterator result, BinaryOperation binary_op);
0072
0073 template<class InputIterator, class OutputIterator, class T>
0074 constexpr OutputIterator // constexpr since C++20
0075 exclusive_scan(InputIterator first, InputIterator last,
0076 OutputIterator result, T init); // C++17
0077
0078 template<class InputIterator, class OutputIterator, class T, class BinaryOperation>
0079 constexpr OutputIterator // constexpr since C++20
0080 exclusive_scan(InputIterator first, InputIterator last,
0081 OutputIterator result, T init, BinaryOperation binary_op); // C++17
0082
0083 template<class InputIterator, class OutputIterator>
0084 constexpr OutputIterator // constexpr since C++20
0085 inclusive_scan(InputIterator first, InputIterator last, OutputIterator result); // C++17
0086
0087 template<class InputIterator, class OutputIterator, class BinaryOperation>
0088 constexpr OutputIterator // constexpr since C++20
0089 inclusive_scan(InputIterator first, InputIterator last,
0090 OutputIterator result, BinaryOperation binary_op); // C++17
0091
0092 template<class InputIterator, class OutputIterator, class BinaryOperation, class T>
0093 constexpr OutputIterator // constexpr since C++20
0094 inclusive_scan(InputIterator first, InputIterator last,
0095 OutputIterator result, BinaryOperation binary_op, T init); // C++17
0096
0097 template<class InputIterator, class OutputIterator, class T,
0098 class BinaryOperation, class UnaryOperation>
0099 constexpr OutputIterator // constexpr since C++20
0100 transform_exclusive_scan(InputIterator first, InputIterator last,
0101 OutputIterator result, T init,
0102 BinaryOperation binary_op, UnaryOperation unary_op); // C++17
0103
0104 template<class InputIterator, class OutputIterator,
0105 class BinaryOperation, class UnaryOperation>
0106 constexpr OutputIterator // constexpr since C++20
0107 transform_inclusive_scan(InputIterator first, InputIterator last,
0108 OutputIterator result,
0109 BinaryOperation binary_op, UnaryOperation unary_op); // C++17
0110
0111 template<class InputIterator, class OutputIterator,
0112 class BinaryOperation, class UnaryOperation, class T>
0113 constexpr OutputIterator // constexpr since C++20
0114 transform_inclusive_scan(InputIterator first, InputIterator last,
0115 OutputIterator result,
0116 BinaryOperation binary_op, UnaryOperation unary_op,
0117 T init); // C++17
0118
0119 template <class InputIterator, class OutputIterator>
0120 constexpr OutputIterator // constexpr since C++20
0121 adjacent_difference(InputIterator first, InputIterator last, OutputIterator result);
0122
0123 template <class InputIterator, class OutputIterator, class BinaryOperation>
0124 constexpr OutputIterator // constexpr since C++20
0125 adjacent_difference(InputIterator first, InputIterator last, OutputIterator result, BinaryOperation binary_op);
0126
0127 template <class ForwardIterator, class T>
0128 constexpr void // constexpr since C++20
0129 iota(ForwardIterator first, ForwardIterator last, T value);
0130
0131 template <class M, class N>
0132 constexpr common_type_t<M,N> gcd(M m, N n); // C++17
0133
0134 template <class M, class N>
0135 constexpr common_type_t<M,N> lcm(M m, N n); // C++17
0136
0137 template<class T>
0138 constexpr T midpoint(T a, T b) noexcept; // C++20
0139
0140 template<class T>
0141 constexpr T* midpoint(T* a, T* b); // C++20
0142
0143 // [numeric.sat], saturation arithmetic
0144 template<class T>
0145 constexpr T add_sat(T x, T y) noexcept; // freestanding, Since C++26
0146 template<class T>
0147 constexpr T sub_sat(T x, T y) noexcept; // freestanding, Since C++26
0148 template<class T>
0149 constexpr T mul_sat(T x, T y) noexcept; // freestanding, Since C++26
0150 template<class T>
0151 constexpr T div_sat(T x, T y) noexcept; // freestanding, Since C++26
0152 template<class T, class U>
0153 constexpr T saturate_cast(U x) noexcept; // freestanding, Since C++26
0154
0155 } // std
0156
0157 */
0158
0159 #include <__cxx03/__config>
0160
0161 #include <__cxx03/__numeric/accumulate.h>
0162 #include <__cxx03/__numeric/adjacent_difference.h>
0163 #include <__cxx03/__numeric/inner_product.h>
0164 #include <__cxx03/__numeric/iota.h>
0165 #include <__cxx03/__numeric/partial_sum.h>
0166
0167 #if _LIBCPP_STD_VER >= 17
0168 # include <__cxx03/__numeric/exclusive_scan.h>
0169 # include <__cxx03/__numeric/gcd_lcm.h>
0170 # include <__cxx03/__numeric/inclusive_scan.h>
0171 # include <__cxx03/__numeric/pstl.h>
0172 # include <__cxx03/__numeric/reduce.h>
0173 # include <__cxx03/__numeric/transform_exclusive_scan.h>
0174 # include <__cxx03/__numeric/transform_inclusive_scan.h>
0175 # include <__cxx03/__numeric/transform_reduce.h>
0176 #endif
0177
0178 #if _LIBCPP_STD_VER >= 20
0179 # include <__cxx03/__numeric/midpoint.h>
0180 # include <__cxx03/__numeric/saturation_arithmetic.h>
0181 #endif
0182
0183 #include <__cxx03/version>
0184
0185 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
0186 # pragma GCC system_header
0187 #endif
0188
0189 #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 14
0190 # include <__cxx03/initializer_list>
0191 # include <__cxx03/limits>
0192 #endif
0193
0194 #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
0195 # include <__cxx03/climits>
0196 # include <__cxx03/cmath>
0197 # include <__cxx03/concepts>
0198 # include <__cxx03/cstdint>
0199 # include <__cxx03/execution>
0200 # include <__cxx03/functional>
0201 # include <__cxx03/iterator>
0202 # include <__cxx03/new>
0203 # include <__cxx03/optional>
0204 # include <__cxx03/type_traits>
0205 #endif
0206
0207 #endif // _LIBCPP___CXX03_NUMERIC