Go to the documentation of this file.
36 template<
class CompOp>
43 std::iota(
p.begin(),
p.end(), 0);
48 [&](label i, label j){ return compare((*this)(i,i), (*this)(j,j)); }
59 if (this->m() !=
p.size())
62 <<
"Attempt to column-reorder according to an uneven list: " <<
nl
63 <<
"SquareMatrix diagonal size = " << this->m() <<
nl
64 <<
"Permutation list size = " <<
p.size() <<
nl
69 SquareMatrix<Type> reordered(this->sizes());
72 for (
const label i :
p)
74 reordered.subColumn(j) = this->subColumn(i);
78 this->transfer(reordered);
85 template<
class AnyType>
90 for (label i = 0; i < this->
n(); ++i)
114 for (label i = 0; i < matrix.
m(); ++i)
116 diagProduct *= matrix(i, i);
119 return sign*diagProduct;
159 if (mat.
m() !=
p.size())
162 <<
"Attempt to column-reorder according to an uneven list: " <<
nl
163 <<
"SquareMatrix diagonal size = " << mat.
m() <<
nl
164 <<
"Permutation list size = " <<
p.size() <<
nl
172 for (
const label i :
p)
185 class typeOfInnerProduct<Type, SquareMatrix<Type>, SquareMatrix<Type>>
scalar detDecomposed(const SquareMatrix< Type > &matrix, const label sign)
DiagonalMatrix< Type > applyPermutation(const DiagonalMatrix< Type > &mat, const List< label > &p)
static constexpr const zero Zero
ConstMatrixBlock< mType > subColumn(const label colIndex, const label rowIndex=0, label len=-1) const
dimensionedScalar sign(const dimensionedScalar &ds)
A templated (m x n) matrix of objects of <T>. The layout is (mRows x nCols) - row-major order:
Templated identity and dual space identity tensors derived from SphericalTensor.
void applyPermutation(const List< label > &p)
errorManip< error > abort(error &err)
SquareMatrix & operator=(const SquareMatrix &)=default
void LUDecompose(scalarSquareMatrix &matrix, labelList &pivotIndices)
A templated (N x N) square matrix of objects of <Type>, containing N*N elements, derived from Matrix.
#define FatalErrorInFunction
List< label > sortPermutation(CompOp &compare) const
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A traits class, which is primarily used for primitives.
fileName::Type type(const fileName &name, const bool followLink=true)
dimensionedScalar det(const dimensionedSphericalTensor &dt)
SquareMatrix< Type > type