help-octave
[Top][All Lists]
Advanced

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

Re: How can I use a function of octave in my C program?


From: E2
Subject: Re: How can I use a function of octave in my C program?
Date: Thu, 26 Jun 2003 16:57:50 -0400
User-agent: Mutt/1.4.1i

On Thu, Jun 26, 2003 at 11:10:59AM -0400, Lan Guo wrote:
> Hi there,
> 
> I am working in UNIX, where Octave is installed at the root.   I have a C

Ok first of all you probably shouldn't be installing things in /, 
you should put octave where your distro keeps all its other
user programs.

> program, and I would like to call an Octave function, binomial_cdf, from my
> C program.  How can I do it?

> 
> Thanks,
> 
> Lan
> 
> 
> 

You can compile your C++ functions into octave and run them from there.
A small amount of info about this can be found under "dynamically linked
functions" in the manual.  Some examples are in a directory called
DLD-FUNCTIONS.
As for calling octave functions from your C++ function, I'm trying to 
figure that out now.  My guess of the moment is that the functions
in input.cc (found in the octave src directory on my machine) allow
input to the octave shell/command line.  I haven't tested anything,
and I might be out in left field.

If somebody could give us a general heads up on how things are done
with the dynamically linked functions I would really appreciate it.
Is there any documentation for this (other than the quick example
in the manual) or do I just need to hack on it for a while?

also, Lan, keep in mind that any code you take from octave and paste
into your program carries the GPL with it.  You should probably think
about coding binomial_cdf yourself, it can only make you smarter ;)
 

-- 
--E2

America without freedoms is not worth securing.

Attachment: pgpxBzOv4VIgW.pgp
Description: PGP signature


reply via email to

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