help-octave
[Top][All Lists]
Advanced

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

Re: How to do subsref for a new data type in octave


From: David Bateman
Subject: Re: How to do subsref for a new data type in octave
Date: Mon, 21 Jun 2004 09:28:54 +0200
User-agent: Mutt/1.4.1i

Take a look at the referencing to "prim_poly", "x", etc in the galois
type in octave-forge.. The code is in main/comm/ov-galois.cc where
"prim_poly" is referred to by the macro __GALOIS_PRIMPOY_STR, etc..
This code uses dotref to display the data only, not to set it. 

Code I wrote that can actually change the values set in this manner is
in main/fixed/ov-fixed.cc where the key __FIXED_INTSIZE_STR can be used
to change the fixed-point representation.

Regards
David


According to address@hidden <address@hidden> (on 06/18/04):
> Hi all,
> 
> Thanks a lot for your quick responses to my questions. They
> are really helpful. Now I have another question:
> 
> I created a new data type in octave by adding a new class. Now
> I would like to access the members of the new class in octave
> script. I tried to define subsref and subsasgn methods in the
> class and hope the methods can be overloaded when I write in
> octave something like " obj.field ". However, it seems I
> haven't created such a connection and an error message says
> "can't perform indexing operations for 'myclass' type". 
> 
> Can anybody tell me if it is the correct way to do the
> indexing and what is missing in my implementation.
> 
> Thanks, 
> 
> Jia
> 
> 
> 
> -------------------------------------------------------------
> 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
> -------------------------------------------------------------

-- 
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:  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]