#[non_exhaustive]pub struct SolverResult {
pub iv: f64,
pub method: SolverMethod,
pub iterations: u32,
pub converged: bool,
pub status: SolverStatus,
pub residual: f64,
}Expand description
Result of an iv_solver::solve_iv attempt.
Check converged (or status) before consuming iv. Whenever the
solver does not converge, iv is f64::NAN and status explains why.
converged is exactly status == SolverStatus::Converged.
New fields may be added in future minor versions; construct via the solver, not via field initializers.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.iv: f64Solved implied volatility (annualized). f64::NAN unless status is
SolverStatus::Converged.
method: SolverMethodSolver method used to produce this result.
iterations: u32Number of iterations taken.
converged: boolWhether the solver converged. Equivalent to
status == SolverStatus::Converged.
status: SolverStatusThe precise outcome of the solve (the reason behind converged).
residual: f64Residual |model_price - market_price| at the solution (or at the
best endpoint examined when no root was found).
Trait Implementations§
Source§impl Clone for SolverResult
impl Clone for SolverResult
Source§fn clone(&self) -> SolverResult
fn clone(&self) -> SolverResult
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 moreSource§impl Debug for SolverResult
impl Debug for SolverResult
Source§impl<'de> Deserialize<'de> for SolverResult
impl<'de> Deserialize<'de> for SolverResult
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SolverResult
impl RefUnwindSafe for SolverResult
impl Send for SolverResult
impl Sync for SolverResult
impl Unpin for SolverResult
impl UnsafeUnpin for SolverResult
impl UnwindSafe for SolverResult
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