taichi.linalg.sparse_solver
¶
Module Contents¶
Classes¶
Sparse linear system solver |
- class taichi.linalg.sparse_solver.SparseSolver(dtype=f32, solver_type='LLT', ordering='AMD')¶
Sparse linear system solver
Use this class to solve linear systems represented by sparse matrices.
- Parameters
solver_type (str) – The factorization type.
ordering (str) – The method for matrices re-ordering.
- static type_assert(sparse_matrix)¶
- compute(self, sparse_matrix)¶
This method is equivalent to calling both analyze_pattern and then factorize.
- Parameters
sparse_matrix (SparseMatrix) – The sparse matrix to be computed.
- analyze_pattern(self, sparse_matrix)¶
Reorder the nonzero elements of the matrix, such that the factorization step creates less fill-in.
- Parameters
sparse_matrix (SparseMatrix) – The sparse matrix to be analyzed.
- factorize(self, sparse_matrix)¶
Do the factorization step
- Parameters
sparse_matrix (SparseMatrix) – The sparse matrix to be factorized.
- solve(self, b)¶
Computes the solution of the linear systems. :param b: The right-hand side of the linear systems. :type b: numpy.array or Field
- Returns
The solution of linear systems.
- Return type
numpy.array
- info(self)¶
Check if the linear systems are solved successfully.
- Returns
True if the solving process succeeded, False otherwise.
- Return type
bool