NLAlib.MGS.reduce_writes
Library ยท theorem
A reduction writes the projection subtraction and its negated coefficient, preserving all other cells. Input/output vector overlap is allowed by the local block contracts. A fragment of NLAlib.MGS.sweepRoutine: run only inside its tree, on its operands and the buffers it allocates.
NLAlib.MGS.reduce_writes {๐ Op Tst : Type} [RCLike ๐] [Ops.Has Ops.ScalarOp Op]
[Ops.Has Ops.Blas1Op Op] {I : Ops.Interp Op Tst ๐} {ฯ : Ops.Tape ๐} {m : Ops.Mem ๐}
(hS : Ops.IsScalar Ops.RCLikeBlas.machine I) (hB : Ops.RCLikeBlas.IsExact I) {n : โ}
{q v r : โ ร โ} (qs vs : List ๐) (hl : m.Live [q, v, r])
(hq : m.store.readBlock q.1 q.2 n = some qs) (hv : m.store.readBlock v.1 v.2 n = some vs)
(hrq : Ops.Fp.Disj (Ops.Store.inBlock r.1 r.2 1) (Ops.Store.inBlock q.1 q.2 n))
(hrv : Ops.Fp.Disj (Ops.Store.inBlock r.1 r.2 1) (Ops.Store.inBlock v.1 v.2 n))
(hqv : Ops.Fp.Disj (Ops.Store.inBlock q.1 q.2 n) (Ops.Store.inBlock v.1 v.2 n) โจ q = v)
(hroom : r.2 + 1 โค m.store.len r.1) (hvroom : v.2 + n โค m.store.len v.1) :
Ops.Writes Ops.Mode.total I ฯ MGS.reduce (Ops.Env.frame [n] [q, v, r])
(Ops.Store.inBlock r.1 r.2 1 โ Ops.Store.inBlock v.1 v.2 n)
(fun m' โฆ
m'.pos = m.pos โง
m'.store.readBlock v.1 v.2 n =
some (List.ofFn fun i โฆ vs.getD (โi) 0 - Ops.RCLikeBlas.dot n qs vs * qs.getD (โi) 0))
mImport NLAlib.Matrix.Factorizations.MGS.Reduce.