The Gram-Schmidt Song


(to the tune of "When Johnny Comes Marching Home")

The wonderful Gram-Schmidt algorithm, hurrah, hurrah!
Is something you compute QR with, hurrah, hurrah!
Triangular orthogonalization,
This is the way Gram-Schmidt is done
and both Q and R are explicitly formed and stored.

The classical Gram-Schmidt incarnate, hurrah, hurrah!
It really isn't all that great, hurrah, hurrah!
For its leftward look and dependence on A
lose orthogonality in computed q_k
And you need another matrix-space to store Q.

The modified Gram-Schmidt incarnate, hurrah, hurrah!
Is better than its Classical mate, hurrah, hurrah!
For advantages of looking right
are numerical accuracy and an overwrite
-ing of A with Q, so bully for modified!

Now we know Gram-Schmidt algorithms, hurrah, hurrah!
We know the good and bad of them, hurrah, hurrah!
But unless I need an explicit Q,
Gram-Schmidt is not the best to do
for Householder is much superior.

"The Gram-Schmidt Song" Copyright (c) 2000-2007 Rebecca Hartman-Baker.

Last updated January 22, 2007
hartmanbakrj@ornl.gov