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

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

[Octave-patch-tracker] [patch #8725] Overhaul Range object in liboctave


From: Rik
Subject: [Octave-patch-tracker] [patch #8725] Overhaul Range object in liboctave
Date: Tue, 25 Aug 2015 00:40:51 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:35.0) Gecko/20100101 Firefox/35.0

URL:
  <http://savannah.gnu.org/patch/?8725>

                 Summary: Overhaul Range object in liboctave
                 Project: GNU Octave
            Submitted by: rik5
            Submitted on: Mon 24 Aug 2015 05:40:50 PM PDT
                Category: None
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

I wrote a patch that overhauls and simplifies the Range object in liboctave by
guaranteeing that the internal rng_limit variable is actually the limit of the
range itself.

For m-file code like 1:2:10 the rng_limit was previously assigned the value 10
which is unreachable, rather than 9 which is the last reachable object. 
Instead of checking this once in the constructor, the existing code requires
that any time the last element is constructed it must be checked to ensure it
doesn't exceed the rng_limit.

Besides that, I found that the existing C++ interface to Range objects could
create range objects that were internally inconsistent with the wrong number
of elements.  I fixed that as well.

The attached newrange.cc is an octfile that I made just for testing the C++
interface.  The results with the old liboctave are in cpp_range_diary.txt and
the new results are in new_cpp_range_diary.txt.  

Since mkoctfile builds against the locally installed liboctave, rather than
the one in the build directory, you need to re-build octave and do 'make
install' and then rebuild newrange.o with mkoctfile before you can truly test
the new code.



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Mon 24 Aug 2015 05:40:50 PM PDT  Name: range_overhaul.cset  Size: 6kB  
By: rik5

<http://savannah.gnu.org/patch/download.php?file_id=34714>
-------------------------------------------------------
Date: Mon 24 Aug 2015 05:40:50 PM PDT  Name: cpp_range_diary.txt  Size: 206B  
By: rik5

<http://savannah.gnu.org/patch/download.php?file_id=34715>
-------------------------------------------------------
Date: Mon 24 Aug 2015 05:40:50 PM PDT  Name: newrange.cc  Size: 929B   By:
rik5

<http://savannah.gnu.org/patch/download.php?file_id=34716>
-------------------------------------------------------
Date: Mon 24 Aug 2015 05:40:50 PM PDT  Name: new_cpp_range_diary.txt  Size:
196B   By: rik5

<http://savannah.gnu.org/patch/download.php?file_id=34717>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/patch/?8725>

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




reply via email to

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