help-gsl
[Top][All Lists]
Advanced

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

Re: [Help-gsl] gsl_linalg_LU_decomp Function


From: Matthew Boulton
Subject: Re: [Help-gsl] gsl_linalg_LU_decomp Function
Date: Wed, 08 Aug 2007 00:11:31 +0100
User-agent: Thunderbird 1.5.0.12 (Windows/20070509)


Basically I have a matrix called 'matrix' and a permutation matrix called
'indx', both of which are of length mat_size + 1 (except that 'matrix' is in 2D
of course so it has two columns of that length). However, GCC flags up an error
when I run the code saying:

gsl: lu.c:67: ERROR: permutation length must match matrix size

Could we see a code snippet? Do you have a gsl_matrix that happens to
be a permutation matrix or a gsl_permutation?

- Jordi G. H.

The programme is far too large to post here I'm afraid, but hopefully this snippet will be of use:


gsl_matrix *matrix = gsl_matrix_calloc( mat_size + 1 , mat_size + 1 ); /* Declare matrix */

ncomp_total = ( (ncomp1 - 1) * ncomp2 ) + 1 + ncomp_bg; /* = mat_size (Size of matrix) */

gsl_permutation *indx = gsl_permutation_calloc( ncomp_total + 1 ); /* Has same length as 'matrix' but is 1D */
 gsl_permutation_init(indx);
gsl_linalg_LU_decomp( matrix , indx , d ); /* 'matrix' and 'indx' are the same size! */


So to answer your last question I have specifically initialised indx using gsl_permutation.

Kind Regards,

Matt



reply via email to

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