Struct DiscretizedCallableBond
struct DiscretizedCallableBond {
coupons: Vec<(usize, f64)>,
exercises: Vec<(usize, f64, CallKind)>,
last: usize,
}Expand description
The rollback asset for a callable/puttable bond: face-scaled (step, amount)
cashflow injections plus (step, dirty redemption, kind) exercise entries,
all on exact grid slices, step-sorted. Amounts are passive — they are
contract terms — and enter the mode arithmetic as right-hand operands.
Fields§
§coupons: Vec<(usize, f64)>§exercises: Vec<(usize, f64, CallKind)>§last: usizeImplementations§
§impl DiscretizedCallableBond
impl DiscretizedCallableBond
fn assemble(
bond: &CallableBond,
grid: &TimeGrid,
cut: NaiveDate,
flows: &[(NaiveDate, f64)],
) -> Result<Self, PricingError>
fn assemble( bond: &CallableBond, grid: &TimeGrid, cut: NaiveDate, flows: &[(NaiveDate, f64)], ) -> Result<Self, PricingError>
Assembles the asset from bond on grid, injecting only flows strictly
after cut. Make-whole entries are skipped — non-exercisable data.
§Errors
PricingError::Curve if a flow or exercise date is not an exact grid
slice; the grid must be built with the bond’s own mandatory dates.
Trait Implementations§
§impl<R: Scalar> DiscretizedAsset<R> for DiscretizedCallableBond
impl<R: Scalar> DiscretizedAsset<R> for DiscretizedCallableBond
§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, _l: &HullWhiteLattice<R>, values: &mut [R])
fn adjust_values(&self, step: usize, _l: &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). Read moreAuto Trait Implementations§
impl Freeze for DiscretizedCallableBond
impl RefUnwindSafe for DiscretizedCallableBond
impl Send for DiscretizedCallableBond
impl Sync for DiscretizedCallableBond
impl Unpin for DiscretizedCallableBond
impl UnsafeUnpin for DiscretizedCallableBond
impl UnwindSafe for DiscretizedCallableBond
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more