Skip to main content

ShiftLadderProfile

Struct ShiftLadderProfile 

Source
pub struct ShiftLadderProfile {
    pub nodes: Vec<ShiftLadderNodeProfile>,
    pub log_det: f64,
    pub std_err: f64,
    pub total_iterations: usize,
    pub hardest_solve: ShiftedPcgTrace,
    pub cold_seed_solve: ShiftedPcgTrace,
    pub cold_seed_solve_undiagonalized: ShiftedPcgTrace,
    pub symmetry_defect: f64,
    pub bracket: (f64, f64),
}
Expand description

The complete work profile of one rational log-determinant evaluation, node by node, plus the residual history of its single most expensive solve.

This is the #2576 discriminator. The issue’s headline evidence — “loosening the CG tolerance from 1e-8 to 1e-4 changes nothing” — is equally consistent with a solve stagnating at its iteration cap and a solve converging so fast that four decades of tolerance cost a handful of iterations, and those need opposite repairs. The two are told apart by the residual CURVE (geometric decay versus a flat line) and by the Ritz spectrum the same solve hands over for free. Neither existed before: the evaluation reported one summed iteration count and nothing else.

Fields§

§nodes: Vec<ShiftLadderNodeProfile>

One row per quadrature node, in ladder (descending-shift) order.

§log_det: f64

The surrogate value this evaluation produced.

§std_err: f64

Its Hutchinson error bar.

§total_iterations: usize

Iterations over the whole ladder — the quantity the existing reduced_schur_logdet_preconditioner_study reports as a single number.

§hardest_solve: ShiftedPcgTrace

Full residual and coefficient history of the ladder’s most expensive single solve. This one is WARM-STARTED from the node above it, so its curve begins wherever the previous shift’s solution left it.

§cold_seed_solve: ShiftedPcgTrace

One COLD solve at the ladder’s smallest shift, from a zero start, on the first probe.

This is the honest price of the family: the smallest shift is the worst-conditioned member, and a Krylov space built from the right-hand side alone — no warm start — is what any evaluator that serves all shifts from ONE space must pay. It is also the trace whose residual curve is interpretable, since it starts at ‖r‖/‖b‖ = 1 rather than wherever the previous node’s solution happened to land.

§cold_seed_solve_undiagonalized: ShiftedPcgTrace

The same cold seed solve with NO diagonal, i.e. on the raw operator.

A shifted family shares its Krylov space only when nothing shift-dependent is applied to it, and this module’s diagonal is 1/(d + t) — shift dependent by construction. So the two cold traces price the two ways to serve the family from one space: rescale the operator by its diagonal ONCE (and carry Σ ln d_g in the value), or keep the operator and pay the raw conditioning. Which is cheaper is a measurement, not an argument.

§symmetry_defect: f64

|vᵀSw − wᵀSv| / (‖Sv‖·‖w‖) on a deterministic probe pair. CG is only valid on a symmetric operator, so a non-negligible value here means no preconditioner can help and the algorithm itself is wrong for the problem.

§bracket: (f64, f64)

The [λ_min, λ_max] bracket the plan was sized from. λ_min is the deflation-floor convention SPECTRAL_DEFLATION_REL_FLOOR·λ_max, i.e. an ASSUMED lower bound, not a measurement — comparing it against hardest_solve’s smallest Ritz value is how one sees whether the quadrature window is sized for a spectrum the operator does not have.

Implementations§

Source§

impl ShiftLadderProfile

Source

pub fn ladder_concentration(&self) -> f64

Iterations of the single hardest solve, against the whole ladder’s total.

A shifted family (S + t_ℓ I) spans ONE Krylov space for every t_ℓ, so a multi-shift Krylov evaluator would pay the hardest solve and get the rest as vector updates. This ratio is exactly what such a change could win, and it is a measurement rather than an argument.

Source

pub fn one_krylov_space_apply_budget(&self) -> Option<f64>

The applies ONE right-hand side may cost, given the operator’s own conditioning and the plan’s own node count:

½·√κ·ln(2/rel_tol)  +  node_count

— the textbook CG bound for a single solve at the conditioning κ the cold seed measured, plus one certification apply per node. Nothing here is chosen: κ is read off the seed’s Ritz values and the node count is the plan’s, so a better-conditioned operator or a coarser quadrature moves the budget on its own.

κ is the UNDIAGONALIZED seed’s, because that is the space a family evaluator can actually share: the diagonal here is 1/(diag(S) + t) and anything shift-dependent destroys the shift invariance the one-space argument rests on. The diagonal remains available to the single-shift repair path, where one fixed t makes it a preconditioner again.

None when the cold seed resolved no spectrum.

Trait Implementations§

Source§

impl Clone for ShiftLadderProfile

Source§

fn clone(&self) -> ShiftLadderProfile

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 ShiftLadderProfile

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> Allocation for T
where T: RefUnwindSafe + Send + Sync,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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