NLA-lib Explorer

NLAlib.MGS.normalize_writes

Library Β· theorem

Compute the actual Hermitian norm square and perform the guarded normalization. The statement covers every vector, including zero, with no execution-success premise. A fragment of NLAlib.MGS.factorRoutine: run only inside its tree, on its operands and the buffers it allocates.

NLAlib.MGS.normalize_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 β†’ π•œ) (hl : m.Live [v, t])
  (hv : m.store.readBlock v.1 v.2 n = some (List.ofFn w))
  (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.normalize (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 (star w ⬝α΅₯ w) = 0 then List.ofFn w
            else List.ofFn fun i ↦ w i / β†‘βˆš(RCLike.re (star w ⬝α΅₯ w))))
    m

Full source on GitHub

Import NLAlib.Matrix.Factorizations.MGS.Normalize.