Struct FlatSpread
pub struct FlatSpread {
reference_date: NaiveDate,
spread: f64,
}Expand description
A constant continuously-compounded spread: DF(t) = exp(−s·τ).
The spread is passive — a declared spread is contract-shaped data. A spread
with free pillars is PiecewiseSpread.
Fields§
§reference_date: NaiveDate§spread: f64Implementations§
§impl FlatSpread
impl FlatSpread
pub fn new(reference_date: NaiveDate, spread: f64) -> Result<Self, CurveError>
pub fn new(reference_date: NaiveDate, spread: f64) -> Result<Self, CurveError>
A flat spread of spread, anchored at reference_date.
§Errors
CurveError::NonFinite if the spread is NaN or infinite.
pub fn reference_date(&self) -> NaiveDate
pub fn reference_date(&self) -> NaiveDate
The date the spread is anchored at.
pub fn parameters(&self) -> &[f64]
pub fn parameters(&self) -> &[f64]
A declared spread is not a free parameter, so the slice is empty.
pub(crate) fn view_with_slice<R: Scalar>(
&self,
_rest: &mut &[R],
) -> FlatSpreadView<'_, R>
pub(crate) fn view_with_slice<R: Scalar>( &self, _rest: &mut &[R], ) -> FlatSpreadView<'_, R>
One step of a substituted walk. See
take_params.
A declared spread is not a free parameter, so this consumes none.
pub(crate) fn view_seeding<R: Scalar + Seedable>(
&self,
_seed: &mut Option<usize>,
) -> FlatSpreadView<'_, R>
pub(crate) fn view_seeding<R: Scalar + Seedable>( &self, _seed: &mut Option<usize>, ) -> FlatSpreadView<'_, R>
One step of a seeded walk. A declared spread is not a free parameter, so this cannot carry the seed: it lifts plainly and leaves the seed for the next family in the walk.
pub fn view<R: Scalar>(&self) -> FlatSpreadView<'_, R>
pub fn view<R: Scalar>(&self) -> FlatSpreadView<'_, R>
This spread lifted into mode R.
Trait Implementations§
§impl Clone for FlatSpread
impl Clone for FlatSpread
§fn clone(&self) -> FlatSpread
fn clone(&self) -> FlatSpread
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for FlatSpread
impl Debug for FlatSpread
§impl PartialEq for FlatSpread
impl PartialEq for FlatSpread
impl StructuralPartialEq for FlatSpread
Auto Trait Implementations§
impl Freeze for FlatSpread
impl RefUnwindSafe for FlatSpread
impl Send for FlatSpread
impl Sync for FlatSpread
impl Unpin for FlatSpread
impl UnsafeUnpin for FlatSpread
impl UnwindSafe for FlatSpread
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