octave-maintainers
[Top][All Lists]
Advanced

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

Re: Use Octave's interpreter in my C++ program...


From: bernddude
Subject: Re: Use Octave's interpreter in my C++ program...
Date: Thu, 22 May 2008 18:19:33 -0700 (PDT)

Hello Molamini, i am looking for exactly the same solution if you do happen
to find on, 
would you mind to let me know

thanks bernd


Molamini wrote:
> 
> Hello,
> I would like to use Octave in a C++ multithreaded application.  Is there
> something like this (see code below) in Octave so I can get an instance of
> Octave and use it throughout the life of my OctaveUser object?  I'll even
> take something close to this. :)
> 
> class OctaveUser
> {
>    private:
>      OctaveInstance *p_oi;
>    public:
>     OctaveUser()
>     {
>         oi = OctaveFactory::createInstance();
>     }
>     void cppMethod()
>     {
>         Matrix m(2,2);
>         m(0,0)=1; m(0,1)=2;
>         m(1,0)=3; m(1,1)=4;
>         oi.feval("invert", m);
> 
>         // call 'testFromCpp.m' file.
>         octave_value_list result = feval ("testFromCpp", octave_value (m),
> 1 );
>         ...//do something with the value in C++
>     }
> 
>     ~OctaveUser()
>     {
>         delete _oi;
>     }
> };
> 
> Thanks!
> Molamini
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Use-Octave%27s-interpreter-in-my-C%2B%2B-program...-tp17413900p17416867.html
Sent from the Octave - Maintainers mailing list archive at Nabble.com.



reply via email to

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