Trait DiscretizedAsset
pub trait DiscretizedAsset<R: Scalar> {
// Required methods
fn last_step(&self) -> usize;
fn adjust_values(
&self,
step: usize,
lattice: &HullWhiteLattice<R>,
values: &mut [R],
);
}Expand description
A product valued by backward induction on a HullWhiteLattice. The
lattice rolls it back; the asset injects its cashflows and exercise at each
slice, in the pricing mode.
Required Methods§
fn last_step(&self) -> usize
fn last_step(&self) -> usize
The last (latest) step index where the asset has value — rollback starts here.
fn adjust_values(
&self,
step: usize,
lattice: &HullWhiteLattice<R>,
values: &mut [R],
)
fn adjust_values( &self, step: usize, lattice: &HullWhiteLattice<R>, values: &mut [R], )
Adjust the slice values at step: inject cashflows, apply exercise.
Called once at the terminal step (with zero-initialised values) to
set the terminal payoff, then after each rollback step. values is
indexed by node offset (0 ⇒ j = −half_width).
Takes &self: the asset is contract data the rollback reads, so a
solver that re-rolls the same asset at many spreads shares one copy.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".