Skip to main content

Complexity

Trait Complexity 

Source
pub trait Complexity {
    const CLASS: ComplexityClass;
    const DETAIL: &'static str = "";
}
Expand description

Compile-time complexity-class declaration. Every public solver / sampler / analyser in this crate implements this trait, exposing its worst-case class as a const so callers can match on it at compile time.

fn pick_solver<S: Complexity>() {
    match S::CLASS {
        ComplexityClass::Logarithmic | ComplexityClass::SubLinear => {
            // use it — edge-safe
        }
        _ => {
            // fall back to something cheaper or refuse
        }
    }
}

Required Associated Constants§

Source

const CLASS: ComplexityClass

Worst-case complexity class on a single-query call. For iterative solvers this is the per-iter cost; the iteration count is bounded by other configuration (max_iterations, tolerance, ef_construction).

Provided Associated Constants§

Source

const DETAIL: &'static str = ""

Optional human-readable detail for documentation / MCP tool schemas. Defaults to the short label of CLASS. Override when there’s a non-obvious constant or k-bound.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Complexity for FindAnomalousRowsOp

Source§

const CLASS: ComplexityClass

Source§

const DETAIL: &'static str = "O(n log k) full-scan baseline today; phase-2 lowers to O(k · log n) via the \ sublinear-Neumann single-entry primitive."

Source§

impl Complexity for IncrementalSolveOp

Source§

const CLASS: ComplexityClass

Source§

const DETAIL: &'static str = "O(k_warm · nnz(A)) per call where k_warm ≪ k_cold for small deltas on \ well-conditioned DD systems; falls back to full solve when \ nnz(delta) > full_solve_break_even (default 64)."

Source§

impl Complexity for OptimizedConjugateGradientSolver

Source§

const CLASS: ComplexityClass = ComplexityClass::Linear

Source§

const DETAIL: &'static str = "O(k · nnz(A)) per iter; k ≈ √κ(A) on SPD inputs."

Source§

impl Complexity for NeumannSolver

Source§

const CLASS: ComplexityClass = ComplexityClass::Linear

Source§

const DETAIL: &'static str = "O(k · nnz(A)) per iter; k bounded by series_tolerance + max_terms (default 200)."

Source§

impl Complexity for JLEmbedding

Source§

const CLASS: ComplexityClass = ComplexityClass::Linear

Source§

const DETAIL: &'static str = "O(d · k) per project_vector; k = target_dim, capped at original_dim - 1."

Source§

impl Complexity for SublinearNeumannSolver

Source§

const CLASS: ComplexityClass

Source§

const DETAIL: &'static str = "O(log n) per single-entry query on diagonally-dominant systems via JL + recursive Neumann; \ O(n) base case at n ≤ base_case_threshold."