GNU Octave  4.0.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ov.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 1996-2015 John W. Eaton
4 Copyright (C) 2009-2010 VZLU Prague
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
10 Free Software Foundation; either version 3 of the License, or (at your
11 option) any later version.
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
19 along with Octave; see the file COPYING. If not, see
20 <http://www.gnu.org/licenses/>.
21 
22 */
23 
24 #if !defined (octave_ov_h)
25 #define octave_ov_h 1
26 
27 #include <cstdlib>
28 
29 #include <iosfwd>
30 #include <string>
31 #include <list>
32 
33 #include "Range.h"
34 #include "data-conv.h"
35 #include "idx-vector.h"
36 #include "mach-info.h"
37 #include "mx-base.h"
38 #include "oct-time.h"
39 #include "str-vec.h"
40 
41 #include "oct-sort.h"
42 
43 class Cell;
44 class mxArray;
45 class octave_map;
46 class octave_scalar_map;
47 class octave_stream;
48 class octave_function;
50 class octave_fcn_handle;
51 class octave_fcn_inline;
52 class octave_value_list;
53 class octave_lvalue;
54 
55 #include "ov-base.h"
56 
57 // Forward declarations of friend functions that have default arguments.
58 
60  const octave_value& limit,
61  bool is_for_cmd_expr = false);
62 
64  const octave_value& increment,
65  const octave_value& limit,
66  bool is_for_cmd_expr = false);
67 
68 class
71 {
72 public:
73 
74  enum unary_op
75  {
76  op_not, // not
77  op_uplus, // uplus
78  op_uminus, // uminus
79  op_transpose, // transpose
80  op_hermitian, // ctranspose
84  unknown_unary_op
85  };
86 
87  enum binary_op
88  {
89  op_add, // plus
90  op_sub, // minus
91  op_mul, // mtimes
92  op_div, // mrdivide
93  op_pow, // mpower
94  op_ldiv, // mldivide
97  op_lt, // lt
98  op_le, // le
99  op_eq, // eq
100  op_ge, // ge
101  op_gt, // gt
102  op_ne, // ne
103  op_el_mul, // times
104  op_el_div, // rdivide
105  op_el_pow, // power
106  op_el_ldiv, // ldivide
107  op_el_and, // and
108  op_el_or, // or
111  unknown_binary_op
112  };
113 
115  {
116  // ** compound operations **
128  unknown_compound_binary_op
129  };
130 
132  {
149  unknown_assign_op
150  };
151 
152  static binary_op assign_op_to_binary_op (assign_op);
153 
154  static assign_op binary_op_to_assign_op (binary_op);
155 
156  static std::string unary_op_as_string (unary_op);
157  static std::string unary_op_fcn_name (unary_op);
158 
159  static std::string binary_op_as_string (binary_op);
160  static std::string binary_op_fcn_name (binary_op);
161 
162  static std::string binary_op_fcn_name (compound_binary_op);
163 
164  static std::string assign_op_as_string (assign_op);
165 
166  static octave_value empty_conv (const std::string& type,
167  const octave_value& rhs = octave_value ());
168 
169  enum magic_colon { magic_colon_t };
170 
172  {
173  static octave_base_value nil_rep;
174  rep = &nil_rep;
175  rep->count++;
176  }
177 
178  octave_value (short int i);
179  octave_value (unsigned short int i);
180  octave_value (int i);
181  octave_value (unsigned int i);
182  octave_value (long int i);
183  octave_value (unsigned long int i);
184 
185  // FIXME: these are kluges. They turn into doubles
186  // internally, which will break for very large values. We just use
187  // them to store things like 64-bit ino_t, etc, and hope that those
188  // values are never actually larger than can be represented exactly
189  // in a double.
190 
191 #if defined (HAVE_LONG_LONG_INT)
192  octave_value (long long int i);
193 #endif
194 #if defined (HAVE_UNSIGNED_LONG_LONG_INT)
195  octave_value (unsigned long long int i);
196 #endif
197 
199  octave_value (double d);
200  octave_value (float d);
201  octave_value (const Array<octave_value>& a, bool is_cs_list = false);
202  octave_value (const Cell& c, bool is_cs_list = false);
203  octave_value (const Matrix& m, const MatrixType& t = MatrixType ());
204  octave_value (const FloatMatrix& m, const MatrixType& t = MatrixType ());
205  octave_value (const NDArray& nda);
206  octave_value (const FloatNDArray& nda);
207  octave_value (const Array<double>& m);
208  octave_value (const Array<float>& m);
209  octave_value (const DiagMatrix& d);
214  octave_value (const FloatDiagMatrix& d);
215  octave_value (const RowVector& v);
216  octave_value (const FloatRowVector& v);
217  octave_value (const ColumnVector& v);
218  octave_value (const FloatColumnVector& v);
219  octave_value (const Complex& C);
220  octave_value (const FloatComplex& C);
221  octave_value (const ComplexMatrix& m, const MatrixType& t = MatrixType ());
223  const MatrixType& t = MatrixType ());
224  octave_value (const ComplexNDArray& cnda);
225  octave_value (const FloatComplexNDArray& cnda);
226  octave_value (const Array<Complex>& m);
230  octave_value (const ComplexRowVector& v);
234  octave_value (const PermMatrix& p);
235  octave_value (bool b);
236  octave_value (const boolMatrix& bm, const MatrixType& t = MatrixType ());
237  octave_value (const boolNDArray& bnda);
238  octave_value (const Array<bool>& bnda);
239  octave_value (char c, char type = '\'');
240  octave_value (const char *s, char type = '\'');
241  octave_value (const std::string& s, char type = '\'');
242  octave_value (const string_vector& s, char type = '\'');
243  octave_value (const charMatrix& chm, char type = '\'');
244  octave_value (const charNDArray& chnda, char type = '\'');
245  octave_value (const Array<char>& chnda, char type = '\'');
246  octave_value (const charMatrix& chm, bool is_string,
247  char type = '\'') GCC_ATTR_DEPRECATED;
248  octave_value (const charNDArray& chnda, bool is_string,
249  char type = '\'') GCC_ATTR_DEPRECATED;
250  octave_value (const Array<char>& chnda, bool is_string,
251  char type = '\'') GCC_ATTR_DEPRECATED;
252  octave_value (const SparseMatrix& m, const MatrixType& t = MatrixType ());
253  octave_value (const Sparse<double>& m, const MatrixType& t = MatrixType ());
255  const MatrixType& t = MatrixType ());
256  octave_value (const Sparse<Complex>& m, const MatrixType& t = MatrixType ());
257  octave_value (const SparseBoolMatrix& bm,
258  const MatrixType& t = MatrixType ());
259  octave_value (const Sparse<bool>& m, const MatrixType& t = MatrixType ());
260  octave_value (const octave_int8& i);
261  octave_value (const octave_int16& i);
262  octave_value (const octave_int32& i);
263  octave_value (const octave_int64& i);
264  octave_value (const octave_uint8& i);
265  octave_value (const octave_uint16& i);
266  octave_value (const octave_uint32& i);
267  octave_value (const octave_uint64& i);
268  octave_value (const int8NDArray& inda);
269  octave_value (const Array<octave_int8>& inda);
270  octave_value (const int16NDArray& inda);
271  octave_value (const Array<octave_int16>& inda);
272  octave_value (const int32NDArray& inda);
273  octave_value (const Array<octave_int32>& inda);
274  octave_value (const int64NDArray& inda);
275  octave_value (const Array<octave_int64>& inda);
276  octave_value (const uint8NDArray& inda);
277  octave_value (const Array<octave_uint8>& inda);
278  octave_value (const uint16NDArray& inda);
279  octave_value (const Array<octave_uint16>& inda);
280  octave_value (const uint32NDArray& inda);
281  octave_value (const Array<octave_uint32>& inda);
282  octave_value (const uint64NDArray& inda);
283  octave_value (const Array<octave_uint64>& inda);
284  octave_value (const Array<octave_idx_type>& inda,
285  bool zero_based = false, bool cache_index = false);
286  octave_value (const Array<std::string>& cellstr);
287  octave_value (const idx_vector& idx, bool lazy = true);
288  octave_value (double base, double limit, double inc);
289  octave_value (const Range& r, bool force_range = false);
290  octave_value (const octave_map& m);
291  octave_value (const octave_scalar_map& m);
292  octave_value (const octave_map& m, const std::string& id,
293  const std::list<std::string>& plist);
294  octave_value (const octave_scalar_map& m, const std::string& id,
295  const std::list<std::string>& plist);
296  octave_value (const octave_value_list& m, bool = false);
297  octave_value (octave_value::magic_colon);
298 
299  octave_value (octave_base_value *new_rep, bool borrow = false);
300  octave_value (octave_base_value *new_rep, int xcount) GCC_ATTR_DEPRECATED;
301 
302  // Copy constructor.
303 
305  {
306  rep = a.rep;
307  rep->count++;
308  }
309 
310  // This should only be called for derived types.
311 
312  octave_base_value *clone (void) const;
313 
315  { return rep->empty_clone (); }
316 
317  // Delete the representation of this constant if the count drops to
318  // zero.
319 
321  {
322  if (--rep->count == 0)
323  delete rep;
324  }
325 
326  void make_unique (void)
327  {
328  if (rep->count > 1)
329  {
330  octave_base_value *r = rep->unique_clone ();
331 
332  if (--rep->count == 0)
333  delete rep;
334 
335  rep = r;
336  }
337  }
338 
339  // This uniquifies the value if it is referenced by more than a certain
340  // number of shallow copies. This is useful for optimizations where we
341  // know a certain copy, typically within a cell array, to be obsolete.
342  void make_unique (int obsolete_copies)
343  {
344  if (rep->count > obsolete_copies + 1)
345  {
346  octave_base_value *r = rep->unique_clone ();
347 
348  if (--rep->count == 0)
349  delete rep;
350 
351  rep = r;
352  }
353  }
354 
355  // Simple assignment.
356 
358  {
359  if (rep != a.rep)
360  {
361  if (--rep->count == 0)
362  delete rep;
363 
364  rep = a.rep;
365  rep->count++;
366  }
367 
368  return *this;
369  }
370 
371  octave_idx_type get_count (void) const { return rep->count; }
372 
374  { return rep->numeric_conversion_function (); }
375 
377  { return rep->numeric_demotion_function (); }
378 
379  void maybe_mutate (void);
380 
381  octave_value squeeze (void) const
382  { return rep->squeeze (); }
383 
384  // The result of full().
386  { return rep->full_value (); }
387 
389  { return rep->try_narrowing_conversion (); }
390 
391  // Close to dims (), but can be overloaded for classes.
392  Matrix size (void)
393  { return rep->size (); }
394 
396  { return rep->numel (idx); }
397 
398  octave_value single_subsref (const std::string& type,
399  const octave_value_list& idx);
400 
401  octave_value subsref (const std::string& type,
402  const std::list<octave_value_list>& idx)
403  { return rep->subsref (type, idx); }
404 
405  octave_value subsref (const std::string& type,
406  const std::list<octave_value_list>& idx,
407  bool auto_add)
408  { return rep->subsref (type, idx, auto_add); }
409 
410  octave_value_list subsref (const std::string& type,
411  const std::list<octave_value_list>& idx,
412  int nargout);
413 
414  octave_value_list subsref (const std::string& type,
415  const std::list<octave_value_list>& idx,
416  int nargout,
417  const std::list<octave_lvalue> *lvalue_list);
418 
419  octave_value next_subsref (const std::string& type, const
420  std::list<octave_value_list>& idx,
421  size_t skip = 1);
422 
423  octave_value_list next_subsref (int nargout,
424  const std::string& type, const
425  std::list<octave_value_list>& idx,
426  size_t skip = 1);
427 
428  octave_value_list next_subsref (int nargout,
429  const std::string& type, const
430  std::list<octave_value_list>& idx,
431  const std::list<octave_lvalue> *lvalue_list,
432  size_t skip = 1);
433 
434  octave_value next_subsref (bool auto_add, const std::string& type, const
435  std::list<octave_value_list>& idx,
436  size_t skip = 1);
437 
439  bool resize_ok = false)
440  { return rep->do_index_op (idx, resize_ok); }
441 
443  do_multi_index_op (int nargout, const octave_value_list& idx);
444 
446  do_multi_index_op (int nargout, const octave_value_list& idx,
447  const std::list<octave_lvalue> *lvalue_list);
448 
449  octave_value subsasgn (const std::string& type,
450  const std::list<octave_value_list>& idx,
451  const octave_value& rhs);
452 
453  octave_value undef_subsasgn (const std::string& type,
454  const std::list<octave_value_list>& idx,
455  const octave_value& rhs);
456 
457  octave_value& assign (assign_op op, const std::string& type,
458  const std::list<octave_value_list>& idx,
459  const octave_value& rhs);
460 
461  octave_value& assign (assign_op, const octave_value& rhs);
462 
463  idx_vector index_vector (bool require_integers = false) const
464  {
465  return rep->index_vector (require_integers);
466  }
467 
468  // Size.
469 
470  dim_vector dims (void) const
471  { return rep->dims (); }
472 
473  octave_idx_type rows (void) const { return rep->rows (); }
474 
475  octave_idx_type columns (void) const { return rep->columns (); }
476 
477  octave_idx_type length (void) const;
478 
479  int ndims (void) const { return rep->ndims (); }
480 
481  bool all_zero_dims (void) const { return dims ().all_zero (); }
482 
483  octave_idx_type numel (void) const
484  { return rep->numel (); }
485 
487  { return rep->capacity (); }
488 
489  size_t byte_size (void) const
490  { return rep->byte_size (); }
491 
492  octave_idx_type nnz (void) const { return rep->nnz (); }
493 
494  octave_idx_type nzmax (void) const { return rep->nzmax (); }
495 
496  octave_idx_type nfields (void) const { return rep->nfields (); }
497 
498  octave_value reshape (const dim_vector& dv) const
499  { return rep->reshape (dv); }
500 
501  octave_value permute (const Array<int>& vec, bool inv = false) const
502  { return rep->permute (vec, inv); }
503 
504  octave_value ipermute (const Array<int>& vec) const
505  { return rep->permute (vec, true); }
506 
507  octave_value resize (const dim_vector& dv, bool fill = false) const
508  { return rep->resize (dv, fill);}
509 
510  MatrixType matrix_type (void) const
511  { return rep->matrix_type (); }
512 
513  MatrixType matrix_type (const MatrixType& typ) const
514  { return rep->matrix_type (typ); }
515 
516  // Does this constant have a type? Both of these are provided since
517  // it is sometimes more natural to write is_undefined() instead of
518  // ! is_defined().
519 
520  bool is_defined (void) const
521  { return rep->is_defined (); }
522 
523  bool is_undefined (void) const
524  { return ! is_defined (); }
525 
526  bool is_empty (void) const
527  { return rep->is_empty (); }
528 
529  bool is_cell (void) const
530  { return rep->is_cell (); }
531 
532  bool is_cellstr (void) const
533  { return rep->is_cellstr (); }
534 
535  bool is_real_scalar (void) const
536  { return rep->is_real_scalar (); }
537 
538  bool is_real_matrix (void) const
539  { return rep->is_real_matrix (); }
540 
541  bool is_complex_scalar (void) const
542  { return rep->is_complex_scalar (); }
543 
544  bool is_complex_matrix (void) const
545  { return rep->is_complex_matrix (); }
546 
547  bool is_bool_scalar (void) const
548  { return rep->is_bool_scalar (); }
549 
550  bool is_bool_matrix (void) const
551  { return rep->is_bool_matrix (); }
552 
553  bool is_char_matrix (void) const
554  { return rep->is_char_matrix (); }
555 
556  bool is_diag_matrix (void) const
557  { return rep->is_diag_matrix (); }
558 
559  bool is_perm_matrix (void) const
560  { return rep->is_perm_matrix (); }
561 
562  bool is_string (void) const
563  { return rep->is_string (); }
564 
565  bool is_sq_string (void) const
566  { return rep->is_sq_string (); }
567 
568  bool is_dq_string (void) const
569  { return rep->is_string () && ! rep->is_sq_string (); }
570 
571  bool is_range (void) const
572  { return rep->is_range (); }
573 
574  bool is_map (void) const
575  { return rep->is_map (); }
576 
577  bool is_object (void) const
578  { return rep->is_object (); }
579 
580  bool is_classdef_object (void) const
581  { return rep->is_classdef_object (); }
582 
583  bool is_java (void) const
584  { return rep->is_java (); }
585 
586  bool is_cs_list (void) const
587  { return rep->is_cs_list (); }
588 
589  bool is_magic_colon (void) const
590  { return rep->is_magic_colon (); }
591 
592  bool is_null_value (void) const
593  { return rep->is_null_value (); }
594 
595  // Are any or all of the elements in this constant nonzero?
596 
597  octave_value all (int dim = 0) const
598  { return rep->all (dim); }
599 
600  octave_value any (int dim = 0) const
601  { return rep->any (dim); }
602 
604  { return rep->builtin_type (); }
605 
606  // Floating point types.
607 
608  bool is_double_type (void) const
609  { return rep->is_double_type (); }
610 
611  bool is_single_type (void) const
612  { return rep->is_single_type (); }
613 
614  bool is_float_type (void) const
615  { return rep->is_float_type (); }
616 
617  // Integer types.
618 
619  bool is_int8_type (void) const
620  { return rep->is_int8_type (); }
621 
622  bool is_int16_type (void) const
623  { return rep->is_int16_type (); }
624 
625  bool is_int32_type (void) const
626  { return rep->is_int32_type (); }
627 
628  bool is_int64_type (void) const
629  { return rep->is_int64_type (); }
630 
631  bool is_uint8_type (void) const
632  { return rep->is_uint8_type (); }
633 
634  bool is_uint16_type (void) const
635  { return rep->is_uint16_type (); }
636 
637  bool is_uint32_type (void) const
638  { return rep->is_uint32_type (); }
639 
640  bool is_uint64_type (void) const
641  { return rep->is_uint64_type (); }
642 
643  // Other type stuff.
644 
645  bool is_bool_type (void) const
646  { return rep->is_bool_type (); }
647 
648  bool is_integer_type (void) const
649  { return rep->is_integer_type (); }
650 
651  bool is_real_type (void) const
652  { return rep->is_real_type (); }
653 
654  bool is_complex_type (void) const
655  { return rep->is_complex_type (); }
656 
657  bool is_scalar_type (void) const
658  { return rep->is_scalar_type (); }
659 
660  bool is_matrix_type (void) const
661  { return rep->is_matrix_type (); }
662 
663  bool is_numeric_type (void) const
664  { return rep->is_numeric_type (); }
665 
666  bool is_sparse_type (void) const
667  { return rep->is_sparse_type (); }
668 
669  // Does this constant correspond to a truth value?
670 
671  bool is_true (void) const
672  { return rep->is_true (); }
673 
674  // Do two constants match (in a switch statement)?
675 
676  bool is_equal (const octave_value&) const;
677 
678  // Are the dimensions of this constant zero by zero?
679 
680  bool is_zero_by_zero (void) const
681  { return (rows () == 0 && columns () == 0); }
682 
683  bool is_constant (void) const
684  { return rep->is_constant (); }
685 
686  bool is_function_handle (void) const
687  { return rep->is_function_handle (); }
688 
689  bool is_anonymous_function (void) const
690  { return rep->is_anonymous_function (); }
691 
692  bool is_inline_function (void) const
693  { return rep->is_inline_function (); }
694 
695  bool is_function (void) const
696  { return rep->is_function (); }
697 
698  bool is_user_script (void) const
699  { return rep->is_user_script (); }
700 
701  bool is_user_function (void) const
702  { return rep->is_user_function (); }
703 
704  bool is_user_code (void) const
705  { return rep->is_user_code (); }
706 
707  bool is_builtin_function (void) const
708  { return rep->is_builtin_function (); }
709 
710  bool is_dld_function (void) const
711  { return rep->is_dld_function (); }
712 
713  bool is_mex_function (void) const
714  { return rep->is_mex_function (); }
715 
716  void erase_subfunctions (void) { rep->erase_subfunctions (); }
717 
718  // Values.
719 
720  octave_value eval (void) { return *this; }
721 
722  short int
723  short_value (bool req_int = false, bool frc_str_conv = false) const
724  { return rep->short_value (req_int, frc_str_conv); }
725 
726  unsigned short int
727  ushort_value (bool req_int = false, bool frc_str_conv = false) const
728  { return rep->ushort_value (req_int, frc_str_conv); }
729 
730  int int_value (bool req_int = false, bool frc_str_conv = false) const
731  { return rep->int_value (req_int, frc_str_conv); }
732 
733  unsigned int
734  uint_value (bool req_int = false, bool frc_str_conv = false) const
735  { return rep->uint_value (req_int, frc_str_conv); }
736 
737  int nint_value (bool frc_str_conv = false) const
738  { return rep->nint_value (frc_str_conv); }
739 
740  long int
741  long_value (bool req_int = false, bool frc_str_conv = false) const
742  { return rep->long_value (req_int, frc_str_conv); }
743 
744  unsigned long int
745  ulong_value (bool req_int = false, bool frc_str_conv = false) const
746  { return rep->ulong_value (req_int, frc_str_conv); }
747 
748  int64_t
749  int64_value (bool req_int = false, bool frc_str_conv = false) const
750  { return rep->int64_value (req_int, frc_str_conv); }
751 
752  uint64_t
753  uint64_value (bool req_int = false, bool frc_str_conv = false) const
754  { return rep->uint64_value (req_int, frc_str_conv); }
755 
757  idx_type_value (bool req_int = false, bool frc_str_conv = false) const;
758 
759  double double_value (bool frc_str_conv = false) const
760  { return rep->double_value (frc_str_conv); }
761 
762  float float_value (bool frc_str_conv = false) const
763  { return rep->float_value (frc_str_conv); }
764 
765  double scalar_value (bool frc_str_conv = false) const
766  { return rep->scalar_value (frc_str_conv); }
767 
768  float float_scalar_value (bool frc_str_conv = false) const
769  { return rep->float_scalar_value (frc_str_conv); }
770 
771  Cell cell_value (void) const;
772 
773  Matrix matrix_value (bool frc_str_conv = false) const
774  { return rep->matrix_value (frc_str_conv); }
775 
776  FloatMatrix float_matrix_value (bool frc_str_conv = false) const
777  { return rep->float_matrix_value (frc_str_conv); }
778 
779  NDArray array_value (bool frc_str_conv = false) const
780  { return rep->array_value (frc_str_conv); }
781 
782  FloatNDArray float_array_value (bool frc_str_conv = false) const
783  { return rep->float_array_value (frc_str_conv); }
784 
785  Complex complex_value (bool frc_str_conv = false) const
786  { return rep->complex_value (frc_str_conv); }
787 
788  FloatComplex float_complex_value (bool frc_str_conv = false) const
789  { return rep->float_complex_value (frc_str_conv); }
790 
791  ComplexMatrix complex_matrix_value (bool frc_str_conv = false) const
792  { return rep->complex_matrix_value (frc_str_conv); }
793 
795  float_complex_matrix_value (bool frc_str_conv = false) const
796  { return rep->float_complex_matrix_value (frc_str_conv); }
797 
798  ComplexNDArray complex_array_value (bool frc_str_conv = false) const
799  { return rep->complex_array_value (frc_str_conv); }
800 
802  float_complex_array_value (bool frc_str_conv = false) const
803  { return rep->float_complex_array_value (frc_str_conv); }
804 
805  bool bool_value (bool warn = false) const
806  { return rep->bool_value (warn); }
807 
808  boolMatrix bool_matrix_value (bool warn = false) const
809  { return rep->bool_matrix_value (warn); }
810 
811  boolNDArray bool_array_value (bool warn = false) const
812  { return rep->bool_array_value (warn); }
813 
814  charMatrix char_matrix_value (bool frc_str_conv = false) const
815  { return rep->char_matrix_value (frc_str_conv); }
816 
817  charNDArray char_array_value (bool frc_str_conv = false) const
818  { return rep->char_array_value (frc_str_conv); }
819 
820  SparseMatrix sparse_matrix_value (bool frc_str_conv = false) const
821  { return rep->sparse_matrix_value (frc_str_conv); }
822 
824  sparse_complex_matrix_value (bool frc_str_conv = false) const
825  { return rep->sparse_complex_matrix_value (frc_str_conv); }
826 
827  SparseBoolMatrix sparse_bool_matrix_value (bool warn = false) const
828  { return rep->sparse_bool_matrix_value (warn); }
829 
830  DiagMatrix diag_matrix_value (bool force = false) const
831  { return rep->diag_matrix_value (force); }
832 
833  FloatDiagMatrix float_diag_matrix_value (bool force = false) const
834  { return rep->float_diag_matrix_value (force); }
835 
836  ComplexDiagMatrix complex_diag_matrix_value (bool force = false) const
837  { return rep->complex_diag_matrix_value (force); }
838 
840  float_complex_diag_matrix_value (bool force = false) const
841  { return rep->float_complex_diag_matrix_value (force); }
842 
844  { return rep->perm_matrix_value (); }
845 
847  { return rep->int8_scalar_value (); }
848 
850  { return rep->int16_scalar_value (); }
851 
853  { return rep->int32_scalar_value (); }
854 
856  { return rep->int64_scalar_value (); }
857 
859  { return rep->uint8_scalar_value (); }
860 
862  { return rep->uint16_scalar_value (); }
863 
865  { return rep->uint32_scalar_value (); }
866 
868  { return rep->uint64_scalar_value (); }
869 
871  { return rep->int8_array_value (); }
872 
874  { return rep->int16_array_value (); }
875 
877  { return rep->int32_array_value (); }
878 
880  { return rep->int64_array_value (); }
881 
883  { return rep->uint8_array_value (); }
884 
886  { return rep->uint16_array_value (); }
887 
889  { return rep->uint32_array_value (); }
890 
892  { return rep->uint64_array_value (); }
893 
894  string_vector all_strings (bool pad = false) const
895  { return rep->all_strings (pad); }
896 
897  std::string string_value (bool force = false) const
898  { return rep->string_value (force); }
899 
901  { return rep->cellstr_value (); }
902 
903  Range range_value (void) const
904  { return rep->range_value (); }
905 
906  octave_map map_value (void) const;
907 
908  octave_scalar_map scalar_map_value (void) const;
909 
910  string_vector map_keys (void) const
911  { return rep->map_keys (); }
912 
913  size_t nparents (void) const
914  { return rep->nparents (); }
915 
916  std::list<std::string> parent_class_name_list (void) const
917  { return rep->parent_class_name_list (); }
918 
920  { return rep->parent_class_names (); }
921 
923  find_parent_class (const std::string& parent_class_name)
924  { return rep->find_parent_class (parent_class_name); }
925 
926  bool is_instance_of (const std::string& cls_name) const
927  { return rep->is_instance_of (cls_name); }
928 
929  octave_function *function_value (bool silent = false) const;
930 
931  octave_user_function *user_function_value (bool silent = false) const;
932 
933  octave_user_script *user_script_value (bool silent = false) const;
934 
935  octave_user_code *user_code_value (bool silent = false) const;
936 
937  octave_fcn_handle *fcn_handle_value (bool silent = false) const;
938 
939  octave_fcn_inline *fcn_inline_value (bool silent = false) const;
940 
941  octave_value_list list_value (void) const;
942 
943  ColumnVector column_vector_value (bool frc_str_conv = false,
944  bool frc_vec_conv = false) const;
945 
947  complex_column_vector_value (bool frc_str_conv = false,
948  bool frc_vec_conv = false) const;
949 
950  RowVector row_vector_value (bool frc_str_conv = false,
951  bool frc_vec_conv = false) const;
952 
954  complex_row_vector_value (bool frc_str_conv = false,
955  bool frc_vec_conv = false) const;
956 
957 
958  FloatColumnVector float_column_vector_value (bool frc_str_conv = false,
959  bool frc_vec_conv = false) const;
960 
962  float_complex_column_vector_value (bool frc_str_conv = false,
963  bool frc_vec_conv = false) const;
964 
965  FloatRowVector float_row_vector_value (bool frc_str_conv = false,
966  bool frc_vec_conv = false) const;
967 
969  float_complex_row_vector_value (bool frc_str_conv = false,
970  bool frc_vec_conv = false) const;
971 
972 
973 
974 
975  Array<int> int_vector_value (bool req_int = false,
976  bool frc_str_conv = false,
977  bool frc_vec_conv = false) const;
978 
980  octave_idx_type_vector_value (bool req_int = false,
981  bool frc_str_conv = false,
982  bool frc_vec_conv = false) const;
983 
984  Array<double> vector_value (bool frc_str_conv = false,
985  bool frc_vec_conv = false) const;
986 
987  Array<Complex> complex_vector_value (bool frc_str_conv = false,
988  bool frc_vec_conv = false) const;
989 
990  Array<float> float_vector_value (bool frc_str_conv = false,
991  bool frc_vec_conv = false) const;
992 
994  float_complex_vector_value (bool frc_str_conv = false,
995  bool frc_vec_conv = false) const;
996 
997  // Possibly economize a lazy-indexed value.
998 
999  void maybe_economize (void)
1000  { rep->maybe_economize (); }
1001 
1002  // The following two hook conversions are called on any octave_value prior to
1003  // storing it to a "permanent" location, like a named variable, a cell or a
1004  // struct component, or a return value of a function.
1005 
1006  octave_value storable_value (void) const;
1007 
1008  // Ditto, but in place, i.e. equivalent to *this = this->storable_value (),
1009  // but possibly more efficient.
1010 
1011  void make_storable_value (void);
1012 
1013  // Conversions. These should probably be private. If a user of this
1014  // class wants a certain kind of constant, he should simply ask for
1015  // it, and we should convert it if possible.
1016 
1017  octave_value convert_to_str (bool pad = false, bool force = false,
1018  char type = '\'') const
1019  { return rep->convert_to_str (pad, force, type); }
1020 
1021  octave_value
1022  convert_to_str_internal (bool pad, bool force, char type) const
1023  { return rep->convert_to_str_internal (pad, force, type); }
1024 
1026  { rep->convert_to_row_or_column_vector (); }
1027 
1028  bool print_as_scalar (void) const
1029  { return rep->print_as_scalar (); }
1030 
1031  void print (std::ostream& os, bool pr_as_read_syntax = false)
1032  { rep->print (os, pr_as_read_syntax); }
1033 
1034  void print_raw (std::ostream& os, bool pr_as_read_syntax = false) const
1035  { rep->print_raw (os, pr_as_read_syntax); }
1036 
1037  bool print_name_tag (std::ostream& os, const std::string& name) const
1038  { return rep->print_name_tag (os, name); }
1039 
1040  void print_with_name (std::ostream& os, const std::string& name) const
1041  { rep->print_with_name (os, name, true); }
1042 
1043  void short_disp (std::ostream& os) const { rep->short_disp (os); }
1044 
1045  int type_id (void) const { return rep->type_id (); }
1046 
1047  std::string type_name (void) const { return rep->type_name (); }
1048 
1049  std::string class_name (void) const { return rep->class_name (); }
1050 
1051  // Unary and binary operations.
1052 
1053  friend OCTINTERP_API octave_value do_unary_op (unary_op op,
1054  const octave_value& a);
1055 
1056  octave_value& do_non_const_unary_op (unary_op op);
1057 
1058  octave_value& do_non_const_unary_op (unary_op op, const std::string& type,
1059  const std::list<octave_value_list>& idx);
1060 
1061  friend OCTINTERP_API octave_value do_binary_op (binary_op op,
1062  const octave_value& a,
1063  const octave_value& b);
1064 
1065  friend OCTINTERP_API octave_value do_binary_op (compound_binary_op op,
1066  const octave_value& a,
1067  const octave_value& b);
1068 
1070  const octave_value& b,
1072 
1074  const octave_value& limit,
1075  bool is_for_cmd_expr)
1076  {
1077  return do_colon_op (base, octave_value (), limit, is_for_cmd_expr);
1078  }
1079 
1080  friend OCTINTERP_API octave_value do_colon_op (const octave_value& base,
1081  const octave_value& increment,
1082  const octave_value& limit,
1083  bool is_for_cmd_expr);
1084 
1085  const octave_base_value& get_rep (void) const { return *rep; }
1086 
1087  bool is_copy_of (const octave_value &val) const { return rep == val.rep; }
1088 
1089  void print_info (std::ostream& os,
1090  const std::string& prefix = std::string ()) const;
1091 
1092  bool save_ascii (std::ostream& os) { return rep->save_ascii (os); }
1093 
1094  bool load_ascii (std::istream& is) { return rep->load_ascii (is); }
1095 
1096  bool save_binary (std::ostream& os, bool& save_as_floats)
1097  { return rep->save_binary (os, save_as_floats); }
1098 
1099  bool load_binary (std::istream& is, bool swap,
1101  { return rep->load_binary (is, swap, fmt); }
1102 
1103  bool save_hdf5 (octave_hdf5_id loc_id, const char *name,
1104  bool save_as_floats)
1105  { return rep->save_hdf5 (loc_id, name, save_as_floats); }
1106 
1107  bool load_hdf5 (octave_hdf5_id loc_id, const char *name)
1108  { return rep->load_hdf5 (loc_id, name); }
1109 
1110  int write (octave_stream& os, int block_size,
1111  oct_data_conv::data_type output_type, int skip,
1112  oct_mach_info::float_format flt_fmt) const;
1113 
1114  octave_base_value *internal_rep (void) const { return rep; }
1115 
1116  // Unsafe. These functions exist to support the MEX interface.
1117  // You should not use them anywhere else.
1118  void *mex_get_data (void) const { return rep->mex_get_data (); }
1119 
1120  octave_idx_type *mex_get_ir (void) const { return rep->mex_get_ir (); }
1121 
1122  octave_idx_type *mex_get_jc (void) const { return rep->mex_get_jc (); }
1123 
1124  mxArray *as_mxArray (void) const { return rep->as_mxArray (); }
1125 
1127  { return rep->diag (k); }
1128 
1130  { return rep->diag (m, n); }
1131 
1133  { return rep->sort (dim, mode); }
1135  sortmode mode = ASCENDING) const
1136  { return rep->sort (sidx, dim, mode); }
1137 
1139  { return rep->is_sorted (mode); }
1140 
1142  { return rep->sort_rows_idx (mode); }
1143 
1145  { return rep->is_sorted_rows (mode); }
1146 
1147  void lock (void) { rep->lock (); }
1148 
1149  void unlock (void) { rep->unlock (); }
1150 
1151  bool islocked (void) const { return rep->islocked (); }
1152 
1153  void dump (std::ostream& os) const { rep->dump (os); }
1154 
1155 #define MAPPER_FORWARD(F) \
1156  octave_value F (void) const { return rep->map (octave_base_value::umap_ ## F); }
1157 
1203 
1204  // These functions are prefixed with X to avoid potential macro
1205  // conflicts.
1206 
1207  MAPPER_FORWARD (xisalnum)
1208  MAPPER_FORWARD (xisalpha)
1210  MAPPER_FORWARD (xiscntrl)
1211  MAPPER_FORWARD (xisdigit)
1212  MAPPER_FORWARD (xisgraph)
1213  MAPPER_FORWARD (xislower)
1214  MAPPER_FORWARD (xisprint)
1215  MAPPER_FORWARD (xispunct)
1216  MAPPER_FORWARD (xisspace)
1217  MAPPER_FORWARD (xisupper)
1218  MAPPER_FORWARD (xisxdigit)
1221  MAPPER_FORWARD (xtolower)
1222  MAPPER_FORWARD (xtoupper)
1223 
1224 #undef MAPPER_FORWARD
1225 
1227  { return rep->map (umap); }
1228 
1229  // Extract the n-th element, aka val(n). Result is undefined if val is not an
1230  // array type or n is out of range. Never error.
1231  octave_value
1233  { return rep->fast_elem_extract (n); }
1234 
1235  // Assign the n-th element, aka val(n) = x. Returns false if val is not an
1236  // array type, x is not a matching scalar type, or n is out of range.
1237  // Never error.
1238  virtual bool
1240  {
1241  make_unique ();
1242  return rep->fast_elem_insert (n, x);
1243  }
1244 
1245 protected:
1246 
1247  // The real representation.
1249 
1250 private:
1251 
1252  assign_op unary_op_to_assign_op (unary_op op);
1253 
1254  binary_op op_eq_to_binary_op (assign_op op);
1255 
1256  // This declaration protects against constructing octave_value from
1257  // const octave_base_value* which actually silently calls octave_value (bool).
1258  octave_value (const octave_base_value *);
1259 
1260 };
1261 
1262 // Publish externally used friend functions.
1263 
1266 
1269  const octave_value& a, const octave_value& b);
1270 
1273  const octave_value& a, const octave_value& b);
1274 
1275 #define OV_UNOP_FN(name) \
1276  inline octave_value \
1277  name (const octave_value& a) \
1278  { \
1279  return do_unary_op (octave_value::name, a); \
1280  }
1281 
1282 #define OV_UNOP_OP(name, op) \
1283  inline octave_value \
1284  operator op (const octave_value& a) \
1285  { \
1286  return name (a); \
1287  }
1288 
1289 #define OV_UNOP_FN_OP(name, op) \
1290  OV_UNOP_FN (name) \
1291  OV_UNOP_OP (name, op)
1292 
1296 
1299 
1300 // No simple way to define these for prefix and suffix ops?
1301 //
1302 // incr
1303 // decr
1304 
1305 #define OV_BINOP_FN(name) \
1306  inline octave_value \
1307  name (const octave_value& a1, const octave_value& a2) \
1308  { \
1309  return do_binary_op (octave_value::name, a1, a2); \
1310  }
1311 
1312 #define OV_BINOP_OP(name, op) \
1313  inline octave_value \
1314  operator op (const octave_value& a1, const octave_value& a2) \
1315  { \
1316  return name (a1, a2); \
1317  }
1318 
1319 #define OV_BINOP_FN_OP(name, op) \
1320  OV_BINOP_FN (name) \
1321  OV_BINOP_OP (name, op)
1322 
1327 
1332 
1339 
1346 
1348 
1349 #define OV_COMP_BINOP_FN(name) \
1350  inline octave_value \
1351  name (const octave_value& a1, const octave_value& a2) \
1352  { \
1353  return do_binary_op (octave_value::name, a1, a2); \
1354  }
1355 
1360 
1361 extern OCTINTERP_API void install_types (void);
1362 
1363 // This will eventually go away, but for now it can be used to
1364 // simplify the transition to the new octave_value class hierarchy,
1365 // which uses octave_base_value instead of octave_value for the type
1366 // of octave_value::rep.
1367 #define OV_REP_TYPE octave_base_value
1368 
1369 // Templated value extractors.
1370 template<class Value>
1371 inline Value octave_value_extract (const octave_value&)
1372 { assert (false); }
1373 
1374 #define DEF_VALUE_EXTRACTOR(VALUE,MPREFIX) \
1375 template<> \
1376 inline VALUE octave_value_extract<VALUE> (const octave_value& v) \
1377  { return v.MPREFIX ## _value (); }
1378 
1380 DEF_VALUE_EXTRACTOR (float, float_scalar)
1384 
1393 
1394 
1400 
1410 
1416 
1420 DEF_VALUE_EXTRACTOR (FloatComplexColumnVector, float_complex_column_vector)
1421 
1425 DEF_VALUE_EXTRACTOR (FloatComplexRowVector, float_complex_row_vector)
1426 
1430 DEF_VALUE_EXTRACTOR (FloatComplexDiagMatrix, float_complex_diag_matrix)
1432 
1436 #undef DEF_VALUE_EXTRACTOR
1437 
1438 #define DEF_DUMMY_VALUE_EXTRACTOR(VALUE,DEFVAL) \
1439 template<> \
1440 inline VALUE octave_value_extract<VALUE> (const octave_value&) \
1441  { assert (false); return DEFVAL; }
1442 
1445 #undef DEF_DUMMY_VALUE_EXTRACTOR
1446 
1447 #endif
sortmode is_sorted_rows(sortmode mode=UNSORTED) const
Definition: ov.h:1144
uint8NDArray uint8_array_value(void) const
Definition: ov.h:882
void short_disp(std::ostream &os) const
Definition: ov.h:1043
bool is_builtin_function(void) const
Definition: ov.h:707
bool is_object(void) const
Definition: ov.h:577
octave_idx_type nnz(void) const
Definition: ov.h:492
octave_value op_mul_trans(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1357
ComplexNDArray complex_array_value(bool frc_str_conv=false) const
Definition: ov.h:798
bool is_range(void) const
Definition: ov.h:571
FloatComplexDiagMatrix float_complex_diag_matrix_value(bool force=false) const
Definition: ov.h:840
octave_value(void)
Definition: ov.h:171
octave_idx_type capacity(void) const
Definition: ov.h:486
Definition: Cell.h:35
octave_value op_uplus(const octave_value &a)
Definition: ov.h:1294
size_t nparents(void) const
Definition: ov.h:913
charNDArray char_array_value(bool frc_str_conv=false) const
Definition: ov.h:817
bool load_binary(std::istream &is, bool swap, oct_mach_info::float_format fmt)
Definition: ov.h:1099
octave_refcount< octave_idx_type > count
Definition: ov-base.h:818
bool is_real_type(void) const
Definition: ov.h:651
assign_op
Definition: ov.h:131
T xsignbit(T x)
Definition: lo-mappers.h:378
boolMatrix bool_matrix_value(bool warn=false) const
Definition: ov.h:808
#define OV_BINOP_FN_OP(name, op)
Definition: ov.h:1319
octave_value subsref(const std::string &type, const std::list< octave_value_list > &idx)
Definition: ov.h:401
octave_value op_el_pow(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1342
bool print_name_tag(std::ostream &os, const std::string &name) const
Definition: ov.h:1037
#define C(a, b)
Definition: Faddeeva.cc:255
int ndims(void) const
Definition: ov.h:479
const octave_base_value const Array< octave_idx_type > & ra_idx
octave_value reshape(const dim_vector &dv) const
Definition: ov.h:498
octave_idx_type rows(void) const
Definition: ov.h:473
octave_value permute(const Array< int > &vec, bool inv=false) const
Definition: ov.h:501
octave_value do_cat_op(const octave_value &v1, const octave_value &v2, const Array< octave_idx_type > &ra_idx)
Definition: ov.cc:2304
octave_int16 int16_scalar_value(void) const
Definition: ov.h:849
octave_value op_eq(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1335
octave_value full_value(void) const
Definition: ov.h:385
unsigned int uint_value(bool req_int=false, bool frc_str_conv=false) const
Definition: ov.h:734
bool save_hdf5(octave_hdf5_id loc_id, const char *name, bool save_as_floats)
Definition: ov.h:1103
int8NDArray int8_array_value(void) const
Definition: ov.h:870
double cbrt(double x)
Definition: lo-specfun.cc:662
Array< octave_idx_type > sort_rows_idx(sortmode mode=ASCENDING) const
Sort by rows returns only indices.
Definition: Array.cc:2086
FloatComplexMatrix float_complex_matrix_value(bool frc_str_conv=false) const
Definition: ov.h:795
double log1p(double x)
Definition: lo-specfun.cc:620
octave_base_value * empty_clone(void) const
Definition: ov.h:314
double erfcinv(double x)
Definition: lo-specfun.cc:3151
mxArray * as_mxArray(void) const
Definition: ov.h:1124
bool is_uint16_type(void) const
Definition: ov.h:634
bool islocked(void) const
Definition: ov.h:1151
bool is_user_code(void) const
Definition: ov.h:704
sortmode
Definition: oct-sort.h:103
bool is_function(void) const
Definition: ov.h:695
std::complex< double > erfi(std::complex< double > z, double relerr=0)
int16NDArray int16_array_value(void) const
Definition: ov.h:873
MatrixType matrix_type(const MatrixType &typ) const
Definition: ov.h:513
static int xtoascii(int c)
Definition: ov-ch-mat.cc:169
octave_idx_type nfields(void) const
Definition: ov.h:496
std::list< std::string > parent_class_name_list(void) const
Definition: ov.h:916
bool is_scalar_type(void) const
Definition: ov.h:657
octave_value diag(octave_idx_type k=0) const
Definition: ov.h:1126
bool is_numeric_type(void) const
Definition: ov.h:663
bool is_defined(void) const
Definition: ov.h:520
octave_value op_el_ldiv(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1343
bool is_complex_scalar(void) const
Definition: ov.h:541
int int_value(bool req_int=false, bool frc_str_conv=false) const
Definition: ov.h:730
Definition: Range.h:31
uint64NDArray uint64_array_value(void) const
Definition: ov.h:891
binary_op
Definition: ov.h:87
int64_t int64_value(bool req_int=false, bool frc_str_conv=false) const
Definition: ov.h:749
octave_value eval(void)
Definition: ov.h:720
function atanh(X)
Definition: atanh.f:2
octave_int32 int32_scalar_value(void) const
Definition: ov.h:852
float float_value(bool frc_str_conv=false) const
Definition: ov.h:762
int32NDArray int32_array_value(void) const
Definition: ov.h:876
bool is_perm_matrix(void) const
Definition: ov.h:559
bool is_int8_type(void) const
Definition: ov.h:619
STL namespace.
octave_value map(octave_base_value::unary_mapper_t umap) const
Definition: ov.h:1226
int type_id(void) const
Definition: ov.h:1045
Array< octave_idx_type > sort_rows_idx(sortmode mode=ASCENDING) const
Definition: ov.h:1141
void make_unique(void)
Definition: ov.h:326
octave_value op_pow(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1328
octave_base_value * try_narrowing_conversion(void)
Definition: ov.h:388
octave_value resize(const dim_vector &dv, bool fill=false) const
Definition: ov.h:507
bool is_cell(void) const
Definition: ov.h:529
float float_scalar_value(bool frc_str_conv=false) const
Definition: ov.h:768
double expm1(double x)
Definition: lo-specfun.cc:510
octave_idx_type nzmax(void) const
Definition: ov.h:494
octave_value convert_to_str_internal(bool pad, bool force, char type) const
Definition: ov.h:1022
bool is_int32_type(void) const
Definition: ov.h:625
bool is_copy_of(const octave_value &val) const
Definition: ov.h:1087
double scalar_value(bool frc_str_conv=false) const
Definition: ov.h:765
#define DEF_VALUE_EXTRACTOR(VALUE, MPREFIX)
Definition: ov.h:1374
builtin_type_t
Definition: ov-base.h:59
ComplexDiagMatrix complex_diag_matrix_value(bool force=false) const
Definition: ov.h:836
std::complex< double > erf(std::complex< double > z, double relerr=0)
boolNDArray bool_array_value(bool warn=false) const
Definition: ov.h:811
bool is_function_handle(void) const
Definition: ov.h:686
F77_RET_T const double const double double * d
string_vector all_strings(bool pad=false) const
Definition: ov.h:894
octave_base_value * rep
Definition: ov.h:1248
bool is_instance_of(const std::string &cls_name) const
Definition: ov.h:926
octave_value ipermute(const Array< int > &vec) const
Definition: ov.h:504
int64NDArray int64_array_value(void) const
Definition: ov.h:879
sortmode is_sorted(sortmode mode=UNSORTED) const
Definition: ov.h:1138
idx_vector index_vector(bool require_integers=false) const
Definition: ov.h:463
bool is_float_type(void) const
Definition: ov.h:614
void lock(void)
Definition: ov.h:1147
octave_base_value::type_conv_info numeric_demotion_function(void) const
Definition: ov.h:376
Array< std::string > cellstr_value(void) const
Definition: ov.h:900
double signum(double x)
Definition: lo-mappers.cc:80
octave_value op_div(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1326
octave_value any(int dim=0) const
Definition: ov.h:600
octave_value op_el_or(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1345
octave_idx_type columns(void) const
Definition: ov.h:475
ComplexColumnVector conj(const ComplexColumnVector &a)
Definition: CColVector.cc:244
long int long_value(bool req_int=false, bool frc_str_conv=false) const
Definition: ov.h:741
bool is_dld_function(void) const
Definition: ov.h:710
virtual octave_base_value * try_narrowing_conversion(void)
Definition: ov-base.h:240
FloatNDArray float_array_value(bool frc_str_conv=false) const
Definition: ov.h:782
#define OV_UNOP_FN(name)
Definition: ov.h:1275
void dump(std::ostream &os) const
Definition: ov.h:1153
bool is_char_matrix(void) const
Definition: ov.h:553
virtual octave_base_value * find_parent_class(const std::string &)
Definition: ov-base.h:582
bool is_mex_function(void) const
Definition: ov.h:713
unsigned long int ulong_value(bool req_int=false, bool frc_str_conv=false) const
Definition: ov.h:745
octave_uint8 uint8_scalar_value(void) const
Definition: ov.h:858
octave_value subsref(const std::string &type, const std::list< octave_value_list > &idx, bool auto_add)
Definition: ov.h:405
bool is_null_value(void) const
Definition: ov.h:592
#define OCTINTERP_API
Definition: mexproto.h:66
octave_value convert_to_str(bool pad=false, bool force=false, char type= '\'') const
Definition: ov.h:1017
bool print_as_scalar(void) const
Definition: ov.h:1028
bool is_complex_matrix(void) const
Definition: ov.h:544
uint64_t uint64_value(bool req_int=false, bool frc_str_conv=false) const
Definition: ov.h:753
octave_value op_not(const octave_value &a)
Definition: ov.h:1293
bool is_sparse_type(void) const
Definition: ov.h:666
octave_value squeeze(void) const
Definition: ov.h:381
octave_idx_type numel(const octave_value_list &idx)
Definition: ov.h:395
bool is_bool_type(void) const
Definition: ov.h:645
function asinh(X)
Definition: asinh.f:2
bool is_real_scalar(void) const
Definition: ov.h:535
octave_idx_type * mex_get_jc(void) const
Definition: ov.h:1122
bool is_bool_matrix(void) const
Definition: ov.h:550
void print(std::ostream &os, bool pr_as_read_syntax=false)
Definition: ov.h:1031
std::string string_value(bool force=false) const
Definition: ov.h:897
FloatDiagMatrix float_diag_matrix_value(bool force=false) const
Definition: ov.h:833
#define DEF_DUMMY_VALUE_EXTRACTOR(VALUE, DEFVAL)
Definition: ov.h:1438
octave_value op_trans_mul(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1356
int nint_value(bool frc_str_conv=false) const
Definition: ov.h:737
bool load_hdf5(octave_hdf5_id loc_id, const char *name)
Definition: ov.h:1107
FloatComplex float_complex_value(bool frc_str_conv=false) const
Definition: ov.h:788
octave_base_value::type_conv_info numeric_conversion_function(void) const
Definition: ov.h:373
Range range_value(void) const
Definition: ov.h:903
octave_value op_transpose(const octave_value &a)
Definition: ov.h:1297
bool is_matrix_type(void) const
Definition: ov.h:660
Value octave_value_extract(const octave_value &)
Definition: ov.h:1371
std::complex< T > ceil(const std::complex< T > &x)
Definition: lo-mappers.h:275
FloatComplexNDArray float_complex_array_value(bool frc_str_conv=false) const
Definition: ov.h:802
bool is_string(void) const
Definition: ov.h:562
bool is_double_type(void) const
Definition: ov.h:608
bool save_binary(std::ostream &os, bool &save_as_floats)
Definition: ov.h:1096
void maybe_economize(void)
Definition: ov.h:999
SparseBoolMatrix sparse_bool_matrix_value(bool warn=false) const
Definition: ov.h:827
bool is_inline_function(void) const
Definition: ov.h:692
void print_raw(std::ostream &os, bool pr_as_read_syntax=false) const
Definition: ov.h:1034
octave_value op_el_and(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1344
bool is_complex_type(void) const
Definition: ov.h:654
octave_value op_lshift(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1330
bool is_magic_colon(void) const
Definition: ov.h:589
bool is_int64_type(void) const
Definition: ov.h:628
virtual octave_base_value * empty_clone(void) const
Definition: ov-base.cc:121
octave_base_value * find_parent_class(const std::string &parent_class_name)
Definition: ov.h:923
bool is_cellstr(void) const
Definition: ov.h:532
octave_idx_type * mex_get_ir(void) const
Definition: ov.h:1120
octave_value op_mul_herm(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1359
bool all_zero_dims(void) const
Definition: ov.h:481
std::complex< double > erfcx(std::complex< double > z, double relerr=0)
bool is_user_script(void) const
Definition: ov.h:698
string_vector map_keys(void) const
Definition: ov.h:910
Definition: dMatrix.h:35
octave_value all(int dim=0) const
Definition: ov.h:597
SparseComplexMatrix sparse_complex_matrix_value(bool frc_str_conv=false) const
Definition: ov.h:824
string_vector parent_class_names(void) const
Definition: ov.h:919
dim_vector dims(void) const
Definition: ov.h:470
Matrix matrix_value(bool frc_str_conv=false) const
Definition: ov.h:773
OCTINTERP_API octave_value do_unary_op(octave_value::unary_op op, const octave_value &a)
Definition: ov.cc:2511
octave_value op_le(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1334
double erfinv(double x)
Definition: lo-specfun.cc:3063
octave_value op_lt(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1333
void erase_subfunctions(void)
Definition: ov.h:716
octave_idx_type numel(void) const
Definition: ov.h:483
#define OV_COMP_BINOP_FN(name)
Definition: ov.h:1349
bool is_defined(void) const
Definition: oct-lvalue.h:66
charMatrix char_matrix_value(bool frc_str_conv=false) const
Definition: ov.h:814
bool is_classdef_object(void) const
Definition: ov.h:580
octave_value op_el_div(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1341
function acosh(X)
Definition: acosh.f:2
virtual octave_base_value * unique_clone(void)
Definition: ov-base.h:226
double arg(double x)
Definition: lo-mappers.h:37
OCTINTERP_API octave_value do_binary_op(octave_value::binary_op op, const octave_value &a, const octave_value &b)
Definition: ov.cc:1978
bool is_int16_type(void) const
Definition: ov.h:622
bool save_ascii(std::ostream &os)
Definition: ov.h:1092
bool is_map(void) const
Definition: ov.h:574
MatrixType matrix_type(void) const
Definition: ov.h:510
DiagMatrix diag_matrix_value(bool force=false) const
Definition: ov.h:830
#define OV_BINOP_FN(name)
Definition: ov.h:1305
bool is_true(void) const
Definition: ov.h:671
unsigned short int ushort_value(bool req_int=false, bool frc_str_conv=false) const
Definition: ov.h:727
magic_colon
Definition: ov.h:169
std::string type_name(void) const
Definition: ov.h:1047
octave_value sort(octave_idx_type dim=0, sortmode mode=ASCENDING) const
Definition: ov.h:1132
bool is_bool_scalar(void) const
Definition: ov.h:547
bool is_empty(void) const
Definition: ov.h:526
~octave_value(void)
Definition: ov.h:320
bool is_sq_string(void) const
Definition: ov.h:565
NDArray array_value(bool frc_str_conv=false) const
Definition: ov.h:779
octave_int8 int8_scalar_value(void) const
Definition: ov.h:846
void assign(octave_value::assign_op, const octave_value &)
Definition: oct-lvalue.cc:33
void * mex_get_data(void) const
Definition: ov.h:1118
octave_value op_ne(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1338
void unlock(void)
Definition: ov.h:1149
bool load_ascii(std::istream &is)
Definition: ov.h:1094
bool is_dq_string(void) const
Definition: ov.h:568
bool bool_value(bool warn=false) const
Definition: ov.h:805
ComplexMatrix complex_matrix_value(bool frc_str_conv=false) const
Definition: ov.h:791
bool is_uint8_type(void) const
Definition: ov.h:631
const octave_base_value & get_rep(void) const
Definition: ov.h:1085
function gamma(X)
Definition: gamma.f:2
bool is_cs_list(void) const
Definition: ov.h:586
Complex complex_value(bool frc_str_conv=false) const
Definition: ov.h:785
std::list< octave_value_list > idx
Definition: oct-lvalue.h:103
FloatMatrix float_matrix_value(bool frc_str_conv=false) const
Definition: ov.h:776
Matrix size(void)
Definition: ov.h:392
OCTINTERP_API void install_types(void)
Definition: ov.cc:2865
compound_binary_op
Definition: ov.h:114
void print_with_name(std::ostream &os, const std::string &name) const
Definition: ov.h:1040
bool is_anonymous_function(void) const
Definition: ov.h:689
std::string class_name(void) const
Definition: ov.h:1049
octave_value op_struct_ref(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1347
octave_int64 int64_scalar_value(void) const
Definition: ov.h:855
octave_idx_type get_count(void) const
Definition: ov.h:371
bool is_constant(void) const
Definition: ov.h:683
bool is_user_function(void) const
Definition: ov.h:701
octave_value op_add(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1323
bool is_undefined(void) const
Definition: ov.h:523
double fix(double x)
Definition: lo-mappers.h:39
void make_unique(int obsolete_copies)
Definition: ov.h:342
bool is_uint64_type(void) const
Definition: ov.h:640
octave_value op_ldiv(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1329
octave_value diag(octave_idx_type m, octave_idx_type n) const
Definition: ov.h:1129
float dawson(float x)
Definition: lo-specfun.cc:349
Complex asin(const Complex &x)
Definition: lo-mappers.cc:204
ColumnVector imag(const ComplexColumnVector &a)
Definition: dColVector.cc:162
octave_uint64 uint64_scalar_value(void) const
Definition: ov.h:867
octave_value op_sub(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1324
octave_value fast_elem_extract(octave_idx_type n) const
Definition: ov.h:1232
std::complex< float > FloatComplex
Definition: oct-cmplx.h:30
virtual bool fast_elem_insert(octave_idx_type n, const octave_value &x)
Definition: ov.h:1239
PermMatrix perm_matrix_value(void) const
Definition: ov.h:843
SparseMatrix sparse_matrix_value(bool frc_str_conv=false) const
Definition: ov.h:820
octave_value op_el_mul(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1340
std::complex< T > floor(const std::complex< T > &x)
Definition: lo-mappers.h:282
octave_value op_herm_mul(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1358
std::complex< double > Complex
Definition: oct-cmplx.h:29
#define MAPPER_FORWARD(F)
Definition: ov.h:1155
octave_value sort(Array< octave_idx_type > &sidx, octave_idx_type dim=0, sortmode mode=ASCENDING) const
Definition: ov.h:1134
#define OV_UNOP_FN_OP(name, op)
Definition: ov.h:1289
bool is_single_type(void) const
Definition: ov.h:611
octave_value op_rshift(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1331
octave_value op_hermitian(const octave_value &a)
Definition: ov.h:1298
Complex acos(const Complex &x)
Definition: lo-mappers.cc:177
octave_base_value * internal_rep(void) const
Definition: ov.h:1114
ColumnVector real(const ComplexColumnVector &a)
Definition: dColVector.cc:156
double double_value(bool frc_str_conv=false) const
Definition: ov.h:759
bool is_java(void) const
Definition: ov.h:583
octave_value op_ge(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1336
bool is_uint32_type(void) const
Definition: ov.h:637
octave_uint32 uint32_scalar_value(void) const
Definition: ov.h:864
unary_op
Definition: ov.h:74
uint32NDArray uint32_array_value(void) const
Definition: ov.h:888
octave_value op_uminus(const octave_value &a)
Definition: ov.h:1295
T abs(T x)
Definition: pr-output.cc:3062
builtin_type_t builtin_type(void) const
Definition: ov.h:603
Complex atan(const Complex &x)
Definition: lo-mappers.cc:231
OCTINTERP_API octave_value do_colon_op(const octave_value &base, const octave_value &limit, bool is_for_cmd_expr=false)
Definition: ov.h:1073
bool is_diag_matrix(void) const
Definition: ov.h:556
uint16NDArray uint16_array_value(void) const
Definition: ov.h:885
octave_value op_mul(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1325
bool is_zero_by_zero(void) const
Definition: ov.h:680
void convert_to_row_or_column_vector(void)
Definition: ov.h:1025
octave_uint16 uint16_scalar_value(void) const
Definition: ov.h:861
octave_value op_gt(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1337
return octave_value(v1.char_array_value().concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string())? '\'': '"'))
F77_RET_T const double * x
static bool scalar(const dim_vector &dims)
Definition: ov-struct.cc:736
static int xisascii(int c)
Definition: ov-ch-mat.cc:160
bool is_real_matrix(void) const
Definition: ov.h:538
size_t byte_size(void) const
Definition: ov.h:489
short int short_value(bool req_int=false, bool frc_str_conv=false) const
Definition: ov.h:723
octave_lvalue & operator=(const octave_lvalue &vr)
Definition: oct-lvalue.h:49
bool is_integer_type(void) const
Definition: ov.h:648
std::complex< double > erfc(std::complex< double > z, double relerr=0)
octave_value do_index_op(const octave_value_list &idx, bool resize_ok=false)
Definition: ov.h:438