Loading...
Searching...
No Matches
MatrixBlock< MatrixType > Class Template Reference

A templated block of an (m x n) matrix of type <MatrixType>. More...

#include <MatrixBlock.H>

Public Types

typedef MatrixType::cmptType cmptType
 The value type the Matrix contains.
typedef MatrixType::value_type value_type
 The value type the Matrix contains.
typedef MatrixType::size_type size_type
 The type to represent the size of a Matrix.

Public Member Functions

 MatrixBlock (const MatrixBlock &)=default
 Copy construct.
 MatrixBlock (MatrixType &matrix, const label m, const label n, const label mStart, const label nStart)
 Construct block for matrix, size and location.
label m () const noexcept
 Return the number of rows in the block.
label n () const noexcept
 Return the number of columns in the block.
label size () const noexcept
 The number of elements in the block (m*n).
labelPair sizes () const noexcept
 Return row/column sizes of the block.
const cmptTypeoperator() (const label i, const label j) const
 (i, j) const element access operator
cmptTypeoperator() (const label i, const label j)
 (i, j) element access operator
 operator Field< cmptType > () const
 Convert a column of a matrix to a Field.
void checkIndex (const label i, const label j) const
 Check if (i, j) is within range of row-column limits.
template<class Form>
void operator= (const Matrix< Form, cmptType > &)
 Assignment to a compatible matrix.
void operator= (const ConstMatrixBlock< MatrixType > &)
 Assignment to a compatible const block.
void operator= (const MatrixBlock< MatrixType > &)
 Assignment to a compatible block.
template<class MatrixType2>
void operator= (const ConstMatrixBlock< MatrixType2 > &)
 Assignment to a compatible const block.
template<class MatrixType2>
void operator= (const MatrixBlock< MatrixType2 > &)
 Assignment to a compatible block.
template<class MSForm, direction Nrows, direction Ncols>
void operator= (const MatrixSpace< MSForm, cmptType, Nrows, Ncols > &)
 Assignment to a compatible MatrixSpace.
template<template< class, direction, direction > class Block, class SubTensor, direction BRowStart, direction BColStart>
void operator= (const Block< SubTensor, BRowStart, BColStart > &)
 Assignment to a compatible MatrixSpace block.
template<class VSForm, direction Ncmpts>
void operator= (const VectorSpace< VSForm, cmptType, Ncmpts > &)
 Assignment to a compatible VectorSpace (column-vector).
template<template< class, direction > class Block, class SubVector, direction BStart>
void operator= (const Block< SubVector, BStart > &)
 Assignment to a compatible VectorSpace (column-vector) block.
void operator= (const Field< cmptType > &)
 Assignment to a Field (column-vector).
template<template< class, Foam::direction, Foam::direction > class MSBlock, class SubTensor, Foam::direction BRowStart, Foam::direction BColStart>
void operator= (const MSBlock< SubTensor, BRowStart, BColStart > &Mb)
template<template< class, Foam::direction > class VSBlock, class SubVector, Foam::direction BStart>
void operator= (const VSBlock< SubVector, BStart > &Mb)

Detailed Description

template<class MatrixType>
class Foam::MatrixBlock< MatrixType >

A templated block of an (m x n) matrix of type <MatrixType>.

Foam::ConstMatrixBlock: block of a const matrix Foam::MatrixBlock: block of a non-const matrix

The block may be assigned to a block of another matrix or to a VectorSpace or MatrixSpace e.g. tensor. Conversion of a column block to a Field<T> is also provide.

Source files

Definition at line 170 of file MatrixBlock.H.

Member Typedef Documentation

◆ cmptType

template<class MatrixType>
typedef MatrixType::cmptType cmptType

The value type the Matrix contains.

Definition at line 207 of file MatrixBlock.H.

◆ value_type

template<class MatrixType>
typedef MatrixType::value_type value_type

The value type the Matrix contains.

Definition at line 212 of file MatrixBlock.H.

◆ size_type

template<class MatrixType>
typedef MatrixType::size_type size_type

The type to represent the size of a Matrix.

Definition at line 217 of file MatrixBlock.H.

Constructor & Destructor Documentation

◆ MatrixBlock() [1/2]

template<class MatrixType>
MatrixBlock ( const MatrixBlock< MatrixType > & )
default

Copy construct.

References m(), MatrixBlock(), and n().

Referenced by MatrixBlock(), operator=(), and operator=().

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

◆ MatrixBlock() [2/2]

template<class MatrixType>
MatrixBlock ( MatrixType & matrix,
const label m,
const label n,
const label mStart,
const label nStart )
inline

Construct block for matrix, size and location.

Definition at line 53 of file MatrixBlockI.H.

References m(), and n().

Here is the call graph for this function:

Member Function Documentation

◆ m()

template<class MatrixType>
label m ( ) const
inlinenoexcept

Return the number of rows in the block.

Definition at line 248 of file MatrixBlock.H.

References Foam::noexcept.

Referenced by MatrixBlock(), and MatrixBlock().

Here is the caller graph for this function:

◆ n()

template<class MatrixType>
label n ( ) const
inlinenoexcept

Return the number of columns in the block.

Definition at line 253 of file MatrixBlock.H.

References Foam::noexcept.

Referenced by MatrixBlock(), and MatrixBlock().

Here is the caller graph for this function:

