pub struct MinDegree;Expand description
Minimum-degree metric — the AMD selection rule of Amestoy, Davis, Duff (1996).
Score is the running degree. Bucket index is the score itself.
All buckets are “fine” (head-only pivot selection). Supervariable
merge does not update the score (AMD tracks degree only via
nv[i] and the per-iteration Pass-2 monotone cap).
Trait Implementations§
Source§impl Metric for MinDegree
impl Metric for MinDegree
Source§type Score = i32
type Score = i32
Bucket key produced by the selection metric. AMD uses
i32
(the running degree); AMF will also use i32 (quantized RMF).Source§fn n_buckets(n: usize) -> usize
fn n_buckets(n: usize) -> usize
Length of the bucket head array
Workspace::head. AMD: n
(indexed up to n - 1 by select_pivot’s while deg < n).
AMF: 2 * n + 2.Source§fn init_score(len: i32) -> i32
fn init_score(len: i32) -> i32
Initial score for a freshly-loaded variable with adjacency
length
len. AMD and AMF both seed len.Source§fn bucket(score: i32, _n: usize) -> usize
fn bucket(score: i32, _n: usize) -> usize
Bucket index for the given score. AMD: identity. AMF: identity
for
s ≤ n, coarse-stride above.Source§fn coarse_bucket(_idx: usize, _n: usize) -> bool
fn coarse_bucket(_idx: usize, _n: usize) -> bool
Whether
idx falls in the “coarse” bucket region — i.e.
select_pivot must linear-scan the bucket chain to pick the
minimum-score entry, rather than just taking the head. AMD
always returns false; AMF returns idx > n.Source§fn merge_supervariable(_parent: &mut i32, _child: i32)
fn merge_supervariable(_parent: &mut i32, _child: i32)
Update
parent’s score on supervariable merge of child into
parent. AMD: no-op. AMF: *parent = max(*parent, child).Source§fn run_elimination(
ws: &mut Workspace,
aggressive: bool,
) -> Result<StepFlops, OrderingError>
fn run_elimination( ws: &mut Workspace, aggressive: bool, ) -> Result<StepFlops, OrderingError>
Run the metric’s elimination loop on a freshly initialised
Workspace. Returns the accumulated flop counters. Read moreimpl Copy for MinDegree
Auto Trait Implementations§
impl Freeze for MinDegree
impl RefUnwindSafe for MinDegree
impl Send for MinDegree
impl Sync for MinDegree
impl Unpin for MinDegree
impl UnsafeUnpin for MinDegree
impl UnwindSafe for MinDegree
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