pub enum ApproxFactor<C> {
Zero,
Ratio {
num: C,
den: C,
},
Infinite,
}Expand description
An approximation factor ε >= 0, kept exactly as a ratio of costs.
ε says how well a set of solutions covers the Pareto-optimal front:
every Pareto-optimal cost s has a solution r with
r_i <= (1 + ε) · s_i in both objectives. The searches derive ε from
cost vectors ((r_i - s_i) / s_i), so it is a ratio of two costs and
compared by exact cross-multiplication (WideMul). It is infinite
when a solution must cover a zero cost with a positive one.
Equality and order are numeric: 1/2 equals 2/4.
Variants§
Zero
ε = 0: the solutions include the whole Pareto-optimal front.
Ratio
ε = num / den, both positive.
Infinite
ε = ∞: some Pareto-optimal cost with a zero component is not yet
matched by a solution.
Implementations§
Trait Implementations§
Source§impl<C: Clone> Clone for ApproxFactor<C>
impl<C: Clone> Clone for ApproxFactor<C>
impl<C: Copy> Copy for ApproxFactor<C>
Source§impl<C: Debug> Debug for ApproxFactor<C>
impl<C: Debug> Debug for ApproxFactor<C>
impl<C: Cost + WideMul> Eq for ApproxFactor<C>
Source§impl<C: Cost + WideMul> Ord for ApproxFactor<C>
impl<C: Cost + WideMul> Ord for ApproxFactor<C>
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl<C: Cost + WideMul> PartialOrd for ApproxFactor<C>
impl<C: Cost + WideMul> PartialOrd for ApproxFactor<C>
Auto Trait Implementations§
impl<C> Forget for ApproxFactor<C>
impl<C> Freeze for ApproxFactor<C>where
C: Freeze,
impl<C> Move for ApproxFactor<C>
impl<C> RefUnwindSafe for ApproxFactor<C>where
C: RefUnwindSafe,
impl<C> Send for ApproxFactor<C>where
C: Send,
impl<C> Sync for ApproxFactor<C>where
C: Sync,
impl<C> Unpin for ApproxFactor<C>where
C: Unpin,
impl<C> UnsafeUnpin for ApproxFactor<C>where
C: UnsafeUnpin,
impl<C> UnwindSafe for ApproxFactor<C>where
C: UnwindSafe,
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