help-octave
[Top][All Lists]
Advanced

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

octave and gsl


From: John W. Eaton
Subject: octave and gsl
Date: Wed, 29 Mar 2006 03:03:43 -0500

On 29-Mar-2006, Gorazd Brumen wrote:

| hi,
| 
| the reference to gsl was my next possibility. I compiled the following
| script with mkoctfile
| 
| #include <octave/oct.h>
| #include <math.h>
| #include <gsl/gsl_sf_bessel.h>
| 
| 
| DEFUN_DLD (gn, args,  , " gn function") {
| 
|   ColumnVector res (1);
| 
|   res(1) = gsl_sf_bessel_Jnu (2, 3);
| 
|   return octave_value ( res );
| 
| }
| 
| 
| compile with mkoctfile gn.cc -lm -lgsl -lcblas
| and it compiles ok. then when i run it in octave i get
| 
| *** glibc detected *** free(): invalid next size (fast): 0x08b8d140 ***
| panic: Aborted -- stopping myself...
| attempting to save variables to `octave-core'...
| save to `octave-core' complete
| Aborted
| 
| 
| octave 2.1.72, ubuntulinux package.
| 
| 
| can someone help me what i am doing wrong?

Probably you want

  ColumnVector res (1);

  res(0) = gsl_sf_bessel_Jnu (2, 3);

since indexing for ColumnVector objects is 0-based.  Or, if you just
want to return a scalar value,

  return octave_value (gsl_sf_bessel_Jnu (2, 3));

(assuming gsl_sf_bessel_Jnu returns a double value).

jwe



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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