Hello,

Could somebody tell me what is wrong with this code (I get a segmentation
fault):
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#include <stdlib.h>

#include <gsl/gsl_matrix.h>

typedef gsl_matrix* Math__GSL__Matrix__gsl_matrix ;

#include "const-c.inc"

MODULE = Test_gsl           PACKAGE = Test_gsl

double
TOI (WF, size)
  Math::GSL::Matrix::gsl_matrix WF
  unsigned int size
  PREINIT:
    double tmp ;
  CODE:
    printf ("Size %d\n", size) ;
    tmp = gsl_matrix_get (WF, 0, 0) ;
    printf ("%g\n", tmp) ;
    RETVAL = tmp ;
  OUTPUT:
    RETVAL


called by:

my $Matr_gsl = gsl_matrix_alloc (3, 3) ;
print ref $Matr_gsl, "\n" ;B
Test_gsl::TOI ($Matr_gsl, $size_mat) ;


Thank

--
---
==========================================================================
 Patrick DUPRÉ                      |   |
 Department of Chemistry            |   |    Phone: (44)-(0)-1904-434384
 The University of York             |   |    Fax:   (44)-(0)-1904-432516
 Heslington                         |   |
 York YO10 5DD  United Kingdom      |   |    email: pd...@york.ac.uk
==========================================================================
-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/

Reply via email to