NLA-lib Explorer

NLAlib.SpectralBisection.deflateSamples_writes

Library · theorem

The sample stage writes exactly the selected, machine-scaled Gaussian matrix. The sample span and scale cell are spatially disjoint from its output span; shared buffers are permitted. Explicit side and slot bounds ensure every stored sample used by the program exists. A fragment of NLAlib.SpectralBisection.bisectionRoutine.

NLAlib.SpectralBisection.deflateSamples_writes {K Op Tst : Type} [Ops.Has Ops.ScalarOp Op]
  {M : Ops.Machine K} {I : Ops.Interp Op Tst K} (hS : Ops.IsScalar M I) {md : Ops.Mode}
  {τ : Ops.Tape K} {m : Ops.Mem K} {n k lo side : ℕ} {sg sq g : ℕ × ℕ} (S : ℕ → ℕ → K × K) (a : K)
  (hside : side < 2) (hslot : lo + k ≤ n) (hl : m.Live [sg, sq, g])
  (hsg :
    m.store.HoldsEntries (Ops.EntryCodec.pair K)
      { buf := sg.1, off := sg.2, rows := n, cols := 2 * n, ld := n } S)
  (hsq : m.store.get sq.1 sq.2 = some a) (hg : g.2 + 2 * (k * k) ≤ m.store.len g.1)
  (hsgg :
    Ops.Fp.Disj (Ops.Store.inBlock sg.1 sg.2 (2 * (2 * n * n)))
      (Ops.Store.inBlock g.1 g.2 (2 * (k * k))))
  (hsqg : Ops.Fp.Disj (Ops.Store.inBlock sq.1 sq.2 1) (Ops.Store.inBlock g.1 g.2 (2 * (k * k)))) :
  Ops.Writes md I τ SpectralBisection.deflateSamples (Ops.Env.frame [n, k, lo, side] [sg, sq, g])
    (Ops.Store.inBlock g.1 g.2 (2 * (k * k)))
    (fun m' ↦
      m'.pos = m.pos ∧
        m'.store.readBlock g.1 g.2 (2 * (k * k)) =
          some
            ((Ops.EntryCodec.pair K).packFinMatrix
              (SpectralBisection.sampledGaussian M k lo side S a)))
    m

Full source on GitHub

Import NLAlib.Eigensolvers.SpectralBisection.Deflation.