ConstantOperator#
- class ConstantOperator(entries=None)[source]#
Constant operator \(\Ophat_{\ell}(\qhat,\u) = \chat \in \RR^{r}\).
- Parameters
- entries(r,) ndarray or None
Operator entries \(\chat\).
Examples
>>> import numpy as np >>> c = opinf.operators.ConstantOperator() >>> entries = np.random.random(10) # Operator entries. >>> c.set_entries(np.random.random(10)) >>> c.shape (10,) >>> out = c.apply() # "Apply" the operator. >>> np.allclose(out, entries) True
Properties
entries
Discrete representation of the operator, the matrix \(\Ohat\).
shape
Shape of the operator entries array.
state_dimension
Dimension 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\c\).
Construct the state Jacobian of the operator.
Load an operator from an HDF5 file.
Column dimension of the operator entries (always 1).
Save the operator to an HDF5 file.
Set the
entries
attribute.