Mercurial > octave-nkf
view .hgsubstate @ 20548:96153b16febe
Overhaul Range object in liboctave.
* Range.h (Range (b, l), Range (b, l, i)): For 2- or 3-element form of
constructor, set internal rng_limit equal to actual limit of range object.
* Range.h (set_base, set_limit, set_inc): Change to prototypes only.
Implementation moved to Range.cc
* Range.cc (matrix_value): Return rng_base for first element, rng_limit for
last element.
* Range.cc (checkelem, elem, index): Simplify functions by returning rng_limit
for last element.
* Range.cc (sort_internal (bool), sort_internal (Array<octave_idx_t>, bool)):
Simplify functions by simply swapping rng_base and rng_limit when sorting a
range in the opposite direction.
* Range.cc (operator <<): Simplify function by returning rng_limit for last
element.
* Range.cc (operator >>): Fix input stream operator so a correctly sync'ed
range object is created with the correct rng_limit and rng_numel.
* Range.cc (set_base, set_inc): Update rng_numel by calling numel_internal ()
after changing base or increment so that range object is correctly in sync with
itself. Clip rng_limit to true limit of data after base or inc has been set.
* Range.h (set_limit): Update rng_numel after changing internal rng_limit.
Clip rng_limit to actual limit of range object.
author | Rik <rik@octave.org> |
---|---|
date | Fri, 25 Sep 2015 16:15:14 -0700 |
parents | 85d9cb769e8b |
children |