When should I use them, and how the relation of speed and precision changes?
Which are the advantages, and disadvantages of them?
When should I use them, and how the relation of speed and precision changes?
Which are the advantages, and disadvantages of them?
For an $m\times n$ matrix, G. Stewart says that both the Householder and Gram-Schmidt cost $mn^2-n^2/3$ floating point additions and multiplications.
The orthogonal factor computed by the Householder factorization is generally more accurate than that of the (modified) Gram-Schmidt unless the GS is implemented with reorthogonalization. On the other hand, GS gives the orthogonal factor directly, while Householder provides it in a factored form (essentially as a product of elementary reflections).
The loss of orthogonality does not need to be a problem for the modified GS, e.g., when solving least squares problem, a careful implementation (without reorthogonalization) can give the solution with the same accuracy as the Householder variant.
Also, GS is easier to implement and computationally more efficient in parallel.