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