Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::Real3x3 Class Reference

Class managing a 3x3 real matrix. More...

#include <arcane/utils/Real3x3.h>

Collaboration diagram for Arcane::Real3x3:

Public Member Functions

constexpr __host__ __device__ Real3x3 ()
 Constructs the matrix with all coefficients zero.
constexpr __host__ __device__ Real3x3 (Real3 ax, Real3 ay, Real3 az)
 Constructs the matrix with rows (ax,ay,az).
ARCANE_DEPRECATED_116 Real3x3 (Real ax, Real ay, Real az, Real bx, Real by, Real bz, Real cx, Real cy, Real cz)
 Constructs the tensor ((ax,bx,cx),(ay,by,cy),(az,bz,cz)).
 Real3x3 (const Real3x3 &f)=default
 Constructs a triplet identical to f.
constexpr __host__ __device__ Real3x3 (const Real3x3POD &f)
 Constructs a triplet identical to f.
constexpr __host__ __device__ Real3x3 (Real v)
 Constructs the instance with the triplet (v,v,v).
constexpr __host__ __device__ Real3x3 (ConstArrayView< Real > av)
 Constructs the triplet ((av[0], av[1], av[2]), (av[3], av[4], av[5]), (av[6], av[7], av[8])).
Real3x3operator= (const Real3x3 &f)=default
 Copy assignment operator.
constexpr __host__ __device__ Real3x3operator= (Real v)
 Assigns the triplet (v,v,v) to the instance.
constexpr __host__ __device__ Real3x3 copy () const
 Returns a copy of the matrix.
constexpr __host__ __device__ Real3x3reset ()
 Resets the coefficients of the matrix to zero.
constexpr __host__ __device__ Real3x3assign (Real3 ax, Real3 ay, Real3 az)
 Assigns the rows (ax,ay,az) to the instance.
constexpr __host__ __device__ Real3x3assign (Real3x3 f)
 Copies matrix f.
constexpr __host__ __device__ ArrayView< Realview ()
constexpr __host__ __device__ ConstArrayView< RealconstView () const
std::istream & assign (std::istream &i)
 Reads the matrix from the stream i The matrix is read in the form of three Real3s.
std::ostream & print (std::ostream &o) const
 Writes the triplet to the stream o readable by an assign().
std::ostream & printXyz (std::ostream &o) const
 Writes the triplet to the stream o in the form (x,y,z).
constexpr __host__ __device__ Real3x3add (Real3x3 b)
 Adds b to the triplet.
constexpr __host__ __device__ Real3x3sub (Real3x3 b)
 Subtracts b from the triplet.
constexpr __host__ __device__ Real3x3addSame (Real3 b)
 Adds b to each component of the triplet.
constexpr __host__ __device__ Real3x3subSame (Real3 b)
 Subtracts b from each component of the triplet.
constexpr __host__ __device__ Real3x3operator+= (Real3x3 b)
 Adds b to the triplet.
constexpr __host__ __device__ Real3x3operator-= (Real3x3 b)
 Subtracts b from the triplet.
constexpr __host__ __device__ void operator*= (Real b)
 Multiplies each component of the matrix by the real b.
constexpr __host__ __device__ void operator/= (Real b)
 Divides each component of the matrix by the real b.
constexpr __host__ __device__ Real3x3 operator+ (Real3x3 b) const
 Creates a triplet that equals this triplet added to b.
constexpr __host__ __device__ Real3x3 operator- (Real3x3 b) const
 Creates a triplet that equals b subtracted from this triplet.
constexpr __host__ __device__ Real3x3 operator- () const
 Creates a tensor opposite to the current tensor.
constexpr __host__ __device__ bool operator== (Real3x3 b) const
 Compares the current instance component by component to b.
constexpr __host__ __device__ bool operator!= (Real3x3 b) const
 Compares two triplets. For the notion of equality, see operator==().
__host__ __device__ Real3 operator[] (Integer i) const
 Read-only access to the i-th (between 0 and 2 inclusive) row of the instance.
