Skip to main content

AssignmentCost

Trait AssignmentCost 

Source
pub trait AssignmentCost: FiniteCost {
    // Required method
    fn checked_sub(&self, rhs: &Self) -> Option<Self>;
}
Expand description

Additive, ordered cost used by certified assignment.

Assignment needs checked addition for totals and checked subtraction for min-cost-flow residual edges and dual certificates. Implementations must provide exact arithmetic: saturating or wrapping implementations violate the certificate contract.

Required Methods§

Source

fn checked_sub(&self, rhs: &Self) -> Option<Self>

Exact checked subtraction.

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 AssignmentCost for f32

Source§

fn checked_sub(&self, rhs: &Self) -> Option<Self>

Source§

impl AssignmentCost for f64

Source§

fn checked_sub(&self, rhs: &Self) -> Option<Self>

Source§

impl AssignmentCost for i32

Source§

fn checked_sub(&self, rhs: &Self) -> Option<Self>

Source§

impl AssignmentCost for i64

Source§

fn checked_sub(&self, rhs: &Self) -> Option<Self>

Source§

impl AssignmentCost for i128

Source§

fn checked_sub(&self, rhs: &Self) -> Option<Self>

Source§

impl AssignmentCost for isize

Source§

fn checked_sub(&self, rhs: &Self) -> Option<Self>

Implementors§