MatrixBlock< MatrixType > Class Template Reference

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

Public Types

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

Public Member Functions

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

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 62 of file Matrix.H.

Member Typedef Documentation

◆ cmptType

typedef MatrixType::cmptType cmptType

The value type the Matrix contains.

Definition at line 207 of file MatrixBlock.H.

◆ value_type

typedef MatrixType::value_type value_type

The value type the Matrix contains.

Definition at line 212 of file MatrixBlock.H.

◆ size_type

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]

MatrixBlock ( const MatrixBlock< MatrixType > &  )
default

Copy construct.

◆ MatrixBlock() [2/2]

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

Member Function Documentation

◆ m()

label m ( ) const
inlinenoexcept

Return the number of rows in the block.

Definition at line 248 of file MatrixBlock.H.

◆ n()

label n ( ) const
inlinenoexcept

Return the number of columns in the block.

Definition at line 253 of file MatrixBlock.H.

◆ size()

Foam::label size ( ) const
inlinenoexcept

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

Definition at line 90 of file MatrixBlockI.H.

◆ sizes()

Foam::labelPair sizes ( ) const
inlinenoexcept

Return row/column sizes of the block.

Definition at line 106 of file MatrixBlockI.H.

◆ operator()() [1/2]

const MatrixType::cmptType & operator() ( const label  i,
const label  j 
) const
inline

(i, j) const element access operator

Definition at line 133 of file MatrixBlockI.H.

◆ operator()() [2/2]

MatrixType::cmptType & operator() ( const label  i,
const label  j 
)
inline

(i, j) element access operator

Definition at line 149 of file MatrixBlockI.H.

◆ operator Field< cmptType >()

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, and forAll.

Here is the call graph for this function:

◆ checkIndex()

void checkIndex ( const label  i,
const label  j 
) const

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

Definition at line 118 of file MatrixBlock.C.

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

Here is the call graph for this function:

◆ operator=() [1/10]

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

Assignment to a compatible matrix.

Definition at line 143 of file MatrixBlock.C.

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

Here is the call graph for this function:

◆ operator=() [2/10]

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

Assignment to a compatible const block.

Definition at line 168 of file MatrixBlock.C.

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

Here is the call graph for this function:

◆ operator=() [3/10]

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

Assignment to a compatible block.

Definition at line 196 of file MatrixBlock.C.

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

Here is the call graph for this function:

◆ operator=() [4/10]

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

Assignment to a compatible const block.

Definition at line 225 of file MatrixBlock.C.

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

Here is the call graph for this function:

◆ operator=() [5/10]

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

Assignment to a compatible block.

Definition at line 254 of file MatrixBlock.C.

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

Here is the call graph for this function:

◆ operator=() [6/10]

void operator= ( const MatrixSpace< MSForm, cmptType, Nrows, Ncols > &  ms)

Assignment to a compatible MatrixSpace.

Definition at line 343 of file MatrixBlock.C.

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

Here is the call graph for this function:

◆ operator=() [7/10]

void operator= ( const MSBlock< SubTensor, BRowStart, BColStart > &  Mb)

Assignment to a compatible MatrixSpace block.

Definition at line 289 of file MatrixBlock.C.

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

Here is the call graph for this function:

◆ operator=() [8/10]

void operator= ( const VectorSpace< VSForm, cmptType, Ncmpts > &  ms)

Assignment to a compatible VectorSpace (column-vector)

Definition at line 369 of file MatrixBlock.C.

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

Here is the call graph for this function:

◆ operator=() [9/10]

void operator= ( const VSBlock< SubVector, BStart > &  Mb)

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

Definition at line 320 of file MatrixBlock.C.

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

Here is the call graph for this function:

◆ operator=() [10/10]

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, and forAll.

Here is the call graph for this function:

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