NLA-lib Explorer

NLAlib.Ops.Standard.Model.ofKernels

Library · def

Standard rounding

Build a standard model directly from a fixed scalar machine and word-level matvec kernels. The backend author proves only the scalar numerical law and the local kernel error bound; the constructor supplies exact comparisons, memory interfaces and the joint BLAS realization.

NLAlib.Ops.Standard.Model.ofKernels {K : Type} [Inhabited K] {r b : ℕ} {P : Ops.Problem K r b}
  {n : (Fin r → ℕ) → ℕ} (scheme : Ops.Standard.Scheme) (u : ℝ) (hu : 0 ≤ u)
  (machine : Ops.Machine K) (decode : K → ℝ) (hM : Ops.StdModel (scheme.roundoff u) decode machine)
  (matrix : (d : Fin r → ℕ) → P.Input d → Matrix (Fin (n d)) (Fin (n d)) ℝ)
  (allowance : (d : Fin r → ℕ) → P.Input d → ℝ)
  (ha : ∀ (d : Fin r → ℕ), P.valid d → ∀ (x : P.Input d), 0 ≤ allowance d x)
  (R : Ops.ResourceModel Ops.Standard.Operation Ops.CmpTst)
  (kernel : (d : Fin r → ℕ) → P.Input d → (Fin (n d) → K) → Fin (n d) → K)
  (hk :
    ∀ (d : Fin r → ℕ),
      P.valid d →
        ∀ (x : P.Input d) (v : Fin (n d) → K),
          ‖WithLp.toLp 2 ((matrix d x *ᵥ fun i ↦ decode (v i)) - fun i ↦ decode (kernel d x v i))‖ ≤
            scheme.roundoff (allowance d x) * ‖WithLp.toLp 2 fun i ↦ decode (v i)‖) :
  Ops.Standard.Model P n

Full source on GitHub

Import NLAlib.Ops.Profiles.Standard.