MatrixSpace< Form, Cmpt, Mrows, Ncols > Class Template Reference

Templated matrix space. More...

Inheritance diagram for MatrixSpace< Form, Cmpt, Mrows, Ncols >:
[legend]
Collaboration diagram for MatrixSpace< Form, Cmpt, Mrows, Ncols >:
[legend]

Classes

class  Block
 Sub-block type. More...
 
class  ConstBlock
 Const sub-block type. More...
 

Public Types

typedef MatrixSpace< Form, Cmpt, Mrows, Ncols > msType
 MatrixSpace type. More...
 
- Public Types inherited from VectorSpace< Form, Cmpt, Mrows *Ncols >
typedef VectorSpace< Form, Cmpt, Ncmpts > vsType
 VectorSpace type. More...
 
typedef Cmpt cmptType
 Component type. More...
 
typedef Cmpt magType
 Magnitude type. More...
 
typedef Cmpt * iterator
 Random access iterator for traversing VectorSpace. More...
 
typedef const Cmpt * const_iterator
 Random access iterator for traversing VectorSpace. More...
 

Public Member Functions

 MatrixSpace ()=default
 Default construct. More...
 
 MatrixSpace (const Foam::zero)
 Construct initialized to zero. More...
 
template<class Form2 , class Cmpt2 >
 MatrixSpace (const VectorSpace< Form2, Cmpt2, Mrows *Ncols > &)
 Construct as copy of a VectorSpace with the same size. More...
 
template<template< class, direction, direction > class Block2, direction BRowStart, direction BColStart>
 MatrixSpace (const Block2< Form, BRowStart, BColStart > &block)
 Construct from a block of another matrix space. More...
 
 MatrixSpace (Istream &is)
 Construct from Istream. More...
 
template<direction Row, direction Col>
const Cmpt & elmt () const
 Fast const element access using compile-time addressing. More...
 
template<direction Row, direction Col>
Cmpt & elmt ()
 Fast element access using compile-time addressing. More...
 
const Cmpt & xx () const
 
const Cmpt & xy () const
 
const Cmpt & xz () const
 
const Cmpt & yx () const
 
const Cmpt & yy () const
 
const Cmpt & yz () const
 
const Cmpt & zx () const
 
const Cmpt & zy () const
 
const Cmpt & zz () const
 
Cmpt & xx ()
 
Cmpt & xy ()
 
Cmpt & xz ()
 
Cmpt & yx ()
 
Cmpt & yy ()
 
Cmpt & yz ()
 
Cmpt & zx ()
 
Cmpt & zy ()
 
Cmpt & zz ()
 
typeOfTranspose< Cmpt, Form >::type T () const
 Return the transpose of the matrix. More...
 
template<class SubTensor , direction BRowStart, direction BColStart>
ConstBlock< SubTensor, BRowStart, BColStart > block () const
 Return a const sub-block corresponding to the specified type. More...
 
template<class SubTensor , direction BRowStart, direction BColStart>
Block< SubTensor, BRowStart, BColStart > block ()
 Return a sub-block corresponding to the specified type. More...
 
const Cmpt & operator() (const direction &i, const direction &j) const
 (i, j) const element access operator More...
 
Cmpt & operator() (const direction &i, const direction &j)
 (i, j) element access operator More...
 
void operator= (const Foam::zero)
 Assignment to zero. More...
 
template<template< class, direction, direction > class Block2, direction BRowStart, direction BColStart>
void operator= (const Block2< Form, BRowStart, BColStart > &block)
 Assignment to a block of another matrix space. More...
 
template<class Form2 >
void operator&= (const MatrixSpace< Form, Cmpt, Ncols, Ncols > &matrix)
 Inner product with a compatible square matrix. More...
 
template<class SubTensor , Foam::direction BRowStart, Foam::direction BColStart>
Foam::MatrixSpace< Form, Cmpt, Mrows, Ncols >::template ConstBlock< SubTensor, BRowStart, BColStart > block () const
 
template<class SubTensor , Foam::direction BRowStart, Foam::direction BColStart>
Foam::MatrixSpace< Form, Cmpt, Mrows, Ncols >::template Block< SubTensor, BRowStart, BColStart > block ()
 
