Mercurial > octave-nkf
annotate libinterp/octave-value/ov.h @ 19783:c913247c85a8
make colon function work (bug #44290)
* colon.m: Delete.
* scripts/miscellaneous/module.mk: Update.
* data.cc (Fcolon): New function.
* ov.h, ov.cc (do_colon_op): New functions.
* pt-colon.h, pt-colon.cc (tree_colon_expression::make_range): Delete.
(tree_colon_expression::rvalue1): Use do_colon_op instead of make_range.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 18 Feb 2015 17:02:13 -0500 |
parents | 4197fc428c7d |
children | 09ed6f7538dd |
rev | line source |
---|---|
2376 | 1 /* |
2 | |
19731
4197fc428c7d
maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents:
19632
diff
changeset
|
3 Copyright (C) 1996-2015 John W. Eaton |
11523 | 4 Copyright (C) 2009-2010 VZLU Prague |
2376 | 5 |
6 This file is part of Octave. | |
7 | |
8 Octave is free software; you can redistribute it and/or modify it | |
9 under the terms of the GNU General Public License as published by the | |
7016 | 10 Free Software Foundation; either version 3 of the License, or (at your |
11 option) any later version. | |
2376 | 12 |
13 Octave is distributed in the hope that it will be useful, but WITHOUT | |
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
16 for more details. | |
17 | |
18 You should have received a copy of the GNU General Public License | |
7016 | 19 along with Octave; see the file COPYING. If not, see |
20 <http://www.gnu.org/licenses/>. | |
2376 | 21 |
22 */ | |
23 | |
17822
ebb3ef964372
maint: Use common #define syntax "octave_filename_h" in h_files.
Rik <rik@octave.org>
parents:
17787
diff
changeset
|
24 #if !defined (octave_ov_h) |
ebb3ef964372
maint: Use common #define syntax "octave_filename_h" in h_files.
Rik <rik@octave.org>
parents:
17787
diff
changeset
|
25 #define octave_ov_h 1 |
2376 | 26 |
27 #include <cstdlib> | |
28 | |
8950
d865363208d6
include <iosfwd> instead of <iostream> in header files
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
29 #include <iosfwd> |
2376 | 30 #include <string> |
4219 | 31 #include <list> |
2376 | 32 |
33 #include "Range.h" | |
5828 | 34 #include "data-conv.h" |
2376 | 35 #include "idx-vector.h" |
5828 | 36 #include "mach-info.h" |
2376 | 37 #include "mx-base.h" |
4254 | 38 #include "oct-time.h" |
2942 | 39 #include "str-vec.h" |
40 | |
8676 | 41 #include "oct-hdf5.h" |
7433 | 42 #include "oct-sort.h" |
43 | |
3351 | 44 class Cell; |
15149
62a35ae7d6a2
use forward decls for mxArray in ov.h and ov-base.h
John W. Eaton <jwe@octave.org>
parents:
15140
diff
changeset
|
45 class mxArray; |
10742
604e13a89c7f
initial code for structs rewrite
Jaroslav Hajek <highegg@gmail.com>
parents:
10670
diff
changeset
|
46 class octave_map; |
604e13a89c7f
initial code for structs rewrite
Jaroslav Hajek <highegg@gmail.com>
parents:
10670
diff
changeset
|
47 class octave_scalar_map; |
2903 | 48 class octave_stream; |
2974 | 49 class octave_function; |
4700 | 50 class octave_user_function; |
4342 | 51 class octave_fcn_handle; |
4933 | 52 class octave_fcn_inline; |
2376 | 53 class octave_value_list; |
2979 | 54 class octave_lvalue; |
2376 | 55 |
5759 | 56 #include "ov-base.h" |
2376 | 57 |
5759 | 58 // Constants. |
2376 | 59 |
2427 | 60 class octave_value; |
61 | |
2376 | 62 class |
6109 | 63 OCTINTERP_API |
2974 | 64 octave_value |
2376 | 65 { |
66 public: | |
67 | |
3203 | 68 enum unary_op |
69 { | |
6518 | 70 op_not, // not |
71 op_uplus, // uplus | |
72 op_uminus, // uminus | |
73 op_transpose, // transpose | |
74 op_hermitian, // ctranspose | |
3525 | 75 op_incr, |
76 op_decr, | |
3203 | 77 num_unary_ops, |
78 unknown_unary_op | |
79 }; | |
80 | |
2376 | 81 enum binary_op |
82 { | |
6518 | 83 op_add, // plus |
84 op_sub, // minus | |
85 op_mul, // mtimes | |
86 op_div, // mrdivide | |
87 op_pow, // mpower | |
88 op_ldiv, // mldivide | |
3525 | 89 op_lshift, |
90 op_rshift, | |
6518 | 91 op_lt, // lt |
92 op_le, // le | |
93 op_eq, // eq | |
94 op_ge, // ge | |
95 op_gt, // gt | |
96 op_ne, // ne | |
97 op_el_mul, // times | |
98 op_el_div, // rdivide | |
99 op_el_pow, // power | |
100 op_el_ldiv, // ldivide | |
101 op_el_and, // and | |
102 op_el_or, // or | |
3525 | 103 op_struct_ref, |
2376 | 104 num_binary_ops, |
105 unknown_binary_op | |
106 }; | |
107 | |
7800
5861b95e9879
support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
108 enum compound_binary_op |
5861b95e9879
support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
109 { |
5861b95e9879
support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
110 // ** compound operations ** |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
111 op_trans_mul, |
7800
5861b95e9879
support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
112 op_mul_trans, |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
113 op_herm_mul, |
7800
5861b95e9879
support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
114 op_mul_herm, |
9661
afcf852256d2
optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
9657
diff
changeset
|
115 op_trans_ldiv, |
afcf852256d2
optimize / and '\ for triangular matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
9657
diff
changeset
|
116 op_herm_ldiv, |
8982
dc6bda6f9994
implement compound logical ops
Jaroslav Hajek <highegg@gmail.com>
parents:
8960
diff
changeset
|
117 op_el_not_and, |
dc6bda6f9994
implement compound logical ops
Jaroslav Hajek <highegg@gmail.com>
parents:
8960
diff
changeset
|
118 op_el_not_or, |
dc6bda6f9994
implement compound logical ops
Jaroslav Hajek <highegg@gmail.com>
parents:
8960
diff
changeset
|
119 op_el_and_not, |
dc6bda6f9994
implement compound logical ops
Jaroslav Hajek <highegg@gmail.com>
parents:
8960
diff
changeset
|
120 op_el_or_not, |
7800
5861b95e9879
support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
121 num_compound_binary_ops, |
5861b95e9879
support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
122 unknown_compound_binary_op |
5861b95e9879
support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
123 }; |
5861b95e9879
support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
124 |
2880 | 125 enum assign_op |
126 { | |
3525 | 127 op_asn_eq, |
128 op_add_eq, | |
129 op_sub_eq, | |
130 op_mul_eq, | |
131 op_div_eq, | |
132 op_ldiv_eq, | |
4018 | 133 op_pow_eq, |
3525 | 134 op_lshift_eq, |
135 op_rshift_eq, | |
136 op_el_mul_eq, | |
137 op_el_div_eq, | |
138 op_el_ldiv_eq, | |
4018 | 139 op_el_pow_eq, |
3525 | 140 op_el_and_eq, |
141 op_el_or_eq, | |
2880 | 142 num_assign_ops, |
143 unknown_assign_op | |
144 }; | |
145 | |
15140
6ea86e1d0f5f
Support +=, -=, *=, ect. in JIT
Max Brister <max@2bass.com>
parents:
15057
diff
changeset
|
146 static binary_op assign_op_to_binary_op (assign_op); |
6ea86e1d0f5f
Support +=, -=, *=, ect. in JIT
Max Brister <max@2bass.com>
parents:
15057
diff
changeset
|
147 |
9607
1be3c73ed7b5
reuse temporary arrays in nested expressions
Jaroslav Hajek <highegg@gmail.com>
parents:
9521
diff
changeset
|
148 static assign_op binary_op_to_assign_op (binary_op); |
1be3c73ed7b5
reuse temporary arrays in nested expressions
Jaroslav Hajek <highegg@gmail.com>
parents:
9521
diff
changeset
|
149 |
3523 | 150 static std::string unary_op_as_string (unary_op); |
7336 | 151 static std::string unary_op_fcn_name (unary_op); |
3203 | 152 |
3523 | 153 static std::string binary_op_as_string (binary_op); |
7336 | 154 static std::string binary_op_fcn_name (binary_op); |
2376 | 155 |
7800
5861b95e9879
support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
156 static std::string binary_op_fcn_name (compound_binary_op); |
5861b95e9879
support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
157 |
3523 | 158 static std::string assign_op_as_string (assign_op); |
2880 | 159 |
3933 | 160 static octave_value empty_conv (const std::string& type, |
10313 | 161 const octave_value& rhs = octave_value ()); |
3933 | 162 |
2376 | 163 enum magic_colon { magic_colon_t }; |
164 | |
8992
d12f44a5dce3
implement fast octave_value constructor
Jaroslav Hajek <highegg@gmail.com>
parents:
8982
diff
changeset
|
165 octave_value (void) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
166 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
167 static octave_base_value nil_rep; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
168 rep = &nil_rep; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
169 rep->count++; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
170 } |
8992
d12f44a5dce3
implement fast octave_value constructor
Jaroslav Hajek <highegg@gmail.com>
parents:
8982
diff
changeset
|
171 |
4254 | 172 octave_value (short int i); |
173 octave_value (unsigned short int i); | |
4233 | 174 octave_value (int i); |
4254 | 175 octave_value (unsigned int i); |
176 octave_value (long int i); | |
177 octave_value (unsigned long int i); | |
4353 | 178 |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
179 // FIXME: these are kluges. They turn into doubles |
4353 | 180 // internally, which will break for very large values. We just use |
181 // them to store things like 64-bit ino_t, etc, and hope that those | |
182 // values are never actually larger than can be represented exactly | |
183 // in a double. | |
184 | |
185 #if defined (HAVE_LONG_LONG_INT) | |
186 octave_value (long long int i); | |
187 #endif | |
4356 | 188 #if defined (HAVE_UNSIGNED_LONG_LONG_INT) |
4353 | 189 octave_value (unsigned long long int i); |
190 #endif | |
191 | |
4254 | 192 octave_value (octave_time t); |
2376 | 193 octave_value (double d); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
194 octave_value (float d); |
9732
b4fdfee405b5
remove ArrayN<T> + fix nonhom. diag-scalar ops
Jaroslav Hajek <highegg@gmail.com>
parents:
9728
diff
changeset
|
195 octave_value (const Array<octave_value>& a, bool is_cs_list = false); |
4532 | 196 octave_value (const Cell& c, bool is_cs_list = false); |
14846
460a3c6d8bf1
maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents:
14770
diff
changeset
|
197 octave_value (const Matrix& m, const MatrixType& t = MatrixType ()); |
460a3c6d8bf1
maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents:
14770
diff
changeset
|
198 octave_value (const FloatMatrix& m, const MatrixType& t = MatrixType ()); |
4513 | 199 octave_value (const NDArray& nda); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
200 octave_value (const FloatNDArray& nda); |
9732
b4fdfee405b5
remove ArrayN<T> + fix nonhom. diag-scalar ops
Jaroslav Hajek <highegg@gmail.com>
parents:
9728
diff
changeset
|
201 octave_value (const Array<double>& m); |
b4fdfee405b5
remove ArrayN<T> + fix nonhom. diag-scalar ops
Jaroslav Hajek <highegg@gmail.com>
parents:
9728
diff
changeset
|
202 octave_value (const Array<float>& m); |
2376 | 203 octave_value (const DiagMatrix& d); |
15428
fd5c0159b588
Fix diag handling of diagvectors (bug #37411)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
14138
diff
changeset
|
204 octave_value (const DiagArray2<double>& d); |
fd5c0159b588
Fix diag handling of diagvectors (bug #37411)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
14138
diff
changeset
|
205 octave_value (const DiagArray2<float>& d); |
fd5c0159b588
Fix diag handling of diagvectors (bug #37411)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
14138
diff
changeset
|
206 octave_value (const DiagArray2<Complex>& d); |
fd5c0159b588
Fix diag handling of diagvectors (bug #37411)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents:
14138
diff
changeset
|
207 octave_value (const DiagArray2<FloatComplex>& d); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
208 octave_value (const FloatDiagMatrix& d); |
3418 | 209 octave_value (const RowVector& v); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
210 octave_value (const FloatRowVector& v); |
3418 | 211 octave_value (const ColumnVector& v); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
212 octave_value (const FloatColumnVector& v); |
2376 | 213 octave_value (const Complex& C); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
214 octave_value (const FloatComplex& C); |
14846
460a3c6d8bf1
maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents:
14770
diff
changeset
|
215 octave_value (const ComplexMatrix& m, const MatrixType& t = MatrixType ()); |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
216 octave_value (const FloatComplexMatrix& m, |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
217 const MatrixType& t = MatrixType ()); |
4513 | 218 octave_value (const ComplexNDArray& cnda); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
219 octave_value (const FloatComplexNDArray& cnda); |
9732
b4fdfee405b5
remove ArrayN<T> + fix nonhom. diag-scalar ops
Jaroslav Hajek <highegg@gmail.com>
parents:
9728
diff
changeset
|
220 octave_value (const Array<Complex>& m); |
b4fdfee405b5
remove ArrayN<T> + fix nonhom. diag-scalar ops
Jaroslav Hajek <highegg@gmail.com>
parents:
9728
diff
changeset
|
221 octave_value (const Array<FloatComplex>& m); |
2376 | 222 octave_value (const ComplexDiagMatrix& d); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
223 octave_value (const FloatComplexDiagMatrix& d); |
3418 | 224 octave_value (const ComplexRowVector& v); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
225 octave_value (const FloatComplexRowVector& v); |
3418 | 226 octave_value (const ComplexColumnVector& v); |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
227 octave_value (const FloatComplexColumnVector& v); |
8960
93f18f166aba
remove float perm matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
8950
diff
changeset
|
228 octave_value (const PermMatrix& p); |
2825 | 229 octave_value (bool b); |
14846
460a3c6d8bf1
maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents:
14770
diff
changeset
|
230 octave_value (const boolMatrix& bm, const MatrixType& t = MatrixType ()); |
4513 | 231 octave_value (const boolNDArray& bnda); |
9732
b4fdfee405b5
remove ArrayN<T> + fix nonhom. diag-scalar ops
Jaroslav Hajek <highegg@gmail.com>
parents:
9728
diff
changeset
|
232 octave_value (const Array<bool>& bnda); |
9689
34d6f005db4b
eliminate is_string argument from octave_value character array constructors
John W. Eaton <jwe@octave.org>
parents:
9685
diff
changeset
|
233 octave_value (char c, char type = '\''); |
34d6f005db4b
eliminate is_string argument from octave_value character array constructors
John W. Eaton <jwe@octave.org>
parents:
9685
diff
changeset
|
234 octave_value (const char *s, char type = '\''); |
34d6f005db4b
eliminate is_string argument from octave_value character array constructors
John W. Eaton <jwe@octave.org>
parents:
9685
diff
changeset
|
235 octave_value (const std::string& s, char type = '\''); |
34d6f005db4b
eliminate is_string argument from octave_value character array constructors
John W. Eaton <jwe@octave.org>
parents:
9685
diff
changeset
|
236 octave_value (const string_vector& s, char type = '\''); |
10313 | 237 octave_value (const charMatrix& chm, char type = '\''); |
9689
34d6f005db4b
eliminate is_string argument from octave_value character array constructors
John W. Eaton <jwe@octave.org>
parents:
9685
diff
changeset
|
238 octave_value (const charNDArray& chnda, char type = '\''); |
9732
b4fdfee405b5
remove ArrayN<T> + fix nonhom. diag-scalar ops
Jaroslav Hajek <highegg@gmail.com>
parents:
9728
diff
changeset
|
239 octave_value (const Array<char>& chnda, char type = '\''); |
9689
34d6f005db4b
eliminate is_string argument from octave_value character array constructors
John W. Eaton <jwe@octave.org>
parents:
9685
diff
changeset
|
240 octave_value (const charMatrix& chm, bool is_string, |
10313 | 241 char type = '\'') GCC_ATTR_DEPRECATED; |
9689
34d6f005db4b
eliminate is_string argument from octave_value character array constructors
John W. Eaton <jwe@octave.org>
parents:
9685
diff
changeset
|
242 octave_value (const charNDArray& chnda, bool is_string, |
10313 | 243 char type = '\'') GCC_ATTR_DEPRECATED; |
9732
b4fdfee405b5
remove ArrayN<T> + fix nonhom. diag-scalar ops
Jaroslav Hajek <highegg@gmail.com>
parents:
9728
diff
changeset
|
244 octave_value (const Array<char>& chnda, bool is_string, |
10313 | 245 char type = '\'') GCC_ATTR_DEPRECATED; |
5785 | 246 octave_value (const SparseMatrix& m, const MatrixType& t = MatrixType ()); |
6863 | 247 octave_value (const Sparse<double>& m, const MatrixType& t = MatrixType ()); |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
248 octave_value (const SparseComplexMatrix& m, |
10313 | 249 const MatrixType& t = MatrixType ()); |
6863 | 250 octave_value (const Sparse<Complex>& m, const MatrixType& t = MatrixType ()); |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
251 octave_value (const SparseBoolMatrix& bm, |
10313 | 252 const MatrixType& t = MatrixType ()); |
7433 | 253 octave_value (const Sparse<bool>& m, const MatrixType& t = MatrixType ()); |
4901 | 254 octave_value (const octave_int8& i); |
4910 | 255 octave_value (const octave_int16& i); |
256 octave_value (const octave_int32& i); | |
257 octave_value (const octave_int64& i); | |
4901 | 258 octave_value (const octave_uint8& i); |
259 octave_value (const octave_uint16& i); | |
260 octave_value (const octave_uint32& i); | |
261 octave_value (const octave_uint64& i); | |
262 octave_value (const int8NDArray& inda); | |
9732
b4fdfee405b5
remove ArrayN<T> + fix nonhom. diag-scalar ops
Jaroslav Hajek <highegg@gmail.com>
parents:
9728
diff
changeset
|
263 octave_value (const Array<octave_int8>& inda); |
4910 | 264 octave_value (const int16NDArray& inda); |
9732
b4fdfee405b5
remove ArrayN<T> + fix nonhom. diag-scalar ops
Jaroslav Hajek <highegg@gmail.com>
parents:
9728
diff
changeset
|
265 octave_value (const Array<octave_int16>& inda); |
4910 | 266 octave_value (const int32NDArray& inda); |
9732
b4fdfee405b5
remove ArrayN<T> + fix nonhom. diag-scalar ops
Jaroslav Hajek <highegg@gmail.com>
parents:
9728
diff
changeset
|
267 octave_value (const Array<octave_int32>& inda); |
4910 | 268 octave_value (const int64NDArray& inda); |
9732
b4fdfee405b5
remove ArrayN<T> + fix nonhom. diag-scalar ops
Jaroslav Hajek <highegg@gmail.com>
parents:
9728
diff
changeset
|
269 octave_value (const Array<octave_int64>& inda); |
4901 | 270 octave_value (const uint8NDArray& inda); |
9732
b4fdfee405b5
remove ArrayN<T> + fix nonhom. diag-scalar ops
Jaroslav Hajek <highegg@gmail.com>
parents:
9728
diff
changeset
|
271 octave_value (const Array<octave_uint8>& inda); |
4901 | 272 octave_value (const uint16NDArray& inda); |
9732
b4fdfee405b5
remove ArrayN<T> + fix nonhom. diag-scalar ops
Jaroslav Hajek <highegg@gmail.com>
parents:
9728
diff
changeset
|
273 octave_value (const Array<octave_uint16>& inda); |
4901 | 274 octave_value (const uint32NDArray& inda); |
9732
b4fdfee405b5
remove ArrayN<T> + fix nonhom. diag-scalar ops
Jaroslav Hajek <highegg@gmail.com>
parents:
9728
diff
changeset
|
275 octave_value (const Array<octave_uint32>& inda); |
4901 | 276 octave_value (const uint64NDArray& inda); |
9732
b4fdfee405b5
remove ArrayN<T> + fix nonhom. diag-scalar ops
Jaroslav Hajek <highegg@gmail.com>
parents:
9728
diff
changeset
|
277 octave_value (const Array<octave_uint64>& inda); |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
278 octave_value (const Array<octave_idx_type>& inda, |
9351
e2344f4af0cb
autocache indices returned from find et al.
Jaroslav Hajek <highegg@gmail.com>
parents:
9329
diff
changeset
|
279 bool zero_based = false, bool cache_index = false); |
9725 | 280 octave_value (const Array<std::string>& cellstr); |
10325
8b3cfc1288e2
implement lazy index conversions
Jaroslav Hajek <highegg@gmail.com>
parents:
10313
diff
changeset
|
281 octave_value (const idx_vector& idx, bool lazy = true); |
2376 | 282 octave_value (double base, double limit, double inc); |
19428
b39cbe9f3bb0
allow ranges to be disabled
John W. Eaton <jwe@octave.org>
parents:
19144
diff
changeset
|
283 octave_value (const Range& r, bool force_range = false); |
10742
604e13a89c7f
initial code for structs rewrite
Jaroslav Hajek <highegg@gmail.com>
parents:
10670
diff
changeset
|
284 octave_value (const octave_map& m); |
604e13a89c7f
initial code for structs rewrite
Jaroslav Hajek <highegg@gmail.com>
parents:
10670
diff
changeset
|
285 octave_value (const octave_scalar_map& m); |
18402
4c064d3d2750
Remove Octave_map class deprecated in 3.8.
Rik <rik@octave.org>
parents:
18129
diff
changeset
|
286 octave_value (const octave_map& m, const std::string& id, |
4c064d3d2750
Remove Octave_map class deprecated in 3.8.
Rik <rik@octave.org>
parents:
18129
diff
changeset
|
287 const std::list<std::string>& plist); |
4c064d3d2750
Remove Octave_map class deprecated in 3.8.
Rik <rik@octave.org>
parents:
18129
diff
changeset
|
288 octave_value (const octave_scalar_map& m, const std::string& id, |
13874
c1b754d93572
copy parent class info when performing operations on class objects
John W. Eaton <jwe@octave.org>
parents:
13736
diff
changeset
|
289 const std::list<std::string>& plist); |
10293 | 290 octave_value (const octave_value_list& m, bool = false); |
2376 | 291 octave_value (octave_value::magic_colon); |
292 | |
9728
70925b11ba46
again allow the obsolete syntax for cellfun
Jaroslav Hajek <highegg@gmail.com>
parents:
9725
diff
changeset
|
293 octave_value (octave_base_value *new_rep, bool borrow = false); |
70925b11ba46
again allow the obsolete syntax for cellfun
Jaroslav Hajek <highegg@gmail.com>
parents:
9725
diff
changeset
|
294 octave_value (octave_base_value *new_rep, int xcount) GCC_ATTR_DEPRECATED; |
2376 | 295 |
296 // Copy constructor. | |
297 | |
298 octave_value (const octave_value& a) | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
299 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
300 rep = a.rep; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
301 rep->count++; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
302 } |
2376 | 303 |
3933 | 304 // This should only be called for derived types. |
305 | |
5759 | 306 octave_base_value *clone (void) const; |
3933 | 307 |
5759 | 308 octave_base_value *empty_clone (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
309 { return rep->empty_clone (); } |
3933 | 310 |
2376 | 311 // Delete the representation of this constant if the count drops to |
312 // zero. | |
313 | |
6338 | 314 ~octave_value (void) |
315 { | |
316 if (--rep->count == 0) | |
317 delete rep; | |
318 } | |
2376 | 319 |
320 void make_unique (void) | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
321 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
322 if (rep->count > 1) |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
323 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
324 octave_base_value *r = rep->unique_clone (); |
13985
43cc49c7abd1
Use thread-safe atomic reference counting (GCC and MSVC).
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13874
diff
changeset
|
325 |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
326 if (--rep->count == 0) |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
327 delete rep; |
13985
43cc49c7abd1
Use thread-safe atomic reference counting (GCC and MSVC).
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13874
diff
changeset
|
328 |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
329 rep = r; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
330 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
331 } |
2376 | 332 |
8546
3d8a914c580e
improve parser indexed assigment code
Jaroslav Hajek <highegg@gmail.com>
parents:
8531
diff
changeset
|
333 // This uniquifies the value if it is referenced by more than a certain |
3d8a914c580e
improve parser indexed assigment code
Jaroslav Hajek <highegg@gmail.com>
parents:
8531
diff
changeset
|
334 // number of shallow copies. This is useful for optimizations where we |
3d8a914c580e
improve parser indexed assigment code
Jaroslav Hajek <highegg@gmail.com>
parents:
8531
diff
changeset
|
335 // know a certain copy, typically within a cell array, to be obsolete. |
3d8a914c580e
improve parser indexed assigment code
Jaroslav Hajek <highegg@gmail.com>
parents:
8531
diff
changeset
|
336 void make_unique (int obsolete_copies) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
337 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
338 if (rep->count > obsolete_copies + 1) |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
339 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
340 octave_base_value *r = rep->unique_clone (); |
13985
43cc49c7abd1
Use thread-safe atomic reference counting (GCC and MSVC).
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13874
diff
changeset
|
341 |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
342 if (--rep->count == 0) |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
343 delete rep; |
13985
43cc49c7abd1
Use thread-safe atomic reference counting (GCC and MSVC).
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13874
diff
changeset
|
344 |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
345 rep = r; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
346 } |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
347 } |
8546
3d8a914c580e
improve parser indexed assigment code
Jaroslav Hajek <highegg@gmail.com>
parents:
8531
diff
changeset
|
348 |
2376 | 349 // Simple assignment. |
350 | |
351 octave_value& operator = (const octave_value& a) | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
352 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
353 if (rep != a.rep) |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
354 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
355 if (--rep->count == 0) |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
356 delete rep; |
2376 | 357 |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
358 rep = a.rep; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
359 rep->count++; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
360 } |
2376 | 361 |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
362 return *this; |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
363 } |
2376 | 364 |
9703
9a5598cf899d
octave_value::get_count: return octave_idx_type, not int
John W. Eaton <jwe@octave.org>
parents:
9689
diff
changeset
|
365 octave_idx_type get_count (void) const { return rep->count; } |
3239 | 366 |
8345
c777f3ce02d8
smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
367 octave_base_value::type_conv_info numeric_conversion_function (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
368 { return rep->numeric_conversion_function (); } |
2376 | 369 |
8345
c777f3ce02d8
smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
370 octave_base_value::type_conv_info numeric_demotion_function (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
371 { return rep->numeric_demotion_function (); } |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
372 |
2409 | 373 void maybe_mutate (void); |
374 | |
5759 | 375 octave_value squeeze (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
376 { return rep->squeeze (); } |
4532 | 377 |
8458
d254a21e0120
reimplement full as method of octave_base_value
Jaroslav Hajek <highegg@gmail.com>
parents:
8456
diff
changeset
|
378 // The result of full(). |
d254a21e0120
reimplement full as method of octave_base_value
Jaroslav Hajek <highegg@gmail.com>
parents:
8456
diff
changeset
|
379 octave_value full_value (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
380 { return rep->full_value (); } |
8458
d254a21e0120
reimplement full as method of octave_base_value
Jaroslav Hajek <highegg@gmail.com>
parents:
8456
diff
changeset
|
381 |
5759 | 382 octave_base_value *try_narrowing_conversion (void) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
383 { return rep->try_narrowing_conversion (); } |
2409 | 384 |
9329
67fc970dad7d
improve indexed assignment using indexed numel
Jaroslav Hajek <highegg@gmail.com>
parents:
9151
diff
changeset
|
385 // Close to dims (), but can be overloaded for classes. |
67fc970dad7d
improve indexed assignment using indexed numel
Jaroslav Hajek <highegg@gmail.com>
parents:
9151
diff
changeset
|
386 Matrix size (void) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
387 { return rep->size (); } |
9329
67fc970dad7d
improve indexed assignment using indexed numel
Jaroslav Hajek <highegg@gmail.com>
parents:
9151
diff
changeset
|
388 |
67fc970dad7d
improve indexed assignment using indexed numel
Jaroslav Hajek <highegg@gmail.com>
parents:
9151
diff
changeset
|
389 octave_idx_type numel (const octave_value_list& idx) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
390 { return rep->numel (idx); } |
9329
67fc970dad7d
improve indexed assignment using indexed numel
Jaroslav Hajek <highegg@gmail.com>
parents:
9151
diff
changeset
|
391 |
4271 | 392 octave_value single_subsref (const std::string& type, |
10313 | 393 const octave_value_list& idx); |
4271 | 394 |
5759 | 395 octave_value subsref (const std::string& type, |
8551
906f976d35a8
further improve struct&cell indexing & indexed assignment
Jaroslav Hajek <highegg@gmail.com>
parents:
8546
diff
changeset
|
396 const std::list<octave_value_list>& idx) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
397 { return rep->subsref (type, idx); } |
3933 | 398 |
8551
906f976d35a8
further improve struct&cell indexing & indexed assignment
Jaroslav Hajek <highegg@gmail.com>
parents:
8546
diff
changeset
|
399 octave_value subsref (const std::string& type, |
906f976d35a8
further improve struct&cell indexing & indexed assignment
Jaroslav Hajek <highegg@gmail.com>
parents:
8546
diff
changeset
|
400 const std::list<octave_value_list>& idx, |
906f976d35a8
further improve struct&cell indexing & indexed assignment
Jaroslav Hajek <highegg@gmail.com>
parents:
8546
diff
changeset
|
401 bool auto_add) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
402 { return rep->subsref (type, idx, auto_add); } |
8551
906f976d35a8
further improve struct&cell indexing & indexed assignment
Jaroslav Hajek <highegg@gmail.com>
parents:
8546
diff
changeset
|
403 |
5759 | 404 octave_value_list subsref (const std::string& type, |
8551
906f976d35a8
further improve struct&cell indexing & indexed assignment
Jaroslav Hajek <highegg@gmail.com>
parents:
8546
diff
changeset
|
405 const std::list<octave_value_list>& idx, |
906f976d35a8
further improve struct&cell indexing & indexed assignment
Jaroslav Hajek <highegg@gmail.com>
parents:
8546
diff
changeset
|
406 int nargout); |
3933 | 407 |
10832
1b2fcd122c6a
allow user detect ignored outputs in m-functions
Jaroslav Hajek <highegg@gmail.com>
parents:
10768
diff
changeset
|
408 octave_value_list subsref (const std::string& type, |
1b2fcd122c6a
allow user detect ignored outputs in m-functions
Jaroslav Hajek <highegg@gmail.com>
parents:
10768
diff
changeset
|
409 const std::list<octave_value_list>& idx, |
1b2fcd122c6a
allow user detect ignored outputs in m-functions
Jaroslav Hajek <highegg@gmail.com>
parents:
10768
diff
changeset
|
410 int nargout, |
1b2fcd122c6a
allow user detect ignored outputs in m-functions
Jaroslav Hajek <highegg@gmail.com>
parents:
10768
diff
changeset
|
411 const std::list<octave_lvalue> *lvalue_list); |
1b2fcd122c6a
allow user detect ignored outputs in m-functions
Jaroslav Hajek <highegg@gmail.com>
parents:
10768
diff
changeset
|
412 |
4247 | 413 octave_value next_subsref (const std::string& type, const |
10313 | 414 std::list<octave_value_list>& idx, |
415 size_t skip = 1); | |
3933 | 416 |
4994 | 417 octave_value_list next_subsref (int nargout, |
10313 | 418 const std::string& type, const |
419 std::list<octave_value_list>& idx, | |
420 size_t skip = 1); | |
4994 | 421 |
16091
1785493171ac
pass lvalue_list to more subsref calls (bug #38374)
John W. Eaton <jwe@octave.org>
parents:
15770
diff
changeset
|
422 octave_value_list next_subsref (int nargout, |
1785493171ac
pass lvalue_list to more subsref calls (bug #38374)
John W. Eaton <jwe@octave.org>
parents:
15770
diff
changeset
|
423 const std::string& type, const |
1785493171ac
pass lvalue_list to more subsref calls (bug #38374)
John W. Eaton <jwe@octave.org>
parents:
15770
diff
changeset
|
424 std::list<octave_value_list>& idx, |
1785493171ac
pass lvalue_list to more subsref calls (bug #38374)
John W. Eaton <jwe@octave.org>
parents:
15770
diff
changeset
|
425 const std::list<octave_lvalue> *lvalue_list, |
1785493171ac
pass lvalue_list to more subsref calls (bug #38374)
John W. Eaton <jwe@octave.org>
parents:
15770
diff
changeset
|
426 size_t skip = 1); |
1785493171ac
pass lvalue_list to more subsref calls (bug #38374)
John W. Eaton <jwe@octave.org>
parents:
15770
diff
changeset
|
427 |
8551
906f976d35a8
further improve struct&cell indexing & indexed assignment
Jaroslav Hajek <highegg@gmail.com>
parents:
8546
diff
changeset
|
428 octave_value next_subsref (bool auto_add, const std::string& type, const |
10313 | 429 std::list<octave_value_list>& idx, |
430 size_t skip = 1); | |
8551
906f976d35a8
further improve struct&cell indexing & indexed assignment
Jaroslav Hajek <highegg@gmail.com>
parents:
8546
diff
changeset
|
431 |
5759 | 432 octave_value do_index_op (const octave_value_list& idx, |
10313 | 433 bool resize_ok = false) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
434 { return rep->do_index_op (idx, resize_ok); } |
3933 | 435 |
5759 | 436 octave_value_list |
3544 | 437 do_multi_index_op (int nargout, const octave_value_list& idx); |
2974 | 438 |
10832
1b2fcd122c6a
allow user detect ignored outputs in m-functions
Jaroslav Hajek <highegg@gmail.com>
parents:
10768
diff
changeset
|
439 octave_value_list |
1b2fcd122c6a
allow user detect ignored outputs in m-functions
Jaroslav Hajek <highegg@gmail.com>
parents:
10768
diff
changeset
|
440 do_multi_index_op (int nargout, const octave_value_list& idx, |
1b2fcd122c6a
allow user detect ignored outputs in m-functions
Jaroslav Hajek <highegg@gmail.com>
parents:
10768
diff
changeset
|
441 const std::list<octave_lvalue> *lvalue_list); |
1b2fcd122c6a
allow user detect ignored outputs in m-functions
Jaroslav Hajek <highegg@gmail.com>
parents:
10768
diff
changeset
|
442 |
5759 | 443 octave_value subsasgn (const std::string& type, |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
444 const std::list<octave_value_list>& idx, |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
445 const octave_value& rhs); |
2376 | 446 |
12171
d08901c05c1b
fix bug in class assignment to undefined object with index
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
447 octave_value undef_subsasgn (const std::string& type, |
d08901c05c1b
fix bug in class assignment to undefined object with index
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
448 const std::list<octave_value_list>& idx, |
d08901c05c1b
fix bug in class assignment to undefined object with index
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
449 const octave_value& rhs); |
d08901c05c1b
fix bug in class assignment to undefined object with index
John W. Eaton <jwe@octave.org>
parents:
11586
diff
changeset
|
450 |
10544
9961fc022d9d
fix assignment to non-existing variables and octave_value::assign
Jaroslav Hajek <highegg@gmail.com>
parents:
10521
diff
changeset
|
451 octave_value& assign (assign_op op, const std::string& type, |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
452 const std::list<octave_value_list>& idx, |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
453 const octave_value& rhs); |
2948 | 454 |
10544
9961fc022d9d
fix assignment to non-existing variables and octave_value::assign
Jaroslav Hajek <highegg@gmail.com>
parents:
10521
diff
changeset
|
455 octave_value& assign (assign_op, const octave_value& rhs); |
2948 | 456 |
18129
e473c4853afc
enable non-integer ranges as indices by default and deprecate preference
John W. Eaton <jwe@octave.org>
parents:
17870
diff
changeset
|
457 idx_vector index_vector (bool require_integers = false) const |
e473c4853afc
enable non-integer ranges as indices by default and deprecate preference
John W. Eaton <jwe@octave.org>
parents:
17870
diff
changeset
|
458 { |
e473c4853afc
enable non-integer ranges as indices by default and deprecate preference
John W. Eaton <jwe@octave.org>
parents:
17870
diff
changeset
|
459 return rep->index_vector (require_integers); |
e473c4853afc
enable non-integer ranges as indices by default and deprecate preference
John W. Eaton <jwe@octave.org>
parents:
17870
diff
changeset
|
460 } |
2376 | 461 |
462 // Size. | |
463 | |
5759 | 464 dim_vector dims (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
465 { return rep->dims (); } |
4513 | 466 |
5759 | 467 octave_idx_type rows (void) const { return rep->rows (); } |
4563 | 468 |
5759 | 469 octave_idx_type columns (void) const { return rep->columns (); } |
3195 | 470 |
5275 | 471 octave_idx_type length (void) const; |
4554 | 472 |
5759 | 473 int ndims (void) const { return rep->ndims (); } |
4563 | 474 |
14846
460a3c6d8bf1
maint: Use Octave coding convention for cuddled parenthis in function calls with empty argument lists.
Rik <octave@nomad.inbox5.com>
parents:
14770
diff
changeset
|
475 bool all_zero_dims (void) const { return dims ().all_zero (); } |
5164 | 476 |
5759 | 477 octave_idx_type numel (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
478 { return rep->numel (); } |
4559 | 479 |
5759 | 480 octave_idx_type capacity (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
481 { return rep->capacity (); } |
5164 | 482 |
5759 | 483 size_t byte_size (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
484 { return rep->byte_size (); } |
4791 | 485 |
5759 | 486 octave_idx_type nnz (void) const { return rep->nnz (); } |
5602 | 487 |
5759 | 488 octave_idx_type nzmax (void) const { return rep->nzmax (); } |
5604 | 489 |
5900 | 490 octave_idx_type nfields (void) const { return rep->nfields (); } |
491 | |
5759 | 492 octave_value reshape (const dim_vector& dv) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
493 { return rep->reshape (dv); } |
4567 | 494 |
5759 | 495 octave_value permute (const Array<int>& vec, bool inv = false) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
496 { return rep->permute (vec, inv); } |
4593 | 497 |
498 octave_value ipermute (const Array<int>& vec) const | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
499 { return rep->permute (vec, true); } |
4593 | 500 |
5759 | 501 octave_value resize (const dim_vector& dv, bool fill = false) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
502 { return rep->resize (dv, fill);} |
4915 | 503 |
5785 | 504 MatrixType matrix_type (void) const |
505 { return rep->matrix_type (); } | |
506 | |
507 MatrixType matrix_type (const MatrixType& typ) const | |
508 { return rep->matrix_type (typ); } | |
509 | |
2376 | 510 // Does this constant have a type? Both of these are provided since |
511 // it is sometimes more natural to write is_undefined() instead of | |
512 // ! is_defined(). | |
513 | |
5759 | 514 bool is_defined (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
515 { return rep->is_defined (); } |
2376 | 516 |
517 bool is_undefined (void) const | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
518 { return ! is_defined (); } |
2376 | 519 |
4559 | 520 bool is_empty (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
521 { return rep->is_empty (); } |
4559 | 522 |
5759 | 523 bool is_cell (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
524 { return rep->is_cell (); } |
3351 | 525 |
6116 | 526 bool is_cellstr (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
527 { return rep->is_cellstr (); } |
6116 | 528 |
5759 | 529 bool is_real_scalar (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
530 { return rep->is_real_scalar (); } |
2376 | 531 |
5759 | 532 bool is_real_matrix (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
533 { return rep->is_real_matrix (); } |
2376 | 534 |
5759 | 535 bool is_complex_scalar (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
536 { return rep->is_complex_scalar (); } |
2376 | 537 |
5759 | 538 bool is_complex_matrix (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
539 { return rep->is_complex_matrix (); } |
2376 | 540 |
5881 | 541 bool is_bool_scalar (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
542 { return rep->is_bool_scalar (); } |
5881 | 543 |
5759 | 544 bool is_bool_matrix (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
545 { return rep->is_bool_matrix (); } |
4587 | 546 |
5759 | 547 bool is_char_matrix (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
548 { return rep->is_char_matrix (); } |
2376 | 549 |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8346
diff
changeset
|
550 bool is_diag_matrix (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
551 { return rep->is_diag_matrix (); } |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8346
diff
changeset
|
552 |
8371
c3f7e2549abb
make det & inv aware of diagonal & permutation matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
8367
diff
changeset
|
553 bool is_perm_matrix (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
554 { return rep->is_perm_matrix (); } |
8371
c3f7e2549abb
make det & inv aware of diagonal & permutation matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
8367
diff
changeset
|
555 |
5759 | 556 bool is_string (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
557 { return rep->is_string (); } |
2376 | 558 |
5759 | 559 bool is_sq_string (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
560 { return rep->is_sq_string (); } |
5279 | 561 |
5280 | 562 bool is_dq_string (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
563 { return rep->is_string () && ! rep->is_sq_string (); } |
5280 | 564 |
5759 | 565 bool is_range (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
566 { return rep->is_range (); } |
2376 | 567 |
5759 | 568 bool is_map (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
569 { return rep->is_map (); } |
2376 | 570 |
7336 | 571 bool is_object (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
572 { return rep->is_object (); } |
7336 | 573 |
19144
fa48651fbb8a
isstruct for classdef objects should not return true.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
19137
diff
changeset
|
574 bool is_classdef_object (void) const |
fa48651fbb8a
isstruct for classdef objects should not return true.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
19137
diff
changeset
|
575 { return rep->is_classdef_object (); } |
fa48651fbb8a
isstruct for classdef objects should not return true.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
19137
diff
changeset
|
576 |
15770 | 577 bool is_java (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
578 { return rep->is_java (); } |
15770 | 579 |
5759 | 580 bool is_cs_list (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
581 { return rep->is_cs_list (); } |
3977 | 582 |
5759 | 583 bool is_magic_colon (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
584 { return rep->is_magic_colon (); } |
2376 | 585 |
8150
283989f2da9b
make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
8017
diff
changeset
|
586 bool is_null_value (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
587 { return rep->is_null_value (); } |
8150
283989f2da9b
make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
8017
diff
changeset
|
588 |
2376 | 589 // Are any or all of the elements in this constant nonzero? |
590 | |
5759 | 591 octave_value all (int dim = 0) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
592 { return rep->all (dim); } |
2376 | 593 |
5759 | 594 octave_value any (int dim = 0) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
595 { return rep->any (dim); } |
2376 | 596 |
9685 | 597 builtin_type_t builtin_type (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
598 { return rep->builtin_type (); } |
9685 | 599 |
5895 | 600 // Floating point types. |
601 | |
602 bool is_double_type (void) const | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
603 { return rep->is_double_type (); } |
5895 | 604 |
605 bool is_single_type (void) const | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
606 { return rep->is_single_type (); } |
5895 | 607 |
7576 | 608 bool is_float_type (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
609 { return rep->is_float_type (); } |
7576 | 610 |
5895 | 611 // Integer types. |
612 | |
613 bool is_int8_type (void) const | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
614 { return rep->is_int8_type (); } |
5895 | 615 |
616 bool is_int16_type (void) const | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
617 { return rep->is_int16_type (); } |
5895 | 618 |
619 bool is_int32_type (void) const | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
620 { return rep->is_int32_type (); } |
5895 | 621 |
622 bool is_int64_type (void) const | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
623 { return rep->is_int64_type (); } |
5895 | 624 |
625 bool is_uint8_type (void) const | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
626 { return rep->is_uint8_type (); } |
5895 | 627 |
628 bool is_uint16_type (void) const | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
629 { return rep->is_uint16_type (); } |
5895 | 630 |
631 bool is_uint32_type (void) const | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
632 { return rep->is_uint32_type (); } |
5895 | 633 |
634 bool is_uint64_type (void) const | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
635 { return rep->is_uint64_type (); } |
5895 | 636 |
2376 | 637 // Other type stuff. |
638 | |
5759 | 639 bool is_bool_type (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
640 { return rep->is_bool_type (); } |
3209 | 641 |
6223 | 642 bool is_integer_type (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
643 { return rep->is_integer_type (); } |
6223 | 644 |
5759 | 645 bool is_real_type (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
646 { return rep->is_real_type (); } |
2376 | 647 |
5759 | 648 bool is_complex_type (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
649 { return rep->is_complex_type (); } |
2376 | 650 |
5759 | 651 bool is_scalar_type (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
652 { return rep->is_scalar_type (); } |
2376 | 653 |
5759 | 654 bool is_matrix_type (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
655 { return rep->is_matrix_type (); } |
2376 | 656 |
5759 | 657 bool is_numeric_type (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
658 { return rep->is_numeric_type (); } |
2376 | 659 |
5759 | 660 bool is_sparse_type (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
661 { return rep->is_sparse_type (); } |
5631 | 662 |
2376 | 663 // Does this constant correspond to a truth value? |
664 | |
5759 | 665 bool is_true (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
666 { return rep->is_true (); } |
2376 | 667 |
8346
8302788f09db
fix empty matrix handling in switch statement
Jaroslav Hajek <highegg@gmail.com>
parents:
8345
diff
changeset
|
668 // Do two constants match (in a switch statement)? |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
669 |
8346
8302788f09db
fix empty matrix handling in switch statement
Jaroslav Hajek <highegg@gmail.com>
parents:
8345
diff
changeset
|
670 bool is_equal (const octave_value&) const; |
8302788f09db
fix empty matrix handling in switch statement
Jaroslav Hajek <highegg@gmail.com>
parents:
8345
diff
changeset
|
671 |
2376 | 672 // Are the dimensions of this constant zero by zero? |
673 | |
5759 | 674 bool is_zero_by_zero (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
675 { return (rows () == 0 && columns () == 0); } |
2376 | 676 |
5759 | 677 bool is_constant (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
678 { return rep->is_constant (); } |
2974 | 679 |
5759 | 680 bool is_function_handle (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
681 { return rep->is_function_handle (); } |
4654 | 682 |
13241
2a8dcb5b3a00
improve default indexing for objects
John W. Eaton <jwe@octave.org>
parents:
13110
diff
changeset
|
683 bool is_anonymous_function (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
684 { return rep->is_anonymous_function (); } |
13241
2a8dcb5b3a00
improve default indexing for objects
John W. Eaton <jwe@octave.org>
parents:
13110
diff
changeset
|
685 |
5759 | 686 bool is_inline_function (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
687 { return rep->is_inline_function (); } |
4954 | 688 |
5759 | 689 bool is_function (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
690 { return rep->is_function (); } |
2891 | 691 |
7336 | 692 bool is_user_script (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
693 { return rep->is_user_script (); } |
7336 | 694 |
695 bool is_user_function (void) const | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
696 { return rep->is_user_function (); } |
7336 | 697 |
7719
87eda1f8faaa
octave_user_code: new base class for octave_user_script and octave_user_function
John W. Eaton <jwe@octave.org>
parents:
7638
diff
changeset
|
698 bool is_user_code (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
699 { return rep->is_user_code (); } |
7719
87eda1f8faaa
octave_user_code: new base class for octave_user_script and octave_user_function
John W. Eaton <jwe@octave.org>
parents:
7638
diff
changeset
|
700 |
5759 | 701 bool is_builtin_function (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
702 { return rep->is_builtin_function (); } |
3325 | 703 |
5759 | 704 bool is_dld_function (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
705 { return rep->is_dld_function (); } |
3325 | 706 |
5864 | 707 bool is_mex_function (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
708 { return rep->is_mex_function (); } |
5864 | 709 |
7876
8447a5024650
clear subfunctions when clearing parent function
John W. Eaton <jwe@octave.org>
parents:
7800
diff
changeset
|
710 void erase_subfunctions (void) { rep->erase_subfunctions (); } |
8447a5024650
clear subfunctions when clearing parent function
John W. Eaton <jwe@octave.org>
parents:
7800
diff
changeset
|
711 |
2376 | 712 // Values. |
713 | |
2891 | 714 octave_value eval (void) { return *this; } |
715 | |
5759 | 716 short int |
4254 | 717 short_value (bool req_int = false, bool frc_str_conv = false) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
718 { return rep->short_value (req_int, frc_str_conv); } |
4254 | 719 |
5759 | 720 unsigned short int |
4254 | 721 ushort_value (bool req_int = false, bool frc_str_conv = false) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
722 { return rep->ushort_value (req_int, frc_str_conv); } |
4254 | 723 |
5759 | 724 int int_value (bool req_int = false, bool frc_str_conv = false) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
725 { return rep->int_value (req_int, frc_str_conv); } |
3202 | 726 |
5759 | 727 unsigned int |
4254 | 728 uint_value (bool req_int = false, bool frc_str_conv = false) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
729 { return rep->uint_value (req_int, frc_str_conv); } |
4254 | 730 |
5759 | 731 int nint_value (bool frc_str_conv = false) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
732 { return rep->nint_value (frc_str_conv); } |
3202 | 733 |
5759 | 734 long int |
4254 | 735 long_value (bool req_int = false, bool frc_str_conv = false) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
736 { return rep->long_value (req_int, frc_str_conv); } |
4254 | 737 |
5759 | 738 unsigned long int |
4254 | 739 ulong_value (bool req_int = false, bool frc_str_conv = false) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
740 { return rep->ulong_value (req_int, frc_str_conv); } |
4254 | 741 |
16323
e769440b39db
provide int64 extractors for octave_value class
John W. Eaton <jwe@octave.org>
parents:
16091
diff
changeset
|
742 int64_t |
e769440b39db
provide int64 extractors for octave_value class
John W. Eaton <jwe@octave.org>
parents:
16091
diff
changeset
|
743 int64_value (bool req_int = false, bool frc_str_conv = false) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
744 { return rep->int64_value (req_int, frc_str_conv); } |
16323
e769440b39db
provide int64 extractors for octave_value class
John W. Eaton <jwe@octave.org>
parents:
16091
diff
changeset
|
745 |
e769440b39db
provide int64 extractors for octave_value class
John W. Eaton <jwe@octave.org>
parents:
16091
diff
changeset
|
746 uint64_t |
e769440b39db
provide int64 extractors for octave_value class
John W. Eaton <jwe@octave.org>
parents:
16091
diff
changeset
|
747 uint64_value (bool req_int = false, bool frc_str_conv = false) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
748 { return rep->uint64_value (req_int, frc_str_conv); } |
16323
e769440b39db
provide int64 extractors for octave_value class
John W. Eaton <jwe@octave.org>
parents:
16091
diff
changeset
|
749 |
6133 | 750 octave_idx_type |
8017
260294a5520f
octave_value::idx_type_value: move definition to ov.cc from ov.h
John W. Eaton <jwe@octave.org>
parents:
7885
diff
changeset
|
751 idx_type_value (bool req_int = false, bool frc_str_conv = false) const; |
6133 | 752 |
5759 | 753 double double_value (bool frc_str_conv = false) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
754 { return rep->double_value (frc_str_conv); } |
2376 | 755 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
756 float float_value (bool frc_str_conv = false) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
757 { return rep->float_value (frc_str_conv); } |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
758 |
5759 | 759 double scalar_value (bool frc_str_conv = false) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
760 { return rep->scalar_value (frc_str_conv); } |
2916 | 761 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
762 float float_scalar_value (bool frc_str_conv = false) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
763 { return rep->float_scalar_value (frc_str_conv); } |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
764 |
5759 | 765 Cell cell_value (void) const; |
3351 | 766 |
5759 | 767 Matrix matrix_value (bool frc_str_conv = false) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
768 { return rep->matrix_value (frc_str_conv); } |
2376 | 769 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
770 FloatMatrix float_matrix_value (bool frc_str_conv = false) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
771 { return rep->float_matrix_value (frc_str_conv); } |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
772 |
5759 | 773 NDArray array_value (bool frc_str_conv = false) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
774 { return rep->array_value (frc_str_conv); } |
4505 | 775 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
776 FloatNDArray float_array_value (bool frc_str_conv = false) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
777 { return rep->float_array_value (frc_str_conv); } |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
778 |
5759 | 779 Complex complex_value (bool frc_str_conv = false) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
780 { return rep->complex_value (frc_str_conv); } |
2376 | 781 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
782 FloatComplex float_complex_value (bool frc_str_conv = false) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
783 { return rep->float_complex_value (frc_str_conv); } |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
784 |
5759 | 785 ComplexMatrix complex_matrix_value (bool frc_str_conv = false) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
786 { return rep->complex_matrix_value (frc_str_conv); } |
2376 | 787 |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
788 FloatComplexMatrix |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
789 float_complex_matrix_value (bool frc_str_conv = false) const |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
790 { return rep->float_complex_matrix_value (frc_str_conv); } |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
791 |
5759 | 792 ComplexNDArray complex_array_value (bool frc_str_conv = false) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
793 { return rep->complex_array_value (frc_str_conv); } |
4550 | 794 |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
795 FloatComplexNDArray |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
796 float_complex_array_value (bool frc_str_conv = false) const |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
797 { return rep->float_complex_array_value (frc_str_conv); } |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
798 |
5943 | 799 bool bool_value (bool warn = false) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
800 { return rep->bool_value (warn); } |
4550 | 801 |
5943 | 802 boolMatrix bool_matrix_value (bool warn = false) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
803 { return rep->bool_matrix_value (warn); } |
4550 | 804 |
5943 | 805 boolNDArray bool_array_value (bool warn = false) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
806 { return rep->bool_array_value (warn); } |
4550 | 807 |
5759 | 808 charMatrix char_matrix_value (bool frc_str_conv = false) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
809 { return rep->char_matrix_value (frc_str_conv); } |
2376 | 810 |
5759 | 811 charNDArray char_array_value (bool frc_str_conv = false) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
812 { return rep->char_array_value (frc_str_conv); } |
4550 | 813 |
5759 | 814 SparseMatrix sparse_matrix_value (bool frc_str_conv = false) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
815 { return rep->sparse_matrix_value (frc_str_conv); } |
5164 | 816 |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
817 SparseComplexMatrix |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
818 sparse_complex_matrix_value (bool frc_str_conv = false) const |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
819 { return rep->sparse_complex_matrix_value (frc_str_conv); } |
5164 | 820 |
9852
aabf7a8c2e57
implement sparse logical conversion
Jaroslav Hajek <highegg@gmail.com>
parents:
9835
diff
changeset
|
821 SparseBoolMatrix sparse_bool_matrix_value (bool warn = false) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
822 { return rep->sparse_bool_matrix_value (warn); } |
5164 | 823 |
8916
a2878ba31a9e
add diag & perm matrix query methods to octave_value
Jaroslav Hajek <highegg@gmail.com>
parents:
8811
diff
changeset
|
824 DiagMatrix diag_matrix_value (bool force = false) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
825 { return rep->diag_matrix_value (force); } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
826 |
8916
a2878ba31a9e
add diag & perm matrix query methods to octave_value
Jaroslav Hajek <highegg@gmail.com>
parents:
8811
diff
changeset
|
827 FloatDiagMatrix float_diag_matrix_value (bool force = false) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
828 { return rep->float_diag_matrix_value (force); } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
829 |
8916
a2878ba31a9e
add diag & perm matrix query methods to octave_value
Jaroslav Hajek <highegg@gmail.com>
parents:
8811
diff
changeset
|
830 ComplexDiagMatrix complex_diag_matrix_value (bool force = false) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
831 { return rep->complex_diag_matrix_value (force); } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
832 |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
833 FloatComplexDiagMatrix |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
834 float_complex_diag_matrix_value (bool force = false) const |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
835 { return rep->float_complex_diag_matrix_value (force); } |
8916
a2878ba31a9e
add diag & perm matrix query methods to octave_value
Jaroslav Hajek <highegg@gmail.com>
parents:
8811
diff
changeset
|
836 |
a2878ba31a9e
add diag & perm matrix query methods to octave_value
Jaroslav Hajek <highegg@gmail.com>
parents:
8811
diff
changeset
|
837 PermMatrix perm_matrix_value (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
838 { return rep->perm_matrix_value (); } |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
839 |
5759 | 840 octave_int8 int8_scalar_value (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
841 { return rep->int8_scalar_value (); } |
4910 | 842 |
5759 | 843 octave_int16 int16_scalar_value (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
844 { return rep->int16_scalar_value (); } |
4910 | 845 |
5759 | 846 octave_int32 int32_scalar_value (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
847 { return rep->int32_scalar_value (); } |
4910 | 848 |
5759 | 849 octave_int64 int64_scalar_value (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
850 { return rep->int64_scalar_value (); } |
4910 | 851 |
5759 | 852 octave_uint8 uint8_scalar_value (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
853 { return rep->uint8_scalar_value (); } |
4910 | 854 |
5759 | 855 octave_uint16 uint16_scalar_value (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
856 { return rep->uint16_scalar_value (); } |
4910 | 857 |
5759 | 858 octave_uint32 uint32_scalar_value (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
859 { return rep->uint32_scalar_value (); } |
4910 | 860 |
5759 | 861 octave_uint64 uint64_scalar_value (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
862 { return rep->uint64_scalar_value (); } |
4910 | 863 |
5759 | 864 int8NDArray int8_array_value (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
865 { return rep->int8_array_value (); } |
4906 | 866 |
5759 | 867 int16NDArray int16_array_value (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
868 { return rep->int16_array_value (); } |
4906 | 869 |
5759 | 870 int32NDArray int32_array_value (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
871 { return rep->int32_array_value (); } |
4906 | 872 |
5759 | 873 int64NDArray int64_array_value (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
874 { return rep->int64_array_value (); } |
4906 | 875 |
5759 | 876 uint8NDArray uint8_array_value (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
877 { return rep->uint8_array_value (); } |
4906 | 878 |
5759 | 879 uint16NDArray uint16_array_value (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
880 { return rep->uint16_array_value (); } |
4906 | 881 |
5759 | 882 uint32NDArray uint32_array_value (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
883 { return rep->uint32_array_value (); } |
4906 | 884 |
5759 | 885 uint64NDArray uint64_array_value (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
886 { return rep->uint64_array_value (); } |
4906 | 887 |
5759 | 888 string_vector all_strings (bool pad = false) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
889 { return rep->all_strings (pad); } |
2376 | 890 |
5759 | 891 std::string string_value (bool force = false) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
892 { return rep->string_value (force); } |
2376 | 893 |
8732 | 894 Array<std::string> cellstr_value (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
895 { return rep->cellstr_value (); } |
8732 | 896 |
5759 | 897 Range range_value (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
898 { return rep->range_value (); } |
2376 | 899 |
10742
604e13a89c7f
initial code for structs rewrite
Jaroslav Hajek <highegg@gmail.com>
parents:
10670
diff
changeset
|
900 octave_map map_value (void) const; |
604e13a89c7f
initial code for structs rewrite
Jaroslav Hajek <highegg@gmail.com>
parents:
10670
diff
changeset
|
901 |
604e13a89c7f
initial code for structs rewrite
Jaroslav Hajek <highegg@gmail.com>
parents:
10670
diff
changeset
|
902 octave_scalar_map scalar_map_value (void) const; |
604e13a89c7f
initial code for structs rewrite
Jaroslav Hajek <highegg@gmail.com>
parents:
10670
diff
changeset
|
903 |
5759 | 904 string_vector map_keys (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
905 { return rep->map_keys (); } |
3933 | 906 |
9151 | 907 size_t nparents (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
908 { return rep->nparents (); } |
9151 | 909 |
910 std::list<std::string> parent_class_name_list (void) const | |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
911 { return rep->parent_class_name_list (); } |
9151 | 912 |
9010
f914834836e7
Partial implementation of derived classes using the old form with "@" files.
rtshort@smoketree.phaselocked.com
parents:
8992
diff
changeset
|
913 string_vector parent_class_names (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
914 { return rep->parent_class_names (); } |
9010
f914834836e7
Partial implementation of derived classes using the old form with "@" files.
rtshort@smoketree.phaselocked.com
parents:
8992
diff
changeset
|
915 |
f914834836e7
Partial implementation of derived classes using the old form with "@" files.
rtshort@smoketree.phaselocked.com
parents:
8992
diff
changeset
|
916 octave_base_value * |
f914834836e7
Partial implementation of derived classes using the old form with "@" files.
rtshort@smoketree.phaselocked.com
parents:
8992
diff
changeset
|
917 find_parent_class (const std::string& parent_class_name) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
918 { return rep->find_parent_class (parent_class_name); } |
9010
f914834836e7
Partial implementation of derived classes using the old form with "@" files.
rtshort@smoketree.phaselocked.com
parents:
8992
diff
changeset
|
919 |
19137
56bc1464ec59
Implement "isa" for classdef objects.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
18416
diff
changeset
|
920 bool is_instance_of (const std::string& cls_name) const |
56bc1464ec59
Implement "isa" for classdef objects.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
18416
diff
changeset
|
921 { return rep->is_instance_of (cls_name); } |
56bc1464ec59
Implement "isa" for classdef objects.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
18416
diff
changeset
|
922 |
10075
84b0725f4b09
return class types by reference in const Array element access functions
Jaroslav Hajek <highegg@gmail.com>
parents:
9881
diff
changeset
|
923 octave_function *function_value (bool silent = false) const; |
2974 | 924 |
10075
84b0725f4b09
return class types by reference in const Array element access functions
Jaroslav Hajek <highegg@gmail.com>
parents:
9881
diff
changeset
|
925 octave_user_function *user_function_value (bool silent = false) const; |
7761
5adeea5de26c
symbol table reporting functions
John W. Eaton <jwe@octave.org>
parents:
7740
diff
changeset
|
926 |
10075
84b0725f4b09
return class types by reference in const Array element access functions
Jaroslav Hajek <highegg@gmail.com>
parents:
9881
diff
changeset
|
927 octave_user_script *user_script_value (bool silent = false) const; |
4700 | 928 |
10075
84b0725f4b09
return class types by reference in const Array element access functions
Jaroslav Hajek <highegg@gmail.com>
parents:
9881
diff
changeset
|
929 octave_user_code *user_code_value (bool silent = false) const; |
7719
87eda1f8faaa
octave_user_code: new base class for octave_user_script and octave_user_function
John W. Eaton <jwe@octave.org>
parents:
7638
diff
changeset
|
930 |
10075
84b0725f4b09
return class types by reference in const Array element access functions
Jaroslav Hajek <highegg@gmail.com>
parents:
9881
diff
changeset
|
931 octave_fcn_handle *fcn_handle_value (bool silent = false) const; |
4343 | 932 |
10075
84b0725f4b09
return class types by reference in const Array element access functions
Jaroslav Hajek <highegg@gmail.com>
parents:
9881
diff
changeset
|
933 octave_fcn_inline *fcn_inline_value (bool silent = false) const; |
4933 | 934 |
5759 | 935 octave_value_list list_value (void) const; |
2880 | 936 |
3419 | 937 ColumnVector column_vector_value (bool frc_str_conv = false, |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
938 bool frc_vec_conv = false) const; |
2376 | 939 |
940 ComplexColumnVector | |
3419 | 941 complex_column_vector_value (bool frc_str_conv = false, |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
942 bool frc_vec_conv = false) const; |
2376 | 943 |
3419 | 944 RowVector row_vector_value (bool frc_str_conv = false, |
10313 | 945 bool frc_vec_conv = false) const; |
3419 | 946 |
947 ComplexRowVector | |
948 complex_row_vector_value (bool frc_str_conv = false, | |
10313 | 949 bool frc_vec_conv = false) const; |
3419 | 950 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
951 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
952 FloatColumnVector float_column_vector_value (bool frc_str_conv = false, |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
953 bool frc_vec_conv = false) const; |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
954 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
955 FloatComplexColumnVector |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
956 float_complex_column_vector_value (bool frc_str_conv = false, |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
957 bool frc_vec_conv = false) const; |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
958 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
959 FloatRowVector float_row_vector_value (bool frc_str_conv = false, |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
960 bool frc_vec_conv = false) const; |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
961 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
962 FloatComplexRowVector |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
963 float_complex_row_vector_value (bool frc_str_conv = false, |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
964 bool frc_vec_conv = false) const; |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
965 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
966 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
967 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
968 |
4044 | 969 Array<int> int_vector_value (bool req_int = false, |
10313 | 970 bool frc_str_conv = false, |
971 bool frc_vec_conv = false) const; | |
4044 | 972 |
8811 | 973 Array<octave_idx_type> |
974 octave_idx_type_vector_value (bool req_int = false, | |
10313 | 975 bool frc_str_conv = false, |
976 bool frc_vec_conv = false) const; | |
8811 | 977 |
3419 | 978 Array<double> vector_value (bool frc_str_conv = false, |
10313 | 979 bool frc_vec_conv = false) const; |
3419 | 980 |
981 Array<Complex> complex_vector_value (bool frc_str_conv = false, | |
10313 | 982 bool frc_vec_conv = false) const; |
3419 | 983 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
984 Array<float> float_vector_value (bool frc_str_conv = false, |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
985 bool frc_vec_conv = false) const; |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
986 |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
987 Array<FloatComplex> |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
988 float_complex_vector_value (bool frc_str_conv = false, |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
989 bool frc_vec_conv = false) const; |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
990 |
8523
ad3afaaa19c1
implement non-copying contiguous range indexing
Jaroslav Hajek <highegg@gmail.com>
parents:
8458
diff
changeset
|
991 // Possibly economize a lazy-indexed value. |
8150
283989f2da9b
make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
8017
diff
changeset
|
992 |
8523
ad3afaaa19c1
implement non-copying contiguous range indexing
Jaroslav Hajek <highegg@gmail.com>
parents:
8458
diff
changeset
|
993 void maybe_economize (void) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
994 { rep->maybe_economize (); } |
8523
ad3afaaa19c1
implement non-copying contiguous range indexing
Jaroslav Hajek <highegg@gmail.com>
parents:
8458
diff
changeset
|
995 |
8531
b01fef323c24
add some explaining comments
Jaroslav Hajek <highegg@gmail.com>
parents:
8523
diff
changeset
|
996 // The following two hook conversions are called on any octave_value prior to |
b01fef323c24
add some explaining comments
Jaroslav Hajek <highegg@gmail.com>
parents:
8523
diff
changeset
|
997 // storing it to a "permanent" location, like a named variable, a cell or a |
11586
12df7854fa7c
strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
998 // struct component, or a return value of a function. |
8523
ad3afaaa19c1
implement non-copying contiguous range indexing
Jaroslav Hajek <highegg@gmail.com>
parents:
8458
diff
changeset
|
999 |
ad3afaaa19c1
implement non-copying contiguous range indexing
Jaroslav Hajek <highegg@gmail.com>
parents:
8458
diff
changeset
|
1000 octave_value storable_value (void) const; |
8150
283989f2da9b
make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
8017
diff
changeset
|
1001 |
8531
b01fef323c24
add some explaining comments
Jaroslav Hajek <highegg@gmail.com>
parents:
8523
diff
changeset
|
1002 // Ditto, but in place, i.e. equivalent to *this = this->storable_value (), |
b01fef323c24
add some explaining comments
Jaroslav Hajek <highegg@gmail.com>
parents:
8523
diff
changeset
|
1003 // but possibly more efficient. |
8150
283989f2da9b
make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
8017
diff
changeset
|
1004 |
8523
ad3afaaa19c1
implement non-copying contiguous range indexing
Jaroslav Hajek <highegg@gmail.com>
parents:
8458
diff
changeset
|
1005 void make_storable_value (void); |
8150
283989f2da9b
make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
8017
diff
changeset
|
1006 |
2376 | 1007 // Conversions. These should probably be private. If a user of this |
1008 // class wants a certain kind of constant, he should simply ask for | |
1009 // it, and we should convert it if possible. | |
1010 | |
5279 | 1011 octave_value convert_to_str (bool pad = false, bool force = false, |
10313 | 1012 char type = '\'') const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1013 { return rep->convert_to_str (pad, force, type); } |
4452 | 1014 |
5759 | 1015 octave_value |
5279 | 1016 convert_to_str_internal (bool pad, bool force, char type) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1017 { return rep->convert_to_str_internal (pad, force, type); } |
2376 | 1018 |
5759 | 1019 void convert_to_row_or_column_vector (void) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1020 { rep->convert_to_row_or_column_vector (); } |
2376 | 1021 |
5759 | 1022 bool print_as_scalar (void) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1023 { return rep->print_as_scalar (); } |
4604 | 1024 |
18416
bcd71a2531d3
Support disp/display overloading in classdef
Michael Goffioul <michael.goffioul@gmail.com>
parents:
18402
diff
changeset
|
1025 void print (std::ostream& os, bool pr_as_read_syntax = false) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1026 { rep->print (os, pr_as_read_syntax); } |
2376 | 1027 |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1028 void print_raw (std::ostream& os, bool pr_as_read_syntax = false) const |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1029 { rep->print_raw (os, pr_as_read_syntax); } |
2903 | 1030 |
5759 | 1031 bool print_name_tag (std::ostream& os, const std::string& name) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1032 { return rep->print_name_tag (os, name); } |
2376 | 1033 |
13110
2d5035847529
Add Júlio Hoffimann Mendes to contributors.in
John W. Eaton <jwe@octave.org>
parents:
12171
diff
changeset
|
1034 void print_with_name (std::ostream& os, const std::string& name) const |
2d5035847529
Add Júlio Hoffimann Mendes to contributors.in
John W. Eaton <jwe@octave.org>
parents:
12171
diff
changeset
|
1035 { rep->print_with_name (os, name, true); } |
2376 | 1036 |
17870 | 1037 void short_disp (std::ostream& os) const { rep->short_disp (os); } |
16468
0f143f68078d
use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents:
16323
diff
changeset
|
1038 |
5759 | 1039 int type_id (void) const { return rep->type_id (); } |
2376 | 1040 |
5759 | 1041 std::string type_name (void) const { return rep->type_name (); } |
1042 | |
1043 std::string class_name (void) const { return rep->class_name (); } | |
4612 | 1044 |
3203 | 1045 // Unary and binary operations. |
1046 | |
6109 | 1047 friend OCTINTERP_API octave_value do_unary_op (unary_op op, |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1048 const octave_value& a); |
3203 | 1049 |
10614
d1194069e58c
optimize code handling ++,--
Jaroslav Hajek <highegg@gmail.com>
parents:
10544
diff
changeset
|
1050 octave_value& do_non_const_unary_op (unary_op op); |
3933 | 1051 |
10614
d1194069e58c
optimize code handling ++,--
Jaroslav Hajek <highegg@gmail.com>
parents:
10544
diff
changeset
|
1052 octave_value& do_non_const_unary_op (unary_op op, const std::string& type, |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1053 const std::list<octave_value_list>& idx); |
3205 | 1054 |
6109 | 1055 friend OCTINTERP_API octave_value do_binary_op (binary_op op, |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1056 const octave_value& a, |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1057 const octave_value& b); |
2376 | 1058 |
7800
5861b95e9879
support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
1059 friend OCTINTERP_API octave_value do_binary_op (compound_binary_op op, |
5861b95e9879
support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
1060 const octave_value& a, |
5861b95e9879
support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
1061 const octave_value& b); |
5861b95e9879
support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
1062 |
6109 | 1063 friend OCTINTERP_API octave_value do_cat_op (const octave_value& a, |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1064 const octave_value& b, |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1065 const Array<octave_idx_type>& ra_idx); |
4915 | 1066 |
19783
c913247c85a8
make colon function work (bug #44290)
John W. Eaton <jwe@octave.org>
parents:
19731
diff
changeset
|
1067 friend OCTINTERP_API octave_value do_colon_op (const octave_value& base, |
c913247c85a8
make colon function work (bug #44290)
John W. Eaton <jwe@octave.org>
parents:
19731
diff
changeset
|
1068 const octave_value& limit, |
c913247c85a8
make colon function work (bug #44290)
John W. Eaton <jwe@octave.org>
parents:
19731
diff
changeset
|
1069 bool is_for_cmd_expr = false) |
c913247c85a8
make colon function work (bug #44290)
John W. Eaton <jwe@octave.org>
parents:
19731
diff
changeset
|
1070 { |
c913247c85a8
make colon function work (bug #44290)
John W. Eaton <jwe@octave.org>
parents:
19731
diff
changeset
|
1071 return do_colon_op (base, octave_value (), limit, is_for_cmd_expr); |
c913247c85a8
make colon function work (bug #44290)
John W. Eaton <jwe@octave.org>
parents:
19731
diff
changeset
|
1072 } |
c913247c85a8
make colon function work (bug #44290)
John W. Eaton <jwe@octave.org>
parents:
19731
diff
changeset
|
1073 |
c913247c85a8
make colon function work (bug #44290)
John W. Eaton <jwe@octave.org>
parents:
19731
diff
changeset
|
1074 friend OCTINTERP_API octave_value do_colon_op (const octave_value& base, |
c913247c85a8
make colon function work (bug #44290)
John W. Eaton <jwe@octave.org>
parents:
19731
diff
changeset
|
1075 const octave_value& increment, |
c913247c85a8
make colon function work (bug #44290)
John W. Eaton <jwe@octave.org>
parents:
19731
diff
changeset
|
1076 const octave_value& limit, |
c913247c85a8
make colon function work (bug #44290)
John W. Eaton <jwe@octave.org>
parents:
19731
diff
changeset
|
1077 bool is_for_cmd_expr = false); |
c913247c85a8
make colon function work (bug #44290)
John W. Eaton <jwe@octave.org>
parents:
19731
diff
changeset
|
1078 |
5759 | 1079 const octave_base_value& get_rep (void) const { return *rep; } |
3301 | 1080 |
8456
c1709a45b45b
optimize structure components access
Jaroslav Hajek <highegg@gmail.com>
parents:
8437
diff
changeset
|
1081 bool is_copy_of (const octave_value &val) const { return rep == val.rep; } |
c1709a45b45b
optimize structure components access
Jaroslav Hajek <highegg@gmail.com>
parents:
8437
diff
changeset
|
1082 |
5759 | 1083 void print_info (std::ostream& os, |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1084 const std::string& prefix = std::string ()) const; |
3933 | 1085 |
6974 | 1086 bool save_ascii (std::ostream& os) { return rep->save_ascii (os); } |
4687 | 1087 |
6974 | 1088 bool load_ascii (std::istream& is) { return rep->load_ascii (is); } |
4687 | 1089 |
5759 | 1090 bool save_binary (std::ostream& os, bool& save_as_floats) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1091 { return rep->save_binary (os, save_as_floats); } |
4687 | 1092 |
5759 | 1093 bool load_binary (std::istream& is, bool swap, |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1094 oct_mach_info::float_format fmt) |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1095 { return rep->load_binary (is, swap, fmt); } |
4687 | 1096 |
1097 #if defined (HAVE_HDF5) | |
5759 | 1098 bool save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1099 { return rep->save_hdf5 (loc_id, name, save_as_floats); } |
4687 | 1100 |
9881
b3089dba88bf
Remove HDF5 cruft for older versions of HDF5
Kacper Kowalik
parents:
9852
diff
changeset
|
1101 bool load_hdf5 (hid_t loc_id, const char *name) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1102 { return rep->load_hdf5 (loc_id, name); } |
4687 | 1103 #endif |
1104 | |
5759 | 1105 int write (octave_stream& os, int block_size, |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1106 oct_data_conv::data_type output_type, int skip, |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1107 oct_mach_info::float_format flt_fmt) const; |
4944 | 1108 |
5759 | 1109 octave_base_value *internal_rep (void) const { return rep; } |
4901 | 1110 |
5900 | 1111 // Unsafe. These functions exist to support the MEX interface. |
1112 // You should not use them anywhere else. | |
1113 void *mex_get_data (void) const { return rep->mex_get_data (); } | |
1114 | |
1115 octave_idx_type *mex_get_ir (void) const { return rep->mex_get_ir (); } | |
1116 | |
1117 octave_idx_type *mex_get_jc (void) const { return rep->mex_get_jc (); } | |
1118 | |
1119 mxArray *as_mxArray (void) const { return rep->as_mxArray (); } | |
1120 | |
7620
36594d5bbe13
Move diag function into the octave_value class
David Bateman <dbateman@free.fr>
parents:
7576
diff
changeset
|
1121 octave_value diag (octave_idx_type k = 0) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1122 { return rep->diag (k); } |
7620
36594d5bbe13
Move diag function into the octave_value class
David Bateman <dbateman@free.fr>
parents:
7576
diff
changeset
|
1123 |
14557
e8e86ae3abbc
make diag (x, m, n) return a proper diagonal matrix object (bug #36099)
John W. Eaton <jwe@octave.org>
parents:
14528
diff
changeset
|
1124 octave_value diag (octave_idx_type m, octave_idx_type n) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1125 { return rep->diag (m, n); } |
14557
e8e86ae3abbc
make diag (x, m, n) return a proper diagonal matrix object (bug #36099)
John W. Eaton <jwe@octave.org>
parents:
14528
diff
changeset
|
1126 |
7463
2467639bd8c0
eliminate UNDEFINED sort mode
John W. Eaton <jwe@octave.org>
parents:
7433
diff
changeset
|
1127 octave_value sort (octave_idx_type dim = 0, sortmode mode = ASCENDING) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1128 { return rep->sort (dim, mode); } |
7433 | 1129 octave_value sort (Array<octave_idx_type> &sidx, octave_idx_type dim = 0, |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1130 sortmode mode = ASCENDING) const |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1131 { return rep->sort (sidx, dim, mode); } |
7433 | 1132 |
8734
767ed8cc6634
rename internal issorted and issorted_rows functions to is_sorted and is_sorted_rows
John W. Eaton <jwe@octave.org>
parents:
8733
diff
changeset
|
1133 sortmode is_sorted (sortmode mode = UNSORTED) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1134 { return rep->is_sorted (mode); } |
8721
e9cb742df9eb
imported patch sort3.diff
Jaroslav Hajek <highegg@gmail.com>
parents:
8676
diff
changeset
|
1135 |
8733
3ef774603887
rename all uses of sortrows_idx to sort_rows_idx
John W. Eaton <jwe@octave.org>
parents:
8732
diff
changeset
|
1136 Array<octave_idx_type> sort_rows_idx (sortmode mode = ASCENDING) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1137 { return rep->sort_rows_idx (mode); } |
8721
e9cb742df9eb
imported patch sort3.diff
Jaroslav Hajek <highegg@gmail.com>
parents:
8676
diff
changeset
|
1138 |
8734
767ed8cc6634
rename internal issorted and issorted_rows functions to is_sorted and is_sorted_rows
John W. Eaton <jwe@octave.org>
parents:
8733
diff
changeset
|
1139 sortmode is_sorted_rows (sortmode mode = UNSORTED) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1140 { return rep->is_sorted_rows (mode); } |
8721
e9cb742df9eb
imported patch sort3.diff
Jaroslav Hajek <highegg@gmail.com>
parents:
8676
diff
changeset
|
1141 |
7489
8e4592e49fa7
don't clear locked functions
John W. Eaton <jwe@octave.org>
parents:
7463
diff
changeset
|
1142 void lock (void) { rep->lock (); } |
8e4592e49fa7
don't clear locked functions
John W. Eaton <jwe@octave.org>
parents:
7463
diff
changeset
|
1143 |
8e4592e49fa7
don't clear locked functions
John W. Eaton <jwe@octave.org>
parents:
7463
diff
changeset
|
1144 void unlock (void) { rep->unlock (); } |
8e4592e49fa7
don't clear locked functions
John W. Eaton <jwe@octave.org>
parents:
7463
diff
changeset
|
1145 |
8e4592e49fa7
don't clear locked functions
John W. Eaton <jwe@octave.org>
parents:
7463
diff
changeset
|
1146 bool islocked (void) const { return rep->islocked (); } |
8e4592e49fa7
don't clear locked functions
John W. Eaton <jwe@octave.org>
parents:
7463
diff
changeset
|
1147 |
7761
5adeea5de26c
symbol table reporting functions
John W. Eaton <jwe@octave.org>
parents:
7740
diff
changeset
|
1148 void dump (std::ostream& os) const { rep->dump (os); } |
5adeea5de26c
symbol table reporting functions
John W. Eaton <jwe@octave.org>
parents:
7740
diff
changeset
|
1149 |
9813
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1150 #define MAPPER_FORWARD(F) \ |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1151 octave_value F (void) const { return rep->map (octave_base_value::umap_ ## F); } |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1152 |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1153 MAPPER_FORWARD (abs) |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1154 MAPPER_FORWARD (acos) |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1155 MAPPER_FORWARD (acosh) |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1156 MAPPER_FORWARD (angle) |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1157 MAPPER_FORWARD (arg) |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1158 MAPPER_FORWARD (asin) |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1159 MAPPER_FORWARD (asinh) |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1160 MAPPER_FORWARD (atan) |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1161 MAPPER_FORWARD (atanh) |
10414
2a8b1db1e2ca
implement built-in cbrt
Jaroslav Hajek <highegg@gmail.com>
parents:
10391
diff
changeset
|
1162 MAPPER_FORWARD (cbrt) |
9813
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1163 MAPPER_FORWARD (ceil) |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1164 MAPPER_FORWARD (conj) |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1165 MAPPER_FORWARD (cos) |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1166 MAPPER_FORWARD (cosh) |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1167 MAPPER_FORWARD (erf) |
9835
1bb1ed717d2f
implement built-in erfinv
Jaroslav Hajek <highegg@gmail.com>
parents:
9813
diff
changeset
|
1168 MAPPER_FORWARD (erfinv) |
14770
cb85e836d035
New function: erfcinv (bug #36607)
Axel Mathéi <axel.mathei@gmail.com>
parents:
14557
diff
changeset
|
1169 MAPPER_FORWARD (erfcinv) |
9813
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1170 MAPPER_FORWARD (erfc) |
10391
59e34bcdff13
implement built-in erfcx
Jaroslav Hajek <highegg@gmail.com>
parents:
10325
diff
changeset
|
1171 MAPPER_FORWARD (erfcx) |
15696
2fac72a256ce
Add complex erf,erfc,erfcx,erfi,dawson routines from Faddeeva package.
Steven G. Johnson <stevenj@alum.mit.edu>
parents:
15487
diff
changeset
|
1172 MAPPER_FORWARD (erfi) |
2fac72a256ce
Add complex erf,erfc,erfcx,erfi,dawson routines from Faddeeva package.
Steven G. Johnson <stevenj@alum.mit.edu>
parents:
15487
diff
changeset
|
1173 MAPPER_FORWARD (dawson) |
9813
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1174 MAPPER_FORWARD (exp) |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1175 MAPPER_FORWARD (expm1) |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1176 MAPPER_FORWARD (finite) |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1177 MAPPER_FORWARD (fix) |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1178 MAPPER_FORWARD (floor) |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1179 MAPPER_FORWARD (gamma) |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1180 MAPPER_FORWARD (imag) |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1181 MAPPER_FORWARD (isinf) |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1182 MAPPER_FORWARD (isna) |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1183 MAPPER_FORWARD (isnan) |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1184 MAPPER_FORWARD (lgamma) |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1185 MAPPER_FORWARD (log) |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1186 MAPPER_FORWARD (log2) |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1187 MAPPER_FORWARD (log10) |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1188 MAPPER_FORWARD (log1p) |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1189 MAPPER_FORWARD (real) |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1190 MAPPER_FORWARD (round) |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1191 MAPPER_FORWARD (roundb) |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1192 MAPPER_FORWARD (signum) |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1193 MAPPER_FORWARD (sin) |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1194 MAPPER_FORWARD (sinh) |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1195 MAPPER_FORWARD (sqrt) |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1196 MAPPER_FORWARD (tan) |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1197 MAPPER_FORWARD (tanh) |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1198 |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1199 // These functions are prefixed with X to avoid potential macro |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1200 // conflicts. |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1201 |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1202 MAPPER_FORWARD (xisalnum) |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1203 MAPPER_FORWARD (xisalpha) |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1204 MAPPER_FORWARD (xisascii) |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1205 MAPPER_FORWARD (xiscntrl) |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1206 MAPPER_FORWARD (xisdigit) |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1207 MAPPER_FORWARD (xisgraph) |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1208 MAPPER_FORWARD (xislower) |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1209 MAPPER_FORWARD (xisprint) |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1210 MAPPER_FORWARD (xispunct) |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1211 MAPPER_FORWARD (xisspace) |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1212 MAPPER_FORWARD (xisupper) |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1213 MAPPER_FORWARD (xisxdigit) |
15487
ecf5be238b4a
provide signbit mapper for real values
John W. Eaton <jwe@octave.org>
parents:
15429
diff
changeset
|
1214 MAPPER_FORWARD (xsignbit) |
9813
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1215 MAPPER_FORWARD (xtoascii) |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1216 MAPPER_FORWARD (xtolower) |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1217 MAPPER_FORWARD (xtoupper) |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1218 |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1219 #undef MAPPER_FORWARD |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1220 |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
1221 octave_value map (octave_base_value::unary_mapper_t umap) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1222 { return rep->map (umap); } |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
1223 |
10670
654fbde5dceb
make cellfun's fast scalar collection mechanism public
Jaroslav Hajek <highegg@gmail.com>
parents:
10614
diff
changeset
|
1224 // Extract the n-th element, aka val(n). Result is undefined if val is not an |
654fbde5dceb
make cellfun's fast scalar collection mechanism public
Jaroslav Hajek <highegg@gmail.com>
parents:
10614
diff
changeset
|
1225 // array type or n is out of range. Never error. |
654fbde5dceb
make cellfun's fast scalar collection mechanism public
Jaroslav Hajek <highegg@gmail.com>
parents:
10614
diff
changeset
|
1226 octave_value |
654fbde5dceb
make cellfun's fast scalar collection mechanism public
Jaroslav Hajek <highegg@gmail.com>
parents:
10614
diff
changeset
|
1227 fast_elem_extract (octave_idx_type n) const |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1228 { return rep->fast_elem_extract (n); } |
10670
654fbde5dceb
make cellfun's fast scalar collection mechanism public
Jaroslav Hajek <highegg@gmail.com>
parents:
10614
diff
changeset
|
1229 |
654fbde5dceb
make cellfun's fast scalar collection mechanism public
Jaroslav Hajek <highegg@gmail.com>
parents:
10614
diff
changeset
|
1230 // Assign the n-th element, aka val(n) = x. Returns false if val is not an |
654fbde5dceb
make cellfun's fast scalar collection mechanism public
Jaroslav Hajek <highegg@gmail.com>
parents:
10614
diff
changeset
|
1231 // array type, x is not a matching scalar type, or n is out of range. |
654fbde5dceb
make cellfun's fast scalar collection mechanism public
Jaroslav Hajek <highegg@gmail.com>
parents:
10614
diff
changeset
|
1232 // Never error. |
654fbde5dceb
make cellfun's fast scalar collection mechanism public
Jaroslav Hajek <highegg@gmail.com>
parents:
10614
diff
changeset
|
1233 virtual bool |
654fbde5dceb
make cellfun's fast scalar collection mechanism public
Jaroslav Hajek <highegg@gmail.com>
parents:
10614
diff
changeset
|
1234 fast_elem_insert (octave_idx_type n, const octave_value& x) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1235 { |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1236 make_unique (); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1237 return rep->fast_elem_insert (n, x); |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1238 } |
10670
654fbde5dceb
make cellfun's fast scalar collection mechanism public
Jaroslav Hajek <highegg@gmail.com>
parents:
10614
diff
changeset
|
1239 |
2376 | 1240 protected: |
1241 | |
5759 | 1242 // The real representation. |
1243 octave_base_value *rep; | |
2413 | 1244 |
3933 | 1245 private: |
2903 | 1246 |
3205 | 1247 assign_op unary_op_to_assign_op (unary_op op); |
1248 | |
3204 | 1249 binary_op op_eq_to_binary_op (assign_op op); |
1250 | |
9521 | 1251 // This declaration protects against constructing octave_value from |
1252 // const octave_base_value* which actually silently calls octave_value (bool). | |
1253 octave_value (const octave_base_value *); | |
1254 | |
2376 | 1255 }; |
1256 | |
5508 | 1257 // Publish externally used friend functions. |
1258 | |
6109 | 1259 extern OCTINTERP_API octave_value |
5508 | 1260 do_unary_op (octave_value::unary_op op, const octave_value& a); |
1261 | |
6109 | 1262 extern OCTINTERP_API octave_value |
5508 | 1263 do_binary_op (octave_value::binary_op op, |
10313 | 1264 const octave_value& a, const octave_value& b); |
5508 | 1265 |
7800
5861b95e9879
support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
1266 extern OCTINTERP_API octave_value |
5861b95e9879
support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
1267 do_binary_op (octave_value::compound_binary_op op, |
5861b95e9879
support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
1268 const octave_value& a, const octave_value& b); |
5861b95e9879
support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
1269 |
3203 | 1270 #define OV_UNOP_FN(name) \ |
1271 inline octave_value \ | |
1272 name (const octave_value& a) \ | |
1273 { \ | |
1274 return do_unary_op (octave_value::name, a); \ | |
1275 } | |
1276 | |
1277 #define OV_UNOP_OP(name, op) \ | |
1278 inline octave_value \ | |
1279 operator op (const octave_value& a) \ | |
1280 { \ | |
1281 return name (a); \ | |
1282 } | |
1283 | |
1284 #define OV_UNOP_FN_OP(name, op) \ | |
1285 OV_UNOP_FN (name) \ | |
1286 OV_UNOP_OP (name, op) | |
1287 | |
3525 | 1288 OV_UNOP_FN_OP (op_not, !) |
6518 | 1289 OV_UNOP_FN_OP (op_uplus, +) |
3525 | 1290 OV_UNOP_FN_OP (op_uminus, -) |
3203 | 1291 |
3525 | 1292 OV_UNOP_FN (op_transpose) |
1293 OV_UNOP_FN (op_hermitian) | |
3203 | 1294 |
1295 // No simple way to define these for prefix and suffix ops? | |
1296 // | |
1297 // incr | |
1298 // decr | |
1299 | |
1300 #define OV_BINOP_FN(name) \ | |
1301 inline octave_value \ | |
1302 name (const octave_value& a1, const octave_value& a2) \ | |
1303 { \ | |
1304 return do_binary_op (octave_value::name, a1, a2); \ | |
1305 } | |
1306 | |
1307 #define OV_BINOP_OP(name, op) \ | |
1308 inline octave_value \ | |
1309 operator op (const octave_value& a1, const octave_value& a2) \ | |
1310 { \ | |
1311 return name (a1, a2); \ | |
1312 } | |
1313 | |
1314 #define OV_BINOP_FN_OP(name, op) \ | |
1315 OV_BINOP_FN (name) \ | |
1316 OV_BINOP_OP (name, op) | |
1317 | |
3525 | 1318 OV_BINOP_FN_OP (op_add, +) |
1319 OV_BINOP_FN_OP (op_sub, -) | |
1320 OV_BINOP_FN_OP (op_mul, *) | |
1321 OV_BINOP_FN_OP (op_div, /) | |
3203 | 1322 |
3525 | 1323 OV_BINOP_FN (op_pow) |
1324 OV_BINOP_FN (op_ldiv) | |
1325 OV_BINOP_FN (op_lshift) | |
1326 OV_BINOP_FN (op_rshift) | |
3203 | 1327 |
3525 | 1328 OV_BINOP_FN_OP (op_lt, <) |
1329 OV_BINOP_FN_OP (op_le, <=) | |
1330 OV_BINOP_FN_OP (op_eq, ==) | |
1331 OV_BINOP_FN_OP (op_ge, >=) | |
1332 OV_BINOP_FN_OP (op_gt, >) | |
1333 OV_BINOP_FN_OP (op_ne, !=) | |
3203 | 1334 |
3525 | 1335 OV_BINOP_FN (op_el_mul) |
1336 OV_BINOP_FN (op_el_div) | |
1337 OV_BINOP_FN (op_el_pow) | |
1338 OV_BINOP_FN (op_el_ldiv) | |
1339 OV_BINOP_FN (op_el_and) | |
1340 OV_BINOP_FN (op_el_or) | |
3203 | 1341 |
3525 | 1342 OV_BINOP_FN (op_struct_ref) |
3203 | 1343 |
7800
5861b95e9879
support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
1344 #define OV_COMP_BINOP_FN(name) \ |
5861b95e9879
support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
1345 inline octave_value \ |
5861b95e9879
support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
1346 name (const octave_value& a1, const octave_value& a2) \ |
5861b95e9879
support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
1347 { \ |
5861b95e9879
support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
1348 return do_binary_op (octave_value::name, a1, a2); \ |
5861b95e9879
support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
1349 } |
5861b95e9879
support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
1350 |
5861b95e9879
support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
1351 OV_COMP_BINOP_FN (op_trans_mul) |
5861b95e9879
support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
1352 OV_COMP_BINOP_FN (op_mul_trans) |
5861b95e9879
support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
1353 OV_COMP_BINOP_FN (op_herm_mul) |
5861b95e9879
support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
1354 OV_COMP_BINOP_FN (op_mul_herm) |
5861b95e9879
support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents:
7789
diff
changeset
|
1355 |
6109 | 1356 extern OCTINTERP_API void install_types (void); |
2376 | 1357 |
5759 | 1358 // This will eventually go away, but for now it can be used to |
1359 // simplify the transition to the new octave_value class hierarchy, | |
1360 // which uses octave_base_value instead of octave_value for the type | |
1361 // of octave_value::rep. | |
1362 #define OV_REP_TYPE octave_base_value | |
1363 | |
9657
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1364 // Templated value extractors. |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1365 template<class Value> |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1366 inline Value octave_value_extract (const octave_value&) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
1367 { assert (false); } |
9657
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1368 |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1369 #define DEF_VALUE_EXTRACTOR(VALUE,MPREFIX) \ |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1370 template<> \ |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1371 inline VALUE octave_value_extract<VALUE> (const octave_value& v) \ |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1372 { return v.MPREFIX ## _value (); } |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1373 |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1374 DEF_VALUE_EXTRACTOR (double, scalar) |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1375 DEF_VALUE_EXTRACTOR (float, float_scalar) |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1376 DEF_VALUE_EXTRACTOR (Complex, complex) |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1377 DEF_VALUE_EXTRACTOR (FloatComplex, float_complex) |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1378 DEF_VALUE_EXTRACTOR (bool, bool) |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1379 |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1380 DEF_VALUE_EXTRACTOR (octave_int8, int8_scalar) |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1381 DEF_VALUE_EXTRACTOR (octave_int16, int16_scalar) |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1382 DEF_VALUE_EXTRACTOR (octave_int32, int32_scalar) |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1383 DEF_VALUE_EXTRACTOR (octave_int64, int64_scalar) |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1384 DEF_VALUE_EXTRACTOR (octave_uint8, uint8_scalar) |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1385 DEF_VALUE_EXTRACTOR (octave_uint16, uint16_scalar) |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1386 DEF_VALUE_EXTRACTOR (octave_uint32, uint32_scalar) |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1387 DEF_VALUE_EXTRACTOR (octave_uint64, uint64_scalar) |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1388 |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1389 |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1390 DEF_VALUE_EXTRACTOR (NDArray, array) |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1391 DEF_VALUE_EXTRACTOR (FloatNDArray, float_array) |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1392 DEF_VALUE_EXTRACTOR (ComplexNDArray, complex_array) |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1393 DEF_VALUE_EXTRACTOR (FloatComplexNDArray, float_complex_array) |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1394 DEF_VALUE_EXTRACTOR (boolNDArray, bool_array) |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1395 |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1396 DEF_VALUE_EXTRACTOR (charNDArray, char_array) |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1397 DEF_VALUE_EXTRACTOR (int8NDArray, int8_array) |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1398 DEF_VALUE_EXTRACTOR (int16NDArray, int16_array) |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1399 DEF_VALUE_EXTRACTOR (int32NDArray, int32_array) |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1400 DEF_VALUE_EXTRACTOR (int64NDArray, int64_array) |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1401 DEF_VALUE_EXTRACTOR (uint8NDArray, uint8_array) |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1402 DEF_VALUE_EXTRACTOR (uint16NDArray, uint16_array) |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1403 DEF_VALUE_EXTRACTOR (uint32NDArray, uint32_array) |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1404 DEF_VALUE_EXTRACTOR (uint64NDArray, uint64_array) |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1405 |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1406 DEF_VALUE_EXTRACTOR (Matrix, matrix) |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1407 DEF_VALUE_EXTRACTOR (FloatMatrix, float_matrix) |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1408 DEF_VALUE_EXTRACTOR (ComplexMatrix, complex_matrix) |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1409 DEF_VALUE_EXTRACTOR (FloatComplexMatrix, float_complex_matrix) |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1410 DEF_VALUE_EXTRACTOR (boolMatrix, bool_matrix) |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1411 |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1412 DEF_VALUE_EXTRACTOR (ColumnVector, column_vector) |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1413 DEF_VALUE_EXTRACTOR (FloatColumnVector, float_column_vector) |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1414 DEF_VALUE_EXTRACTOR (ComplexColumnVector, complex_column_vector) |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1415 DEF_VALUE_EXTRACTOR (FloatComplexColumnVector, float_complex_column_vector) |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1416 |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1417 DEF_VALUE_EXTRACTOR (RowVector, row_vector) |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1418 DEF_VALUE_EXTRACTOR (FloatRowVector, float_row_vector) |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1419 DEF_VALUE_EXTRACTOR (ComplexRowVector, complex_row_vector) |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1420 DEF_VALUE_EXTRACTOR (FloatComplexRowVector, float_complex_row_vector) |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1421 |
9685 | 1422 DEF_VALUE_EXTRACTOR (DiagMatrix, diag_matrix) |
1423 DEF_VALUE_EXTRACTOR (FloatDiagMatrix, float_diag_matrix) | |
1424 DEF_VALUE_EXTRACTOR (ComplexDiagMatrix, complex_diag_matrix) | |
1425 DEF_VALUE_EXTRACTOR (FloatComplexDiagMatrix, float_complex_diag_matrix) | |
1426 DEF_VALUE_EXTRACTOR (PermMatrix, perm_matrix) | |
1427 | |
9789
97f5de91427b
support sparse templated extractors
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
1428 DEF_VALUE_EXTRACTOR (SparseMatrix, sparse_matrix) |
97f5de91427b
support sparse templated extractors
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
1429 DEF_VALUE_EXTRACTOR (SparseComplexMatrix, sparse_complex_matrix) |
97f5de91427b
support sparse templated extractors
Jaroslav Hajek <highegg@gmail.com>
parents:
9732
diff
changeset
|
1430 DEF_VALUE_EXTRACTOR (SparseBoolMatrix, sparse_bool_matrix) |
9657
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1431 #undef DEF_VALUE_EXTRACTOR |
3c1c3a38ec7b
implement templated octave_value extractor
Jaroslav Hajek <highegg@gmail.com>
parents:
9607
diff
changeset
|
1432 |
13733
b1186adb567e
Add dummy template specializations with a return value.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13294
diff
changeset
|
1433 #define DEF_DUMMY_VALUE_EXTRACTOR(VALUE,DEFVAL) \ |
b1186adb567e
Add dummy template specializations with a return value.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13294
diff
changeset
|
1434 template<> \ |
13736
deb69dab4514
Avoid some compilation warnings.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13733
diff
changeset
|
1435 inline VALUE octave_value_extract<VALUE> (const octave_value&) \ |
13733
b1186adb567e
Add dummy template specializations with a return value.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13294
diff
changeset
|
1436 { assert (false); return DEFVAL; } |
b1186adb567e
Add dummy template specializations with a return value.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13294
diff
changeset
|
1437 |
b1186adb567e
Add dummy template specializations with a return value.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13294
diff
changeset
|
1438 DEF_DUMMY_VALUE_EXTRACTOR (char, 0) |
b1186adb567e
Add dummy template specializations with a return value.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13294
diff
changeset
|
1439 DEF_DUMMY_VALUE_EXTRACTOR (octave_value, octave_value ()) |
b1186adb567e
Add dummy template specializations with a return value.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13294
diff
changeset
|
1440 #undef DEF_DUMMY_VALUE_EXTRACTOR |
b1186adb567e
Add dummy template specializations with a return value.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
13294
diff
changeset
|
1441 |
2376 | 1442 #endif |