factorize#
- AnsMath.factorize(mat, algo=None, inplace=True)#
Factorize a matrix.
- Parameters:
- mat
AnsMat AnsMath matrix.
- algo
str,optional Factorization algorithm. Options are
"LAPACK"and"DSP". The default is"LAPACK"for dense matrices and"DSP"for sparse matrices.- inplacebool,
optional Whether the factorization is performed on the input matrix rather than on a copy of this matrix. Performing factorization on a copy of this matrix would result in no changes to the input matrix. The default is
True.
- mat
- Returns:
AnsSolverAnsys Solver object.
Examples
Factorize a random matrix.
>>> dim = 1000 >>> m2 = mm.rand(dim, dim) >>> m3 = m2.copy() >>> mat = mm.factorize(m2)