NLA-lib Explorer

NLAlib.Ops.Examples.cgsB

Library · def

Classical Gram–Schmidt with names, the whole algorithm in one block: for each column j of the n × p matrix A stored by columns, the coefficients R[j p + i] := Q_iᵀ A_j for i < j, the work vector v := A_j - Σ_i R[j p + i] Q_i, the norm R[j p + j] := ‖v‖, and Q_j := v / R[j p + j]. The operand R is updated in place; the input copy is named R₀ and is not used, so every use of R is the output copy (buffer variable 3, offset variable 5).

NLAlib.Ops.Examples.cgsB {Op Tst : Type} [Ops.Has Ops.ScalarOp Op] [Ops.Has Ops.Blas1Op Op] :
  Ops.Stmt Op Tst

Full source on GitHub

Import NLAlib.Ops.Examples.Built.