[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-gsl] gsl_linalg_LU_decomp() and float

From: Bosch
Subject: [Help-gsl] gsl_linalg_LU_decomp() and float
Date: Fri, 17 Mar 2006 05:18:55 -0800 (PST)


I am trying to invert a matrix of type float via the gsl_linalg_LU routines.
And right now I am doing this more or less like this.. with a segmentation
fault as result.. 

float H[][MAXWIDTH]=HH; // (HH being my 4x4 matrix)
gsl_matrix_float *ptr = gsl_matrix_float_alloc (4, 4);
gsl_permutation *p =  gsl_permutation_alloc (4);
gsl_permutation_init (p);
int sign = (((*ptr).size1%2) ==0) ?  1 : -1;
gsl_linalg_LU_decomp (ptr, p, &sign); // <-- here is the segfault

I think I've found the problem, but I don't know how to solve it. The header
file (gsl_linalg.h) seems to be made for gsl_matrix structures only,and not
for other data types (e.g. gsl_matrix_float). 
I would prefer to use float, as all my data is in float... and I would like
to keep it that way.  How should I solve it?

Thanks for any support that I'll get, I am not a very good c programmer, and
if it's a very stupid question: sorry and extra thanks!
View this message in context:
Sent from the Gnu - Gsl - Help forum at

reply via email to

[Prev in Thread] Current Thread [Next in Thread]