pub struct MatchMetrics {
pub error: f64,
pub is_exact: bool,
pub complexity: u32,
pub ugliness: f64,
pub novelty: f64,
pub stability: f64,
pub diversity: f64,
}Expand description
Metrics computed for a match
Fields§
§error: f64Absolute error from target
is_exact: boolWhether this is an exact match (error < 1e-14)
complexity: u32Total complexity score
ugliness: f64“Ugliness” penalty (deep nesting, many ops)
novelty: f64Novelty score (rarer operators/constants)
stability: f64Stability score (Newton conditioning)
diversity: f64Operator diversity score
Implementations§
Source§impl MatchMetrics
impl MatchMetrics
Sourcepub fn from_match(m: &Match, freq_map: Option<&OperatorFrequency>) -> Self
pub fn from_match(m: &Match, freq_map: Option<&OperatorFrequency>) -> Self
Compute metrics for a match
Sourcepub fn elegant_score(&self) -> f64
pub fn elegant_score(&self) -> f64
Elegant score: lower is better Optimizes for simplicity and cleanliness
Sourcepub fn interesting_score(&self, error_cap: f64) -> f64
pub fn interesting_score(&self, error_cap: f64) -> f64
Interesting score: higher is better Optimizes for novelty while maintaining reasonable error
Sourcepub fn stable_score(&self) -> f64
pub fn stable_score(&self) -> f64
Stable score: higher is better
Trait Implementations§
Source§impl Clone for MatchMetrics
impl Clone for MatchMetrics
Source§fn clone(&self) -> MatchMetrics
fn clone(&self) -> MatchMetrics
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 moreAuto Trait Implementations§
impl Freeze for MatchMetrics
impl RefUnwindSafe for MatchMetrics
impl Send for MatchMetrics
impl Sync for MatchMetrics
impl Unpin for MatchMetrics
impl UnsafeUnpin for MatchMetrics
impl UnwindSafe for MatchMetrics
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more