M. T. Shakeri wrote:
> Is there any code with F90 for calculation Pseudo Inverse (
> General Inverse ) Matrix.
Look for singular value decomposition (SVD) at http://www.netlib.org or
http://gams.nist.gov. Don't use the one in Numerical Recipes. I've
been told it has bugs in it.
Singular value decomposition of a matrix A decomposes it as U S V^T,
where U and V are orthonormal, and S is diagonal. A+ (A pseudo inverse)
is V S+ U^T, where S+ has the inverses of nonzero diagonal elements
of S on its diagonal, and zero everywhere else. The rank of A is
the number of nonzeroes in S. Most SVD algorithms sort the singular
values (diagonal elements of S) into non-increasing order.
Do you really need the pseudo inverse? Are you going to multiply it
by another matrix, say A+ B, or look at its elements? If the former,
it's faster to use an algorithm that computes V S+ U^T B. There are
algorithms that return V, S and (U^T B). This leaves you with one full
matrix multiply (multiplying by a diagonal is an order faster) instead
of two. If you really want A+ you can use this kind of algorithm, put
B = I, and compute V S+ (U^T B).
For a deeper description, see "Matrix Algorithms" by Golub and Van Loan.
Best regards,
Van Snyder
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|