Skip to content

num::cgs2_orthogonalize

Defined in header <linear/subspace.hpp>

array<real> cgs2_orthogonalize(const mat<real> &Q, idx k, vec<real> &v);

Orthogonalize a vector by classical Gram–Schmidt, applied twice (CGS2): \(v \leftarrow (I - Q_k^T Q_k)^2 v\). Returns the coefficients; rows of \(Q_k\) must be orthonormal.