Skip to main content

Workspace

Struct Workspace 

Source
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: i32

Generation counter for the mark array w.

§wbig: i32

Overflow ceiling for wflg: i32::MAX - n.

§lemax: i32

Largest element size encountered so far — used by supervariable detection (Slice B) to bump wflg safely.

§mindeg: usize

Lower bound on the next pivot’s degree. Monotone non-decreasing.

§ncmpa: u32

Number of garbage-collection compactions so far.

§nel: usize

Supervariables eliminated so far (pivoted OR dense-deferred).

§ndense: i32

Dense-deferred supervariable count.

§n_mass_elim: u32

Variables folded into a concurrent pivot by mass elimination.

§n_supervar_merge: u32

Supervariable merges detected during indistinguishable-variable consolidation.

Implementations§

Source§

impl Workspace

Source

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:

  1. Zero-degree (deg == 0) — pre-eliminated. pe[i] = NONE, elen[i] = flip(1), w[i] = 0, nel incremented.
  2. Dense-deferred (deg > dense) — moved to the dense tail. pe[i] = NONE, nv[i] = 0, elen[i] = NONE, nel incremented.
  3. Live — inserted LIFO into the degree-indexed linked list headed by head[deg], threaded through next/last.

pattern must be the full-symmetric graph (both halves). The diagonal is ignored if present.

Source

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.

Trait Implementations§

Source§

impl Debug for Workspace

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.