Matrix< Form, Type > Class Template Reference

A templated (m x n) matrix of objects of <T>. The layout is (mRows x nCols) - row-major order: More...

Inheritance diagram for Matrix< Form, Type >:
[legend]
Collaboration diagram for Matrix< Form, Type >:
[legend]

Public Types

typedef Matrix< Form, Type > mType
 Matrix type. More...
 
typedef Type cmptType
 Component type. More...
 
typedef Type * iterator
 Random access iterator for traversing a Matrix. More...
 

Public Member Functions

 Matrix () noexcept
 Default construct (empty matrix) More...
 
 Matrix (const label m, const label n)
 Construct given number of rows/columns. More...
 
 Matrix (const label m, const label n, const Foam::zero)
 
 Matrix (const label m, const label n, const Type &val)
 
 Matrix (const labelPair &dims)
 Construct given number of rows/columns. More...
 
 Matrix (const labelPair &dims, const Foam::zero)
 
 Matrix (const labelPair &dims, const Type &val)
 
 Matrix (const Matrix< Form, Type > &mat)
 Copy construct. More...
 
 Matrix (Matrix< Form, Type > &&mat)
 Move construct. More...
 
template<class Form2 >
 Matrix (const Matrix< Form2, Type > &mat)
 Copy constructor from Matrix of a different form. More...
 
template<class MatrixType >
 Matrix (const ConstMatrixBlock< MatrixType > &Mb)
 Construct from a block of another Matrix. More...
 
template<class MatrixType >
 Matrix (const MatrixBlock< MatrixType > &Mb)
 Construct from a block of another Matrix. More...
 
 Matrix (Istream &is)
 Construct from Istream. More...
 
autoPtr< mTypeclone () const
 Clone. More...
 
 ~Matrix ()
 Destructor. More...
 
label m () const noexcept
 The number of rows. More...
 
label n () const noexcept
 The number of columns. More...
 
label size () const
 The number of elements in Matrix (m*n) More...
 
labelPair sizes () const
 Return row/column sizes. More...
 
bool empty () const noexcept
 Return true if Matrix is empty (i.e., size() is zero) More...
 
const Type * cdata () const noexcept
 
Type * data () noexcept
 
const char * cdata_bytes () const noexcept
 
char * data_bytes () noexcept
 
std::streamsize size_bytes () const noexcept
 
std::streamsize byteSize () const
 
const Type * rowData (const label irow) const
 Return const pointer to data in the specified row. More...
 
Type * rowData (const label irow)
 Return pointer to data in the specified row. More...
 
const Type & at (const label idx) const
 Linear addressing const element access. More...
 
Type & at (const label idx)
 Linear addressing element access. More...
 
ConstMatrixBlock< mTypesubColumn (const label colIndex, const label rowIndex=0, label len=-1) const
 Return const column or column's subset of Matrix. More...
 
ConstMatrixBlock< mTypesubRow (const label rowIndex, const label colIndex=0, label len=-1) const
 Return const row or const row's subset of Matrix. More...
 
ConstMatrixBlock< mTypesubMatrix (const label rowIndex, const label colIndex, label szRows=-1, label szCols=-1) const
 Return const sub-block of Matrix. More...
 
template<class VectorSpace >
ConstMatrixBlock< mTypeblock (const label rowIndex, const label colIndex) const
 Access Field as a ConstMatrixBlock. More...
 
MatrixBlock< mTypesubColumn (const label colIndex, const label rowIndex=0, label len=-1)
 Return column or column's subset of Matrix. More...
 
MatrixBlock< mTypesubRow (const label rowIndex, const label colIndex=0, label len=-1)
 Return row or row's subset of Matrix. More...
 
MatrixBlock< mTypesubMatrix (const label rowIndex, const label colIndex, label szRows=-1, label szCols=-1)
 Return sub-block of Matrix. More...
 
template<class VectorSpace >
MatrixBlock< mTypeblock (const label rowIndex, const label colIndex)
 Access Field as a MatrixBlock. More...
 
void checki (const label irow) const
 Check index i is within valid range [0, m) More...
 
void checkj (const label jcol) const
 Check index j is within valid range [0, n) More...
 
void checkSize () const
 Check that dimensions are positive, non-zero. More...
 
bool uniform () const
 True if all entries have identical values, and Matrix is non-empty. More...
 
