help-octave
[Top][All Lists]
Advanced

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

Re: Inline::Octave for perl


From: adler
Subject: Re: Inline::Octave for perl
Date: Mon, 22 Oct 2001 21:49:20 -0400 (EDT)

On Mon, 22 Oct 2001, Paul Kienzle wrote:
> I'm no perl hack, but I gave it a try anyway.  It would be nice if you could
> upload
> a demo script to go with it so that non-perl folks can see if it works.  I put
>
>     #!/usr/bin/perl
>
> at the top of your example below and got the following result:

Sorry, I realized I should have given some directions ...

You need to install the Inline module from CPAN. This provides
the infrastructure to support all the Inline::* modules.

Then install Octave.pm in an Inline directory in any path in your @INC.

An:~> perl -e 'print join ",\n",@INC '     # my values
   /usr/lib/perl5/5.6.0/i386-linux,
   /usr/lib/perl5/5.6.0,
   /usr/lib/perl5/site_perl/5.6.0/i386-linux,
   /usr/lib/perl5/site_perl/5.6.0,
   /usr/lib/perl5/site_perl,
   .

The easiest is to create a ./Inline directory in your
working directory, and put Octave.pm in that.

after that the example code should run.

It should work with stock octave - but I'd like to get feedback on this.
Basically, I create an octave process with controlled stdin and stdout.
Commands send by stdin. Data is send by stdin and read with
fread(stdin, [dimx dimy], "double"), and read similarly.

Inline::Octave::Matrix variables in perl are tied to the octave
variable. When a destructor is called, it sends a "clear varname"
command to octave.

I initially tried to bind the C++ and liboctave to perl, but
it started to get really hard - so I took this route.

_______________________________________
Andy Adler,                address@hidden




-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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