Mercurial > hg > octave-lyh
annotate liboctave/array/uint16NDArray.h @ 16169:0303fda3e929
Fix range behavior with -0 endpoints (bug #38423)
* libinterp/interpfcn/pr-output.cc(octave_print_internal): print base
or limit of range rather than using expression base+i*increment
which can destroy the signbit of base/limit.
* liboctave/array/Range.cc(Range constructor): Move trivial 2-line constructor
to .h file.
* liboctave/array/Range.cc(matrix_value, checkelem): Return base for first
element of array. Return limit of range for end of array if appropriate.
* liboctave/array/Range.cc(elem): Move function from Range.h Return base for
first element of array. Return limit of range for end of array if appropriate.
* liboctave/array/Range.cc(_rangeindex_helper, index): Return base for first
element of array. Return limit of range for end of array if appropriate.
* liboctave/array/Range.cc(min, max): Use '<=' or '>=' tests to
return base or limit if appropriate.
* liboctave/array/Range.cc(is_sorted): Place more common test first in
if/else if/else tree.
* liboctave/array/Range.cc(operator <<): Return base for first
element of array. Return limit of range for end of array if appropriate.
liboctave/array/Range.h(Range constructor): Put trivial 2-line constructor
in .h file.
liboctave/array/Range.h(elem): Move function which has become more complicated
to Range.cc.
* test/range.tst: Add %!tests for corner cases of base and limit of range.
author | Rik <rik@octave.org> |
---|---|
date | Fri, 01 Mar 2013 14:06:02 -0800 |
parents | 648dabbb4c6b |
children |
rev | line source |
---|---|
4902 | 1 /* |
2 | |
14138
72c96de7a403
maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents:
13012
diff
changeset
|
3 Copyright (C) 2004-2012 John W. Eaton |
4902 | 4 |
5 This file is part of Octave. | |
6 | |
7 Octave is free software; you can redistribute it and/or modify it | |
8 under the terms of the GNU General Public License as published by the | |
7016 | 9 Free Software Foundation; either version 3 of the License, or (at your |
10 option) any later version. | |
4902 | 11 |
12 Octave is distributed in the hope that it will be useful, but WITHOUT | |
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
15 for more details. | |
16 | |
17 You should have received a copy of the GNU General Public License | |
7016 | 18 along with Octave; see the file COPYING. If not, see |
19 <http://www.gnu.org/licenses/>. | |
4902 | 20 |
21 */ | |
22 | |
23 #if !defined (octave_uint16NDArray_h) | |
24 #define octave_uint16NDArray_h 1 | |
25 | |
26 #include "intNDArray.h" | |
8774
b756ce0002db
split implementation and interface in mx-op-defs and MArray-defs
Jaroslav Hajek <highegg@gmail.com>
parents:
7189
diff
changeset
|
27 #include "mx-op-decl.h" |
4902 | 28 #include "oct-inttypes.h" |
9743
26abff55f6fe
optimize bsxfun for common built-in operations
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
29 #include "bsxfun-decl.h" |
4902 | 30 |
31 typedef intNDArray<octave_uint16> uint16NDArray; | |
32 | |
6708 | 33 NDS_CMP_OP_DECLS (uint16NDArray, octave_uint16, OCTAVE_API) |
34 NDS_BOOL_OP_DECLS (uint16NDArray, octave_uint16, OCTAVE_API) | |
4902 | 35 |
6708 | 36 SND_CMP_OP_DECLS (octave_uint16, uint16NDArray, OCTAVE_API) |
37 SND_BOOL_OP_DECLS (octave_uint16, uint16NDArray, OCTAVE_API) | |
4902 | 38 |
6708 | 39 NDND_CMP_OP_DECLS (uint16NDArray, uint16NDArray, OCTAVE_API) |
40 NDND_BOOL_OP_DECLS (uint16NDArray, uint16NDArray, OCTAVE_API) | |
4902 | 41 |
10350
12884915a8e4
merge MArray classes & improve Array interface
Jaroslav Hajek <highegg@gmail.com>
parents:
10329
diff
changeset
|
42 MARRAY_FORWARD_DEFS (MArray, uint16NDArray, octave_uint16) |
4902 | 43 |
10329
83fa590b8a09
simplify min/max definitions in liboctave
Jaroslav Hajek <highegg@gmail.com>
parents:
10158
diff
changeset
|
44 MINMAX_DECLS (uint16NDArray, octave_uint16, OCTAVE_API) |
7189 | 45 |
9743
26abff55f6fe
optimize bsxfun for common built-in operations
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
46 BSXFUN_STDOP_DECLS (uint16NDArray, OCTAVE_API) |
13012
15eefbd9d4e8
Implement a few missing automatic bsxfun power operators
Jordi Gutiérrez Hermoso <jordigh@gmail.com>
parents:
11523
diff
changeset
|
47 BSXFUN_MIXED_INT_DECLS(uint16NDArray, OCTAVE_API) |
9743
26abff55f6fe
optimize bsxfun for common built-in operations
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
48 BSXFUN_STDREL_DECLS (uint16NDArray, OCTAVE_API) |
26abff55f6fe
optimize bsxfun for common built-in operations
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
49 |
4902 | 50 #endif |