Solving a Numerically Underdetermined System
If the columns of the matrix A in a least squares problem are linearly dependent, or if there are fewer columns than rows, there is no unique solution to the problem. Sometimes it may happen that the columns in A are very close to being linearly dependent, but not quite. Even worse, sometimes the columns may actually be linearly dependent, but due to roundoff error in the construction of the least squares decomposition, they may not be linearly dependent in the decomposition. In this case, you can still construct a unique solution to the problem, but it is likely to be extremely inaccurate. The problem is dominated by the nearly dependent columns, and is very ill-conditioned.
The Rogue Wave SVD and QR least squares classes have a mechanism for dealing with the problem of nearly dependent columns in the least squares matrix. When you set a value, called the tolerance, to a measure of the error in your problem, the diagonal entries of the decomposition less than this tolerance are treated as 0. For example, if the values in your matrix represent the masses (in grams, say) of samples in an experiment, and the masses are accurate to within 0.0001 grams, you could use a tolerance by constructing your least squares factorization like this:
 
RWLeastSqQR<double,RWQRCalcP3<double> > leastSquares(A,0.0001);
Now if the columns of the matrix are linearly dependent to within the tolerance, the system is treated as underdetermined. This avoids conditioning problems.