Go to the documentation of this file.
62 for (Type& val : *
this)
75 for (Type& val : *
this)
77 if (
mag(val) < VSMALL)
90 template<
class CompOp>
97 std::iota(
p.begin(),
p.end(), 0);
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)
188 if (mat.size() !=
p.size())
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];
void Swap(DynamicList< T, SizeMinA > &a, DynamicList< T, SizeMinB > &b)
DiagonalMatrix< Type > applyPermutation(const DiagonalMatrix< Type > &mat, const List< label > &p)
static constexpr const zero Zero
Global zero (0)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
A templated (m x n) matrix of objects of <T>. The layout is (mRows x nCols) - row-major order:
A templated (N x N) diagonal matrix of objects of <Type>, effectively containing N elements,...
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
List< label > sortPermutation(CompOp &compare) const
void invert()
Return the matrix inverse into itself if no elem is equal to zero.
void applyPermutation(const List< label > &p)
errorManip< error > abort(error &err)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
DiagonalMatrix()=default
Default construct.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...