pub struct Workspace {Show 23 fields
pub n: usize,
pub iwlen: usize,
pub pfree: usize,
pub iw: Vec<i32>,
pub pe: Vec<i32>,
pub len: Vec<i32>,
pub nv: Vec<i32>,
pub elen: Vec<i32>,
pub degree: Vec<i32>,
pub w: Vec<i32>,
pub head: Vec<i32>,
pub next: Vec<i32>,
pub last: Vec<i32>,
pub wf: Vec<i64>,
pub wflg: i32,
pub wbig: i32,
pub lemax: i32,
pub mindeg: usize,
pub ncmpa: u32,
pub nel: usize,
pub ndense: i32,
pub n_mass_elim: u32,
pub n_supervar_merge: u32,
}Expand description
In-memory workspace for one AMD run.
The fields mirror faer’s amd_2 locals. Ownership of every buffer
is held here so the elimination loop can borrow them concurrently
through split borrows without reallocation.
Fields§
§n: usize§iwlen: usize§pfree: usize§iw: Vec<i32>§pe: Vec<i32>§len: Vec<i32>§nv: Vec<i32>§elen: Vec<i32>§degree: Vec<i32>§w: Vec<i32>§head: Vec<i32>§next: Vec<i32>§last: Vec<i32>§wf: Vec<i64>Per-supervariable / per-element fill-score scratch used by the
AMF inner loop only. Length n. Ignored by the AMD path
(feral-amd never reads or writes it). For variable indices
i, holds the running quantized RMF score; for element indices
e, holds the lazily-cached dext * (2*deg(e) - dext - 1)
surface contribution (sentinel 0 = “first touch this iter”).
i64 (not i32): the un-quantized surface contribution has
both factors O(n), so it reaches ~n^2 and overflows i32
for n ≳ 46k before being consumed as f64 in the RMF score
(O1, dev/research/repo-review-2026-06-09.md). MUMPS computes
the RMF in DBLE for the same reason. The post-quantization RMF
score stored here later is bounded by i32::MAX - 1.
wflg: i32Generation counter for the mark array w.
wbig: i32Overflow ceiling for wflg: i32::MAX - n.
lemax: i32Largest element size encountered so far — used by supervariable
detection (Slice B) to bump wflg safely.
mindeg: usizeLower bound on the next pivot’s degree. Monotone non-decreasing.
ncmpa: u32Number of garbage-collection compactions so far.
nel: usizeSupervariables eliminated so far (pivoted OR dense-deferred).
ndense: i32Dense-deferred supervariable count.
n_mass_elim: u32Variables folded into a concurrent pivot by mass elimination.
n_supervar_merge: u32Supervariable merges detected during indistinguishable-variable consolidation.
Implementations§
Source§impl Workspace
impl Workspace
Sourcepub fn new(
pattern: &CscPattern<'_>,
opts: &WorkspaceOptions,
) -> Result<Workspace, OrderingError>
pub fn new( pattern: &CscPattern<'_>, opts: &WorkspaceOptions, ) -> Result<Workspace, OrderingError>
Build a workspace from a full-symmetric CSC pattern and run initialization. On return, all variables have been classified into one of three buckets:
- Zero-degree (
deg == 0) — pre-eliminated.pe[i] = NONE,elen[i] = flip(1),w[i] = 0,nelincremented. - Dense-deferred (
deg > dense) — moved to the dense tail.pe[i] = NONE,nv[i] = 0,elen[i] = NONE,nelincremented. - Live — inserted LIFO into the degree-indexed linked list
headed by
head[deg], threaded throughnext/last.
pattern must be the full-symmetric graph (both halves). The
diagonal is ignored if present.
Sourcepub fn new_with_n_buckets(
pattern: &CscPattern<'_>,
opts: &WorkspaceOptions,
n_buckets: usize,
) -> Result<Workspace, OrderingError>
pub fn new_with_n_buckets( pattern: &CscPattern<'_>, opts: &WorkspaceOptions, n_buckets: usize, ) -> Result<Workspace, OrderingError>
Variant of Workspace::new that allocates head with the
caller-supplied bucket count. Used by AMF, where the quantized
fill score can exceed n and the head array must extend up to
NBBUCK + 1 = 2 * n + 1. AMD always passes pattern.n, which
makes this byte-equivalent to Workspace::new.
n_buckets must be at least n so the init insertion at
head[deg] (with deg ≤ dense ≤ n) is in range.