gemseo / algos / linear_solvers

Hide inherited members

linear_solvers_factory module

A factory to instantiate linear solvers from their class names.

class gemseo.algos.linear_solvers.linear_solvers_factory.LinearSolversFactory(use_cache=False)[source]

Bases: BaseAlgoFactory

MDA factory to create the MDA from a name or a class.

Parameters:

use_cache (bool) –

Whether to cache the created objects.

By default it is set to False.

clear_lib_cache()

Clear the library cache.

Return type:

None

create(name)

Create a driver library from an algorithm name.

Parameters:

name (str) – The name of an algorithm.

Returns:

The driver.

Raises:

ImportError – If the library is not available.

Return type:

DriverLibrary

execute(problem, algo_name, **options)[source]

Execute a problem with an algorithm.

Parameters:
  • problem (LinearProblem) – The problem to execute.

  • algo_name (str) – The name of the algorithm.

  • **options (Any) – The options of the algorithm.

Returns:

The optimization result.

Return type:

ndarray

get_class(name)

Return a class from its name.

Parameters:

name (str) – The name of the class.

Returns:

The class.

Raises:

ImportError – If the class is not available.

Return type:

type

get_library_name(name)

Return the name of the library related to the name of a class.

Parameters:

name (str) – The name of the class.

Returns:

The name of the library.

Return type:

str

is_available(name)

Check the availability of a library name or algorithm name.

Parameters:

name (str) – The name of the library name or algorithm name.

Returns:

Whether the library or algorithm is available.

Return type:

bool

property algo_names_to_libraries: dict[str, str]

The mapping from the algorithm names to the libraries.

property algorithms: list[str]

The available algorithms names.

property libraries: list[str]

List the available library names in the present configuration.

Returns:

The names of the available libraries.

property linear_solvers: list[str]

The names of the available classes.