From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23099 invoked by alias); 23 Jul 2002 17:35:28 -0000 Mailing-List: contact gsl-discuss-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gsl-discuss-owner@sources.redhat.com Received: (qmail 23045 invoked from network); 23 Jul 2002 17:35:25 -0000 Received: from unknown (HELO okra.cchem.Berkeley.edu) (128.32.198.129) by sources.redhat.com with SMTP; 23 Jul 2002 17:35:25 -0000 Received: from localhost (aspuru@localhost) by okra.cchem.Berkeley.edu (8.11.0/8.11.0) with ESMTP id g6NHnYP13702; Tue, 23 Jul 2002 10:49:34 -0700 Date: Tue, 23 Jul 2002 10:35:00 -0000 From: Alan Aspuru-Guzik To: Przemyslaw Sliwa cc: gsl-discuss@sources.redhat.com Subject: Re: Determinant of a matrix In-Reply-To: <3D3D8C3A.8030003@euv-frankfurt-o.de> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT X-SW-Source: 2002-q3/txt/msg00084.txt.bz2 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