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 ()
 Construct null. 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 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 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 ()
 Return an iterator to begin traversing a Matrix. More...
 
iterator end ()
 Return an iterator to end traversing a Matrix. More...
 
const_iterator cbegin () const
 Return const_iterator to begin traversing a constant Matrix. More...
 
const_iterator cend () const
 Return const_iterator to end traversing a constant Matrix. More...
 
const_iterator begin () const
 Return const_iterator to begin traversing a constant Matrix. More...
 
const_iterator end () const
 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 102 of file Matrix.H.

◆ cmptType

typedef Type cmptType

Component type.

Definition at line 105 of file Matrix.H.

◆ iterator

typedef Type* iterator

Random access iterator for traversing a Matrix.

Definition at line 117 of file Matrix.H.

Constructor & Destructor Documentation

◆ Matrix() [1/13]

Matrix ( )
inline

Construct null.

Definition at line 48 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 57 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 64 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 71 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 88 of file MatrixI.H.

◆ clone()

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

Clone.

Definition at line 79 of file MatrixI.H.

◆ m()

◆ n()

◆ size()

Foam::label size ( ) const
inline

The number of elements in Matrix (m*n)

Definition at line 109 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 116 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 123 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 201 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 208 of file MatrixI.H.

◆ 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 215 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 225 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 235 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 250 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 267 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 292 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 317 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 361 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 386 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 411 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 130 of file MatrixI.H.

◆ checkj()

void checkj ( const label  jcol) const
inline

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

Definition at line 148 of file MatrixI.H.

◆ checkSize()

void checkSize ( ) const
inline

Check that dimensions are positive, non-zero.

Definition at line 166 of file MatrixI.H.

◆ uniform()

bool uniform ( ) const
inline

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

Definition at line 179 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.

◆ 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:

◆ setSize()

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

Change Matrix dimensions, preserving the elements.

Definition at line 453 of file MatrixI.H.

◆ shallowResize()

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

Resize Matrix without reallocating storage (unsafe)

Definition at line 460 of file MatrixI.H.

◆ round()

void round ( const scalar  tol = SMALL)

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

Definition at line 349 of file Matrix.C.

◆ T()

Form T ( ) const

Return (conjugate) transpose of Matrix.

Definition at line 362 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 469 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 490 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 379 of file Matrix.C.

◆ diag() [2/2]

void diag ( const UList< Type > &  list)

Assign diagonal of Matrix.

Definition at line 395 of file Matrix.C.

◆ trace()

Type trace ( ) const

Return the trace.

Definition at line 416 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 433 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 450 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 592 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 602 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 563 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 578 of file MatrixI.H.

◆ operator=() [1/6]

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

Copy assignment. Takes linear time.

Definition at line 466 of file Matrix.C.

◆ operator=() [2/6]

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

Move assignment.

Definition at line 489 of file Matrix.C.

◆ operator=() [3/6]

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

Assignment to a block of another Matrix.

Definition at line 502 of file Matrix.C.

◆ operator=() [4/6]

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

Assignment to a block of another Matrix.

Definition at line 519 of file Matrix.C.

◆ operator=() [5/6]

void operator= ( const Foam::zero  )

Assignment of all elements to zero.

Definition at line 541 of file Matrix.C.

◆ operator=() [6/6]

void operator= ( const Type &  val)

Assignment of all elements to the given value.

Definition at line 534 of file Matrix.C.

◆ operator+=() [1/2]

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

Matrix addition.

Definition at line 548 of file Matrix.C.

◆ operator-=() [1/2]

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

Matrix subtraction.

Definition at line 578 of file Matrix.C.

◆ operator+=() [2/2]

void operator+= ( const Type &  s)

Matrix scalar addition.

Definition at line 608 of file Matrix.C.

◆ operator-=() [2/2]

void operator-= ( const Type &  s)

Matrix scalar subtraction.

Definition at line 618 of file Matrix.C.

◆ operator*=()

void operator*= ( const Type &  s)

Matrix scalar multiplication.

Definition at line 628 of file Matrix.C.

◆ operator/=()

void operator/= ( const Type &  s)

Matrix scalar division.

Definition at line 638 of file Matrix.C.

◆ begin() [1/2]

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

Return an iterator to begin traversing a Matrix.

Definition at line 513 of file MatrixI.H.

◆ end() [1/2]

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

Return an iterator to end traversing a Matrix.

Definition at line 521 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
inline

Return const_iterator to begin traversing a constant Matrix.

Definition at line 529 of file MatrixI.H.

Referenced by 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
inline

Return const_iterator to end traversing a constant Matrix.

Definition at line 537 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
inline

Return const_iterator to begin traversing a constant Matrix.

Definition at line 545 of file MatrixI.H.

◆ end() [2/2]

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

Return const_iterator to end traversing a constant Matrix.

Definition at line 553 of file MatrixI.H.

◆ readMatrix()

bool readMatrix ( Istream is)

Read Matrix from Istream, discarding existing contents.

Definition at line 51 of file MatrixIO.C.

◆ 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 142 of file MatrixIO.C.

◆ mRows()

label mRows ( ) const
inlinenoexcept

The number of rows - same as m()

Definition at line 481 of file Matrix.H.

◆ nRows()

label nRows ( ) const
inlinenoexcept

The number of rows - same as m()

Definition at line 487 of file Matrix.H.

◆ nCols()

label nCols ( ) const
inlinenoexcept

The number of columns - same as n()

Definition at line 493 of file Matrix.H.

◆ 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 502 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 510 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 519 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 533 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 548 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 561 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 342 of file MatrixI.H.

◆ block() [6/6]

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

Definition at line 436 of file MatrixI.H.

◆ Amul() [3/3]

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

Definition at line 480 of file MatrixI.H.

◆ Tmul() [3/3]

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

Definition at line 501 of file MatrixI.H.

Member Data Documentation

◆ const_iterator

const typedef Type* const_iterator

Random access iterator for traversing a Matrix.

Definition at line 120 of file Matrix.H.


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