help-octave
[Top][All Lists]
Advanced

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

Dynamically Linked Functions.


From: Sven Khatri
Subject: Dynamically Linked Functions.
Date: Thu, 28 Jan 1999 15:24:10 -0800

Hello All,

I'm trying to call a dynamically linked function and I'm getting a 
segmentation fault. The function I'm calling is the oregonator from
the online manual/help:
 http://www.che.wisc.edu/octave/doc/octave_12.html#SEC97

so I copied the following to a file:

#include <octave/oct.h>

DEFUN_DLD (oregonator, args, ,
  "The `oregonator'.")
{
  ColumnVector dx (3);

  ColumnVector x = args(0).vector_value ();

  dx(0) = 77.27 * (x(1) - x(0)*x(1) + x(0)
                   - 8.375e-06*pow (x(0), 2));

  dx(1) = (x(2) - x(0)*x(1) - x(1)) / 77.27;

  dx(2) = 0.161*(x(0) - x(2));

  return octave_value (dx);
}

I compiled it using mkoctfile and called it using:
oregonator ([1, 2, 3], 0)

and I get a segmentation fault.

I'm running on a RedHat Linux 5.2 system Running Octave 2.0.13.90.


Are dynamically linked functions not working/supported for my system.
Is the on-line manual not up to date? Do I need a more recent version
Octave. Is there an error in this piece of code? 

thanx for any help,

Sven Khatri



reply via email to

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