Arcane  4.2.1.0
User documentation
Loading...
Searching...
No Matches
Arcane::Real3x3 Class Reference

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

#include <arccore/base/Real3x3.h>

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).
 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

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
constexpr __host__ __device__ Real3x3()
Constructs the matrix with all coefficients zero.
Real3 x
first element of the triplet
Real y
second component of the triplet
Real z
third component of the triplet
Real x
first component of the triplet

Definition at line 66 of file arccore/src/base/arccore/base/Real3x3.h.

Constructor & Destructor Documentation

◆ Real3x3() [1/5]

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

◆ Real3x3() [2/5]

__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 arccore/src/base/arccore/base/Real3x3.h.

References x, y, and z.

◆ Real3x3() [3/5]

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

Constructs a triplet identical to f.

Definition at line 100 of file arccore/src/base/arccore/base/Real3x3.h.

References x, y, and z.

◆ Real3x3() [4/5]

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

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

Definition at line 107 of file arccore/src/base/arccore/base/Real3x3.h.

References x, y, and z.

◆ Real3x3() [5/5]

__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 113 of file arccore/src/base/arccore/base/Real3x3.h.

References x, y, and z.

Member Function Documentation

◆ add()

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

Adds b to the triplet.

Definition at line 215 of file arccore/src/base/arccore/base/Real3x3.h.

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

Referenced by operator+=().

◆ addSame()

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

Adds b to each component of the triplet.

Definition at line 233 of file arccore/src/base/arccore/base/Real3x3.h.

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

◆ 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 171 of file arccore/src/base/arccore/base/Real3x3.h.

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

Referenced by operator>>.

◆ assign() [2/3]

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

Copies matrix f.

Definition at line 180 of file arccore/src/base/arccore/base/Real3x3.h.

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

◆ 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 arccore/src/base/arccore/base/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 197 of file arccore/src/base/arccore/base/Real3x3.h.

References x.

◆ copy()

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

Returns a copy of the matrix.

Definition at line 161 of file arccore/src/base/arccore/base/Real3x3.h.

References Real3x3().

◆ determinant()

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

Determinant of the matrix.

Definition at line 368 of file arccore/src/base/arccore/base/Real3x3.h.

References x, y, and z.

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

◆ 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 147 of file arccore/src/base/arccore/base/Real3x3.h.

References Real3x3().

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

◆ 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 153 of file arccore/src/base/arccore/base/Real3x3.h.

References Real3x3().

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

◆ identity()

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

Constructs the identity matrix.

Definition at line 144 of file arccore/src/base/arccore/base/Real3x3.h.

References Real3x3().

◆ isNearlyZero()

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

Definition at line 52 of file MathReal3x3.h.

◆ null()

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

Constructs the null tensor.

Definition at line 138 of file arccore/src/base/arccore/base/Real3x3.h.

References Real3x3().

◆ 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 298 of file arccore/src/base/arccore/base/Real3x3.h.

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

◆ 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 349 of file arccore/src/base/arccore/base/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 317 of file arccore/src/base/arccore/base/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 360 of file arccore/src/base/arccore/base/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 328 of file arccore/src/base/arccore/base/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 257 of file arccore/src/base/arccore/base/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 273 of file arccore/src/base/arccore/base/Real3x3.h.

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

◆ operator+=()

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

Adds b to the triplet.

Definition at line 251 of file arccore/src/base/arccore/base/Real3x3.h.

References add(), and Real3x3().

◆ operator-() [1/2]

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

Creates a tensor opposite to the current tensor.

Definition at line 279 of file arccore/src/base/arccore/base/Real3x3.h.

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

◆ 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 276 of file arccore/src/base/arccore/base/Real3x3.h.

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

◆ operator-=()

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

Subtracts b from the triplet.

Definition at line 254 of file arccore/src/base/arccore/base/Real3x3.h.

References Real3x3(), and sub().

◆ operator/=()

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

Divides each component of the matrix by the real b.

Definition at line 265 of file arccore/src/base/arccore/base/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 123 of file arccore/src/base/arccore/base/Real3x3.h.

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

◆ 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 287 of file arccore/src/base/arccore/base/Real3x3.h.

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

Referenced by operator!=().

◆ 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 339 of file arccore/src/base/arccore/base/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 307 of file arccore/src/base/arccore/base/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 arccore/src/base/arccore/base/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 arccore/src/base/arccore/base/Real3x3.cc.

References x, y, and z.

Referenced by operator<<.

◆ reset()

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

Resets the coefficients of the matrix to zero.

Definition at line 164 of file arccore/src/base/arccore/base/Real3x3.h.

References Real3x3(), and zero().

◆ sub()

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

Subtracts b from the triplet.

Definition at line 224 of file arccore/src/base/arccore/base/Real3x3.h.

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

Referenced by operator-=().

◆ subSame()

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

Subtracts b from each component of the triplet.

Definition at line 242 of file arccore/src/base/arccore/base/Real3x3.h.

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

◆ 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 190 of file arccore/src/base/arccore/base/Real3x3.h.

References x.

◆ zero()

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

Constructs the zero matrix.

Definition at line 141 of file arccore/src/base/arccore/base/Real3x3.h.

References Real3x3().

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

◆ operator* [1/2]

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

Multiplication by a scalar.

Definition at line 386 of file arccore/src/base/arccore/base/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 392 of file arccore/src/base/arccore/base/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 398 of file arccore/src/base/arccore/base/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 409 of file arccore/src/base/arccore/base/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 374 of file arccore/src/base/arccore/base/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 380 of file arccore/src/base/arccore/base/Real3x3.h.

References assign(), and Real3x3().

Member Data Documentation

◆ x

◆ y

◆ z


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