pymor.algorithms.genericsolvers

This module contains some iterative linear solvers which only use the Operator interface.

Module Contents

pymor.algorithms.genericsolvers.apply_inverse(op, V, initial_guess=None, options=None, least_squares=False, check_finite=True, default_solver='generic_lgmres', default_least_squares_solver='generic_least_squares_lsmr')[source]

Solve linear equation system.

Applies the inverse of op to the vectors in V using a generic iterative solver.

Parameters

op

The linear, non-parametric Operator to invert.

V

VectorArray of right-hand sides for the equation system.

initial_guess

VectorArray with the same length as V containing initial guesses for the solution. Some implementations of apply_inverse may ignore this parameter. If None a solver-dependent default is used.

options

The solver_options to use (see solver_options).

least_squares

If True, return least squares solution.

check_finite

Test if solution only contains finite values.

default_solver

Default solver to use (generic_lgmres, generic_least_squares_lsmr, generic_least_squares_lsqr).

default_least_squares_solver

Default solver to use for least squares problems (generic_least_squares_lsmr, generic_least_squares_lsqr).

Returns

VectorArray of the solution vectors.

pymor.algorithms.genericsolvers.lgmres(A, b, x0=None, tol=1e-05, maxiter=1000, M=None, callback=None, inner_m=30, outer_k=3, outer_v=None, store_outer_Av=True)[source]
pymor.algorithms.genericsolvers.lsmr(A, b, damp=0.0, atol=1e-06, btol=1e-06, conlim=100000000.0, maxiter=None, show=False)[source]
pymor.algorithms.genericsolvers.lsqr(A, b, damp=0.0, atol=1e-08, btol=1e-08, conlim=100000000.0, iter_lim=None, show=False)[source]
pymor.algorithms.genericsolvers.solver_options(lgmres_tol=1e-05, lgmres_maxiter=1000, lgmres_inner_m=39, lgmres_outer_k=3, least_squares_lsmr_damp=0.0, least_squares_lsmr_atol=1e-06, least_squares_lsmr_btol=1e-06, least_squares_lsmr_conlim=100000000.0, least_squares_lsmr_maxiter=None, least_squares_lsmr_show=False, least_squares_lsqr_damp=0.0, least_squares_lsqr_atol=1e-06, least_squares_lsqr_btol=1e-06, least_squares_lsqr_conlim=100000000.0, least_squares_lsqr_iter_lim=None, least_squares_lsqr_show=False)[source]

Returns available solvers with default solver_options.

Parameters

lgmres_tol

See scipy.sparse.linalg.lgmres.

lgmres_maxiter

See scipy.sparse.linalg.lgmres.

lgmres_inner_m

See scipy.sparse.linalg.lgmres.

lgmres_outer_k

See scipy.sparse.linalg.lgmres.

least_squares_lsmr_damp

See scipy.sparse.linalg.lsmr.

least_squares_lsmr_atol

See scipy.sparse.linalg.lsmr.

least_squares_lsmr_btol

See scipy.sparse.linalg.lsmr.

least_squares_lsmr_conlim

See scipy.sparse.linalg.lsmr.

least_squares_lsmr_maxiter

See scipy.sparse.linalg.lsmr.

least_squares_lsmr_show

See scipy.sparse.linalg.lsmr.

least_squares_lsqr_damp

See scipy.sparse.linalg.lsqr.

least_squares_lsqr_atol

See scipy.sparse.linalg.lsqr.

least_squares_lsqr_btol

See scipy.sparse.linalg.lsqr.

least_squares_lsqr_conlim

See scipy.sparse.linalg.lsqr.

least_squares_lsqr_iter_lim

See scipy.sparse.linalg.lsqr.

least_squares_lsqr_show

See scipy.sparse.linalg.lsqr.

Returns

A dict of available solvers with default solver_options.