- Public Member Functions inherited from VectorSpace< Form, Cmpt, Mrows *Ncols >
 VectorSpace ()=default
 Default construct. More...
 
 VectorSpace (const Foam::zero)
 Construct initialized to zero. More...
 
 VectorSpace (const VectorSpace< Form, Cmpt, Ncmpts > &vs)
 Copy construct. More...
 
 VectorSpace (const VectorSpace< Form2, Cmpt2, Ncmpts > &)
 Copy construct of a VectorSpace with the same size. More...
 
 VectorSpace (Istream &is)
 Construct from Istream. More...
 
const Cmpt & component (const direction) const
 
Cmpt & component (const direction)
 
void component (Cmpt &, const direction) const
 
void replace (const direction, const Cmpt &)
 
const Cmpt * cdata () const noexcept
 Return const pointer to the first data element. More...
 
Cmpt * data () noexcept
 Return pointer to the first data element. More...
 
const ConstBlock< SubVector, BStart > block () const
 
const Foam::VectorSpace< Form, Cmpt, Ncmpts >::template ConstBlock< SubVector, BStart > block () const
 
const Cmpt & operator[] (const direction) const
 
Cmpt & operator[] (const direction)
 
void operator= (const VectorSpace< Form, Cmpt, Ncmpts > &)
 
void operator= (const Foam::zero)
 
void operator+= (const VectorSpace< Form, Cmpt, Ncmpts > &)
 
void operator-= (const VectorSpace< Form, Cmpt, Ncmpts > &)
 
void operator*= (const scalar)
 
void operator/= (const scalar)
 
iterator begin () noexcept
 Return an iterator to begin of VectorSpace. More...
 
const_iterator begin () const noexcept
 Return const_iterator to begin of VectorSpace. More...
 
iterator end () noexcept
 Return an iterator to end of VectorSpace. More...
 
const_iterator end () const noexcept
 Return const_iterator to end of VectorSpace. More...
 
const_iterator cbegin () const noexcept
 Return const_iterator to begin of VectorSpace. More...
 
const_iterator cend () const noexcept
 Return const_iterator to end of VectorSpace. More...
 

Static Public Member Functions

static direction m () noexcept
 The number of rows. More...
 
static direction n () noexcept
 The number of columns. More...
 
static msType identity ()
 An identity matrix for square matrix-spaces. More...
 
- Static Public Member Functions inherited from VectorSpace< Form, Cmpt, Mrows *Ncols >
static constexpr direction size () noexcept
 The number of elements in the VectorSpace = Ncmpts. More...
 
static Form uniform (const Cmpt &s)
 Return a VectorSpace with all elements = s. More...
 

Static Public Attributes

static constexpr direction mRows = Mrows
 
static constexpr direction nCols = Ncols
 
- Static Public Attributes inherited from VectorSpace< Form, Cmpt, Mrows *Ncols >
static constexpr direction dim
 Dimensionality of space. More...
 
static constexpr direction nComponents
 Number of components in this vector space. More...
 
static constexpr direction mRows
 
static constexpr direction nCols
 
static const char *const typeName
 
static const char *const componentNames []
 
static const Form zero
 
static const Form one
 
static const Form max
 
static const Form min
 
static const Form rootMax
 
static const Form rootMin
 

Additional Inherited Members

- Public Attributes inherited from VectorSpace< Form, Cmpt, Mrows *Ncols >
Cmpt v_ [Ncmpts]
 The components of this vector space. More...
 

Detailed Description

template<class Form, class Cmpt, direction Mrows, direction Ncols>
class Foam::MatrixSpace< Form, Cmpt, Mrows, Ncols >

Templated matrix space.

Template arguments are the Form the matrix space will be used to create, the type of the elements and the number of rows and columns of the matrix.

Source files
See also
Foam::VectorSpace

Definition at line 58 of file MatrixSpace.H.

Member Typedef Documentation

◆ msType

typedef MatrixSpace<Form, Cmpt, Mrows, Ncols> msType

MatrixSpace type.

Definition at line 67 of file MatrixSpace.H.

Constructor & Destructor Documentation

◆ MatrixSpace() [1/5]

