This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
gsl_linalg_LU_det error
- From: Kollányi Tibor <kollanyi at kt>
- To: gsl-discuss at sources dot redhat dot com
- Date: Mon, 27 May 2002 13:29:34 +0200
- Subject: gsl_linalg_LU_det error
- Organization: University of Miskolc
- Reply-to: kollanyi at szgtirix dot szgt dot uni-miskolc dot hu
Hello, here is my simple program, but the value of determinant is not
correct. What is the problem?
#include <iostream.h>
#include <stdlib.h>
#include <gsl/gsl_linalg.h>
int main (void)
{
double a_data[] = { 3.0, 4.0, 5.0, 66.0, 23.0, 1.0, 2.0, 7.0, 9.0 };
gsl_matrix_view m = gsl_matrix_view_array(a_data, 3,3);
int s1,s2;
double dd;
gsl_permutation * p = gsl_permutation_alloc (3);
gsl_linalg_LU_decomp (&m.matrix, p, &s1);
dd=gsl_linalg_LU_det (&m.matrix,s2);
cout << "det(A)= " << dd;
gsl_permutation_free (p);
return 0;
}
Please help me!
--
Kollányi Tibor
assistant
University of Miskolc
Miskolc-Egyetemváros
H-3515
HUNGARY
tel.:+36 46 / 565 111 / 1915
30 / 455 7717