help-octave
[Top][All Lists]
Advanced

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

using functions found in oct files from c++


From: John W. Eaton
Subject: using functions found in oct files from c++
Date: Mon, 25 Sep 2006 12:57:23 -0400

On 25-Sep-2006, Søren Hauberg wrote:

| can I somehow call "some_function" from another oct file?

Yes.  Use feval.

If you try to do this some other way, you will end up implementing at
least part of feval, but you will potentially have strange results.
For example, if the .oct file for the function changes, or somone
expects their .m file version to be called in place of the .oct file
(because it is earlier in the path).  So use feval.  It's simple (for
you) and it works.

If you think that it is too slow to use feval, then please demonstrate
that it really is too expensive (does anyone have any real numbers, or
is this just folklore?).  If it is too expensive, then I suspect the
only reason is because it must look for newer versions of the
function.  If that is enough to cause feval to be too slow, then any
.oct file function would be too slow to call from Octave, since I
think the mechanism used by feval is essentially the same as Octave
uses internally for any function call.

jwe



reply via email to

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