Public Member Functions | List of all members
SquareMatrix< Type > Class Template Reference

A templated (N x N) square matrix of objects of <Type>, containing N*N elements, derived from Matrix. More...

Inheritance diagram for SquareMatrix< Type >:
Inheritance graph
[legend]
Collaboration diagram for SquareMatrix< Type >:
Collaboration graph
[legend]

Public Member Functions

 SquareMatrix ()=default
 
 SquareMatrix (const SquareMatrix &)=default
 
SquareMatrixoperator= (const SquareMatrix &)=default
 
 SquareMatrix (const label n)
 
 SquareMatrix (const label n, const Foam::zero)
 
 SquareMatrix (const label n, const Type &val)
 
template<class AnyType >
 SquareMatrix (const label n, const Identity< AnyType >)
 
template<class AnyType >
 SquareMatrix (const labelPair &dims, const Identity< AnyType >)
 
 SquareMatrix (const labelPair &dims)
 
 SquareMatrix (const labelPair &dims, const Foam::zero)
 
 SquareMatrix (const labelPair &dims, const Type &val)
 
 SquareMatrix (const label m, const label n, const Foam::zero)
 
template<class MatrixType >
 SquareMatrix (const ConstMatrixBlock< MatrixType > &mat)
 
template<class MatrixType >
 SquareMatrix (const MatrixBlock< MatrixType > &mat)
 
 SquareMatrix (const RectangularMatrix< Type > &mat)
 
 SquareMatrix (Istream &is)
 
autoPtr< SquareMatrix< Type > > clone () const
 
void resize (const label m)
 
void resize (const label m, const label n)
 
void setSize (const label m)
 
void shallowResize (const label m)
 
bool symmetric () const
 
bool tridiagonal () const
 
template<class CompOp >
List< label > sortPermutation (CompOp &compare) const
 
void applyPermutation (const List< label > &p)
 
void operator= (const Foam::zero)
 
void operator= (const Type &val)
 
template<class AnyType >
void operator= (const Identity< AnyType >)
 
template<class CompOp >
Foam::List< Foam::label > sortPermutation (CompOp &compare) const
 
- Public Member Functions inherited from Matrix< SquareMatrix< Type >, Type >
Foam::tmp< Foam::Field< Type > > AmulImpl (const ListType &x) const
 
Foam::tmp< Foam::Field< Type > > TmulImpl (const ListType &x) const
 
 Matrix () noexcept
 
 Matrix (const label m, const label n)
 
 Matrix (const label m, const label n, const Foam::zero)
 
 Matrix (const label m, const label n, const Type &val)
 
 Matrix (const labelPair &dims)
 
 Matrix (const labelPair &dims, const Foam::zero)
 
 Matrix (const labelPair &dims, const Type &val)
 
 Matrix (const Matrix< Form, Type > &mat)
 
 Matrix (Matrix< Form, Type > &&mat)
 
 Matrix (const Matrix< Form2, Type > &mat)
 
 Matrix (const ConstMatrixBlock< MatrixType > &Mb)
 
 Matrix (const MatrixBlock< MatrixType > &Mb)
 
 Matrix (Istream &is)
 
autoPtr< mTypeclone () const
 
 ~Matrix ()
 
label m () const noexcept
 
label n () const noexcept
 
label size () const
 
labelPair sizes () const
 
bool empty () const noexcept
 
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
 
Type * rowData (const label irow)
 
const Type & at (const label idx) const
 
Type & at (const label idx)
 
ConstMatrixBlock< mTypesubColumn (const label colIndex, const label rowIndex=0, label len=-1) const
 
MatrixBlock< mTypesubColumn (const label colIndex, const label rowIndex=0, label len=-1)
 
ConstMatrixBlock< mTypesubRow (const label rowIndex, const label colIndex=0, label len=-1) const
 
MatrixBlock< mTypesubRow (const label rowIndex, const label colIndex=0, label len=-1)
 
ConstMatrixBlock< mTypesubMatrix (const label rowIndex, const label colIndex, label szRows=-1, label szCols=-1) const
 
MatrixBlock< mTypesubMatrix (const label rowIndex, const label colIndex, label szRows=-1, label szCols=-1)
 
