This is the mail archive of the gsl-discuss@sources.redhat.com mailing list for the GSL project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: matrix inversion


Hi,
if you can avoid using the inverse of a matrix do it!
Almost all computations involving the inverse of a matrix can be avoided,
it is only when you want elements explicitly from the matrix you have to
form
parts of the inverse.

If you want to solve a linear system of equations it is better to compute
a LU decomposition (uses the same storrage) of the matrix and then solve two
triangular systems.
For small systems (like ~100 varibles) you can use the function
gsl_linalg_LU_decomp() to compute the decomposition and
gsl_linalg_LU_solve() to solve the system. If you insist to compute
the inverse use gsl_linalg_LU_invert(). (It is much more expensive
to compute the inverse and use it to solve the systems than using
the LU decomposition. More, the numerical accuracy is much worse when
using the inverse)

See the online documentation:
http://sources.redhat.com/gsl/ref/gsl-ref_12.html#SEC201

If you want to solve large problems i should use LAPACK instead. 
You can find LAPACK at netlib (www.netlib.org),

Sincerely,
Mikael Adlers

------------------------------------------------------------------ 
 Mikael Adlers, Ph.D.          email: mikael@mathcore.com 
 MathCore AB                   phone: +4613 32 85 07 
 Wallenbergsgata 4             fax:         21 27 01
 SE-583 35 Linköping, Sweden   http://www.mathcore.com



> -----Original Message-----
> From: Rooms Frédéric [mailto:rooms@enserg.fr] 
> Sent: den 4 september 2001 15:05
> To: gsl-discuss@sources.redhat.com
> Subject: matrix inversion
> 
> 
> Hi,
> 
> is there an easy way to inverse complex matrix ?
> 
> Thanks a lot
> 
> Fred
> 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]