[simd.mask.reductions]

# 29 Numerics library [[numerics]](./#numerics)

## 29.10 Data-parallel types [[simd]](simd#mask.reductions)

### 29.10.10 basic_mask non-member operations [[simd.mask.nonmembers]](simd.mask.nonmembers#simd.mask.reductions)

#### 29.10.10.5 basic_mask reductions [simd.mask.reductions]

[ð](#lib:all_of,simd)

`template<size_t Bytes, class Abi>
  constexpr bool all_of(const basic_mask<Bytes, Abi>& k) noexcept;
`

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L20493)

*Returns*: true if all boolean elements in k are true, otherwisefalse[.](#1.sentence-1)

[ð](#lib:any_of,simd)

`template<size_t Bytes, class Abi>
  constexpr bool any_of(const basic_mask<Bytes, Abi>& k) noexcept;
`

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L20506)

*Returns*: true if at least one boolean element in k is true,
otherwise false[.](#2.sentence-1)

[ð](#lib:none_of,simd)

`template<size_t Bytes, class Abi>
  constexpr bool none_of(const basic_mask<Bytes, Abi>& k) noexcept;
`

[3](#3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L20519)

*Returns*: !any_of(k)[.](#3.sentence-1)

[ð](#lib:reduce_count,simd)

`template<size_t Bytes, class Abi>
  constexpr simd-size-type reduce_count(const basic_mask<Bytes, Abi>& k) noexcept;
`

[4](#4)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L20531)

*Returns*: The number of boolean elements in k that are true[.](#4.sentence-1)

[ð](#lib:reduce_min_index,simd)

`template<size_t Bytes, class Abi>
  constexpr simd-size-type reduce_min_index(const basic_mask<Bytes, Abi>& k);
`

[5](#5)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L20543)

*Preconditions*: any_of(k) is true[.](#5.sentence-1)

[6](#6)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L20547)

*Returns*: The lowest element index i where k[i] is true[.](#6.sentence-1)

[ð](#lib:reduce_max_index,simd)

`template<size_t Bytes, class Abi>
  constexpr simd-size-type reduce_max_index(const basic_mask<Bytes, Abi>& k);
`

[7](#7)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L20559)

*Preconditions*: any_of(k) is true[.](#7.sentence-1)

[8](#8)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L20563)

*Returns*: The greatest element index i where k[i] is true[.](#8.sentence-1)

[ð](#lib:all_of,simd_)

`constexpr bool all_of([same_as](concept.same#concept:same_as "18.4.2 Concept same_­as [concept.same]")<bool> auto x) noexcept;
constexpr bool any_of([same_as](concept.same#concept:same_as "18.4.2 Concept same_­as [concept.same]")<bool> auto x) noexcept;
constexpr simd-size-type reduce_count([same_as](concept.same#concept:same_as "18.4.2 Concept same_­as [concept.same]")<bool> auto x) noexcept;
`

[9](#9)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L20578)

*Returns*: x[.](#9.sentence-1)

[ð](#lib:none_of,simd_)

`constexpr bool none_of([same_as](concept.same#concept:same_as "18.4.2 Concept same_­as [concept.same]")<bool> auto x) noexcept;
`

[10](#10)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L20589)

*Returns*: !x[.](#10.sentence-1)

[ð](#lib:reduce_min_index,simd_)

`constexpr simd-size-type reduce_min_index([same_as](concept.same#concept:same_as "18.4.2 Concept same_­as [concept.same]")<bool> auto x);
constexpr simd-size-type reduce_max_index([same_as](concept.same#concept:same_as "18.4.2 Concept same_­as [concept.same]")<bool> auto x);
`

[11](#11)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L20602)

*Preconditions*: x is true[.](#11.sentence-1)

[12](#12)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L20606)

*Returns*: 0[.](#12.sentence-1)
