NLAlib.HutchPlusPlus.prepare_writes
Library Β· theorem
The preparation returns the rank-revealing basis and actual untouched probes. Every temporary allocation is cleaned up and both sample windows are identified exactly. A fragment of NLAlib.HutchPlusPlus.estimateRoutine: run only inside its tree, on its operands and the buffers it allocates.
NLAlib.HutchPlusPlus.prepare_writes {π Op Tst : Type} [RCLike π] [Ops.Has Ops.ScalarOp Op]
[Ops.Has Ops.Blas1Op Op] [Ops.Has Ops.CmpTst Tst] [Ops.Has Ops.StoredOperatorOp Op]
[Ops.Has Ops.SampleOp Op] {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) {dataLength : β β β β β}
{matrix : (m n : β) β List π β Matrix (Fin m) (Fin n) π}
(hI : Ops.StoredOperator.IsExact dataLength matrix I) (hSample : Ops.IsSample I) (stream : β)
{n k ell : β} {data b : β Γ β} (as : List π) (hl : m.Live [data, b])
(hA : m.store.readBlock data.1 data.2 (dataLength n n) = some as)
(hBA :
Ops.Fp.Disj (Ops.Store.inBlock b.1 b.2 ((k + ell) * n))
(Ops.Store.inBlock data.1 data.2 (dataLength n n)))
(hb : b.2 + (k + ell) * n β€ m.store.len b.1) :
Ops.Writes Ops.Mode.total I Ο (HutchPlusPlus.prepare stream) (Ops.Env.frame [n, k, ell] [data, b])
(Ops.Store.inBlock b.1 b.2 ((k + ell) * n))
(fun m' β¦
m'.pos = m.pos + n * (k + ell) β§
m'.store.readBlock b.1 b.2 ((k + ell) * n) =
some
((Ops.EntryCodec.scalar π).packFinMatrix
(HutchPlusPlus.basisProbes
(gramSchmidtQ
(matrix n n as *
(Ops.EntryCodec.scalar π).matrix n k (Ο.window stream m.pos (n * k))))
((Ops.EntryCodec.scalar π).matrix n ell
(Ο.window stream (m.pos + n * k) (n * ell))))))
mImport NLAlib.Estimation.Trace.HutchPlusPlus.Prepare.