GNU Octave  4.2.1
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-typeinfo.cc
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 1996-2017 John W. Eaton
4 
5 This file is part of Octave.
6 
7 Octave is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the
9 Free Software Foundation; either version 3 of the License, or (at your
10 option) any later version.
11 
12 Octave is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with Octave; see the file COPYING. If not, see
19 <http://www.gnu.org/licenses/>.
20 
21 */
22 
23 #if defined (HAVE_CONFIG_H)
24 # include "config.h"
25 #endif
26 
27 #include "Array.h"
28 #include "singleton-cleanup.h"
29 
30 #include "defun.h"
31 #include "error.h"
32 #include "ov-typeinfo.h"
33 
34 const int
36 
39 
40 bool
42 {
43  bool retval = true;
44 
45  if (! instance)
46  {
48 
49  if (instance)
51  }
52 
53  if (! instance)
54  error ("unable to create value type info object!");
55 
56  return retval;
57 }
58 
59 int
61  const std::string& c_name,
62  const octave_value& val)
63 {
64  return (instance_ok ())
65  ? instance->do_register_type (t_name, c_name, val) : -1;
66 }
67 
68 bool
71 {
72  return (instance_ok ())
73  ? instance->do_register_unary_class_op (op, f) : false;
74 }
75 
76 bool
78  int t,
80 {
81  return (instance_ok ())
82  ? instance->do_register_unary_op (op, t, f) : false;
83 }
84 
85 bool
87  int t,
89 {
90  return (instance_ok ())
91  ? instance->do_register_non_const_unary_op (op, t, f) : false;
92 }
93 
94 bool
97 {
98  return (instance_ok ())
99  ? instance->do_register_binary_class_op (op, f) : false;
100 }
101 
102 bool
104  int t1, int t2,
106 {
107  return (instance_ok ())
108  ? instance->do_register_binary_op (op, t1, t2, f) : false;
109 }
110 
111 bool
114 {
115  return (instance_ok ())
116  ? instance->do_register_binary_class_op (op, f) : false;
117 }
118 
119 bool
121  int t1, int t2,
123 {
124  return (instance_ok ())
125  ? instance->do_register_binary_op (op, t1, t2, f) : false;
126 }
127 
128 bool
131 {
132  return (instance_ok ())
133  ? instance->do_register_cat_op (t1, t2, f) : false;
134 }
135 
136 bool
138  int t_lhs, int t_rhs,
140 {
141  return (instance_ok ())
142  ? instance->do_register_assign_op (op, t_lhs, t_rhs, f) : -1;
143 }
144 
145 bool
148 {
149  return (instance_ok ())
150  ? instance->do_register_assignany_op (op, t_lhs, f) : -1;
151 }
152 
153 bool
155  int t_result)
156 {
157  return (instance_ok ())
158  ? instance->do_register_pref_assign_conv (t_lhs, t_rhs, t_result)
159  : false;
160 }
161 
162 bool
165 {
166  return (instance_ok ())
167  ? instance->do_register_widening_op (t, t_result, f) : false;
168 }
169 
170 // FIXME: we should also store all class names and provide a
171 // way to list them (calling class with nargin == 0?).
172 
173 int
175  const std::string& /* c_name */,
176  const octave_value& val)
177 {
178  int i = 0;
179 
180  for (i = 0; i < num_types; i++)
181  if (t_name == types (i))
182  return i;
183 
184  int len = types.numel ();
185 
186  if (i == len)
187  {
188  len *= 2;
189 
190  types.resize (dim_vector (len, 1), "");
191 
192  vals.resize (dim_vector (len, 1), octave_value ());
193 
195 
198 
200  (dim_vector (octave_value::num_binary_ops, len, len), 0);
201 
204 
205  cat_ops.resize (dim_vector (len, len), 0);
206 
208  (dim_vector (octave_value::num_assign_ops, len, len), 0);
209 
212 
213  pref_assign_conv.resize (dim_vector (len, len), -1);
214 
215  widening_ops.resize (dim_vector (len, len), 0);
216  }
217 
218  types (i) = t_name;
219 
220  vals (i) = val;
221 
222  num_types++;
223 
224  return i;
225 }
226 
227 bool
230 {
231  if (lookup_unary_class_op (op))
232  {
234 
235  warning ("duplicate unary operator '%s' for class dispatch",
236  op_name.c_str ());
237  }
238 
239  unary_class_ops.checkelem (static_cast<int> (op))
240  = reinterpret_cast<void *> (f);
241 
242  return false;
243 }
244 
245 bool
247  int t,
249 {
250  if (lookup_unary_op (op, t))
251  {
253  std::string type_name = types(t);
254 
255  warning ("duplicate unary operator '%s' for type '%s'",
256  op_name.c_str (), type_name.c_str ());
257  }
258 
259  unary_ops.checkelem (static_cast<int> (op), t) = reinterpret_cast<void *> (f);
260 
261  return false;
262 }
263 
264 bool
268 {
269  if (lookup_non_const_unary_op (op, t))
270  {
272  std::string type_name = types(t);
273 
274  warning ("duplicate unary operator '%s' for type '%s'",
275  op_name.c_str (), type_name.c_str ());
276  }
277 
278  non_const_unary_ops.checkelem (static_cast<int> (op), t)
279  = reinterpret_cast<void *> (f);
280 
281  return false;
282 }
283 
284 bool
287 {
288  if (lookup_binary_class_op (op))
289  {
291 
292  warning ("duplicate binary operator '%s' for class dispatch",
293  op_name.c_str ());
294  }
295 
296  binary_class_ops.checkelem (static_cast<int> (op))
297  = reinterpret_cast<void *> (f);
298 
299  return false;
300 }
301 
302 bool
304  int t1, int t2,
306 {
307  if (lookup_binary_op (op, t1, t2))
308  {
310  std::string t1_name = types(t1);
311  std::string t2_name = types(t2);
312 
313  warning ("duplicate binary operator '%s' for types '%s' and '%s'",
314  op_name.c_str (), t1_name.c_str (), t1_name.c_str ());
315  }
316 
317  binary_ops.checkelem (static_cast<int> (op), t1, t2)
318  = reinterpret_cast<void *> (f);
319 
320  return false;
321 }
322 
323 bool
326 {
327  if (lookup_binary_class_op (op))
328  {
330 
331  warning ("duplicate compound binary operator '%s' for class dispatch",
332  op_name.c_str ());
333  }
334 
335  compound_binary_class_ops.checkelem (static_cast<int> (op))
336  = reinterpret_cast<void *> (f);
337 
338  return false;
339 }
340 
341 bool
343  int t1, int t2,
345 {
346  if (lookup_binary_op (op, t1, t2))
347  {
349  std::string t1_name = types(t1);
350  std::string t2_name = types(t2);
351 
352  warning ("duplicate compound binary operator '%s' for types '%s' and '%s'",
353  op_name.c_str (), t1_name.c_str (), t1_name.c_str ());
354  }
355 
356  compound_binary_ops.checkelem (static_cast<int> (op), t1, t2)
357  = reinterpret_cast<void *> (f);
358 
359  return false;
360 }
361 
362 bool
365 {
366  if (lookup_cat_op (t1, t2))
367  {
368  std::string t1_name = types(t1);
369  std::string t2_name = types(t2);
370 
371  warning ("duplicate concatenation operator for types '%s' and '%s'",
372  t1_name.c_str (), t1_name.c_str ());
373  }
374 
375  cat_ops.checkelem (t1, t2) = reinterpret_cast<void *> (f);
376 
377  return false;
378 }
379 
380 bool
382  int t_lhs, int t_rhs,
384 {
385  if (lookup_assign_op (op, t_lhs, t_rhs))
386  {
388  std::string t_lhs_name = types(t_lhs);
389  std::string t_rhs_name = types(t_rhs);
390 
391  warning ("duplicate assignment operator '%s' for types '%s' and '%s'",
392  op_name.c_str (), t_lhs_name.c_str (), t_rhs_name.c_str ());
393  }
394 
395  assign_ops.checkelem (static_cast<int> (op), t_lhs, t_rhs)
396  = reinterpret_cast<void *> (f);
397 
398  return false;
399 }
400 
401 bool
404 {
405  if (lookup_assignany_op (op, t_lhs))
406  {
408  std::string t_lhs_name = types(t_lhs);
409 
410  warning ("duplicate assignment operator '%s' for types '%s'",
411  op_name.c_str (), t_lhs_name.c_str ());
412  }
413 
414  assignany_ops.checkelem (static_cast<int> (op), t_lhs)
415  = reinterpret_cast<void *> (f);
416 
417  return false;
418 }
419 
420 bool
422  int t_result)
423 {
424  if (lookup_pref_assign_conv (t_lhs, t_rhs) >= 0)
425  {
426  std::string t_lhs_name = types(t_lhs);
427  std::string t_rhs_name = types(t_rhs);
428 
429  warning ("overriding assignment conversion for types '%s' and '%s'",
430  t_lhs_name.c_str (), t_rhs_name.c_str ());
431  }
432 
433  pref_assign_conv.checkelem (t_lhs, t_rhs) = t_result;
434 
435  return false;
436 }
437 
438 bool
440  (int t, int t_result, octave_base_value::type_conv_fcn f)
441 {
442  if (lookup_widening_op (t, t_result))
443  {
444  std::string t_name = types(t);
445  std::string t_result_name = types(t_result);
446 
447  warning ("overriding widening op for '%s' to '%s'",
448  t_name.c_str (), t_result_name.c_str ());
449  }
450 
451  widening_ops.checkelem (t, t_result) = reinterpret_cast<void *> (f);
452 
453  return false;
454 }
455 
458 {
460 
461  for (int i = 0; i < num_types; i++)
462  {
463  if (nm == types(i))
464  {
465  retval = vals(i);
466  retval.make_unique ();
467  break;
468  }
469  }
470 
471  return retval;
472 }
473 
476 {
477  void *f = unary_class_ops.checkelem (static_cast<int> (op));
478  return reinterpret_cast<octave_value_typeinfo::unary_class_op_fcn> (f);
479 }
480 
483 {
484  void *f = unary_ops.checkelem (static_cast<int> (op), t);
485  return reinterpret_cast<octave_value_typeinfo::unary_op_fcn> (f);
486 }
487 
491 {
492  void *f = non_const_unary_ops.checkelem (static_cast<int> (op), t);
493  return reinterpret_cast<octave_value_typeinfo::non_const_unary_op_fcn> (f);
494 }
495 
498 {
499  void *f = binary_class_ops.checkelem (static_cast<int> (op));
500  return reinterpret_cast<octave_value_typeinfo::binary_class_op_fcn> (f);
501 }
502 
505  int t1, int t2)
506 {
507  void *f = binary_ops.checkelem (static_cast<int> (op), t1, t2);
508  return reinterpret_cast<octave_value_typeinfo::binary_op_fcn> (f);
509 }
510 
513 {
514  void *f = compound_binary_class_ops.checkelem (static_cast<int> (op));
515  return reinterpret_cast<octave_value_typeinfo::binary_class_op_fcn> (f);
516 }
517 
520  int t1, int t2)
521 {
522  void *f = compound_binary_ops.checkelem (static_cast<int> (op), t1, t2);
523  return reinterpret_cast<octave_value_typeinfo::binary_op_fcn> (f);
524 }
525 
528 {
529  void *f = cat_ops.checkelem (t1, t2);
530  return reinterpret_cast<octave_value_typeinfo::cat_op_fcn> (f);
531 }
532 
535  int t_lhs, int t_rhs)
536 {
537  void *f = assign_ops.checkelem (static_cast<int> (op), t_lhs, t_rhs);
538  return reinterpret_cast<octave_value_typeinfo::assign_op_fcn> (f);
539 }
540 
543  int t_lhs)
544 {
545  void *f = assignany_ops.checkelem (static_cast<int> (op), t_lhs);
546  return reinterpret_cast<octave_value_typeinfo::assignany_op_fcn> (f);
547 }
548 
549 int
551 {
552  return pref_assign_conv.checkelem (t_lhs, t_rhs);
553 }
554 
557 {
558  void *f = widening_ops.checkelem (t, t_result);
559  return reinterpret_cast<octave_base_value::type_conv_fcn> (f);
560 }
561 
564 {
566 
567  for (int i = 0; i < num_types; i++)
568  retval(i) = types(i);
569 
570  return retval;
571 }
572 
573 DEFUN (typeinfo, args, ,
574  doc: /* -*- texinfo -*-
575 @deftypefn {} {} typeinfo ()
576 @deftypefnx {} {} typeinfo (@var{expr})
577 
578 Return the type of the expression @var{expr}, as a string.
579 
580 If @var{expr} is omitted, return a cell array of strings containing all the
581 currently installed data types.
582 @seealso{class, isa}
583 @end deftypefn */)
584 {
585  int nargin = args.length ();
586 
587  if (nargin > 1)
588  print_usage ();
589 
590  if (nargin == 0)
592  else
593  return ovl (args(0).type_name ());
594 }
595 
596 /*
597 %!assert (iscellstr (typeinfo ()))
598 
599 %!assert (typeinfo ({"cell"}), "cell")
600 
601 %!assert (typeinfo (1), "scalar")
602 %!assert (typeinfo (double (1)), "scalar")
603 %!assert (typeinfo (i), "complex scalar")
604 
605 %!assert (typeinfo ([1, 2]), "matrix")
606 %!assert (typeinfo (double ([1, 2])), "matrix")
607 %!assert (typeinfo (diag ([1, 2])), "diagonal matrix")
608 %!assert (typeinfo ([i, 2]), "complex matrix")
609 %!assert (typeinfo (diag ([i, 2])), "complex diagonal matrix")
610 
611 %!assert (typeinfo (1:2), "range")
612 
613 %!assert (typeinfo (false), "bool")
614 %!assert (typeinfo ([true, false]), "bool matrix")
615 
616 %!assert (typeinfo ("string"), "string")
617 %!assert (typeinfo ('string'), "sq_string")
618 
619 %!assert (typeinfo (int8 (1)), "int8 scalar")
620 %!assert (typeinfo (int16 (1)), "int16 scalar")
621 %!assert (typeinfo (int32 (1)), "int32 scalar")
622 %!assert (typeinfo (int64 (1)), "int64 scalar")
623 %!assert (typeinfo (uint8 (1)), "uint8 scalar")
624 %!assert (typeinfo (uint16 (1)), "uint16 scalar")
625 %!assert (typeinfo (uint32 (1)), "uint32 scalar")
626 %!assert (typeinfo (uint64 (1)), "uint64 scalar")
627 
628 %!assert (typeinfo (int8 ([1,2])), "int8 matrix")
629 %!assert (typeinfo (int16 ([1,2])), "int16 matrix")
630 %!assert (typeinfo (int32 ([1,2])), "int32 matrix")
631 %!assert (typeinfo (int64 ([1,2])), "int64 matrix")
632 %!assert (typeinfo (uint8 ([1,2])), "uint8 matrix")
633 %!assert (typeinfo (uint16 ([1,2])), "uint16 matrix")
634 %!assert (typeinfo (uint32 ([1,2])), "uint32 matrix")
635 %!assert (typeinfo (uint64 ([1,2])), "uint64 matrix")
636 
637 %!assert (typeinfo (sparse ([true, false])), "sparse bool matrix")
638 %!assert (typeinfo (logical (sparse (i * eye (10)))), "sparse bool matrix")
639 %!assert (typeinfo (sparse ([1,2])), "sparse matrix")
640 %!assert (typeinfo (sparse (eye (10))), "sparse matrix")
641 %!assert (typeinfo (sparse ([i,2])), "sparse complex matrix")
642 %!assert (typeinfo (sparse (i * eye (10))), "sparse complex matrix")
643 
644 %!test
645 %! s(2).a = 1;
646 %! assert (typeinfo (s), "struct");
647 
648 %!test
649 %! s.a = 1;
650 %! assert (typeinfo (s), "scalar struct");
651 
652 ## FIXME: This doesn't work as a test for comma-separated list
653 %!#test
654 %! clist = {1, 2, 3};
655 %! assert (typeinfo (clist{:}), "cs-list");
656 
657 %!assert (typeinfo (@sin), "function handle")
658 %!assert (typeinfo (@(x) x), "function handle")
659 
660 %!assert (typeinfo (inline ("x^2")), "inline function")
661 
662 %!assert (typeinfo (single (1)), "float scalar")
663 %!assert (typeinfo (single (i)), "float complex scalar")
664 %!assert (typeinfo (single ([1, 2])), "float matrix")
665 
666 %!assert (typeinfo (single (diag ([1, 2]))), "float diagonal matrix")
667 %!assert (typeinfo (diag (single ([1, 2]))), "float diagonal matrix")
668 %!assert (typeinfo (single (diag ([i, 2]))), "float complex diagonal matrix")
669 %!assert (typeinfo (diag (single ([i, 2]))), "float complex diagonal matrix")
670 
671 %!assert (typeinfo (eye(3)(:,[1 3 2])), "permutation matrix")
672 %!test
673 %! [l, u, p] = lu (rand (3));
674 %! assert (typeinfo (p), "permutation matrix");
675 
676 %!assert (typeinfo ([]), "null_matrix")
677 %!assert (typeinfo (""), "null_string")
678 %!assert (typeinfo (''), "null_sq_string")
679 
680 %!test
681 %! cvar = onCleanup (@() "");
682 %! assert (typeinfo (cvar), "onCleanup");
683 
684 %!testif HAVE_JAVA
685 %! if (! usejava ("jvm"))
686 %! return;
687 %! endif
688 %! x = javaObject ("java.lang.StringBuffer");
689 %! assert (typeinfo (x), "octave_java");
690 
691 ## Test input validation
692 %!error typeinfo ("foo", 1)
693 */
694 
695 static boolNDArray
696 as_bool_nd_array (const Array<void *>& x)
697 {
698  boolNDArray retval (x.dims ());
699 
700  for (octave_idx_type i = 0; i < x.numel (); i++)
701  retval.xelem (i) = x(i);
702 
703  return retval;
704 }
705 
708 {
710 
711  int len = std::min (static_cast<int> (non_const_unary_ops.columns ()),
712  num_types);
713 
714  dim_vector tab_dims (1, len);
715 
716  for (int j = 0; j < octave_value::num_unary_ops; j++)
717  {
718  boolNDArray tab (tab_dims);
719 
720  for (int i = 0; i < len; i++)
721  tab.xelem (i) = (unary_ops(j,i) != 0);
722 
723  octave_value::unary_op op_id = static_cast<octave_value::unary_op> (j);
724 
725  retval.setfield (octave_value::unary_op_as_string (op_id), tab);
726  }
727 
728  return retval;
729 }
730 
733 {
735 
736  int len = std::min (static_cast<int> (non_const_unary_ops.columns ()),
737  num_types);
738 
739  dim_vector tab_dims (1, len);
740 
741  for (int j = 0; j < octave_value::num_unary_ops; j++)
742  {
743  boolNDArray tab (tab_dims);
744 
745  for (int i = 0; i < len; i++)
746  tab.xelem (i) = (non_const_unary_ops(j,i) != 0);
747 
748  octave_value::unary_op op_id = static_cast<octave_value::unary_op> (j);
749 
750  retval.setfield (octave_value::unary_op_as_string (op_id), tab);
751  }
752 
753  return retval;
754 }
755 
758 {
760 
761  int len = std::min (static_cast<int> (binary_ops.columns ()), num_types);
762 
763  dim_vector tab_dims (len, len);
764 
765  for (int k = 0; k < octave_value::num_binary_ops; k++)
766  {
767  boolNDArray tab (tab_dims);
768 
769  for (int j = 0; j < len; j++)
770  for (int i = 0; i < len; i++)
771  tab.xelem (j,i) = (binary_ops(k,j,i) != 0);
772 
773  octave_value::binary_op op_id = static_cast<octave_value::binary_op> (k);
774 
775  retval.setfield (octave_value::binary_op_as_string (op_id), tab);
776  }
777 
778  return retval;
779 }
780 
783 {
785 
786  int len = std::min (static_cast<int> (compound_binary_ops.columns ()),
787  num_types);
788 
789  dim_vector tab_dims (len, len);
790 
791  for (int k = 0; k < octave_value::num_compound_binary_ops; k++)
792  {
793  boolNDArray tab (tab_dims);
794 
795  for (int j = 0; j < len; j++)
796  for (int i = 0; i < len; i++)
797  tab.xelem (j,i) = (compound_binary_ops(k,j,i) != 0);
798 
800  = static_cast<octave_value::compound_binary_op> (k);
801 
802  retval.setfield (octave_value::binary_op_fcn_name (op_id), tab);
803  }
804 
805  return retval;
806 }
807 
810 {
812 
813  int len = std::min (static_cast<int> (assign_ops.columns ()), num_types);
814 
815  dim_vector tab_dims (len, len);
816 
817  for (int k = 0; k < octave_value::num_assign_ops; k++)
818  {
819  boolNDArray tab (tab_dims);
820 
821  for (int j = 0; j < len; j++)
822  for (int i = 0; i < len; i++)
823  tab.xelem (j,i) = (assign_ops(k,j,i) != 0);
824 
825  octave_value::assign_op op_id = static_cast<octave_value::assign_op> (k);
826 
827  retval.setfield (octave_value::assign_op_as_string (op_id), tab);
828  }
829 
830  return retval;
831 }
832 
835 {
837 
838  int len = std::min (static_cast<int> (assignany_ops.columns ()), num_types);
839 
840  dim_vector tab_dims (1, len);
841 
842  for (int j = 0; j < octave_value::num_assign_ops; j++)
843  {
844  boolNDArray tab (tab_dims);
845 
846  for (int i = 0; i < len; i++)
847  tab.xelem (i) = (assignany_ops(j,i) != 0);
848 
849  octave_value::assign_op op_id = static_cast<octave_value::assign_op> (j);
850 
851  retval.setfield (octave_value::assign_op_as_string (op_id), tab);
852  }
853 
854  return retval;
855 }
856 
857 static NDArray
858 as_nd_array (const Array<int>& x)
859 {
860  NDArray retval (x.dims ());
861 
862  for (int i = 0; i < x.numel (); i++)
863  retval.xelem(i) = x(i);
864 
865  return retval;
866 }
867 
870 {
872 
873  retval.setfield ("types", octave_value (Cell (do_installed_type_names ())));
874  retval.setfield ("unary_ops", unary_ops_map ());
875  retval.setfield ("non_const_unary_ops", non_const_unary_ops_map ());
876  retval.setfield ("binary_ops", binary_ops_map ());
877  retval.setfield ("compound_unary_ops", compound_binary_ops_map ());
878  retval.setfield ("cat_ops", as_bool_nd_array (cat_ops));
879  retval.setfield ("assign_ops", assign_ops_map ());
880  retval.setfield ("assignany_ops", assignany_ops_map ());
881  retval.setfield ("pref_assign_conv", as_nd_array (pref_assign_conv));
882  retval.setfield ("widening_ops", as_bool_nd_array (widening_ops));
883 
884  return retval;
885 }
886 
887 DEFUN (__dump_typeinfo__, args, ,
888  doc: /* -*- texinfo -*-
889 @deftypefn {} {} __dump_typeinfo__ ()
890 Undocumented internal function.
891 @end deftypefn */)
892 {
893  if (args.length () > 0)
894  print_usage ();
895 
897 }
static bool register_pref_assign_conv(int, int, int)
Definition: ov-typeinfo.cc:154
static bool register_assign_op(octave_value::assign_op, int, int, assign_op_fcn)
Definition: ov-typeinfo.cc:137
static const int init_tab_sz
Definition: ov-typeinfo.h:213
Array< void * > binary_ops
Definition: ov-typeinfo.h:233
void(* non_const_unary_op_fcn)(octave_base_value &)
Definition: ov-typeinfo.h:47
bool do_register_non_const_unary_op(octave_value::unary_op, int, non_const_unary_op_fcn)
Definition: ov-typeinfo.cc:266
octave_scalar_map unary_ops_map(void) const
Definition: Cell.h:37
assign_op
Definition: ov.h:131
octave_value(* binary_op_fcn)(const octave_base_value &, const octave_base_value &)
Definition: ov-typeinfo.h:53
octave_scalar_map non_const_unary_ops_map(void) const
OCTAVE_EXPORT octave_value_list isa nd deftypefn *return ovl(args(0).is_integer_type())
OCTINTERP_API void print_usage(void)
Definition: defun.cc:52
static std::string binary_op_as_string(binary_op)
Definition: ov.cc:175
static octave_scalar_map installed_type_info(void)
Definition: ov-typeinfo.h:186
static void cleanup_instance(void)
Definition: ov-typeinfo.h:217
octave_idx_type numel(void) const
Number of elements in the array.
Definition: Array.h:363
identity matrix If supplied two scalar respectively For allows like xample val
Definition: data.cc:5068
F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &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 F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T F77_REAL F77_REAL &F77_RET_T F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE const F77_DBLE * f
static string_vector installed_type_names(void)
Definition: ov-typeinfo.h:181
cat_op_fcn do_lookup_cat_op(int, int)
Definition: ov-typeinfo.cc:527
Array< int > pref_assign_conv
Definition: ov-typeinfo.h:245
for large enough k
Definition: lu.cc:606
octave_scalar_map assignany_ops_map(void) const
Array< octave_value > vals
Definition: ov-typeinfo.h:223
binary_op
Definition: ov.h:89
Array< void * > binary_class_ops
Definition: ov-typeinfo.h:231
unary_op_fcn do_lookup_unary_op(octave_value::unary_op, int)
Definition: ov-typeinfo.cc:482
#define DEFUN(name, args_name, nargout_name, doc)
Definition: defun.h:46
void error(const char *fmt,...)
Definition: error.cc:570
unary_class_op_fcn do_lookup_unary_class_op(octave_value::unary_op)
Definition: ov-typeinfo.cc:475
static bool register_unary_class_op(octave_value::unary_op, unary_class_op_fcn)
Definition: ov-typeinfo.cc:69
void make_unique(void)
Definition: ov.h:327
void setfield(const std::string &key, const octave_value &val)
Definition: oct-map.cc:178
octave_value(* binary_class_op_fcn)(const octave_value &, const octave_value &)
Definition: ov-typeinfo.h:50
static std::string assign_op_as_string(assign_op)
Definition: ov.cc:346
octave_scalar_map binary_ops_map(void) const
static binary_op_fcn lookup_binary_op(octave_value::binary_op op, int t1, int t2)
Definition: ov-typeinfo.h:134
static int lookup_pref_assign_conv(int t_lhs, int t_rhs)
Definition: ov-typeinfo.h:170
octave_base_value::type_conv_fcn do_lookup_widening_op(int, int)
Definition: ov-typeinfo.cc:556
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:935
octave_scalar_map assign_ops_map(void) const
bool do_register_binary_op(octave_value::binary_op, int, int, binary_op_fcn)
Definition: ov-typeinfo.cc:303
bool do_register_unary_op(octave_value::unary_op, int, unary_op_fcn)
Definition: ov-typeinfo.cc:246
static octave_value_typeinfo * instance
Definition: ov-typeinfo.h:215
assignany_op_fcn do_lookup_assignany_op(octave_value::assign_op, int)
Definition: ov-typeinfo.cc:542
static unary_class_op_fcn lookup_unary_class_op(octave_value::unary_op op)
Definition: ov-typeinfo.h:110
JNIEnv void * args
Definition: ov-java.cc:67
binary_class_op_fcn do_lookup_binary_class_op(octave_value::binary_op)
Definition: ov-typeinfo.cc:497
const dim_vector & dims(void) const
Return a const-reference so that dims ()(i) works efficiently.
Definition: Array.h:439
octave_scalar_map do_installed_type_info(void) const
octave_value(* cat_op_fcn)(octave_base_value &, const octave_base_value &, const Array< octave_idx_type > &ra_idx)
Definition: ov-typeinfo.h:56
non_const_unary_op_fcn do_lookup_non_const_unary_op(octave_value::unary_op, int)
Definition: ov-typeinfo.cc:490
OCTAVE_EXPORT octave_value_list isdir nd deftypefn *std::string nm
Definition: utils.cc:941
octave_value(* unary_op_fcn)(const octave_base_value &)
Definition: ov-typeinfo.h:45
static assignany_op_fcn lookup_assignany_op(octave_value::assign_op op, int t_lhs)
Definition: ov-typeinfo.h:164
static void add(fptr f)
int do_lookup_pref_assign_conv(int, int)
Definition: ov-typeinfo.cc:550
int nargin
Definition: graphics.cc:10115
Array< void * > non_const_unary_ops
Definition: ov-typeinfo.h:229
static std::string binary_op_fcn_name(binary_op)
Definition: ov.cc:242
assign_op_fcn do_lookup_assign_op(octave_value::assign_op, int, int)
Definition: ov-typeinfo.cc:534
Array< void * > assignany_ops
Definition: ov-typeinfo.h:243
void resize(const dim_vector &dv, const T &rfv)
Definition: Array.cc:1028
Array< void * > unary_class_ops
Definition: ov-typeinfo.h:225
static bool register_non_const_unary_op(octave_value::unary_op, int, non_const_unary_op_fcn)
Definition: ov-typeinfo.cc:86
octave_value retval
Definition: data.cc:6294
bool do_register_assignany_op(octave_value::assign_op, int, assignany_op_fcn)
Definition: ov-typeinfo.cc:402
static bool register_binary_op(octave_value::binary_op, int, int, binary_op_fcn)
Definition: ov-typeinfo.cc:103
static binary_class_op_fcn lookup_binary_class_op(octave_value::binary_op op)
Definition: ov-typeinfo.h:128
bool do_register_assign_op(octave_value::assign_op, int, int, assign_op_fcn)
Definition: ov-typeinfo.cc:381
octave_scalar_map compound_binary_ops_map(void) const
Array< void * > cat_ops
Definition: ov-typeinfo.h:239
bool do_register_unary_class_op(octave_value::unary_op, unary_class_op_fcn)
Definition: ov-typeinfo.cc:228
bool do_register_pref_assign_conv(int, int, int)
Definition: ov-typeinfo.cc:421
void warning(const char *fmt,...)
Definition: error.cc:788
octave_value(* assignany_op_fcn)(octave_base_value &, const octave_value_list &, const octave_value &)
Definition: ov-typeinfo.h:63
bool do_register_widening_op(int, int, octave_base_value::type_conv_fcn)
Definition: ov-typeinfo.cc:440
octave_value(* assign_op_fcn)(octave_base_value &, const octave_value_list &, const octave_base_value &)
Definition: ov-typeinfo.h:60
static bool register_widening_op(int, int, octave_base_value::type_conv_fcn)
Definition: ov-typeinfo.cc:163
bool do_register_binary_class_op(octave_value::binary_op, binary_class_op_fcn)
Definition: ov-typeinfo.cc:285
static cat_op_fcn lookup_cat_op(int t1, int t2)
Definition: ov-typeinfo.h:152
octave_base_value *(* type_conv_fcn)(const octave_base_value &)
Definition: ov-base.h:190
static bool register_cat_op(int, int, cat_op_fcn)
Definition: ov-typeinfo.cc:129
T & checkelem(octave_idx_type n)
Definition: Array.cc:200
=val(i)}if ode{val(i)}occurs in table i
Definition: lookup.cc:239
Array< void * > unary_ops
Definition: ov-typeinfo.h:227
static int register_type(const std::string &, const std::string &, const octave_value &)
Definition: ov-typeinfo.cc:60
Array< void * > assign_ops
Definition: ov-typeinfo.h:241
string_vector do_installed_type_names(void) const
Definition: ov-typeinfo.cc:563
octave_value(* unary_class_op_fcn)(const octave_value &)
Definition: ov-typeinfo.h:43
compound_binary_op
Definition: ov.h:114
int do_register_type(const std::string &, const std::string &, const octave_value &)
Definition: ov-typeinfo.cc:174
Array< void * > widening_ops
Definition: ov-typeinfo.h:247
octave_value do_lookup_type(const std::string &nm)
Definition: ov-typeinfo.cc:457
static assign_op_fcn lookup_assign_op(octave_value::assign_op op, int t_lhs, int t_rhs)
Definition: ov-typeinfo.h:158
static std::string unary_op_as_string(unary_op)
Definition: ov.cc:119
static bool instance_ok(void)
Definition: ov-typeinfo.cc:41
Array< void * > compound_binary_ops
Definition: ov-typeinfo.h:237
Vector representing the dimensions (size) of an Array.
Definition: dim-vector.h:87
unary_op
Definition: ov.h:76
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:854
octave_idx_type columns(void) const
Definition: Array.h:410
static bool register_binary_class_op(octave_value::binary_op, binary_class_op_fcn)
Definition: ov-typeinfo.cc:95
binary_op_fcn do_lookup_binary_op(octave_value::binary_op, int, int)
Definition: ov-typeinfo.cc:504
Array< std::string > types
Definition: ov-typeinfo.h:221
F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &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 F77_REAL &F77_RET_T F77_DBLE &F77_RET_T F77_DBLE &F77_RET_T F77_REAL &F77_RET_T F77_REAL &F77_RET_T F77_DBLE &F77_RET_T const F77_DBLE F77_DBLE &F77_RET_T const F77_REAL F77_REAL &F77_RET_T F77_REAL F77_REAL &F77_RET_T F77_DBLE F77_DBLE &F77_RET_T const F77_DBLE * x
bool do_register_cat_op(int, int, cat_op_fcn)
Definition: ov-typeinfo.cc:363
charNDArray min(char d, const charNDArray &m)
Definition: chNDArray.cc:205
static bool register_unary_op(octave_value::unary_op, int, unary_op_fcn)
Definition: ov-typeinfo.cc:77
static unary_op_fcn lookup_unary_op(octave_value::unary_op op, int t)
Definition: ov-typeinfo.h:116
static bool register_assignany_op(octave_value::assign_op, int, assignany_op_fcn)
Definition: ov-typeinfo.cc:146
Array< void * > compound_binary_class_ops
Definition: ov-typeinfo.h:235