help-octave
[Top][All Lists]
Advanced

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

Re: Calling lsode directly from a c++ program via liboctave?


From: John W. Eaton
Subject: Re: Calling lsode directly from a c++ program via liboctave?
Date: Thu, 8 Nov 2001 23:06:48 -0600

On 25-Oct-2001, Douglas Eck <address@hidden> wrote:

| > Great job! I was wondering if there is a quick way to supply parameters
| > to the ode function. It seems Octave leaves us nothing but declare them
| > as global. I am afraid it would be a pain to access global variables
| > from an .oct file (symbol table lookups and stuff like that)...

It's actually not too painful to access global variables in .oct
files.  You just need to do this:

  octave_value my_global = get_global_value ("my_global");

and, if needed, extract a more basic type from the octave_value
object.  There is a corresponding function for setting global values
too:

  void set_global_value (const std::string& nm, const octave_value& val);

Both of these are declared in variables.h and defined in variables.cc
in the Octave sources.

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]