29#define CHECK_MATRIX_IS_SQUARE(a, b) \
32 FatalErrorInFunction \
33 << "Attempt to create a non-square matrix (" \
34 << a << ", " << b << ')' << nl << abort(FatalError); \
70template<
class AnyType>
79 for (label i = 0; i <
n; ++i)
87template<
class AnyType>
98 for (label i = 0; i < dims.
first(); ++i)
158template<
class MatrixType>
171template<
class MatrixType>
251 for (label
n = 0;
n < this->
n() - 1; ++
n)
253 for (label m = this->m() - 1;
n < m; --m)
255 if (SMALL <
mag((*
this)(
n, m) - (*
this)(m,
n)))
268 for (label i = 0; i < this->m(); ++i)
270 for (label j = 0; j < this->
n(); ++j)
272 const Type& val = (*this)(i, j);
274 if ((i == j) || (i - 1 == j) || (i + 1 == j))
276 if (
mag(val) < SMALL)
281 else if (SMALL <
mag(val))
331 for (label i = 0; i < f1f2T.
m(); ++i)
333 for (label j = 0; j < f1f2T.
n(); ++j)
335 f1f2T(i, j) = f1[i]*f2[j];
350#undef CHECK_MATRIX_IS_SQUARE
#define CHECK_MATRIX_IS_SQUARE(a, b)
virtual bool resize()
Resize the ODE solver.
Generic templated field type.
T & first() noexcept
The first element of the list, position [0].
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>.
A templated (m x n) matrix of objects of <T>. The layout is (mRows x nCols) - row-major order:
label n() const noexcept
The number of columns.
const Type & operator()(const label irow, const label jcol) const
(i, j) const element access operator
label m() const noexcept
The number of rows.
const T & second() const noexcept
Return second element, which is also the last element.
A templated (M x N) rectangular matrix of objects of <Type>, containing M*N elements,...
A templated (N x N) square matrix of objects of <Type>, containing N*N elements, derived from Matrix.
bool symmetric() const
Return true if the square matrix is effectively symmetric/Hermitian.
SquareMatrix()=default
Default construct.
autoPtr< SquareMatrix< Type > > clone() const
Clone.
bool tridiagonal() const
Return true if the square matrix is reduced tridiagonal.
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.
void size(const label n)
Older name for setAddressableSize.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
patchWriters resize(patchIds.size())
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Foam::SquareMatrix< Type > symmOuter(const Field< Type > &f1, const Field< Type > &f2)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
errorManip< error > abort(error &err)
static constexpr const zero Zero
Global zero (0)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.