Small fixed-size vector of N numerical data points. More...
#include <arcane/utils/NumVector.h>
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). | |
| 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 (Real2 v) |
| constexpr __host__ __device__ | NumVector (Real3 v) |
| constexpr __host__ __device__ ThatClass & | operator= (Real v) |
| Assigns the triplet (v,v,v) to the instance. | |
| constexpr __host__ __device__ ThatClass & | operator= (const Real2 &v) |
| constexpr __host__ __device__ ThatClass & | operator= (const Real3 &v) |
| operator Real2 () const | |
| operator Real3 () const | |
| constexpr __host__ __device__ bool | isNearlyZero () const |
| constexpr __host__ __device__ Real | squareNormL2 () const |
| Returns the square of the L2 norm of the triplet \(x^2+y^2+z^2\). | |
| __host__ __device__ Real | normL2 () const |
| Returns the L2 norm of the triplet \(\sqrt{x^2+y^2+z^2}\). | |
| __host__ __device__ ThatClass | absolute () const |
| Absolute value component by component. | |
| constexpr __host__ __device__ ThatClass & | operator+= (T b) |
| Adds b to each component of the instance. | |
| constexpr __host__ __device__ ThatClass & | operator+= (const ThatClass &b) |
| Adds b to the instance. | |
| constexpr __host__ __device__ ThatClass & | operator-= (T b) |
| Subtracts b from each component of the instance. | |
| constexpr __host__ __device__ ThatClass & | operator-= (const ThatClass &b) |
| Subtracts b from the instance. | |
| constexpr __host__ __device__ ThatClass & | operator*= (T b) |
| Multiplies each component by b. | |
| constexpr __host__ __device__ ThatClass & | operator/= (T b) |
| Divides each component by b. | |
| constexpr __host__ __device__ ThatClass | 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__ T | operator[] (Int32 i) const |
| T & | vx () |
| Value of the first component. | |
| T | vx () const |
| Value of the first component. | |
| T & | vy () |
| Value of the second component. | |
| T | vy () const |
| Value of the second component. | |
| T & | vz () |
| Value of the third component. | |
| T | vz () const |
| Value of the third component. | |
Static Public Member Functions | |
| constexpr __host__ static __device__ ThatClass | zero () |
Friends | |
| constexpr __host__ __device__ ThatClass | operator+ (const ThatClass &a, const ThatClass &b) |
| Creates a triplet that equals this triplet added to b. | |
| constexpr __host__ __device__ ThatClass | operator- (const ThatClass &a, const ThatClass &b) |
| Creates a triplet that equals b subtracted from this triplet. | |
| constexpr __host__ __device__ ThatClass | operator* (T a, const ThatClass &vec) |
| Multiplication by a scalar. | |
| constexpr __host__ __device__ ThatClass | operator* (const ThatClass &vec, T b) |
| Multiplication by a scalar. | |
| constexpr __host__ __device__ ThatClass | operator/ (const ThatClass &vec, T b) |
| Division by a scalar. | |
| constexpr __host__ __device__ bool | operator== (const ThatClass &a, const ThatClass &b) |
| Compares the current instance component by component to b. | |
| constexpr __host__ __device__ bool | operator!= (const ThatClass &a, const ThatClass &b) |
| Compares two vectors For the notion of equality, see operator==(). | |
Small fixed-size vector of N 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 43 of file NumVector.h.
| using Arcane::NumVector< T, Size >::DataType = T |
Definition at line 51 of file NumVector.h.
| using Arcane::NumVector< T, Size >::ThatClass = NumVector<T, Size> |
Definition at line 50 of file NumVector.h.
|
inlineconstexpr |
Constructs with the pair (ax,ay).
Definition at line 59 of file NumVector.h.
|
inlineconstexpr |
Constructs with the triplet (ax,ay,az).
Definition at line 67 of file NumVector.h.
|
inlineconstexpr |
Constructs with the quadruplet (a1,a2,a3,a4).
Definition at line 76 of file NumVector.h.
|
inlineconstexpr |
Constructs with the quintuplet (a1,a2,a3,a4,a5).
Definition at line 86 of file NumVector.h.
|
inlineexplicitconstexpr |
Constructs the instance with the value v for each component.
Definition at line 97 of file NumVector.h.
|
inlineexplicitconstexpr |
Constructs the instance with the value v for each component.
Definition at line 104 of file NumVector.h.
|
inlineexplicitconstexpr |
Constructs the instance with the value v for each component.
Definition at line 111 of file NumVector.h.
|
inlineexplicitconstexpr |
Definition at line 117 of file NumVector.h.
|
inlineexplicitconstexpr |
Definition at line 121 of file NumVector.h.
|
inline |
Absolute value component by component.
Definition at line 176 of file NumVector.h.
|
inlineconstexpr |
Definition at line 155 of file NumVector.h.
|
inline |
Returns the L2 norm of the triplet \(\sqrt{x^2+y^2+z^2}\).
Definition at line 173 of file NumVector.h.
|
inline |
Definition at line 145 of file NumVector.h.
|
inline |
Definition at line 147 of file NumVector.h.
|
inlineconstexpr |
Definition at line 309 of file NumVector.h.
|
inlineconstexpr |
Definition at line 314 of file NumVector.h.
|
inlineconstexpr |
Multiplies each component by b.
Definition at line 217 of file NumVector.h.
|
inlineconstexpr |
Adds b to the instance.
Definition at line 193 of file NumVector.h.
|
inlineconstexpr |
Adds b to each component of the instance.
Definition at line 185 of file NumVector.h.
|
inlineconstexpr |
Creates a triplet opposite to the current triplet.
Definition at line 251 of file NumVector.h.
|
inlineconstexpr |
Subtracts b from the instance.
Definition at line 209 of file NumVector.h.
|
inlineconstexpr |
Subtracts b from each component of the instance.
Definition at line 201 of file NumVector.h.
|
inlineconstexpr |
Divides each component by b.
Definition at line 225 of file NumVector.h.
|
inlineconstexpr |
Definition at line 133 of file NumVector.h.
|
inlineconstexpr |
Definition at line 139 of file NumVector.h.
|
inlineconstexpr |
Assigns the triplet (v,v,v) to the instance.
Definition at line 126 of file NumVector.h.
|
inlineconstexpr |
Definition at line 319 of file NumVector.h.
|
inlineconstexpr |
Definition at line 324 of file NumVector.h.
|
inlineconstexpr |
Returns the square of the L2 norm of the triplet \(x^2+y^2+z^2\).
Definition at line 164 of file NumVector.h.
Referenced by Arcane::NumVector< DataType, Size >::normL2().
|
inline |
Value of the first component.
Definition at line 331 of file NumVector.h.
|
inline |
Value of the first component.
Definition at line 336 of file NumVector.h.
|
inline |
Value of the second component.
Definition at line 342 of file NumVector.h.
|
inline |
Value of the second component.
Definition at line 347 of file NumVector.h.
|
inline |
Value of the third component.
Definition at line 353 of file NumVector.h.
|
inline |
Value of the third component.
Definition at line 358 of file NumVector.h.
|
inlinestaticconstexpr |
Definition at line 151 of file NumVector.h.
|
friend |
Compares two vectors For the notion of equality, see operator==().
Definition at line 304 of file NumVector.h.
|
friend |
Multiplication by a scalar.
Definition at line 269 of file NumVector.h.
|
friend |
Multiplication by a scalar.
Definition at line 260 of file NumVector.h.
|
friend |
Creates a triplet that equals this triplet added to b.
Definition at line 233 of file NumVector.h.
|
friend |
Creates a triplet that equals b subtracted from this triplet.
Definition at line 242 of file NumVector.h.
|
friend |
Division by a scalar.
Definition at line 278 of file 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 292 of file NumVector.h.