void clear ()
 Clear Matrix, i.e. set sizes to zero. More...
 
List< Type > release ()
 
void swap (Matrix< Form, Type > &mat)
 Swap contents. More...
 
void transfer (Matrix< Form, Type > &mat)
 
void resize (const label m, const label n)
 Change Matrix dimensions, preserving the elements. More...
 
void resize_nocopy (const label mrow, const label ncol)
 Change Matrix dimensions without preserving existing content. More...
 
void setSize (const label m, const label n)
 Change Matrix dimensions, preserving the elements. More...
 
void shallowResize (const label m, const label n)
 Resize Matrix without reallocating storage (unsafe) More...
 
void round (const scalar tol=SMALL)
 Round elements with magnitude smaller than tol (SMALL) to zero. More...
 
Form T () const
 Return (conjugate) transpose of Matrix. More...
 
tmp< Field< Type > > Amul (const UList< Type > &x) const
 Right-multiply Matrix by a column vector (A * x) More...
 
template<class Addr >
tmp< Field< Type > > Amul (const IndirectListBase< Type, Addr > &x) const
 Right-multiply Matrix by a column vector (A * x) More...
 
tmp< Field< Type > > Tmul (const UList< Type > &x) const
 Left-multiply Matrix by a row vector (x * A) More...
 
template<class Addr >
tmp< Field< Type > > Tmul (const IndirectListBase< Type, Addr > &x) const
 Left-multiply Matrix by a row vector (x * A) More...
 
List< Type > diag () const
 Extract the diagonal elements. Method may change in the future. More...
 
void diag (const UList< Type > &list)
 Assign diagonal of Matrix. More...
 
Type trace () const
 Return the trace. More...
 
scalar columnNorm (const label colIndex, const bool noSqrt=false) const
 Return L2-Norm of chosen column. More...
 
scalar norm (const bool noSqrt=false) const
 Return Frobenius norm of Matrix. More...
 
const Type * operator[] (const label irow) const
 Return const pointer to data in the specified row - rowData(). More...
 
Type * operator[] (const label irow)
 Return pointer to data in the specified row - rowData(). More...
 
const Type & operator() (const label irow, const label jcol) const
 (i, j) const element access operator More...
 
Type & operator() (const label irow, const label jcol)
 (i, j) element access operator More...
 
void operator= (const Matrix< Form, Type > &mat)
 Copy assignment. Takes linear time. More...
 
void operator= (Matrix< Form, Type > &&mat)
 Move assignment. More...
 
template<class MatrixType >
void operator= (const ConstMatrixBlock< MatrixType > &Mb)
 Assignment to a block of another Matrix. More...
 
template<class MatrixType >
void operator= (const MatrixBlock< MatrixType > &Mb)
 Assignment to a block of another Matrix. More...
 
void operator= (const Foam::zero)
 Assignment of all elements to zero. More...
 
void operator= (const Type &val)
 Assignment of all elements to the given value. More...
 
void operator+= (const Matrix< Form, Type > &other)
 Matrix addition. More...
 
void operator-= (const Matrix< Form, Type > &other)
 Matrix subtraction. More...
 
void operator+= (const Type &s)
 Matrix scalar addition. More...
 
void operator-= (const Type &s)
 Matrix scalar subtraction. More...
 
void operator*= (const Type &s)
 Matrix scalar multiplication. More...
 
void operator/= (const Type &s)
 Matrix scalar division. More...
 
iterator begin () noexcept
 Return an iterator to begin traversing a Matrix. More...
 
iterator end () noexcept
 Return an iterator to end traversing a Matrix. More...
 
const_iterator cbegin () const noexcept
 Return const_iterator to begin traversing a constant Matrix. More...
 
const_iterator cend () const noexcept
 Return const_iterator to end traversing a constant Matrix. More...
 
const_iterator begin () const noexcept
 Return const_iterator to begin traversing a constant Matrix. More...
 
const_iterator end () const noexcept
 Return const_iterator to end traversing a constant Matrix. More...
 
bool readMatrix (Istream &is)
 Read Matrix from Istream, discarding existing contents. More...
 
OstreamwriteMatrix (Ostream &os, const label shortLen=0) const
 
label mRows () const noexcept
 The number of rows - same as m() More...
 
label nRows () const noexcept
 The number of rows - same as m() More...
 
