octave-maintainers
[Top][All Lists]
Advanced

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

Re: How to use the OO features of Octave


From: David Bateman
Subject: Re: How to use the OO features of Octave
Date: Tue, 23 Sep 2008 23:17:36 +0200
User-agent: Thunderbird 2.0.0.16 (X11/20080725)

John W. Eaton wrote:
On 23-Sep-2008, David Bateman wrote:

| David Bateman wrote:
| > John W. Eaton wrote:
| > >
| > >      args(2) = num_indices;
| > >      args(1) = index_position;
| > >      args(0) = *indexed_object;
| >
| >
| > shouldn't args(1) be
| >
| > args(1) = index_position + 1;
| >
| > due to the 1-based indexing of Octave?

Yes, I've fixed this now.  Thanks.

Ok.
| Also shouldn't we subtract one from the return value of the feval call?

I don't think so, because the result is not used directly in C++, but
it replaces the value in the expression where the "end" keyword
appears.  So in your example, for a(2:end) and a(2:4) to be
equivalent, the value returned from the __end__ function must be 4
(== numel(obj.x), I think), not 3.
Yes I noticed after I sent my mail. However the indexing like a(1,1:end) or a(1,:) as s.subs in subsref is passed a scalar value and not a vector or matrix as expected.

D.



jwe


--
David Bateman                                address@hidden
35 rue Gambetta +33 1 46 04 02 18 (Home) 92100 Boulogne-Billancourt FRANCE +33 6 72 01 06 33 (Mob)


reply via email to

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