Mercurial > octave
comparison liboctave/array/idx-vector.h @ 31204:a81fad5c9fef
idx_vector: Fix wrong length calculation (bug #62968).
* liboctave/array/idx-vector.cc: Fix wrong calculation for m_len in
(start, limit, step) constructor to account for incomplete intervals.
* liboctave/array/idx-vector.h: Add comment to (start, limit, step) constructor.
author | Maged Rifaat <magedrifaat@gmail.com> |
---|---|
date | Sat, 27 Aug 2022 13:41:44 +0200 |
parents | 796f54d4ddbf |
children | e88a07dec498 |
comparison
equal
deleted
inserted
replaced
31203:4c2b83516eb7 | 31204:a81fad5c9fef |
---|---|
169 | 169 |
170 idx_range_rep (octave_idx_type start, octave_idx_type len, | 170 idx_range_rep (octave_idx_type start, octave_idx_type len, |
171 octave_idx_type step, direct) | 171 octave_idx_type step, direct) |
172 : idx_base_rep (), m_start (start), m_len (len), m_step (step) { } | 172 : idx_base_rep (), m_start (start), m_len (len), m_step (step) { } |
173 | 173 |
174 // Zero-based constructor. | 174 // Zero-based constructor for index range starting at `start` (inclusive) |
175 // and ending at `limit` (exclusive) in steps of `step`. | |
175 idx_range_rep (octave_idx_type start, octave_idx_type limit, | 176 idx_range_rep (octave_idx_type start, octave_idx_type limit, |
176 octave_idx_type step); | 177 octave_idx_type step); |
177 | 178 |
178 OCTAVE_API idx_range_rep (const range<double>&); | 179 OCTAVE_API idx_range_rep (const range<double>&); |
179 | 180 |