This is more a suggestion/request than a question:
Someone should write a LaTeX macro that automatically row reduces a matrix until it's in (reduced) echelon form and typesets all the steps. (As far as I can tell, none such exists.)
I'm thinking of something like the gauss package, except that the row reductions themselves are carried out automatically, like in the Linear Algebra Toolkit. This would be similar to the \polylongdiv
command in the polynom package, where all one needs to do is enter the polynomials to be divided and the macro carries out the algorithm and typesets the steps.
Of course you might be wondering why I don't just do it myself. Well I guess my answer to that is: some (linear) combination of laziness, busyness, not being the right person for the job, etc.
Thanks, regards, respect, and even a little love. :*
Best Answer
Update-2
I heard someone said Givens rotations.
For a 10 by 10 random matrix, the norm of A - QR is about 4e-4. The norm of QQᵀ - I is about 2e-4.
Update-1: New Answer
I implement three decompositions:
If A is m by n, then P, L are m by m; U is the same as A; and Q is n by n.
Advantages
The complexity of accessing a matrix entry is O(1). (Assuming
\csname
is O(1)). So the complexity of decompositions is O(m²n).The input utilize
\pgfplotstableread
from pgfplotstable. So it accepts inline-table, file, loaded table, and even the table created by\pgfplotstablenew
. You can also pass options to it. (such as filtering)The output utilize
\pgfplotstabletypeset
from the same package. Or you can convert the matrix back to a table and do whatever you want.The calculation is done by
\pgfmathparse
. I assume FPU is on. But one can reimplement that.There is a debug macro that output the raw data of matrices. You can copy and paste those data into whatever modern matrix calculator.
According to Wikipeida, even partial pivoting is numerically stable in practice. I test a 10 by 10 random matrix and check A - PLUQ in sage; the norm is about 1.1e-6. (This is about the precision of FPU)
debug mode
Old Answer
I would like to try
The rest is deleted because of the length limitation.