Skip to main content

Weight

Trait Weight 

Source
pub trait Weight:
    Copy
    + Ord
    + Debug
    + Add<Output = Self>
    + Sub<Output = Self>
    + AddAssign
    + SubAssign
    + 'static {
    const ZERO: Self;
    const ONE: Self;

    // Required methods
    fn inf() -> Self;
    fn double(self) -> Self;
    fn half(self) -> Self;
}
Expand description

Edge-weight type for the blossom solver: a signed integer wide enough to hold the caller’s largest weight without overflow.

Required Associated Constants§

Source

const ZERO: Self

Source

const ONE: Self

Required Methods§

Source

fn inf() -> Self

Larger than any edge slack that can arise, but small enough to leave headroom against overflow when doubled.

Source

fn double(self) -> Self

self * 2, used when doubling dual-variable adjustments.

Source

fn half(self) -> Self

self / 2, used when halving slack to keep duals integral.

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 Weight for i32

Source§

const ZERO: Self = 0

Source§

const ONE: Self = 1

Source§

fn inf() -> Self

Source§

fn double(self) -> Self

Source§

fn half(self) -> Self

Source§

impl Weight for i64

Source§

const ZERO: Self = 0

Source§

const ONE: Self = 1

Source§

fn inf() -> Self

Source§

fn double(self) -> Self

Source§

fn half(self) -> Self

Source§

impl Weight for i128

Source§

const ZERO: Self = 0

Source§

const ONE: Self = 1

Source§

fn inf() -> Self

Source§

fn double(self) -> Self

Source§

fn half(self) -> Self

Implementors§