label nCols () const noexcept
 The number of columns - same as n() More...
 
const Type * v () const
 Deprecated(2019-04) raw data pointer, const access. More...
 
Type * v ()
 Deprecated(2019-04) raw data pointer, non-const access. More...
 
ConstMatrixBlock< mTypeblock (const label m, const label n, const label mStart, const label nStart) const
 Deprecated(2019-04) - use subMatrix() More...
 
MatrixBlock< mTypeblock (const label m, const label n, const label mStart, const label nStart)
 Deprecated(2019-04) - use subMatrix() More...
 
ConstMatrixBlock< mTypecol (const label m, const label mStart, const label nStart) const
 Deprecated(2019-04) - use subColumn() More...
 
MatrixBlock< mTypecol (const label m, const label mStart, const label nStart)
 Deprecated(2019-04) - use subColumn() More...
 
void col (const label m, const label rowStart) const =delete
 Deleted(2019-04) - use subColumn() More...
 
void col (const label m, const label rowStart)=delete
 Deleted(2019-04) - use subColumn() More...
 
template<class ListType >
Foam::tmp< Foam::Field< Type > > AmulImpl (const ListType &x) const
 
template<class ListType >
Foam::tmp< Foam::Field< Type > > TmulImpl (const ListType &x) const
 
template<class VectorSpace >
Foam::ConstMatrixBlock< Foam::Matrix< Form, Type > > block (const label rowIndex, const label colIndex) const
 
template<class VectorSpace >
Foam::MatrixBlock< Foam::Matrix< Form, Type > > block (const label rowIndex, const label colIndex)
 
template<class Addr >
Foam::tmp< Foam::Field< Type > > Amul (const IndirectListBase< Type, Addr > &x) const
 
template<class Addr >
Foam::tmp< Foam::Field< Type > > Tmul (const IndirectListBase< Type, Addr > &x) const
 

Static Public Member Functions

static const Matrix< Form, Type > & null ()
 Return a null Matrix. More...
 

Public Attributes

const typedef Type * const_iterator
 Random access iterator for traversing a Matrix. More...
 

Detailed Description

template<class Form, class Type>
class Foam::Matrix< Form, Type >

A templated (m x n) matrix of objects of <T>. The layout is (mRows x nCols) - row-major order:

    (0,0)
      +---> j [nCols]
      |
      |
      v
      i [mRows]
Source files

Definition at line 53 of file DiagonalMatrix.H.

Member Typedef Documentation

◆ mType

typedef Matrix<Form, Type> mType

Matrix type.

Definition at line 108 of file Matrix.H.

◆ cmptType

typedef Type cmptType

Component type.

Definition at line 111 of file Matrix.H.

◆ iterator

typedef Type* iterator

Random access iterator for traversing a Matrix.

Definition at line 123 of file Matrix.H.

Constructor & Destructor Documentation

◆ Matrix() [1/13]

Matrix ( )
inlinenoexcept

Default construct (empty matrix)

Definition at line 49 of file MatrixI.H.

◆ Matrix() [2/13]

Matrix ( const label  m,
const label  n 
)

Construct given number of rows/columns.

Definition at line 109 of file Matrix.C.

◆ Matrix() [3/13]

Matrix ( const label  m,
const label  n,
const Foam::zero   
)

Construct with given number of rows/columns initializing all elements to zero

Definition at line 122 of file Matrix.C.

◆ Matrix() [4/13]

Matrix ( const label  m,
const label  n,
const Type &  val 
)

Construct with given number of rows/columns initializing all elements to the given value

Definition at line 137 of file Matrix.C.

◆ Matrix() [5/13]

Matrix ( const labelPair dims)
inlineexplicit

Construct given number of rows/columns.

Definition at line 58 of file MatrixI.H.

◆ Matrix() [6/13]

Matrix ( const labelPair dims,
const Foam::zero   
)
inline

Construct given number of rows/columns initializing all elements to zero

Definition at line 65 of file MatrixI.H.

◆ Matrix() [7/13]

Matrix ( const labelPair dims,
const Type &  val 
)
inline

Construct with given number of rows/columns initializing all elements to the given value

Definition at line 72 of file MatrixI.H.

◆ Matrix() [8/13]

Matrix ( const Matrix< Form, Type > &  mat)

Copy construct.

Definition at line 152 of file Matrix.C.

