pymor.algorithms.lincomb¶
Module Contents¶
Classes¶
Define algorithm by a table of match conditions and corresponding actions. |
Functions¶
Try to assemble a linear combination of the given operators. |
- pymor.algorithms.lincomb.assemble_lincomb(operators, coefficients, solver_options=None, name=None)[source]¶
Try to assemble a linear combination of the given operators.
Returns a new
Operatorwhich represents the sumc_1*O_1 + ... + c_N*O_N
where
O_iareOperatorsandc_iscalar coefficients.This function is called in the
assemblemethod ofLincombOperatorand is not intended to be used directly.To form the linear combination of backend
Operators(containing actual matrix data),_assemble_lincombwill be called on the firstOperatorin the linear combination.Parameters
- operators
List of
OperatorsO_iwhose linear combination is formed.- coefficients
List of the corresponding linear coefficients
c_i.- solver_options
solver_optionsfor the assembled operator.- name
Name of the assembled operator.
Returns
The assembled
Operator.
- class pymor.algorithms.lincomb.AssembleLincombRules(coefficients, solver_options, name)[source]¶
Bases:
pymor.algorithms.rules.RuleTableDefine algorithm by a table of match conditions and corresponding actions.
RuleTablemanages a table ofrules, stored in therulesattributes, which can beappliedto given objects.A new table is created by subclassing
RuleTableand defining new methods which are decorated withmatch_class,match_genericor anotherrulesubclass. The order of the method definitions determines the order in which the definedrulesare applied.Parameters
- use_caching
If
True, cache results ofapply.