GNU Octave  4.4.1
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
ov.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 1996-2018 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
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
12 
13 Octave is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License 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 <https://www.gnu.org/licenses/>.
21 
22 */
23 
24 #if ! defined (octave_ov_h)
25 #define octave_ov_h 1
26 
27 #include "octave-config.h"
28 
29 #include <cstdlib>
30 
31 #include <iosfwd>
32 #include <string>
33 #include <list>
34 #include <map>
35 
36 #include "Range.h"
37 #include "data-conv.h"
38 #include "idx-vector.h"
39 #include "mach-info.h"
40 #include "mx-base.h"
41 #include "oct-sort.h"
42 #include "oct-time.h"
43 #include "str-vec.h"
44 
45 namespace octave
46 {
47  class type_info;
48 }
49 
50 class Cell;
51 class float_format;
52 class mxArray;
53 class octave_map;
54 class octave_scalar_map;
55 class octave_function;
57 class octave_fcn_handle;
58 class octave_fcn_inline;
59 class octave_value_list;
60 
61 #include "oct-stream.h"
62 #include "ov-base.h"
63 
64 // Forward declarations of friend functions that have default arguments.
65 
66 OCTINTERP_API octave_value do_colon_op (const octave_value& base,
67  const octave_value& limit,
68  bool is_for_cmd_expr = false);
69 
70 OCTINTERP_API octave_value do_colon_op (const octave_value& base,
71  const octave_value& increment,
72  const octave_value& limit,
73  bool is_for_cmd_expr = false);
74 
75 class
76 OCTINTERP_API
78 {
79 public:
80 
81  enum unary_op
82  {
83  op_not, // not
84  op_uplus, // uplus
85  op_uminus, // uminus
86  op_transpose, // transpose
87  op_hermitian, // ctranspose
91  unknown_unary_op
92  };
93 
94  enum binary_op
95  {
96  op_add, // plus
97  op_sub, // minus
98  op_mul, // mtimes
99  op_div, // mrdivide
100  op_pow, // mpower
101  op_ldiv, // mldivide
102  op_lt, // lt
103  op_le, // le
104  op_eq, // eq
105  op_ge, // ge
106  op_gt, // gt
107  op_ne, // ne
108  op_el_mul, // times
109  op_el_div, // rdivide
110  op_el_pow, // power
111  op_el_ldiv, // ldivide
112  op_el_and, // and
113  op_el_or, // or
116  unknown_binary_op
117  };
118 
120  {
121  // ** compound operations **
133  unknown_compound_binary_op
134  };
135 
137  {
152  unknown_assign_op
153  };
154 
155  static binary_op assign_op_to_binary_op (assign_op);
156 
157  static assign_op binary_op_to_assign_op (binary_op);
158 
159  static std::string unary_op_as_string (unary_op);
160  static std::string unary_op_fcn_name (unary_op);
161 
162  static std::string binary_op_as_string (binary_op);
163  static std::string binary_op_fcn_name (binary_op);
164 
165  static std::string binary_op_fcn_name (compound_binary_op);
166 
167  static std::string assign_op_as_string (assign_op);
168 
169  static octave_value empty_conv (const std::string& type,
170  const octave_value& rhs = octave_value ());
171 
172  enum magic_colon { magic_colon_t };
173 
175  : rep (nil_rep ())
176  {
177  rep->count++;
178  }
179 
180  octave_value (short int i);
181  octave_value (unsigned short int i);
182  octave_value (int i);
183  octave_value (unsigned int i);
184  octave_value (long int i);
185  octave_value (unsigned long int i);
186 
187  // FIXME: These are kluges. They turn into doubles internally, which will
188  // break for very large values. We just use them to store things like
189  // 64-bit ino_t, etc, and hope that those values are never actually larger
190  // than can be represented exactly in a double.
191 
192 #if defined (OCTAVE_HAVE_LONG_LONG_INT)
193  octave_value (long long int i);
194 #endif
195 #if defined (OCTAVE_HAVE_UNSIGNED_LONG_LONG_INT)
196  octave_value (unsigned long long int i);
197 #endif
198 
200  octave_value (double d);
201  octave_value (float d);
202  octave_value (const Array<octave_value>& a, bool is_cs_list = false);
203  octave_value (const Cell& c, bool is_cs_list = false);
204  octave_value (const Matrix& m, const MatrixType& t = MatrixType ());
205  octave_value (const FloatMatrix& m, const MatrixType& t = MatrixType ());
206  octave_value (const NDArray& nda);
207  octave_value (const FloatNDArray& nda);
208  octave_value (const Array<double>& m);
209  octave_value (const Array<float>& m);
210  octave_value (const DiagMatrix& d);
215  octave_value (const FloatDiagMatrix& d);
216  octave_value (const RowVector& v);
217  octave_value (const FloatRowVector& v);
218  octave_value (const ColumnVector& v);
219  octave_value (const FloatColumnVector& v);
220  octave_value (const Complex& C);
221  octave_value (const FloatComplex& C);
222  octave_value (const ComplexMatrix& m, const MatrixType& t = MatrixType ());
224  const MatrixType& t = MatrixType ());
225  octave_value (const ComplexNDArray& cnda);
226  octave_value (const FloatComplexNDArray& cnda);
227  octave_value (const Array<Complex>& m);
231  octave_value (const ComplexRowVector& v);
235  octave_value (const PermMatrix& p);
236  octave_value (bool b);
237  octave_value (const boolMatrix& bm, const MatrixType& t = MatrixType ());
238  octave_value (const boolNDArray& bnda);
239  octave_value (const Array<bool>& bnda);
240  octave_value (char c, char type = '\'');
241  octave_value (const char *s, char type = '\'');
242  octave_value (const std::string& s, char type = '\'');
243  octave_value (const string_vector& s, char type = '\'');
244  octave_value (const charMatrix& chm, char type = '\'');
245  octave_value (const charNDArray& chnda, char type = '\'');
246  octave_value (const Array<char>& chnda, char type = '\'');
247 
248  octave_value (const SparseMatrix& m, const MatrixType& t = MatrixType ());
249  octave_value (const Sparse<double>& m, const MatrixType& t = MatrixType ());
251  const MatrixType& t = MatrixType ());
252  octave_value (const Sparse<Complex>& m, const MatrixType& t = MatrixType ());
253  octave_value (const SparseBoolMatrix& bm,
254  const MatrixType& t = MatrixType ());
255  octave_value (const Sparse<bool>& m, const MatrixType& t = MatrixType ());
256  octave_value (const octave_int8& i);
257  octave_value (const octave_int16& i);
258  octave_value (const octave_int32& i);
259  octave_value (const octave_int64& i);
260  octave_value (const octave_uint8& i);
261  octave_value (const octave_uint16& i);
262  octave_value (const octave_uint32& i);
263  octave_value (const octave_uint64& i);
264  octave_value (const int8NDArray& inda);
265  octave_value (const Array<octave_int8>& inda);
266  octave_value (const int16NDArray& inda);
267  octave_value (const Array<octave_int16>& inda);
268  octave_value (const int32NDArray& inda);
269  octave_value (const Array<octave_int32>& inda);
270  octave_value (const int64NDArray& inda);
271  octave_value (const Array<octave_int64>& inda);
272  octave_value (const uint8NDArray& inda);
273  octave_value (const Array<octave_uint8>& inda);
274  octave_value (const uint16NDArray& inda);
275  octave_value (const Array<octave_uint16>& inda);
276  octave_value (const uint32NDArray& inda);
277  octave_value (const Array<octave_uint32>& inda);
278  octave_value (const uint64NDArray& inda);
279  octave_value (const Array<octave_uint64>& inda);
281  bool zero_based = false, bool cache_index = false);
282  octave_value (const Array<std::string>& cellstr);
283  octave_value (const idx_vector& idx, bool lazy = true);
284  octave_value (double base, double limit, double inc);
285  octave_value (const Range& r, bool force_range = false);
286  octave_value (const octave_map& m);
287  octave_value (const octave_scalar_map& m);
288  octave_value (const std::map<std::string, octave_value>&);
289  octave_value (const octave_map& m, const std::string& id,
290  const std::list<std::string>& plist);
291  octave_value (const octave_scalar_map& m, const std::string& id,
292  const std::list<std::string>& plist);
293 
294  OCTAVE_DEPRECATED (4.4, "note: second argument is always ignored; use octave_value (const octave_value_list&) instead")
295  octave_value (const octave_value_list& m, bool);
296 
297  // This one is explicit because it can cause some trouble to
298  // accidentally create a cs-list when one was not intended.
299  explicit octave_value (const octave_value_list& m);
300 
301  octave_value (octave_value::magic_colon);
302 
303  octave_value (octave_base_value *new_rep, bool borrow = false);
304 
305  // Copy constructor.
306 
308  {
309  rep = a.rep;
310  rep->count++;
311  }
312 
313  // This should only be called for derived types.
314 
315  octave_base_value * clone (void) const;
316 
318  { return rep->empty_clone (); }
319 
320  // Delete the representation of this constant if the count drops to zero.
321 
323  {
324  if (--rep->count == 0)
325  delete rep;
326  }
327 
328  void make_unique (void)
329  {
330  if (rep->count > 1)
331  {
332  octave_base_value *r = rep->unique_clone ();
333 
334  if (--rep->count == 0)
335  delete rep;
336 
337  rep = r;
338  }
339  }
340 
341  // This uniquifies the value if it is referenced by more than a certain
342  // number of shallow copies. This is useful for optimizations where we
343  // know a certain copy, typically within a cell array, to be obsolete.
344  void make_unique (int obsolete_copies)
345  {
346  if (rep->count > obsolete_copies + 1)
347  {
348  octave_base_value *r = rep->unique_clone ();
349 
350  if (--rep->count == 0)
351  delete rep;
352 
353  rep = r;
354  }
355  }
356 
357  // Simple assignment.
358 
360  {
361  if (rep != a.rep)
362  {
363  if (--rep->count == 0)
364  delete rep;
365 
366  rep = a.rep;
367  rep->count++;
368  }
369 
370  return *this;
371  }
372 
373  octave_idx_type get_count (void) const { return rep->count; }
374 
376  { return rep->numeric_conversion_function (); }
377 
379  { return rep->numeric_demotion_function (); }
380 
381  void maybe_mutate (void);
382 
383  octave_value squeeze (void) const
384  { return rep->squeeze (); }
385 
386  // The result of full().
388  { return rep->full_value (); }
389 
390  // Type conversions.
391 
392  octave_value as_double (void) const { return rep->as_double (); }
393  octave_value as_single (void) const { return rep->as_single (); }
394 
395  octave_value as_int8 (void) const { return rep->as_int8 (); }
396  octave_value as_int16 (void) const { return rep->as_int16 (); }
397  octave_value as_int32 (void) const { return rep->as_int32 (); }
398  octave_value as_int64 (void) const { return rep->as_int64 (); }
399 
400  octave_value as_uint8 (void) const { return rep->as_uint8 (); }
401  octave_value as_uint16 (void) const { return rep->as_uint16 (); }
402  octave_value as_uint32 (void) const { return rep->as_uint32 (); }
403  octave_value as_uint64 (void) const { return rep->as_uint64 (); }
404 
406  { return rep->try_narrowing_conversion (); }
407 
408  // Close to dims (), but can be overloaded for classes.
409  Matrix size (void)
410  { return rep->size (); }
411 
413  { return rep->numel (idx); }
414 
415  octave_value single_subsref (const std::string& type,
416  const octave_value_list& idx);
417 
419  const std::list<octave_value_list>& idx)
420  { return rep->subsref (type, idx); }
421 
423  const std::list<octave_value_list>& idx,
424  bool auto_add)
425  { return rep->subsref (type, idx, auto_add); }
426 
428  const std::list<octave_value_list>& idx,
429  int nargout);
430 
431  octave_value next_subsref (const std::string& type, const
432  std::list<octave_value_list>& idx,
433  size_t skip = 1);
434 
435  octave_value_list next_subsref (int nargout,
436  const std::string& type, const
437  std::list<octave_value_list>& idx,
438  size_t skip = 1);
439 
440  octave_value next_subsref (bool auto_add, const std::string& type, const
441  std::list<octave_value_list>& idx,
442  size_t skip = 1);
443 
445  bool resize_ok = false)
446  { return rep->do_index_op (idx, resize_ok); }
447 
449  const std::list<octave_value_list>& idx,
450  const octave_value& rhs);
451 
452  octave_value undef_subsasgn (const std::string& type,
453  const std::list<octave_value_list>& idx,
454  const octave_value& rhs);
455 
456  octave_value& assign (assign_op op, const std::string& type,
457  const std::list<octave_value_list>& idx,
458  const octave_value& rhs);
459 
460  octave_value& assign (assign_op, const octave_value& rhs);
461 
462  idx_vector index_vector (bool require_integers = false) const
463  {
464  return rep->index_vector (require_integers);
465  }
466 
467  // Size.
468 
469  dim_vector dims (void) const
470  { return rep->dims (); }
471 
472  octave_idx_type rows (void) const { return rep->rows (); }
473 
474  octave_idx_type columns (void) const { return rep->columns (); }
475 
476  octave_idx_type length (void) const;
477 
478  int ndims (void) const { return rep->ndims (); }
479 
480  bool all_zero_dims (void) const { return dims ().all_zero (); }
481 
482  // Are the dimensions of this constant zero by zero?
483  bool is_zero_by_zero (void) const
484  { return (ndims () == 2 && rows () == 0 && columns () == 0); }
485 
486  octave_idx_type numel (void) const
487  { return rep->numel (); }
488 
489  OCTAVE_DEPRECATED (4.4, "use 'numel' instead")
490  octave_idx_type capacity (void) const
491  { return rep->numel (); }
492 
493  size_t byte_size (void) const
494  { return rep->byte_size (); }
495 
496  octave_idx_type nnz (void) const { return rep->nnz (); }
497 
498  octave_idx_type nzmax (void) const { return rep->nzmax (); }
499 
500  octave_idx_type nfields (void) const { return rep->nfields (); }
501 
503  { return rep->reshape (dv); }
504 
505  octave_value permute (const Array<int>& vec, bool inv = false) const
506  { return rep->permute (vec, inv); }
507 
508  octave_value ipermute (const Array<int>& vec) const
509  { return rep->permute (vec, true); }
510 
511  octave_value resize (const dim_vector& dv, bool fill = false) const
512  { return rep->resize (dv, fill);}
513 
514  MatrixType matrix_type (void) const
515  { return rep->matrix_type (); }
516 
517  MatrixType matrix_type (const MatrixType& typ) const
518  { return rep->matrix_type (typ); }
519 
520  // Does this constant have a type? Both of these are provided since it is
521  // sometimes more natural to write is_undefined() instead of ! is_defined().
522 
523  bool is_defined (void) const
524  { return rep->is_defined (); }
525 
526  bool is_undefined (void) const
527  { return ! is_defined (); }
528 
529  bool isempty (void) const
530  { return rep->isempty (); }
531 
532  OCTAVE_DEPRECATED (4.4, "use 'isempty' instead")
533  bool is_empty (void) const
534  { return rep->isempty (); }
535 
536  bool iscell (void) const
537  { return rep->iscell (); }
538 
539  OCTAVE_DEPRECATED (4.4, "use 'iscell' instead")
540  bool is_cell (void) const
541  { return rep->iscell (); }
542 
543  bool iscellstr (void) const
544  { return rep->iscellstr (); }
545 
546  OCTAVE_DEPRECATED (4.4, "use 'iscellstr' instead")
547  bool is_cellstr (void) const
548  { return rep->iscellstr (); }
549 
550  bool is_real_scalar (void) const
551  { return rep->is_real_scalar (); }
552 
553  bool is_real_matrix (void) const
554  { return rep->is_real_matrix (); }
555 
556  bool is_complex_scalar (void) const
557  { return rep->is_complex_scalar (); }
558 
559  bool is_complex_matrix (void) const
560  { return rep->is_complex_matrix (); }
561 
562  bool is_bool_scalar (void) const
563  { return rep->is_bool_scalar (); }
564 
565  bool is_bool_matrix (void) const
566  { return rep->is_bool_matrix (); }
567 
568  bool is_char_matrix (void) const
569  { return rep->is_char_matrix (); }
570 
571  bool is_diag_matrix (void) const
572  { return rep->is_diag_matrix (); }
573 
574  bool is_perm_matrix (void) const
575  { return rep->is_perm_matrix (); }
576 
577  bool is_string (void) const
578  { return rep->is_string (); }
579 
580  bool is_sq_string (void) const
581  { return rep->is_sq_string (); }
582 
583  bool is_dq_string (void) const
584  { return rep->is_string () && ! rep->is_sq_string (); }
585 
586  bool is_range (void) const
587  { return rep->is_range (); }
588 
589  bool isstruct (void) const
590  { return rep->isstruct (); }
591 
592  OCTAVE_DEPRECATED (4.4, "use 'isstruct' instead")
593  bool is_map (void) const
594  { return rep->isstruct (); }
595 
596  bool is_classdef_meta (void) const
597  { return rep->is_classdef_meta (); }
598 
599  bool is_classdef_object (void) const
600  { return rep->is_classdef_object (); }
601 
602  bool is_classdef_superclass_ref (void) const
603  { return rep->is_classdef_superclass_ref (); }
604 
605  bool is_package (void) const
606  { return rep->is_package (); }
607 
608  bool isobject (void) const
609  { return rep->isobject (); }
610 
611  OCTAVE_DEPRECATED (4.4, "use 'isobject' instead")
612  bool is_object (void) const
613  { return rep->isobject (); }
614 
615  bool isjava (void) const
616  { return rep->isjava (); }
617 
618  OCTAVE_DEPRECATED (4.4, "use 'isjava' instead")
619  bool is_java (void) const
620  { return rep->isjava (); }
621 
622  bool is_cs_list (void) const
623  { return rep->is_cs_list (); }
624 
625  bool is_magic_colon (void) const
626  { return rep->is_magic_colon (); }
627 
628  bool isnull (void) const
629  { return rep->isnull (); }
630 
631  OCTAVE_DEPRECATED (4.4, "use 'isnull' instead")
632  bool is_null_value (void) const
633  { return rep->isnull (); }
634 
635  // Are any or all of the elements in this constant nonzero?
636 
637  octave_value all (int dim = 0) const
638  { return rep->all (dim); }
639 
640  octave_value any (int dim = 0) const
641  { return rep->any (dim); }
642 
644  { return rep->builtin_type (); }
645 
646  // Floating point types.
647 
648  bool is_double_type (void) const
649  { return rep->is_double_type (); }
650 
651  bool is_single_type (void) const
652  { return rep->is_single_type (); }
653 
654  bool isfloat (void) const
655  { return rep->isfloat (); }
656 
657  OCTAVE_DEPRECATED (4.4, "use 'isfloat' instead")
658  bool is_float_type (void) const
659  { return rep->isfloat (); }
660 
661  // Integer types.
662 
663  bool is_int8_type (void) const
664  { return rep->is_int8_type (); }
665 
666  bool is_int16_type (void) const
667  { return rep->is_int16_type (); }
668 
669  bool is_int32_type (void) const
670  { return rep->is_int32_type (); }
671 
672  bool is_int64_type (void) const
673  { return rep->is_int64_type (); }
674 
675  bool is_uint8_type (void) const
676  { return rep->is_uint8_type (); }
677 
678  bool is_uint16_type (void) const
679  { return rep->is_uint16_type (); }
680 
681  bool is_uint32_type (void) const
682  { return rep->is_uint32_type (); }
683 
684  bool is_uint64_type (void) const
685  { return rep->is_uint64_type (); }
686 
687  bool isinteger (void) const
688  { return rep->isinteger (); }
689 
690  OCTAVE_DEPRECATED (4.4, "use 'isinteger' instead")
691  bool is_integer_type (void) const
692  { return rep->isinteger (); }
693 
694  // Other type stuff.
695 
696  bool islogical (void) const
697  { return rep->islogical (); }
698 
699  OCTAVE_DEPRECATED (4.4, "use 'islogical' instead")
700  bool is_bool_type (void) const
701  { return rep->islogical (); }
702 
703  bool isreal (void) const
704  { return rep->isreal (); }
705 
706  OCTAVE_DEPRECATED (4.4, "use 'isreal' instead")
707  bool is_real_type (void) const
708  { return rep->isreal (); }
709 
710  bool iscomplex (void) const
711  { return rep->iscomplex (); }
712 
713  OCTAVE_DEPRECATED (4.4, "use 'iscomplex' instead")
714  bool is_complex_type (void) const
715  { return rep->iscomplex (); }
716 
717  bool is_scalar_type (void) const
718  { return rep->is_scalar_type (); }
719 
720  bool is_matrix_type (void) const
721  { return rep->is_matrix_type (); }
722 
723  bool isnumeric (void) const
724  { return rep->isnumeric (); }
725 
726  OCTAVE_DEPRECATED (4.4, "use 'isnumeric' instead")
727  bool is_numeric_type (void) const
728  { return rep->isnumeric (); }
729 
730  bool issparse (void) const
731  { return rep->issparse (); }
732 
733  OCTAVE_DEPRECATED (4.4, "use 'issparse' instead")
734  bool is_sparse_type (void) const
735  { return rep->issparse (); }
736 
737  // Does this constant correspond to a truth value?
738 
739  bool is_true (void) const
740  { return rep->is_true (); }
741 
742  // Do two constants match (in a switch statement)?
743 
744  bool is_equal (const octave_value&) const;
745 
746  bool is_constant (void) const
747  { return rep->is_constant (); }
748 
749  bool is_function_handle (void) const
750  { return rep->is_function_handle (); }
751 
752  bool is_anonymous_function (void) const
753  { return rep->is_anonymous_function (); }
754 
755  bool is_inline_function (void) const
756  { return rep->is_inline_function (); }
757 
758  bool is_function (void) const
759  { return rep->is_function (); }
760 
761  bool is_user_script (void) const
762  { return rep->is_user_script (); }
763 
764  bool is_user_function (void) const
765  { return rep->is_user_function (); }
766 
767  bool is_user_code (void) const
768  { return rep->is_user_code (); }
769 
770  bool is_builtin_function (void) const
771  { return rep->is_builtin_function (); }
772 
773  bool is_dld_function (void) const
774  { return rep->is_dld_function (); }
775 
776  bool is_mex_function (void) const
777  { return rep->is_mex_function (); }
778 
779  void erase_subfunctions (void) { rep->erase_subfunctions (); }
780 
781  // Values.
782 
783  octave_value eval (void) { return *this; }
784 
785  short int
786  short_value (bool req_int = false, bool frc_str_conv = false) const
787  { return rep->short_value (req_int, frc_str_conv); }
788 
789  unsigned short int
790  ushort_value (bool req_int = false, bool frc_str_conv = false) const
791  { return rep->ushort_value (req_int, frc_str_conv); }
792 
793  int int_value (bool req_int = false, bool frc_str_conv = false) const
794  { return rep->int_value (req_int, frc_str_conv); }
795 
796  unsigned int
797  uint_value (bool req_int = false, bool frc_str_conv = false) const
798  { return rep->uint_value (req_int, frc_str_conv); }
799 
800  int nint_value (bool frc_str_conv = false) const
801  { return rep->nint_value (frc_str_conv); }
802 
803  long int
804  long_value (bool req_int = false, bool frc_str_conv = false) const
805  { return rep->long_value (req_int, frc_str_conv); }
806 
807  unsigned long int
808  ulong_value (bool req_int = false, bool frc_str_conv = false) const
809  { return rep->ulong_value (req_int, frc_str_conv); }
810 
811  int64_t
812  int64_value (bool req_int = false, bool frc_str_conv = false) const
813  { return rep->int64_value (req_int, frc_str_conv); }
814 
815  uint64_t
816  uint64_value (bool req_int = false, bool frc_str_conv = false) const
817  { return rep->uint64_value (req_int, frc_str_conv); }
818 
820  idx_type_value (bool req_int = false, bool frc_str_conv = false) const;
821 
822  double double_value (bool frc_str_conv = false) const
823  { return rep->double_value (frc_str_conv); }
824 
825  float float_value (bool frc_str_conv = false) const
826  { return rep->float_value (frc_str_conv); }
827 
828  double scalar_value (bool frc_str_conv = false) const
829  { return rep->scalar_value (frc_str_conv); }
830 
831  float float_scalar_value (bool frc_str_conv = false) const
832  { return rep->float_scalar_value (frc_str_conv); }
833 
834  Matrix matrix_value (bool frc_str_conv = false) const
835  { return rep->matrix_value (frc_str_conv); }
836 
837  FloatMatrix float_matrix_value (bool frc_str_conv = false) const
838  { return rep->float_matrix_value (frc_str_conv); }
839 
840  NDArray array_value (bool frc_str_conv = false) const
841  { return rep->array_value (frc_str_conv); }
842 
843  FloatNDArray float_array_value (bool frc_str_conv = false) const
844  { return rep->float_array_value (frc_str_conv); }
845 
846  Complex complex_value (bool frc_str_conv = false) const
847  { return rep->complex_value (frc_str_conv); }
848 
849  FloatComplex float_complex_value (bool frc_str_conv = false) const
850  { return rep->float_complex_value (frc_str_conv); }
851 
852  ComplexMatrix complex_matrix_value (bool frc_str_conv = false) const
853  { return rep->complex_matrix_value (frc_str_conv); }
854 
856  float_complex_matrix_value (bool frc_str_conv = false) const
857  { return rep->float_complex_matrix_value (frc_str_conv); }
858 
859  ComplexNDArray complex_array_value (bool frc_str_conv = false) const
860  { return rep->complex_array_value (frc_str_conv); }
861 
863  float_complex_array_value (bool frc_str_conv = false) const
864  { return rep->float_complex_array_value (frc_str_conv); }
865 
866  bool bool_value (bool warn = false) const
867  { return rep->bool_value (warn); }
868 
869  boolMatrix bool_matrix_value (bool warn = false) const
870  { return rep->bool_matrix_value (warn); }
871 
872  boolNDArray bool_array_value (bool warn = false) const
873  { return rep->bool_array_value (warn); }
874 
875  charMatrix char_matrix_value (bool frc_str_conv = false) const
876  { return rep->char_matrix_value (frc_str_conv); }
877 
878  charNDArray char_array_value (bool frc_str_conv = false) const
879  { return rep->char_array_value (frc_str_conv); }
880 
881  SparseMatrix sparse_matrix_value (bool frc_str_conv = false) const
882  { return rep->sparse_matrix_value (frc_str_conv); }
883 
885  sparse_complex_matrix_value (bool frc_str_conv = false) const
886  { return rep->sparse_complex_matrix_value (frc_str_conv); }
887 
888  SparseBoolMatrix sparse_bool_matrix_value (bool warn = false) const
889  { return rep->sparse_bool_matrix_value (warn); }
890 
891  DiagMatrix diag_matrix_value (bool force = false) const
892  { return rep->diag_matrix_value (force); }
893 
894  FloatDiagMatrix float_diag_matrix_value (bool force = false) const
895  { return rep->float_diag_matrix_value (force); }
896 
897  ComplexDiagMatrix complex_diag_matrix_value (bool force = false) const
898  { return rep->complex_diag_matrix_value (force); }
899 
901  float_complex_diag_matrix_value (bool force = false) const
902  { return rep->float_complex_diag_matrix_value (force); }
903 
905  { return rep->perm_matrix_value (); }
906 
908  { return rep->int8_scalar_value (); }
909 
911  { return rep->int16_scalar_value (); }
912 
914  { return rep->int32_scalar_value (); }
915 
917  { return rep->int64_scalar_value (); }
918 
920  { return rep->uint8_scalar_value (); }
921 
923  { return rep->uint16_scalar_value (); }
924 
926  { return rep->uint32_scalar_value (); }
927 
929  { return rep->uint64_scalar_value (); }
930 
932  { return rep->int8_array_value (); }
933 
935  { return rep->int16_array_value (); }
936 
938  { return rep->int32_array_value (); }
939 
941  { return rep->int64_array_value (); }
942 
944  { return rep->uint8_array_value (); }
945 
947  { return rep->uint16_array_value (); }
948 
950  { return rep->uint32_array_value (); }
951 
953  { return rep->uint64_array_value (); }
954 
955  std::string string_value (bool force = false) const
956  { return rep->string_value (force); }
957 
958  string_vector string_vector_value (bool pad = false) const
959  { return rep->string_vector_value (pad); }
960 
961  OCTAVE_DEPRECATED (4.4, "use 'string_vector_value' instead")
962  string_vector all_strings (bool pad = false) const
963  { return string_vector_value (pad); }
964 
965  Cell cell_value (void) const;
966 
968  { return rep->cellstr_value (); }
969 
970  Range range_value (void) const
971  { return rep->range_value (); }
972 
973  octave_map map_value (void) const;
974 
975  octave_scalar_map scalar_map_value (void) const;
976 
977  string_vector map_keys (void) const
978  { return rep->map_keys (); }
979 
980  size_t nparents (void) const
981  { return rep->nparents (); }
982 
983  std::list<std::string> parent_class_name_list (void) const
984  { return rep->parent_class_name_list (); }
985 
987  { return rep->parent_class_names (); }
988 
990  find_parent_class (const std::string& parent_class_name)
991  { return rep->find_parent_class (parent_class_name); }
992 
993  bool is_instance_of (const std::string& cls_name) const
994  { return rep->is_instance_of (cls_name); }
995 
996  octave_classdef * classdef_object_value (bool silent = false) const;
997 
998  octave_function * function_value (bool silent = false) const;
999 
1000  octave_user_function * user_function_value (bool silent = false) const;
1001 
1002  octave_user_script * user_script_value (bool silent = false) const;
1003 
1004  octave_user_code * user_code_value (bool silent = false) const;
1005 
1006  octave_fcn_handle * fcn_handle_value (bool silent = false) const;
1007 
1008  octave_fcn_inline * fcn_inline_value (bool silent = false) const;
1009 
1010  octave_value_list list_value (void) const;
1011 
1012  ColumnVector column_vector_value (bool frc_str_conv = false,
1013  bool frc_vec_conv = false) const;
1014 
1016  complex_column_vector_value (bool frc_str_conv = false,
1017  bool frc_vec_conv = false) const;
1018 
1019  RowVector row_vector_value (bool frc_str_conv = false,
1020  bool frc_vec_conv = false) const;
1021 
1023  complex_row_vector_value (bool frc_str_conv = false,
1024  bool frc_vec_conv = false) const;
1025 
1026  FloatColumnVector float_column_vector_value (bool frc_str_conv = false,
1027  bool frc_vec_conv = false) const;
1028 
1030  float_complex_column_vector_value (bool frc_str_conv = false,
1031  bool frc_vec_conv = false) const;
1032 
1033  FloatRowVector float_row_vector_value (bool frc_str_conv = false,
1034  bool frc_vec_conv = false) const;
1035 
1037  float_complex_row_vector_value (bool frc_str_conv = false,
1038  bool frc_vec_conv = false) const;
1039 
1040  Array<int> int_vector_value (bool req_int = false,
1041  bool frc_str_conv = false,
1042  bool frc_vec_conv = false) const;
1043 
1045  octave_idx_type_vector_value (bool req_int = false,
1046  bool frc_str_conv = false,
1047  bool frc_vec_conv = false) const;
1048 
1049  Array<double> vector_value (bool frc_str_conv = false,
1050  bool frc_vec_conv = false) const;
1051 
1052  Array<Complex> complex_vector_value (bool frc_str_conv = false,
1053  bool frc_vec_conv = false) const;
1054 
1055  Array<float> float_vector_value (bool frc_str_conv = false,
1056  bool frc_vec_conv = false) const;
1057 
1059  float_complex_vector_value (bool frc_str_conv = false,
1060  bool frc_vec_conv = false) const;
1061 
1062  // Extract values of specific types without any implicit type conversions.
1063  // Throw an error if an object is the wrong type for the requested value
1064  // extraction.
1065  //
1066  // These functions are intended to provide a simple way to extract values of
1067  // specific types and display error messages that are more meaningful than
1068  // the generic "error: wrong type argument 'cell'" message.
1069 
1070  short int xshort_value (const char *fmt, ...) const;
1071 
1072  unsigned short int xushort_value (const char *fmt, ...) const;
1073 
1074  int xint_value (const char *fmt, ...) const;
1075 
1076  unsigned int xuint_value (const char *fmt, ...) const;
1077 
1078  int xnint_value (const char *fmt, ...) const;
1079 
1080  long int xlong_value (const char *fmt, ...) const;
1081 
1082  unsigned long int xulong_value (const char *fmt, ...) const;
1083 
1084  int64_t xint64_value (const char *fmt, ...) const;
1085 
1086  uint64_t xuint64_value (const char *fmt, ...) const;
1087 
1088  octave_idx_type xidx_type_value (const char *fmt, ...) const;
1089 
1090  double xdouble_value (const char *fmt, ...) const;
1091 
1092  float xfloat_value (const char *fmt, ...) const;
1093 
1094  double xscalar_value (const char *fmt, ...) const;
1095 
1096  float xfloat_scalar_value (const char *fmt, ...) const;
1097 
1098  Matrix xmatrix_value (const char *fmt, ...) const;
1099 
1100  FloatMatrix xfloat_matrix_value (const char *fmt, ...) const;
1101 
1102  NDArray xarray_value (const char *fmt, ...) const;
1103 
1104  FloatNDArray xfloat_array_value (const char *fmt, ...) const;
1105 
1106  Complex xcomplex_value (const char *fmt, ...) const;
1107 
1108  FloatComplex xfloat_complex_value (const char *fmt, ...) const;
1109 
1110  ComplexMatrix xcomplex_matrix_value (const char *fmt, ...) const;
1111 
1112  FloatComplexMatrix xfloat_complex_matrix_value (const char *fmt, ...) const;
1113 
1114  ComplexNDArray xcomplex_array_value (const char *fmt, ...) const;
1115 
1116  FloatComplexNDArray xfloat_complex_array_value (const char *fmt, ...) const;
1117 
1118  bool xbool_value (const char *fmt, ...) const;
1119 
1120  boolMatrix xbool_matrix_value (const char *fmt, ...) const;
1121 
1122  boolNDArray xbool_array_value (const char *fmt, ...) const;
1123 
1124  charMatrix xchar_matrix_value (const char *fmt, ...) const;
1125 
1126  charNDArray xchar_array_value (const char *fmt, ...) const;
1127 
1128  SparseMatrix xsparse_matrix_value (const char *fmt, ...) const;
1129 
1130  SparseComplexMatrix xsparse_complex_matrix_value (const char *fmt, ...) const;
1131 
1132  SparseBoolMatrix xsparse_bool_matrix_value (const char *fmt, ...) const;
1133 
1134  DiagMatrix xdiag_matrix_value (const char *fmt, ...) const;
1135 
1136  FloatDiagMatrix xfloat_diag_matrix_value (const char *fmt, ...) const;
1137 
1138  ComplexDiagMatrix xcomplex_diag_matrix_value (const char *fmt, ...) const;
1139 
1140  FloatComplexDiagMatrix xfloat_complex_diag_matrix_value (const char *fmt, ...) const;
1141 
1142  PermMatrix xperm_matrix_value (const char *fmt, ...) const;
1143 
1144  octave_int8 xint8_scalar_value (const char *fmt, ...) const;
1145 
1146  octave_int16 xint16_scalar_value (const char *fmt, ...) const;
1147 
1148  octave_int32 xint32_scalar_value (const char *fmt, ...) const;
1149 
1150  octave_int64 xint64_scalar_value (const char *fmt, ...) const;
1151 
1152  octave_uint8 xuint8_scalar_value (const char *fmt, ...) const;
1153 
1154  octave_uint16 xuint16_scalar_value (const char *fmt, ...) const;
1155 
1156  octave_uint32 xuint32_scalar_value (const char *fmt, ...) const;
1157 
1158  octave_uint64 xuint64_scalar_value (const char *fmt, ...) const;
1159 
1160  int8NDArray xint8_array_value (const char *fmt, ...) const;
1161 
1162  int16NDArray xint16_array_value (const char *fmt, ...) const;
1163 
1164  int32NDArray xint32_array_value (const char *fmt, ...) const;
1165 
1166  int64NDArray xint64_array_value (const char *fmt, ...) const;
1167 
1168  uint8NDArray xuint8_array_value (const char *fmt, ...) const;
1169 
1170  uint16NDArray xuint16_array_value (const char *fmt, ...) const;
1171 
1172  uint32NDArray xuint32_array_value (const char *fmt, ...) const;
1173 
1174  uint64NDArray xuint64_array_value (const char *fmt, ...) const;
1175 
1176  std::string xstring_value (const char *fmt, ...) const;
1177 
1178  string_vector xstring_vector_value (const char *fmt, ...) const;
1179 
1180  Cell xcell_value (const char *fmt, ...) const;
1181 
1182  Array<std::string> xcellstr_value (const char *fmt, ...) const;
1183 
1184  Range xrange_value (const char *fmt, ...) const;
1185 
1186  octave_map xmap_value (const char *fmt, ...) const;
1187 
1188  octave_scalar_map xscalar_map_value (const char *fmt, ...) const;
1189 
1190  ColumnVector xcolumn_vector_value (const char *fmt, ...) const;
1191 
1193  xcomplex_column_vector_value (const char *fmt, ...) const;
1194 
1195  RowVector xrow_vector_value (const char *fmt, ...) const;
1196 
1197  ComplexRowVector xcomplex_row_vector_value (const char *fmt, ...) const;
1198 
1199  FloatColumnVector xfloat_column_vector_value (const char *fmt, ...) const;
1200 
1202  xfloat_complex_column_vector_value (const char *fmt, ...) const;
1203 
1204  FloatRowVector xfloat_row_vector_value (const char *fmt, ...) const;
1205 
1207  xfloat_complex_row_vector_value (const char *fmt, ...) const;
1208 
1209  Array<int> xint_vector_value (const char *fmt, ...) const;
1210 
1212  xoctave_idx_type_vector_value (const char *fmt, ...) const;
1213 
1214  Array<double> xvector_value (const char *fmt, ...) const;
1215 
1216  Array<Complex> xcomplex_vector_value (const char *fmt, ...) const;
1217 
1218  Array<float> xfloat_vector_value (const char *fmt, ...) const;
1219 
1220  Array<FloatComplex> xfloat_complex_vector_value (const char *fmt, ...) const;
1221 
1222  octave_function * xfunction_value (const char *fmt, ...) const;
1223  octave_user_function * xuser_function_value (const char *fmt, ...) const;
1224  octave_user_script * xuser_script_value (const char *fmt, ...) const;
1225  octave_user_code * xuser_code_value (const char *fmt, ...) const;
1226  octave_fcn_handle * xfcn_handle_value (const char *fmt, ...) const;
1227  octave_fcn_inline * xfcn_inline_value (const char *fmt, ...) const;
1228 
1229  octave_value_list xlist_value (const char *fmt, ...) const;
1230 
1231  // Possibly economize a lazy-indexed value.
1232 
1233  void maybe_economize (void)
1234  { rep->maybe_economize (); }
1235 
1236  // The following two hook conversions are called on any octave_value prior to
1237  // storing it to a "permanent" location, like a named variable, a cell or a
1238  // struct component, or a return value of a function.
1239 
1240  octave_value storable_value (void) const;
1241 
1242  // Ditto, but in place, i.e., equivalent to *this = this->storable_value (),
1243  // but possibly more efficient.
1244 
1245  void make_storable_value (void);
1246 
1247  // FIXME: These should probably be private.
1248  // Conversions. If a user of this class wants a certain kind of constant,
1249  // he should simply ask for it, and we should convert it if possible.
1250 
1251  octave_value convert_to_str (bool pad = false, bool force = false,
1252  char type = '\'') const
1253  { return rep->convert_to_str (pad, force, type); }
1254 
1255  octave_value
1256  convert_to_str_internal (bool pad, bool force, char type) const
1257  { return rep->convert_to_str_internal (pad, force, type); }
1258 
1260  { rep->convert_to_row_or_column_vector (); }
1261 
1262  bool print_as_scalar (void) const
1263  { return rep->print_as_scalar (); }
1264 
1265  void print (std::ostream& os, bool pr_as_read_syntax = false)
1266  { rep->print (os, pr_as_read_syntax); }
1267 
1268  void print_raw (std::ostream& os, bool pr_as_read_syntax = false) const
1269  { rep->print_raw (os, pr_as_read_syntax); }
1270 
1271  bool print_name_tag (std::ostream& os, const std::string& name) const
1272  { return rep->print_name_tag (os, name); }
1273 
1274  void print_with_name (std::ostream& os, const std::string& name) const
1275  { rep->print_with_name (os, name, true); }
1276 
1277  void short_disp (std::ostream& os) const { rep->short_disp (os); }
1278 
1280 
1283  {
1284  return rep->edit_display (fmt, i, j);
1285  }
1286 
1287  int type_id (void) const { return rep->type_id (); }
1288 
1289  std::string type_name (void) const { return rep->type_name (); }
1290 
1291  std::string class_name (void) const { return rep->class_name (); }
1292 
1293  // Unary and binary operations.
1294 
1295  friend OCTINTERP_API octave_value
1296  do_unary_op (octave::type_info& ti, unary_op op, const octave_value& a);
1297 
1298  octave_value& do_non_const_unary_op (unary_op op);
1299 
1300  octave_value& do_non_const_unary_op (unary_op op, const std::string& type,
1301  const std::list<octave_value_list>& idx);
1302 
1303  friend OCTINTERP_API octave_value
1304  do_binary_op (octave::type_info& ti, binary_op op,
1305  const octave_value& a, const octave_value& b);
1306 
1307  friend OCTINTERP_API octave_value
1308  do_binary_op (octave::type_info& ti, compound_binary_op op,
1309  const octave_value& a, const octave_value& b);
1310 
1311  friend OCTINTERP_API octave_value
1313  const octave_value& b, const Array<octave_idx_type>& ra_idx);
1314 
1315  friend OCTINTERP_API octave_value do_colon_op (const octave_value& base,
1316  const octave_value& limit,
1317  bool is_for_cmd_expr)
1318  {
1319  return do_colon_op (base, octave_value (), limit, is_for_cmd_expr);
1320  }
1321 
1322  friend OCTINTERP_API octave_value do_colon_op (const octave_value& base,
1323  const octave_value& increment,
1324  const octave_value& limit,
1325  bool is_for_cmd_expr);
1326 
1327  const octave_base_value& get_rep (void) const { return *rep; }
1328 
1329  bool is_copy_of (const octave_value& val) const { return rep == val.rep; }
1330 
1331  void print_info (std::ostream& os,
1332  const std::string& prefix = "") const;
1333 
1334  bool save_ascii (std::ostream& os) { return rep->save_ascii (os); }
1335 
1336  bool load_ascii (std::istream& is) { return rep->load_ascii (is); }
1337 
1338  bool save_binary (std::ostream& os, bool& save_as_floats)
1339  { return rep->save_binary (os, save_as_floats); }
1340 
1341  bool load_binary (std::istream& is, bool swap,
1343  { return rep->load_binary (is, swap, fmt); }
1344 
1345  bool save_hdf5 (octave_hdf5_id loc_id, const char *name,
1346  bool save_as_floats)
1347  { return rep->save_hdf5 (loc_id, name, save_as_floats); }
1348 
1349  bool load_hdf5 (octave_hdf5_id loc_id, const char *name)
1350  { return rep->load_hdf5 (loc_id, name); }
1351 
1352  int write (octave::stream& os, int block_size,
1353  oct_data_conv::data_type output_type, int skip,
1355 
1356  octave_base_value * internal_rep (void) const { return rep; }
1357 
1358  // Unsafe. These functions exist to support the MEX interface.
1359  // You should not use them anywhere else.
1360  void * mex_get_data (void) const { return rep->mex_get_data (); }
1361 
1362  octave_idx_type * mex_get_ir (void) const { return rep->mex_get_ir (); }
1363 
1364  octave_idx_type * mex_get_jc (void) const { return rep->mex_get_jc (); }
1365 
1366  mxArray * as_mxArray (void) const { return rep->as_mxArray (); }
1367 
1369  { return rep->diag (k); }
1370 
1372  { return rep->diag (m, n); }
1373 
1375  { return rep->sort (dim, mode); }
1377  sortmode mode = ASCENDING) const
1378  { return rep->sort (sidx, dim, mode); }
1379 
1381  { return rep->issorted (mode); }
1382 
1383  OCTAVE_DEPRECATED (4.4, "use 'issorted' instead")
1384  sortmode is_sorted (sortmode mode = UNSORTED) const
1385  { return rep->issorted (mode); }
1386 
1388  { return rep->sort_rows_idx (mode); }
1389 
1391  { return rep->is_sorted_rows (mode); }
1392 
1393  void lock (void) { rep->lock (); }
1394 
1395  void unlock (void) { rep->unlock (); }
1396 
1397  bool islocked (void) const { return rep->islocked (); }
1398 
1399  octave_value dump (void) const { return rep->dump (); }
1400 
1401 #define MAPPER_FORWARD(F) \
1402  octave_value F (void) const \
1403  { \
1404  return rep->map (octave_base_value::umap_ ## F); \
1405  }
1406 
1452 
1453  // These functions are prefixed with X to avoid potential macro conflicts.
1454 
1455  MAPPER_FORWARD (xisalnum)
1456  MAPPER_FORWARD (xisalpha)
1458  MAPPER_FORWARD (xiscntrl)
1459  MAPPER_FORWARD (xisdigit)
1460  MAPPER_FORWARD (xisgraph)
1461  MAPPER_FORWARD (xislower)
1462  MAPPER_FORWARD (xisprint)
1463  MAPPER_FORWARD (xispunct)
1464  MAPPER_FORWARD (xisspace)
1465  MAPPER_FORWARD (xisupper)
1466  MAPPER_FORWARD (xisxdigit)
1467  MAPPER_FORWARD (xsignbit)
1468  MAPPER_FORWARD (xtolower)
1469  MAPPER_FORWARD (xtoupper)
1470 
1471 #undef MAPPER_FORWARD
1472 
1474  { return rep->map (umap); }
1475 
1476  //! Extract the n-th element, aka `val(n)`.
1477  //!
1478  //! @return Result is undefined if `val` is not an array type
1479  //! or @p n is out of range.
1480  //!
1481  //! @warning Function calls should never error.
1482 
1483  octave_value
1485  { return rep->fast_elem_extract (n); }
1486 
1487  //! Assign the n-th element, aka `val(n) = x`.
1488  //!
1489  //! @returns false if `val` is not an array type,
1490  //! @p x is not a matching scalar type,
1491  //! or @p n is out of range.
1492  //!
1493  //! @warning Function calls should never error.
1494 
1495  bool
1497  {
1498  make_unique ();
1499  return rep->fast_elem_insert (n, x);
1500  }
1501 
1502 protected:
1503 
1504  //! The real representation.
1506 
1507 private:
1508 
1509  static octave_base_value *nil_rep (void);
1510 
1511  assign_op unary_op_to_assign_op (unary_op op);
1512 
1513  binary_op op_eq_to_binary_op (assign_op op);
1514 
1515  // This declaration protects against constructing octave_value from
1516  // const octave_base_value* which actually silently calls octave_value (bool).
1517  octave_value (const octave_base_value *);
1518 
1519 };
1520 
1521 // Publish externally used friend functions. Which compiler requires
1522 // these extra declarations?
1523 
1524 extern OCTINTERP_API octave_value
1526  const octave_value& a);
1527 
1528 extern OCTINTERP_API octave_value
1530 
1531 extern OCTINTERP_API octave_value
1533  const octave_value& a, const octave_value& b);
1534 
1535 extern OCTINTERP_API octave_value
1537  const octave_value& a, const octave_value& b);
1538 
1539 extern OCTINTERP_API octave_value
1541  const octave_value& b);
1542 
1543 extern OCTINTERP_API octave_value
1545  const octave_value& b);
1546 
1547 extern OCTINTERP_API octave_value
1549  const octave_value& b, const Array<octave_idx_type>& ra_idx);
1550 
1551 extern OCTINTERP_API octave_value
1552 do_cat_op (const octave_value& a, const octave_value& b,
1554 
1555 #define OV_UNOP_FN(name) \
1556  inline octave_value \
1557  name (const octave_value& a) \
1558  { \
1559  return do_unary_op (octave_value::name, a); \
1560  }
1561 
1562 #define OV_UNOP_OP(name, op) \
1563  inline octave_value \
1564  operator op (const octave_value& a) \
1565  { \
1566  return name (a); \
1567  }
1568 
1569 #define OV_UNOP_FN_OP(name, op) \
1570  OV_UNOP_FN (name) \
1571  OV_UNOP_OP (name, op)
1572 
1576 
1579 
1580 // No simple way to define these for prefix and suffix ops?
1581 //
1582 // incr
1583 // decr
1584 
1585 #define OV_BINOP_FN(name) \
1586  inline octave_value \
1587  name (const octave_value& a1, const octave_value& a2) \
1588  { \
1589  return do_binary_op (octave_value::name, a1, a2); \
1590  }
1591 
1592 #define OV_BINOP_OP(name, op) \
1593  inline octave_value \
1594  operator op (const octave_value& a1, const octave_value& a2) \
1595  { \
1596  return name (a1, a2); \
1597  }
1598 
1599 #define OV_BINOP_FN_OP(name, op) \
1600  OV_BINOP_FN (name) \
1601  OV_BINOP_OP (name, op)
1602 
1607 
1610 
1617 
1624 
1626 
1627 #define OV_COMP_BINOP_FN(name) \
1628  inline octave_value \
1629  name (const octave_value& a1, const octave_value& a2) \
1630  { \
1631  return do_binary_op (octave_value::name, a1, a2); \
1632  }
1633 
1638 
1639 extern OCTINTERP_API void install_types (octave::type_info&);
1640 
1641 // Templated value extractors.
1642 template <typename Value>
1643 inline Value octave_value_extract (const octave_value&)
1644 { assert (false); }
1645 
1646 #define DEF_VALUE_EXTRACTOR(VALUE,MPREFIX) \
1647  template <> \
1648  inline VALUE octave_value_extract<VALUE> (const octave_value& v) \
1649  { \
1650  return v.MPREFIX ## _value (); \
1651  }
1652 
1654 DEF_VALUE_EXTRACTOR (float, float_scalar)
1658 
1667 
1673 
1683 
1689 
1693 DEF_VALUE_EXTRACTOR (FloatComplexColumnVector, float_complex_column_vector)
1694 
1698 DEF_VALUE_EXTRACTOR (FloatComplexRowVector, float_complex_row_vector)
1699 
1703 DEF_VALUE_EXTRACTOR (FloatComplexDiagMatrix, float_complex_diag_matrix)
1705 
1709 #undef DEF_VALUE_EXTRACTOR
1710 
1711 #define DEF_DUMMY_VALUE_EXTRACTOR(VALUE,DEFVAL) \
1712  template <> \
1713  inline VALUE octave_value_extract<VALUE> (const octave_value&) \
1714  { \
1715  assert (false); \
1716  return DEFVAL; \
1717  }
1718 
1721 #undef DEF_DUMMY_VALUE_EXTRACTOR
1722 
1723 #endif
bool is_dld_function(void) const
Definition: ov.h:773
FloatComplex float_complex_value(bool frc_str_conv=false) const
Definition: ov.h:849
octave_value ipermute(const Array< int > &vec) const
Definition: ov.h:508
bool is_bool_scalar(void) const
Definition: ov.h:562
octave_value as_uint16(void) const
Definition: ov.h:401
octave_value op_mul_trans(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1635
octave_value as_int32(void) const
Definition: ov.h:397
octave_value(void)
Definition: ov.h:174
octave_value map(octave_base_value::unary_mapper_t umap) const
Definition: ov.h:1473
Definition: Cell.h:37
octave_value op_uplus(const octave_value &a)
Definition: ov.h:1574
octave_base_value * internal_rep(void) const
Definition: ov.h:1356
int int_value(bool req_int=false, bool frc_str_conv=false) const
Definition: ov.h:793
bool is_user_code(void) const
Definition: ov.h:767
bool is_uint32_type(void) const
Definition: ov.h:681
Range range_value(void) const
Definition: ov.h:970
assign_op
Definition: ov.h:136
bool is_user_function(void) const
Definition: ov.h:764
#define OV_BINOP_FN_OP(name, op)
Definition: ov.h:1599
octave_value subsref(const std::string &type, const std::list< octave_value_list > &idx)
Definition: ov.h:418
bool is_instance_of(const std::string &cls_name) const
Definition: ov.h:993
octave_value op_el_pow(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1620
#define C(a, b)
Definition: Faddeeva.cc:246
const octave_base_value const Array< octave_idx_type > & ra_idx
characters Given a string matrix
Definition: hex2num.cc:155
octave_value as_int8(void) const
Definition: ov.h:395
std::string string_value(bool force=false) const
Definition: ov.h:955
bool isempty(void) const
Definition: ov.h:529
octave_int16 int16_scalar_value(void) const
Definition: ov.h:910
octave_value as_single(void) const
Definition: ov.h:393
octave_value diag(octave_idx_type m, octave_idx_type n) const
Definition: ov.h:1371
octave_value op_eq(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1613
bool save_hdf5(octave_hdf5_id loc_id, const char *name, bool save_as_floats)
Definition: ov.h:1345
nd group nd example oindent but is performed more efficiently If only and it is a scalar
Definition: data.cc:5264
octave_uint64 uint64_scalar_value(void) const
Definition: ov.h:928
unsigned long int ulong_value(bool req_int=false, bool frc_str_conv=false) const
Definition: ov.h:808
bool islogical(void) const
Definition: ov.h:696
void print_with_name(std::ostream &os, const std::string &name) const
Definition: ov.h:1274
sortmode
Definition: oct-sort.h:105
std::complex< double > erfi(std::complex< double > z, double relerr=0)
idx_vector index_vector(bool require_integers=false) const
Definition: ov.h:462
bool is_mex_function(void) const
Definition: ov.h:776
identity matrix If supplied two scalar respectively For allows like xample val
Definition: data.cc:4986
bool is_real_matrix(void) const
Definition: ov.h:553
octave_value as_int64(void) const
Definition: ov.h:398
int nint_value(bool frc_str_conv=false) const
Definition: ov.h:800
octave_base_value * empty_clone(void) const
Definition: ov.h:317
Return the CPU time used by your Octave session The first output is the total time spent executing your process and is equal to the sum of second and third which are the number of CPU seconds spent executing in user mode and the number of CPU seconds spent executing in system mode
Definition: data.cc:6348
idx subsref(val, idx) esult
Definition: ov.cc:3065
bool is_classdef_superclass_ref(void) const
Definition: ov.h:602
double asinh(double x)
Definition: lo-specfun.h:67
int64_t int64_value(bool req_int=false, bool frc_str_conv=false) const
Definition: ov.h:812
octave_value squeeze(void) const
Definition: ov.h:383
bool all_zero_dims(void) const
Definition: ov.h:480
octave_value op_el_ldiv(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1621
for large enough k
Definition: lu.cc:617
bool is_cs_list(void) const
Definition: ov.h:622
bool isna(double x)
Definition: lo-mappers.cc:45
octave_uint32 uint32_scalar_value(void) const
Definition: ov.h:925
Definition: Range.h:33
bool is_anonymous_function(void) const
Definition: ov.h:752
OCTAVE_EXPORT octave_value_list or N dimensional array whose elements are all equal to the base of natural logarithms The constant ex $e satisfies the equation log(e)
bool is_true(void) const
Definition: ov.h:739
octave_value all(int dim=0) const
Definition: ov.h:637
int32NDArray int32_array_value(void) const
Definition: ov.h:937
binary_op
Definition: ov.h:94
octave_value eval(void)
Definition: ov.h:783
bool isnan(bool)
Definition: lo-mappers.h:187
std::complex< T > ceil(const std::complex< T > &x)
Definition: lo-mappers.h:112
bool is_complex_scalar(void) const
Definition: ov.h:556
bool isinf(double x)
Definition: lo-mappers.h:225
std::complex< T > floor(const std::complex< T > &x)
Definition: lo-mappers.h:139
bool is_magic_colon(void) const
Definition: ov.h:625
uint64_t uint64_value(bool req_int=false, bool frc_str_conv=false) const
Definition: ov.h:816
DiagMatrix diag_matrix_value(bool force=false) const
Definition: ov.h:891
FloatDiagMatrix float_diag_matrix_value(bool force=false) const
Definition: ov.h:894
Array< octave_idx_type > sort_rows_idx(sortmode mode=ASCENDING) const
Sort by rows returns only indices.
Definition: Array.cc:2068
static T abs(T x)
Definition: pr-output.cc:1696
void make_unique(void)
Definition: ov.h:328
octave_value op_pow(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1608
octave_base_value * try_narrowing_conversion(void)
Definition: ov.h:405
Array< octave_idx_type > sort_rows_idx(sortmode mode=ASCENDING) const
Definition: ov.h:1387
octave::mach_info::float_format flt_fmt
Definition: load-save.cc:736
bool is_defined(void) const
Definition: ov.h:523
const octave_base_value & get_rep(void) const
Definition: ov.h:1327
octave_int8 int8_scalar_value(void) const
Definition: ov.h:907
Complex acos(const Complex &x)
Definition: lo-mappers.cc:83
MatrixType matrix_type(const MatrixType &typ) const
Definition: ov.h:517
Complex atan(const Complex &x)
Definition: lo-mappers.h:80
OCTAVE_EXPORT octave_value_list return the number of command line arguments passed to Octave If called with the optional argument the function t
Definition: ov-usr-fcn.cc:997
bool is_constant(void) const
Definition: ov.h:746
FloatMatrix float_matrix_value(bool frc_str_conv=false) const
Definition: ov.h:837
Complex complex_value(bool frc_str_conv=false) const
Definition: ov.h:846
int ndims(void) const
Definition: ov.h:478
bool is_perm_matrix(void) const
Definition: ov.h:574
nd example oindent opens the file binary numeric values will be read assuming they are stored in IEEE format with the least significant bit and then converted to the native representation Opening a file that is already open simply opens it again and returns a separate file id It is not an error to open a file several though writing to the same file through several different file ids may produce unexpected results The possible values of text mode reading and writing automatically converts linefeeds to the appropriate line end character for the you may append a you must also open the file in binary mode The parameter conversions are currently only supported for and permissions will be set to and then everything is written in a single operation This is very efficient and improves performance c
Definition: file-io.cc:587
double fix(double x)
Definition: lo-mappers.h:127
s
Definition: file-io.cc:2729
FloatNDArray float_array_value(bool frc_str_conv=false) const
Definition: ov.h:843
Complex asin(const Complex &x)
Definition: lo-mappers.cc:105
#define DEF_VALUE_EXTRACTOR(VALUE, MPREFIX)
Definition: ov.h:1646
builtin_type_t
Definition: ov-base.h:71
bool isobject(void) const
Definition: ov.h:608
Complex log2(const Complex &x)
Definition: lo-mappers.cc:137
bool is_int16_type(void) const
Definition: ov.h:666
std::complex< double > erf(std::complex< double > z, double relerr=0)
float float_value(bool frc_str_conv=false) const
Definition: ov.h:825
charMatrix char_matrix_value(bool frc_str_conv=false) const
Definition: ov.h:875
octave_value arg
Definition: pr-output.cc:3244
F77_RET_T const F77_REAL const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE * d
octave_base_value * rep
The real representation.
Definition: ov.h:1505
bool is_user_script(void) const
Definition: ov.h:761
OCTINTERP_API void install_types(octave::type_info &)
Definition: ov.cc:2894
octave_value resize(const dim_vector &dv, bool fill=false) const
Definition: ov.h:511
bool is_dq_string(void) const
Definition: ov.h:583
calling an anonymous function involves an overhead quite comparable to the overhead of an m file function Passing a handle to a built in function is because the interpreter is not involved in the internal loop For a
Definition: cellfun.cc:400
uint32NDArray uint32_array_value(void) const
Definition: ov.h:949
octave_value subsref(const std::string &type, const std::list< octave_value_list > &idx, bool auto_add)
Definition: ov.h:422
FloatComplexMatrix float_complex_matrix_value(bool frc_str_conv=false) const
Definition: ov.h:856
bool swap
Definition: load-save.cc:738
void lock(void)
Definition: ov.h:1393
charNDArray char_array_value(bool frc_str_conv=false) const
Definition: ov.h:878
bool iscellstr(void) const
Definition: ov.h:543
bool isjava(void) const
Definition: ov.h:615
sortmode is_sorted_rows(sortmode mode=UNSORTED) const
Definition: ov.h:1390
octave_value op_div(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1606
double lgamma(double x)
Definition: lo-specfun.h:377
then the function must return scalars which will be concatenated into the return array(s). If code
Definition: cellfun.cc:400
octave_value sort(octave_idx_type dim=0, sortmode mode=ASCENDING) const
Definition: ov.h:1374
bool bool_value(bool warn=false) const
Definition: ov.h:866
octave_value dump(void) const
Definition: ov.h:1399
Complex expm1(const Complex &x)
Definition: lo-specfun.cc:1875
octave_value sort(Array< octave_idx_type > &sidx, octave_idx_type dim=0, sortmode mode=ASCENDING) const
Definition: ov.h:1376
int16NDArray int16_array_value(void) const
Definition: ov.h:934
octave_value as_uint64(void) const
Definition: ov.h:403
octave_value op_el_or(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1623
ComplexColumnVector conj(const ComplexColumnVector &a)
Definition: CColVector.cc:215
virtual octave_base_value * try_narrowing_conversion(void)
Definition: ov-base.h:275
nd deftypefn *std::string name
Definition: sysdep.cc:647
#define OV_UNOP_FN(name)
Definition: ov.h:1555
double acosh(double x)
Definition: lo-specfun.h:49
size_t byte_size(void) const
Definition: ov.h:493
virtual octave_base_value * find_parent_class(const std::string &)
Definition: ov-base.h:614
double gamma(double x)
Definition: lo-specfun.cc:1913
OCTAVE_EXPORT octave_value_list return the number of command line arguments passed to Octave If called with the optional argument the function xample nargout(@histc)
Definition: ov-usr-fcn.cc:997
bool is_function_handle(void) const
Definition: ov.h:749
octave_value op_not(const octave_value &a)
Definition: ov.h:1573
void print_raw(std::ostream &os, bool pr_as_read_syntax=false) const
Definition: ov.h:1268
octave_idx_type numel(const octave_value_list &idx)
Definition: ov.h:412
octave_uint8 uint8_scalar_value(void) const
Definition: ov.h:919
void print(std::ostream &os, bool pr_as_read_syntax=false)
Definition: ov.h:1265
octave_base_value::type_conv_info numeric_demotion_function(void) const
Definition: ov.h:378
void * mex_get_data(void) const
Definition: ov.h:1360
#define DEF_DUMMY_VALUE_EXTRACTOR(VALUE, DEFVAL)
Definition: ov.h:1711
Complex log1p(const Complex &x)
Definition: lo-specfun.cc:1959
octave_idx_type columns(void) const
Definition: ov.h:474
ComplexDiagMatrix complex_diag_matrix_value(bool force=false) const
Definition: ov.h:897
bool is_uint64_type(void) const
Definition: ov.h:684
octave_value op_trans_mul(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1634
OCTINTERP_API octave_value do_binary_op(octave::type_info &ti, octave_value::binary_op op, const octave_value &a, const octave_value &b)
bool load_hdf5(octave_hdf5_id loc_id, const char *name)
Definition: ov.h:1349
octave_value any(int dim=0) const
Definition: ov.h:640
octave_value op_transpose(const octave_value &a)
Definition: ov.h:1577
bool is_single_type(void) const
Definition: ov.h:651
bool iscell(void) const
Definition: ov.h:536
Value octave_value_extract(const octave_value &)
Definition: ov.h:1643
double scalar_value(bool frc_str_conv=false) const
Definition: ov.h:828
double signum(double x)
Definition: lo-mappers.h:244
octave_value convert_to_str_internal(bool pad, bool force, char type) const
Definition: ov.h:1256
bool save_binary(std::ostream &os, bool &save_as_floats)
Definition: ov.h:1338
void maybe_economize(void)
Definition: ov.h:1233
double dawson(double x)
Definition: lo-specfun.cc:1518
dim_vector dims(void) const
Definition: ov.h:469
bool save_as_floats
Definition: load-save.cc:1617
octave_value op_el_and(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1622
octave_value permute(const Array< int > &vec, bool inv=false) const
Definition: ov.h:505
bool isinteger(void) const
Definition: ov.h:687
octave_idx_type rows(void) const
Definition: ov.h:472
is false
Definition: cellfun.cc:400
bool issparse(void) const
Definition: ov.h:730
size_type size(const size_type d) const
Size of the specified dimension.
Definition: Array.h:431
octave_base_value * find_parent_class(const std::string &parent_class_name)
Definition: ov.h:990
uint64NDArray uint64_array_value(void) const
Definition: ov.h:952
std::list< std::string > parent_class_name_list(void) const
Definition: ov.h:983
bool is_char_matrix(void) const
Definition: ov.h:568
bool is_complex_matrix(void) const
Definition: ov.h:559
bool islocked(void) const
Definition: ov.h:1397
octave_value op_mul_herm(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1637
std::complex< double > erfcx(std::complex< double > z, double relerr=0)
int64_t octave_hdf5_id
double atanh(double x)
Definition: lo-specfun.h:72
bool is_zero_by_zero(void) const
Definition: ov.h:483
idx type
Definition: ov.cc:3114
std::string class_name(void) const
Definition: ov.h:1291
int type_id(void) const
Definition: ov.h:1287
string_vector parent_class_names(void) const
Definition: ov.h:986
Definition: dMatrix.h:36
bool is_function(void) const
Definition: ov.h:758
bool is_package(void) const
Definition: ov.h:605
bool isstruct(void) const
Definition: ov.h:589
the exceeded dimensions are set to if fewer subscripts than dimensions are the exceeding dimensions are merged into the final requested dimension For consider the following dims
Definition: sub2ind.cc:255
bool is_int8_type(void) const
Definition: ov.h:663
octave_value op_le(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1612
bool is_bool_matrix(void) const
Definition: ov.h:565
octave_idx_type get_count(void) const
Definition: ov.h:373
octave_value op_lt(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1611
void erase_subfunctions(void)
Definition: ov.h:779
bool isfloat(void) const
Definition: ov.h:654
octave_value convert_to_str(bool pad=false, bool force=false, char type='\'') const
Definition: ov.h:1251
octave_value as_int16(void) const
Definition: ov.h:396
FloatComplexNDArray float_complex_array_value(bool frc_str_conv=false) const
Definition: ov.h:863
string_vector map_keys(void) const
Definition: ov.h:977
double cbrt(double x)
Definition: lo-specfun.h:298
#define OV_COMP_BINOP_FN(name)
Definition: ov.h:1627
double erfcinv(double x)
Definition: lo-specfun.cc:1745
bool is_int32_type(void) const
Definition: ov.h:669
octave_value op_el_div(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1619
SparseComplexMatrix sparse_complex_matrix_value(bool frc_str_conv=false) const
Definition: ov.h:885
virtual octave_base_value * unique_clone(void)
Definition: ov-base.h:248
OCTINTERP_API octave_value do_unary_op(octave::type_info &ti, octave_value::unary_op op, const octave_value &a)
Definition: ov.cc:2615
octave_uint16 uint16_scalar_value(void) const
Definition: ov.h:922
octave_value as_uint32(void) const
Definition: ov.h:402
void short_disp(std::ostream &os) const
Definition: ov.h:1277
bool save_ascii(std::ostream &os)
Definition: ov.h:1334
bool fast_elem_insert(octave_idx_type n, const octave_value &x)
Assign the n-th element, aka val(n) = x.
Definition: ov.h:1496
#define OV_BINOP_FN(name)
Definition: ov.h:1585
octave_base_value::type_conv_info numeric_conversion_function(void) const
Definition: ov.h:375
octave_value reshape(const dim_vector &dv) const
Definition: ov.h:502
octave_value diag(octave_idx_type k=0) const
Definition: ov.h:1368
return octave_value(v1.char_array_value() . concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string()) ? '\'' :'"'))
magic_colon
Definition: ov.h:172
bool isreal(void) const
Definition: ov.h:703
short int short_value(bool req_int=false, bool frc_str_conv=false) const
Definition: ov.h:786
MatrixType matrix_type(void) const
Definition: ov.h:514
FloatComplexDiagMatrix float_complex_diag_matrix_value(bool force=false) const
Definition: ov.h:901
builtin_type_t builtin_type(void) const
Definition: ov.h:643
~octave_value(void)
Definition: ov.h:322
boolNDArray bool_array_value(bool warn=false) const
Definition: ov.h:872
long int long_value(bool req_int=false, bool frc_str_conv=false) const
Definition: ov.h:804
OCTINTERP_API octave_value do_cat_op(octave::type_info &ti, const octave_value &a, const octave_value &b, const Array< octave_idx_type > &ra_idx)
bool is_undefined(void) const
Definition: ov.h:526
bool is_builtin_function(void) const
Definition: ov.h:770
bool is_sq_string(void) const
Definition: ov.h:580
octave_value op_ne(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1616
void unlock(void)
Definition: ov.h:1395
bool load_ascii(std::istream &is)
Definition: ov.h:1336
octave_idx_type * mex_get_ir(void) const
Definition: ov.h:1362
std::string edit_display(const float_display_format &fmt, octave_idx_type i, octave_idx_type j) const
Definition: ov.h:1281
octave_int32 int32_scalar_value(void) const
Definition: ov.h:913
bool print_as_scalar(void) const
Definition: ov.h:1262
bool isnull(void) const
Definition: ov.h:628
octave_idx_type nnz(void) const
Definition: ov.h:496
uint16NDArray uint16_array_value(void) const
Definition: ov.h:946
p
Definition: lu.cc:138
bool is_int64_type(void) const
Definition: ov.h:672
bool print_name_tag(std::ostream &os, const std::string &name) const
Definition: ov.h:1271
octave_value full_value(void) const
Definition: ov.h:387
bool is_copy_of(const octave_value &val) const
Definition: ov.h:1329
bool isfinite(double x)
Definition: lo-mappers.h:201
idx subsasgn(val, idx, 0) esult
Definition: ov.cc:3114
Matrix size(void)
Definition: ov.h:409
Cell cell_value(void) const
Definition: ovl.h:88
compound_binary_op
Definition: ov.h:119
double double_value(bool frc_str_conv=false) const
Definition: ov.h:822
double roundb(double x)
Definition: lo-mappers.h:156
int64NDArray int64_array_value(void) const
Definition: ov.h:940
float float_scalar_value(bool frc_str_conv=false) const
Definition: ov.h:831
int8NDArray int8_array_value(void) const
Definition: ov.h:931
SparseMatrix sparse_matrix_value(bool frc_str_conv=false) const
Definition: ov.h:881
octave_value op_struct_ref(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1625
b
Definition: cellfun.cc:400
octave_idx_type numel(void) const
Definition: ov.h:486
octave_value op_add(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1603
void make_unique(int obsolete_copies)
Definition: ov.h:344
octave_value op_ldiv(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1609
double erfinv(double x)
Definition: lo-specfun.cc:1864
double round(double x)
Definition: lo-mappers.h:145
boolMatrix bool_matrix_value(bool warn=false) const
Definition: ov.h:869
bool iscomplex(void) const
Definition: ov.h:710
octave_idx_type nfields(void) const
Definition: ov.h:500
ColumnVector imag(const ComplexColumnVector &a)
Definition: dColVector.cc:141
for i
Definition: data.cc:5264
octave_value op_sub(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1604
SparseBoolMatrix sparse_bool_matrix_value(bool warn=false) const
Definition: ov.h:888
bool is_diag_matrix(void) const
Definition: ov.h:571
PermMatrix perm_matrix_value(void) const
Definition: ov.h:904
string_vector string_vector_value(bool pad=false) const
Definition: ov.h:958
bool is_string(void) const
Definition: ov.h:577
std::complex< float > FloatComplex
Definition: oct-cmplx.h:32
bool is_double_type(void) const
Definition: ov.h:648
octave_value op_el_mul(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1618
bool is_classdef_meta(void) const
Definition: ov.h:596
size_t nparents(void) const
Definition: ov.h:980
octave_value op_herm_mul(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1636
mxArray * as_mxArray(void) const
Definition: ov.h:1366
ComplexMatrix complex_matrix_value(bool frc_str_conv=false) const
Definition: ov.h:852
std::complex< double > Complex
Definition: oct-cmplx.h:31
#define MAPPER_FORWARD(F)
Definition: ov.h:1401
#define OV_UNOP_FN_OP(name, op)
Definition: ov.h:1569
bool is_range(void) const
Definition: ov.h:586
octave_value op_hermitian(const octave_value &a)
Definition: ov.h:1578
octave_value as_uint8(void) const
Definition: ov.h:400
ColumnVector real(const ComplexColumnVector &a)
Definition: dColVector.cc:135
write the output to stdout if nargout is
Definition: load-save.cc:1612
ComplexNDArray complex_array_value(bool frc_str_conv=false) const
Definition: ov.h:859
octave_value op_ge(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1614
sortmode issorted(sortmode mode=UNSORTED) const
Definition: ov.h:1380
octave_idx_type * mex_get_jc(void) const
Definition: ov.h:1364
Vector representing the dimensions (size) of an Array.
Definition: dim-vector.h:87
bool is_uint8_type(void) const
Definition: ov.h:675
octave_value as_double(void) const
Definition: ov.h:392
Array< std::string > cellstr_value(void) const
Definition: ov.h:967
bool load_binary(std::istream &is, bool swap, octave::mach_info::float_format fmt)
Definition: ov.h:1341
unary_op
Definition: ov.h:81
octave_value op_uminus(const octave_value &a)
Definition: ov.h:1575
std::string type_name(void) const
Definition: ov.h:1289
If this string is the system will ring the terminal sometimes it is useful to be able to print the original representation of the string
Definition: utils.cc:888
bool is_real_scalar(void) const
Definition: ov.h:550
unsigned short int ushort_value(bool req_int=false, bool frc_str_conv=false) const
Definition: ov.h:790
dim_vector dv
Definition: sub2ind.cc:263
OCTINTERP_API octave_value do_colon_op(const octave_value &base, const octave_value &limit, bool is_for_cmd_expr=false)
Definition: ov.h:1315
octave_value op_mul(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1605
unsigned int uint_value(bool req_int=false, bool frc_str_conv=false) const
Definition: ov.h:797
bool is_scalar_type(void) const
Definition: ov.h:717
void convert_to_row_or_column_vector(void)
Definition: ov.h:1259
bool is_classdef_object(void) const
Definition: ov.h:599
octave::stream os
Definition: file-io.cc:627
NDArray array_value(bool frc_str_conv=false) const
Definition: ov.h:840
bool isnumeric(void) const
Definition: ov.h:723
octave_idx_type nzmax(void) const
Definition: ov.h:498
bool is_matrix_type(void) const
Definition: ov.h:720
Matrix matrix_value(bool frc_str_conv=false) const
Definition: ov.h:834
octave_value op_gt(const octave_value &a1, const octave_value &a2)
Definition: ov.h:1615
octave_int64 int64_scalar_value(void) const
Definition: ov.h:916
uint8NDArray uint8_array_value(void) const
Definition: ov.h:943
F77_RET_T const F77_REAL const F77_REAL F77_REAL &F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T const F77_DBLE * x
bool is_inline_function(void) const
Definition: ov.h:755
static int xisascii(int c)
Definition: ov-ch-mat.cc:241
virtual octave_base_value * empty_clone(void) const
Definition: ov-base.cc:104
octave_value_list & operator=(const octave_value_list &obj)
Definition: ovl.h:75
static float_display_format get_edit_display_format(const octave_value &val)
bool is_uint16_type(void) const
Definition: ov.h:678
std::complex< double > erfc(std::complex< double > z, double relerr=0)
octave_value fast_elem_extract(octave_idx_type n) const
Extract the n-th element, aka val(n).
Definition: ov.h:1484
octave_value do_index_op(const octave_value_list &idx, bool resize_ok=false)
Definition: ov.h:444