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".

Implementors§

Source§

impl Complexity for ClosureIndicesOp

Source§

const CLASS: ComplexityClass = ComplexityClass::SubLinear

Source§

impl Complexity for ContrastiveSolveOnChangeOp

Source§

const CLASS: ComplexityClass

Source§

const DETAIL: &'static str = "Phase-2A: closure (SubLinear) + warm-start solve (Linear) + top-k-in-subset \ (SubLinear). Phase-2B replaces the inner solve with per-entry sublinear-Neumann \ queries scoped to the closure, dropping the orchestrator end-to-end to SubLinear."

Source§

impl Complexity for ContrastiveSolveOnChangeSublinearOp

Source§

const CLASS: ComplexityClass = ComplexityClass::SubLinear

Source§

const DETAIL: &'static str = "Phase-2B: closure (SubLinear) + per-entry sublinear-Neumann (SubLinear) + top-k-in-subset \ (SubLinear). End-to-end SubLinear in n for sparse DD matrices with bounded depth."

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 SolveSingleEntryNeumannOp

Source§

const CLASS: ComplexityClass = ComplexityClass::SubLinear

Source§

const DETAIL: &'static str = "Single-entry Neumann: O(max_terms · |closure| · branching). Independent of n for \ sparse DD matrices with bounded degree + bounded max_terms. Widens to Linear when \ the closure spans the whole graph."

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 SolveOnChangeSublinearOp

Source§

const CLASS: ComplexityClass = ComplexityClass::SubLinear

Source§

const DETAIL: &'static str = "Closure (SubLinear) + per-entry sublinear-Neumann at each closure index (SubLinear). \ Independent of n for sparse DD matrices with bounded closure_depth + max_terms."

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 EventStreamOp

Source§

const CLASS: ComplexityClass = ComplexityClass::SubLinear

Source§

const DETAIL: &'static str = "Per-event class is the auto-tuned SubLinear orchestrator's. The iterator wrapper \ adds O(1) gate probe + optional O(1) budget consume per event; aggregate cost is \ O(events · per_event_class)."

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."

Source§

impl Complexity for VerifySparseSolutionOp

Source§

const CLASS: ComplexityClass = ComplexityClass::SubLinear

Source§

const DETAIL: &'static str = "Residual audit restricted to caller-supplied closure entries. \ O(|entries| · avg_row_nnz) — same class as the SubLinear orchestrator \ whose output it verifies. Independent of n for sparse DD matrices."