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 | |
| constexpr | NumVector () |
| Constructs a vector with each coefficient initialized with default T constructor. | |
| constexpr | NumVector (NoInitTag) |
| Constructs the vector WITHOUT initializing its coefficients. | |
| 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 __host__ __device__ NumVector & | operator= (std::array< T, Size > v) |
| Constructs the instance with the value v for each component. | |
| 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 a vector with each coefficient initialized with default T constructor.
Definition at line 51 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineexplicitconstexpr |
Constructs the vector WITHOUT initializing its coefficients.
Definition at line 58 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineconstexpr |
Constructs with the pair (ax,ay).
Definition at line 61 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineconstexpr |
Constructs with the triplet (ax,ay,az).
Definition at line 69 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineconstexpr |
Constructs with the quadruplet (a1,a2,a3,a4).
Definition at line 78 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineconstexpr |
Constructs with the quintuplet (a1,a2,a3,a4,a5).
Definition at line 88 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineconstexpr |
Constructs with the sextuplet (a1,a2,a3,a4,a5,a6).
Definition at line 98 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineconstexpr |
Constructs the instance with the value v for each component.
Definition at line 110 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineconstexpr |
Constructs the instance with the value v for each component.
Definition at line 117 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineexplicitconstexpr |
Constructs the instance with the value v for each component.
Definition at line 124 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineconstexpr |
Constructs the instance with the value v for each component.
Definition at line 131 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineexplicitconstexpr |
Definition at line 137 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineexplicitconstexpr |
Definition at line 141 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 407 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 192 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineconstexpr |
Fill the vector with the value v.
Definition at line 201 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 175 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineconstexpr |
Definition at line 180 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineconstexpr |
Definition at line 339 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineconstexpr |
Definition at line 344 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineconstexpr |
Creates a triplet opposite to the current triplet.
Definition at line 275 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineconstexpr |
Assigns value to all components of the vector.
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 160 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineconstexpr |
Constructs the instance with the value v for each component.
Definition at line 168 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineconstexpr |
Definition at line 349 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineconstexpr |
Definition at line 354 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineprivate |
Definition at line 412 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineconstexpr |
Value of the first component.
Definition at line 361 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineconstexpr |
Value of the first component.
Definition at line 366 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineconstexpr |
Value of the second component.
Definition at line 372 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineconstexpr |
Value of the second component.
Definition at line 377 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineconstexpr |
Value of the third component.
Definition at line 383 of file arccore/src/base/arccore/base/NumVector.h.
|
inlineconstexpr |
Value of the third component.
Definition at line 388 of file arccore/src/base/arccore/base/NumVector.h.
|
inlinestaticconstexpr |
Definition at line 187 of file arccore/src/base/arccore/base/NumVector.h.
|
friend |
Compares two vectors For the notion of equality, see operator==().
Definition at line 334 of file arccore/src/base/arccore/base/NumVector.h.
|
friend |
Multiplication by a scalar.
Definition at line 293 of file arccore/src/base/arccore/base/NumVector.h.
|
friend |
Multiplication by a scalar.
Definition at line 284 of file arccore/src/base/arccore/base/NumVector.h.
|
friend |
Multiplies each component of a by b.
Definition at line 241 of file arccore/src/base/arccore/base/NumVector.h.
|
friend |
Creates a triplet that equals this triplet added to b.
Definition at line 257 of file arccore/src/base/arccore/base/NumVector.h.
|
friend |
Adds b to a.
Definition at line 217 of file arccore/src/base/arccore/base/NumVector.h.
|
friend |
Adds b to each component of a.
Definition at line 209 of file arccore/src/base/arccore/base/NumVector.h.
|
friend |
Creates a triplet that equals b subtracted from this triplet.
Definition at line 266 of file arccore/src/base/arccore/base/NumVector.h.
|
friend |
Subtracts b from each component of a.
Definition at line 233 of file arccore/src/base/arccore/base/NumVector.h.
|
friend |
Subtracts b from each component of a.
Definition at line 225 of file arccore/src/base/arccore/base/NumVector.h.
|
friend |
Division by a scalar.
Definition at line 302 of file arccore/src/base/arccore/base/NumVector.h.
|
friend |
Divides each component of a by b.
Definition at line 249 of file arccore/src/base/arccore/base/NumVector.h.
|
friend |
Definition at line 324 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 316 of file arccore/src/base/arccore/base/NumVector.h.
|
private |
Vector values.
Definition at line 396 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==.