◆ Matrix() [9/13]

Matrix ( Matrix< Form, Type > &&  mat)

Move construct.

Definition at line 168 of file Matrix.C.

◆ Matrix() [10/13]

Matrix ( const Matrix< Form2, Type > &  mat)
explicit

Copy constructor from Matrix of a different form.

Definition at line 182 of file Matrix.C.

◆ Matrix() [11/13]

Matrix ( const ConstMatrixBlock< MatrixType > &  Mb)
inline

Construct from a block of another Matrix.

Definition at line 200 of file Matrix.C.

◆ Matrix() [12/13]

Matrix ( const MatrixBlock< MatrixType > &  Mb)
inline

Construct from a block of another Matrix.

Definition at line 222 of file Matrix.C.

◆ Matrix() [13/13]

Matrix ( Istream is)
explicit

Construct from Istream.

Definition at line 40 of file MatrixIO.C.

◆ ~Matrix()

~Matrix ( )

Destructor.

Definition at line 244 of file Matrix.C.

Member Function Documentation

◆ null()

const Foam::Matrix< Form, Type > & null ( )
inlinestatic

Return a null Matrix.

Definition at line 89 of file MatrixI.H.

◆ clone()

Foam::autoPtr< Foam::Matrix< Form, Type > > clone ( ) const
inline

Clone.

Definition at line 80 of file MatrixI.H.

◆ m()

◆ n()

◆ size()

Foam::label size ( ) const
inline

The number of elements in Matrix (m*n)

Definition at line 110 of file MatrixI.H.

Referenced by Matrix< RectangularMatrix< Type >, Type >::writeMatrix().

Here is the caller graph for this function:

◆ sizes()

Foam::labelPair sizes ( ) const
inline

Return row/column sizes.

Definition at line 117 of file MatrixI.H.

Referenced by Foam::operator*(), Foam::operator+(), Foam::operator-(), and Foam::operator/().

Here is the caller graph for this function:

◆ empty()

bool empty ( ) const
inlinenoexcept

Return true if Matrix is empty (i.e., size() is zero)

Definition at line 124 of file MatrixI.H.

Referenced by Foam::max(), and Foam::min().

Here is the caller graph for this function:

◆ cdata()

const Type * cdata ( ) const
inlinenoexcept

Return const pointer to the first data element, which can also be used to address into Matrix contents

Definition at line 202 of file MatrixI.H.

Referenced by Matrix< RectangularMatrix< Type >, Type >::Matrix(), and Matrix< RectangularMatrix< Type >, Type >::writeMatrix().

Here is the caller graph for this function:

◆ data()

Type * data ( )
inlinenoexcept

Return pointer to the first data element, which can also be used to address into Matrix contents

Definition at line 209 of file MatrixI.H.

◆ cdata_bytes()

const char * cdata_bytes ( ) const
inlinenoexcept

Return pointer to the underlying array serving as data storage, reinterpreted as byte data.

Note
Only meaningful for contiguous data

Definition at line 216 of file MatrixI.H.

Referenced by Matrix< RectangularMatrix< Type >, Type >::writeMatrix().

Here is the caller graph for this function:

◆ data_bytes()

char * data_bytes ( )
inlinenoexcept

Return pointer to the underlying array serving as data storage, reinterpreted as byte data.

Note
Only meaningful for contiguous data

Definition at line 223 of file MatrixI.H.

◆ size_bytes()

std::streamsize size_bytes ( ) const
inlinenoexcept

Number of contiguous bytes for the Matrix data, no runtime check that the type is actually contiguous

Note
Only meaningful for contiguous data

Definition at line 230 of file MatrixI.H.

Referenced by Matrix< RectangularMatrix< Type >, Type >::writeMatrix().

Here is the caller graph for this function:

◆ byteSize()

std::streamsize byteSize ( ) const

Number of contiguous bytes for the Matrix data, runtime FatalError if type is not contiguous

Definition at line 494 of file Matrix.C.

◆ rowData() [1/2]

const Type * rowData ( const label  irow) const
inline

Return const pointer to data in the specified row.

Subscript checking only with FULLDEBUG

Definition at line 237 of file MatrixI.H.

◆ rowData() [2/2]

Type * rowData ( const label  irow)
inline

Return pointer to data in the specified row.

Subscript checking only with FULLDEBUG

