KFR

Selection functions

min

template<typename T1, typename T2, KFR_ENABLE_IF(is_numeric_args<T1, T2>::value), typename Tout = common_type<T1, T2>>
Tout min(const T1 &x, const T2 &y)

Returns the smaller of two values.

Source:

template <typename T1, typename T2, KFR_ENABLE_IF(is_numeric_args<T1, T2>::value),
          typename Tout = common_type<T1, T2>>
KFR_INTRIN Tout min(const T1& x, const T2& y)
template<typename E1, typename E2, KFR_ENABLE_IF(is_input_expressions<E1, E2>::value)>
internal::expression_function<fn::min, E1, E2> min(E1 &&x, E2 &&y)

Returns template expression that returns the smaller of two values.

Source:

template <typename E1, typename E2, KFR_ENABLE_IF(is_input_expressions<E1, E2>::value)>
KFR_INTRIN internal::expression_function<fn::min, E1, E2> min(E1&& x, E2&& y)

max

template<typename T1, typename T2, KFR_ENABLE_IF(is_numeric_args<T1, T2>::value), typename Tout = common_type<T1, T2>>
Tout max(const T1 &x, const T2 &y)

Returns the greater of two values.

Source:

template <typename T1, typename T2, KFR_ENABLE_IF(is_numeric_args<T1, T2>::value),
          typename Tout = common_type<T1, T2>>
KFR_INTRIN Tout max(const T1& x, const T2& y)
template<typename E1, typename E2, KFR_ENABLE_IF(is_input_expressions<E1, E2>::value)>
internal::expression_function<fn::max, E1, E2> max(E1 &&x, E2 &&y)

Returns template expression that returns the greater of two values.

Source:

template <typename E1, typename E2, KFR_ENABLE_IF(is_input_expressions<E1, E2>::value)>
KFR_INTRIN internal::expression_function<fn::max, E1, E2> max(E1&& x, E2&& y)

absmin

template<typename T1, typename T2, KFR_ENABLE_IF(is_numeric_args<T1, T2>::value), typename Tout = common_type<T1, T2>>
Tout absmin(const T1 &x, const T2 &y)

Returns the smaller in magnitude of two values.

Source:

template <typename T1, typename T2, KFR_ENABLE_IF(is_numeric_args<T1, T2>::value),
          typename Tout = common_type<T1, T2>>
KFR_INTRIN Tout absmin(const T1& x, const T2& y)
template<typename E1, typename E2, KFR_ENABLE_IF(is_input_expressions<E1, E2>::value)>
internal::expression_function<fn::absmin, E1, E2> absmin(E1 &&x, E2 &&y)

Returns template expression that returns the smaller in magnitude of two values.

Source:

template <typename E1, typename E2, KFR_ENABLE_IF(is_input_expressions<E1, E2>::value)>
KFR_INTRIN internal::expression_function<fn::absmin, E1, E2> absmin(E1&& x, E2&& y)

absmax

template<typename T1, typename T2, KFR_ENABLE_IF(is_numeric_args<T1, T2>::value), typename Tout = common_type<T1, T2>>
Tout absmax(const T1 &x, const T2 &y)

Returns the greater in magnitude of two values.

Source:

template <typename T1, typename T2, KFR_ENABLE_IF(is_numeric_args<T1, T2>::value),
          typename Tout = common_type<T1, T2>>
KFR_INTRIN Tout absmax(const T1& x, const T2& y)
template<typename E1, typename E2, KFR_ENABLE_IF(is_input_expressions<E1, E2>::value)>
internal::expression_function<fn::absmax, E1, E2> absmax(E1 &&x, E2 &&y)

Returns template expression that returns the greater in magnitude of two values.

Source:

template <typename E1, typename E2, KFR_ENABLE_IF(is_input_expressions<E1, E2>::value)>
KFR_INTRIN internal::expression_function<fn::absmax, E1, E2> absmax(E1&& x, E2&& y)

clamp

template<typename T1, typename T2, typename T3, KFR_ENABLE_IF(is_numeric_args<T1, T2, T3>::value), typename Tout = common_type<T1, T2, T3>>
Tout clamp(const T1 &x, const T2 &lo, const T3 &hi)

Returns the first argument clamped to a range [lo, hi]

Source:

template <typename T1, typename T2, typename T3, KFR_ENABLE_IF(is_numeric_args<T1, T2, T3>::value),
          typename Tout = common_type<T1, T2, T3>>
KFR_INTRIN Tout clamp(const T1& x, const T2& lo, const T3& hi)
template<typename E1, typename E2, typename E3, KFR_ENABLE_IF(is_input_expressions<E1, E2, E3>::value)>
internal::expression_function<fn::clamp, E1, E2, E3> clamp(E1 &&x, E2 &&lo, E3 &&hi)

Creates an expression that returns the first argument clamped to a range [lo, hi]

Source:

template <typename E1, typename E2, typename E3, KFR_ENABLE_IF(is_input_expressions<E1, E2, E3>::value)>
KFR_INTRIN internal::expression_function<fn::clamp, E1, E2, E3> clamp(E1&& x, E2&& lo, E3&& hi)
template<typename T1, typename T2, KFR_ENABLE_IF(is_numeric_args<T1, T2>::value), typename Tout = common_type<T1, T2>>
Tout clamp(const T1 &x, const T2 &hi)

Returns the first argument clamped to a range [0, hi]

Source:

template <typename T1, typename T2, KFR_ENABLE_IF(is_numeric_args<T1, T2>::value),
          typename Tout = common_type<T1, T2>>
KFR_INTRIN Tout clamp(const T1& x, const T2& hi)
template<typename E1, typename E2, KFR_ENABLE_IF(is_input_expressions<E1, E2>::value)>
internal::expression_function<fn::clamp, E1, E2> clamp(E1 &&x, E2 &&hi)

Creates an expression that returns the first argument clamped to a range [0, hi]

Source:

template <typename E1, typename E2, KFR_ENABLE_IF(is_input_expressions<E1, E2>::value)>
KFR_INTRIN internal::expression_function<fn::clamp, E1, E2> clamp(E1&& x, E2&& hi)

select

template<typename T1, size_t N, typename T2, typename T3, KFR_ENABLE_IF(is_numeric_args<T1, T2, T3>::value), typename Tout = subtype<common_type<T2, T3>>>
vec<Tout, N> select(const mask<T1, N> &m, const T2 &x, const T3 &y)

Returns x if m is true, otherwise return y. Order of the arguments is same as in ternary operator.

return m ? x : y

Source:

template <typename T1, size_t N, typename T2, typename T3, KFR_ENABLE_IF(is_numeric_args<T1, T2, T3>::value),
          typename Tout = subtype<common_type<T2, T3>>>
KFR_INTRIN vec<Tout, N> select(const mask<T1, N>& m, const T2& x, const T3& y)
template<typename E1, typename E2, typename E3, KFR_ENABLE_IF(is_input_expressions<E1, E2, E3>::value)>
internal::expression_function<fn::select, E1, E2, E3> select(E1 &&m, E2 &&x, E3 &&y)

Returns template expression that returns x if m is true, otherwise return y. Order of the arguments

is same as in ternary operator.

Source:

template <typename E1, typename E2, typename E3, KFR_ENABLE_IF(is_input_expressions<E1, E2, E3>::value)>
KFR_INTRIN internal::expression_function<fn::select, E1, E2, E3> select(E1&& m, E2&& x, E3&& y)