octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #50626] Indexing with "end" does not work for


From: Oliver Heimlich
Subject: [Octave-bug-tracker] [bug #50626] Indexing with "end" does not work for matrices of intervals
Date: Fri, 24 Mar 2017 14:05:17 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0

Follow-up Comment #1, bug #50626 (project octave):

I consider this a bug, but it might be difficult to fix. If you debug
into the subsref method (you can set a break point with `dbstop
@infsup/subsref`), you will see that it is called as if you had written
v(1). That means, Octave somehow evaluates the 1:end expression into 1
before calling the subsref method.

Background information: Classes, which are implemented as m-files, are
represented as “structure arrays” internally (see
https://www.gnu.org/software/octave/doc/interpreter/Structure-Arrays.html
). To avoid a lot of conversion overhead, interval matrices of size m×n
are stored as a 1×1 structure array object with two properties inf and
sup. The properties are matrices, which are of size m×n each. This way,
inf and sup are stored as two matrices. If I hadn't overridden the size
method, Octave would think that this object was of size 1×1. Maybe
Octave uses this (wrong) information when the 1:end expression is
evaluated, which might happen deep into Octave's C++ code where somebody
forgot to call the overridden size or numel methods of the @infsup class.

I have tried to store interval matrices as structure arrays of size m×n,
where each entry stores a scalar inf and sup boundary, but then I would
have to do a lot of conversion during computation and it would have a
big impact on performance.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?50626>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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