Mercurial > octave-nkf
annotate src/ov-base.h @ 7638:2df457529cfa
implement expm1 and log1p functions
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Tue, 25 Mar 2008 19:47:21 -0400 |
parents | 99c410f7f0b0 |
children | 87eda1f8faaa |
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; | |
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 |
5759 | 127 virtual octave_value squeeze (void) const; |
128 | |
129 virtual octave_base_value *try_narrowing_conversion (void) { return 0; } | |
4532 | 130 |
5759 | 131 virtual octave_value |
132 subsref (const std::string& type, | |
133 const std::list<octave_value_list>& idx); | |
3933 | 134 |
5759 | 135 virtual octave_value_list |
136 subsref (const std::string& type, | |
137 const std::list<octave_value_list>& idx, | |
138 int nargout); | |
3933 | 139 |
5759 | 140 virtual octave_value |
5885 | 141 do_index_op (const octave_value_list& idx, bool resize_ok = false); |
2974 | 142 |
5759 | 143 virtual octave_value_list |
3544 | 144 do_multi_index_op (int nargout, const octave_value_list& idx); |
2376 | 145 |
5759 | 146 virtual octave_value |
147 subsasgn (const std::string& type, | |
148 const std::list<octave_value_list>& idx, | |
149 const octave_value& rhs); | |
2376 | 150 |
5759 | 151 virtual idx_vector index_vector (void) const; |
2376 | 152 |
5759 | 153 virtual dim_vector dims (void) const { return dim_vector (-1, -1); } |
4559 | 154 |
5759 | 155 octave_idx_type rows (void) const |
156 { | |
157 dim_vector dv = dims (); | |
5164 | 158 |
5759 | 159 return (dv.length () > 0) ? dv(0) : -1; |
160 } | |
4791 | 161 |
5759 | 162 octave_idx_type columns (void) const |
163 { | |
164 dim_vector dv = dims (); | |
5602 | 165 |
5759 | 166 return (dv.length () > 1) ? dv(1) : -1; |
167 } | |
5604 | 168 |
5759 | 169 virtual int ndims (void) const; |
4567 | 170 |
5759 | 171 virtual octave_idx_type numel (void) const { return dims ().numel (); } |
4593 | 172 |
5759 | 173 virtual octave_idx_type capacity (void) const { return numel (); } |
174 | |
175 virtual size_t byte_size (void) const { return 0; } | |
4915 | 176 |
5759 | 177 virtual octave_idx_type nnz (void) const; |
2376 | 178 |
5759 | 179 virtual octave_idx_type nzmax (void) const; |
180 | |
5900 | 181 virtual octave_idx_type nfields (void) const; |
182 | |
5759 | 183 virtual octave_value reshape (const dim_vector&) const; |
3351 | 184 |
5759 | 185 virtual octave_value permute (const Array<int>& vec, bool = false) const; |
2376 | 186 |
5759 | 187 virtual octave_value resize (const dim_vector&, bool fill = false) const; |
2376 | 188 |
5785 | 189 virtual MatrixType matrix_type (void) const; |
190 | |
191 virtual MatrixType matrix_type (const MatrixType& typ) const; | |
192 | |
5759 | 193 virtual bool is_defined (void) const { return false; } |
4505 | 194 |
5759 | 195 bool is_empty (void) const { return numel () == 0; } |
2376 | 196 |
5759 | 197 virtual bool is_cell (void) const { return false; } |
2376 | 198 |
6116 | 199 virtual bool is_cellstr (void) const { return false; } |
200 | |
5759 | 201 virtual bool is_real_scalar (void) const { return false; } |
4587 | 202 |
5759 | 203 virtual bool is_real_matrix (void) const { return false; } |
204 | |
205 virtual bool is_real_nd_array (void) const { return false; } | |
2376 | 206 |
5759 | 207 virtual bool is_complex_scalar (void) const { return false; } |
2376 | 208 |
5759 | 209 virtual bool is_complex_matrix (void) const { return false; } |
210 | |
5881 | 211 virtual bool is_bool_scalar (void) const { return false; } |
212 | |
5759 | 213 virtual bool is_bool_matrix (void) const { return false; } |
5279 | 214 |
5759 | 215 virtual bool is_char_matrix (void) const { return false; } |
2376 | 216 |
5759 | 217 virtual bool is_string (void) const { return false; } |
2376 | 218 |
5759 | 219 virtual bool is_sq_string (void) const { return false; } |
4643 | 220 |
5759 | 221 virtual bool is_range (void) const { return false; } |
3977 | 222 |
5759 | 223 virtual bool is_map (void) const { return false; } |
224 | |
7336 | 225 virtual bool is_object (void) const { return false; } |
226 | |
5759 | 227 virtual bool is_streamoff (void) const { return false; } |
2882 | 228 |
5759 | 229 virtual bool is_cs_list (void) const { return false; } |
2376 | 230 |
5759 | 231 virtual bool is_list (void) const { return false; } |
232 | |
233 virtual bool is_magic_colon (void) const { return false; } | |
2376 | 234 |
5759 | 235 virtual bool is_all_va_args (void) const { return false; } |
2376 | 236 |
5759 | 237 virtual octave_value all (int = 0) const; |
238 | |
239 virtual octave_value any (int = 0) const; | |
2376 | 240 |
5895 | 241 virtual bool is_double_type (void) const { return false; } |
242 | |
243 virtual bool is_single_type (void) const { return false; } | |
244 | |
7576 | 245 virtual bool is_float_type (void) const { return false; } |
246 | |
5895 | 247 virtual bool is_int8_type (void) const { return false; } |
248 | |
249 virtual bool is_int16_type (void) const { return false; } | |
250 | |
251 virtual bool is_int32_type (void) const { return false; } | |
252 | |
253 virtual bool is_int64_type (void) const { return false; } | |
254 | |
255 virtual bool is_uint8_type (void) const { return false; } | |
256 | |
257 virtual bool is_uint16_type (void) const { return false; } | |
258 | |
259 virtual bool is_uint32_type (void) const { return false; } | |
260 | |
261 virtual bool is_uint64_type (void) const { return false; } | |
262 | |
5759 | 263 virtual bool is_bool_type (void) const { return false; } |
3209 | 264 |
6223 | 265 virtual bool is_integer_type (void) const { return false; } |
266 | |
5759 | 267 virtual bool is_real_type (void) const { return false; } |
2376 | 268 |
5759 | 269 virtual bool is_complex_type (void) const { return false; } |
2376 | 270 |
271 // Would be nice to get rid of the next four functions: | |
272 | |
5759 | 273 virtual bool is_scalar_type (void) const { return false; } |
2376 | 274 |
5759 | 275 virtual bool is_matrix_type (void) const { return false; } |
2376 | 276 |
5759 | 277 virtual bool is_numeric_type (void) const { return false; } |
2376 | 278 |
5759 | 279 virtual bool is_sparse_type (void) const { return false; } |
5631 | 280 |
5759 | 281 virtual bool valid_as_scalar_index (void) const { return false; } |
2376 | 282 |
5759 | 283 virtual bool valid_as_zero_index (void) const { return false; } |
2376 | 284 |
5759 | 285 virtual bool is_true (void) const { return false; } |
286 | |
287 virtual bool is_constant (void) const { return false; } | |
2376 | 288 |
5759 | 289 virtual bool is_function_handle (void) const { return false; } |
2376 | 290 |
5759 | 291 virtual bool is_inline_function (void) const { return false; } |
2974 | 292 |
5759 | 293 virtual bool is_function (void) const { return false; } |
4954 | 294 |
7336 | 295 virtual bool is_user_script (void) const { return false; } |
296 | |
297 virtual bool is_user_function (void) const { return false; } | |
298 | |
5759 | 299 virtual bool is_builtin_function (void) const { return false; } |
2974 | 300 |
5759 | 301 virtual bool is_dld_function (void) const { return false; } |
3325 | 302 |
5864 | 303 virtual bool is_mex_function (void) const { return false; } |
304 | |
5759 | 305 virtual short int short_value (bool = false, bool = false) const; |
4254 | 306 |
5759 | 307 virtual unsigned short int ushort_value (bool = false, bool = false) const; |
4254 | 308 |
5759 | 309 virtual int int_value (bool = false, bool = false) const; |
3202 | 310 |
5759 | 311 virtual unsigned int uint_value (bool = false, bool = false) const; |
4254 | 312 |
5759 | 313 virtual int nint_value (bool = false) const; |
3202 | 314 |
5759 | 315 virtual long int long_value (bool = false, bool = false) const; |
4254 | 316 |
5759 | 317 virtual unsigned long int ulong_value (bool = false, bool = false) const; |
4254 | 318 |
5759 | 319 virtual double double_value (bool = false) const; |
2376 | 320 |
5759 | 321 virtual double scalar_value (bool frc_str_conv = false) const |
3145 | 322 { return double_value (frc_str_conv); } |
2376 | 323 |
5759 | 324 virtual Cell cell_value (void) const; |
3351 | 325 |
5759 | 326 virtual Matrix matrix_value (bool = false) const; |
3145 | 327 |
5759 | 328 virtual NDArray array_value (bool = false) const; |
4505 | 329 |
5759 | 330 virtual Complex complex_value (bool = false) const; |
2376 | 331 |
5759 | 332 virtual ComplexMatrix complex_matrix_value (bool = false) const; |
2376 | 333 |
5759 | 334 virtual ComplexNDArray complex_array_value (bool = false) const; |
4550 | 335 |
5943 | 336 virtual bool bool_value (bool = false) const; |
4550 | 337 |
5943 | 338 virtual boolMatrix bool_matrix_value (bool = false) const; |
4550 | 339 |
5943 | 340 virtual boolNDArray bool_array_value (bool = false) const; |
4550 | 341 |
5759 | 342 virtual charMatrix char_matrix_value (bool force = false) const; |
343 | |
344 virtual charNDArray char_array_value (bool = false) const; | |
2376 | 345 |
5759 | 346 virtual SparseMatrix sparse_matrix_value (bool = false) const; |
4550 | 347 |
5759 | 348 virtual SparseComplexMatrix sparse_complex_matrix_value (bool = false) const; |
5164 | 349 |
5759 | 350 virtual SparseBoolMatrix sparse_bool_matrix_value (bool = false) const; |
5164 | 351 |
5759 | 352 virtual octave_int8 int8_scalar_value (void) const; |
5164 | 353 |
5759 | 354 virtual octave_int16 int16_scalar_value (void) const; |
4910 | 355 |
5759 | 356 virtual octave_int32 int32_scalar_value (void) const; |
357 | |
358 virtual octave_int64 int64_scalar_value (void) const; | |
4910 | 359 |
5759 | 360 virtual octave_uint8 uint8_scalar_value (void) const; |
4910 | 361 |
5759 | 362 virtual octave_uint16 uint16_scalar_value (void) const; |
4910 | 363 |
5759 | 364 virtual octave_uint32 uint32_scalar_value (void) const; |
4910 | 365 |
5759 | 366 virtual octave_uint64 uint64_scalar_value (void) const; |
4910 | 367 |
5759 | 368 virtual int8NDArray int8_array_value (void) const; |
4910 | 369 |
5759 | 370 virtual int16NDArray int16_array_value (void) const; |
4910 | 371 |
5759 | 372 virtual int32NDArray int32_array_value (void) const; |
4906 | 373 |
5759 | 374 virtual int64NDArray int64_array_value (void) const; |
4906 | 375 |
5759 | 376 virtual uint8NDArray uint8_array_value (void) const; |
4906 | 377 |
5759 | 378 virtual uint16NDArray uint16_array_value (void) const; |
4906 | 379 |
5759 | 380 virtual uint32NDArray uint32_array_value (void) const; |
4906 | 381 |
5759 | 382 virtual uint64NDArray uint64_array_value (void) const; |
4906 | 383 |
5759 | 384 virtual string_vector all_strings (bool pad = false) const; |
4906 | 385 |
5759 | 386 virtual std::string string_value (bool force = false) const; |
4906 | 387 |
5759 | 388 virtual Range range_value (void) const; |
2376 | 389 |
5759 | 390 virtual Octave_map map_value (void) const; |
2376 | 391 |
5759 | 392 virtual string_vector map_keys (void) const; |
2376 | 393 |
5759 | 394 virtual std::streamoff streamoff_value (void) const; |
2376 | 395 |
5759 | 396 virtual streamoff_array streamoff_array_value (void) const; |
397 | |
398 virtual octave_function *function_value (bool silent = false); | |
3933 | 399 |
5759 | 400 virtual octave_user_function *user_function_value (bool silent = false); |
4645 | 401 |
5759 | 402 virtual octave_fcn_handle *fcn_handle_value (bool silent = false); |
4643 | 403 |
5759 | 404 virtual octave_fcn_inline *fcn_inline_value (bool silent = false); |
2974 | 405 |
5759 | 406 virtual octave_value_list list_value (void) const; |
4343 | 407 |
5759 | 408 virtual octave_value convert_to_str (bool pad = false, bool force = false, |
409 char type = '"') const; | |
410 virtual octave_value | |
411 convert_to_str_internal (bool pad, bool force, char type) const; | |
4933 | 412 |
5759 | 413 virtual void convert_to_row_or_column_vector (void); |
2882 | 414 |
5759 | 415 virtual bool print_as_scalar (void) const { return false; } |
2376 | 416 |
5759 | 417 virtual void print (std::ostream& os, bool pr_as_read_syntax = false) const; |
2376 | 418 |
5759 | 419 virtual void |
420 print_raw (std::ostream& os, bool pr_as_read_syntax = false) const; | |
4604 | 421 |
5759 | 422 virtual bool |
423 print_name_tag (std::ostream& os, const std::string& name) const; | |
2901 | 424 |
5759 | 425 virtual void |
426 print_with_name (std::ostream& output_buf, const std::string& name, | |
427 bool print_padding = true) const; | |
2376 | 428 |
5759 | 429 virtual void print_info (std::ostream& os, const std::string& prefix) const; |
3933 | 430 |
6974 | 431 virtual bool save_ascii (std::ostream& os); |
4687 | 432 |
5759 | 433 virtual bool load_ascii (std::istream& is); |
4687 | 434 |
5759 | 435 virtual bool save_binary (std::ostream& os, bool& save_as_floats); |
4687 | 436 |
5759 | 437 virtual bool load_binary (std::istream& is, bool swap, |
438 oct_mach_info::float_format fmt); | |
4687 | 439 |
440 #if defined (HAVE_HDF5) | |
5759 | 441 virtual bool |
442 save_hdf5 (hid_t loc_id, const char *name, bool save_as_floats); | |
4687 | 443 |
5759 | 444 virtual bool |
445 load_hdf5 (hid_t loc_id, const char *name, bool have_h5giterate_bug); | |
4687 | 446 #endif |
447 | |
5759 | 448 virtual int |
449 write (octave_stream& os, int block_size, | |
450 oct_data_conv::data_type output_type, int skip, | |
451 oct_mach_info::float_format flt_fmt) const; | |
452 | |
5900 | 453 virtual void *mex_get_data (void) const { return 0; } |
454 | |
455 virtual octave_idx_type *mex_get_ir (void) const { return 0; } | |
456 | |
457 virtual octave_idx_type *mex_get_jc (void) const { return 0; } | |
458 | |
459 virtual mxArray *as_mxArray (void) const; | |
460 | |
7620
36594d5bbe13
Move diag function into the octave_value class
David Bateman <dbateman@free.fr>
parents:
7576
diff
changeset
|
461 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
|
462 |
7433 | 463 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
|
464 sortmode mode = ASCENDING) const; |
7433 | 465 virtual octave_value sort (Array<octave_idx_type> &sidx, |
466 octave_idx_type dim = 0, | |
7463
2467639bd8c0
eliminate UNDEFINED sort mode
John W. Eaton <jwe@octave.org>
parents:
7433
diff
changeset
|
467 sortmode mode = ASCENDING) const; |
7433 | 468 |
7489
8e4592e49fa7
don't clear locked functions
John W. Eaton <jwe@octave.org>
parents:
7463
diff
changeset
|
469 virtual void lock (void); |
8e4592e49fa7
don't clear locked functions
John W. Eaton <jwe@octave.org>
parents:
7463
diff
changeset
|
470 |
8e4592e49fa7
don't clear locked functions
John W. Eaton <jwe@octave.org>
parents:
7463
diff
changeset
|
471 virtual void unlock (void); |
8e4592e49fa7
don't clear locked functions
John W. Eaton <jwe@octave.org>
parents:
7463
diff
changeset
|
472 |
8e4592e49fa7
don't clear locked functions
John W. Eaton <jwe@octave.org>
parents:
7463
diff
changeset
|
473 virtual bool islocked (void) const { return false; } |
8e4592e49fa7
don't clear locked functions
John W. Eaton <jwe@octave.org>
parents:
7463
diff
changeset
|
474 |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
475 virtual octave_value abs (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
476 virtual octave_value acos (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
477 virtual octave_value acosh (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
478 virtual octave_value angle (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
479 virtual octave_value arg (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
480 virtual octave_value asin (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
481 virtual octave_value asinh (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
482 virtual octave_value atan (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
483 virtual octave_value atanh (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
484 virtual octave_value ceil (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
485 virtual octave_value conj (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
486 virtual octave_value cos (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
487 virtual octave_value cosh (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
488 virtual octave_value erf (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
489 virtual octave_value erfc (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
490 virtual octave_value exp (void) const; |
7638
2df457529cfa
implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7636
diff
changeset
|
491 virtual octave_value expm1 (void) const; |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
492 virtual octave_value finite (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
493 virtual octave_value fix (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
494 virtual octave_value floor (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
495 virtual octave_value gamma (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
496 virtual octave_value imag (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
497 virtual octave_value isinf (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
498 virtual octave_value isna (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
499 virtual octave_value isnan (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
500 virtual octave_value lgamma (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
501 virtual octave_value log (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
502 virtual octave_value log10 (void) const; |
7638
2df457529cfa
implement expm1 and log1p functions
Jaroslav Hajek <highegg@gmail.com>
parents:
7636
diff
changeset
|
503 virtual octave_value log1p (void) const; |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
504 virtual octave_value real (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
505 virtual octave_value round (void) const; |
7636
99c410f7f0b0
implement mapper function for banker's rounding
Jaroslav Hajek <highegg@gmail.com>
parents:
7620
diff
changeset
|
506 virtual octave_value roundb (void) const; |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
507 virtual octave_value signum (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
508 virtual octave_value sin (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
509 virtual octave_value sinh (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
510 virtual octave_value sqrt (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
511 virtual octave_value tan (void) const; |
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
512 virtual octave_value tanh (void) const; |
7528
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
513 |
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
514 // 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
|
515 // conflicts. |
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
516 |
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
517 virtual octave_value xisalnum (void) const; |
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
518 virtual octave_value xisalpha (void) const; |
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
519 virtual octave_value xisascii (void) const; |
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
520 virtual octave_value xiscntrl (void) const; |
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
521 virtual octave_value xisdigit (void) const; |
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
522 virtual octave_value xisgraph (void) const; |
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
523 virtual octave_value xislower (void) const; |
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
524 virtual octave_value xisprint (void) const; |
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
525 virtual octave_value xispunct (void) const; |
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
526 virtual octave_value xisspace (void) const; |
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
527 virtual octave_value xisupper (void) const; |
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
528 virtual octave_value xisxdigit (void) const; |
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
529 virtual octave_value xtoascii (void) const; |
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
530 virtual octave_value xtolower (void) const; |
26d8a92644de
try to avoid ctype macro problems
John W. Eaton <jwe@octave.org>
parents:
7503
diff
changeset
|
531 virtual octave_value xtoupper (void) const; |
7503
8c32f95c2639
convert mapper functions to new format
David Bateman <dbateman@free.fr>
parents:
7489
diff
changeset
|
532 |
5759 | 533 protected: |
534 | |
535 // This should only be called for derived types. | |
536 | |
537 octave_value numeric_assign (const std::string& type, | |
538 const std::list<octave_value_list>& idx, | |
539 const octave_value& rhs); | |
540 | |
541 void reset_indent_level (void) const | |
542 { curr_print_indent_level = 0; } | |
543 | |
544 void increment_indent_level (void) const | |
545 { curr_print_indent_level += 2; } | |
546 | |
547 void decrement_indent_level (void) const | |
548 { curr_print_indent_level -= 2; } | |
549 | |
550 int current_print_indent_level (void) const | |
551 { return curr_print_indent_level; } | |
552 | |
553 void indent (std::ostream& os) const; | |
554 | |
555 void newline (std::ostream& os) const; | |
556 | |
557 void reset (void) const; | |
558 | |
559 // A reference count. | |
560 int count; | |
4944 | 561 |
2376 | 562 private: |
563 | |
5759 | 564 static int curr_print_indent_level; |
565 static bool beginning_of_line; | |
566 | |
567 DECLARE_OV_BASE_TYPEID_FUNCTIONS_AND_DATA | |
2376 | 568 }; |
569 | |
7336 | 570 // If TRUE, turn off printing of results in functions (as if a |
571 // semicolon has been appended to each statement). | |
572 extern bool Vsilent_functions; | |
573 | |
7193 | 574 // TRUE means to perform automatic sparse to real mutation if there |
575 // is memory to be saved | |
576 extern bool Vsparse_auto_mutate; | |
577 | |
2376 | 578 #endif |
579 | |
580 /* | |
581 ;;; Local Variables: *** | |
582 ;;; mode: C++ *** | |
583 ;;; End: *** | |
584 */ |