Definition at line 247 of file MatrixI.H.

◆ at() [1/2]

const Type & at ( const label  idx) const
inline

Linear addressing const element access.

Subscript checking only with FULLDEBUG

Definition at line 257 of file MatrixI.H.

◆ at() [2/2]

Type & at ( const label  idx)
inline

Linear addressing element access.

Subscript checking only with FULLDEBUG

Definition at line 272 of file MatrixI.H.

◆ subColumn() [1/2]

Foam::ConstMatrixBlock< Foam::Matrix< Form, Type > > subColumn ( const label  colIndex,
const label  rowIndex = 0,
label  len = -1 
) const
inline

Return const column or column's subset of Matrix.

Return entire column by its index: M.subColumn(a); Return subset of a column starting from rowIndex: M.subColumn(a, b); Return subset of a column starting from rowIndex with szRows elems: M.subColumn(a, b, c);

Definition at line 289 of file MatrixI.H.

Referenced by Foam::applyPermutation(), and Matrix< RectangularMatrix< Type >, Type >::col().

Here is the caller graph for this function:

◆ subRow() [1/2]

Foam::ConstMatrixBlock< Foam::Matrix< Form, Type > > subRow ( const label  rowIndex,
const label  colIndex = 0,
label  len = -1 
) const
inline

Return const row or const row's subset of Matrix.

Return entire row by its index: M.subRow(a); Return subset of a row starting from columnIndex: M.subRow(a,b); Return subset of a row starting from columnIndex with szCols elems: M.subRow(a, b, c);

Definition at line 314 of file MatrixI.H.

◆ subMatrix() [1/2]

Foam::ConstMatrixBlock< Foam::Matrix< Form, Type > > subMatrix ( const label  rowIndex,
const label  colIndex,
label  szRows = -1,
label  szCols = -1 
) const
inline

Return const sub-block of Matrix.

Sub-block starting at columnIndex & rowIndex indices

Definition at line 339 of file MatrixI.H.

Referenced by Matrix< RectangularMatrix< Type >, Type >::block().

Here is the caller graph for this function:

◆ block() [1/6]

ConstMatrixBlock<mType> block ( const label  rowIndex,
const label  colIndex 
) const
inline

Access Field as a ConstMatrixBlock.

◆ subColumn() [2/2]

Foam::MatrixBlock< Foam::Matrix< Form, Type > > subColumn ( const label  colIndex,
const label  rowIndex = 0,
label  len = -1 
)
inline

Return column or column's subset of Matrix.

Definition at line 383 of file MatrixI.H.

◆ subRow() [2/2]

Foam::MatrixBlock< Foam::Matrix< Form, Type > > subRow ( const label  rowIndex,
const label  colIndex = 0,
label  len = -1 
)
inline

Return row or row's subset of Matrix.

Definition at line 408 of file MatrixI.H.

◆ subMatrix() [2/2]

Foam::MatrixBlock< Foam::Matrix< Form, Type > > subMatrix ( const label  rowIndex,
const label  colIndex,
label  szRows = -1,
label  szCols = -1 
)
inline

Return sub-block of Matrix.

Definition at line 433 of file MatrixI.H.

◆ block() [2/6]

MatrixBlock<mType> block ( const label  rowIndex,
const label  colIndex 
)
inline

Access Field as a MatrixBlock.

◆ checki()

void checki ( const label  irow) const
inline

Check index i is within valid range [0, m)

Definition at line 131 of file MatrixI.H.

◆ checkj()

void checkj ( const label  jcol) const
inline

Check index j is within valid range [0, n)

Definition at line 149 of file MatrixI.H.

◆ checkSize()

void checkSize ( ) const
inline

Check that dimensions are positive, non-zero.

Definition at line 167 of file MatrixI.H.

◆ uniform()

bool uniform ( ) const
inline

True if all entries have identical values, and Matrix is non-empty.

Definition at line 180 of file MatrixI.H.

Referenced by Matrix< RectangularMatrix< Type >, Type >::writeMatrix().

Here is the caller graph for this function:

◆ clear()

void clear ( )

Clear Matrix, i.e. set sizes to zero.

Definition at line 256 of file Matrix.C.

Referenced by STDMD::fit().

Here is the caller graph for this function:

◆ release()

Foam::List< Type > release ( )

Release storage management of Matrix contents by transferring management to a List

