Template Class VectorFit

Inheritance Relationships

Base Type

Class Documentation

template<typename scalar_type, typename index_type>
class VectorFit : public GridKit::EMT::Component<scalar_type, index_type>

Vector-fitted rational operator.

The output dimension N and the input dimension K are those of the first of D, E and the residues that the data gives. w has K entries per real pole, then per conjugate pair, and v has K entries per conjugate pair.

Public Functions

explicit VectorFit(const ModelDataT &data)

Construct the operator that the data describes.

The output dimension N and the input dimension K are the rows and columns of the first of D, E and the residues that the data gives. Layout: internal variables w and v, input u of size K, output y of size N. verify reports invalid data.

Parameters:

data – [in] Coefficients, poles and residues.

inline IdxT outputs() const

Output dimension N.

inline IdxT inputs() const

Input dimension K.

virtual Model::ConfigurationChecks verify() const override

Check the sizes and shapes of the data and the pairing of complex poles.

Returns:

The failed checks.

virtual int setAbsoluteTolerance(RealT rel_tol) override

Set the tolerance of each memory state to the tolerance of its input over the pole magnitude.

The argument is unused. A pole at zero keeps the input tolerance.

Returns:

0.

Pre:

The component at input u has set its tolerances.

virtual int tagDifferentiable() override

Fill the tag() vector with proper indicators.

Note

For some models, this may be a no-op, and the vector returned by tag() will still be empty.

Pre:

allocate() must have been called.

virtual int evaluateOutputs() override

Evaluate every output at the current values, whether or not it is connected.

template<typename T>
void internalResidual(const T *y, const T *yp, const T *u, const T *up, T *f) const

Write the residuals of the memory states w and v.

template<typename T>
void output(OutputsT output, const T *y, const T *yp, const T *u, const T *up, T *f) const

Write the output y.

Pre:

The entries of y are zero on entry.