factorize#
- AnsSolver.factorize(mat, algo=None, inplace=True)[source]#
Factorize a matrix
Perform the numerical factorization of a linear solver system (
).Warning
By default, factorization modifies the input matrix
mat
in place. This behavior can be changed using theinplace
argument.- Parameters:
- mat
ansys.mapdl.math.AnsMat
An ansys.mapdl.math matrix.
- algo
str
,optional
Factorization algorithm. Either
"LAPACK"
(default for dense matrices) or"DSP"
(default for sparse matrices).- inplacebool,
optional
If
False
, the factorization is performed on a copy of the input matrix (mat
argument), hence this input matrix (mat
) is not changed. Default isTrue
.
- mat
Examples
Factorize a random matrix and solve a linear system.
>>> mm = mapdl.math >>> dim = 1000 >>> m2 = mm.rand(dim, dim) >>> solver = mm.factorize(m2) >>> b = mm.ones(dim) >>> x = solver.solve(b)