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
Operator
to a matrix.Parameters
- op
The
Operator
to convert.- format
Format of the resulting matrix:
NumPy array
if ‘dense’, otherwise the appropriateSciPy spmatrix
. IfNone
, a choice between dense and sparse format is automatically made.- mu
The
parameter values
for which to convertop
.
Returns
- res
The matrix equivalent to
op
.
- class pymor.algorithms.to_matrix.ToMatrixRules(format, mu)[source]¶
Bases:
pymor.algorithms.rules.RuleTable
Define algorithm by a table of match conditions and corresponding actions.
RuleTable
manages a table ofrules
, stored in therules
attributes, which can beapplied
to given objects.A new table is created by subclassing
RuleTable
and defining new methods which are decorated withmatch_class
,match_generic
or anotherrule
subclass. The order of the method definitions determines the order in which the definedrules
are applied.Parameters
- use_caching
If
True
, cache results ofapply
.