patchGNU Octave - Patches: patch #8725, Overhaul Range object in liboctave

 
 

patch #8725: Overhaul Range object in liboctave

Submitter:  Rik <rik5>
Submitted:  Tue 25 Aug 2015 12:40:50 AM UTC
   
 
Category:  None Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  None Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 25 Aug 2015 12:40:50 AM UTC, original submission:  

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.

Rik <rik5>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #34714:  range_overhaul.cset added by rik5 (6KiB - application/octet-stream)
file #34715:  cpp_range_diary.txt added by rik5 (206B - text/plain)
file #34716:  newrange.cc added by rik5 (929B - text/x-c++src)
file #34717:  new_cpp_range_diary.txt added by rik5 (196B - text/plain)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Submitted the item)
  • -email is unavailable- added by rik5
  • -email is unavailable- added by rik5
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-09-29 rik5 Open/ClosedOpen Closed
    2015-09-29 rik5 StatusNone Done
    2015-08-25 rik5 Attached File- Added range_overhaul.cset, #34714
        Attached File- Added cpp_range_diary.txt, #34715
        Attached File- Added newrange.cc, #34716
        Attached File- Added new_cpp_range_diary.txt, #34717
        Carbon-Copy- Added jwe
        Carbon-Copy- Added godfrey

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code