ConstantOperator#
- class ConstantOperator(entries=None)[source]#
Constant operator \(\Ophat_{\ell}(\qhat,\u) = \chat \in \RR^{r}\).
- Parameters:
- entries(r,) ndarray or None
Operator vector \(\chat\).
Examples
>>> import numpy as np >>> c = opinf.operators.ConstantOperator() >>> entries = np.random.random(10) # Operator vector. >>> c.set_entries(np.random.random(10)) >>> c.shape (10,) >>> out = c.apply() # "Apply" the operator. >>> np.allclose(out, entries) True
Properties:- entries#
Operator vector \(\chat\).
- shape#
Shape \((r,)\) of the operator vector \(\chat\).
- state_dimension#
Dimension \(r\) of the state \(\qhat\) that the operator acts on.
Methods:Apply the operator to the given state / input: \(\Ophat_{\ell}(\qhat,\u) = \chat\).
Return a copy of the operator.
Return the data matrix block corresponding to the operator, a row vector of ones.
Return the Galerkin projection of the operator, \(\chat = (\Wr\trp\Vr)^{-1}\Wr\trp\c\).
Construct the state Jacobian of the operator.
Load an operator from an HDF5 file.
Column dimension of the operator vector (always 1).
Save the operator to an HDF5 file.
Set the operator vector \(\chat\).
Verify consistency between dimension properties and required methods.