Mercurial > octave-nkf
annotate src/ov-base.h @ 7885:f336dd8e96d0
eliminate streamoff type
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 12 Jun 2008 10:42:56 -0400 |
parents | 8447a5024650 |
children | 283989f2da9b |
rev | line source |
---|---|
2376 | 1 /* |
2 | |
7017 | 3 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005, |
4 2006, 2007 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 | |
3503 | 29 #include <iostream> |
5759 | 30 #include <list> |
2376 | 31 #include <string> |
32 | |
5759 | 33 #if defined (HAVE_HDF5) |
34 #include <hdf5.h> | |
35 #endif | |
36 | |
37 #include "Range.h" | |
5828 | 38 #include "data-conv.h" |
5900 | 39 #include "mxarray.h" |
2376 | 40 #include "mx-base.h" |
41 #include "str-vec.h" | |
42 | |
43 #include "error.h" | |
44 | |
3351 | 45 class Cell; |
2376 | 46 class Octave_map; |
5759 | 47 class octave_value; |
2376 | 48 class octave_value_list; |
5759 | 49 class octave_stream; |
50 class octave_function; | |
51 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
|
52 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
|
53 class octave_user_code; |
5759 | 54 class octave_fcn_handle; |
55 class octave_fcn_inline; | |
56 class octave_value_list; | |
57 class octave_lvalue; | |
2376 | 58 |
59 class tree_walker; | |
60 | |
5759 | 61 // T_ID is the type id of struct objects, set by register_type(). |
62 // T_NAME is the type name of struct objects. | |
7067 | 63 |
5759 | 64 #define DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA \ |
7066 | 65 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA2 (OCTAVE_EMPTY_CPP_ARG) |
5759 | 66 |
67 #define DECLARE_OV_BASE_TYPEID_FUNCTIONS_AND_DATA \ | |
68 DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA2(virtual) | |
69 | |
70 #define DECLARE_OV_TYPEID_FUNCTIONS_AND_DATA2(VIRTUAL) \ | |
71 public: \ | |
72 VIRTUAL int type_id (void) const { return t_id; } \ | |
73 VIRTUAL std::string type_name (void) const { return t_name; } \ | |
74 VIRTUAL std::string class_name (void) const { return c_name; } \ | |
75 static int static_type_id (void) { return t_id; } \ | |
76 static std::string static_type_name (void) { return t_name; } \ | |
77 static std::string static_class_name (void) { return c_name; } \ | |
78 static void register_type (void); \ | |
79 \ | |
80 private: \ | |
81 static int t_id; \ | |
82 static const std::string t_name; \ | |
83 static const std::string c_name; | |
84 | |
85 | |
86 #define DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA(t, n, c) \ | |
87 int t::t_id (-1); \ | |
88 const std::string t::t_name (n); \ | |
89 const std::string t::c_name (c); \ | |
90 void t::register_type (void) \ | |
91 { \ | |
92 t_id = octave_value_typeinfo::register_type (t::t_name, \ | |
93 t::c_name, \ | |
94 octave_value (new t ())); \ | |
95 } | |
96 | |
2477 | 97 // A base value type, so that derived types only have to redefine what |
98 // they need (if they are derived from octave_base_value instead of | |
99 // octave_value). | |
2376 | 100 |
101 class | |
6109 | 102 OCTINTERP_API |
5759 | 103 octave_base_value |
2376 | 104 { |
105 public: | |
106 | |
5759 | 107 typedef octave_base_value * (*type_conv_fcn) (const octave_base_value&); |
108 | |
109 friend class octave_value; | |
2376 | 110 |
5759 | 111 octave_base_value (void) : count (1) { } |
112 | |
113 octave_base_value (const octave_base_value&) { } | |
2376 | 114 |
5759 | 115 virtual ~octave_base_value (void) { } |
116 | |
117 virtual octave_base_value * | |
118 clone (void) const { return new octave_base_value (*this); } | |
2376 | 119 |
5759 | 120 virtual octave_base_value * |
121 empty_clone (void) const { return new octave_base_value (); } | |
2376 | 122 |
5759 | 123 virtual type_conv_fcn |
124 numeric_conversion_function (void) const | |
2800 | 125 { return static_cast<type_conv_fcn> (0); } |
2410 | 126 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
127 virtual type_conv_fcn |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
128 numeric_demotion_function (void) const |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
129 { return static_cast<type_conv_fcn> (0); } |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
130 |
5759 | 131 virtual octave_value squeeze (void) const; |
132 | |
133 virtual octave_base_value *try_narrowing_conversion (void) { return 0; } | |
4532 | 134 |
5759 | 135 virtual octave_value |
136 subsref (const std::string& type, | |
137 const std::list<octave_value_list>& idx); | |
3933 | 138 |
5759 | 139 virtual octave_value_list |
140 subsref (const std::string& type, | |
141 const std::list<octave_value_list>& idx, | |
142 int nargout); | |
3933 | 143 |
5759 | 144 virtual octave_value |
5885 | 145 do_index_op (const octave_value_list& idx, bool resize_ok = false); |
2974 | 146 |
5759 | 147 virtual octave_value_list |
3544 | 148 do_multi_index_op (int nargout, const octave_value_list& idx); |
2376 | 149 |
5759 | 150 virtual octave_value |
151 subsasgn (const std::string& type, | |
152 const std::list<octave_value_list>& idx, | |
153 const octave_value& rhs); | |
2376 | 154 |
5759 | 155 virtual idx_vector index_vector (void) const; |
2376 | 156 |
5759 | 157 virtual dim_vector dims (void) const { return dim_vector (-1, -1); } |
4559 | 158 |
5759 | 159 octave_idx_type rows (void) const |
160 { | |
161 dim_vector dv = dims (); | |
5164 | 162 |
5759 | 163 return (dv.length () > 0) ? dv(0) : -1; |
164 } | |
4791 | 165 |
5759 | 166 octave_idx_type columns (void) const |
167 { | |
168 dim_vector dv = dims (); | |
5602 | 169 |
5759 | 170 return (dv.length () > 1) ? dv(1) : -1; |
171 } | |
5604 | 172 |
5759 | 173 virtual int ndims (void) const; |
4567 | 174 |
5759 | 175 virtual octave_idx_type numel (void) const { return dims ().numel (); } |
4593 | 176 |
5759 | 177 virtual octave_idx_type capacity (void) const { return numel (); } |
178 | |
179 virtual size_t byte_size (void) const { return 0; } | |
4915 | 180 |
5759 | 181 virtual octave_idx_type nnz (void) const; |
2376 | 182 |
5759 | 183 virtual octave_idx_type nzmax (void) const; |
184 | |
5900 | 185 virtual octave_idx_type nfields (void) const; |
186 | |
5759 | 187 virtual octave_value reshape (const dim_vector&) const; |
3351 | 188 |
5759 | 189 virtual octave_value permute (const Array<int>& vec, bool = false) const; |
2376 | 190 |
5759 | 191 virtual octave_value resize (const dim_vector&, bool fill = false) const; |
2376 | 192 |
5785 | 193 virtual MatrixType matrix_type (void) const; |
194 | |
195 virtual MatrixType matrix_type (const MatrixType& typ) const; | |
196 | |
5759 | 197 virtual bool is_defined (void) const { return false; } |
4505 | 198 |
5759 | 199 bool is_empty (void) const { return numel () == 0; } |
2376 | 200 |
5759 | 201 virtual bool is_cell (void) const { return false; } |
2376 | 202 |
6116 | 203 virtual bool is_cellstr (void) const { return false; } |
204 | |
5759 | 205 virtual bool is_real_scalar (void) const { return false; } |
4587 | 206 |
5759 | 207 virtual bool is_real_matrix (void) const { return false; } |
208 | |
209 virtual bool is_real_nd_array (void) const { return false; } | |
2376 | 210 |
5759 | 211 virtual bool is_complex_scalar (void) const { return false; } |
2376 | 212 |
5759 | 213 virtual bool is_complex_matrix (void) const { return false; } |
214 | |
5881 | 215 virtual bool is_bool_scalar (void) const { return false; } |
216 | |
5759 | 217 virtual bool is_bool_matrix (void) const { return false; } |
5279 | 218 |
5759 | 219 virtual bool is_char_matrix (void) const { return false; } |
2376 | 220 |
5759 | 221 virtual bool is_string (void) const { return false; } |
2376 | 222 |
5759 | 223 virtual bool is_sq_string (void) const { return false; } |
4643 | 224 |
5759 | 225 virtual bool is_range (void) const { return false; } |
3977 | 226 |
5759 | 227 virtual bool is_map (void) const { return false; } |
228 | |
7336 | 229 virtual bool is_object (void) const { return false; } |
230 | |
5759 | 231 virtual bool is_cs_list (void) const { return false; } |
2376 | 232 |
5759 | 233 virtual bool is_list (void) const { return false; } |
234 | |
235 virtual bool is_magic_colon (void) const { return false; } | |
2376 | 236 |
5759 | 237 virtual bool is_all_va_args (void) const { return false; } |
2376 | 238 |
5759 | 239 virtual octave_value all (int = 0) const; |
240 | |
241 virtual octave_value any (int = 0) const; | |
2376 | 242 |
5895 | 243 virtual bool is_double_type (void) const { return false; } |
244 | |
245 virtual bool is_single_type (void) const { return false; } | |
246 | |
7576 | 247 virtual bool is_float_type (void) const { return false; } |
248 | |
5895 | 249 virtual bool is_int8_type (void) const { return false; } |
250 | |
251 virtual bool is_int16_type (void) const { return false; } | |
252 | |
253 virtual bool is_int32_type (void) const { return false; } | |
254 | |
255 virtual bool is_int64_type (void) const { return false; } | |
256 | |
257 virtual bool is_uint8_type (void) const { return false; } | |
258 | |
259 virtual bool is_uint16_type (void) const { return false; } | |
260 | |
261 virtual bool is_uint32_type (void) const { return false; } | |
262 | |
263 virtual bool is_uint64_type (void) const { return false; } | |
264 | |
5759 | 265 virtual bool is_bool_type (void) const { return false; } |
3209 | 266 |
6223 | 267 virtual bool is_integer_type (void) const { return false; } |
268 | |
5759 | 269 virtual bool is_real_type (void) const { return false; } |
2376 | 270 |
5759 | 271 virtual bool is_complex_type (void) const { return false; } |
2376 | 272 |
273 // Would be nice to get rid of the next four functions: | |
274 | |
5759 | 275 virtual bool is_scalar_type (void) const { return false; } |
2376 | 276 |
5759 | 277 virtual bool is_matrix_type (void) const { return false; } |
2376 | 278 |
5759 | 279 virtual bool is_numeric_type (void) const { return false; } |
2376 | 280 |
5759 | 281 virtual bool is_sparse_type (void) const { return false; } |
5631 | 282 |
5759 | 283 virtual bool valid_as_scalar_index (void) const { return false; } |
2376 | 284 |
5759 | 285 virtual bool valid_as_zero_index (void) const { return false; } |
2376 | 286 |
5759 | 287 virtual bool is_true (void) const { return false; } |
288 | |
289 virtual bool is_constant (void) const { return false; } | |
2376 | 290 |
5759 | 291 virtual bool is_function_handle (void) const { return false; } |
2376 | 292 |
5759 | 293 virtual bool is_inline_function (void) const { return false; } |
2974 | 294 |
5759 | 295 virtual bool is_function (void) const { return false; } |
4954 | 296 |
7336 | 297 virtual bool is_user_script (void) const { return false; } |
298 | |
299 virtual bool is_user_function (void) const { return false; } | |
300 | |
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
|
301 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
|
302 |
5759 | 303 virtual bool is_builtin_function (void) const { return false; } |
2974 | 304 |
5759 | 305 virtual bool is_dld_function (void) const { return false; } |
3325 | 306 |
5864 | 307 virtual bool is_mex_function (void) const { return false; } |
308 | |
7876
8447a5024650
clear subfunctions when clearing parent function
John W. Eaton <jwe@octave.org>
parents:
7789
diff
changeset
|
309 virtual void erase_subfunctions (void) { } |
8447a5024650
clear subfunctions when clearing parent function
John W. Eaton <jwe@octave.org>
parents:
7789
diff
changeset
|
310 |
5759 | 311 virtual short int short_value (bool = false, bool = false) const; |
4254 | 312 |
5759 | 313 virtual unsigned short int ushort_value (bool = false, bool = false) const; |
4254 | 314 |
5759 | 315 virtual int int_value (bool = false, bool = false) const; |
3202 | 316 |
5759 | 317 virtual unsigned int uint_value (bool = false, bool = false) const; |
4254 | 318 |
5759 | 319 virtual int nint_value (bool = false) const; |
3202 | 320 |
5759 | 321 virtual long int long_value (bool = false, bool = false) const; |
4254 | 322 |
5759 | 323 virtual unsigned long int ulong_value (bool = false, bool = false) const; |
4254 | 324 |
5759 | 325 virtual double double_value (bool = false) const; |
2376 | 326 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
327 virtual float float_value (bool = false) const; |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
328 |
5759 | 329 virtual double scalar_value (bool frc_str_conv = false) const |
3145 | 330 { return double_value (frc_str_conv); } |
2376 | 331 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
332 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
|
333 { return float_value (frc_str_conv); } |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
334 |
5759 | 335 virtual Cell cell_value (void) const; |
3351 | 336 |
5759 | 337 virtual Matrix matrix_value (bool = false) const; |
3145 | 338 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
339 virtual FloatMatrix float_matrix_value (bool = false) const; |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
340 |
5759 | 341 virtual NDArray array_value (bool = false) const; |
4505 | 342 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
343 virtual FloatNDArray float_array_value (bool = false) const; |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
344 |
5759 | 345 virtual Complex complex_value (bool = false) const; |
2376 | 346 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
347 virtual FloatComplex float_complex_value (bool = false) const; |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
348 |
5759 | 349 virtual ComplexMatrix complex_matrix_value (bool = false) const; |
2376 | 350 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
351 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
|
352 |
5759 | 353 virtual ComplexNDArray complex_array_value (bool = false) const; |
4550 | 354 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7761
diff
changeset
|
355 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
|
356 |
5943 | 357 virtual bool bool_value (bool = false) const; |
4550 | 358 |
5943 | 359 virtual boolMatrix bool_matrix_value (bool = false) const; |
4550 | 360 |
5943 | 361 virtual boolNDArray bool_array_value (bool = false) const; |
4550 | 362 |
5759 | 363 virtual charMatrix char_matrix_value (bool force = false) const; |
364 | |
365 virtual charNDArray char_array_value (bool = false) const; | |
2376 | 366 |
5759 | 367 virtual SparseMatrix sparse_matrix_value (bool = false) const; |
4550 | 368 |
5759 | 369 virtual SparseComplexMatrix sparse_complex_matrix_value (bool = false) const; |
5164 | 370 |
5759 | 371 virtual SparseBoolMatrix sparse_bool_matrix_value (bool = false) const; |
5164 | 372 |
5759 | 373 virtual octave_int8 int8_scalar_value (void) const; |
5164 | 374 |
5759 | 375 virtual octave_int16 int16_scalar_value (void) const; |
4910 | 376 |
5759 | 377 virtual octave_int32 int32_scalar_value (void) const; |
378 | |
379 virtual octave_int64 int64_scalar_value (void) const; | |
4910 | 380 |
5759 | 381 virtual octave_uint8 uint8_scalar_value (void) const; |
4910 | 382 |
5759 | 383 virtual octave_uint16 uint16_scalar_value (void) const; |
4910 | 384 |
5759 | 385 virtual octave_uint32 uint32_scalar_value (void) const; |
4910 | 386 |
5759 | 387 virtual octave_uint64 uint64_scalar_value (void) const; |
4910 | 388 |
5759 | 389 virtual int8NDArray int8_array_value (void) const; |
4910 | 390 |
5759 | 391 virtual int16NDArray int16_array_value (void) const; |
4910 | 392 |
5759 | 393 virtual int32NDArray int32_array_value (void) const; |
4906 | 394 |
5759 | 395 virtual int64NDArray int64_array_value (void) const; |
4906 | 396 |
5759 | 397 virtual uint8NDArray uint8_array_value (void) const; |
4906 | 398 |
5759 | 399 virtual uint16NDArray uint16_array_value (void) const; |
4906 | 400 |
5759 | 401 virtual uint32NDArray uint32_array_value (void) const; |
4906 | 402 |
5759 | 403 virtual uint64NDArray uint64_array_value (void) const; |
4906 | 404 |
5759 | 405 virtual string_vector all_strings (bool pad = false) const; |
4906 | 406 |
5759 | 407 virtual std::string string_value (bool force = false) const; |
4906 | 408 |
5759 | 409 virtual Range range_value (void) const; |
2376 | 410 |
5759 | 411 virtual Octave_map map_value (void) const; |
2376 | 412 |
5759 | 413 virtual string_vector map_keys (void) const; |
2376 | 414 |
5759 | 415 virtual octave_function *function_value (bool silent = false); |
3933 | 416 |
7761
5adeea5de26c
symbol table reporting functions
John W. Eaton <jwe@octave.org>
parents:
7740
diff
changeset
|
417 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
|
418 |
5759 | 419 virtual octave_user_function *user_function_value (bool silent = false); |
4645 | 420 |
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
|
421 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
|
422 |
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
|
423 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
|
424 |
5759 | 425 virtual octave_fcn_handle *fcn_handle_value (bool silent = false); |
4643 | 426 |
5759 | 427 virtual octave_fcn_inline *fcn_inline_value (bool silent = false); |
2974 | 428 |
5759 | 429 virtual octave_value_list list_value (void) const; |
4343 | 430 |
5759 | 431 virtual octave_value convert_to_str (bool pad = false, bool force = false, |
432 char type = '"') const; | |
433 virtual octave_value | |
434 convert_to_str_internal (bool pad, bool force, char type) const; | |
4933 | 435 |
5759 | 436 virtual void convert_to_row_or_column_vector (void); |
2882 | 437 |
5759 | 438 virtual bool print_as_scalar (void) const { return false; } |
2376 | 439 |
5759 | 440 virtual void print (std::ostream& os, bool pr_as_read_syntax = false) const; |
2376 | 441 |
5759 | 442 virtual void |
443 print_raw (std::ostream& os, bool pr_as_read_syntax = false) const; | |
4604 | 444 |
5759 | 445 virtual bool |
446 print_name_tag (std::ostream& os, const std::string& name) const; | |
2901 | 447 |
5759 | 448 virtual void |
449 print_with_name (std::ostream& output_buf, const std::string& name, | |
450 bool print_padding = true) const; | |
2376 | 451 |
5759 | 452 virtual void print_info (std::ostream& os, const std::string& prefix) const; |
3933 | 453 |
6974 | 454 virtual bool save_ascii (std::ostream& os); |
4687 | 455 |
5759 | 456 virtual bool load_ascii (std::istream& is); |
4687 | 457 |
5759 | 458 virtual bool save_binary (std::ostream& os, bool& save_as_floats); |
4687 | 459 |
5759 | 460 virtual bool load_binary (std::istream& is, bool swap, |
461 oct_mach_info::float_format fmt); | |
4687 | 462 |
463 #if defined (HAVE_HDF5) | |
5759 | 464 virtual bool |
465 save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats); | |
4687 | 466 |
5759 | 467 virtual bool |
468 load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug); | |
4687 | 469 #endif |
470 | |
5759 | 471 virtual int |
472 write (octave_stream& os, int block_size, | |
473 oct_data_conv::data_type output_type, int skip, | |
474 oct_mach_info::float_format flt_fmt) const; | |
475 | |
5900 | 476 virtual void *mex_get_data (void) const { return 0; } |
477 | |
478 virtual octave_idx_type *mex_get_ir (void) const { return 0; } | |
479 | |
480 virtual octave_idx_type *mex_get_jc (void) const { return 0; } | |
481 | |
482 virtual mxArray *as_mxArray (void) const; | |
483 | |
7620
36594d5bbe13
Move diag function into the octave_value class
David Bateman <dbateman@free.fr>
parents:
7576
diff
changeset
|
484 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
|
485 |
7433 | 486 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
|
487 sortmode mode = ASCENDING) const; |
7433 | 488 virtual octave_value sort (Array<octave_idx_type> &sidx, |
489 octave_idx_type dim = 0, | |
7463
2467639bd8c0
eliminate UNDEFINED sort mode
John W. Eaton <jwe@octave.org>
parents:
7433
diff
changeset
|
490 sortmode mode = ASCENDING) const; |
7433 | 491 |
7489
8e4592e49fa7
don't clear locked functions
John W. Eaton <jwe@octave.org>
parents:
7463
diff
changeset
|
492 virtual void lock (void); |
8e4592e49fa7
don't clear locked functions
John W. Eaton <jwe@octave.org>
parents:
7463
diff
changeset
|
493 |
8e4592e49fa7
don't clear locked functions
John W. Eaton <jwe@octave.org>
parents:
7463
diff
changeset
|
494 virtual void unlock (void); |
8e4592e49fa7
don't clear locked functions
John W. Eaton <jwe@octave.org>
parents:
7463
diff
changeset
|
495 |
8e4592e49fa7
don't clear locked functions
John W. Eaton <jwe@octave.org>
parents:
7463
diff
changeset
|
496 virtual bool islocked (void) const { return false; } |
8e4592e49fa7
don't clear locked functions
John W. Eaton <jwe@octave.org>
parents:
7463
diff
changeset
|
497 |
7761
5adeea5de26c
symbol table reporting functions
John W. Eaton <jwe@octave.org>
parents:
7740
diff
changeset
|
498 virtual void dump (std::ostream& os) const; |
5adeea5de26c
symbol table reporting functions
John W. Eaton <jwe@octave.org>
parents:
7740
diff
changeset
|
499 |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
500 virtual octave_value abs (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
501 virtual octave_value acos (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
502 virtual octave_value acosh (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
503 virtual octave_value angle (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
504 virtual octave_value arg (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
505 virtual octave_value asin (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
506 virtual octave_value asinh (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
507 virtual octave_value atan (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
508 virtual octave_value atanh (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
509 virtual octave_value ceil (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
510 virtual octave_value conj (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
511 virtual octave_value cos (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
512 virtual octave_value cosh (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
513 virtual octave_value erf (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
514 virtual octave_value erfc (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
515 virtual octave_value exp (void) const; |
7638
2df457529cfa
implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7636
diff
changeset
|
516 virtual octave_value expm1 (void) const; |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
517 virtual octave_value finite (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
518 virtual octave_value fix (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
519 virtual octave_value floor (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
520 virtual octave_value gamma (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
521 virtual octave_value imag (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
522 virtual octave_value isinf (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
523 virtual octave_value isna (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
524 virtual octave_value isnan (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
525 virtual octave_value lgamma (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
526 virtual octave_value log (void) const; |
7740 | 527 virtual octave_value log2 (void) const; |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
528 virtual octave_value log10 (void) const; |
7638
2df457529cfa
implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7636
diff
changeset
|
529 virtual octave_value log1p (void) const; |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
530 virtual octave_value real (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
531 virtual octave_value round (void) const; |
7636
99c410f7f0b0
implement mapper function for banker's rounding
Jaroslav Hajek <highegg@gmail.com>
parents:
7620
diff
changeset
|
532 virtual octave_value roundb (void) const; |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
533 virtual octave_value signum (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
534 virtual octave_value sin (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
535 virtual octave_value sinh (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
536 virtual octave_value sqrt (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
537 virtual octave_value tan (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
538 virtual octave_value tanh (void) const; |
7528
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
539 |
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
540 // 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
|
541 // conflicts. |
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
542 |
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
543 virtual octave_value xisalnum (void) const; |
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
544 virtual octave_value xisalpha (void) const; |
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
545 virtual octave_value xisascii (void) const; |
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
546 virtual octave_value xiscntrl (void) const; |
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
547 virtual octave_value xisdigit (void) const; |
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
548 virtual octave_value xisgraph (void) const; |
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
549 virtual octave_value xislower (void) const; |
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
550 virtual octave_value xisprint (void) const; |
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
551 virtual octave_value xispunct (void) const; |
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
552 virtual octave_value xisspace (void) const; |
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
553 virtual octave_value xisupper (void) const; |
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
554 virtual octave_value xisxdigit (void) const; |
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
555 virtual octave_value xtoascii (void) const; |
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
556 virtual octave_value xtolower (void) const; |
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
557 virtual octave_value xtoupper (void) const; |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
558 |
5759 | 559 protected: |
560 | |
561 // This should only be called for derived types. | |
562 | |
563 octave_value numeric_assign (const std::string& type, | |
564 const std::list<octave_value_list>& idx, | |
565 const octave_value& rhs); | |
566 | |
567 void reset_indent_level (void) const | |
568 { curr_print_indent_level = 0; } | |
569 | |
570 void increment_indent_level (void) const | |
571 { curr_print_indent_level += 2; } | |
572 | |
573 void decrement_indent_level (void) const | |
574 { curr_print_indent_level -= 2; } | |
575 | |
576 int current_print_indent_level (void) const | |
577 { return curr_print_indent_level; } | |
578 | |
579 void indent (std::ostream& os) const; | |
580 | |
581 void newline (std::ostream& os) const; | |
582 | |
583 void reset (void) const; | |
584 | |
585 // A reference count. | |
586 int count; | |
4944 | 587 |
2376 | 588 private: |
589 | |
5759 | 590 static int curr_print_indent_level; |
591 static bool beginning_of_line; | |
592 | |
593 DECLARE_OV_BASE_TYPEID_FUNCTIONS_AND_DATA | |
2376 | 594 }; |
595 | |
7336 | 596 // If TRUE, turn off printing of results in functions (as if a |
597 // semicolon has been appended to each statement). | |
598 extern bool Vsilent_functions; | |
599 | |
7193 | 600 // TRUE means to perform automatic sparse to real mutation if there |
601 // is memory to be saved | |
602 extern bool Vsparse_auto_mutate; | |
603 | |
2376 | 604 #endif |
605 | |
606 /* | |
607 ;;; Local Variables: *** | |
608 ;;; mode: C++ *** | |
609 ;;; End: *** | |
610 */ |