Mercurial > octave-nkf
annotate src/ov-base.h @ 9813:8fa32b527d9a
improve & partially revert previous change
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Fri, 13 Nov 2009 11:45:39 +0100 |
parents | f80c566bc751 |
children | 1bb1ed717d2f |
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 |
2376 | 5 |
6 This file is part of Octave. | |
7 | |
8 Octave is free software; you can redistribute it and/or modify it | |
9 under the terms of the GNU General Public License as published by the | |
7016 | 10 Free Software Foundation; either version 3 of the License, or (at your |
11 option) any later version. | |
2376 | 12 |
13 Octave is distributed in the hope that it will be useful, but WITHOUT | |
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
16 for more details. | |
17 | |
18 You should have received a copy of the GNU General Public License | |
7016 | 19 along with Octave; see the file COPYING. If not, see |
20 <http://www.gnu.org/licenses/>. | |
2376 | 21 |
22 */ | |
23 | |
24 #if !defined (octave_base_value_h) | |
25 #define octave_base_value_h 1 | |
26 | |
27 #include <cstdlib> | |
28 | |
8950
d865363208d6
include <iosfwd> instead of <iostream> in header files
John W. Eaton <jwe@octave.org>
parents:
8920
diff
changeset
|
29 #include <iosfwd> |
5759 | 30 #include <list> |
2376 | 31 #include <string> |
32 | |
5759 | 33 #include "Range.h" |
5828 | 34 #include "data-conv.h" |
5900 | 35 #include "mxarray.h" |
2376 | 36 #include "mx-base.h" |
37 #include "str-vec.h" | |
38 | |
39 #include "error.h" | |
8676 | 40 #include "oct-hdf5.h" |
2376 | 41 |
3351 | 42 class Cell; |
2376 | 43 class Octave_map; |
5759 | 44 class octave_value; |
2376 | 45 class octave_value_list; |
5759 | 46 class octave_stream; |
47 class octave_function; | |
48 class octave_user_function; | |
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
|
49 class octave_user_script; |
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
|
50 class octave_user_code; |
5759 | 51 class octave_fcn_handle; |
52 class octave_fcn_inline; | |
53 class octave_value_list; | |
54 class octave_lvalue; | |
2376 | 55 |
56 class tree_walker; | |
57 | |
9685 | 58 enum builtin_type_t |
59 { | |
60 btyp_double, | |
61 btyp_float, | |
62 btyp_complex, | |
63 btyp_float_complex, | |
64 btyp_int8, | |
65 btyp_int16, | |
66 btyp_int32, | |
67 btyp_int64, | |
68 btyp_uint8, | |
69 btyp_uint16, | |
70 btyp_uint32, | |
71 btyp_uint64, | |
9790
a5035bc7fbfb
rewrite dispatch part & slightly improve min,max,cummin,cummax
Jaroslav Hajek <highegg@gmail.com>
parents:
9767
diff
changeset
|
72 btyp_bool, |
9685 | 73 btyp_char, |
9743
26abff55f6fe
optimize bsxfun for common built-in operations
Jaroslav Hajek <highegg@gmail.com>
parents:
9689
diff
changeset
|
74 btyp_unknown, |
26abff55f6fe
optimize bsxfun for common built-in operations
Jaroslav Hajek <highegg@gmail.com>
parents:
9689
diff
changeset
|
75 btyp_num_types = btyp_unknown |
9685 | 76 }; |
77 | |
9790
a5035bc7fbfb
rewrite dispatch part & slightly improve min,max,cummin,cummax
Jaroslav Hajek <highegg@gmail.com>
parents:
9767
diff
changeset
|
78 inline bool btyp_isnumeric (builtin_type_t btyp) |
a5035bc7fbfb
rewrite dispatch part & slightly improve min,max,cummin,cummax
Jaroslav Hajek <highegg@gmail.com>
parents:
9767
diff
changeset
|
79 { return btyp <= btyp_uint64; } |
a5035bc7fbfb
rewrite dispatch part & slightly improve min,max,cummin,cummax
Jaroslav Hajek <highegg@gmail.com>
parents:
9767
diff
changeset
|
80 |
a5035bc7fbfb
rewrite dispatch part & slightly improve min,max,cummin,cummax
Jaroslav Hajek <highegg@gmail.com>
parents:
9767
diff
changeset
|
81 // Compute a numeric type for a possibly mixed-type operation, using these rules: |
a5035bc7fbfb
rewrite dispatch part & slightly improve min,max,cummin,cummax
Jaroslav Hajek <highegg@gmail.com>
parents:
9767
diff
changeset
|
82 // bool -> double |
a5035bc7fbfb
rewrite dispatch part & slightly improve min,max,cummin,cummax
Jaroslav Hajek <highegg@gmail.com>
parents:
9767
diff
changeset
|
83 // single + double -> single |
a5035bc7fbfb
rewrite dispatch part & slightly improve min,max,cummin,cummax
Jaroslav Hajek <highegg@gmail.com>
parents:
9767
diff
changeset
|
84 // real + complex -> complex |
a5035bc7fbfb
rewrite dispatch part & slightly improve min,max,cummin,cummax
Jaroslav Hajek <highegg@gmail.com>
parents:
9767
diff
changeset
|
85 // integer + real -> integer |
a5035bc7fbfb
rewrite dispatch part & slightly improve min,max,cummin,cummax
Jaroslav Hajek <highegg@gmail.com>
parents:
9767
diff
changeset
|
86 // uint + uint -> uint (the bigger one) |
a5035bc7fbfb
rewrite dispatch part & slightly improve min,max,cummin,cummax
Jaroslav Hajek <highegg@gmail.com>
parents:
9767
diff
changeset
|
87 // sint + sint -> sint (the bigger one) |
a5035bc7fbfb
rewrite dispatch part & slightly improve min,max,cummin,cummax
Jaroslav Hajek <highegg@gmail.com>
parents:
9767
diff
changeset
|
88 // |
a5035bc7fbfb
rewrite dispatch part & slightly improve min,max,cummin,cummax
Jaroslav Hajek <highegg@gmail.com>
parents:
9767
diff
changeset
|
89 // failing otherwise. |
a5035bc7fbfb
rewrite dispatch part & slightly improve min,max,cummin,cummax
Jaroslav Hajek <highegg@gmail.com>
parents:
9767
diff
changeset
|
90 |
a5035bc7fbfb
rewrite dispatch part & slightly improve min,max,cummin,cummax
Jaroslav Hajek <highegg@gmail.com>
parents:
9767
diff
changeset
|
91 extern OCTINTERP_API |
a5035bc7fbfb
rewrite dispatch part & slightly improve min,max,cummin,cummax
Jaroslav Hajek <highegg@gmail.com>
parents:
9767
diff
changeset
|
92 builtin_type_t btyp_mixed_numeric (builtin_type_t x, builtin_type_t y); |
a5035bc7fbfb
rewrite dispatch part & slightly improve min,max,cummin,cummax
Jaroslav Hajek <highegg@gmail.com>
parents:
9767
diff
changeset
|
93 |
9685 | 94 template <class T> |
95 struct class_to_btyp | |
96 { | |
97 static const builtin_type_t btyp = btyp_unknown; | |
98 }; | |
99 | |
100 #define DEF_CLASS_TO_BTYP(CLASS,BTYP) \ | |
101 template <> \ | |
102 struct class_to_btyp<CLASS> \ | |
103 { static const builtin_type_t btyp = BTYP; } | |
104 | |
105 DEF_CLASS_TO_BTYP (double, btyp_double); | |
106 DEF_CLASS_TO_BTYP (float, btyp_float); | |
107 DEF_CLASS_TO_BTYP (Complex, btyp_complex); | |
108 DEF_CLASS_TO_BTYP (FloatComplex, btyp_float_complex); | |
109 DEF_CLASS_TO_BTYP (octave_int8, btyp_int8); | |
110 DEF_CLASS_TO_BTYP (octave_int16, btyp_int16); | |
111 DEF_CLASS_TO_BTYP (octave_int32, btyp_int32); | |
112 DEF_CLASS_TO_BTYP (octave_int64, btyp_int64); | |
113 DEF_CLASS_TO_BTYP (octave_uint8, btyp_uint8); | |
114 DEF_CLASS_TO_BTYP (octave_uint16, btyp_uint16); | |
115 DEF_CLASS_TO_BTYP (octave_uint32, btyp_uint32); | |
116 DEF_CLASS_TO_BTYP (octave_uint64, btyp_uint64); | |
117 DEF_CLASS_TO_BTYP (bool, btyp_bool); | |
118 DEF_CLASS_TO_BTYP (char, btyp_char); | |
119 | |
5759 | 120 // T_ID is the type id of struct objects, set by register_type(). |
121 // T_NAME is the type name of struct objects. | |
7067 | 122 |
5759 | 123 #define DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA \ |
7066 | 124 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA2 (OCTAVE_EMPTY_CPP_ARG) |
5759 | 125 |
126 #define DECLARE_OV_BASE_TYPEID_FUNCTIONS_AND_DATA \ | |
127 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA2(virtual) | |
128 | |
129 #define DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA2(VIRTUAL) \ | |
130 public: \ | |
131 VIRTUAL int type_id (void) const { return t_id; } \ | |
132 VIRTUAL std::string type_name (void) const { return t_name; } \ | |
133 VIRTUAL std::string class_name (void) const { return c_name; } \ | |
134 static int static_type_id (void) { return t_id; } \ | |
135 static std::string static_type_name (void) { return t_name; } \ | |
136 static std::string static_class_name (void) { return c_name; } \ | |
137 static void register_type (void); \ | |
138 \ | |
139 private: \ | |
140 static int t_id; \ | |
141 static const std::string t_name; \ | |
142 static const std::string c_name; | |
143 | |
144 | |
145 #define DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA(t, n, c) \ | |
146 int t::t_id (-1); \ | |
147 const std::string t::t_name (n); \ | |
148 const std::string t::c_name (c); \ | |
149 void t::register_type (void) \ | |
150 { \ | |
151 t_id = octave_value_typeinfo::register_type (t::t_name, \ | |
152 t::c_name, \ | |
153 octave_value (new t ())); \ | |
154 } | |
155 | |
2477 | 156 // A base value type, so that derived types only have to redefine what |
157 // they need (if they are derived from octave_base_value instead of | |
158 // octave_value). | |
2376 | 159 |
160 class | |
6109 | 161 OCTINTERP_API |
5759 | 162 octave_base_value |
2376 | 163 { |
164 public: | |
165 | |
5759 | 166 typedef octave_base_value * (*type_conv_fcn) (const octave_base_value&); |
167 | |
8345
c777f3ce02d8
smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
168 // type conversion, including result type information |
c777f3ce02d8
smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
169 class type_conv_info |
c777f3ce02d8
smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
170 { |
c777f3ce02d8
smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
171 public: |
c777f3ce02d8
smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
172 type_conv_info (type_conv_fcn f = 0, int t = -1) : _fcn (f), _type_id (t) { } |
c777f3ce02d8
smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
173 |
c777f3ce02d8
smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
174 operator type_conv_fcn (void) const { return _fcn; } |
c777f3ce02d8
smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
175 |
c777f3ce02d8
smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
176 octave_base_value * operator () (const octave_base_value &v) const |
c777f3ce02d8
smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
177 { return (*_fcn) (v); } |
c777f3ce02d8
smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
178 |
c777f3ce02d8
smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
179 int type_id (void) const { return _type_id; } |
c777f3ce02d8
smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
180 |
c777f3ce02d8
smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
181 private: |
c777f3ce02d8
smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
182 type_conv_fcn _fcn; |
c777f3ce02d8
smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
183 int _type_id; |
c777f3ce02d8
smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
184 }; |
c777f3ce02d8
smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
185 |
5759 | 186 friend class octave_value; |
2376 | 187 |
5759 | 188 octave_base_value (void) : count (1) { } |
189 | |
9521 | 190 octave_base_value (const octave_base_value&) : count (1) { } |
2376 | 191 |
5759 | 192 virtual ~octave_base_value (void) { } |
193 | |
9521 | 194 // Unconditional clone. Always clones. |
5759 | 195 virtual octave_base_value * |
196 clone (void) const { return new octave_base_value (*this); } | |
2376 | 197 |
9521 | 198 // Empty clone. |
5759 | 199 virtual octave_base_value * |
200 empty_clone (void) const { return new octave_base_value (); } | |
2376 | 201 |
9521 | 202 // Unique clone. Usually clones, but may be overriden to fake the |
203 // cloning when sharing copies is to be controlled from within an | |
204 // instance (see octave_class). | |
205 virtual octave_base_value * | |
206 unique_clone (void) { return clone (); } | |
207 | |
8345
c777f3ce02d8
smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
208 virtual type_conv_info |
5759 | 209 numeric_conversion_function (void) const |
8345
c777f3ce02d8
smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
210 { return type_conv_info (); } |
2410 | 211 |
8345
c777f3ce02d8
smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
212 virtual type_conv_info |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
213 numeric_demotion_function (void) const |
8345
c777f3ce02d8
smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
214 { return type_conv_info (); } |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
215 |
5759 | 216 virtual octave_value squeeze (void) const; |
217 | |
8458
d254a21e0120
reimplement full as method of octave_base_value
Jaroslav Hajek <highegg@gmail.com>
parents:
8437
diff
changeset
|
218 virtual octave_value full_value (void) const; |
d254a21e0120
reimplement full as method of octave_base_value
Jaroslav Hajek <highegg@gmail.com>
parents:
8437
diff
changeset
|
219 |
5759 | 220 virtual octave_base_value *try_narrowing_conversion (void) { return 0; } |
4532 | 221 |
8523
ad3afaaa19c1
implement non-copying contiguous range indexing
Jaroslav Hajek <highegg@gmail.com>
parents:
8458
diff
changeset
|
222 virtual void maybe_economize (void) { } |
ad3afaaa19c1
implement non-copying contiguous range indexing
Jaroslav Hajek <highegg@gmail.com>
parents:
8458
diff
changeset
|
223 |
9329
67fc970dad7d
improve indexed assignment using indexed numel
Jaroslav Hajek <highegg@gmail.com>
parents:
9182
diff
changeset
|
224 virtual Matrix size (void); |
67fc970dad7d
improve indexed assignment using indexed numel
Jaroslav Hajek <highegg@gmail.com>
parents:
9182
diff
changeset
|
225 |
67fc970dad7d
improve indexed assignment using indexed numel
Jaroslav Hajek <highegg@gmail.com>
parents:
9182
diff
changeset
|
226 virtual octave_idx_type numel (const octave_value_list&); |
67fc970dad7d
improve indexed assignment using indexed numel
Jaroslav Hajek <highegg@gmail.com>
parents:
9182
diff
changeset
|
227 |
5759 | 228 virtual octave_value |
229 subsref (const std::string& type, | |
230 const std::list<octave_value_list>& idx); | |
3933 | 231 |
5759 | 232 virtual octave_value_list |
233 subsref (const std::string& type, | |
234 const std::list<octave_value_list>& idx, | |
235 int nargout); | |
3933 | 236 |
5759 | 237 virtual octave_value |
8551
906f976d35a8
further improve struct&cell indexing & indexed assignment
Jaroslav Hajek <highegg@gmail.com>
parents:
8523
diff
changeset
|
238 subsref (const std::string& type, |
906f976d35a8
further improve struct&cell indexing & indexed assignment
Jaroslav Hajek <highegg@gmail.com>
parents:
8523
diff
changeset
|
239 const std::list<octave_value_list>& idx, |
906f976d35a8
further improve struct&cell indexing & indexed assignment
Jaroslav Hajek <highegg@gmail.com>
parents:
8523
diff
changeset
|
240 bool auto_add); |
906f976d35a8
further improve struct&cell indexing & indexed assignment
Jaroslav Hajek <highegg@gmail.com>
parents:
8523
diff
changeset
|
241 |
906f976d35a8
further improve struct&cell indexing & indexed assignment
Jaroslav Hajek <highegg@gmail.com>
parents:
8523
diff
changeset
|
242 virtual octave_value |
5885 | 243 do_index_op (const octave_value_list& idx, bool resize_ok = false); |
2974 | 244 |
5759 | 245 virtual octave_value_list |
3544 | 246 do_multi_index_op (int nargout, const octave_value_list& idx); |
2376 | 247 |
9147
5579998f8acf
Update to OOP facilities.
rtshort@bristlecone.phaselocked.com
parents:
9010
diff
changeset
|
248 virtual void assign (const std::string&, const octave_value&) { } |
5579998f8acf
Update to OOP facilities.
rtshort@bristlecone.phaselocked.com
parents:
9010
diff
changeset
|
249 |
5759 | 250 virtual octave_value |
251 subsasgn (const std::string& type, | |
252 const std::list<octave_value_list>& idx, | |
253 const octave_value& rhs); | |
2376 | 254 |
5759 | 255 virtual idx_vector index_vector (void) const; |
2376 | 256 |
5759 | 257 virtual dim_vector dims (void) const { return dim_vector (-1, -1); } |
4559 | 258 |
5759 | 259 octave_idx_type rows (void) const |
260 { | |
261 dim_vector dv = dims (); | |
5164 | 262 |
5759 | 263 return (dv.length () > 0) ? dv(0) : -1; |
264 } | |
4791 | 265 |
5759 | 266 octave_idx_type columns (void) const |
267 { | |
268 dim_vector dv = dims (); | |
5602 | 269 |
5759 | 270 return (dv.length () > 1) ? dv(1) : -1; |
271 } | |
5604 | 272 |
5759 | 273 virtual int ndims (void) const; |
4567 | 274 |
5759 | 275 virtual octave_idx_type numel (void) const { return dims ().numel (); } |
4593 | 276 |
5759 | 277 virtual octave_idx_type capacity (void) const { return numel (); } |
278 | |
279 virtual size_t byte_size (void) const { return 0; } | |
4915 | 280 |
5759 | 281 virtual octave_idx_type nnz (void) const; |
2376 | 282 |
5759 | 283 virtual octave_idx_type nzmax (void) const; |
284 | |
5900 | 285 virtual octave_idx_type nfields (void) const; |
286 | |
5759 | 287 virtual octave_value reshape (const dim_vector&) const; |
3351 | 288 |
5759 | 289 virtual octave_value permute (const Array<int>& vec, bool = false) const; |
2376 | 290 |
5759 | 291 virtual octave_value resize (const dim_vector&, bool fill = false) const; |
2376 | 292 |
5785 | 293 virtual MatrixType matrix_type (void) const; |
294 | |
295 virtual MatrixType matrix_type (const MatrixType& typ) const; | |
296 | |
5759 | 297 virtual bool is_defined (void) const { return false; } |
4505 | 298 |
5759 | 299 bool is_empty (void) const { return numel () == 0; } |
2376 | 300 |
5759 | 301 virtual bool is_cell (void) const { return false; } |
2376 | 302 |
6116 | 303 virtual bool is_cellstr (void) const { return false; } |
304 | |
5759 | 305 virtual bool is_real_scalar (void) const { return false; } |
4587 | 306 |
5759 | 307 virtual bool is_real_matrix (void) const { return false; } |
308 | |
309 virtual bool is_real_nd_array (void) const { return false; } | |
2376 | 310 |
5759 | 311 virtual bool is_complex_scalar (void) const { return false; } |
2376 | 312 |
5759 | 313 virtual bool is_complex_matrix (void) const { return false; } |
314 | |
5881 | 315 virtual bool is_bool_scalar (void) const { return false; } |
316 | |
5759 | 317 virtual bool is_bool_matrix (void) const { return false; } |
5279 | 318 |
5759 | 319 virtual bool is_char_matrix (void) const { return false; } |
2376 | 320 |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8345
diff
changeset
|
321 virtual bool is_diag_matrix (void) const { return false; } |
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8345
diff
changeset
|
322 |
8371
c3f7e2549abb
make det & inv aware of diagonal & permutation matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
8366
diff
changeset
|
323 virtual bool is_perm_matrix (void) const { return false; } |
c3f7e2549abb
make det & inv aware of diagonal & permutation matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
8366
diff
changeset
|
324 |
5759 | 325 virtual bool is_string (void) const { return false; } |
2376 | 326 |
5759 | 327 virtual bool is_sq_string (void) const { return false; } |
4643 | 328 |
5759 | 329 virtual bool is_range (void) const { return false; } |
3977 | 330 |
5759 | 331 virtual bool is_map (void) const { return false; } |
332 | |
7336 | 333 virtual bool is_object (void) const { return false; } |
334 | |
5759 | 335 virtual bool is_cs_list (void) const { return false; } |
2376 | 336 |
5759 | 337 virtual bool is_list (void) const { return false; } |
338 | |
339 virtual bool is_magic_colon (void) const { return false; } | |
2376 | 340 |
5759 | 341 virtual bool is_all_va_args (void) const { return false; } |
2376 | 342 |
5759 | 343 virtual octave_value all (int = 0) const; |
344 | |
345 virtual octave_value any (int = 0) const; | |
2376 | 346 |
9685 | 347 virtual builtin_type_t builtin_type (void) const { return btyp_unknown; } |
348 | |
5895 | 349 virtual bool is_double_type (void) const { return false; } |
350 | |
351 virtual bool is_single_type (void) const { return false; } | |
352 | |
7576 | 353 virtual bool is_float_type (void) const { return false; } |
354 | |
5895 | 355 virtual bool is_int8_type (void) const { return false; } |
356 | |
357 virtual bool is_int16_type (void) const { return false; } | |
358 | |
359 virtual bool is_int32_type (void) const { return false; } | |
360 | |
361 virtual bool is_int64_type (void) const { return false; } | |
362 | |
363 virtual bool is_uint8_type (void) const { return false; } | |
364 | |
365 virtual bool is_uint16_type (void) const { return false; } | |
366 | |
367 virtual bool is_uint32_type (void) const { return false; } | |
368 | |
369 virtual bool is_uint64_type (void) const { return false; } | |
370 | |
5759 | 371 virtual bool is_bool_type (void) const { return false; } |
3209 | 372 |
6223 | 373 virtual bool is_integer_type (void) const { return false; } |
374 | |
5759 | 375 virtual bool is_real_type (void) const { return false; } |
2376 | 376 |
5759 | 377 virtual bool is_complex_type (void) const { return false; } |
2376 | 378 |
379 // Would be nice to get rid of the next four functions: | |
380 | |
5759 | 381 virtual bool is_scalar_type (void) const { return false; } |
2376 | 382 |
5759 | 383 virtual bool is_matrix_type (void) const { return false; } |
2376 | 384 |
5759 | 385 virtual bool is_numeric_type (void) const { return false; } |
2376 | 386 |
5759 | 387 virtual bool is_sparse_type (void) const { return false; } |
5631 | 388 |
5759 | 389 virtual bool is_true (void) const { return false; } |
390 | |
8150
283989f2da9b
make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
7885
diff
changeset
|
391 virtual bool is_null_value (void) const { return false; } |
283989f2da9b
make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
7885
diff
changeset
|
392 |
5759 | 393 virtual bool is_constant (void) const { return false; } |
2376 | 394 |
5759 | 395 virtual bool is_function_handle (void) const { return false; } |
2376 | 396 |
5759 | 397 virtual bool is_inline_function (void) const { return false; } |
2974 | 398 |
5759 | 399 virtual bool is_function (void) const { return false; } |
4954 | 400 |
7336 | 401 virtual bool is_user_script (void) const { return false; } |
402 | |
403 virtual bool is_user_function (void) const { return false; } | |
404 | |
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
|
405 virtual bool is_user_code (void) const { return false; } |
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
|
406 |
5759 | 407 virtual bool is_builtin_function (void) const { return false; } |
2974 | 408 |
5759 | 409 virtual bool is_dld_function (void) const { return false; } |
3325 | 410 |
5864 | 411 virtual bool is_mex_function (void) const { return false; } |
412 | |
7876
8447a5024650
clear subfunctions when clearing parent function
John W. Eaton <jwe@octave.org>
parents:
7789
diff
changeset
|
413 virtual void erase_subfunctions (void) { } |
8447a5024650
clear subfunctions when clearing parent function
John W. Eaton <jwe@octave.org>
parents:
7789
diff
changeset
|
414 |
5759 | 415 virtual short int short_value (bool = false, bool = false) const; |
4254 | 416 |
5759 | 417 virtual unsigned short int ushort_value (bool = false, bool = false) const; |
4254 | 418 |
5759 | 419 virtual int int_value (bool = false, bool = false) const; |
3202 | 420 |
5759 | 421 virtual unsigned int uint_value (bool = false, bool = false) const; |
4254 | 422 |
5759 | 423 virtual int nint_value (bool = false) const; |
3202 | 424 |
5759 | 425 virtual long int long_value (bool = false, bool = false) const; |
4254 | 426 |
5759 | 427 virtual unsigned long int ulong_value (bool = false, bool = false) const; |
4254 | 428 |
5759 | 429 virtual double double_value (bool = false) const; |
2376 | 430 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
431 virtual float float_value (bool = false) const; |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
432 |
5759 | 433 virtual double scalar_value (bool frc_str_conv = false) const |
3145 | 434 { return double_value (frc_str_conv); } |
2376 | 435 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
436 virtual 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
|
437 { return float_value (frc_str_conv); } |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
438 |
5759 | 439 virtual Cell cell_value (void) const; |
3351 | 440 |
5759 | 441 virtual Matrix matrix_value (bool = false) const; |
3145 | 442 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
443 virtual FloatMatrix float_matrix_value (bool = false) const; |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
444 |
5759 | 445 virtual NDArray array_value (bool = false) const; |
4505 | 446 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
447 virtual FloatNDArray float_array_value (bool = false) const; |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
448 |
5759 | 449 virtual Complex complex_value (bool = false) const; |
2376 | 450 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
451 virtual FloatComplex float_complex_value (bool = false) const; |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
452 |
5759 | 453 virtual ComplexMatrix complex_matrix_value (bool = false) const; |
2376 | 454 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
455 virtual FloatComplexMatrix float_complex_matrix_value (bool = false) const; |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
456 |
5759 | 457 virtual ComplexNDArray complex_array_value (bool = false) const; |
4550 | 458 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
459 virtual FloatComplexNDArray float_complex_array_value (bool = false) const; |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
460 |
5943 | 461 virtual bool bool_value (bool = false) const; |
4550 | 462 |
5943 | 463 virtual boolMatrix bool_matrix_value (bool = false) const; |
4550 | 464 |
5943 | 465 virtual boolNDArray bool_array_value (bool = false) const; |
4550 | 466 |
5759 | 467 virtual charMatrix char_matrix_value (bool force = false) const; |
468 | |
469 virtual charNDArray char_array_value (bool = false) const; | |
2376 | 470 |
5759 | 471 virtual SparseMatrix sparse_matrix_value (bool = false) const; |
4550 | 472 |
5759 | 473 virtual SparseComplexMatrix sparse_complex_matrix_value (bool = false) const; |
5164 | 474 |
5759 | 475 virtual SparseBoolMatrix sparse_bool_matrix_value (bool = false) const; |
5164 | 476 |
8916
a2878ba31a9e
add diag & perm matrix query methods to octave_value
Jaroslav Hajek <highegg@gmail.com>
parents:
8734
diff
changeset
|
477 virtual DiagMatrix diag_matrix_value (bool = false) const; |
a2878ba31a9e
add diag & perm matrix query methods to octave_value
Jaroslav Hajek <highegg@gmail.com>
parents:
8734
diff
changeset
|
478 |
a2878ba31a9e
add diag & perm matrix query methods to octave_value
Jaroslav Hajek <highegg@gmail.com>
parents:
8734
diff
changeset
|
479 virtual FloatDiagMatrix float_diag_matrix_value (bool = false) const; |
a2878ba31a9e
add diag & perm matrix query methods to octave_value
Jaroslav Hajek <highegg@gmail.com>
parents:
8734
diff
changeset
|
480 |
a2878ba31a9e
add diag & perm matrix query methods to octave_value
Jaroslav Hajek <highegg@gmail.com>
parents:
8734
diff
changeset
|
481 virtual ComplexDiagMatrix complex_diag_matrix_value (bool = false) const; |
a2878ba31a9e
add diag & perm matrix query methods to octave_value
Jaroslav Hajek <highegg@gmail.com>
parents:
8734
diff
changeset
|
482 |
a2878ba31a9e
add diag & perm matrix query methods to octave_value
Jaroslav Hajek <highegg@gmail.com>
parents:
8734
diff
changeset
|
483 virtual FloatComplexDiagMatrix float_complex_diag_matrix_value (bool = false) const; |
a2878ba31a9e
add diag & perm matrix query methods to octave_value
Jaroslav Hajek <highegg@gmail.com>
parents:
8734
diff
changeset
|
484 |
a2878ba31a9e
add diag & perm matrix query methods to octave_value
Jaroslav Hajek <highegg@gmail.com>
parents:
8734
diff
changeset
|
485 virtual PermMatrix perm_matrix_value (void) const; |
a2878ba31a9e
add diag & perm matrix query methods to octave_value
Jaroslav Hajek <highegg@gmail.com>
parents:
8734
diff
changeset
|
486 |
5759 | 487 virtual octave_int8 int8_scalar_value (void) const; |
5164 | 488 |
5759 | 489 virtual octave_int16 int16_scalar_value (void) const; |
4910 | 490 |
5759 | 491 virtual octave_int32 int32_scalar_value (void) const; |
492 | |
493 virtual octave_int64 int64_scalar_value (void) const; | |
4910 | 494 |
5759 | 495 virtual octave_uint8 uint8_scalar_value (void) const; |
4910 | 496 |
5759 | 497 virtual octave_uint16 uint16_scalar_value (void) const; |
4910 | 498 |
5759 | 499 virtual octave_uint32 uint32_scalar_value (void) const; |
4910 | 500 |
5759 | 501 virtual octave_uint64 uint64_scalar_value (void) const; |
4910 | 502 |
5759 | 503 virtual int8NDArray int8_array_value (void) const; |
4910 | 504 |
5759 | 505 virtual int16NDArray int16_array_value (void) const; |
4910 | 506 |
5759 | 507 virtual int32NDArray int32_array_value (void) const; |
4906 | 508 |
5759 | 509 virtual int64NDArray int64_array_value (void) const; |
4906 | 510 |
5759 | 511 virtual uint8NDArray uint8_array_value (void) const; |
4906 | 512 |
5759 | 513 virtual uint16NDArray uint16_array_value (void) const; |
4906 | 514 |
5759 | 515 virtual uint32NDArray uint32_array_value (void) const; |
4906 | 516 |
5759 | 517 virtual uint64NDArray uint64_array_value (void) const; |
4906 | 518 |
5759 | 519 virtual string_vector all_strings (bool pad = false) const; |
4906 | 520 |
5759 | 521 virtual std::string string_value (bool force = false) const; |
4906 | 522 |
8732 | 523 virtual Array<std::string> cellstr_value (void) const; |
524 | |
5759 | 525 virtual Range range_value (void) const; |
2376 | 526 |
5759 | 527 virtual Octave_map map_value (void) const; |
2376 | 528 |
5759 | 529 virtual string_vector map_keys (void) const; |
2376 | 530 |
9151 | 531 virtual size_t nparents (void) const; |
532 | |
533 virtual std::list<std::string> parent_class_name_list (void) const; | |
534 | |
535 virtual string_vector parent_class_names (void) const; | |
9010
f914834836e7
Partial implementation of derived classes using the old form with "@" files.
rtshort@smoketree.phaselocked.com
parents:
8950
diff
changeset
|
536 |
f914834836e7
Partial implementation of derived classes using the old form with "@" files.
rtshort@smoketree.phaselocked.com
parents:
8950
diff
changeset
|
537 virtual octave_base_value *find_parent_class (const std::string&) |
f914834836e7
Partial implementation of derived classes using the old form with "@" files.
rtshort@smoketree.phaselocked.com
parents:
8950
diff
changeset
|
538 { return 0; } |
f914834836e7
Partial implementation of derived classes using the old form with "@" files.
rtshort@smoketree.phaselocked.com
parents:
8950
diff
changeset
|
539 |
9767
0df32e0b2074
fix base class field assignment
Jaroslav Hajek <highegg@gmail.com>
parents:
9743
diff
changeset
|
540 virtual octave_base_value *unique_parent_class (const std::string&) |
0df32e0b2074
fix base class field assignment
Jaroslav Hajek <highegg@gmail.com>
parents:
9743
diff
changeset
|
541 { return 0; } |
0df32e0b2074
fix base class field assignment
Jaroslav Hajek <highegg@gmail.com>
parents:
9743
diff
changeset
|
542 |
5759 | 543 virtual octave_function *function_value (bool silent = false); |
3933 | 544 |
7761
5adeea5de26c
symbol table reporting functions
John W. Eaton <jwe@octave.org>
parents:
7740
diff
changeset
|
545 virtual const octave_function *function_value (bool silent = false) const; |
5adeea5de26c
symbol table reporting functions
John W. Eaton <jwe@octave.org>
parents:
7740
diff
changeset
|
546 |
5759 | 547 virtual octave_user_function *user_function_value (bool silent = false); |
4645 | 548 |
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
|
549 virtual octave_user_script *user_script_value (bool silent = false); |
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
|
550 |
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
|
551 virtual octave_user_code *user_code_value (bool silent = false); |
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
|
552 |
5759 | 553 virtual octave_fcn_handle *fcn_handle_value (bool silent = false); |
4643 | 554 |
5759 | 555 virtual octave_fcn_inline *fcn_inline_value (bool silent = false); |
2974 | 556 |
5759 | 557 virtual octave_value_list list_value (void) const; |
4343 | 558 |
5759 | 559 virtual octave_value convert_to_str (bool pad = false, bool force = false, |
9689
34d6f005db4b
eliminate is_string argument from octave_value character array constructors
John W. Eaton <jwe@octave.org>
parents:
9685
diff
changeset
|
560 char type = '\'') const; |
5759 | 561 virtual octave_value |
562 convert_to_str_internal (bool pad, bool force, char type) const; | |
4933 | 563 |
5759 | 564 virtual void convert_to_row_or_column_vector (void); |
2882 | 565 |
5759 | 566 virtual bool print_as_scalar (void) const { return false; } |
2376 | 567 |
5759 | 568 virtual void print (std::ostream& os, bool pr_as_read_syntax = false) const; |
2376 | 569 |
5759 | 570 virtual void |
571 print_raw (std::ostream& os, bool pr_as_read_syntax = false) const; | |
4604 | 572 |
5759 | 573 virtual bool |
574 print_name_tag (std::ostream& os, const std::string& name) const; | |
2901 | 575 |
5759 | 576 virtual void |
577 print_with_name (std::ostream& output_buf, const std::string& name, | |
9521 | 578 bool print_padding = true); |
2376 | 579 |
5759 | 580 virtual void print_info (std::ostream& os, const std::string& prefix) const; |
3933 | 581 |
6974 | 582 virtual bool save_ascii (std::ostream& os); |
4687 | 583 |
5759 | 584 virtual bool load_ascii (std::istream& is); |
4687 | 585 |
5759 | 586 virtual bool save_binary (std::ostream& os, bool& save_as_floats); |
4687 | 587 |
5759 | 588 virtual bool load_binary (std::istream& is, bool swap, |
589 oct_mach_info::float_format fmt); | |
4687 | 590 |
591 #if defined (HAVE_HDF5) | |
5759 | 592 virtual bool |
593 save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats); | |
4687 | 594 |
5759 | 595 virtual bool |
596 load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug); | |
4687 | 597 #endif |
598 | |
5759 | 599 virtual int |
600 write (octave_stream& os, int block_size, | |
601 oct_data_conv::data_type output_type, int skip, | |
602 oct_mach_info::float_format flt_fmt) const; | |
603 | |
5900 | 604 virtual void *mex_get_data (void) const { return 0; } |
605 | |
606 virtual octave_idx_type *mex_get_ir (void) const { return 0; } | |
607 | |
608 virtual octave_idx_type *mex_get_jc (void) const { return 0; } | |
609 | |
610 virtual mxArray *as_mxArray (void) const; | |
611 | |
7620
36594d5bbe13
Move diag function into the octave_value class
David Bateman <dbateman@free.fr>
parents:
7576
diff
changeset
|
612 virtual 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
|
613 |
7433 | 614 virtual octave_value sort (octave_idx_type dim = 0, |
7463
2467639bd8c0
eliminate UNDEFINED sort mode
John W. Eaton <jwe@octave.org>
parents:
7433
diff
changeset
|
615 sortmode mode = ASCENDING) const; |
7433 | 616 virtual octave_value sort (Array<octave_idx_type> &sidx, |
617 octave_idx_type dim = 0, | |
7463
2467639bd8c0
eliminate UNDEFINED sort mode
John W. Eaton <jwe@octave.org>
parents:
7433
diff
changeset
|
618 sortmode mode = ASCENDING) const; |
7433 | 619 |
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
|
620 virtual sortmode is_sorted (sortmode mode = UNSORTED) const; |
8721
e9cb742df9eb
imported patch sort3.diff
Jaroslav Hajek <highegg@gmail.com>
parents:
8676
diff
changeset
|
621 |
8733
3ef774603887
rename all uses of sortrows_idx to sort_rows_idx
John W. Eaton <jwe@octave.org>
parents:
8732
diff
changeset
|
622 virtual Array<octave_idx_type> |
3ef774603887
rename all uses of sortrows_idx to sort_rows_idx
John W. Eaton <jwe@octave.org>
parents:
8732
diff
changeset
|
623 sort_rows_idx (sortmode mode = ASCENDING) const; |
8721
e9cb742df9eb
imported patch sort3.diff
Jaroslav Hajek <highegg@gmail.com>
parents:
8676
diff
changeset
|
624 |
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
|
625 virtual sortmode is_sorted_rows (sortmode mode = UNSORTED) const; |
8721
e9cb742df9eb
imported patch sort3.diff
Jaroslav Hajek <highegg@gmail.com>
parents:
8676
diff
changeset
|
626 |
7489
8e4592e49fa7
don't clear locked functions
John W. Eaton <jwe@octave.org>
parents:
7463
diff
changeset
|
627 virtual void lock (void); |
8e4592e49fa7
don't clear locked functions
John W. Eaton <jwe@octave.org>
parents:
7463
diff
changeset
|
628 |
8e4592e49fa7
don't clear locked functions
John W. Eaton <jwe@octave.org>
parents:
7463
diff
changeset
|
629 virtual void unlock (void); |
8e4592e49fa7
don't clear locked functions
John W. Eaton <jwe@octave.org>
parents:
7463
diff
changeset
|
630 |
8e4592e49fa7
don't clear locked functions
John W. Eaton <jwe@octave.org>
parents:
7463
diff
changeset
|
631 virtual bool islocked (void) const { return false; } |
8e4592e49fa7
don't clear locked functions
John W. Eaton <jwe@octave.org>
parents:
7463
diff
changeset
|
632 |
7761
5adeea5de26c
symbol table reporting functions
John W. Eaton <jwe@octave.org>
parents:
7740
diff
changeset
|
633 virtual void dump (std::ostream& os) const; |
5adeea5de26c
symbol table reporting functions
John W. Eaton <jwe@octave.org>
parents:
7740
diff
changeset
|
634 |
9813
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
635 // Standard mappers. Register new ones here. |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
636 enum unary_mapper_t |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
637 { |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
638 umap_abs, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
639 umap_acos, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
640 umap_acosh, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
641 umap_angle, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
642 umap_arg, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
643 umap_asin, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
644 umap_asinh, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
645 umap_atan, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
646 umap_atanh, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
647 umap_ceil, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
648 umap_conj, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
649 umap_cos, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
650 umap_cosh, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
651 umap_erf, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
652 umap_erfc, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
653 umap_exp, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
654 umap_expm1, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
655 umap_finite, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
656 umap_fix, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
657 umap_floor, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
658 umap_gamma, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
659 umap_imag, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
660 umap_isinf, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
661 umap_isna, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
662 umap_isnan, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
663 umap_lgamma, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
664 umap_log, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
665 umap_log2, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
666 umap_log10, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
667 umap_log1p, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
668 umap_real, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
669 umap_round, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
670 umap_roundb, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
671 umap_signum, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
672 umap_sin, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
673 umap_sinh, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
674 umap_sqrt, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
675 umap_tan, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
676 umap_tanh, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
677 umap_xisalnum, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
678 umap_xisalpha, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
679 umap_xisascii, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
680 umap_xiscntrl, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
681 umap_xisdigit, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
682 umap_xisgraph, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
683 umap_xislower, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
684 umap_xisprint, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
685 umap_xispunct, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
686 umap_xisspace, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
687 umap_xisupper, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
688 umap_xisxdigit, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
689 umap_xtoascii, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
690 umap_xtolower, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
691 umap_xtoupper, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
692 umap_unknown, |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
693 num_unary_mappers = umap_unknown |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
694 }; |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
695 |
9812
f80c566bc751
improve unary mapper system
Jaroslav Hajek <highegg@gmail.com>
parents:
9790
diff
changeset
|
696 virtual octave_value map (unary_mapper_t) const; |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
697 |
5759 | 698 protected: |
699 | |
700 // This should only be called for derived types. | |
701 | |
702 octave_value numeric_assign (const std::string& type, | |
703 const std::list<octave_value_list>& idx, | |
704 const octave_value& rhs); | |
705 | |
706 void reset_indent_level (void) const | |
707 { curr_print_indent_level = 0; } | |
708 | |
709 void increment_indent_level (void) const | |
710 { curr_print_indent_level += 2; } | |
711 | |
712 void decrement_indent_level (void) const | |
713 { curr_print_indent_level -= 2; } | |
714 | |
715 int current_print_indent_level (void) const | |
716 { return curr_print_indent_level; } | |
717 | |
718 void indent (std::ostream& os) const; | |
719 | |
720 void newline (std::ostream& os) const; | |
721 | |
722 void reset (void) const; | |
723 | |
724 // A reference count. | |
9521 | 725 // NOTE: the declaration is octave_idx_type because with 64-bit indexing, |
726 // it is well possible to have more than MAX_INT copies of a single value | |
727 // (think of an empty cell array with >2G elements). | |
728 octave_idx_type count; | |
4944 | 729 |
2376 | 730 private: |
731 | |
9813
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
732 static const char *get_umap_name (unary_mapper_t); |
8fa32b527d9a
improve & partially revert previous change
Jaroslav Hajek <highegg@gmail.com>
parents:
9812
diff
changeset
|
733 |
5759 | 734 static int curr_print_indent_level; |
735 static bool beginning_of_line; | |
736 | |
737 DECLARE_OV_BASE_TYPEID_FUNCTIONS_AND_DATA | |
2376 | 738 }; |
739 | |
7193 | 740 // TRUE means to perform automatic sparse to real mutation if there |
741 // is memory to be saved | |
742 extern bool Vsparse_auto_mutate; | |
743 | |
2376 | 744 #endif |
745 | |
746 /* | |
747 ;;; Local Variables: *** | |
748 ;;; mode: C++ *** | |
749 ;;; End: *** | |
750 */ |