Loading...
Searching...
No Matches
MatrixSpace< Form, Cmpt, Mrows, Ncols > Class Template Reference

Templated matrix space. More...

#include <MatrixSpace.H>

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

Classes

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

Public Types

typedef MatrixSpace< Form, Cmpt, Mrows, Ncols > msType
 MatrixSpace type.
Public Types inherited from VectorSpace< Form, Cmpt, Mrows *Ncols >
typedef VectorSpace< Form, Cmpt, Ncmpts > vsType
 VectorSpace type.
typedef Cmpt cmptType
 Component type.
typedef Cmpt magType
 Magnitude type.
typedef direction size_type
 The type to represent the size of a VectorSpace.
typedef Cmpt * iterator
 Random access iterator for traversing VectorSpace.
typedef const Cmpt * const_iterator
 Random access iterator for traversing VectorSpace.

Public Member Functions

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

Static Public Member Functions

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

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.
static constexpr direction nComponents
 Number of components in this vector space.
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.

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 54 of file MatrixSpace.H.

Member Typedef Documentation

◆ msType

template<class Form, class Cmpt, direction Mrows, direction Ncols>
typedef MatrixSpace<Form, Cmpt, Mrows, Ncols> msType

MatrixSpace type.

Definition at line 65 of file MatrixSpace.H.

Constructor & Destructor Documentation

◆ MatrixSpace() [1/5]

template<class Form, class Cmpt, direction Mrows, direction Ncols>
MatrixSpace ( )
default

◆ MatrixSpace() [2/5]

template<class Form, class Cmpt, Foam::direction Mrows, Foam::direction Ncols>
MatrixSpace ( Foam::zero )
inline

Construct initialized to zero.

Definition at line 26 of file MatrixSpaceI.H.

References MatrixSpace(), and VectorSpace< Form, Cmpt, Mrows *Ncols >::zero.

Here is the call graph for this function:

◆ MatrixSpace() [3/5]

template<class Form, class Cmpt, Foam::direction Mrows, Foam::direction Ncols>
template<class Form2, class Cmpt2>
MatrixSpace ( const VectorSpace< Form2, Cmpt2, Mrows *Ncols > & vs)
inlineexplicit

Construct as copy of a VectorSpace with the same size.

Definition at line 37 of file MatrixSpaceI.H.

References MatrixSpace(), and VectorSpace< Form, Cmpt, Mrows *Ncols >::VectorSpace().

Here is the call graph for this function:

◆ MatrixSpace() [4/5]

template<class Form, class Cmpt, Foam::direction Mrows, Foam::direction Ncols>
template<template< class, Foam::direction, Foam::direction > class Block2, Foam::direction BRowStart, Foam::direction BColStart>
MatrixSpace ( const Block2< Form, BRowStart, BColStart > & block)
inline

Construct from a block of another matrix space.

Definition at line 53 of file MatrixSpaceI.H.

References block(), and operator()().

Here is the call graph for this function:

◆ MatrixSpace() [5/5]

template<class Form, class Cmpt, Foam::direction Mrows, Foam::direction Ncols>
MatrixSpace ( Istream & is)
inlineexplicit

Construct from Istream.

Definition at line 69 of file MatrixSpaceI.H.

References MatrixSpace().

Here is the call graph for this function:

Member Function Documentation

◆ m()

template<class Form, class Cmpt, direction Mrows, direction Ncols>
direction m ( )
inlinestaticnoexcept

The number of rows.

Definition at line 79 of file MatrixSpace.H.

References Foam::noexcept.

◆ n()

template<class Form, class Cmpt, direction Mrows, direction Ncols>
direction n ( )
inlinestaticnoexcept

The number of columns.

Definition at line 84 of file MatrixSpace.H.

References Foam::noexcept.

◆ identity()

template<class Form, class Cmpt, Foam::direction Mrows, Foam::direction Ncols>
Foam::MatrixSpace< Form, Cmpt, Mrows, Ncols > identity ( )
inlinestatic

An identity matrix for square matrix-spaces.

Definition at line 141 of file MatrixSpaceI.H.

References Foam::Zero.

◆ elmt() [1/2]

template<class Form, class Cmpt, Foam::direction Mrows, Foam::direction Ncols>
template<Foam::direction Row, Foam::direction Col>
const Cmpt & elmt ( ) const
inlinenoexcept

Fast const element access using compile-time addressing.

