NLA-lib Explorer

NLAlib.HutchPlusPlus.accumulate_writes

Library ยท theorem

The explicit accumulation returns the low-rank sum plus the mean residual sum. Input blocks are read from actual columns and retained through disjoint scalar writes. A fragment of NLAlib.HutchPlusPlus.estimateRoutine: run only inside its tree, on its operands and the buffers it allocates.

NLAlib.HutchPlusPlus.accumulate_writes {๐•œ Op Tst : Type} [RCLike ๐•œ] [Ops.Has Ops.ScalarOp Op]
  [Ops.Has Ops.Blas1Op Op] [Ops.Has Ops.IndexOp Op] {I : Ops.Interp Op Tst ๐•œ} {ฯ„ : Ops.Tape ๐•œ}
  {m : Ops.Mem ๐•œ} (hS : Ops.IsScalar Ops.RCLikeBlas.machine I) (hB : Ops.RCLikeBlas.IsExact I)
  (hLit : Ops.IsIndexLit Ops.RCLikeBlas.machine I) {n k ell : โ„•} {b c t out : โ„• ร— โ„•}
  (xs ys : โ„• โ†’ List ๐•œ) (hl : m.Live [b, c, t, out])
  (hX : โˆ€ j < k + ell, m.store.readBlock b.1 (b.2 + n * j) n = some (xs j))
  (hY : โˆ€ j < k + ell, m.store.readBlock c.1 (c.2 + n * j) n = some (ys j))
  (hDX :
    โˆ€ j < k + ell,
      (Ops.Store.inBlock t.1 t.2 2 โŠ” Ops.Store.inBlock out.1 out.2 1).Disj
        (Ops.Store.inBlock b.1 (b.2 + n * j) n))
  (hDY :
    โˆ€ j < k + ell,
      (Ops.Store.inBlock t.1 t.2 2 โŠ” Ops.Store.inBlock out.1 out.2 1).Disj
        (Ops.Store.inBlock c.1 (c.2 + n * j) n))
  (hTO : Ops.Fp.Disj (Ops.Store.inBlock t.1 t.2 2) (Ops.Store.inBlock out.1 out.2 1))
  (ht : t.2 + 2 โ‰ค m.store.len t.1) (ho : out.2 + 1 โ‰ค m.store.len out.1) :
  Ops.Writes Ops.Mode.total I ฯ„ HutchPlusPlus.accumulate (Ops.Env.frame [n, k, ell] [b, c, t, out])
    (Ops.Store.inBlock t.1 t.2 2 โŠ” Ops.Store.inBlock out.1 out.2 1)
    (fun m' โ†ฆ
      m'.pos = m.pos โˆง
        m'.store.readBlock out.1 out.2 1 =
          some
            [โˆ‘ j โˆˆ Finset.range k, Ops.RCLikeBlas.dot n (xs j) (ys j) +
                (โˆ‘ j โˆˆ Finset.range ell, Ops.RCLikeBlas.dot n (xs (k + j)) (ys (k + j))) / โ†‘ell])
    m

Full source on GitHub

Import NLAlib.Estimation.Trace.HutchPlusPlus.Accumulate.