Struct Shocked
pub struct Shocked {
base: Box<Curve>,
shock: Box<Curve>,
label: String,
}Expand description
A base under a named scenario perturbation.
The shock is a spread curve, so the arithmetic is the same as composing one. What a shock adds is identity: the name is what a scenario report keys its row by. That identity lives here, on the storage, for the same reason a step curve’s knot kinds do — the evaluation trait says what a curve is, and how a sensitivity is labelled is a property of the lift.
Fields§
§base: Box<Curve>§shock: Box<Curve>§label: StringImplementations§
§impl Shocked
impl Shocked
pub fn new(base: Curve, shock: Curve, label: impl Into<String>) -> Self
pub fn new(base: Curve, shock: Curve, label: impl Into<String>) -> Self
base perturbed by shock, reported under label.
pub fn view<R: Scalar>(&self) -> ShockedView<'_, R>
pub fn view<R: Scalar>(&self) -> ShockedView<'_, R>
This transform lifted into mode R.
pub(crate) fn view_with_slice<'a, R: Scalar>(
&'a self,
rest: &mut &'a [R],
) -> ShockedView<'a, R>
pub(crate) fn view_with_slice<'a, R: Scalar>( &'a self, rest: &mut &'a [R], ) -> ShockedView<'a, R>
One step of a substituted walk. See
take_params.
Like the seeded walk, this reaches the base only — the shock is stated data, so there is no parameter of its own to substitute.
pub(crate) fn view_seeding<R: Scalar + Seedable>(
&self,
seed: &mut Option<usize>,
) -> ShockedView<'_, R>
pub(crate) fn view_seeding<R: Scalar + Seedable>( &self, seed: &mut Option<usize>, ) -> ShockedView<'_, R>
One step of the seeded walk. See
take_seed.
The seed reaches the base only. A scenario shock is a stated
perturbation, not a free parameter — it is what a report keys a row by,
not something a solve moves — which is why
Curve::parts does not walk into it
either. The two must agree, or a flat parameter index would mean one
thing to the walk and another to the lift.