__host__ __device__ Real3 operator() (Integer i) const
 Read-only access to the i-th (between 0 and 2 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__ Real3operator[] (Integer i)
 Access to the i-th row (between 0 and 2 inclusive) of the instance.
__host__ __device__ Real3operator() (Integer i)
 Access to the i-th row (between 0 and 2 inclusive) of the instance.
__host__ __device__ Realoperator() (Integer i, Integer j)
 Access to the i-th row and j-th column.
constexpr __host__ __device__ Real determinant () const
 Determinant of the matrix.
constexpr __host__ __device__ bool isNearlyZero () const

Static Public Member Functions

constexpr __host__ static __device__ Real3x3 null ()
 Constructs the null tensor.
constexpr __host__ static __device__ Real3x3 zero ()
 Constructs the zero matrix.
constexpr __host__ static __device__ Real3x3 identity ()
 Constructs the identity matrix.
constexpr __host__ static __device__ Real3x3 fromColumns (Real ax, Real ay, Real az, Real bx, Real by, Real bz, Real cx, Real cy, Real cz)
 Constructs the matrix ((ax,bx,cx),(ay,by,cy),(az,bz,cz)).
constexpr __host__ static __device__ Real3x3 fromLines (Real ax, Real bx, Real cx, Real ay, Real by, Real cy, Real az, Real bz, Real cz)
 Constructs the matrix ((ax,bx,cx),(ay,by,cy),(az,bz,cz)).

Public Attributes

Real3 x
 first element of the triplet
Real3 y
 first element of the triplet
Real3 z
 first element of the triplet

Static Private Member Functions

constexpr __host__ static __device__ bool _eq (Real a, Real b)
 Compares the values of a and b with the TypeEqualT comparator.

Friends

std::ostream & operator<< (std::ostream &o, Real3x3 t)
 Writes the triplet t to the stream o.
std::istream & operator>> (std::istream &i, Real3x3 &t)
 Reads the triplet t from the stream o.
constexpr __host__ __device__ Real3x3 operator* (Real sca, Real3x3 vec)
 Multiplication by a scalar.
constexpr __host__ __device__ Real3x3 operator* (Real3x3 vec, Real sca)
 Multiplication by a scalar.
constexpr __host__ __device__ Real3x3 operator/ (Real3x3 vec, Real sca)
 Division by a scalar.
constexpr __host__ __device__ bool operator< (Real3x3 v1, Real3x3 v2)
 Comparison operator.

Detailed Description

Class managing a 3x3 real matrix.

The matrix comprises three components x, y and z of type Real3. Each component represents a row of the matrix. Consequently, for a matrix m, m.y.z represents the 2nd row and the 3rd column of the matrix.

It is also possible to access the matrix elements like an array. For example m[1][2] represents the 2nd row and the 3rd column of the matrix.

Matrices can be constructed by row by specifying the values by row (fromLines()) or by specifying by column (fromColumns()).

For example:

Real3x3 matrix;
matrix.x.y = 2.0;
matrix.y.z = 3.0;
matrix.x.x = 5.0;
Real3 y
first element of the triplet
Definition Real3x3.h:130
constexpr __host__ __device__ Real3x3()
Constructs the matrix with all coefficients zero.
Definition Real3x3.h:71
Real3 x
first element of the triplet
Definition Real3x3.h:129
Real y
second component of the triplet
Definition Real3.h:36
Real z
third component of the triplet
Definition Real3.h:37
Real x
first component of the triplet
Definition Real3.h:35

Definition at line 66 of file Real3x3.h.

Constructor & Destructor Documentation

◆ Real3x3() [1/6]

__host__ __device__ Arcane::Real3x3::Real3x3 ( )
inlineconstexpr

Constructs the matrix with all coefficients zero.

Definition at line 71 of file Real3x3.h.

References x, y, z, and zero().

Referenced by add(), addSame(), assign(), assign(), copy(), fromColumns(), fromLines(), identity(), null(), operator!=(), operator*, operator*, operator+(), operator+=(), operator-(), operator-(), operator-=(), operator/, operator<, operator<<, operator=(), operator=(), operator==(), operator>>, Real3x3(), reset(), sub(), subSame(), and zero().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Real3x3() [2/6]

__host__ __device__ Arcane::Real3x3::Real3x3 ( Real3 ax,
Real3 ay,
Real3 az )
inlineconstexpr

Constructs the matrix with rows (ax,ay,az).

Definition at line 78 of file Real3x3.h.

References x, y, and z.

◆ Real3x3() [3/6]

ARCANE_DEPRECATED_116 Arcane::Real3x3::Real3x3 ( Real ax,
Real ay,
Real az,
Real bx,
Real by,
Real bz,
Real cx,
Real cy,
Real cz )
inline

Constructs the tensor ((ax,bx,cx),(ay,by,cy),(az,bz,cz)).

Deprecated
Use Real3x3(Real3 x,Real3 y,Real3 z) instead.

Definition at line 88 of file Real3x3.h.

References x, y, and z.

◆ Real3x3() [4/6]

__host__ __device__ Arcane::Real3x3::Real3x3 ( const Real3x3POD & f)
inlineexplicitconstexpr

Constructs a triplet identical to f.

Definition at line 98 of file Real3x3.h.

References x, y, and z.

◆ Real3x3() [5/6]

__host__ __device__ Arcane::Real3x3::Real3x3 ( Real v)
inlineexplicitconstexpr

Constructs the instance with the triplet (v,v,v).

Definition at line 105 of file Real3x3.h.

References x, y, and z.

◆ Real3x3() [6/6]

__host__ __device__ Arcane::Real3x3::Real3x3 ( ConstArrayView< Real > av)
inlineexplicitconstexpr

Constructs the triplet ((av[0], av[1], av[2]), (av[3], av[4], av[5]), (av[6], av[7], av[8])).

Definition at line 111 of file Real3x3.h.

References x, y, and z.

Member Function Documentation

◆ _eq()

__host__ static __device__ bool Arcane::Real3x3::_eq ( Real a,
Real b )
inlinestaticconstexprprivate

Compares the values of a and b with the TypeEqualT comparator.

Return values
trueif a and b are equal,
falseotherwise.

Definition at line 430 of file Real3x3.h.

References Arcane::TypeEqualT< T >::isEqual().

Here is the call graph for this function:

◆ add()

__host__ __device__ Real3x3 & Arcane::Real3x3::add ( Real3x3 b)
inlineconstexpr

Adds b to the triplet.

Definition at line 213 of file Real3x3.h.

References Real3x3(), x, y, and z.

Referenced by operator+=().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ addSame()

__host__ __device__ Real3x3 & Arcane::Real3x3::addSame ( Real3 b)
inlineconstexpr

Adds b to each component of the triplet.

Definition at line 231 of file Real3x3.h.

References Real3x3(), x, y, and z.

Here is the call graph for this function:

◆ assign() [1/3]

__host__ __device__ Real3x3 & Arcane::Real3x3::assign ( Real3 ax,
Real3 ay,
Real3 az )
inlineconstexpr

Assigns the rows (ax,ay,az) to the instance.

Definition at line 169 of file Real3x3.h.

References Real3x3(), x, y, and z.

Referenced by operator>>.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ assign() [2/3]

__host__ __device__ Real3x3 & Arcane::Real3x3::assign ( Real3x3 f)
inlineconstexpr

Copies matrix f.

Definition at line 178 of file Real3x3.h.

References Real3x3(), x, y, and z.

Here is the call graph for this function:

◆ assign() [3/3]

std::istream & Arcane::Real3x3::assign ( std::istream & i)

Reads the matrix from the stream i The matrix is read in the form of three Real3s.

Definition at line 28 of file Real3x3.cc.

References x, y, and z.

◆ constView()

__host__ __device__ ConstArrayView< Real > Arcane::Real3x3::constView ( ) const
inlineconstexpr

Returns a constant view over the nine elements of the matrix. [x.x, x.y, x.z, y.x, y.y, y.z, z.x, z.y, z.z]

Definition at line 195 of file Real3x3.h.

References x.

◆ copy()

__host__ __device__ Real3x3 Arcane::Real3x3::copy ( ) const
inlineconstexpr

Returns a copy of the matrix.

Definition at line 159 of file Real3x3.h.

References Real3x3().

Here is the call graph for this function:

◆ determinant()

__host__ __device__ Real Arcane::Real3x3::determinant ( ) const
inlineconstexpr

Determinant of the matrix.

Definition at line 366 of file Real3x3.h.

References x, y, and z.

Referenced by Arcane::math::inverseMatrix(), and Arcane::math::matrixDeterminant().

Here is the caller graph for this function:

◆ fromColumns()

__host__ static __device__ Real3x3 Arcane::Real3x3::fromColumns ( Real ax,
Real ay,
Real az,
Real bx,
Real by,
Real bz,
Real cx,
Real cy,
Real cz )
inlinestaticconstexpr

Constructs the matrix ((ax,bx,cx),(ay,by,cy),(az,bz,cz)).

Definition at line 145 of file Real3x3.h.

References Real3x3().

Referenced by Arcane::math::matrix3x3Prod(), and Arcane::math::matrix3x3Transp().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fromLines()

__host__ static __device__ Real3x3 Arcane::Real3x3::fromLines ( Real ax,
Real bx,
Real cx,
Real ay,
Real by,
Real cy,
Real az,
Real bz,
Real cz )
inlinestaticconstexpr

Constructs the matrix ((ax,bx,cx),(ay,by,cy),(az,bz,cz)).

Definition at line 151 of file Real3x3.h.

References Real3x3().

Referenced by Arcane::math::matrixProduct().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ identity()

__host__ static __device__ Real3x3 Arcane::Real3x3::identity ( )
inlinestaticconstexpr

Constructs the identity matrix.

Definition at line 142 of file Real3x3.h.

References Real3x3().

Here is the call graph for this function:

◆ isNearlyZero()

__host__ __device__ bool Arcane::Real3x3::isNearlyZero ( ) const
inlineconstexpr

Definition at line 461 of file Real3x3.h.

◆ null()

__host__ static __device__ Real3x3 Arcane::Real3x3::null ( )
inlinestaticconstexpr

Constructs the null tensor.

Definition at line 136 of file Real3x3.h.

References Real3x3().

Here is the call graph for this function:

◆ operator!=()

__host__ __device__ bool Arcane::Real3x3::operator!= ( Real3x3 b) const
inlineconstexpr

Compares two triplets. For the notion of equality, see operator==().

Return values
trueif the two triplets are different,
falseotherwise.

Definition at line 296 of file Real3x3.h.

References operator==(), and Real3x3().

Here is the call graph for this function:

◆ operator()() [1/4]

__host__ __device__ Real3 & Arcane::Real3x3::operator() ( Integer i)
inline

Access to the i-th row (between 0 and 2 inclusive) of the instance.

Parameters
irow number to return

Definition at line 347 of file Real3x3.h.

References x.

◆ operator()() [2/4]

__host__ __device__ Real3 Arcane::Real3x3::operator() ( Integer i) const
inline

Read-only access to the i-th (between 0 and 2 inclusive) row of the instance.

Parameters
irow number to return

Definition at line 315 of file Real3x3.h.

References x.

◆ operator()() [3/4]

__host__ __device__ Real & Arcane::Real3x3::operator() ( Integer i,
Integer j )
inline

Access to the i-th row and j-th column.

Parameters
irow number to return
jcolumn number to return

Definition at line 358 of file Real3x3.h.

References x.

◆ operator()() [4/4]

__host__ __device__ Real Arcane::Real3x3::operator() ( Integer i,
Integer j ) const
inline

Read-only access to the i-th row and j-th column.

Parameters
irow number to return
jcolumn number to return

Definition at line 326 of file Real3x3.h.

References x.

◆ operator*=()

__host__ __device__ void Arcane::Real3x3::operator*= ( Real b)
inlineconstexpr

Multiplies each component of the matrix by the real b.

Definition at line 255 of file Real3x3.h.

References x, y, and z.

◆ operator+()

__host__ __device__ Real3x3 Arcane::Real3x3::operator+ ( Real3x3 b) const
inlineconstexpr

Creates a triplet that equals this triplet added to b.

Definition at line 271 of file Real3x3.h.

References Real3x3(), x, y, and z.

Here is the call graph for this function:

◆ operator+=()

__host__ __device__ Real3x3 & Arcane::Real3x3::operator+= ( Real3x3 b)
inlineconstexpr

Adds b to the triplet.

Definition at line 249 of file Real3x3.h.

References add(), and Real3x3().

Here is the call graph for this function:

◆ operator-() [1/2]

__host__ __device__ Real3x3 Arcane::Real3x3::operator- ( ) const
inlineconstexpr

Creates a tensor opposite to the current tensor.

Definition at line 277 of file Real3x3.h.

References Real3x3(), x, y, and z.

Here is the call graph for this function:

◆ operator-() [2/2]

__host__ __device__ Real3x3 Arcane::Real3x3::operator- ( Real3x3 b) const
inlineconstexpr

Creates a triplet that equals b subtracted from this triplet.

Definition at line 274 of file Real3x3.h.

References Real3x3(), x, y, and z.

Here is the call graph for this function:

◆ operator-=()

__host__ __device__ Real3x3 & Arcane::Real3x3::operator-= ( Real3x3 b)
inlineconstexpr

Subtracts b from the triplet.

Definition at line 252 of file Real3x3.h.

References Real3x3(), and sub().

Here is the call graph for this function:

◆ operator/=()

__host__ __device__ void Arcane::Real3x3::operator/= ( Real b)
inlineconstexpr

Divides each component of the matrix by the real b.

Definition at line 263 of file Real3x3.h.

References x, y, and z.

◆ operator=()

__host__ __device__ Real3x3 & Arcane::Real3x3::operator= ( Real v)
inlineconstexpr

Assigns the triplet (v,v,v) to the instance.

Definition at line 121 of file Real3x3.h.

References Real3x3(), x, y, and z.

Here is the call graph for this function:

◆ operator==()

__host__ __device__ bool Arcane::Real3x3::operator== ( Real3x3 b) const
inlineconstexpr

Compares the current instance component by component to b.

Return values
trueif this.x==b.x and this.y==b.y and this.z==b.z.
falseotherwise.

Definition at line 285 of file Real3x3.h.

References Real3x3(), x, y, and z.

Referenced by operator!=().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator[]() [1/2]

__host__ __device__ Real3 & Arcane::Real3x3::operator[] ( Integer i)
inline

Access to the i-th row (between 0 and 2 inclusive) of the instance.

Parameters
irow number to return

Definition at line 337 of file Real3x3.h.

References x.

◆ operator[]() [2/2]

__host__ __device__ Real3 Arcane::Real3x3::operator[] ( Integer i) const
inline

Read-only access to the i-th (between 0 and 2 inclusive) row of the instance.

Parameters
irow number to return

Definition at line 305 of file Real3x3.h.

References x.

◆ print()

std::ostream & Arcane::Real3x3::print ( std::ostream & o) const

Writes the triplet to the stream o readable by an assign().

Definition at line 38 of file Real3x3.cc.

References x, y, and z.

◆ printXyz()

std::ostream & Arcane::Real3x3::printXyz ( std::ostream & o) const

Writes the triplet to the stream o in the form (x,y,z).

Definition at line 48 of file Real3x3.cc.

References x, y, and z.

Referenced by operator<<.

Here is the caller graph for this function:

◆ reset()

__host__ __device__ Real3x3 & Arcane::Real3x3::reset ( )
inlineconstexpr

Resets the coefficients of the matrix to zero.

Definition at line 162 of file Real3x3.h.

References Real3x3(), and zero().

Here is the call graph for this function:

◆ sub()

__host__ __device__ Real3x3 & Arcane::Real3x3::sub ( Real3x3 b)
inlineconstexpr

Subtracts b from the triplet.

Definition at line 222 of file Real3x3.h.

References Real3x3(), x, y, and z.

Referenced by operator-=().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ subSame()

__host__ __device__ Real3x3 & Arcane::Real3x3::subSame ( Real3 b)
inlineconstexpr

Subtracts b from each component of the triplet.

Definition at line 240 of file Real3x3.h.

References Real3x3(), x, y, and z.

Here is the call graph for this function:

◆ view()

__host__ __device__ ArrayView< Real > Arcane::Real3x3::view ( )
inlineconstexpr

Returns a view over the nine elements of the matrix. [x.x, x.y, x.z, y.x, y.y, y.z, z.x, z.y, z.z]

Definition at line 188 of file Real3x3.h.

References x.

◆ zero()

__host__ static __device__ Real3x3 Arcane::Real3x3::zero ( )
inlinestaticconstexpr

Constructs the zero matrix.

Definition at line 139 of file Real3x3.h.

References Real3x3().

Referenced by Arcane::DataTypeTraitsT< Real3x3 >::defaultValue(), Real3x3(), and reset().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator* [1/2]

__host__ __device__ Real3x3 operator* ( Real sca,
Real3x3 vec )
friend

Multiplication by a scalar.

Definition at line 384 of file Real3x3.h.

References Real3x3(), x, y, and z.

◆ operator* [2/2]

__host__ __device__ Real3x3 operator* ( Real3x3 vec,
Real sca )
friend

Multiplication by a scalar.

Definition at line 390 of file Real3x3.h.

References Real3x3(), x, y, and z.

◆ operator/

__host__ __device__ Real3x3 operator/ ( Real3x3 vec,
Real sca )
friend

Division by a scalar.

Definition at line 396 of file Real3x3.h.

References Real3x3(), x, y, and z.

◆ operator<

__host__ __device__ bool operator< ( Real3x3 v1,
Real3x3 v2 )
friend

Comparison operator.

This operator allows sorting Real3s for example in std::set

Definition at line 407 of file Real3x3.h.

References Real3x3(), x, y, and z.

◆ operator<<

std::ostream & operator<< ( std::ostream & o,
Real3x3 t )
friend

Writes the triplet t to the stream o.

Definition at line 372 of file Real3x3.h.

References printXyz(), and Real3x3().

◆ operator>>

std::istream & operator>> ( std::istream & i,
Real3x3 & t )
friend

Reads the triplet t from the stream o.

Definition at line 378 of file Real3x3.h.

References assign(), and Real3x3().

Member Data Documentation

◆ x

◆ y

◆ z


The documentation for this class was generated from the following files: