62 for (Type& val : *
this)
75 for (Type& val : *
this)
79 if (
mag(val) > VSMALL)
100 [&](label i, label j){ return compare((*this)[i], (*this)[j]); }
111 if (this->
size() !=
p.size())
114 <<
"Attempt to column-reorder according to an uneven list: " <<
nl
115 <<
"DiagonalMatrix diagonal size = " << this->
size() <<
nl
116 <<
"Permutation list size = " <<
p.size() <<
nl
121 List<bool> pass(
p.size(),
false);
123 for (label i = 0; i <
p.size(); ++i)
158 Type* iter = Ainv.
begin();
160 for (
const Type& val : mat)
162 if (
mag(val) > VSMALL)
184 if (mat.
size() !=
p.size())
187 <<
"Attempt to column-reorder according to an uneven list: " <<
nl
188 <<
"DiagonalMatrix diagonal size = " << mat.
size() <<
nl
189 <<
"Permutation list size = " <<
p.size() <<
nl
197 for (
const label i :
p)
199 reordered[j] = mat[i];
A templated (N x N) diagonal matrix of objects of <Type>, effectively containing N elements,...
labelList sortPermutation(const CompOp &compare) const
Return a sort permutation labelList according to a given comparison on the diagonal entries.
DiagonalMatrix()=default
Default construct.
void invert()
Return the matrix inverse into itself.
void applyPermutation(const labelUList &p)
Column-reorder this Matrix according to a given permutation labelList.
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.
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.
List< label > labelList
A List of labels.
DiagonalMatrix< Type > applyPermutation(const DiagonalMatrix< Type > &mat, const labelUList &p)
Return Matrix column-reordered according to a given permutation labelList.
void Swap(DynamicList< T, SizeMinA > &a, DynamicList< T, SizeMinB > &b)
Exchange contents of lists - see DynamicList::swap().
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)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
UList< label > labelUList
A UList of labels.
constexpr char nl
The newline '\n' character (0x0a).