Class managing a 2x2 matrix of reals. More...
#include <arcane/utils/Real2x2.h>
Public Member Functions | |
| constexpr __host__ __device__ | Real2x2 () |
| Constructs the zero matrix. | |
| constexpr __host__ __device__ | Real2x2 (Real2 ax, Real2 ay) |
| Constructs the pair (ax,ay). | |
| ARCANE_DEPRECATED_116 | Real2x2 (Real ax, Real ay, Real bx, Real by) |
| Constructs the pair ((ax,bx),(ay,by)). | |
| Real2x2 (const Real2x2 &f)=default | |
| Constructs a copy identical to f. | |
| constexpr __host__ __device__ | Real2x2 (const Real2x2POD &f) |
| Constructs a copy identical to f. | |
| constexpr __host__ __device__ | Real2x2 (Real v) |
| Constructs the instance with the triplet (v,v,v). | |
| constexpr __host__ __device__ | Real2x2 (ConstArrayView< Real > av) |
| Constructs the pair ((av[0], av[1]), (av[2], av[3])). | |
| Real2x2 & | operator= (const Real2x2 &f)=default |
| Copy assignment operator. | |
| constexpr __host__ __device__ Real2x2 & | operator= (Real v) |
| Assigns the pair (v,v,v) to the instance. | |
| constexpr __host__ __device__ Real2x2 | copy () const |
| Returns a copy of the pair. | |
| constexpr __host__ __device__ Real2x2 & | reset () |
| Resets the pair with default constructors. | |
| constexpr __host__ __device__ Real2x2 & | assign (Real2 ax, Real2 ay) |
| Assigns the pair (ax,ay) to the instance. | |
| constexpr __host__ __device__ Real2x2 & | assign (Real2x2 f) |
| Copies the pair f. | |
| constexpr __host__ __device__ ArrayView< Real > | view () |
| constexpr __host__ __device__ ConstArrayView< Real > | constView () const |
| std::istream & | assign (std::istream &i) |
| Reads the matrix from the stream i The matrix is read in the form of three Real2. | |
| std::ostream & | print (std::ostream &o) const |
| Writes the pair to the stream o readable by an assign(). | |
| std::ostream & | printXy (std::ostream &o) const |
| Writes the pair to the stream o in the form (x,y,z). | |
| constexpr __host__ __device__ Real2x2 & | add (Real2x2 b) |
| Adds b to the pair. | |
| constexpr __host__ __device__ Real2x2 & | sub (Real2x2 b) |
| Subtracts b from the pair. | |
| constexpr __host__ __device__ Real2x2 & | div (Real2x2 b) |
| Multiplies each component of the pair by the corresponding component of b. | |
| constexpr __host__ __device__ Real2x2 & | addSame (Real2 b) |
| Adds b to each component of the pair. | |
| constexpr __host__ __device__ Real2x2 & | subSame (Real2 b) |
| Subtracts b from each component of the pair. | |
| constexpr __host__ __device__ Real2x2 & | mulSame (Real2 b) |
| Multiplies each component of the pair by b. | |
| constexpr __host__ __device__ Real2x2 & | divSame (Real2 b) |
| Divides each component of the pair by b. | |
| constexpr __host__ __device__ Real2x2 & | operator+= (Real2x2 b) |
| Adds b to the pair. | |
| constexpr __host__ __device__ Real2x2 & | operator-= (Real2x2 b) |
| Subtracts b from the pair. | |
| constexpr __host__ __device__ void | operator*= (Real b) |
| Multiplies each component of the pair by the corresponding component of b. | |
| constexpr __host__ __device__ void | operator/= (Real b) |
| Divides each component of the pair by the corresponding component of b. | |
| constexpr __host__ __device__ Real2x2 | operator+ (Real2x2 b) const |
| Creates a pair that equals this pair added to b. | |
| constexpr __host__ __device__ Real2x2 | operator- (Real2x2 b) const |
| Creates a pair that equals b subtracted from this pair. | |
| constexpr __host__ __device__ Real2x2 | operator- () const |
| Creates an inverse tensor of the current tensor. | |
| constexpr __host__ __device__ bool | operator== (Real2x2 b) const |
| Compares component by component the current instance to b. | |
| constexpr __host__ __device__ bool | operator!= (Real2x2 b) const |
| Compares two pairs. For the notion of equality, see operator==(). | |
| __host__ __device__ Real2 | operator[] (Integer i) const |
| Read-only access to the i-th (between 0 and 1 inclusive) row of the instance. | |
| __host__ __device__ Real2 | operator() (Integer i) const |
| Read-only access to the i-th (between 0 and 1 inclusive) row of the instance. | |
| __host__ __device__ Real | operator() (Integer i, Integer j) const |
| Read-only access to the i-th row and j-th column. | |
| __host__ __device__ Real2 & | operator[] (Integer i) |
| Access to the i-th row (between 0 and 1 inclusive) of the instance. | |
| __host__ __device__ Real2 & | operator() (Integer i) |
| Access to the i-th row (between 0 and 1 inclusive) of the instance. | |
| __host__ __device__ Real & | operator() (Integer i, Integer j) |
| Access to the i-th row and j-th column. | |
| constexpr __host__ __device__ bool | isNearlyZero () const |
| Compares the matrix with the zero matrix. | |
Static Public Member Functions | |
| constexpr __host__ static __device__ Real2x2 | null () |
| Constructs the zero matrix. | |
| constexpr __host__ static __device__ Real2x2 | fromColumns (Real ax, Real ay, Real bx, Real by) |
| Constructs the pair ((ax,bx),(ay,by)). | |
| constexpr __host__ static __device__ Real2x2 | fromLines (Real ax, Real bx, Real ay, Real by) |
| Constructs the pair ((ax,bx),(ay,by)). | |
Public Attributes | |
| Real2 | x |
| First component. | |
| Real2 | y |
| Second component. | |
Friends | |
| std::ostream & | operator<< (std::ostream &o, Real2x2 t) |
| Writes the pair t to the stream o. | |
| std::istream & | operator>> (std::istream &i, Real2x2 &t) |
| Reads the pair t from the stream o. | |
| constexpr __host__ __device__ Real2x2 | operator* (Real sca, Real2x2 vec) |
| Multiplication by a scalar. | |
| constexpr __host__ __device__ Real2x2 | operator* (Real2x2 vec, Real sca) |
| Multiplication by a scalar. | |
| constexpr __host__ __device__ Real2x2 | operator/ (Real2x2 vec, Real sca) |
| Division by a scalar. | |
| constexpr __host__ __device__ bool | operator< (Real2x2 v1, Real2x2 v2) |
| Comparison operator. | |
Class managing a 2x2 matrix of reals.
The matrix comprises two components x and y which are of the type Real2. For example:
|
inlineconstexpr |
Constructs the zero matrix.
Definition at line 59 of file Real2x2.h.
Referenced by add(), addSame(), assign(), assign(), copy(), div(), divSame(), fromColumns(), fromLines(), mulSame(), null(), operator!=(), operator*, operator*, operator+(), operator+=(), operator-(), operator-(), operator-=(), operator/, operator<, operator<<, operator=(), operator=(), operator==(), operator>>, Real2x2(), reset(), sub(), and subSame().
Constructs the pair ((ax,bx),(ay,by)).
|
inlineexplicitconstexpr |
|
inlineexplicitconstexpr |
|
inlineexplicitconstexpr |
| std::istream & Arcane::Real2x2::assign | ( | std::istream & | i | ) |
Reads the matrix from the stream i The matrix is read in the form of three Real2.
Definition at line 27 of file Real2x2.cc.
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
Compares the matrix with the zero matrix.
The matrix is zero if and only if each of its components is less than a given epsilon. The epsilon value used is that of float_info<value_type>::nearlyEpsilon():
\[A=0 \Leftrightarrow |A.x|<\epsilon,|A.y|<\epsilon\]
| true | if the matrix is equal to the zero matrix, |
| false | otherwise. |
|
inlinestaticconstexpr |
Constructs the zero matrix.
Definition at line 118 of file Real2x2.h.
References Real2x2().
Referenced by Arcane::DataTypeTraitsT< Real2x2 >::defaultValue(), Real2x2(), reset(), and Arcane::Real2x2Proxy::reset().
|
inlineconstexpr |
Compares two pairs. For the notion of equality, see operator==().
| true | if the two pairs are different, |
| false | otherwise. |
Definition at line 297 of file Real2x2.h.
References operator==(), and Real2x2().
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
| std::ostream & Arcane::Real2x2::print | ( | std::ostream & | o | ) | const |
Writes the pair to the stream o readable by an assign().
Definition at line 37 of file Real2x2.cc.
| std::ostream & Arcane::Real2x2::printXy | ( | std::ostream & | o | ) | const |
Writes the pair to the stream o in the form (x,y,z).
Definition at line 47 of file Real2x2.cc.
Referenced by operator<<.
|
inlineconstexpr |
|
friend |
|
friend |
| Real2 Arcane::Real2x2::x |
First component.
Definition at line 112 of file Real2x2.h.
Referenced by add(), Arcane::Real2x2Proxy::add(), addSame(), assign(), assign(), assign(), constView(), div(), Arcane::Real2x2Proxy::div(), divSame(), Arcane::math::doubleContraction(), Arcane::math::isNearlyZero(), Arcane::math::max(), Arcane::math::min(), mulSame(), operator()(), operator()(), operator()(), operator()(), operator*, operator*, operator*=(), operator+(), Arcane::Real2x2Proxy::operator+(), operator-(), operator-(), Arcane::Real2x2Proxy::operator-(), operator/, operator/=(), operator<, operator=(), operator==(), operator[](), operator[](), print(), printXy(), Real2x2(), Real2x2(), Real2x2(), Real2x2(), Real2x2(), Real2x2(), sub(), Arcane::Real2x2Proxy::sub(), subSame(), and view().
| Real2 Arcane::Real2x2::y |
Second component.
Definition at line 113 of file Real2x2.h.
Referenced by add(), Arcane::Real2x2Proxy::add(), addSame(), assign(), assign(), assign(), div(), Arcane::Real2x2Proxy::div(), divSame(), Arcane::math::doubleContraction(), Arcane::math::isNearlyZero(), Arcane::math::max(), Arcane::math::min(), mulSame(), operator*, operator*, operator*=(), operator+(), Arcane::Real2x2Proxy::operator+(), operator-(), operator-(), Arcane::Real2x2Proxy::operator-(), operator/, operator/=(), operator<, operator=(), operator==(), print(), printXy(), Real2x2(), Real2x2(), Real2x2(), Real2x2(), Real2x2(), Real2x2(), sub(), Arcane::Real2x2Proxy::sub(), and subSame().