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]
Other format: [Raw text]

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


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