Hi,
I am using the gsl function gsl_linalg_LU_invert in the following piece of code:

gsl_matrix_complex Invert(gsl_matrix_complex* m){
        double  inv[]= {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; 
        int s;
        gsl_matrix_complex_view minv = gsl_matrix_complex_view_array(inv, 3, 3);
        gsl_permutation * p = gsl_permutation_alloc(3);
        gsl_linalg_complex_LU_decomp(m,p,&s);
        gsl_linalg_complex_LU_invert(m, p, &minv.matrix);
        gsl_permutation_free(p);
        return minv.matrix;

}

Whenever I try to run this I get the following error when 
gsl_linalg_complex_LU_invert is called:

gsl: rowcol_source.c:51: ERROR: column index is out of range
Default GSL error handler invoked.

my m matrix is defined as:
double  ma[]= {1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0}; 
gsl_matrix_complex_view m = gsl_matrix_complex_view_array(ma, 3, 3);

and the call to my function is:
gsl_matrix_complex Invert(&m.matrix);

Thank you for your help,

Elena Guardincerri




Reply via email to