Trait ParametersAD

Source
pub trait ParametersAD:
    Send
    + Sync
    + Sized {
    type Parameters<D: DualNum<f64> + Copy>: Clone;

    // Required methods
    fn params<D: DualNum<f64> + Copy>(&self) -> Self::Parameters<D>;
    fn params_from_inner<D: DualNum<f64> + Copy, D2: DualNum<f64, Inner = D> + Copy>(
        parameters: &Self::Parameters<D>,
    ) -> Self::Parameters<D2>;

    // Provided method
    fn wrap<const N: usize>(self) -> HelmholtzEnergyWrapper<Self, f64, N> { ... }
}
Expand description

A model that can be evaluated with derivatives of its parameters.

Required Associated Types§

Source

type Parameters<D: DualNum<f64> + Copy>: Clone

The type of the structure that stores the parameters internally.

Required Methods§

Source

fn params<D: DualNum<f64> + Copy>(&self) -> Self::Parameters<D>

Return the parameters in the given data type.

Source

fn params_from_inner<D: DualNum<f64> + Copy, D2: DualNum<f64, Inner = D> + Copy>( parameters: &Self::Parameters<D>, ) -> Self::Parameters<D2>

Lift the parameters to the given type of dual number.

Provided Methods§

Source

fn wrap<const N: usize>(self) -> HelmholtzEnergyWrapper<Self, f64, N>

Wraps the model in the HelmholtzEnergyWrapper struct, so that it can be used as an argument to StateAD and PhaseEquilibriumAD constructors.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§