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

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

[Octave-bug-tracker] [bug #45739] sort 'descend' together with vectors c


From: Rik
Subject: [Octave-bug-tracker] [bug #45739] sort 'descend' together with vectors created with the colon operator
Date: Thu, 13 Aug 2015 18:48:02 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:40.0) Gecko/20100101 Firefox/40.0

Update of bug #45739 (project octave):

                  Status:                    None => Confirmed              
        Operating System:       Microsoft Windows => Any                    

    _______________________________________________________

Follow-up Comment #9:

I've added jwe to the CC list for the bug.  This seems important enough that
it should be fixed on the stable branch.

I've made draft changesets of two different approaches.  In range1.cset I
modified the Range constructors in Range.h.  Instead of storing a range limit
which can never be reached, it stores the actual end of range as the range
limit.  In the problem example of 1:2:10 it stores a range limit of 9 rather
than 10.

The second approach in range2.cset modifies Range::sort_internal in Range.cc. 
It takes the same approach in acquiring the true range limit and using it
rather than the limit that was entered at the Octave prompt.

I've tested both with 'make check' and either one will work.  I would say that
range1.cset which makes changes to the constructors might have a greater
possibility of side effects.  But I also think there could be advantages to
storing the true limit rather than the entered one.  There are simplifications
that could be made in some of the other routines once it is guaranteed that
the true limit and rng_limit are synonymous.  The simplifications would
definitely go on the default branch.

The second approach is directly geared to solving the problem with sort().



(file #34637, file #34638)
    _______________________________________________________

Additional Item Attachment:

File name: range1.cset                    Size:1 KB
File name: range2.cset                    Size:0 KB


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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