◆ size()

template<class MatrixType>
Foam::label size ( ) const
inlinenoexcept

The number of elements in the block (m*n).

Definition at line 90 of file MatrixBlockI.H.

References Foam::noexcept.

◆ sizes()

template<class MatrixType>
Foam::labelPair sizes ( ) const
inlinenoexcept

Return row/column sizes of the block.

Definition at line 106 of file MatrixBlockI.H.

References Foam::noexcept.

◆ operator()() [1/2]

template<class MatrixType>
const MatrixType::cmptType & operator() ( const label i,
const label j ) const
inline

(i, j) const element access operator

Definition at line 132 of file MatrixBlockI.H.

References checkIndex().

Referenced by operator Field< cmptType >(), operator=(), operator=(), operator=(), and operator=().

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

◆ operator()() [2/2]

template<class MatrixType>
MatrixType::cmptType & operator() ( const label i,
const label j )
inline

(i, j) element access operator

Definition at line 148 of file MatrixBlockI.H.

References checkIndex().

Here is the call graph for this function:

◆ operator Field< cmptType >()

template<class MatrixType>
operator Field< cmptType > ( ) const

Convert a column of a matrix to a Field.

Definition at line 48 of file MatrixBlock.C.

References Foam::abort(), f(), Foam::FatalError, FatalErrorInFunction, forAll, and operator()().

Here is the call graph for this function:

◆ checkIndex()

template<class MatrixType>
void checkIndex ( const label i,
const label j ) const

Check if (i, j) is within range of row-column limits.

Definition at line 117 of file MatrixBlock.C.

References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.

Referenced by operator()(), and operator()().

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

◆ operator=() [1/12]

template<class MatrixType>
template<class Form>
void operator= ( const Matrix< Form, cmptType > & Mb)

Assignment to a compatible matrix.

Definition at line 142 of file MatrixBlock.C.

References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.

Here is the call graph for this function:

◆ operator=() [2/12]

template<class MatrixType>
void operator= ( const ConstMatrixBlock< MatrixType > & Mb)

Assignment to a compatible const block.

Definition at line 167 of file MatrixBlock.C.

References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.

Here is the call graph for this function:

◆ operator=() [3/12]

template<class MatrixType>
void operator= ( const MatrixBlock< MatrixType > & Mb)

Assignment to a compatible block.

Definition at line 195 of file MatrixBlock.C.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and MatrixBlock().

Here is the call graph for this function:

◆ operator=() [4/12]

template<class MatrixType>
template<class MatrixType2>
void operator= ( const ConstMatrixBlock< MatrixType2 > & Mb)

Assignment to a compatible const block.

Definition at line 224 of file MatrixBlock.C.

References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.

Here is the call graph for this function:

◆ operator=() [5/12]

template<class MatrixType>
template<class MatrixType2>
void operator= ( const MatrixBlock< MatrixType2 > & Mb)

Assignment to a compatible block.

Definition at line 253 of file MatrixBlock.C.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and MatrixBlock().

Here is the call graph for this function:

◆ operator=() [6/12]

template<class MatrixType>
template<class MSForm, Foam::direction Nrows, Foam::direction Ncols>
void operator= ( const MatrixSpace< MSForm, cmptType, Nrows, Ncols > & ms)

Assignment to a compatible MatrixSpace.

Definition at line 342 of file MatrixBlock.C.

References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.

Here is the call graph for this function:

◆ operator=() [7/12]

template<class MatrixType>
template<template< class, direction, direction > class Block, class SubTensor, direction BRowStart, direction BColStart>
void operator= ( const Block< SubTensor, BRowStart, BColStart > & )

Assignment to a compatible MatrixSpace block.

◆ operator=() [8/12]

template<class MatrixType>
template<class VSForm, Foam::direction Ncmpts>
void operator= ( const VectorSpace< VSForm, cmptType, Ncmpts > & ms)

Assignment to a compatible VectorSpace (column-vector).

Definition at line 368 of file MatrixBlock.C.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and operator()().

Here is the call graph for this function:

◆ operator=() [9/12]

template<class MatrixType>
template<template< class, direction > class Block, class SubVector, direction BStart>
void operator= ( const Block< SubVector, BStart > & )

Assignment to a compatible VectorSpace (column-vector) block.

◆ operator=() [10/12]

template<class MatrixType>
void operator= ( const Field< cmptType > & f)

Assignment to a Field (column-vector).

Definition at line 390 of file MatrixBlock.C.

References Foam::abort(), f(), Foam::FatalError, FatalErrorInFunction, forAll, and operator()().

Here is the call graph for this function:

◆ operator=() [11/12]

template<class MatrixType>
template<template< class, Foam::direction, Foam::direction > class MSBlock, class SubTensor, Foam::direction BRowStart, Foam::direction BColStart>
void operator= ( const MSBlock< SubTensor, BRowStart, BColStart > & Mb)

Definition at line 288 of file MatrixBlock.C.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and operator()().

Here is the call graph for this function:

◆ operator=() [12/12]

template<class MatrixType>
template<template< class, Foam::direction > class VSBlock, class SubVector, Foam::direction BStart>
void operator= ( const VSBlock< SubVector, BStart > & Mb)

Definition at line 319 of file MatrixBlock.C.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and operator()().

Here is the call graph for this function:

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