Re: Real Symmetric Matrix Inversion




"rjmagyar" <rjmagyar@xxxxxxxxx> wrote in message
news:d8fc7e65-caa3-4307-8ac4-8f45f05244fa@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi, I was wondering if any one can recommend a robust and fast matrix
inversion routine. I have a matrix with vastly different (sometimes
over 10 orders of magnitude) elements that needs to be inverted. I
have modified the matinv routine by C. Reeve to allow double precision
calculations, but this doesn't seems to be enough. The inverse I get
is only approximately correct. Does any one know of either a general
routine that can handle this, or does any one know a scheme around
this?


Best, Rudy

For n < 50
below is PROVEN fastest and most accurate..


! --------------------------------------------------------------------
SUBROUTINE Gauss (a,n) ! Invert matrix by Gauss method
! --------------------------------------------------------------------
IMPLICIT NONE
INTEGER :: n
REAL(8) :: a(n,n), b(n,n), c, d, temp(n)
INTEGER :: j, k, m, imax(1), ipvt(n)

b = a
ipvt = [ 1:n ]

DO k = 1,n
imax = MAXLOC(ABS(b(k:n,k)))
m = k-1+imax(1)
IF (m /= k) THEN
ipvt( [m,k] ) = ipvt( [k,m] )
b( [m,k],:) = b( [k,m],:)
END IF
d = 1/b(k,k)
temp = b(:,k)
DO j = 1, n
c = b(k,j)*d
b(:,j) = b(:,j)-temp*c
b(k,j) = c
END DO
b(:,k) = temp*(-d)
b(k,k) = d
END DO
a(:,ipvt) = b
END SUBROUTINE Gauss



.



Relevant Pages

  • Re: Real Symmetric Matrix Inversion
    ... inversion routine. ... SUBROUTINE Gauss! ... Invert matrix by Gauss method ...
    (comp.lang.fortran)
  • Re: Matrix Inversion Suggestions for Fortran
    ... inversion routine. ...   Does any one know of either a general ... The MIRACL library can invert a large Hilbert matrix, ...
    (sci.math.num-analysis)
  • Re: Real Symmetric Matrix Inversion
    ... inversion routine. ... numerical methods newsgroup. ... Do not invert unless you have extremely good reasons to so. ... Solving equations by inversion is both slower and less accurrate ...
    (comp.lang.fortran)
  • Re: Real Symmetric Matrix Inversion
    ... inversion routine. ... The have several different inversion methods. ... Some of those come with an automatic "rescaling" of the matrix to cope with difference in magnitude. ... Only invert if you really have to. ...
    (comp.lang.fortran)
  • Re: Matrix Inversion Suggestions for Fortran
    ... inversion routine. ...   Does any one know of either a general ... better fundamental algorithms can be found in Collected Algorithms ...
    (sci.math.num-analysis)