MatrixSpace ( )
default

Default construct.

◆ MatrixSpace() [2/5]

MatrixSpace ( const Foam::zero  )
inline

Construct initialized to zero.

Definition at line 33 of file MatrixSpaceI.H.

◆ MatrixSpace() [3/5]

MatrixSpace ( const VectorSpace< Form2, Cmpt2, Mrows *Ncols > &  vs)
inlineexplicit

Construct as copy of a VectorSpace with the same size.

Definition at line 44 of file MatrixSpaceI.H.

◆ MatrixSpace() [4/5]

MatrixSpace ( const Block2< Form, BRowStart, BColStart > &  block)
inline

Construct from a block of another matrix space.

Definition at line 60 of file MatrixSpaceI.H.

◆ MatrixSpace() [5/5]

MatrixSpace ( Istream is)
inlineexplicit

Construct from Istream.

Definition at line 76 of file MatrixSpaceI.H.

Member Function Documentation

◆ m()

static direction m ( )
inlinestaticnoexcept

The number of rows.

Definition at line 79 of file MatrixSpace.H.

◆ n()

static direction n ( )
inlinestaticnoexcept

The number of columns.

Definition at line 85 of file MatrixSpace.H.

◆ identity()

Foam::MatrixSpace< Form, Cmpt, Mrows, Ncols > identity
inlinestatic

An identity matrix for square matrix-spaces.

Definition at line 270 of file MatrixSpaceI.H.

◆ elmt() [1/2]

const Cmpt & elmt
inline

Fast const element access using compile-time addressing.

Definition at line 128 of file MatrixSpaceI.H.

References VectorSpace< Form, Cmpt, Mrows *Ncols >::v_.

◆ elmt() [2/2]

Cmpt & elmt
inline

Fast element access using compile-time addressing.

Definition at line 137 of file MatrixSpaceI.H.

References VectorSpace< Form, Cmpt, Mrows *Ncols >::v_.

◆ xx() [1/2]

const Cmpt & xx
inline

Definition at line 145 of file MatrixSpaceI.H.

Referenced by Rs::jcalc(), Rxyz::jcalc(), Ryxz::jcalc(), and Rzyx::jcalc().

Here is the caller graph for this function:

◆ xy() [1/2]

const Cmpt & xy
inline

Definition at line 159 of file MatrixSpaceI.H.

Referenced by Rxyz::jcalc(), and Ryxz::jcalc().

Here is the caller graph for this function:

◆ xz() [1/2]

const Cmpt & xz
inline

Definition at line 173 of file MatrixSpaceI.H.

Referenced by Rzyx::jcalc().

Here is the caller graph for this function:

◆ yx() [1/2]

const Cmpt & yx
inline

Definition at line 187 of file MatrixSpaceI.H.

Referenced by Rxyz::jcalc(), Ryxz::jcalc(), and Rzyx::jcalc().

Here is the caller graph for this function:

◆ yy() [1/2]

const Cmpt & yy
inline

Definition at line 201 of file MatrixSpaceI.H.

Referenced by Rs::jcalc(), Rxyz::jcalc(), Ryxz::jcalc(), and Rzyx::jcalc().

Here is the caller graph for this function:

◆ yz() [1/2]

const Cmpt & yz
inline

Definition at line 215 of file MatrixSpaceI.H.

◆ zx() [1/2]

const Cmpt & zx
inline

Definition at line 229 of file MatrixSpaceI.H.

Referenced by Rxyz::jcalc(), Ryxz::jcalc(), and Rzyx::jcalc().

Here is the caller graph for this function:

◆ zy() [1/2]

const Cmpt & zy
inline

Definition at line 243 of file MatrixSpaceI.H.

Referenced by Rzyx::jcalc().

Here is the caller graph for this function:

◆ zz() [1/2]

const Cmpt & zz
inline

Definition at line 257 of file MatrixSpaceI.H.

Referenced by Rs::jcalc(), Rxyz::jcalc(), and Ryxz::jcalc().

Here is the caller graph for this function:

◆ xx() [2/2]

Cmpt & xx
inline

Definition at line 152 of file MatrixSpaceI.H.

◆ xy() [2/2]

