help-octave
[Top][All Lists]
Advanced

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

Re: writing classes in octave


From: Paul Kienzle
Subject: Re: writing classes in octave
Date: Fri, 23 Jul 2004 10:04:33 -0400


On Jul 23, 2004, at 4:20 AM, David Bateman wrote:

According to Ganesh Bikshandi <address@hidden> (on 07/23/04):
Hi,

I have two questions:

Is there a way to write classes in Octave,

Yes, and

like that in Matlab (using
@classname as a directory) ?

No.... There is no way in octave at the moment to do the overloading
necessary to create custom types from a dot-m file. There is no
subsref, subsasgn, etc function to perform this.

However, if you are really motivated it is possible to create a class
for octave as an oct-file. There are several examples of this within the
octave-forge directories. There are complex classes for sparse, Galois
field and fixed point types in the directories main/sparse, main/comm
and main/fixed respectively. However if you want to learn how to create
your class the easiest example to look at is probably the one in
extra/linear-algebra/ov-re-tri.cc for upper/lower triangular matrices.
Note that only assignment and transpose/hermitian are defined on this
class, you'll have to check the other directories above if you want
to do something more complex.

And if you are even more motivated, you can write a new class as
an oct-file which allows you to write classes as m-files.  It won't be
a lot more work than writing a class.

Paul Kienzle
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]