linear_solver_lib module¶
Base wrapper for all linear solvers.
Classes:
Abstract class for libraries of linear solvers. |
- class gemseo.algos.linear_solvers.linear_solver_lib.LinearSolverLib[source]¶
Bases:
gemseo.algos.algo_lib.AlgoLib
Abstract class for libraries of linear solvers.
- Return type
None
- XXX how about backup_path or file_path?
- save_fpath¶
The path to the file to save the problem when it is not converged and the attribute save_when_fail is True.
- Type
str
Attributes:
The available algorithms.
The solution of the problem.
Methods:
driver_has_option
(option_key)Check if the option key exists.
execute
(problem[, algo_name])Executes the driver.
filter_adapted_algorithms
(problem)Filter the algorithms capable of solving the problem.
init_options_grammar
(algo_name)Initialize the options grammar.
is_algorithm_suited
(algo_dict, problem)Check if the algorithm is suited to the problem according to algo_dict.
solve
(linear_problem, algo_name, **options)Solve the linear system.
- INTERNAL_NAME = 'internal_algo_name'¶
- LHS_CAN_BE_LINEAR_OPERATOR = 'LHS_linear_operator'¶
- LHS_MUST_BE_POSITIVE_DEFINITE = 'LHS_positive_definite'¶
- LHS_MUST_BE_SYMMETRIC = 'LHS_symmetric'¶
- LIB = 'lib'¶
- OPTIONS_DIR = 'options'¶
- OPTIONS_MAP = {}¶
- PROBLEM_TYPE = 'problem_type'¶
- SAVE_WHEN_FAIL = 'save_when_fail'¶
- property algorithms¶
The available algorithms.
- driver_has_option(option_key)¶
Check if the option key exists.
- Parameters
option_key (str) – The name of the option.
- Returns
Whether the option is in the grammar.
- Return type
bool
- execute(problem, algo_name=None, **options)¶
Executes the driver.
- Parameters
problem (Any) – The problem to be solved.
algo_name (Optional[str]) –
The name of the algorithm> If None, use the algo_name attribute which may have been set by the factory.
By default it is set to None.
options – The options dict for the algorithm.
**options (Any) –
- Return type
None
- filter_adapted_algorithms(problem)¶
Filter the algorithms capable of solving the problem.
- Parameters
problem (Any) – The opt_problem to be solved.
- Returns
The list of adapted algorithms names.
- Return type
bool
- init_options_grammar(algo_name)¶
Initialize the options grammar.
- Parameters
algo_name (str) – The name of the algorithm.
- Return type
- static is_algorithm_suited(algo_dict, problem)[source]¶
Check if the algorithm is suited to the problem according to algo_dict.
- Parameters
algo_dict (Mapping[str, bool]) – The algorithm characteristics.
problem (gemseo.algos.linear_solvers.linear_problem.LinearProblem) – The problem to be solved.
- Returns
Whether the algorithm suits.
- Return type
bool
- property solution¶
The solution of the problem.
- solve(linear_problem, algo_name, **options)[source]¶
Solve the linear system.
- Parameters
linear_problem (gemseo.algos.linear_solvers.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
Any