[Top][All Lists]

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

Re: writing classes in octave

From: David Bateman
Subject: Re: writing classes in octave
Date: Fri, 23 Jul 2004 10:20:33 +0200
User-agent: Mutt/1.4.1i

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/ 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.

Also note that at the moment the "[]" can not be overloaded, though there
is a patch in the works to fix that.

> Is there any study that shows the execution time (speed) of Matlab vs
> that of Octave?

There is a survey at, but
please don't take the values in this benchmark as the speed of octave
currently. There is a long thread discussing this, under different
titles earlier this year. A sum-up of the results and an updated comaprison
using the sciviews scripts can be seen in the message


David Bateman                                address@hidden
Motorola CRM                                 +33 1 69 35 48 04 (Ph) 
Parc Les Algorithmes, Commune de St Aubin    +33 1 69 35 77 01 (Fax) 
91193 Gif-Sur-Yvette FRANCE

The information contained in this communication has been classified as: 

[x] General Business Information 
[ ] Motorola Internal Use Only 
[ ] Motorola Confidential Proprietary

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

Octave's home on the web:
How to fund new projects:
Subscription information:

reply via email to

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