Re:LU Factorization and Linear Systems for Programers
by gmiller123456 on Wednesday September 27, 2017 @02:52PM
(#15351075)
To save people a few clicks:
[1] https://www.cs.utexas.edu/users/pingali/CS378/2008sp/papers/...
Re:LU Factorization and Linear Systems for Programers
by FabHK on Wednesday September 27, 2017 @05:44PM
(#15352609)
BTW, I think one important take-away for programmers is:
Don't invert matrices.
For example, the solution for the least squares (=linear regression) problem is
beta^hat = (X'X)^-1 X'y
and you might think that the best way to compute it is to compute X'X, invert it, do the multiplication, yada yada yada. But it's really better to just ask your library (Matlab, LAPACK, ...) to solve the problem for you, and it'll probably do a QR decomposition. For small problems, it doesn't really matter, but for big problems you'll be both faster and more accurate.
Re:LU Factorization and Linear Systems for Programers
by R_haterade on Wednesday September 27, 2017 @06:57PM
(#15353108)
Excellent John D. Cook piece on the same subject: https://www.johndcook.com/blog/2010/01/19/dont-invert-that-m...
Re:LU Factorization and Linear Systems for Programers
by conistonwater on Wednesday September 27, 2017 @11:23PM
(#15354308)
That's a slightly different issue: the issue with solving normal equations directly is that the condition number of X^\top X is the square of the condition number of X, so it's much more significant than lu-vs-inv. It can matter a great deal for ill-conditioned linear regression problems where some features resemble each other.
Re:LU Factorization and Linear Systems for Programers
by FabHK on Wednesday September 27, 2017 @05:28PM
(#15352507)
> how to achieve high performance
You really just want to use LAPACK/BLAS, no? (That's what the Neanderthal library mentioned in the article does, btw, and basically linear algebra libraries for other languages, too. If not, you probably shouldn't use it...)
Re:LU Factorization and Linear Systems for Programers
by dagss on Thursday September 28, 2017 @12:45PM
(#15358629)
Of course you should but the blocking and amortization techniques have much wider usecases beyond linear algebra. Matrix multiplicaton is a useful "simple" example to study; of course you don't write your own if what you want to do is covered by BLAS/LAPACK.
For instance I have written high performance spherical harmonic transforms, and these techniques apply then.
Google for Goto's "Anatomy of high-performance matrix multiplication", one of my favorite programming texts.
Also the papers underlying the development of the "Elemental" library for distributed dense linear algebra is worth a look.