linear_solver_library module¶
Base wrapper for all linear solvers.
- class gemseo.algos.linear_solvers.linear_solver_library.LinearSolverDescription(algorithm_name, internal_algorithm_name, library_name='', description='', website='', lhs_must_be_symmetric=False, lhs_must_be_positive_definite=False, lhs_must_be_linear_operator=False)[source]
Bases:
AlgorithmDescription
The description of a linear solver.
- Parameters:
algorithm_name (str) –
internal_algorithm_name (str) –
library_name (str) –
By default it is set to “”.
description (str) –
By default it is set to “”.
website (str) –
By default it is set to “”.
lhs_must_be_symmetric (bool) –
By default it is set to False.
lhs_must_be_positive_definite (bool) –
By default it is set to False.
lhs_must_be_linear_operator (bool) –
By default it is set to False.
- algorithm_name: str
The name of the algorithm in GEMSEO.
- internal_algorithm_name: str
The name of the algorithm in the wrapped library.
- lhs_must_be_linear_operator: bool = False
Whether the left-hand side matrix must be a linear operator.
- lhs_must_be_positive_definite: bool = False
Whether the left-hand side matrix must be positive definite.
- lhs_must_be_symmetric: bool = False
Whether the left-hand side matrix must be symmetric.
- class gemseo.algos.linear_solvers.linear_solver_library.LinearSolverLibrary[source]
Bases:
AlgorithmLibrary
Abstract class for libraries of linear solvers.
- solve(linear_problem, algo_name, **options)[source]
Solve the linear system.
- Parameters:
linear_problem (LinearProblem) – The problem to solve.
algo_name (str) – The name of the algorithm.
**options (Any) – The algorithm options.
- Returns:
The execution result.
- Return type:
- SAVE_WHEN_FAIL = 'save_when_fail'
- descriptions: dict[str, AlgorithmDescription]
The description of the algorithms contained in the library.
- internal_algo_name: str | None
The internal name of the algorithm used currently.
It typically corresponds to the name of the algorithm in the wrapped library if any.
- opt_grammar: JSONGrammar | None
The grammar defining the options of the current algorithm.
- problem: Any | None
The problem to be solved.
- property solution: ndarray
The solution of the problem.