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