Thanks, Jack and Sven.
I've now done what Sven suggested: if eigenvalues have been
calculated OK, we first check whether any of them are neither 0
nor 1, and if so we report that the matrix is not idempotent.
Otherwise we go ahead and do the test multiplication.
Allin.