# singular matrix

Matthew Knepley knepley at gmail.com
Thu Apr 16 14:38:54 CDT 2009

```On Thu, Apr 16, 2009 at 11:34 AM, Chetan Jhurani <chetan at ices.utexas.edu>wrote:

> > From: Yixun Liu
> >
> > Hi,
> > For Ax=b, A is mxn, m>n. I use CG to resolve it and find the solution
> > makes no sense.  I guess rank(A) < min(m,n). How to resolve this
> > singular system? Use SVD?
>
> Only a square matrix can be singular.

No, a singular matrix has a kernel. A non-square matrix can be singular.

>
> If reinterpreting as a least-squares problem, SVD would be slower.
>
> If rank(A) = n, see
> <http://en.wikipedia.org/wiki/Moore-Penrose_pseudoinverse#The_QR_method>

QR will work for a matrix of rank < n. In this case, a null space basis
fills out U.

Matt

> If A is dense, use LAPACK for QR, otherwise sparse QR factorization
> should be faster.  http://www.cise.ufl.edu/research/sparse/CSparse/
>
> If A is not full rank (rank(A) < n), it is more complicated.  The
> pseudoinverse does not have a simple formula, although it is still
> computable for getting the minimum norm solution.  The book by Ake
> Bjorck would be useful, as Matt already suggested.
>
> Chetan
>
> > Best,
> >
> > Yixun
> >
>
>

--
What most experimenters take for granted before they begin their experiments
is infinitely more interesting than any results to which their experiments