ConstMatrixBlock< mTypeblock (const label rowIndex, const label colIndex) const
 
MatrixBlock< mTypeblock (const label rowIndex, const label colIndex)
 
ConstMatrixBlock< mTypeblock (const label m, const label n, const label mStart, const label nStart) const
 
MatrixBlock< mTypeblock (const label m, const label n, const label mStart, const label nStart)
 
Foam::ConstMatrixBlock< Foam::Matrix< Form, Type > > block (const label rowIndex, const label colIndex) const
 
Foam::MatrixBlock< Foam::Matrix< Form, Type > > block (const label rowIndex, const label colIndex)
 
void checki (const label irow) const
 
void checkj (const label jcol) const
 
void checkSize () const
 
bool uniform () const
 
void clear ()
 
List< Type > release ()
 
void swap (Matrix< Form, Type > &mat)
 
void transfer (Matrix< Form, Type > &mat)
 
void resize (const label m, const label n)
 
void resize_nocopy (const label mrow, const label ncol)
 
void setSize (const label m, const label n)
 
void shallowResize (const label m, const label n)
 
void round (const scalar tol=SMALL)
 
Form T () const
 
tmp< Field< Type > > Amul (const UList< Type > &x) const
 
tmp< Field< Type > > Amul (const IndirectListBase< Type, Addr > &x) const
 
Foam::tmp< Foam::Field< Type > > Amul (const IndirectListBase< Type, Addr > &x) const
 
tmp< Field< Type > > Tmul (const UList< Type > &x) const
 
tmp< Field< Type > > Tmul (const IndirectListBase< Type, Addr > &x) const
 
Foam::tmp< Foam::Field< Type > > Tmul (const IndirectListBase< Type, Addr > &x) const
 
List< Type > diag () const
 
void diag (const UList< Type > &list)
 
Type trace () const
 
scalar columnNorm (const label colIndex, const bool noSqrt=false) const
 
scalar norm (const bool noSqrt=false) const
 
const Type * operator[] (const label irow) const
 
Type * operator[] (const label irow)
 
const Type & operator() (const label irow, const label jcol) const
 
Type & operator() (const label irow, const label jcol)
 
void operator= (const Matrix< Form, Type > &mat)
 
void operator= (Matrix< Form, Type > &&mat)
 
void operator= (const ConstMatrixBlock< MatrixType > &Mb)
 
void operator= (const MatrixBlock< MatrixType > &Mb)
 
void operator= (const Foam::zero)
 
void operator= (const Type &val)
 
void operator+= (const Matrix< Form, Type > &other)
 
void operator+= (const Type &s)
 
void operator-= (const Matrix< Form, Type > &other)
 
void operator-= (const Type &s)
 
void operator*= (const Type &s)
 
void operator/= (const Type &s)
 
iterator begin () noexcept
 
const_iterator begin () const noexcept
 
iterator end () noexcept
 
const_iterator end () const noexcept
 
const_iterator cbegin () const noexcept
 
const_iterator cend () const noexcept
 
bool readMatrix (Istream &is)
 
OstreamwriteMatrix (Ostream &os, const label shortLen=0) const
 
label mRows () const noexcept
 
label nRows () const noexcept
 
label nCols () const noexcept
 
const Type * v () const
 
Type * v ()
 
ConstMatrixBlock< mTypecol (const label m, const label mStart, const label nStart) const
 
MatrixBlock< mTypecol (const label m, const label mStart, const label nStart)
 
void col (const label m, const label rowStart) const=delete
 
void col (const label m, const label rowStart)=delete
 

Additional Inherited Members

- Public Types inherited from Matrix< SquareMatrix< Type >, Type >
typedef Matrix< Form, Type > mType
 
typedef Type cmptType
 
typedef Type * iterator
 
- Static Public Member Functions inherited from Matrix< SquareMatrix< Type >, Type >
static const Matrix< Form, Type > & null ()
 
- Public Attributes inherited from Matrix< SquareMatrix< Type >, Type >
const typedef Type * const_iterator
 

Detailed Description

template<class Type>
class Foam::SquareMatrix< Type >

A templated (N x N) square matrix of objects of <Type>, containing N*N elements, derived from Matrix.

See also
Test-SquareMatrix.C
Source files

