help-gsl
[Top][All Lists]
Advanced

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

[Help-gsl] Help with gsl_matrix_column


From: Paris Kaimakis
Subject: [Help-gsl] Help with gsl_matrix_column
Date: Fri, 02 Sep 2005 12:52:08 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5) Gecko/20031007

Dear Sir/Madam,

I'm new to the gsl library and at the moment I'm trying to get some simple programs running. I'm having some trouble with an example program, which is supposed to give the norm of each column of a 10-by-10 matrix. The example program (taken right out of the gsl documentation pages) can be found at the bottom of http://www.gnu.org/software/gsl/manual/gsl-ref_8.html#SEC183 :

#include <math.h>
#include <stdio.h>
#include <gsl/gsl_matrix.h>
#include <gsl/gsl_blas.h>

int
main (void)
{
 size_t i,j;

 gsl_matrix *m = gsl_matrix_alloc (10, 10);

 for (i = 0; i < 10; i++)
   for (j = 0; j < 10; j++)
     gsl_matrix_set (m, i, j, sin (i) + cos (j));

 for (j = 0; j < 10; j++)
   {
     gsl_vector_view column = gsl_matrix_column (m, j);
     double d;

     d = gsl_blas_dnrm2 (&column.vector);

     printf ("matrix column %d, norm = %g\n", j, d);
   }

 gsl_matrix_free (m);

 return 0;
}


I use gsl under Windows (and Visual C). Other examples I have tried worked. This program compiles and links fine, but when I run it I get a "Debug Error" which reads: "The value of ESP was not properly saved across a funcrion call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention". This causes an abnormal termination of the executable.

After commenting out various parts of this program I found that the function call to "gsl_matrix_column" (line 19) is responsible for this. Is there any way that I can call this function without causing an abnormal termination?

I'd appreciate any help you could provide.

Paris








reply via email to

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