43#ifndef Foam_SquareMatrix_H
44#define Foam_SquareMatrix_H
64 public Matrix<SquareMatrix<Type>, Type>
95 template<
class AnyType>
100 template<
class AnyType>
125 template<
class MatrixType>
129 template<
class MatrixType>
148 inline void resize(
const label
m);
154 inline void resize(
const label
m,
const label
n);
174 template<
class CompOp>
193 template<
class AnyType>
Templated identity and dual space identity tensors derived from SphericalTensor.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
A templated block of an (m x n) matrix of type <MatrixType>.
constexpr Matrix() noexcept
label m() const noexcept
The number of rows.
label n() const noexcept
The number of columns.
A templated (M x N) rectangular matrix of objects of <Type>, containing M*N elements,...
bool symmetric() const
Return true if the square matrix is effectively symmetric/Hermitian.
void operator=(Foam::zero)
Assign all elements to zero.
SquareMatrix(const label m, const label n, Foam::zero)
Construct given number of rows/columns (checked to be equal) initializing all elements to zero.
SquareMatrix(const RectangularMatrix< Type > &mat)
Construct as copy of a RectangularMatrix which is checked to be square.
void resize_nocopy(const label n)
Resize the matrix without preserving existing content.
SquareMatrix(const SquareMatrix &)=default
Copy construct.
SquareMatrix(const labelPair &dims)
Construct given number of rows/columns by using a labelPair (checked to be equal).
SquareMatrix(const label n, const Identity< AnyType >)
Construct for given size (rows == cols) initializing to the identity matrix.
SquareMatrix(const labelPair &dims, const Identity< AnyType >)
Construct for given size (rows == cols) by using a labelPair initializing to the identity matrix.
SquareMatrix(const labelPair &dims, Foam::zero)
Construct given number of rows/columns by using a labelPair (checked to be equal) and initializing al...
SquareMatrix(const labelPair &dims, const Type &val)
Construct given number of rows/columns by using a labelPair (checked to be equal) and initializing al...
void operator=(SquareMatrix< Type > &&mat)
Move assignment.
SquareMatrix()=default
Default construct.
autoPtr< SquareMatrix< Type > > clone() const
Clone.
labelList sortPermutation(CompOp &compare) const
Return a sort permutation using the given comparison operator on the diagonal entries.
SquareMatrix(const label n, Foam::zero)
Construct for given size (rows == cols) initializing all elements to zero.
SquareMatrix(const ConstMatrixBlock< MatrixType > &mat)
Construct from const sub-matrix block.
SquareMatrix(Istream &is)
Construct from Istream.
SquareMatrix(const label n, const Type &val)
Construct for given size (rows == cols) initializing all elements to the given value.
bool tridiagonal() const
Return true if the square matrix is reduced tridiagonal.
void applyPermutation(const labelUList &p)
Column-reorder this Matrix according to the given permutation.
SquareMatrix(const label n)
Construct for given size (rows == cols), uninitialised content.
void operator=(const Type &val)
Assign all elements to value.
void operator=(const Identity< AnyType >)
Set to identity matrix.
void setSize(const label m)
Resize the matrix preserving the elements.
void shallowResize(const label m)
Resize the matrix without reallocating storage (unsafe).
SquareMatrix & operator=(const SquareMatrix &)=default
Copy assignment.
SquareMatrix(const MatrixBlock< MatrixType > &mat)
Construct from sub-matrix block.
void resize(const label m)
Resize the matrix preserving the elements.
void resize(const label m, const label n)
Resize the matrix preserving the elements (compatibility).
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Pair< label > labelPair
A pair of labels.
List< label > labelList
A List of labels.
UList< label > labelUList
A UList of labels.