NLAlib.MGS.normalizeGuard_writes
Library Β· theorem
The guard uses the actual stored squared norm and returns the corresponding normalized vector. Its total execution includes both the zero and nonzero branches. A fragment of NLAlib.MGS.factorRoutine: run only inside its tree, on its operands and the buffers it allocates.
NLAlib.MGS.normalizeGuard_writes {π Op Tst : Type} [RCLike π] [Ops.Has Ops.ScalarOp Op]
[Ops.Has Ops.Blas1Op Op] [Ops.Has Ops.CmpTst Tst] {I : Ops.Interp Op Tst π} {Ο : Ops.Tape π}
{m : Ops.Mem π} (hS : Ops.IsScalar Ops.RCLikeBlas.machine I) (hB : Ops.RCLikeBlas.IsExact I)
(hC : Ops.IsCmp (βRCLike.re) I) {n : β} {v t : β Γ β} (w : Fin n β π) (d : π) (hl : m.Live [v, t])
(hv : m.store.readBlock v.1 v.2 n = some (List.ofFn w))
(hd : m.store.readBlock t.1 (t.2 + 1) 1 = some [d]) (hzero : m.store.get t.1 t.2 = some 0)
(htv : Ops.Fp.Disj (Ops.Store.inBlock t.1 t.2 2) (Ops.Store.inBlock v.1 v.2 n))
(ht : t.2 + 2 β€ m.store.len t.1) (hz : v.2 + n β€ m.store.len v.1) :
Ops.Writes Ops.Mode.total I Ο MGS.normalizeGuard (Ops.Env.frame [n] [v, t])
(Ops.Store.inBlock t.1 t.2 2 β Ops.Store.inBlock v.1 v.2 n)
(fun m' β¦
m'.pos = m.pos β§
m'.store.readBlock v.1 v.2 n =
some (if RCLike.re d = 0 then List.ofFn w else List.ofFn fun i β¦ w i / ββ(RCLike.re d)))
mImport NLAlib.Matrix.Factorizations.MGS.Normalize.