pymor.algorithms.to_matrix¶
Module Contents¶
Classes¶
Define algorithm by a table of match conditions and corresponding actions. |
Functions¶
Convert a linear |
- pymor.algorithms.to_matrix.to_matrix(op, format=None, mu=None)[source]¶
Convert a linear
Operatorto a matrix.Parameters
- op
The
Operatorto convert.- format
Format of the resulting matrix:
NumPy arrayif ‘dense’, otherwise the appropriateSciPy spmatrix. IfNone, a choice between dense and sparse format is automatically made.- mu
The
parameter valuesfor which to convertop.
Returns
- res
The matrix equivalent to
op.
- class pymor.algorithms.to_matrix.ToMatrixRules(format, mu)[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.