Mercurial > octave-nkf
annotate src/ov-base.h @ 9685:e793865ede63
implement builtin_type
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Fri, 02 Oct 2009 08:27:44 +0200 |
parents | e08d72bb988e |
children | 34d6f005db4b |
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, | |
72 btyp_char, | |
73 btyp_bool, | |
74 btyp_unknown | |
75 }; | |
76 | |
77 template <class T> | |
78 struct class_to_btyp | |
79 { | |
80 static const builtin_type_t btyp = btyp_unknown; | |
81 }; | |
82 | |
83 #define DEF_CLASS_TO_BTYP(CLASS,BTYP) \ | |
84 template <> \ | |
85 struct class_to_btyp<CLASS> \ | |
86 { static const builtin_type_t btyp = BTYP; } | |
87 | |
88 DEF_CLASS_TO_BTYP (double, btyp_double); | |
89 DEF_CLASS_TO_BTYP (float, btyp_float); | |
90 DEF_CLASS_TO_BTYP (Complex, btyp_complex); | |
91 DEF_CLASS_TO_BTYP (FloatComplex, btyp_float_complex); | |
92 DEF_CLASS_TO_BTYP (octave_int8, btyp_int8); | |
93 DEF_CLASS_TO_BTYP (octave_int16, btyp_int16); | |
94 DEF_CLASS_TO_BTYP (octave_int32, btyp_int32); | |
95 DEF_CLASS_TO_BTYP (octave_int64, btyp_int64); | |
96 DEF_CLASS_TO_BTYP (octave_uint8, btyp_uint8); | |
97 DEF_CLASS_TO_BTYP (octave_uint16, btyp_uint16); | |
98 DEF_CLASS_TO_BTYP (octave_uint32, btyp_uint32); | |
99 DEF_CLASS_TO_BTYP (octave_uint64, btyp_uint64); | |
100 DEF_CLASS_TO_BTYP (bool, btyp_bool); | |
101 DEF_CLASS_TO_BTYP (char, btyp_char); | |
102 | |
5759 | 103 // T_ID is the type id of struct objects, set by register_type(). |
104 // T_NAME is the type name of struct objects. | |
7067 | 105 |
5759 | 106 #define DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA \ |
7066 | 107 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA2 (OCTAVE_EMPTY_CPP_ARG) |
5759 | 108 |
109 #define DECLARE_OV_BASE_TYPEID_FUNCTIONS_AND_DATA \ | |
110 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA2(virtual) | |
111 | |
112 #define DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA2(VIRTUAL) \ | |
113 public: \ | |
114 VIRTUAL int type_id (void) const { return t_id; } \ | |
115 VIRTUAL std::string type_name (void) const { return t_name; } \ | |
116 VIRTUAL std::string class_name (void) const { return c_name; } \ | |
117 static int static_type_id (void) { return t_id; } \ | |
118 static std::string static_type_name (void) { return t_name; } \ | |
119 static std::string static_class_name (void) { return c_name; } \ | |
120 static void register_type (void); \ | |
121 \ | |
122 private: \ | |
123 static int t_id; \ | |
124 static const std::string t_name; \ | |
125 static const std::string c_name; | |
126 | |
127 | |
128 #define DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA(t, n, c) \ | |
129 int t::t_id (-1); \ | |
130 const std::string t::t_name (n); \ | |
131 const std::string t::c_name (c); \ | |
132 void t::register_type (void) \ | |
133 { \ | |
134 t_id = octave_value_typeinfo::register_type (t::t_name, \ | |
135 t::c_name, \ | |
136 octave_value (new t ())); \ | |
137 } | |
138 | |
2477 | 139 // A base value type, so that derived types only have to redefine what |
140 // they need (if they are derived from octave_base_value instead of | |
141 // octave_value). | |
2376 | 142 |
143 class | |
6109 | 144 OCTINTERP_API |
5759 | 145 octave_base_value |
2376 | 146 { |
147 public: | |
148 | |
5759 | 149 typedef octave_base_value * (*type_conv_fcn) (const octave_base_value&); |
150 | |
8345
c777f3ce02d8
smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
151 // type conversion, including result type information |
c777f3ce02d8
smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
152 class type_conv_info |
c777f3ce02d8
smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
153 { |
c777f3ce02d8
smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
154 public: |
c777f3ce02d8
smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
155 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
|
156 |
c777f3ce02d8
smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
157 operator type_conv_fcn (void) const { return _fcn; } |
c777f3ce02d8
smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
158 |
c777f3ce02d8
smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
159 octave_base_value * operator () (const octave_base_value &v) const |
c777f3ce02d8
smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
160 { return (*_fcn) (v); } |
c777f3ce02d8
smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
161 |
c777f3ce02d8
smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
162 int type_id (void) const { return _type_id; } |
c777f3ce02d8
smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
163 |
c777f3ce02d8
smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
164 private: |
c777f3ce02d8
smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
165 type_conv_fcn _fcn; |
c777f3ce02d8
smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
166 int _type_id; |
c777f3ce02d8
smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
167 }; |
c777f3ce02d8
smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
168 |
5759 | 169 friend class octave_value; |
2376 | 170 |
5759 | 171 octave_base_value (void) : count (1) { } |
172 | |
9521 | 173 octave_base_value (const octave_base_value&) : count (1) { } |
2376 | 174 |
5759 | 175 virtual ~octave_base_value (void) { } |
176 | |
9521 | 177 // Unconditional clone. Always clones. |
5759 | 178 virtual octave_base_value * |
179 clone (void) const { return new octave_base_value (*this); } | |
2376 | 180 |
9521 | 181 // Empty clone. |
5759 | 182 virtual octave_base_value * |
183 empty_clone (void) const { return new octave_base_value (); } | |
2376 | 184 |
9521 | 185 // Unique clone. Usually clones, but may be overriden to fake the |
186 // cloning when sharing copies is to be controlled from within an | |
187 // instance (see octave_class). | |
188 virtual octave_base_value * | |
189 unique_clone (void) { return clone (); } | |
190 | |
8345
c777f3ce02d8
smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
191 virtual type_conv_info |
5759 | 192 numeric_conversion_function (void) const |
8345
c777f3ce02d8
smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
193 { return type_conv_info (); } |
2410 | 194 |
8345
c777f3ce02d8
smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
195 virtual type_conv_info |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
196 numeric_demotion_function (void) const |
8345
c777f3ce02d8
smarter conversion lookup
Jaroslav Hajek <highegg@gmail.com>
parents:
8150
diff
changeset
|
197 { return type_conv_info (); } |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
198 |
5759 | 199 virtual octave_value squeeze (void) const; |
200 | |
8458
d254a21e0120
reimplement full as method of octave_base_value
Jaroslav Hajek <highegg@gmail.com>
parents:
8437
diff
changeset
|
201 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
|
202 |
5759 | 203 virtual octave_base_value *try_narrowing_conversion (void) { return 0; } |
4532 | 204 |
8523
ad3afaaa19c1
implement non-copying contiguous range indexing
Jaroslav Hajek <highegg@gmail.com>
parents:
8458
diff
changeset
|
205 virtual void maybe_economize (void) { } |
ad3afaaa19c1
implement non-copying contiguous range indexing
Jaroslav Hajek <highegg@gmail.com>
parents:
8458
diff
changeset
|
206 |
9329
67fc970dad7d
improve indexed assignment using indexed numel
Jaroslav Hajek <highegg@gmail.com>
parents:
9182
diff
changeset
|
207 virtual Matrix size (void); |
67fc970dad7d
improve indexed assignment using indexed numel
Jaroslav Hajek <highegg@gmail.com>
parents:
9182
diff
changeset
|
208 |
67fc970dad7d
improve indexed assignment using indexed numel
Jaroslav Hajek <highegg@gmail.com>
parents:
9182
diff
changeset
|
209 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
|
210 |
5759 | 211 virtual octave_value |
212 subsref (const std::string& type, | |
213 const std::list<octave_value_list>& idx); | |
3933 | 214 |
5759 | 215 virtual octave_value_list |
216 subsref (const std::string& type, | |
217 const std::list<octave_value_list>& idx, | |
218 int nargout); | |
3933 | 219 |
5759 | 220 virtual octave_value |
8551
906f976d35a8
further improve struct&cell indexing & indexed assignment
Jaroslav Hajek <highegg@gmail.com>
parents:
8523
diff
changeset
|
221 subsref (const std::string& type, |
906f976d35a8
further improve struct&cell indexing & indexed assignment
Jaroslav Hajek <highegg@gmail.com>
parents:
8523
diff
changeset
|
222 const std::list<octave_value_list>& idx, |
906f976d35a8
further improve struct&cell indexing & indexed assignment
Jaroslav Hajek <highegg@gmail.com>
parents:
8523
diff
changeset
|
223 bool auto_add); |
906f976d35a8
further improve struct&cell indexing & indexed assignment
Jaroslav Hajek <highegg@gmail.com>
parents:
8523
diff
changeset
|
224 |
906f976d35a8
further improve struct&cell indexing & indexed assignment
Jaroslav Hajek <highegg@gmail.com>
parents:
8523
diff
changeset
|
225 virtual octave_value |
5885 | 226 do_index_op (const octave_value_list& idx, bool resize_ok = false); |
2974 | 227 |
5759 | 228 virtual octave_value_list |
3544 | 229 do_multi_index_op (int nargout, const octave_value_list& idx); |
2376 | 230 |
9147
5579998f8acf
Update to OOP facilities.
rtshort@bristlecone.phaselocked.com
parents:
9010
diff
changeset
|
231 virtual void assign (const std::string&, const octave_value&) { } |
5579998f8acf
Update to OOP facilities.
rtshort@bristlecone.phaselocked.com
parents:
9010
diff
changeset
|
232 |
5759 | 233 virtual octave_value |
234 subsasgn (const std::string& type, | |
235 const std::list<octave_value_list>& idx, | |
236 const octave_value& rhs); | |
2376 | 237 |
5759 | 238 virtual idx_vector index_vector (void) const; |
2376 | 239 |
5759 | 240 virtual dim_vector dims (void) const { return dim_vector (-1, -1); } |
4559 | 241 |
5759 | 242 octave_idx_type rows (void) const |
243 { | |
244 dim_vector dv = dims (); | |
5164 | 245 |
5759 | 246 return (dv.length () > 0) ? dv(0) : -1; |
247 } | |
4791 | 248 |
5759 | 249 octave_idx_type columns (void) const |
250 { | |
251 dim_vector dv = dims (); | |
5602 | 252 |
5759 | 253 return (dv.length () > 1) ? dv(1) : -1; |
254 } | |
5604 | 255 |
5759 | 256 virtual int ndims (void) const; |
4567 | 257 |
5759 | 258 virtual octave_idx_type numel (void) const { return dims ().numel (); } |
4593 | 259 |
5759 | 260 virtual octave_idx_type capacity (void) const { return numel (); } |
261 | |
262 virtual size_t byte_size (void) const { return 0; } | |
4915 | 263 |
5759 | 264 virtual octave_idx_type nnz (void) const; |
2376 | 265 |
5759 | 266 virtual octave_idx_type nzmax (void) const; |
267 | |
5900 | 268 virtual octave_idx_type nfields (void) const; |
269 | |
5759 | 270 virtual octave_value reshape (const dim_vector&) const; |
3351 | 271 |
5759 | 272 virtual octave_value permute (const Array<int>& vec, bool = false) const; |
2376 | 273 |
5759 | 274 virtual octave_value resize (const dim_vector&, bool fill = false) const; |
2376 | 275 |
5785 | 276 virtual MatrixType matrix_type (void) const; |
277 | |
278 virtual MatrixType matrix_type (const MatrixType& typ) const; | |
279 | |
5759 | 280 virtual bool is_defined (void) const { return false; } |
4505 | 281 |
5759 | 282 bool is_empty (void) const { return numel () == 0; } |
2376 | 283 |
5759 | 284 virtual bool is_cell (void) const { return false; } |
2376 | 285 |
6116 | 286 virtual bool is_cellstr (void) const { return false; } |
287 | |
5759 | 288 virtual bool is_real_scalar (void) const { return false; } |
4587 | 289 |
5759 | 290 virtual bool is_real_matrix (void) const { return false; } |
291 | |
292 virtual bool is_real_nd_array (void) const { return false; } | |
2376 | 293 |
5759 | 294 virtual bool is_complex_scalar (void) const { return false; } |
2376 | 295 |
5759 | 296 virtual bool is_complex_matrix (void) const { return false; } |
297 | |
5881 | 298 virtual bool is_bool_scalar (void) const { return false; } |
299 | |
5759 | 300 virtual bool is_bool_matrix (void) const { return false; } |
5279 | 301 |
5759 | 302 virtual bool is_char_matrix (void) const { return false; } |
2376 | 303 |
8366
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8345
diff
changeset
|
304 virtual bool is_diag_matrix (void) const { return false; } |
8b1a2555c4e2
implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
8345
diff
changeset
|
305 |
8371
c3f7e2549abb
make det & inv aware of diagonal & permutation matrices
Jaroslav Hajek <highegg@gmail.com>
parents:
8366
diff
changeset
|
306 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
|
307 |
5759 | 308 virtual bool is_string (void) const { return false; } |
2376 | 309 |
5759 | 310 virtual bool is_sq_string (void) const { return false; } |
4643 | 311 |
5759 | 312 virtual bool is_range (void) const { return false; } |
3977 | 313 |
5759 | 314 virtual bool is_map (void) const { return false; } |
315 | |
7336 | 316 virtual bool is_object (void) const { return false; } |
317 | |
5759 | 318 virtual bool is_cs_list (void) const { return false; } |
2376 | 319 |
5759 | 320 virtual bool is_list (void) const { return false; } |
321 | |
322 virtual bool is_magic_colon (void) const { return false; } | |
2376 | 323 |
5759 | 324 virtual bool is_all_va_args (void) const { return false; } |
2376 | 325 |
5759 | 326 virtual octave_value all (int = 0) const; |
327 | |
328 virtual octave_value any (int = 0) const; | |
2376 | 329 |
9685 | 330 virtual builtin_type_t builtin_type (void) const { return btyp_unknown; } |
331 | |
5895 | 332 virtual bool is_double_type (void) const { return false; } |
333 | |
334 virtual bool is_single_type (void) const { return false; } | |
335 | |
7576 | 336 virtual bool is_float_type (void) const { return false; } |
337 | |
5895 | 338 virtual bool is_int8_type (void) const { return false; } |
339 | |
340 virtual bool is_int16_type (void) const { return false; } | |
341 | |
342 virtual bool is_int32_type (void) const { return false; } | |
343 | |
344 virtual bool is_int64_type (void) const { return false; } | |
345 | |
346 virtual bool is_uint8_type (void) const { return false; } | |
347 | |
348 virtual bool is_uint16_type (void) const { return false; } | |
349 | |
350 virtual bool is_uint32_type (void) const { return false; } | |
351 | |
352 virtual bool is_uint64_type (void) const { return false; } | |
353 | |
5759 | 354 virtual bool is_bool_type (void) const { return false; } |
3209 | 355 |
6223 | 356 virtual bool is_integer_type (void) const { return false; } |
357 | |
5759 | 358 virtual bool is_real_type (void) const { return false; } |
2376 | 359 |
5759 | 360 virtual bool is_complex_type (void) const { return false; } |
2376 | 361 |
362 // Would be nice to get rid of the next four functions: | |
363 | |
5759 | 364 virtual bool is_scalar_type (void) const { return false; } |
2376 | 365 |
5759 | 366 virtual bool is_matrix_type (void) const { return false; } |
2376 | 367 |
5759 | 368 virtual bool is_numeric_type (void) const { return false; } |
2376 | 369 |
5759 | 370 virtual bool is_sparse_type (void) const { return false; } |
5631 | 371 |
5759 | 372 virtual bool is_true (void) const { return false; } |
373 | |
8150
283989f2da9b
make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
7885
diff
changeset
|
374 virtual bool is_null_value (void) const { return false; } |
283989f2da9b
make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents:
7885
diff
changeset
|
375 |
5759 | 376 virtual bool is_constant (void) const { return false; } |
2376 | 377 |
5759 | 378 virtual bool is_function_handle (void) const { return false; } |
2376 | 379 |
5759 | 380 virtual bool is_inline_function (void) const { return false; } |
2974 | 381 |
5759 | 382 virtual bool is_function (void) const { return false; } |
4954 | 383 |
7336 | 384 virtual bool is_user_script (void) const { return false; } |
385 | |
386 virtual bool is_user_function (void) const { return false; } | |
387 | |
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
|
388 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
|
389 |
5759 | 390 virtual bool is_builtin_function (void) const { return false; } |
2974 | 391 |
5759 | 392 virtual bool is_dld_function (void) const { return false; } |
3325 | 393 |
5864 | 394 virtual bool is_mex_function (void) const { return false; } |
395 | |
7876
8447a5024650
clear subfunctions when clearing parent function
John W. Eaton <jwe@octave.org>
parents:
7789
diff
changeset
|
396 virtual void erase_subfunctions (void) { } |
8447a5024650
clear subfunctions when clearing parent function
John W. Eaton <jwe@octave.org>
parents:
7789
diff
changeset
|
397 |
5759 | 398 virtual short int short_value (bool = false, bool = false) const; |
4254 | 399 |
5759 | 400 virtual unsigned short int ushort_value (bool = false, bool = false) const; |
4254 | 401 |
5759 | 402 virtual int int_value (bool = false, bool = false) const; |
3202 | 403 |
5759 | 404 virtual unsigned int uint_value (bool = false, bool = false) const; |
4254 | 405 |
5759 | 406 virtual int nint_value (bool = false) const; |
3202 | 407 |
5759 | 408 virtual long int long_value (bool = false, bool = false) const; |
4254 | 409 |
5759 | 410 virtual unsigned long int ulong_value (bool = false, bool = false) const; |
4254 | 411 |
5759 | 412 virtual double double_value (bool = false) const; |
2376 | 413 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
414 virtual float float_value (bool = false) const; |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
415 |
5759 | 416 virtual double scalar_value (bool frc_str_conv = false) const |
3145 | 417 { return double_value (frc_str_conv); } |
2376 | 418 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
419 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
|
420 { return float_value (frc_str_conv); } |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
421 |
5759 | 422 virtual Cell cell_value (void) const; |
3351 | 423 |
5759 | 424 virtual Matrix matrix_value (bool = false) const; |
3145 | 425 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
426 virtual FloatMatrix float_matrix_value (bool = false) const; |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
427 |
5759 | 428 virtual NDArray array_value (bool = false) const; |
4505 | 429 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
430 virtual FloatNDArray float_array_value (bool = false) const; |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
431 |
5759 | 432 virtual Complex complex_value (bool = false) const; |
2376 | 433 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
434 virtual FloatComplex float_complex_value (bool = false) const; |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
435 |
5759 | 436 virtual ComplexMatrix complex_matrix_value (bool = false) const; |
2376 | 437 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
438 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
|
439 |
5759 | 440 virtual ComplexNDArray complex_array_value (bool = false) const; |
4550 | 441 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
442 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
|
443 |
5943 | 444 virtual bool bool_value (bool = false) const; |
4550 | 445 |
5943 | 446 virtual boolMatrix bool_matrix_value (bool = false) const; |
4550 | 447 |
5943 | 448 virtual boolNDArray bool_array_value (bool = false) const; |
4550 | 449 |
5759 | 450 virtual charMatrix char_matrix_value (bool force = false) const; |
451 | |
452 virtual charNDArray char_array_value (bool = false) const; | |
2376 | 453 |
5759 | 454 virtual SparseMatrix sparse_matrix_value (bool = false) const; |
4550 | 455 |
5759 | 456 virtual SparseComplexMatrix sparse_complex_matrix_value (bool = false) const; |
5164 | 457 |
5759 | 458 virtual SparseBoolMatrix sparse_bool_matrix_value (bool = false) const; |
5164 | 459 |
8916
a2878ba31a9e
add diag & perm matrix query methods to octave_value
Jaroslav Hajek <highegg@gmail.com>
parents:
8734
diff
changeset
|
460 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
|
461 |
a2878ba31a9e
add diag & perm matrix query methods to octave_value
Jaroslav Hajek <highegg@gmail.com>
parents:
8734
diff
changeset
|
462 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
|
463 |
a2878ba31a9e
add diag & perm matrix query methods to octave_value
Jaroslav Hajek <highegg@gmail.com>
parents:
8734
diff
changeset
|
464 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
|
465 |
a2878ba31a9e
add diag & perm matrix query methods to octave_value
Jaroslav Hajek <highegg@gmail.com>
parents:
8734
diff
changeset
|
466 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
|
467 |
a2878ba31a9e
add diag & perm matrix query methods to octave_value
Jaroslav Hajek <highegg@gmail.com>
parents:
8734
diff
changeset
|
468 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
|
469 |
5759 | 470 virtual octave_int8 int8_scalar_value (void) const; |
5164 | 471 |
5759 | 472 virtual octave_int16 int16_scalar_value (void) const; |
4910 | 473 |
5759 | 474 virtual octave_int32 int32_scalar_value (void) const; |
475 | |
476 virtual octave_int64 int64_scalar_value (void) const; | |
4910 | 477 |
5759 | 478 virtual octave_uint8 uint8_scalar_value (void) const; |
4910 | 479 |
5759 | 480 virtual octave_uint16 uint16_scalar_value (void) const; |
4910 | 481 |
5759 | 482 virtual octave_uint32 uint32_scalar_value (void) const; |
4910 | 483 |
5759 | 484 virtual octave_uint64 uint64_scalar_value (void) const; |
4910 | 485 |
5759 | 486 virtual int8NDArray int8_array_value (void) const; |
4910 | 487 |
5759 | 488 virtual int16NDArray int16_array_value (void) const; |
4910 | 489 |
5759 | 490 virtual int32NDArray int32_array_value (void) const; |
4906 | 491 |
5759 | 492 virtual int64NDArray int64_array_value (void) const; |
4906 | 493 |
5759 | 494 virtual uint8NDArray uint8_array_value (void) const; |
4906 | 495 |
5759 | 496 virtual uint16NDArray uint16_array_value (void) const; |
4906 | 497 |
5759 | 498 virtual uint32NDArray uint32_array_value (void) const; |
4906 | 499 |
5759 | 500 virtual uint64NDArray uint64_array_value (void) const; |
4906 | 501 |
5759 | 502 virtual string_vector all_strings (bool pad = false) const; |
4906 | 503 |
5759 | 504 virtual std::string string_value (bool force = false) const; |
4906 | 505 |
8732 | 506 virtual Array<std::string> cellstr_value (void) const; |
507 | |
5759 | 508 virtual Range range_value (void) const; |
2376 | 509 |
5759 | 510 virtual Octave_map map_value (void) const; |
2376 | 511 |
5759 | 512 virtual string_vector map_keys (void) const; |
2376 | 513 |
9151 | 514 virtual size_t nparents (void) const; |
515 | |
516 virtual std::list<std::string> parent_class_name_list (void) const; | |
517 | |
518 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
|
519 |
f914834836e7
Partial implementation of derived classes using the old form with "@" files.
rtshort@smoketree.phaselocked.com
parents:
8950
diff
changeset
|
520 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
|
521 { return 0; } |
f914834836e7
Partial implementation of derived classes using the old form with "@" files.
rtshort@smoketree.phaselocked.com
parents:
8950
diff
changeset
|
522 |
5759 | 523 virtual octave_function *function_value (bool silent = false); |
3933 | 524 |
7761
5adeea5de26c
symbol table reporting functions
John W. Eaton <jwe@octave.org>
parents:
7740
diff
changeset
|
525 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
|
526 |
5759 | 527 virtual octave_user_function *user_function_value (bool silent = false); |
4645 | 528 |
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
|
529 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
|
530 |
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
|
531 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
|
532 |
5759 | 533 virtual octave_fcn_handle *fcn_handle_value (bool silent = false); |
4643 | 534 |
5759 | 535 virtual octave_fcn_inline *fcn_inline_value (bool silent = false); |
2974 | 536 |
5759 | 537 virtual octave_value_list list_value (void) const; |
4343 | 538 |
5759 | 539 virtual octave_value convert_to_str (bool pad = false, bool force = false, |
540 char type = '"') const; | |
541 virtual octave_value | |
542 convert_to_str_internal (bool pad, bool force, char type) const; | |
4933 | 543 |
5759 | 544 virtual void convert_to_row_or_column_vector (void); |
2882 | 545 |
5759 | 546 virtual bool print_as_scalar (void) const { return false; } |
2376 | 547 |
5759 | 548 virtual void print (std::ostream& os, bool pr_as_read_syntax = false) const; |
2376 | 549 |
5759 | 550 virtual void |
551 print_raw (std::ostream& os, bool pr_as_read_syntax = false) const; | |
4604 | 552 |
5759 | 553 virtual bool |
554 print_name_tag (std::ostream& os, const std::string& name) const; | |
2901 | 555 |
5759 | 556 virtual void |
557 print_with_name (std::ostream& output_buf, const std::string& name, | |
9521 | 558 bool print_padding = true); |
2376 | 559 |
5759 | 560 virtual void print_info (std::ostream& os, const std::string& prefix) const; |
3933 | 561 |
6974 | 562 virtual bool save_ascii (std::ostream& os); |
4687 | 563 |
5759 | 564 virtual bool load_ascii (std::istream& is); |
4687 | 565 |
5759 | 566 virtual bool save_binary (std::ostream& os, bool& save_as_floats); |
4687 | 567 |
5759 | 568 virtual bool load_binary (std::istream& is, bool swap, |
569 oct_mach_info::float_format fmt); | |
4687 | 570 |
571 #if defined (HAVE_HDF5) | |
5759 | 572 virtual bool |
573 save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats); | |
4687 | 574 |
5759 | 575 virtual bool |
576 load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug); | |
4687 | 577 #endif |
578 | |
5759 | 579 virtual int |
580 write (octave_stream& os, int block_size, | |
581 oct_data_conv::data_type output_type, int skip, | |
582 oct_mach_info::float_format flt_fmt) const; | |
583 | |
5900 | 584 virtual void *mex_get_data (void) const { return 0; } |
585 | |
586 virtual octave_idx_type *mex_get_ir (void) const { return 0; } | |
587 | |
588 virtual octave_idx_type *mex_get_jc (void) const { return 0; } | |
589 | |
590 virtual mxArray *as_mxArray (void) const; | |
591 | |
7620
36594d5bbe13
Move diag function into the octave_value class
David Bateman <dbateman@free.fr>
parents:
7576
diff
changeset
|
592 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
|
593 |
7433 | 594 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
|
595 sortmode mode = ASCENDING) const; |
7433 | 596 virtual octave_value sort (Array<octave_idx_type> &sidx, |
597 octave_idx_type dim = 0, | |
7463
2467639bd8c0
eliminate UNDEFINED sort mode
John W. Eaton <jwe@octave.org>
parents:
7433
diff
changeset
|
598 sortmode mode = ASCENDING) const; |
7433 | 599 |
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
|
600 virtual sortmode is_sorted (sortmode mode = UNSORTED) const; |
8721
e9cb742df9eb
imported patch sort3.diff
Jaroslav Hajek <highegg@gmail.com>
parents:
8676
diff
changeset
|
601 |
8733
3ef774603887
rename all uses of sortrows_idx to sort_rows_idx
John W. Eaton <jwe@octave.org>
parents:
8732
diff
changeset
|
602 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
|
603 sort_rows_idx (sortmode mode = ASCENDING) const; |
8721
e9cb742df9eb
imported patch sort3.diff
Jaroslav Hajek <highegg@gmail.com>
parents:
8676
diff
changeset
|
604 |
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
|
605 virtual sortmode is_sorted_rows (sortmode mode = UNSORTED) const; |
8721
e9cb742df9eb
imported patch sort3.diff
Jaroslav Hajek <highegg@gmail.com>
parents:
8676
diff
changeset
|
606 |
7489
8e4592e49fa7
don't clear locked functions
John W. Eaton <jwe@octave.org>
parents:
7463
diff
changeset
|
607 virtual void lock (void); |
8e4592e49fa7
don't clear locked functions
John W. Eaton <jwe@octave.org>
parents:
7463
diff
changeset
|
608 |
8e4592e49fa7
don't clear locked functions
John W. Eaton <jwe@octave.org>
parents:
7463
diff
changeset
|
609 virtual void unlock (void); |
8e4592e49fa7
don't clear locked functions
John W. Eaton <jwe@octave.org>
parents:
7463
diff
changeset
|
610 |
8e4592e49fa7
don't clear locked functions
John W. Eaton <jwe@octave.org>
parents:
7463
diff
changeset
|
611 virtual bool islocked (void) const { return false; } |
8e4592e49fa7
don't clear locked functions
John W. Eaton <jwe@octave.org>
parents:
7463
diff
changeset
|
612 |
7761
5adeea5de26c
symbol table reporting functions
John W. Eaton <jwe@octave.org>
parents:
7740
diff
changeset
|
613 virtual void dump (std::ostream& os) const; |
5adeea5de26c
symbol table reporting functions
John W. Eaton <jwe@octave.org>
parents:
7740
diff
changeset
|
614 |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
615 virtual octave_value abs (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
616 virtual octave_value acos (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
617 virtual octave_value acosh (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
618 virtual octave_value angle (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
619 virtual octave_value arg (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
620 virtual octave_value asin (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
621 virtual octave_value asinh (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
622 virtual octave_value atan (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
623 virtual octave_value atanh (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
624 virtual octave_value ceil (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
625 virtual octave_value conj (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
626 virtual octave_value cos (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
627 virtual octave_value cosh (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
628 virtual octave_value erf (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
629 virtual octave_value erfc (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
630 virtual octave_value exp (void) const; |
7638
2df457529cfa
implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7636
diff
changeset
|
631 virtual octave_value expm1 (void) const; |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
632 virtual octave_value finite (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
633 virtual octave_value fix (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
634 virtual octave_value floor (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
635 virtual octave_value gamma (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
636 virtual octave_value imag (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
637 virtual octave_value isinf (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
638 virtual octave_value isna (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
639 virtual octave_value isnan (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
640 virtual octave_value lgamma (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
641 virtual octave_value log (void) const; |
7740 | 642 virtual octave_value log2 (void) const; |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
643 virtual octave_value log10 (void) const; |
7638
2df457529cfa
implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7636
diff
changeset
|
644 virtual octave_value log1p (void) const; |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
645 virtual octave_value real (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
646 virtual octave_value round (void) const; |
7636
99c410f7f0b0
implement mapper function for banker's rounding
Jaroslav Hajek <highegg@gmail.com>
parents:
7620
diff
changeset
|
647 virtual octave_value roundb (void) const; |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
648 virtual octave_value signum (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
649 virtual octave_value sin (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
650 virtual octave_value sinh (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
651 virtual octave_value sqrt (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
652 virtual octave_value tan (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
653 virtual octave_value tanh (void) const; |
7528
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
654 |
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
655 // These functions are prefixed with X to avoid potential macro |
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
656 // conflicts. |
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
657 |
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
658 virtual octave_value xisalnum (void) const; |
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
659 virtual octave_value xisalpha (void) const; |
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
660 virtual octave_value xisascii (void) const; |
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
661 virtual octave_value xiscntrl (void) const; |
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
662 virtual octave_value xisdigit (void) const; |
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
663 virtual octave_value xisgraph (void) const; |
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
664 virtual octave_value xislower (void) const; |
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
665 virtual octave_value xisprint (void) const; |
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
666 virtual octave_value xispunct (void) const; |
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
667 virtual octave_value xisspace (void) const; |
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
668 virtual octave_value xisupper (void) const; |
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
669 virtual octave_value xisxdigit (void) const; |
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
670 virtual octave_value xtoascii (void) const; |
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
671 virtual octave_value xtolower (void) const; |
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
672 virtual octave_value xtoupper (void) const; |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
673 |
5759 | 674 protected: |
675 | |
676 // This should only be called for derived types. | |
677 | |
678 octave_value numeric_assign (const std::string& type, | |
679 const std::list<octave_value_list>& idx, | |
680 const octave_value& rhs); | |
681 | |
682 void reset_indent_level (void) const | |
683 { curr_print_indent_level = 0; } | |
684 | |
685 void increment_indent_level (void) const | |
686 { curr_print_indent_level += 2; } | |
687 | |
688 void decrement_indent_level (void) const | |
689 { curr_print_indent_level -= 2; } | |
690 | |
691 int current_print_indent_level (void) const | |
692 { return curr_print_indent_level; } | |
693 | |
694 void indent (std::ostream& os) const; | |
695 | |
696 void newline (std::ostream& os) const; | |
697 | |
698 void reset (void) const; | |
699 | |
700 // A reference count. | |
9521 | 701 // NOTE: the declaration is octave_idx_type because with 64-bit indexing, |
702 // it is well possible to have more than MAX_INT copies of a single value | |
703 // (think of an empty cell array with >2G elements). | |
704 octave_idx_type count; | |
4944 | 705 |
2376 | 706 private: |
707 | |
5759 | 708 static int curr_print_indent_level; |
709 static bool beginning_of_line; | |
710 | |
711 DECLARE_OV_BASE_TYPEID_FUNCTIONS_AND_DATA | |
2376 | 712 }; |
713 | |
7193 | 714 // TRUE means to perform automatic sparse to real mutation if there |
715 // is memory to be saved | |
716 extern bool Vsparse_auto_mutate; | |
717 | |
2376 | 718 #endif |
719 | |
720 /* | |
721 ;;; Local Variables: *** | |
722 ;;; mode: C++ *** | |
723 ;;; End: *** | |
724 */ |