[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-gsl] Declaring GSL Matrices
From: |
Matthew Boulton |
Subject: |
[Help-gsl] Declaring GSL Matrices |
Date: |
Mon, 13 Aug 2007 16:19:21 +0100 |
User-agent: |
Thunderbird 2.0.0.6 (Windows/20070728) |
Hello. I'm having a bit of an issue with implementing GSL matrices.
Basically at the moment when I declare a permutation matrix in a
particular function called by the main function, that matrix is not
considered to be declared if I try and use it later on in my main function.
For example, I declare a matrix called indx in check_stamps() as follows:
gsl_permutation * indx = gsl_permutation_calloc( ncomp_total + 1 + 100 );
Now bear in mind that line is in the check_stamps() function, my main
function looks as follows:
check_stamps();
printf("Expanding Matrix\n");
mat_size = (ncomp_kernel - 1) * ((( deg_spatial + 1 ) * ( deg_spatial
+ 2 )) / 2) + ((( deg_bg + 1 ) * ( deg_bg + 2 )) / 2) + 1;
gsl_matrix *matrix = gsl_matrix_calloc( ncomp_total + 1 + 100 ,
ncomp_total + 1 + 100); /* Declare matrix */
matrix = build_matrix();
printf("Expanding Matrix Done\n");
build_scprod(sub_image);
ncomp_total = (ncomp1 - 1) * ncomp2 + 1 + ncomp_bg; /* = mat_size
(Size of matrix) */
/* gsl_permutation *indx = gsl_permutation_calloc( ncomp_total + 1 + 100
); Has same dimension as 'matrix' but is 1D */
gsl_linalg_LU_decomp( matrix , indx , d );
Sadly this will not compile unless I remove the commented out line, but
this means I am declaring the same matrix twice.
Is this a common problem or have I simply not implemented this correctly?
Kind Regards,
Matt
- [Help-gsl] Declaring GSL Matrices,
Matthew Boulton <=