176 lines
5.0 KiB
Markdown
176 lines
5.0 KiB
Markdown
[simd.unary]
|
||
|
||
# 29 Numerics library [[numerics]](./#numerics)
|
||
|
||
## 29.10 Data-parallel types [[simd]](simd#unary)
|
||
|
||
### 29.10.7 Class template basic_vec [[simd.class]](simd.class#simd.unary)
|
||
|
||
#### 29.10.7.5 basic_vec unary operators [simd.unary]
|
||
|
||
[1](#1)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L17983)
|
||
|
||
Effects in [simd.unary] are applied as unary element-wise operations[.](#1.sentence-1)
|
||
|
||
[ð](#lib:operator++,basic_vec)
|
||
|
||
`constexpr basic_vec& operator++() noexcept;
|
||
`
|
||
|
||
[2](#2)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L17992)
|
||
|
||
*Constraints*: requires (value_type a) { ++a; } is true[.](#2.sentence-1)
|
||
|
||
[3](#3)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L17996)
|
||
|
||
*Effects*: Increments every element by one[.](#3.sentence-1)
|
||
|
||
[4](#4)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L18000)
|
||
|
||
*Returns*: *this[.](#4.sentence-1)
|
||
|
||
[ð](#lib:operator++,basic_vec_)
|
||
|
||
`constexpr basic_vec operator++(int) noexcept;
|
||
`
|
||
|
||
[5](#5)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L18011)
|
||
|
||
*Constraints*: requires (value_type a) { a++; } is true[.](#5.sentence-1)
|
||
|
||
[6](#6)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L18015)
|
||
|
||
*Effects*: Increments every element by one[.](#6.sentence-1)
|
||
|
||
[7](#7)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L18019)
|
||
|
||
*Returns*: A copy of *this before incrementing[.](#7.sentence-1)
|
||
|
||
[ð](#lib:operator--,basic_vec)
|
||
|
||
`constexpr basic_vec& operator--() noexcept;
|
||
`
|
||
|
||
[8](#8)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L18030)
|
||
|
||
*Constraints*: requires (value_type a) { --a; } is true[.](#8.sentence-1)
|
||
|
||
[9](#9)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L18034)
|
||
|
||
*Effects*: Decrements every element by one[.](#9.sentence-1)
|
||
|
||
[10](#10)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L18038)
|
||
|
||
*Returns*: *this[.](#10.sentence-1)
|
||
|
||
[ð](#lib:operator--,basic_vec_)
|
||
|
||
`constexpr basic_vec operator--(int) noexcept;
|
||
`
|
||
|
||
[11](#11)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L18049)
|
||
|
||
*Constraints*: requires (value_type a) { a--; } is true[.](#11.sentence-1)
|
||
|
||
[12](#12)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L18053)
|
||
|
||
*Effects*: Decrements every element by one[.](#12.sentence-1)
|
||
|
||
[13](#13)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L18057)
|
||
|
||
*Returns*: A copy of *this before decrementing[.](#13.sentence-1)
|
||
|
||
[ð](#lib:operator,operator,basic_vec)
|
||
|
||
`constexpr mask_type operator!() const noexcept;
|
||
`
|
||
|
||
[14](#14)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L18068)
|
||
|
||
*Constraints*: requires (const value_type a) { !a; } is true[.](#14.sentence-1)
|
||
|
||
[15](#15)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L18072)
|
||
|
||
*Returns*: A basic_mask object with the ith element set to!operator[](i) for all i in the range of [0, size())[.](#15.sentence-1)
|
||
|
||
[ð](#lib:operator~,basic_vec)
|
||
|
||
`constexpr basic_vec operator~() const noexcept;
|
||
`
|
||
|
||
[16](#16)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L18084)
|
||
|
||
*Constraints*: requires (const value_type a) { ~a; } is true[.](#16.sentence-1)
|
||
|
||
[17](#17)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L18088)
|
||
|
||
*Returns*: A basic_vec object with the ith element set to~operator[](i) for all i in the range of [0, size())[.](#17.sentence-1)
|
||
|
||
[ð](#lib:operator+,basic_vec)
|
||
|
||
`constexpr basic_vec operator+() const noexcept;
|
||
`
|
||
|
||
[18](#18)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L18100)
|
||
|
||
*Constraints*: requires (const value_type a) { +a; } is true[.](#18.sentence-1)
|
||
|
||
[19](#19)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L18104)
|
||
|
||
*Returns*: *this[.](#19.sentence-1)
|
||
|
||
[ð](#lib:operator-,basic_vec)
|
||
|
||
`constexpr basic_vec operator-() const noexcept;
|
||
`
|
||
|
||
[20](#20)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L18115)
|
||
|
||
*Constraints*: requires (const value_type a) { -a; } is true[.](#20.sentence-1)
|
||
|
||
[21](#21)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L18119)
|
||
|
||
*Returns*: A basic_vec object where the ith element is initialized to-operator[](i) for all i in the range of [0, size())[.](#21.sentence-1)
|