Definition at line 59 of file SquareMatrix.H.

Constructor & Destructor Documentation

◆ SquareMatrix() [1/15]

SquareMatrix ( )
default

◆ SquareMatrix() [2/15]

SquareMatrix ( const SquareMatrix< Type > &  )
default

◆ SquareMatrix() [3/15]

SquareMatrix ( const label  n)
inlineexplicit

Definition at line 34 of file SquareMatrixI.H.

◆ SquareMatrix() [4/15]

SquareMatrix ( const label  n,
const Foam::zero   
)
inline

Definition at line 42 of file SquareMatrixI.H.

◆ SquareMatrix() [5/15]

SquareMatrix ( const label  n,
const Type &  val 
)
inline

Definition at line 53 of file SquareMatrixI.H.

◆ SquareMatrix() [6/15]

SquareMatrix ( const label  n,
const Identity< AnyType >   
)
inline

Definition at line 65 of file SquareMatrixI.H.

◆ SquareMatrix() [7/15]

SquareMatrix ( const labelPair dims,
const Identity< AnyType >   
)
inline

Definition at line 82 of file SquareMatrixI.H.

◆ SquareMatrix() [8/15]

SquareMatrix ( const labelPair dims)
inlineexplicit

Definition at line 100 of file SquareMatrixI.H.

◆ SquareMatrix() [9/15]

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

Definition at line 112 of file SquareMatrixI.H.

◆ SquareMatrix() [10/15]

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

Definition at line 125 of file SquareMatrixI.H.

◆ SquareMatrix() [11/15]

SquareMatrix ( const label  m,
const label  n,
const Foam::zero   
)
inline

Definition at line 138 of file SquareMatrixI.H.

◆ SquareMatrix() [12/15]

SquareMatrix ( const ConstMatrixBlock< MatrixType > &  mat)
inline

Definition at line 153 of file SquareMatrixI.H.

◆ SquareMatrix() [13/15]

SquareMatrix ( const MatrixBlock< MatrixType > &  mat)
inline

Definition at line 166 of file SquareMatrixI.H.

◆ SquareMatrix() [14/15]

SquareMatrix ( const RectangularMatrix< Type > &  mat)
inlineexplicit

Definition at line 178 of file SquareMatrixI.H.

◆ SquareMatrix() [15/15]

SquareMatrix ( Istream is)
inlineexplicit

Definition at line 189 of file SquareMatrixI.H.

Member Function Documentation

◆ operator=() [1/4]

SquareMatrix& operator= ( const SquareMatrix< Type > &  )
default

◆ clone()

Foam::autoPtr< Foam::SquareMatrix< Type > > clone
inline

Definition at line 199 of file SquareMatrixI.H.

◆ resize() [1/2]

void resize ( const label  m)
inline

Definition at line 208 of file SquareMatrixI.H.

◆ resize() [2/2]

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

Definition at line 215 of file SquareMatrixI.H.

◆ setSize()

void setSize ( const label  m)
inline

Definition at line 228 of file SquareMatrixI.H.

◆ shallowResize()

void shallowResize ( const label  m)
inline

Definition at line 235 of file SquareMatrixI.H.

Referenced by ODESolver::resizeMatrix().

Here is the caller graph for this function:

◆ symmetric()

bool symmetric
inline

Definition at line 242 of file SquareMatrixI.H.

◆ tridiagonal()

bool tridiagonal
inline

Definition at line 259 of file SquareMatrixI.H.

◆ sortPermutation() [1/2]

List<label> sortPermutation ( CompOp &  compare) const

◆ applyPermutation()

void applyPermutation ( const List< label > &  p)

Definition at line 49 of file SquareMatrix.C.

◆ operator=() [2/4]

void operator= ( const Foam::zero  )
inline

Definition at line 287 of file SquareMatrixI.H.

◆ operator=() [3/4]

void operator= ( const Type &  val)
inline

Definition at line 294 of file SquareMatrixI.H.

◆ operator=() [4/4]

void operator= ( const Identity< AnyType >  )

Definition at line 79 of file SquareMatrix.C.

◆ sortPermutation() [2/2]

Foam::List<Foam::label> sortPermutation ( CompOp &  compare) const

Definition at line 31 of file SquareMatrix.C.


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