<Dd> u = x − α e 1, v = u ‖ u ‖, Q = I − 2 v v T . (\ displaystyle (\ begin (aligned) \ mathbf (u) & = \ mathbf (x) - \ alpha \ mathbf (e) _ (1), \ \ \ mathbf (v) & = (\ mathbf (u) \ over \ \ mathbf (u) \), \ \ Q& = I - 2 \ mathbf (v) \ mathbf (v) ^ (\ textsf (T)). \ end (aligned))) </Dd> <P> Or, if A (\ displaystyle A) is complex </P> <Dl> <Dd> Q = I − 2 v v ∗ . (\ displaystyle Q = I - 2 \ mathbf (v) \ mathbf (v) ^ (*).) </Dd> </Dl> <Dd> Q = I − 2 v v ∗ . (\ displaystyle Q = I - 2 \ mathbf (v) \ mathbf (v) ^ (*).) </Dd>

Solve the linear least squares problem using the qrqr factorization. with numpy