|
template<typename Type> |
constexpr auto | abs (Type input) noexcept -> Type |
| Returns the absolute value.
|
|
template<typename InputIt, typename Type> |
constexpr auto | accumulate (InputIt first, InputIt last, Type init) noexcept -> Type |
| Computes the sum of the given value init and the elements in the range [first, last) .
|
|
template<typename InputIt, typename Type, typename BinaryOperation> |
constexpr auto | accumulate (InputIt first, InputIt last, Type init, BinaryOperation op) noexcept -> Type |
| Computes the sum of the given value init and the elements in the range [first, last) .
|
|
template<etl::builtin_integer Int> |
constexpr auto | add_sat (Int x, Int y) noexcept -> Int |
|
template<typename InputIt, typename OutputIt> |
constexpr auto | adjacent_difference (InputIt first, InputIt last, OutputIt destination) -> OutputIt |
|
template<typename InputIt, typename OutputIt, typename BinaryOperation> |
constexpr auto | adjacent_difference (InputIt first, InputIt last, OutputIt destination, BinaryOperation op) -> OutputIt |
| Computes the differences between the second and the first of each adjacent pair of elements of the range [first, last) and writes them to the range beginning at destination + 1. An unmodified copy of *first is written to *destination.
|
|
template<builtin_integer Int> |
constexpr auto | div_sat (Int x, Int y) noexcept -> Int |
| Computes the saturating division x / y.
|
|
template<typename M, typename N> |
constexpr auto | gcd (M m, N n) noexcept -> etl::common_type_t< M, N > |
| Computes the greatest common divisor of the integers m and n.
|
|
template<typename InputIt1, typename InputIt2, typename T> |
constexpr auto | inner_product (InputIt1 first1, InputIt1 last1, InputIt2 first2, T init) -> T |
| Computes inner product (i.e. sum of products) or performs ordered map/reduce operation on the range [first1, last1) and the range beginning at first2.
|
|
template<typename InputIt1, typename InputIt2, typename T, typename BinaryOperation1, typename BinaryOperation2> |
constexpr auto | inner_product (InputIt1 first1, InputIt1 last1, InputIt2 first2, T init, BinaryOperation1 op1, BinaryOperation2 op2) -> T |
|
template<typename ForwardIt, typename T> |
constexpr auto | iota (ForwardIt first, ForwardIt last, T value) -> void |
| Fills the range [first, last) with sequentially increasing values, starting with value and repetitively evaluating ++value.
|
|
template<typename M, typename N>
requires (is_integral_v<M> and not is_same_v<M, bool> and is_integral_v<N> and not is_same_v<N, bool>) |
constexpr auto | lcm (M m, N n) -> common_type_t< M, N > |
| Computes the least common multiple of the integers m and n.
|
|
template<etl::floating_point Float> |
constexpr auto | midpoint (Float a, Float b) noexcept -> Float |
|
template<typename Int>
requires (etl::is_integral_v<Int> and not etl::is_same_v<Int, bool>) |
constexpr auto | midpoint (Int a, Int b) noexcept -> Int |
| Returns half the sum of a + b. If the sum is odd, the result is rounded towards a.
|
|
template<typename Ptr>
requires etl::is_pointer_v<Ptr> |
constexpr auto | midpoint (Ptr a, Ptr b) noexcept -> Ptr |
|
template<typename InputIt, typename OutputIt> |
constexpr auto | partial_sum (InputIt first, InputIt last, OutputIt destination) -> OutputIt |
|
template<typename InputIt, typename OutputIt, typename BinaryOperation> |
constexpr auto | partial_sum (InputIt first, InputIt last, OutputIt destination, BinaryOperation op) -> OutputIt |
| Computes the partial sums of the elements in the subranges of the range [first, last) and writes them to the range beginning at destination. This version uses the given binary function op, both applying etl::move to their operands on the left hand side.
|
|
template<typename InputIter> |
constexpr auto | reduce (InputIter first, InputIter last) -> typename etl::iterator_traits< InputIter >::value_type |
| Similar to etl::accumulate.
|
|
template<typename InputIter, typename T> |
constexpr auto | reduce (InputIter first, InputIter last, T init) -> T |
| Similar to etl::accumulate.
|
|
template<typename InputIter, typename T, typename BinaryOp> |
constexpr auto | reduce (InputIter first, InputIter last, T init, BinaryOp op) -> T |
| Similar to etl::accumulate.
|
|
template<builtin_integer To, builtin_integer From> |
constexpr auto | saturate_cast (From x) noexcept -> To |
| Converts the value x to a value of type T, clamping x between the minimum and maximum values of type T.
|
|
template<typename InputIt, typename T, typename BinaryReductionOp, typename UnaryTransformOp> |
constexpr auto | transform_reduce (InputIt first, InputIt last, T init, BinaryReductionOp reduce, UnaryTransformOp transform) -> T |
| https://en.cppreference.com/w/cpp/algorithm/transform_reduce
|
|
template<typename InputIt1, typename InputIt2, typename T> |
constexpr auto | transform_reduce (InputIt1 first1, InputIt1 last1, InputIt2 first2, T init) -> T |
| https://en.cppreference.com/w/cpp/algorithm/transform_reduce
|
|
template<typename InputIt1, typename InputIt2, typename T, typename BinaryReductionOp, typename BinaryTransformOp> |
constexpr auto | transform_reduce (InputIt1 first1, InputIt1 last1, InputIt2 first2, T init, BinaryReductionOp reduce, BinaryTransformOp transform) -> T |
| https://en.cppreference.com/w/cpp/algorithm/transform_reduce
|
|
Numeric operations on values in ranges.