62 for (Type& val : *
this)
75 for (Type& val : *
this)
77 if (
mag(val) < VSMALL)
102 [&](label i, label j){ return compare((*this)[i], (*this)[j]); }
113 if (this->size() !=
p.
size())
116 <<
"Attempt to column-reorder according to an uneven list: " <<
nl
117 <<
"DiagonalMatrix diagonal size = " << this->size() <<
nl
118 <<
"Permutation list size = " <<
p.
size() <<
nl
125 for (label i = 0; i <
p.
size(); ++i)
136 Swap((*
this)[prev], (*
this)[j]);
158 Type* iter = Ainv.
begin();
160 for (
const Type& val : mat)
162 if (
mag(val) < VSMALL)
191 <<
"Attempt to column-reorder according to an uneven list: " <<
nl
192 <<
"DiagonalMatrix diagonal size = " << mat.
size() <<
nl
193 <<
"Permutation list size = " <<
p.
size() <<
nl
201 for (
const label i :
p)
203 reordered[j] = mat[i];
A templated (N x N) diagonal matrix of objects of <Type>, effectively containing N elements,...
List< label > sortPermutation(CompOp &compare) const
DiagonalMatrix()=default
Default construct.
void applyPermutation(const List< label > &p)
void invert()
Return the matrix inverse into itself if no elem is equal to zero.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A templated (m x n) matrix of objects of <T>. The layout is (mRows x nCols) - row-major order:
iterator begin() noexcept
Return an iterator to begin traversing the UList.
iterator end() noexcept
Return an iterator to end traversing the UList.
void size(const label n)
Older name for setAddressableSize.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void Swap(DynamicList< T, SizeMinA > &a, DynamicList< T, SizeMinB > &b)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
errorManip< error > abort(error &err)
DiagonalMatrix< Type > applyPermutation(const DiagonalMatrix< Type > &mat, const List< label > &p)
static constexpr const zero Zero
Global zero (0)
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
constexpr char nl
The newline '\n' character (0x0a)