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: JacobianEngineWhich engine built jacobian. Lanes for a ladder stood up from
parts, which carries no record of how its matrix was made.
Implementations§
§impl CurveProvenance
impl CurveProvenance
pub fn from_parts(
entries: Vec<ProvenanceEntry>,
jacobian: Vec<Vec<f64>>,
) -> Result<Self, ProvenanceShape>
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_engine(&self) -> JacobianEngine
pub fn jacobian_engine(&self) -> JacobianEngine
Which engine built jacobian.
pub fn with_engine(self, engine: JacobianEngine) -> Self
pub fn with_engine(self, engine: JacobianEngine) -> Self
This ladder, recorded as built by engine.
pub fn entries(&self) -> &[ProvenanceEntry]
pub fn entries(&self) -> &[ProvenanceEntry]
The ladder’s rungs, in solve order.
Trait Implementations§
§impl Clone for CurveProvenance
impl Clone for CurveProvenance
§fn clone(&self) -> CurveProvenance
fn clone(&self) -> CurveProvenance
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more