A simple square matrix solver with scalar coefficients. More...


Public Member Functions | |
| simpleMatrix (const label) | |
| Construct given size. More... | |
| simpleMatrix (const label, const scalar, const Type &) | |
| Construct given size and initial values for coefficients and source. More... | |
| simpleMatrix (const scalarSquareMatrix &, const Field< Type > &) | |
| Construct from components. More... | |
| simpleMatrix (Istream &) | |
| Construct from Istream. More... | |
| simpleMatrix (const simpleMatrix< Type > &) | |
| Copy constructor. More... | |
| Field< Type > & | source () |
| Return access to the source. More... | |
| const Field< Type > & | source () const |
| Return const-access to the source. More... | |
| Field< Type > | solve () const |
| Solve the matrix using Gaussian elimination with pivoting. More... | |
| Field< Type > | LUsolve () const |
| Solve the matrix using LU decomposition with pivoting. More... | |
| void | operator= (const simpleMatrix< Type > &) |
Public Member Functions inherited from SquareMatrix< scalar > | |
| SquareMatrix () | |
| Null constructor. More... | |
| SquareMatrix (const label n) | |
| Construct given number of rows/columns. More... | |
| SquareMatrix (const ConstMatrixBlock< MatrixType > &) | |
| Construct from a block of another matrix. More... | |
| SquareMatrix (const MatrixBlock< MatrixType > &) | |
| Construct from a block of another matrix. More... | |
| SquareMatrix (const label n, const zero) | |
| Construct given number of rows/columns. More... | |
| SquareMatrix (const label m, const label n, const zero) | |
| Construct given number of rows/columns (checked to be equal) More... | |
| SquareMatrix (const label n, const Identity< scalar >) | |
| Construct given number of rows/columns. More... | |
| SquareMatrix (const label n, const scalar &) | |
| Construct with given number of rows/columns. More... | |
| SquareMatrix (const label n, InputIterator first, InputIterator last) | |
| Construct with given number of rows/columns. More... | |
| SquareMatrix (const label n, std::initializer_list< scalar >) | |
| Construct with given number of rows/columns and initialiser list. More... | |
| SquareMatrix (std::initializer_list< scalar >) | |
| Construct from an initialiser list. More... | |
| SquareMatrix (std::initializer_list< std::initializer_list< scalar >>) | |
| Construct from initialiser list list. More... | |
| SquareMatrix (const RectangularMatrix< scalar > &) | |
| Construct as copy of a RectangularMatrix. More... | |
| SquareMatrix (Istream &) | |
| Construct from Istream. More... | |
| autoPtr< SquareMatrix< scalar > > | clone () const |
| Clone. More... | |
| void | setSize (const label m) |
| Resize the matrix preserving the elements. More... | |
| void | shallowResize (const label m) |
| Resize the matrix without reallocating storage (unsafe) More... | |
| void | operator= (const zero) |
| Assignment of all elements to zero. More... | |
| void | operator= (const Identity< scalar >) |
| Assignment elements to the. More... | |
Public Member Functions inherited from Matrix< Form, Type > | |
| Matrix () | |
| Null constructor. More... | |
| Matrix (const label m, const label n) | |
| Construct given number of rows and columns. More... | |
| Matrix (const label m, const label n, const zero) | |
| Construct with given number of rows and columns. More... | |
| Matrix (const label m, const label n, const Type &) | |
| Construct with given number of rows and columns. More... | |
| template<class InputIterator > | |
| Matrix (const label m, const label n, InputIterator first, InputIterator last) | |
| Construct with given number of rows and columns. More... | |
| Matrix (const label m, const label n, std::initializer_list< Type >) | |
| Construct with given number of rows and columns and initialiser list. More... | |
| Matrix (std::initializer_list< std::initializer_list< Type >>) | |
| Construct from initialiser list list. More... | |
| Matrix (const mType &) | |
| Copy constructor. More... | |
| template<class Form2 > | |
| Matrix (const Matrix< Form2, Type > &) | |
| Copy constructor from matrix of a different form. More... | |
| template<class MatrixType > | |
| Matrix (const ConstMatrixBlock< MatrixType > &) | |
| Construct from a block of another matrix. More... | |
| template<class MatrixType > | |
| Matrix (const MatrixBlock< MatrixType > &) | |
| Construct from a block of another matrix. More... | |
| template<class MSForm , direction Mrows, direction Ncols> | |
| Matrix (const MatrixSpace< MSForm, Type, Mrows, Ncols > &) | |
| Matrix (Istream &) | |
| Construct from Istream. More... | |
| autoPtr< mType > | clone () const |
| Clone. More... | |
| ~Matrix () | |
| Destructor. More... | |
| label | m () const |
| Return the number of rows. More... | |
| label | n () const |
| Return the number of columns. More... | |
| label | size () const |
| Return the number of elements in matrix (m*n) More... | |
| const Type * | v () const |
| Return element vector of the constant Matrix. More... | |
| Type * | v () |
| Return element vector of the Matrix. More... | |
| ConstMatrixBlock< mType > | block (const label m, const label n, const label mStart, const label nStart) const |
| template<class VectorSpace > | |
| ConstMatrixBlock< mType > | block (const label mStart, const label nStart) const |
| ConstMatrixBlock< mType > | col (const label m, const label rowStart) const |
| ConstMatrixBlock< mType > | col (const label m, const label mStart, const label nStart) const |
| MatrixBlock< mType > | block (const label m, const label n, const label mStart, const label nStart) |
| template<class VectorSpace > | |
| MatrixBlock< mType > | block (const label mStart, const label nStart) |
| MatrixBlock< mType > | col (const label m, const label rowStart) |
| MatrixBlock< mType > | col (const label m, const label mStart, const label nStart) |
| void | checki (const label i) const |
| Check index i is within valid range (0 ... m-1). More... | |
| void | checkj (const label j) const |
| Check index j is within valid range (0 ... n-1). More... | |
| void | clear () |
| Clear the Matrix, i.e. set sizes to zero. More... | |
| void | transfer (mType &) |
| Transfer the contents of the argument Matrix into this Matrix. More... | |
| void | setSize (const label m, const label n) |
| Resize the matrix preserving the elements. More... | |
| void | shallowResize (const label m, const label n) |
| Resize the matrix without reallocating storage (unsafe) More... | |
| Form | T () const |
| Return the transpose of the matrix. More... | |
| Type * | operator[] (const label) |
| Return subscript-checked row of Matrix. More... | |
| const Type * | operator[] (const label) const |
| Return subscript-checked row of constant Matrix. More... | |
| const Type & | operator() (const label i, const label j) const |
| (i, j) const element access operator More... | |
| Type & | operator() (const label i, const label j) |
| (i, j) element access operator More... | |
| void | operator= (const mType &) |
| Assignment operator. Takes linear time. More... | |
| template<class MatrixType > | |
| void | operator= (const ConstMatrixBlock< MatrixType > &) |
| Assignment to a block of another matrix. More... | |
| template<class MatrixType > | |
| void | operator= (const MatrixBlock< MatrixType > &) |
| Assignment to a block of another matrix. More... | |
| void | operator= (const zero) |
| Assignment of all elements to zero. More... | |
| void | operator= (const Type &) |
| Assignment of all elements to the given value. More... | |
| template<class VectorSpace > | |
| Foam::ConstMatrixBlock< Foam::Matrix< Form, Type > > | block (const label mStart, const label nStart) const |
| template<class VectorSpace > | |
| Foam::MatrixBlock< Foam::Matrix< Form, Type > > | block (const label mStart, const label nStart) |
Friends | |
| Ostream & | operator (Ostream &, const simpleMatrix< Type > &) |
Additional Inherited Members | |
Public Types inherited from Matrix< Form, Type > | |
| typedef Matrix< Form, Type > | mType |
| Matrix type. More... | |
| typedef Type | cmptType |
| Component type. More... | |
Static Public Member Functions inherited from SquareMatrix< scalar > | |
| static word | typeName () |
| Return the instantiated type name. More... | |
Static Public Member Functions inherited from Matrix< Form, Type > | |
| static const mType & | null () |
| Return a null Matrix. More... | |
A simple square matrix solver with scalar coefficients.
Definition at line 62 of file simpleMatrix.H.
| simpleMatrix | ( | const label | mSize | ) |
Construct given size.
Note: this does not initialise the coefficients or the source.
Definition at line 31 of file simpleMatrix.C.
| simpleMatrix | ( | const label | mSize, |
| const scalar | coeffVal, | ||
| const Type & | sourceVal | ||
| ) |
Construct given size and initial values for coefficients and source.
Definition at line 39 of file simpleMatrix.C.
| simpleMatrix | ( | const scalarSquareMatrix & | matrix, |
| const Field< Type > & | source | ||
| ) |
Construct from components.
Definition at line 52 of file simpleMatrix.C.
| simpleMatrix | ( | Istream & | is | ) |
Construct from Istream.
Definition at line 64 of file simpleMatrix.C.
| simpleMatrix | ( | const simpleMatrix< Type > & | ) |
Copy constructor.
|
inline |
Return access to the source.
Definition at line 97 of file simpleMatrix.H.
|
inline |
Return const-access to the source.
Definition at line 103 of file simpleMatrix.H.
| Foam::Field< Type > solve |
Solve the matrix using Gaussian elimination with pivoting.
and return the solution
Definition at line 74 of file simpleMatrix.C.
| Foam::Field< Type > LUsolve |
Solve the matrix using LU decomposition with pivoting.
and return the solution
Definition at line 86 of file simpleMatrix.C.
References Foam::LUsolve().

| void operator= | ( | const simpleMatrix< Type > & | m | ) |
Definition at line 100 of file simpleMatrix.C.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and Matrix< Form, Type >::m().

|
friend |