Cleve Moler defines a matrix A as "morally triangular" if there exists a permutation P such that P*A is lower triangular. In contrast, John Gilbert defines a matrix A as "psychologically triangular" if there exist permutations P and Q such that P*A*Q is lower (or upper) triangular. Morally triangular matrices arise in MATLAB when you do [L,U]=lu(A); in this case, the partial pivoting is captured in L, which is morally triangular. The right factor, U, is simply triangular. Backslash then detects whether or not L is morally triangular when computing x=L\b, finds the permutation, and does the forward solve. Thus, in MATLAB:
A = sprand (100,100,0.1) ;
b = rand (100,1) ;
[L,U] = lu (A) ;
spparms ('spumoni',2) ; % turn on sparse diagnostics
x = L\b ;
you get the following output:
sp\: bandwidth = 93+1+89.
sp\: is A diagonal? no.
sp\: is band density (0.34) > bandden (0.50) to try banded solver? no.
sp\: is A triangular? no.
sp\: is A morally triangular? yes.
sp\: permute and solve.
I have a hard time keeping track of the difference between moral triangularity
and psychological triangularity, and I suspect others who read the
NA digest do
too. Thus, in honor of Cleve and John, I wrote a helpful tool for remembering
the difference:
|
|
I don't think morally triangular matrices are related to the definition of "horror matrices", but in case they do, you can find the definition here.
Copyright 2007, Tim Davis. Please don't copy-and-paste or hot-link this poem without permission; link to this page instead: http://www.cise.ufl.edu/~davis/Poetry/moral.html
If you like this poem, you can find more poems at Horror Matrices and Other Mathematical Poetry. Click here for an index of my serious poetry.