Skip to main content

ArrowSolveOptions

Struct ArrowSolveOptions 

Source
pub struct ArrowSolveOptions {
    pub mode: ArrowSolverMode,
    pub pcg: ArrowPcgOptions,
    pub trust_region: ArrowTrustRegionOptions,
    pub streaming_chunk_size: Option<usize>,
    pub riemannian_trust_region: bool,
    pub gpu_matvec: Option<GpuSchurMatvec>,
    pub tolerate_ill_conditioning: bool,
    pub solve_precision: ArrowSolvePrecisionPolicy,
    pub schur_pd_floor: Option<f64>,
}
Expand description

Complete BA Schur solve options.

Use ArrowSolveOptions::automatic for normal latent-coordinate fits; use ArrowSolveOptions::sqrt_ba when the assembler has single-precision row blocks or an ill-conditioned gauge; use ArrowSolveOptions::inexact_pcg for SAE-manifold scale K.

Fields§

§mode: ArrowSolverMode§pcg: ArrowPcgOptions§trust_region: ArrowTrustRegionOptions§streaming_chunk_size: Option<usize>

Row chunk size for streaming direct/Square-Root Schur assembly.

§riemannian_trust_region: bool

Use the Riemannian latent projection before the Schur reduction. The reduced Steihaug solve itself remains in Euclidean β coordinates.

§gpu_matvec: Option<GpuSchurMatvec>

Optional GPU-backed Schur matvec for CPU-driven InexactPCG at K ≥ 5000.

When set, run_pcg_with_preconditioner delegates each S·p call to this closure instead of the CPU schur_matvec. Constructed by crate::gpu_kernels::arrow_schur::gpu_schur_matvec_backend when cuda_selected() and the system has dense per-row H_tβ slabs. None means CPU-only PCG.

§tolerate_ill_conditioning: bool

Skip the ill-conditioning rejection (the κ-based [ArrowSchurError::PerRowFactorIllConditioned] per-row guard and the matching reduced-Schur κ guard) while still requiring genuine positive definiteness (a non-PD Cholesky pivot still errors).

The κ guards exist to protect the accuracy of the Newton step: a barely-PD H_tt^(i) or an over-conditioned reduced Schur yields an inaccurate Δβ/Δt. Evidence-only callers (e.g. SaeManifoldTerm::reml_criterion_with_cache) do not consume the step — they need only the factor cache for the log-determinant (½log|H|, exact from diag(L) regardless of κ) and the selected-inverse traces. For those callers the κ rejection is a false abort when ρ sweeps to extreme values, so this flag lifts it and hands the “is this step trustworthy” decision back to the caller.

Default false: ordinary solves keep the full guard.

§solve_precision: ArrowSolvePrecisionPolicy

Arrow solve precision policy. Default is f64-only.

§schur_pd_floor: Option<f64>

Optional spectral positive-definiteness floor on the reduced Schur complement S = H_ββ + ridge_β·I − Σ_i H_tβ^(i)ᵀ (H_tt^(i))⁻¹ H_tβ^(i), as a relative fraction of S’s largest eigenvalue.

None (default) keeps the strict contract: a non-PD S errors as [ArrowSchurError::SchurFactorFailed] so the LM outer loop lifts ridge_beta globally and re-forms S.

Some(floor) engages the #1026 SAE co-collapse cure on the SOLVE path: when the reduced Schur Cholesky refuses (collapsed atoms drive a per-row H_tt near-singular, so the accumulated (H_tt)⁻¹ over-subtracts S into an INDEFINITE matrix), instead of rejecting and over-damping every β direction with a global ridge, symmetric-eigendecompose S and clamp every eigenvalue UP to floor·max(λ). This is Levenberg–Marquardt restricted to exactly the indefinite/collapsed subspace: the well-conditioned β directions (λ ≫ floor·max λ) are untouched and the step in those directions is the exact Newton step, while only the collapsed directions receive the minimal damping needed for a PD solve. The inner Newton then makes a real descent step rather than crawling behind an inflated global ridge. Mirrors the per-row spectral floor the evidence path uses for #1377/#1117/#1118 ([super::factorization::factor_spectral_deflated_evidence_row]); the difference is the floored value — a small positive floor·max λ (Tikhonov) for the solve, vs unit stiffness +1 (log 1 = 0) for the evidence log-det.

Only consulted by the dense Direct / SqrtBA reduced solve (the only caller of [super::reduced_solve::solve_dense_reduced_system]); the InexactPCG path is unaffected.

Implementations§

Source§

impl ArrowSolveOptions

Source

pub fn automatic(k: usize) -> Self

Select Direct for K <= 2000 and InexactPCG above, following BA RCS practice for dense-vs-iterative reduced systems.

Source

pub fn direct() -> Self

Force dense reduced-camera-system Cholesky, the classic BA direct solve for small K.

Source

pub fn sqrt_ba() -> Self

Force Square-Root BA Schur assembly for the direct reduced solve.

Source

pub fn inexact_pcg() -> Self

Force inexact BA Schur PCG with Jacobi preconditioning.

Source

pub fn with_streaming_chunk_size(self, chunk_size: Option<usize>) -> Self

Source

pub fn with_ill_conditioning_tolerated(self) -> Self

Lift the ill-conditioning rejection for evidence/log-det-only callers while still requiring genuine PD. See Self::tolerate_ill_conditioning.

Use this when the returned (Δt, Δβ) Newton step is discarded and only the factor cache is consumed (log-determinant + selected-inverse traces). The cache stays undamped at ridge_t = 0, so the log-determinant is exact regardless of κ.

Source

pub fn with_solve_precision_policy( self, policy: ArrowSolvePrecisionPolicy, ) -> Self

Source

pub fn with_streaming_solve_precision_default(&self) -> Self

Turn certified mixed precision ON for the streaming/residency reduced solve unless the caller already pinned an explicit policy (#1014).

Only F64Only (the inherited default) is upgraded to CertifiedMixed; a caller that deliberately set a policy keeps it. The reduced-Schur f64 factor and every evidence log-determinant are unaffected — see [mixed_precision_reduced_beta].

Trait Implementations§

Source§

impl Clone for ArrowSolveOptions

Source§

fn clone(&self) -> ArrowSolveOptions

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ArrowSolveOptions

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> ByRef<T> for T

Source§

fn by_ref(&self) -> &T

Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

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

Source§

fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> T
where Self: Distribution<T>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Imply<T> for U
where T: ?Sized, U: ?Sized,

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V