pub struct Options {
pub tol: f64,
pub scale: i32,
pub btf: bool,
pub halt_if_singular: bool,
}Expand description
Fixed solver configuration, mirroring the specific KLU_common fields
sparse_klu.rs::new_common() (via klu_defaults) leaves at their
defaults — confirmed directly from KLU/Source/klu_defaults.c — and that
this port’s algorithm actually consumes. Kept as a struct (not bare
constants) so differential tests (#[cfg(all(test, feature = "klu"))],
comparing against the vendored C oracle) can vary tol/scale without
touching any production code path, which always uses Options::default().
Two KLU_common fields are deliberately absent here, not just
defaulted, because gridoxide’s call pattern makes the alternative
branches they’d select genuinely unreachable (confirmed dead, not merely
unused):
ordering: real KLU supports AMD (0), COLAMD (1), user-supplied P/Q (2), or a user callback (3).klu_defaults.cdefaults to0(AMD) andsparse_klu.rsnever overrides it, so this port only ever implements the AMD path — noorderingfield exists to accidentally select another one.maxwork: bounds the workbtf_maxtransmay spend before giving up with a possibly-incomplete matching. Defaults to0(“no limit”) and is never overridden, so this port’s BTF implementation always runsbtf_maxtransto completion — the work-limit bookkeeping threaded through the upstream C is dropped outright, not merely defaulted off.
Fields§
§tol: f64Partial-pivoting threshold: a candidate pivot is accepted only if
its magnitude is at least tol times the largest candidate
available in that column (otherwise the largest is forced instead).
klu_defaults.c: Common->tol = 0.001.
scale: i32Row-scaling strategy: 1 = sum of absolute values per row, 2 =
max absolute value per row. klu_defaults.c: Common->scale = 2.
btf: boolWhether to BTF-preorder before per-block AMD ordering.
klu_defaults.c: Common->btf = TRUE. gridoxide never disables
this, but it’s kept as a field (rather than assumed) so analyze
phase tests can exercise the single-block (btf: false) path too.
halt_if_singular: boolAbort immediately (and report singular) on a pivot that’s still zero
after the tolerance-based search, rather than substituting a tiny
nonzero value and continuing. klu_defaults.c:
Common->halt_if_singular = TRUE.
Trait Implementations§
impl Copy for Options
impl StructuralPartialEq for Options
Auto Trait Implementations§
impl Freeze for Options
impl RefUnwindSafe for Options
impl Send for Options
impl Sync for Options
impl Unpin for Options
impl UnsafeUnpin for Options
impl UnwindSafe for Options
Blanket Implementations§
impl<T> Boilerplate for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T, U> Imply<T> for U
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more