Files
2025-10-25 03:02:53 +03:00

4.0 KiB
Raw Permalink Blame History

[simd.alg]

29 Numerics library [numerics]

29.10 Data-parallel types [simd]

29.10.8 basic_vec non-member operations [simd.nonmembers]

29.10.8.12 Algorithms [simd.alg]

🔗

template<class T, class Abi> constexpr basic_vec<T, Abi> min(const basic_vec<T, Abi>& a, const basic_vec<T, Abi>& b) noexcept;

1

#

Constraints: T models totally_ordered.

2

#

Returns: The result of the element-wise application of min(a[i], b[i]) for all i in the range of [0, basic_vec<T, Abi>::size()).

🔗

template<class T, class Abi> constexpr basic_vec<T, Abi> max(const basic_vec<T, Abi>& a, const basic_vec<T, Abi>& b) noexcept;

3

#

Constraints: T models totally_ordered.

4

#

Returns: The result of the element-wise application of max(a[i], b[i]) for all i in the range of [0, basic_vec<T, Abi>::size()).

🔗

template<class T, class Abi> constexpr pair<basic_vec<T, Abi>, basic_vec<T, Abi>> minmax(const basic_vec<T, Abi>& a, const basic_vec<T, Abi>& b) noexcept;

5

#

Effects: Equivalent to: return pair{min(a, b), max(a, b)};

🔗

template<class T, class Abi> constexpr basic_vec<T, Abi> clamp( const basic_vec<T, Abi>& v, const basic_vec<T, Abi>& lo, const basic_vec<T, Abi>& hi);

6

#

Constraints: T models totally_ordered.

7

#

Preconditions: No element in lo shall be greater than the corresponding element inhi.

8

#

Returns: The result of element-wise application of clamp(v[i], lo[i], hi[i]) for all i in the range of [0, basic_vec<T, Abi>::size()).

🔗

template<class T, class U> constexpr auto select(bool c, const T& a, const U& b) -> remove_cvref_t<decltype(c ? a : b)>;

9

#

Effects: Equivalent to: return c ? a : b;

🔗

template<size_t Bytes, class Abi, class T, class U> constexpr auto select(const basic_mask<Bytes, Abi>& c, const T& a, const U& b) noexcept -> decltype(simd-select-impl(c, a, b));

10

#

Effects: Equivalent to:return simd-select-impl(c, a, b); where simd-select-impl is found by argument-dependent lookup ([basic.lookup.argdep]) contrary to [contents].