1

I am trying to solve a sparse least-squares like problem using the SparseQR solver in Eigen. In the course of my application, I have to solve for both the over and underdetermined equations provided by some matrix A where A is overdetermined and A.transpose() is underdetermined.

I understand the technique by which the over-determined system is solved reasonably well using QR decomposition, but I wanted to check how Eigen solves the under-determined system. To solve the equation A.transpose() x = b Eigen doesn't seem to be performing the minimum norm solution which would be performed something like:

//Get the QR decomposition of A (over-determined system)
SparseQR solver;
solver.compute(A)

//Get the Q and R matrices of A
Q = solver.matrixQ()
R = solver.matrixR()

//Given that: A.transpose() = R.transpose() Q.transpose(), solve for x
xstar = R.transpose().solve(b)
x = Q*xstar

but after solving using a solver initialized via

solverAT.compute(AT);

I don't get the minimum-norm solution so I'm not sure exactly what approach it is using.

An additional question is if I can use the overdetermined decomposition to solve the underdetermined problem without having to recompute. That would certainly help in my application.

NateM
  • 177
  • 1
  • 12
  • It seems that in your code you use the overdetermined decomposition to solve the underdetermined problem. It it is the case, did you try to use the undermined decomposition and compare both results? – Damien May 14 '19 at 16:46
  • I did check that and I got two different answers so I don't think Eigen is computing the minimum-norm solution. It is definitely an answer since I checked that as well. I've edited my question to indicate what I tried. – NateM May 14 '19 at 20:24
  • SparseQR is not really rank-revealing: http://eigen.tuxfamily.org/bz/show_bug.cgi?id=899, i.e., be careful with underdetermined systems. You can try to play around with the pivoting threshold. – chtz May 21 '19 at 08:41

0 Answers0