Definition at line 270 of file Matrix.C.

◆ swap()

void swap ( Matrix< Form, Type > &  mat)

Swap contents.

Definition at line 290 of file Matrix.C.

◆ transfer()

void transfer ( Matrix< Form, Type > &  mat)

Transfer the contents of the argument Matrix into this Matrix and annul the argument Matrix

Definition at line 304 of file Matrix.C.

◆ resize()

void resize ( const label  m,
const label  n 
)

Change Matrix dimensions, preserving the elements.

Definition at line 324 of file Matrix.C.

Referenced by Foam::pinv().

Here is the caller graph for this function:

◆ resize_nocopy()

void resize_nocopy ( const label  mrow,
const label  ncol 
)

Change Matrix dimensions without preserving existing content.

Definition at line 349 of file Matrix.C.

◆ setSize()

void setSize ( const label  m,
const label  n 
)
inline

Change Matrix dimensions, preserving the elements.

Definition at line 475 of file MatrixI.H.

◆ shallowResize()

void shallowResize ( const label  m,
const label  n 
)
inline

Resize Matrix without reallocating storage (unsafe)

Definition at line 482 of file MatrixI.H.

◆ round()

void round ( const scalar  tol = SMALL)

Round elements with magnitude smaller than tol (SMALL) to zero.

Definition at line 379 of file Matrix.C.

◆ T()

Form T ( ) const

Return (conjugate) transpose of Matrix.

Definition at line 392 of file Matrix.C.

Referenced by chemPointISAT< CompType, ThermoType >::chemPointISAT().

Here is the caller graph for this function:

◆ Amul() [1/3]

Foam::tmp< Foam::Field< Type > > Amul ( const UList< Type > &  x) const
inline

Right-multiply Matrix by a column vector (A * x)

Definition at line 491 of file MatrixI.H.

Referenced by Foam::operator*().

Here is the caller graph for this function:

◆ Amul() [2/3]

tmp<Field<Type> > Amul ( const IndirectListBase< Type, Addr > &  x) const
inline

Right-multiply Matrix by a column vector (A * x)

◆ Tmul() [1/3]

Foam::tmp< Foam::Field< Type > > Tmul ( const UList< Type > &  x) const
inline

Left-multiply Matrix by a row vector (x * A)

Definition at line 512 of file MatrixI.H.

Referenced by Foam::operator*().

Here is the caller graph for this function:

◆ Tmul() [2/3]

tmp<Field<Type> > Tmul ( const IndirectListBase< Type, Addr > &  x) const
inline

Left-multiply Matrix by a row vector (x * A)

◆ diag() [1/2]

Foam::List< Type > diag ( ) const

Extract the diagonal elements. Method may change in the future.

Definition at line 409 of file Matrix.C.

◆ diag() [2/2]

void diag ( const UList< Type > &  list)

Assign diagonal of Matrix.

Definition at line 425 of file Matrix.C.

◆ trace()

Type trace ( ) const

Return the trace.

Definition at line 446 of file Matrix.C.

◆ columnNorm()

Foam::scalar columnNorm ( const label  colIndex,
const bool  noSqrt = false 
) const

Return L2-Norm of chosen column.

Optional without sqrt for parallel usage.

Definition at line 463 of file Matrix.C.

Referenced by QRMatrix< MatrixType >::householderReflector().

Here is the caller graph for this function:

◆ norm()

Foam::scalar norm ( const bool  noSqrt = false) const

Return Frobenius norm of Matrix.

Optional without sqrt for parallel usage.

Definition at line 480 of file Matrix.C.

◆ operator[]() [1/2]

const Type * operator[] ( const label  irow) const
inline

Return const pointer to data in the specified row - rowData().

Subscript checking only with FULLDEBUG

Definition at line 614 of file MatrixI.H.

◆ operator[]() [2/2]

Type * operator[] ( const label  irow)
inline

Return pointer to data in the specified row - rowData().

Subscript checking only with FULLDEBUG

Definition at line 624 of file MatrixI.H.

◆ operator()() [1/2]

const Type & operator() ( const label  irow,
const label  jcol 
) const
inline

(i, j) const element access operator

Subscript checking only with FULLDEBUG

Definition at line 585 of file MatrixI.H.

◆ operator()() [2/2]

Type & operator() ( const label  irow,
const label  jcol 
)
inline

