pub struct EquationEval {
pub equation_id: String,
pub inputs: IndexMap<String, f64>,
pub result: f64,
pub expected: Option<f64>,
pub error: Option<f64>,
pub z3_verified: Option<bool>,
}Expand description
Equation evaluation record (EDD-17).
Every equation evaluation MUST be logged with inputs, result, and optional expected value for verification.
Fields§
§equation_id: StringEquation identifier from EMC (e.g., two_opt_delta, tour_length)
inputs: IndexMap<String, f64>Input values with variable names
result: f64Computed result
expected: Option<f64>Expected result (if known analytically)
error: Option<f64>Absolute error (|result - expected| if expected is known)
z3_verified: Option<bool>Whether Z3 verified this computation
Implementations§
Source§impl EquationEval
impl EquationEval
Sourcepub fn new(equation_id: impl Into<String>, result: f64) -> Self
pub fn new(equation_id: impl Into<String>, result: f64) -> Self
Create a new equation evaluation record.
Sourcepub fn with_input(self, name: impl Into<String>, value: f64) -> Self
pub fn with_input(self, name: impl Into<String>, value: f64) -> Self
Add an input variable.
Sourcepub fn with_expected(self, expected: f64) -> Self
pub fn with_expected(self, expected: f64) -> Self
Set expected value and compute error.
Sourcepub fn with_z3_verified(self, verified: bool) -> Self
pub fn with_z3_verified(self, verified: bool) -> Self
Mark as Z3 verified.
Sourcepub fn is_correct(&self, tolerance: f64) -> bool
pub fn is_correct(&self, tolerance: f64) -> bool
Check if result matches expected within tolerance.
Trait Implementations§
Source§impl Clone for EquationEval
impl Clone for EquationEval
Source§fn clone(&self) -> EquationEval
fn clone(&self) -> EquationEval
Returns a duplicate of the value. Read more
1.0.0 · 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 EquationEval
impl Debug for EquationEval
Source§impl<'de> Deserialize<'de> for EquationEval
impl<'de> Deserialize<'de> for EquationEval
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
Source§impl PartialEq for EquationEval
impl PartialEq for EquationEval
Source§impl Serialize for EquationEval
impl Serialize for EquationEval
impl StructuralPartialEq for EquationEval
Auto Trait Implementations§
impl Freeze for EquationEval
impl RefUnwindSafe for EquationEval
impl Send for EquationEval
impl Sync for EquationEval
impl Unpin for EquationEval
impl UnsafeUnpin for EquationEval
impl UnwindSafe for EquationEval
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