Cmpt & xy
inline

Definition at line 166 of file MatrixSpaceI.H.

◆ xz() [2/2]

Cmpt & xz
inline

Definition at line 180 of file MatrixSpaceI.H.

◆ yx() [2/2]

Cmpt & yx
inline

Definition at line 194 of file MatrixSpaceI.H.

◆ yy() [2/2]

Cmpt & yy
inline

Definition at line 208 of file MatrixSpaceI.H.

◆ yz() [2/2]

Cmpt & yz
inline

Definition at line 222 of file MatrixSpaceI.H.

◆ zx() [2/2]

Cmpt & zx
inline

Definition at line 236 of file MatrixSpaceI.H.

◆ zy() [2/2]

Cmpt & zy
inline

Definition at line 250 of file MatrixSpaceI.H.

◆ zz() [2/2]

Cmpt & zz
inline

Definition at line 263 of file MatrixSpaceI.H.

◆ T()

Foam::typeOfTranspose< Cmpt, Form >::type T
inline

Return the transpose of the matrix.

Definition at line 286 of file MatrixSpaceI.H.

Referenced by Foam::T().

Here is the caller graph for this function:

◆ block() [1/4]

ConstBlock< SubTensor, BRowStart, BColStart > block ( ) const
inline

Return a const sub-block corresponding to the specified type.

starting at the specified row and column

Referenced by MatrixSpace< Form, Cmpt, Mrows, Ncols >::operator=().

Here is the caller graph for this function:

◆ block() [2/4]

Block< SubTensor, BRowStart, BColStart > block ( )
inline

Return a sub-block corresponding to the specified type.

starting at the specified row and column

◆ operator()() [1/2]

const Cmpt & operator() ( const direction i,
const direction j 
) const
inline

(i, j) const element access operator

Definition at line 336 of file MatrixSpaceI.H.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and VectorSpace< Form, Cmpt, Mrows *Ncols >::v_.

Referenced by MatrixSpace< Form, Cmpt, Mrows, Ncols >::Block< SubTensor, BRowStart, BColStart >::operator()(), MatrixSpace< BarycentricTensor< Cmpt >, Cmpt, 4, 3 >::operator()(), MatrixSpace< Form, Cmpt, Mrows, Ncols >::operator=(), and MatrixSpace< Form, Cmpt, Mrows, Ncols >::Block< SubTensor, BRowStart, BColStart >::operator=().

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

◆ operator()() [2/2]

Cmpt & operator() ( const direction i,
const direction j 
)
inline

(i, j) element access operator

Definition at line 356 of file MatrixSpaceI.H.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and VectorSpace< Form, Cmpt, Mrows *Ncols >::v_.

Here is the call graph for this function:

◆ operator=() [1/2]

void operator= ( const Foam::zero  )
inline

Assignment to zero.

Definition at line 441 of file MatrixSpaceI.H.

References VectorSpace< Form, Cmpt, Ncmpts >::operator=(), and Foam::Zero.

Here is the call graph for this function:

◆ operator=() [2/2]

void operator= ( const Block2< Form, BRowStart, BColStart > &  block)
inline

Assignment to a block of another matrix space.

Definition at line 468 of file MatrixSpaceI.H.

References MatrixSpace< Form, Cmpt, Mrows, Ncols >::block(), and MatrixSpace< Form, Cmpt, Mrows, Ncols >::operator()().

Here is the call graph for this function:

◆ operator&=()

void operator&= ( const MatrixSpace< Form, Cmpt, Ncols, Ncols > &  matrix)
inline

Inner product with a compatible square matrix.

Definition at line 452 of file MatrixSpaceI.H.

◆ block() [3/4]

Foam::MatrixSpace< Form, Cmpt, Mrows, Ncols >::template ConstBlock< SubTensor, BRowStart, BColStart > block ( ) const
inline

Definition at line 311 of file MatrixSpaceI.H.

◆ block() [4/4]

Foam::MatrixSpace< Form, Cmpt, Mrows, Ncols >::template Block< SubTensor, BRowStart, BColStart > block ( )
inline

Definition at line 327 of file MatrixSpaceI.H.

Member Data Documentation

◆ mRows

◆ nCols


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