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