(i, j) element access operator

Subscript checking only with FULLDEBUG

Definition at line 600 of file MatrixI.H.

◆ operator=() [1/6]

void operator= ( const Matrix< Form, Type > &  mat)

Copy assignment. Takes linear time.

Definition at line 509 of file Matrix.C.

◆ operator=() [2/6]

void operator= ( Matrix< Form, Type > &&  mat)

Move assignment.

Definition at line 532 of file Matrix.C.

◆ operator=() [3/6]

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

Assignment to a block of another Matrix.

Definition at line 545 of file Matrix.C.

◆ operator=() [4/6]

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

Assignment to a block of another Matrix.

Definition at line 562 of file Matrix.C.

◆ operator=() [5/6]

void operator= ( const Foam::zero  )

Assignment of all elements to zero.

Definition at line 584 of file Matrix.C.

◆ operator=() [6/6]

void operator= ( const Type &  val)

Assignment of all elements to the given value.

Definition at line 577 of file Matrix.C.

◆ operator+=() [1/2]

void operator+= ( const Matrix< Form, Type > &  other)

Matrix addition.

Definition at line 591 of file Matrix.C.

◆ operator-=() [1/2]

void operator-= ( const Matrix< Form, Type > &  other)

Matrix subtraction.

Definition at line 621 of file Matrix.C.

◆ operator+=() [2/2]

void operator+= ( const Type &  s)

Matrix scalar addition.

Definition at line 651 of file Matrix.C.

◆ operator-=() [2/2]

void operator-= ( const Type &  s)

Matrix scalar subtraction.

Definition at line 661 of file Matrix.C.

◆ operator*=()

void operator*= ( const Type &  s)

Matrix scalar multiplication.

Definition at line 671 of file Matrix.C.

◆ operator/=()

void operator/= ( const Type &  s)

Matrix scalar division.

Definition at line 681 of file Matrix.C.

◆ begin() [1/2]

Foam::Matrix< Form, Type >::iterator begin ( )
inlinenoexcept

Return an iterator to begin traversing a Matrix.

Definition at line 535 of file MatrixI.H.

◆ end() [1/2]

Foam::Matrix< Form, Type >::iterator end ( )
inlinenoexcept

Return an iterator to end traversing a Matrix.

Definition at line 543 of file MatrixI.H.

Referenced by Foam::operator-(), and Foam::operator/().

Here is the caller graph for this function:

◆ cbegin()

Foam::Matrix< Form, Type >::const_iterator cbegin ( ) const
inlinenoexcept

Return const_iterator to begin traversing a constant Matrix.

Definition at line 551 of file MatrixI.H.

Referenced by STDMD::initialise(), Matrix< RectangularMatrix< Type >, Type >::Matrix(), Foam::max(), Foam::min(), Foam::operator*(), Foam::operator+(), Matrix< RectangularMatrix< Type >, Type >::operator+=(), Foam::operator-(), Matrix< RectangularMatrix< Type >, Type >::operator-=(), Foam::operator/(), and Matrix< RectangularMatrix< Type >, Type >::operator=().

Here is the caller graph for this function:

◆ cend()

Foam::Matrix< Form, Type >::const_iterator cend ( ) const
inlinenoexcept

Return const_iterator to end traversing a constant Matrix.

Definition at line 559 of file MatrixI.H.

Referenced by Matrix< RectangularMatrix< Type >, Type >::Matrix(), Foam::max(), Foam::min(), Foam::operator*(), Foam::operator+(), Foam::operator-(), and Matrix< RectangularMatrix< Type >, Type >::operator=().

Here is the caller graph for this function:

◆ begin() [2/2]

Foam::Matrix< Form, Type >::const_iterator begin ( ) const
inlinenoexcept

Return const_iterator to begin traversing a constant Matrix.

Definition at line 567 of file MatrixI.H.

◆ end() [2/2]

Foam::Matrix< Form, Type >::const_iterator end ( ) const
inlinenoexcept

Return const_iterator to end traversing a constant Matrix.

Definition at line 575 of file MatrixI.H.

◆ readMatrix()

bool readMatrix ( Istream is)

Read Matrix from Istream, discarding existing contents.

Definition at line 53 of file MatrixIO.C.

Referenced by Foam::operator>>().

Here is the caller graph for this function:

◆ writeMatrix()

