Skip to main content

Input

Enum Input 

enum Input<'a> {
    Term(&'a CurveId, &'a Term),
    Fixings(&'a FixingStore),
    Fx(&'a FxRates),
    Vol(&'a VolSurfaceId, &'a VolSurface),
    Recovery(&'a CreditCurveId, f64),
    Mark(&'a MarkId, &'a Mark),
}
Expand description

One stored input as the lift reads it, with the key it is stored under.

Self-describing: it names its own InputId, labels its own parameters and reports its own refusal, so no walk pairs a span with a store it must look the input back up in. A closed enum rather than a trait object because the kinds are fixed and three of them are not curves — a shared trait would hand a fixing store a method about adjoint refusals it has no use for.

Variants§

§

Term(&'a CurveId, &'a Term)

One term structure, by identity.

§

Fixings(&'a FixingStore)

§

Fx(&'a FxRates)

§

Vol(&'a VolSurfaceId, &'a VolSurface)

One vol surface, by identity: one parameter per node.

§

Recovery(&'a CreditCurveId, f64)

One entity’s market recovery, by entity: walked after every curve and surface so pinning one moves no earlier offset.

§

Mark(&'a MarkId, &'a Mark)

One model mark, by identity: walked last, so pinning one moves no other input.

Implementations§

§

impl Input<'_>

fn source(&self) -> InputId

What a Span records this input as.

fn contents(&self) -> Vec<(&'static str, String)>

This input’s stored identifiers as (kind, key) rows, in store order.

The kind names the builder verb that fills the store, so a row reads as the call that would put it back. A store holding several things yields several rows — one fixing observation, one FX quote, one watched label each — because each is separately addressable; a store holding nothing yields none.

fn parameter_count(&self) -> usize

How many free parameters this input contributes.

fn extend_into(&self, out: &mut Vec<f64>)

Appends this input’s parameters to out, in the order its view consumes them. A composed curve flattens through for_each_owner, in parameter_owners order — the order view_with consumes — so a market of leaves fills one vector rather than one per curve.

fn labels(&self) -> Vec<MarketInputId>

The identifier of each parameter this input contributes, in the same order extend_into lays them down.

fn adjoint_refusal(&self) -> Option<(CurveId, &'static str)>

Why this input cannot report correct sensitivities, with the curve to name, if it cannot. Only a curve can refuse.

Auto Trait Implementations§

§

impl<'a> Freeze for Input<'a>

§

impl<'a> RefUnwindSafe for Input<'a>

§

impl<'a> Send for Input<'a>

§

impl<'a> Sync for Input<'a>

§

impl<'a> Unpin for Input<'a>

§

impl<'a> UnsafeUnpin for Input<'a>

§

impl<'a> UnwindSafe for Input<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.