Simple-Vector v1.3.0
Algorithm

Functions

template<std::ranges::input_range TRange, std::weakly_incrementable TOut, std::copy_constructible TUnaryOp>
constexpr void sl::vec::transform_unseq (TRange &&range, TOut result, TUnaryOp unaryOp)
 Applies the given unary operation to each element and writes into result. More...
 
template<std::ranges::input_range TRange1, std::ranges::input_range TRange2, std::weakly_incrementable TOut, std::copy_constructible TBinaryOp>
constexpr void sl::vec::transform_unseq (TRange1 &&range1, TRange2 &&range2, TOut result, TBinaryOp binaryOp)
 Applies the given unary operation to each element and writes into result. More...
 
template<std::ranges::input_range TRange, std::move_constructible T, std::copy_constructible TBinaryOp, std::copy_constructible TUnaryOp>
constexpr T sl::vec::transform_reduce_unseq (TRange &&range, T init, TBinaryOp binaryOp, TUnaryOp unaryOp)
 Applies the unaryOp to each elements from the range and reduces the results (possibly permuted and aggregated unspecified manner) along with the initial value init over binaryOp. More...
 
template<std::ranges::input_range TRange1, std::ranges::input_range TRange2, std::move_constructible T, std::copy_constructible TBinaryOp1, std::copy_constructible TBinaryOp2>
constexpr T sl::vec::transform_reduce_unseq (TRange1 &&range1, TRange2 &&range2, T init, TBinaryOp1 binaryOp1, TBinaryOp2 binaryOp2)
 Applies the binaryOp2 to each pair of elements from both ranges and reduces the results (possibly permuted and aggregated unspecified manner) along with the initial value init over binaryOp1. More...
 

Detailed Description

Function Documentation

◆ transform_reduce_unseq() [1/2]

template<std::ranges::input_range TRange, std::move_constructible T, std::copy_constructible TBinaryOp, std::copy_constructible TUnaryOp>
constexpr T sl::vec::transform_reduce_unseq ( TRange &&  range,
init,
TBinaryOp  binaryOp,
TUnaryOp  unaryOp 
)
constexpr

Applies the unaryOp to each elements from the range and reduces the results (possibly permuted and aggregated unspecified manner) along with the initial value init over binaryOp.

Template Parameters
TRangeType of range
Tresult type
TBinaryOpType of binary operation
TUnaryOpType of unary operation
Parameters
rangesource range1
initinitial value
binaryOpbinary operation applied to the results of unaryOp along with the initial value
unaryOpunary operation applied to each elements from the range

This functions serves as a convenient wrapper, which is used for enabling constexpr when possible and otherwise use the potentially benefit of vectorization. If this function is called in a non-constant-evaluated context it uses the std::execution::unseq policy. Due to the lack of a constexpr declaration of these overload, this function will otherwise fallback to the std::transform_reduce algorithm. For further details read here: https://en.cppreference.com/w/cpp/algorithm/execution_policy_tag_t

◆ transform_reduce_unseq() [2/2]

template<std::ranges::input_range TRange1, std::ranges::input_range TRange2, std::move_constructible T, std::copy_constructible TBinaryOp1, std::copy_constructible TBinaryOp2>
constexpr T sl::vec::transform_reduce_unseq ( TRange1 &&  range1,
TRange2 &&  range2,
init,
TBinaryOp1  binaryOp1,
TBinaryOp2  binaryOp2 
)
constexpr

Applies the binaryOp2 to each pair of elements from both ranges and reduces the results (possibly permuted and aggregated unspecified manner) along with the initial value init over binaryOp1.

Template Parameters
TRange1Type of range1
TRange2Type of range2
Tresult type
TBinaryOp1Type of inner binary operation
TBinaryOp2Type of outer binary operation
Parameters
range1source range1
range2source range2
initinitial value
binaryOp1binary operation applied to the results of binaryOp2 along with the initial value
binaryOp2binary operation applied to each pair of elements from both ranges

This functions serves as a convenient wrapper, which is used for enabling constexpr when possible and otherwise use the potentially benefit of vectorization. If this function is called in a non-constant-evaluated context it uses the std::execution::unseq policy. Due to the lack of a constexpr declaration of these overload, this function will otherwise fallback to the std::transform_reduce algorithm. For further details read here: https://en.cppreference.com/w/cpp/algorithm/execution_policy_tag_t

◆ transform_unseq() [1/2]

template<std::ranges::input_range TRange, std::weakly_incrementable TOut, std::copy_constructible TUnaryOp>
constexpr void sl::vec::transform_unseq ( TRange &&  range,
TOut  result,
TUnaryOp  unaryOp 
)
constexpr

Applies the given unary operation to each element and writes into result.

Template Parameters
TRangeType of range
TOutresult destination
TUnaryOpType of unary operation
Parameters
rangesource range
resultdestination where the result will be written to
unaryOpunary operation applied to each element of the source range

This functions serves as a convenient wrapper, which is used for enabling constexpr when possible and otherwise use the potentially benefit of vectorization. If this function is called in a non-constant-evaluated context it uses the std::execution::unseq policy. Due to the lack of a constexpr declaration of these overload, this function will otherwise fallback to the std::ranges::transform algorithm. For further details read here: https://en.cppreference.com/w/cpp/algorithm/execution_policy_tag_t

◆ transform_unseq() [2/2]

template<std::ranges::input_range TRange1, std::ranges::input_range TRange2, std::weakly_incrementable TOut, std::copy_constructible TBinaryOp>
constexpr void sl::vec::transform_unseq ( TRange1 &&  range1,
TRange2 &&  range2,
TOut  result,
TBinaryOp  binaryOp 
)
constexpr

Applies the given unary operation to each element and writes into result.

Template Parameters
TRange1Type of range1
TRange2Type of range2
TOutresult destination
TBinaryOpType of binary operation
Parameters
range1source range1
range2source range2
resultdestination where the result will be written to
binaryOpbinary operation applied to each pair of elements of both source ranges

This functions serves as a convenient wrapper, which is used for enabling constexpr when possible and otherwise use the potentially benefit of vectorization. If this function is called in a non-constant-evaluated context it uses the std::execution::unseq policy. Due to the lack of a constexpr declaration of these overload, this function will otherwise fallback to the std::ranges::transform algorithm. For further details read here: https://en.cppreference.com/w/cpp/algorithm/execution_policy_tag_t