NLA-lib Explorer

NLAlib.Ops.RCLikeScalar.axpyWithScratch_writes

Library ยท theorem

The pointwise scalar axpy follows the original input words through the output prefix. Each vector may alias the output exactly; the broadcast scalar remains separate. A fragment of the tree NLAlib.Ops.RCLikeScalar.axpy.

NLAlib.Ops.RCLikeScalar.axpyWithScratch_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 t out : โ„• ร— โ„•} (xs ys : List ๐•œ)
  (alpha : ๐•œ) (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))
  (hTX : Ops.Fp.Disj (Ops.Store.inBlock t.1 t.2 1) (Ops.Store.inBlock x.1 x.2 n))
  (hTY : Ops.Fp.Disj (Ops.Store.inBlock t.1 t.2 1) (Ops.Store.inBlock y.1 y.2 n))
  (hTA : Ops.Fp.Disj (Ops.Store.inBlock t.1 t.2 1) (Ops.Store.inBlock a.1 a.2 1))
  (hTO : Ops.Fp.Disj (Ops.Store.inBlock t.1 t.2 1) (Ops.Store.inBlock out.1 out.2 n))
  (ht : t.2 + 1 โ‰ค m.store.len t.1) (ho : out.2 + n โ‰ค m.store.len out.1) :
  Ops.Writes Ops.Mode.total I tape Ops.RCLikeScalar.axpyWithScratch
    (Ops.Env.frame [n] [a, x, y, t, out])
    (Ops.Store.inBlock out.1 out.2 n โŠ” Ops.Store.inBlock t.1 t.2 1)
    (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.