Skip to main content

ScoreOps

Trait ScoreOps 

Source
pub trait ScoreOps:
    Copy
    + PartialOrd
    + PartialEq
    + Add<Output = Self>
    + Sub<Output = Self>
    + Mul<Output = Self> {
    // Required methods
    fn is_finite(self) -> bool;
    fn from_f64(v: f64) -> Self;
}
Expand description

Minimal trait for types usable as scores (weights, normalized values).

Implemented for f32 and f64. Only needed as a bound on witness constructors — downstream code uses concrete types directly.

Required Methods§

Source

fn is_finite(self) -> bool

Source

fn from_f64(v: f64) -> Self

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl ScoreOps for f32

Source§

fn is_finite(self) -> bool

Source§

fn from_f64(v: f64) -> Self

Source§

impl ScoreOps for f64

Source§

fn is_finite(self) -> bool

Source§

fn from_f64(v: f64) -> Self

Implementors§