[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
C++ Standalone Program: register my own Octave function
From: |
Wolfgang Betz |
Subject: |
C++ Standalone Program: register my own Octave function |
Date: |
Fri, 10 Apr 2015 06:48:27 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 |
Hi!
I use the Octave library inside a standalone application - this concept
is demonstrated here:
http://hg.savannah.gnu.org/hgweb/octave/file/bb0c5e182c12/examples/code/embedded.cc
https://www.gnu.org/software/octave/doc/interpreter/Standalone-Programs.html#Standalone-Programs
My question is: I want to define a function in Octave that can
'call-back' to my C++ application.
Has anybody an idea how this could be done?
An example:
My C++ application registers Octave function 'myownfun' that takes
e.g. a scalar and returns a scalar.
In my C++ application I use it like this:
..
const std::string psn = "myownfun(5.5)";
int parse_status;
octave_value v = eval_string (psn, false, parse_status);
...
I am looking forward to your feedback!
Thanks!
Wolfgang
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- C++ Standalone Program: register my own Octave function,
Wolfgang Betz <=