This project has moved. For the latest updates, please go here.

Q-less QR decomposition

Dec 5, 2013 at 11:43 AM
In MATLAB (if A is sparse) R = qr(A) computes a Q-less QR decomposition and returns the upper triangular factor R.
Does Math.NET Numerics support this Q-less decomposition for sparse matrices?

Regards,
Oliver
Coordinator
Dec 5, 2013 at 8:28 PM
Hi Oliver

Not as part of our QR decomposition implementation. But as indicated in the MATLAB QR reference the triangular factor R can also be computed with the Cholesky decomposition: R = chol(A'*A), which is more efficient especially if the matrix is very tall. Although note that in Math.NET Numerics the Cholesky decomposition provides the lower triangular factor, not the upper one, hence: var R = A.TransposeThisAndMultiply(A).Cholesky().Factor.Transpose();. Also note that since the QR decomposition is not unique, some rows can be negative the corresponding one of the Cholesky factor.

Then, other than the iterative solvers, all these direct solvers like Cholesky and QR are currently only optimized for dense matrices, so until we make progress on sparse direct solvers it may actually be faster to use dense matrices even if the data is very sparse, especially if you can use the MKL native provider.

Thanks,
Christoph
Marked as answer by cdrnet on 12/30/2013 at 6:46 AM