help-octave
[Top][All Lists]
Advanced

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

call octave functions direction from c++ (not using feval() )


From: daviddoria
Subject: call octave functions direction from c++ (not using feval() )
Date: Mon, 8 Dec 2008 10:58:39 -0800 (PST)

I know how to call octave function from c++, for example, to integrate the
function x^2 from 0 to 2 using "quad", I can do

#include <octave/octave.h>
#include <octave/oct.h>
#include <octave/parse.h>

int main(int argc, char **argv)
{
octave_main (argc, argv, 1)
f_arg(0) = "x^2";
f_arg(1) = 0;
f_arg(2) = 2;
f_arg(3) = octave_value(m);
f_ret = feval("quad", f_arg);
        
double ans = f_ret(0).double_value();
}

However, is there a way to call directly the function quad() that octave
calls (ie skip the interpreted language step)? I am using fedora so I have
the octave source - seems like this should be possible.

Anyone have any hints?

Thanks,
Dave
-- 
View this message in context: 
http://www.nabble.com/call-octave-functions-direction-from-c%2B%2B-%28not-using-feval%28%29-%29-tp20901391p20901391.html
Sent from the Octave - General mailing list archive at Nabble.com.



reply via email to

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