54 for (
label i=0; i<m; i++)
56 for (
label j=0; j<m; j++)
68 sum -= LLT(i,
k)*LLT(j,
k);
73 LLT(i, j) =
sum/LLT(j, j);
82 <<
"Cholesky decomposition failed, "
83 "matrix is not symmetric positive definite"
107 for (
label i=0; i<m; i++)
109 Type
sum = source[i];
111 for (
label j=0; j<i; j++)
116 x[i] =
sum/LLT(i, i);
119 for (
int i=m - 1; i >= 0; i--)
123 for (
label j=i + 1; j<m; j++)
128 x[i] =
sum/LLT(i, i);
Pre-declare SubField and related Field type.
void solve(Field< Type > &x, const Field< Type > &source) const
Solve the linear system with the given source.
void decompose(const SquareMatrix< Type > &M)
Perform the Cholesky decomposition of the matrix.
LLTMatrix()
Construct null.
label m() const
Return the number of rows.
A templated 2D square matrix of objects of <T>, where the n x n matrix dimension is known and used fo...
A class for managing temporary objects.
T & ref() const
Return non-const reference or generate a fatal error.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
errorManip< error > abort(error &err)
dimensionedScalar sqrt(const dimensionedScalar &ds)