Foam::Ostream & writeMatrix ( Ostream os,
const label  shortLen = 0 
) const

Write Matrix, with line-breaks in ASCII when length exceeds shortLen.

Using '0' suppresses line-breaks entirely.

Definition at line 144 of file MatrixIO.C.

Referenced by Foam::operator<<().

Here is the caller graph for this function:

◆ mRows()

label mRows ( ) const
inlinenoexcept

The number of rows - same as m()

Definition at line 510 of file Matrix.H.

◆ nRows()

label nRows ( ) const
inlinenoexcept

The number of rows - same as m()

Definition at line 516 of file Matrix.H.

Referenced by Matrix< RectangularMatrix< Type >, Type >::writeMatrix().

Here is the caller graph for this function:

◆ nCols()

label nCols ( ) const
inlinenoexcept

The number of columns - same as n()

Definition at line 522 of file Matrix.H.

Referenced by Matrix< RectangularMatrix< Type >, Type >::writeMatrix().

Here is the caller graph for this function:

◆ v() [1/2]

const Type* v ( ) const
inline

Deprecated(2019-04) raw data pointer, const access.

Deprecated:
(2019-04) - use cdata() method

Definition at line 531 of file Matrix.H.

◆ v() [2/2]

Type* v ( )
inline

Deprecated(2019-04) raw data pointer, non-const access.

Deprecated:
(2019-04) - use data() method

Definition at line 539 of file Matrix.H.

◆ block() [3/6]

ConstMatrixBlock<mType> block ( const label  m,
const label  n,
const label  mStart,
const label  nStart 
) const
inline

Deprecated(2019-04) - use subMatrix()

Deprecated:
(2019-04) - use subMatrix()

Definition at line 548 of file Matrix.H.

◆ block() [4/6]

MatrixBlock<mType> block ( const label  m,
const label  n,
const label  mStart,
const label  nStart 
)
inline

Deprecated(2019-04) - use subMatrix()

Deprecated:
(2019-04) - use subMatrix()

Definition at line 562 of file Matrix.H.

◆ col() [1/4]

ConstMatrixBlock<mType> col ( const label  m,
const label  mStart,
const label  nStart 
) const
inline

Deprecated(2019-04) - use subColumn()

Deprecated:
(2019-04) - use subColumn()

Definition at line 577 of file Matrix.H.

◆ col() [2/4]

MatrixBlock<mType> col ( const label  m,
const label  mStart,
const label  nStart 
)
inline

Deprecated(2019-04) - use subColumn()

Deprecated:
(2019-04) - use subColumn()

Definition at line 590 of file Matrix.H.

◆ col() [3/4]

void col ( const label  m,
const label  rowStart 
) const
delete

Deleted(2019-04) - use subColumn()

Deprecated:
(2019-04) - use subColumn()

◆ col() [4/4]

void col ( const label  m,
const label  rowStart 
)
delete

Deleted(2019-04) - use subColumn()

Deprecated:
(2019-04) - use subColumn()

◆ AmulImpl()

Foam::tmp<Foam::Field<Type> > AmulImpl ( const ListType &  x) const

Definition at line 38 of file Matrix.C.

◆ TmulImpl()

Foam::tmp<Foam::Field<Type> > TmulImpl ( const ListType &  x) const

Definition at line 73 of file Matrix.C.

◆ block() [5/6]

Foam::ConstMatrixBlock<Foam::Matrix<Form, Type> > block ( const label  rowIndex,
const label  colIndex 
) const
inline

Definition at line 364 of file MatrixI.H.

◆ block() [6/6]

Foam::MatrixBlock<Foam::Matrix<Form, Type> > block ( const label  rowIndex,
const label  colIndex 
)
inline

Definition at line 458 of file MatrixI.H.

◆ Amul() [3/3]

Foam::tmp<Foam::Field<Type> > Amul ( const IndirectListBase< Type, Addr > &  x) const
inline

Definition at line 502 of file MatrixI.H.

◆ Tmul() [3/3]

Foam::tmp<Foam::Field<Type> > Tmul ( const IndirectListBase< Type, Addr > &  x) const
inline

Definition at line 523 of file MatrixI.H.

Member Data Documentation

◆ const_iterator

const typedef Type* const_iterator

Random access iterator for traversing a Matrix.

Definition at line 126 of file Matrix.H.


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