[Top][All Lists]

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

octave libs and builtin functions

From: John W. Eaton
Subject: octave libs and builtin functions
Date: Thu, 4 Jun 1998 10:21:05 -0500 (CDT)

On 27-May-1998, Erich Schneider <address@hidden> wrote:

| I'm already using the octave classes in my own C++ applications.
| However, I don't quite understand how to use octave's builtin functions
| like load, save or plot. I have problems in understanding what the
| DEFUN_TEXT macros are doing. I cannot see that the functions defined by
| these macros are exported. Does anybody have an example for using
| octave builtin functions or saving, loading and plotting octave
| variables in the mat format?

The DEFUN macros provide the function declarations and enforce a
uniform naming scheme for built in and dynamically loaded functions.

  DEFUN(foo, args, nargout,
    "help text")

declares a function with the signature

  Ffoo (const octave_value_list& args, int nargout)

If you create the argument list yourself, you can call the function

  octave_value_list args;

  args(2) = ...
  args(1) = ...
  args(0) = ...

  octave_value_list retval = Ffoo (args, nargout);

However, the functions defined by the DEFUN macros are really only
intended to be called from functions that are running inside of
Octave.  They are not particularly useful (and some would not even
make sense) in standalone C++ programs.

Recently, I've tried to make the functions defined with the DEFUN
macros simple wrappers around other functions that can be called from
standalone C++ programs.  That's not always been true, however, so
some of the functionality provided by Octave functions is not easily
available to standalone C++ programs.  Fixing this is not hard, but
takes time away from other projects.  Would someone like to help do
the work?



reply via email to

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