Definition at line 121 of file MatrixSpaceI.H.

References Foam::noexcept.

Referenced by MatrixSpace(), xx(), xx(), xy(), xy(), xz(), xz(), yx(), yx(), yy(), yy(), yz(), yz(), zx(), zx(), zy(), zy(), zz(), and zz().

Here is the caller graph for this function:

◆ elmt() [2/2]

template<class Form, class Cmpt, Foam::direction Mrows, Foam::direction Ncols>
template<Foam::direction Row, Foam::direction Col>
Cmpt & elmt ( )
inlinenoexcept

Fast element access using compile-time addressing.

Definition at line 131 of file MatrixSpaceI.H.

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

◆ xx() [1/2]

template<class Form, class Cmpt, direction Mrows, direction Ncols>
const Cmpt & xx ( ) const
inlinenoexcept

Definition at line 284 of file MatrixSpace.H.

References elmt(), Foam::noexcept, and xx().

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

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

◆ xy() [1/2]

template<class Form, class Cmpt, direction Mrows, direction Ncols>
const Cmpt & xy ( ) const
inlinenoexcept

Definition at line 285 of file MatrixSpace.H.

References elmt(), and Foam::noexcept.

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

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

◆ xz() [1/2]

template<class Form, class Cmpt, direction Mrows, direction Ncols>
const Cmpt & xz ( ) const
inlinenoexcept

Definition at line 286 of file MatrixSpace.H.

References elmt(), and Foam::noexcept.

Referenced by Rzyx::jcalc().

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

◆ yx() [1/2]

template<class Form, class Cmpt, direction Mrows, direction Ncols>
const Cmpt & yx ( ) const
inlinenoexcept

Definition at line 287 of file MatrixSpace.H.

References elmt(), and Foam::noexcept.

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

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

◆ yy() [1/2]

template<class Form, class Cmpt, direction Mrows, direction Ncols>
const Cmpt & yy ( ) const
inlinenoexcept

Definition at line 288 of file MatrixSpace.H.

References elmt(), and Foam::noexcept.

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

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

◆ yz() [1/2]

template<class Form, class Cmpt, direction Mrows, direction Ncols>
const Cmpt & yz ( ) const
inlinenoexcept

Definition at line 289 of file MatrixSpace.H.

References elmt(), and Foam::noexcept.

Here is the call graph for this function:

◆ zx() [1/2]

template<class Form, class Cmpt, direction Mrows, direction Ncols>
const Cmpt & zx ( ) const
inlinenoexcept

Definition at line 290 of file MatrixSpace.H.

References elmt(), and Foam::noexcept.

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

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

◆ zy() [1/2]

template<class Form, class Cmpt, direction Mrows, direction Ncols>
const Cmpt & zy ( ) const
inlinenoexcept

Definition at line 291 of file MatrixSpace.H.

References elmt(), and Foam::noexcept.

Referenced by Rzyx::jcalc().

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

◆ zz() [1/2]

template<class Form, class Cmpt, direction Mrows, direction Ncols>
const Cmpt & zz ( ) const
inlinenoexcept

Definition at line 292 of file MatrixSpace.H.

References elmt(), and Foam::noexcept.

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

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

◆ xx() [2/2]

template<class Form, class Cmpt, direction Mrows, direction Ncols>
Cmpt & xx ( )
inlinenoexcept

Definition at line 298 of file MatrixSpace.H.

References elmt(), and Foam::noexcept.

Here is the call graph for this function:

◆ xy() [2/2]

template<class Form, class Cmpt, direction Mrows, direction Ncols>
Cmpt & xy ( )
inlinenoexcept

Definition at line 299 of file MatrixSpace.H.

References elmt(), and Foam::noexcept.

Here is the call graph for this function:

◆ xz() [2/2]

template<class Form, class Cmpt, direction Mrows, direction Ncols>
Cmpt & xz ( )
inlinenoexcept

Definition at line 300 of file MatrixSpace.H.

References elmt(), and Foam::noexcept.

Here is the call graph for this function:

◆ yx() [2/2]

template<class Form, class Cmpt, direction Mrows, direction Ncols>
Cmpt & yx ( )
inlinenoexcept

Definition at line 301 of file MatrixSpace.H.

References elmt(), and Foam::noexcept.

Here is the call graph for this function:

◆ yy() [2/2]

