Skip to main content

CurveProvenance

Struct CurveProvenance 

pub struct CurveProvenance {
    entries: Vec<ProvenanceEntry>,
    jacobian: Vec<Vec<f64>>,
    jacobian_engine: JacobianEngine,
}
Expand description

The ladder a curve was calibrated from: what it reprices, and how its pillars move when those quotes do.

Held behind an Arc once pinned, so a curve serving two roles shares one ladder rather than two copies of it — which is also what makes the two roles’ risk meet in the same par column rather than in two disjoint sets.

Fields§

§entries: Vec<ProvenanceEntry>

One entry per rung, in solve order — the same order as the curve’s flat parameter vector, and the same length.

§jacobian: Vec<Vec<f64>>

∂z/∂q, row-major: jacobian[pillar][rung] is how far pillar pillar’s parameter moves per unit move in rung rung’s quote.

Rows are in the curve’s flat parameter order, so a risk entry’s node_index is the row index. Columns are in rung order, and are identified by this ladder together with their position — not by a curve role, so a curve pinned under two roles presents one column set to both.

Always square, with one row and one column per entry — the constructors admit no other shape.

§jacobian_engine: JacobianEngine

Which engine built jacobian. Lanes for a ladder stood up from parts, which carries no record of how its matrix was made.

Implementations§

§

impl CurveProvenance

pub fn from_parts( entries: Vec<ProvenanceEntry>, jacobian: Vec<Vec<f64>>, ) -> Result<Self, ProvenanceShape>

A ladder from its parts, both required.

The calibration builds its own; this is the seam for a caller standing one up from elsewhere. Both parts are taken together because a ladder carrying rungs but no ∂z/∂q is a half-thing: it would satisfy the rung-count check at pinning and then have no row for any pillar to land on, which is a failure discovered at the far end of the system from the mistake.

§Errors

ProvenanceShape unless jacobian is square with one row and one column per entry.

pub fn jacobian(&self) -> &[Vec<f64>]

∂z/∂q, row-major and indexed [pillar][rung].

pub fn jacobian_engine(&self) -> JacobianEngine

Which engine built jacobian.

pub fn with_engine(self, engine: JacobianEngine) -> Self

This ladder, recorded as built by engine.

pub fn entries(&self) -> &[ProvenanceEntry]

The ladder’s rungs, in solve order.

pub fn len(&self) -> usize

How many rungs — equally, how many pillars the curve carries.

pub fn is_empty(&self) -> bool

Whether the ladder is empty. A calibration never produces one; the method exists because a length accessor without it is a clippy lint.

Trait Implementations§

§

impl Clone for CurveProvenance

§

fn clone(&self) -> CurveProvenance

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for CurveProvenance

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
§

impl PartialEq for CurveProvenance

§

fn eq(&self, other: &CurveProvenance) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl StructuralPartialEq for CurveProvenance

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.