pymoto.LinSolve
- class pymoto.LinSolve(dep_tol: float = 1e-05, hermitian: bool = None, symmetric: bool = None, positive_definite: bool = None, solver: LinearSolver = None)
Solves linear system of equations \(\mathbf{A}\mathbf{x}=\mathbf{b}\)
Self-adjointness is automatically detected using
LDAWrapper.- Input Signals:
A(dense or sparse matrix): The system matrix \(\mathbf{A}\) of size(n, n)b(vector): Right-hand-side vector of size(n)or block-vector of size(n, Nrhs)
- Output Signal:
x(vector): Solution vector of size(n)or block-vector of size(n, Nrhs)
- use_lda_solver
Use the linear-dependency-aware solver
LDAWrapperto prevent redundant computations
- __init__(dep_tol: float = 1e-05, hermitian: bool = None, symmetric: bool = None, positive_definite: bool = None, solver: LinearSolver = None)
Initialize the linear solver module
- Parameters:
dep_tol (float, optional) – Tolerance for detecting linear dependence of solution vectors. Defaults to 1e-5.
hermitian (bool, optional) – Flag to omit the automatic detection for Hermitian matrix, saves some work for large matrices
symmetric (bool, optional) – Flag to omit the automatic detection for symmetric matrix, saves some work for large matrices
positive_definite (bool, optional) – Flag to specify if the matrix is positive definite
solver (
pymoto.solvers.LinearSolver, optional) – Manually override the linear solver used, instead of the the solver frompymoto.solvers.auto_determine_solver()
Methods
__init__([dep_tol, hermitian, symmetric, ...])Initialize the linear solver module
connect(sig_in[, sig_out])Connect without automatic adding to a function network
get_input_sensitivities([as_list])get_input_states([as_list])get_output_sensitivities([as_list])get_output_states([as_list])reset()Reset the state of the sensitivities (they are set to zero or to None)
response()Calculate the response from sig_in and output this to sig_out
Calculate sensitivities using backpropagation
Attributes
Get the number of input signals
Get the number of output signals
- use_lda_solver = True
- connect(sig_in: Signal | Iterable[Signal], sig_out: Signal | Iterable[Signal] = None)
Connect without automatic adding to a function network
- get_input_sensitivities(as_list=False)
- get_input_states(as_list=False)
- get_output_sensitivities(as_list=False)
- get_output_states(as_list=False)
- property n_in: int
Get the number of input signals
- property n_out: int
Get the number of output signals
Note: Cannot be used in the initial __call__()
- reset()
Reset the state of the sensitivities (they are set to zero or to None)
- response()
Calculate the response from sig_in and output this to sig_out
- sensitivity()
Calculate sensitivities using backpropagation
Based on the sensitivity we get from sig_out, reverse the process and output the new sensitivities to sig_in
- sig_in: List = None
- sig_out: List = None