template<class Form, class Cmpt, direction Mrows, direction Ncols>
Cmpt & yy ( )
inlinenoexcept

Definition at line 302 of file MatrixSpace.H.

References elmt(), and Foam::noexcept.

Here is the call graph for this function:

◆ yz() [2/2]

template<class Form, class Cmpt, direction Mrows, direction Ncols>
Cmpt & yz ( )
inlinenoexcept

Definition at line 303 of file MatrixSpace.H.

References elmt(), and Foam::noexcept.

Here is the call graph for this function:

◆ zx() [2/2]

template<class Form, class Cmpt, direction Mrows, direction Ncols>
Cmpt & zx ( )
inlinenoexcept

Definition at line 304 of file MatrixSpace.H.

References elmt(), and Foam::noexcept.

Here is the call graph for this function:

◆ zy() [2/2]

template<class Form, class Cmpt, direction Mrows, direction Ncols>
Cmpt & zy ( )
inlinenoexcept

Definition at line 305 of file MatrixSpace.H.

References elmt(), and Foam::noexcept.

Here is the call graph for this function:

◆ zz() [2/2]

template<class Form, class Cmpt, direction Mrows, direction Ncols>
Cmpt & zz ( )
inlinenoexcept

Definition at line 306 of file MatrixSpace.H.

References elmt(), and Foam::noexcept.

Here is the call graph for this function:

◆ T()

template<class Form, class Cmpt, Foam::direction Mrows, Foam::direction Ncols>
Foam::typeOfTranspose< Cmpt, Form >::type T ( ) const
inline

Return the transpose of the matrix.

Definition at line 157 of file MatrixSpaceI.H.

References operator()().

Referenced by Foam::T().

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

◆ block() [1/4]

template<class Form, class Cmpt, direction Mrows, direction Ncols>
template<class SubTensor, direction BRowStart, direction BColStart>
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 block(), MatrixSpace(), MatrixSpace(), operator=(), and Tensor< scalar >::Tensor().

Here is the caller graph for this function:

◆ block() [2/4]

template<class Form, class Cmpt, direction Mrows, direction Ncols>
template<class SubTensor, direction BRowStart, direction BColStart>
Block< SubTensor, BRowStart, BColStart > block ( )
inline

Return a sub-block corresponding to the specified type.

starting at the specified row and column

References block(), and MatrixSpace().

Here is the call graph for this function:

◆ operator()() [1/2]

template<class Form, class Cmpt, Foam::direction Mrows, Foam::direction Ncols>
const Cmpt & operator() ( const direction i,
const direction j ) const
inline

◆ operator()() [2/2]

template<class Form, class Cmpt, Foam::direction Mrows, Foam::direction Ncols>
Cmpt & operator() ( const direction i,
const direction j )
inline

(i, j) element access operator

Definition at line 227 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]

template<class Form, class Cmpt, Foam::direction Mrows, Foam::direction Ncols>
void operator= ( Foam::zero )
inline

Assignment to zero.

Definition at line 312 of file MatrixSpaceI.H.

References VectorSpace< Form, Cmpt, Mrows *Ncols >::operator, and VectorSpace< Form, Cmpt, Ncmpts >::operator=().

Here is the call graph for this function:

◆ operator=() [2/2]

template<class Form, class Cmpt, Foam::direction Mrows, Foam::direction Ncols>
template<template< class, Foam::direction, Foam::direction > class Block2, Foam::direction BRowStart, Foam::direction BColStart>
void operator= ( const Block2< Form, BRowStart, BColStart > & block)
inline

Assignment to a block of another matrix space.

Definition at line 339 of file MatrixSpaceI.H.

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

Here is the call graph for this function:

◆ operator&=()

template<class Form, class Cmpt, Foam::direction Mrows, Foam::direction Ncols>
template<class Form2>
void operator&= ( const MatrixSpace< Form, Cmpt, Ncols, Ncols > & matrix)
inline

Inner product with a compatible square matrix.

Definition at line 323 of file MatrixSpaceI.H.

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

Here is the call graph for this function:

◆ block() [3/4]

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

Definition at line 182 of file MatrixSpaceI.H.

◆ block() [4/4]

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

Definition at line 198 of file MatrixSpaceI.H.

Member Data Documentation

◆ mRows

◆ nCols

template<class Form, class Cmpt, direction Mrows, direction Ncols>
direction nCols = Ncols
staticconstexpr

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