Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

There's two parts to this problem the first is implementation related the second is theoretical.

Part 1: I've been given $A$ & $B$ and need to solve for $x$. To do this I've been using an SVD. The problem is when $A$ has a large condition number the SVD loses enough precision that returned matrix becomes useless (filled with nan values).

The condition number is quotient of the absolute value of largest and smallest eigenvalues. Part of the reason the condition number is so large is the min value is on the order of $10^{-19}$. I used the Jacobi method to calculate the eigenvalues of $A$.

Both the SVD & Jacobi implementations come from Numerical Recipes in C 3rd ed.

I've heard that you can threshold the SVD to ignore such small values but can't find reference to it in the NR and LAPACK implementations or on papers on SVD implementation. Am I missing something does this not exist?

Part 2: What other methods are used to solve $Ax = B$?

Thanks, Jon

share|cite|improve this question – user2468 Apr 21 '12 at 22:13
"...but can't find reference to it in the NR and LAPACK implementations or on papers on SVD implementation." - if memory serves, it's specifically said there to zero out "tiny" singular values, and then perform pseudoinversion with the diagonal factor (reciprocate if nonzero, do nothing otherwise). If you're looking at NR, did you read the comments in the code? – J. M. Apr 22 '12 at 0:27
Also: often, if you end up dealing with an ill-conditioned matrix, it often turns out that you're solving the wrong problem to begin with. Where did your matrices come from? – J. M. Apr 22 '12 at 0:28

The most common approach is to use a matrix preconditioner.

Deciding which to use is a matter of understanding its impact on your problem, so you'll need to consult a numerical analysis text to decide what it right for you. Often simple Jacobi preconditioners will work based on the matrices in your system.

This is a rather open ended question, so it's probably best if you check with some preconditioning references and then post a new question if you encounter more specific issues.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.