NLA-lib Explorer

NLAlib.Ops.RCLikeScalar.axpy_writes

Library ยท theorem

One scoped product cell implements axpy for disjoint or exactly aliased vector views. The broadcast scalar remains outside the output; scratch is removed before returning. The tree implements axpy for four operand layouts, four routines (axpyRoutine, axpyInPlaceRoutine, axpyOnXRoutine, axpySelfRoutine); this lemma, stated for every layout, is their common proof. Shared by the trees of NLAlib.Krylov.CG.HSCG.step, NLAlib.Krylov.CG.HSCG.initializeState, NLAlib.Krylov.CG.HSCG.initializeRoutine and 26 more.

NLAlib.Ops.RCLikeScalar.axpy_writes {Op Tst : Type} [Ops.Has Ops.ScalarOp Op] {๐•œ : Type} [RCLike ๐•œ]
  {I : Ops.Interp Op Tst ๐•œ} {tape : Ops.Tape ๐•œ} {m : Ops.Mem ๐•œ}
  (hS : Ops.IsScalar Ops.RCLikeBlas.machine I) {n : โ„•} {a x y out : โ„• ร— โ„•} (xs ys : List ๐•œ)
  (alpha : ๐•œ) (hl : m.Live [a, x, y, out]) (hA : m.store.get a.1 a.2 = some alpha)
  (hX : m.store.readBlock x.1 x.2 n = some xs) (hY : m.store.readBlock y.1 y.2 n = some ys)
  (hXO : Ops.Fp.Disj (Ops.Store.inBlock x.1 x.2 n) (Ops.Store.inBlock out.1 out.2 n) โˆจ x = out)
  (hYO : Ops.Fp.Disj (Ops.Store.inBlock y.1 y.2 n) (Ops.Store.inBlock out.1 out.2 n) โˆจ y = out)
  (hAO : Ops.Fp.Disj (Ops.Store.inBlock a.1 a.2 1) (Ops.Store.inBlock out.1 out.2 n))
  (ho : out.2 + n โ‰ค m.store.len out.1) :
  Ops.Writes Ops.Mode.total I tape Ops.RCLikeScalar.axpy (Ops.Env.frame [n] [a, x, y, out])
    (Ops.Store.inBlock out.1 out.2 n)
    (fun m' โ†ฆ
      m'.pos = m.pos โˆง
        m'.store.readBlock out.1 out.2 n =
          some (List.ofFn fun i โ†ฆ ys.getD (โ†‘i) 0 + alpha * xs.getD (โ†‘i) 0))
    m

Full source on GitHub

Import NLAlib.Ops.Profiles.RCLikeScalarTrees.