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]

gsl_linalg_LU_det error


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


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