Small fixed-size vector of Size numerical data points. More...
Classes | |
| struct | InitTag |
Public Types | |
| using | ThatClass = NumVector<T, Size> |
| using | DataType = T |
Public Member Functions | |
| NumVector ()=default | |
| Constructs the zero vector. | |
| constexpr __host__ __device__ | NumVector (T ax, T ay) |
| Constructs with the pair (ax,ay). | |
| constexpr __host__ __device__ | NumVector (T ax, T ay, T az) |
| Constructs with the triplet (ax,ay,az). | |
| constexpr __host__ __device__ | NumVector (T a1, T a2, T a3, T a4) |
| Constructs with the quadruplet (a1,a2,a3,a4). | |
| constexpr __host__ __device__ | NumVector (T a1, T a2, T a3, T a4, T a5) |
| Constructs with the quintuplet (a1,a2,a3,a4,a5). | |
| constexpr __host__ __device__ | NumVector (T a1, T a2, T a3, T a4, T a5, T a6) |
| Constructs with the sextuplet (a1,a2,a3,a4,a5,a6). | |
| template<bool = true> | |
| constexpr __host__ __device__ | NumVector (const T(&v)[Size]) |
| Constructs the instance with the value v for each component. | |
| constexpr __host__ __device__ | NumVector (std::array< T, Size > v) |
| Constructs the instance with the value v for each component. | |
| constexpr __host__ __device__ | NumVector (T v) |
| Constructs the instance with the value v for each component. | |
| constexpr __host__ __device__ | NumVector (const DataType *v, InitTag) |
| Constructs the instance with the value v for each component. | |
| constexpr __host__ __device__ | NumVector (Real2 v) |
| constexpr __host__ __device__ | NumVector (Real3 v) |
| constexpr __host__ __device__ NumVector & | operator= (const DataType &value) |
| Assigns value to all components of the vector. | |
| constexpr __host__ __device__ NumVector & | operator= (const Real2 &v) |
| constexpr __host__ __device__ NumVector & | operator= (const Real3 &v) |
| constexpr | operator Real2 () const |
| constexpr | operator Real3 () const |
| __host__ __device__ NumVector | absolute () const |
| Absolute value component by component. | |
| constexpr __host__ __device__ void | fill (const T &v) |
| Fill the vector with the value v. | |
| constexpr __host__ __device__ NumVector | operator- () const |
| Creates a triplet opposite to the current triplet. | |
| constexpr __host__ __device__ T & | operator() (Int32 i) |
| constexpr __host__ __device__ T | operator() (Int32 i) const |
| constexpr __host__ __device__ T & | operator[] (Int32 i) |
| constexpr __host__ __device__ DataType | operator[] (Int32 i) const |
| constexpr __host__ __device__ DataType & | vx () |
| Value of the first component. | |
| constexpr __host__ __device__ DataType | vx () const |
| Value of the first component. | |
| constexpr __host__ __device__ DataType & | vy () |
| Value of the second component. | |
| constexpr __host__ __device__ DataType | vy () const |
| Value of the second component. | |
| constexpr __host__ __device__ DataType & | vz () |
| Value of the third component. | |
| constexpr __host__ __device__ DataType | vz () const |
| Value of the third component. | |
Static Public Member Functions | |
| static constexpr bool | isRealType () |
| constexpr __host__ static __device__ NumVector | zero () |
Private Member Functions | |
| template<typename Stream> | |
| void | print (Stream &o) const |
Static Private Member Functions | |
| constexpr __host__ static __device__ bool | _eq (T a, T b) |
| Compares the values of a and b using the TypeEqualT comparator. | |
Private Attributes | |
| T | m_values [Size] |
| Vector values. | |
Friends | |
| constexpr __host__ __device__ NumVector & | operator+= (NumVector &a, T b) |
| Adds b to each component of a. | |
| constexpr __host__ __device__ NumVector & | operator+= (NumVector &a, const NumVector &b) |
| Adds b to a. | |
| constexpr __host__ __device__ NumVector & | operator-= (NumVector &a, T b) |
| Subtracts b from each component of a. | |
| constexpr __host__ __device__ NumVector & | operator-= (NumVector &a, const NumVector &b) |
| Subtracts b from each component of a. | |
| constexpr __host__ __device__ NumVector & | operator*= (NumVector &a, T b) |
| Multiplies each component of a by b. | |
| constexpr __host__ __device__ NumVector & | operator/= (NumVector &a, T b) |
| Divides each component of a by b. | |
| constexpr __host__ __device__ NumVector | operator+ (const NumVector &a, const NumVector &b) |
| Creates a triplet that equals this triplet added to b. | |
| constexpr __host__ __device__ NumVector | operator- (const NumVector &a, const NumVector &b) |
| Creates a triplet that equals b subtracted from this triplet. | |
| constexpr __host__ __device__ NumVector | operator* (T a, const NumVector &vec) |
| Multiplication by a scalar. | |
| constexpr __host__ __device__ NumVector | operator* (const NumVector &vec, T b) |
| Multiplication by a scalar. | |
| constexpr __host__ __device__ NumVector | operator/ (const NumVector &vec, T b) |
| Division by a scalar. | |
| constexpr __host__ __device__ bool | operator== (const NumVector &a, const NumVector &b) |
| Compares the current instance component by component to b. | |
| std::ostream & | operator<< (std::ostream &o, const NumVector &t) |
| constexpr __host__ __device__ bool | operator!= (const NumVector &a, const NumVector &b) |
| Compares two vectors For the notion of equality, see operator==(). | |
Small fixed-size vector of Size numerical data points.
It is possible to access each component of the vector using 'operator[]' or 'operator()' or via the methods vx(), vy(), vz() if the dimension is sufficient (for example, vz() is only accessible if Size>=3.
Definition at line 36 of file arccore/src/base/arccore/base/NumVector.h.
| using Arcane::NumVector< T, Size >::DataType = T |
Definition at line 43 of file arccore/src/base/arccore/base/NumVector.h.
| using Arcane::NumVector< T, Size >::ThatClass = NumVector<T, Size> |
Definition at line 42 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineconstexpr |
Constructs with the pair (ax,ay).
Definition at line 54 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineconstexpr |
Constructs with the triplet (ax,ay,az).
Definition at line 62 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineconstexpr |
Constructs with the quadruplet (a1,a2,a3,a4).
Definition at line 71 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineconstexpr |
Constructs with the quintuplet (a1,a2,a3,a4,a5).
Definition at line 81 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineconstexpr |
Constructs with the sextuplet (a1,a2,a3,a4,a5,a6).
Definition at line 91 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineexplicitconstexpr |
Constructs the instance with the value v for each component.
Definition at line 103 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineexplicitconstexpr |
Constructs the instance with the value v for each component.
Definition at line 110 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineexplicitconstexpr |
Constructs the instance with the value v for each component.
Definition at line 117 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineconstexpr |
Constructs the instance with the value v for each component.
Definition at line 124 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineexplicitconstexpr |
Definition at line 130 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineexplicitconstexpr |
Definition at line 134 of file arccore/src/base/arccore/base/NumVector.h.
|
inlinestaticconstexprprivate |
Compares the values of a and b using the TypeEqualT comparator.
| true | if a and b are equal, |
| false | otherwise. |
Definition at line 392 of file arccore/src/base/arccore/base/NumVector.h.
Referenced by Arcane::NumVector< DataType, Size >::operator==.
|
inline |
Absolute value component by component.
Definition at line 177 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineconstexpr |
Fill the vector with the value v.
Definition at line 186 of file arccore/src/base/arccore/base/NumVector.h.
|
inlinestaticconstexpr |
Definition at line 44 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineconstexpr |
Definition at line 160 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineconstexpr |
Definition at line 165 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineconstexpr |
Definition at line 324 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineconstexpr |
Definition at line 329 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineconstexpr |
Creates a triplet opposite to the current triplet.
Definition at line 260 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineconstexpr |
Assigns value to all components of the vector.
Definition at line 139 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineconstexpr |
Definition at line 146 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineconstexpr |
Definition at line 153 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineconstexpr |
Definition at line 334 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineconstexpr |
Definition at line 339 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineprivate |
Definition at line 397 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineconstexpr |
Value of the first component.
Definition at line 346 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineconstexpr |
Value of the first component.
Definition at line 351 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineconstexpr |
Value of the second component.
Definition at line 357 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineconstexpr |
Value of the second component.
Definition at line 362 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineconstexpr |
Value of the third component.
Definition at line 368 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineconstexpr |
Value of the third component.
Definition at line 373 of file arccore/src/base/arccore/base/NumVector.h.
|
inlinestaticconstexpr |
Definition at line 172 of file arccore/src/base/arccore/base/NumVector.h.
|
friend |
Compares two vectors For the notion of equality, see operator==().
Definition at line 319 of file arccore/src/base/arccore/base/NumVector.h.
|
friend |
Multiplication by a scalar.
Definition at line 278 of file arccore/src/base/arccore/base/NumVector.h.
|
friend |
Multiplication by a scalar.
Definition at line 269 of file arccore/src/base/arccore/base/NumVector.h.
|
friend |
Multiplies each component of a by b.
Definition at line 226 of file arccore/src/base/arccore/base/NumVector.h.
|
friend |
Creates a triplet that equals this triplet added to b.
Definition at line 242 of file arccore/src/base/arccore/base/NumVector.h.
|
friend |
Adds b to a.
Definition at line 202 of file arccore/src/base/arccore/base/NumVector.h.
|
friend |
Adds b to each component of a.
Definition at line 194 of file arccore/src/base/arccore/base/NumVector.h.
|
friend |
Creates a triplet that equals b subtracted from this triplet.
Definition at line 251 of file arccore/src/base/arccore/base/NumVector.h.
|
friend |
Subtracts b from each component of a.
Definition at line 218 of file arccore/src/base/arccore/base/NumVector.h.
|
friend |
Subtracts b from each component of a.
Definition at line 210 of file arccore/src/base/arccore/base/NumVector.h.
|
friend |
Division by a scalar.
Definition at line 287 of file arccore/src/base/arccore/base/NumVector.h.
|
friend |
Divides each component of a by b.
Definition at line 234 of file arccore/src/base/arccore/base/NumVector.h.
|
friend |
Definition at line 309 of file arccore/src/base/arccore/base/NumVector.h.
|
friend |
Compares the current instance component by component to b.
| true | if this.x==b.x and this.y==b.y and this.z==b.z. |
| false | otherwise. |
Definition at line 301 of file arccore/src/base/arccore/base/NumVector.h.
|
private |
Vector values.
Definition at line 381 of file arccore/src/base/arccore/base/NumVector.h.
Referenced by Arcane::NumVector< DataType, Size >::absolute(), Arcane::NumVector< DataType, Size >::operator*, Arcane::NumVector< DataType, Size >::operator*, Arcane::NumVector< DataType, Size >::operator*=, Arcane::NumVector< DataType, Size >::operator+, Arcane::NumVector< DataType, Size >::operator+=, Arcane::NumVector< DataType, Size >::operator+=, Arcane::NumVector< DataType, Size >::operator-(), Arcane::NumVector< DataType, Size >::operator-, Arcane::NumVector< DataType, Size >::operator-=, Arcane::NumVector< DataType, Size >::operator-=, Arcane::NumVector< DataType, Size >::operator/, Arcane::NumVector< DataType, Size >::operator/=, and Arcane::NumVector< DataType, Size >::operator==.