This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
Re: Determinant of a matrix
- From: Alan Aspuru-Guzik <aspuru at okra dot cchem dot Berkeley dot edu>
- To: Przemyslaw Sliwa <sliwa at euv-frankfurt-o dot de>
- Cc: gsl-discuss at sources dot redhat dot com
- Date: Tue, 23 Jul 2002 10:49:34 -0700 (PDT)
- Subject: Re: Determinant of a matrix
I already answered the question to you before (the 28th of May)!
http://sources.redhat.com/ml/gsl-discuss/2002-q2/msg00197.html
There is a lot of stuff that you don't need in that code, but it is easy
to figure out... (here I tried to be more explicit than in the previous
post)
x ludecomp and matrix are matrices
x perm is a permutation
x det is a double, s is an integer
//this copies the matrix, I like this, so I can still have it afterwards
//otherwise you will get the LU decomposition and loose your original
//matrix
gsl_matrix_memcopy(ludecomp,matrix);
//get the LU decomposition
gsl_linalg_LU_decomp(ludecomp,perm,&s);
//get the determinant
det =gsl_linalg_LU_det(ludecomp,s);
Let me know if you have any problems,
Alan
On Tue, 23 Jul 2002, Przemyslaw Sliwa wrote:
> Does anyone know how to compute in an easy way the determinant of a real
> matrix?
>
> Thanx for hinst.
>
> Przem
>
--
Alan Aspuru-Guzik Dios mueve al jugador, y éste, la pieza.
(510)642-5911 UC Berkeley ¿Qué Dios detrás de Dios la trama empieza
(925)422-8739 LLNL de polvo y tiempo y sueño y agonías? -Borges