annotate libinterp/octave-value/ov-typeinfo.cc @ 21301:40de9f8f23a6

Use '#include "config.h"' rather than <config.h>. * mk-octave-config-h.sh, mk-opts.pl, Backend.cc, BaseControl.cc, ButtonControl.cc, Canvas.cc, CheckBoxControl.cc, Container.cc, ContextMenu.cc, EditControl.cc, Figure.cc, FigureWindow.cc, GLCanvas.cc, KeyMap.cc, ListBoxControl.cc, Logger.cc, Menu.cc, MouseModeActionGroup.cc, Object.cc, ObjectFactory.cc, ObjectProxy.cc, Panel.cc, PopupMenuControl.cc, PushButtonControl.cc, PushTool.cc, QtHandlesUtils.cc, RadioButtonControl.cc, SliderControl.cc, TextControl.cc, TextEdit.cc, ToggleButtonControl.cc, ToggleTool.cc, ToolBar.cc, ToolBarButton.cc, __init_qt__.cc, annotation-dialog.cc, gl-select.cc, module.mk, kpty.cpp, color-picker.cc, dialog.cc, documentation-dock-widget.cc, files-dock-widget.cc, find-files-dialog.cc, find-files-model.cc, history-dock-widget.cc, file-editor-tab.cc, file-editor-tab.h, file-editor.cc, find-dialog.cc, marker.cc, octave-qscintilla.cc, octave-txt-lexer.cc, main-window.cc, octave-cmd.cc, octave-dock-widget.cc, octave-gui.cc, octave-interpreter.cc, octave-qt-link.cc, parser.cc, webinfo.cc, resource-manager.cc, settings-dialog.cc, shortcut-manager.cc, terminal-dock-widget.cc, thread-manager.cc, welcome-wizard.cc, workspace-model.cc, workspace-view.cc, build-env-features.sh, build-env.in.cc, Cell.cc, __contourc__.cc, __dispatch__.cc, __dsearchn__.cc, __ichol__.cc, __ilu__.cc, __lin_interpn__.cc, __pchip_deriv__.cc, __qp__.cc, balance.cc, besselj.cc, betainc.cc, bitfcns.cc, bsxfun.cc, c-file-ptr-stream.cc, cdisplay.c, cellfun.cc, coct-hdf5-types.c, colloc.cc, comment-list.cc, conv2.cc, daspk.cc, dasrt.cc, dassl.cc, data.cc, debug.cc, defaults.cc, defun.cc, det.cc, dirfns.cc, display.cc, dlmread.cc, dot.cc, dynamic-ld.cc, eig.cc, ellipj.cc, error.cc, errwarn.cc, event-queue.cc, fft.cc, fft2.cc, fftn.cc, file-io.cc, filter.cc, find.cc, ft-text-renderer.cc, gammainc.cc, gcd.cc, getgrent.cc, getpwent.cc, getrusage.cc, givens.cc, gl-render.cc, gl2ps-print.cc, graphics.cc, gripes.cc, hash.cc, help.cc, hess.cc, hex2num.cc, hook-fcn.cc, input.cc, inv.cc, jit-ir.cc, jit-typeinfo.cc, jit-util.cc, kron.cc, load-path.cc, load-save.cc, lookup.cc, ls-ascii-helper.cc, ls-hdf5.cc, ls-mat-ascii.cc, ls-mat4.cc, ls-mat5.cc, ls-oct-binary.cc, ls-oct-text.cc, ls-utils.cc, lsode.cc, lu.cc, luinc.cc, mappers.cc, matrix_type.cc, max.cc, mex.cc, mgorth.cc, nproc.cc, oct-errno.in.cc, oct-fstrm.cc, oct-hdf5-types.cc, oct-hist.cc, oct-iostrm.cc, oct-lvalue.cc, oct-map.cc, oct-prcstrm.cc, oct-procbuf.cc, oct-stream.cc, oct-strstrm.cc, oct-tex-lexer.in.ll, oct-tex-parser.in.yy, octave-link.cc, ordschur.cc, pager.cc, pinv.cc, pr-output.cc, procstream.cc, profiler.cc, psi.cc, pt-jit.cc, quad.cc, quadcc.cc, qz.cc, rand.cc, rcond.cc, regexp.cc, schur.cc, sighandlers.cc, siglist.c, sparse-xdiv.cc, sparse-xpow.cc, sparse.cc, spparms.cc, sqrtm.cc, str2double.cc, strfind.cc, strfns.cc, sub2ind.cc, svd.cc, sylvester.cc, symtab.cc, syscalls.cc, sysdep.cc, text-renderer.cc, time.cc, toplev.cc, tril.cc, tsearch.cc, txt-eng.cc, typecast.cc, urlwrite.cc, utils.cc, variables.cc, xdiv.cc, xgl2ps.c, xnorm.cc, xpow.cc, zfstream.cc, __delaunayn__.cc, __eigs__.cc, __fltk_uigetfile__.cc, __glpk__.cc, __init_fltk__.cc, __init_gnuplot__.cc, __magick_read__.cc, __osmesa_print__.cc, __voronoi__.cc, amd.cc, audiodevinfo.cc, audioread.cc, ccolamd.cc, chol.cc, colamd.cc, convhulln.cc, dmperm.cc, fftw.cc, qr.cc, symbfact.cc, symrcm.cc, mkbuiltins, mkops, ov-base-diag.cc, ov-base-int.cc, ov-base-mat.cc, ov-base-scalar.cc, ov-base-sparse.cc, ov-base.cc, ov-bool-mat.cc, ov-bool-sparse.cc, ov-bool.cc, ov-builtin.cc, ov-cell.cc, ov-ch-mat.cc, ov-class.cc, ov-classdef.cc, ov-colon.cc, ov-complex.cc, ov-cs-list.cc, ov-cx-diag.cc, ov-cx-mat.cc, ov-cx-sparse.cc, ov-dld-fcn.cc, ov-fcn-handle.cc, ov-fcn-inline.cc, ov-fcn.cc, ov-float.cc, ov-flt-complex.cc, ov-flt-cx-diag.cc, ov-flt-cx-mat.cc, ov-flt-re-diag.cc, ov-flt-re-mat.cc, ov-int16.cc, ov-int32.cc, ov-int64.cc, ov-int8.cc, ov-java.cc, ov-lazy-idx.cc, ov-mex-fcn.cc, ov-null-mat.cc, ov-oncleanup.cc, ov-perm.cc, ov-range.cc, ov-re-diag.cc, ov-re-mat.cc, ov-re-sparse.cc, ov-scalar.cc, ov-str-mat.cc, ov-struct.cc, ov-typeinfo.cc, ov-uint16.cc, ov-uint32.cc, ov-uint64.cc, ov-uint8.cc, ov-usr-fcn.cc, ov.cc, ovl.cc, octave.cc, op-b-b.cc, op-b-bm.cc, op-b-sbm.cc, op-bm-b.cc, op-bm-bm.cc, op-bm-sbm.cc, op-cdm-cdm.cc, op-cell.cc, op-chm.cc, op-class.cc, op-cm-cm.cc, op-cm-cs.cc, op-cm-m.cc, op-cm-s.cc, op-cm-scm.cc, op-cm-sm.cc, op-cs-cm.cc, op-cs-cs.cc, op-cs-m.cc, op-cs-s.cc, op-cs-scm.cc, op-cs-sm.cc, op-dm-dm.cc, op-dm-scm.cc, op-dm-sm.cc, op-dm-template.cc, op-dms-template.cc, op-double-conv.cc, op-fcdm-fcdm.cc, op-fcdm-fdm.cc, op-fcm-fcm.cc, op-fcm-fcs.cc, op-fcm-fm.cc, op-fcm-fs.cc, op-fcn.cc, op-fcs-fcm.cc, op-fcs-fcs.cc, op-fcs-fm.cc, op-fcs-fs.cc, op-fdm-fdm.cc, op-float-conv.cc, op-fm-fcm.cc, op-fm-fcs.cc, op-fm-fm.cc, op-fm-fs.cc, op-fs-fcm.cc, op-fs-fcs.cc, op-fs-fm.cc, op-fs-fs.cc, op-i16-i16.cc, op-i32-i32.cc, op-i64-i64.cc, op-i8-i8.cc, op-int-concat.cc, op-int-conv.cc, op-m-cm.cc, op-m-cs.cc, op-m-m.cc, op-m-s.cc, op-m-scm.cc, op-m-sm.cc, op-pm-pm.cc, op-pm-scm.cc, op-pm-sm.cc, op-pm-template.cc, op-range.cc, op-s-cm.cc, op-s-cs.cc, op-s-m.cc, op-s-s.cc, op-s-scm.cc, op-s-sm.cc, op-sbm-b.cc, op-sbm-bm.cc, op-sbm-sbm.cc, op-scm-cm.cc, op-scm-cs.cc, op-scm-m.cc, op-scm-s.cc, op-scm-scm.cc, op-scm-sm.cc, op-sm-cm.cc, op-sm-cs.cc, op-sm-m.cc, op-sm-s.cc, op-sm-scm.cc, op-sm-sm.cc, op-str-m.cc, op-str-s.cc, op-str-str.cc, op-struct.cc, op-ui16-ui16.cc, op-ui32-ui32.cc, op-ui64-ui64.cc, op-ui8-ui8.cc, lex.ll, oct-parse.in.yy, pt-arg-list.cc, pt-array-list.cc, pt-assign.cc, pt-binop.cc, pt-bp.cc, pt-cbinop.cc, pt-cell.cc, pt-check.cc, pt-classdef.cc, pt-cmd.cc, pt-colon.cc, pt-const.cc, pt-decl.cc, pt-eval.cc, pt-except.cc, pt-exp.cc, pt-fcn-handle.cc, pt-funcall.cc, pt-id.cc, pt-idx.cc, pt-jump.cc, pt-loop.cc, pt-mat.cc, pt-misc.cc, pt-pr-code.cc, pt-select.cc, pt-stmt.cc, pt-unop.cc, pt.cc, token.cc, Array-jit.cc, Array-os.cc, Array-sym.cc, Array-tc.cc, version.cc, Array-C.cc, Array-b.cc, Array-ch.cc, Array-d.cc, Array-f.cc, Array-fC.cc, Array-i.cc, Array-idx-vec.cc, Array-s.cc, Array-str.cc, Array-util.cc, Array-voidp.cc, Array.cc, CColVector.cc, CDiagMatrix.cc, CMatrix.cc, CNDArray.cc, CRowVector.cc, CSparse.cc, DiagArray2.cc, MArray-C.cc, MArray-d.cc, MArray-f.cc, MArray-fC.cc, MArray-i.cc, MArray-s.cc, MArray.cc, MDiagArray2.cc, MSparse-C.cc, MSparse-d.cc, MatrixType.cc, PermMatrix.cc, Range.cc, Sparse-C.cc, Sparse-b.cc, Sparse-d.cc, Sparse.cc, boolMatrix.cc, boolNDArray.cc, boolSparse.cc, chMatrix.cc, chNDArray.cc, dColVector.cc, dDiagMatrix.cc, dMatrix.cc, dNDArray.cc, dRowVector.cc, dSparse.cc, dim-vector.cc, fCColVector.cc, fCDiagMatrix.cc, fCMatrix.cc, fCNDArray.cc, fCRowVector.cc, fColVector.cc, fDiagMatrix.cc, fMatrix.cc, fNDArray.cc, fRowVector.cc, idx-vector.cc, int16NDArray.cc, int32NDArray.cc, int64NDArray.cc, int8NDArray.cc, intNDArray.cc, uint16NDArray.cc, uint32NDArray.cc, uint64NDArray.cc, uint8NDArray.cc, blaswrap.c, cquit.c, f77-extern.cc, f77-fcn.c, lo-error.c, quit.cc, CollocWt.cc, DASPK.cc, DASRT.cc, DASSL.cc, EIG.cc, LSODE.cc, ODES.cc, Quad.cc, aepbalance.cc, chol.cc, eigs-base.cc, fEIG.cc, gepbalance.cc, hess.cc, lo-mappers.cc, lo-specfun.cc, lu.cc, oct-convn.cc, oct-fftw.cc, oct-norm.cc, oct-rand.cc, oct-spparms.cc, qr.cc, qrp.cc, randgamma.c, randmtzig.c, randpoisson.c, schur.cc, sparse-chol.cc, sparse-dmsolve.cc, sparse-lu.cc, sparse-qr.cc, svd.cc, mk-ops.awk, dir-ops.cc, file-ops.cc, file-stat.cc, lo-sysdep.cc, mach-info.cc, oct-env.cc, oct-group.cc, oct-passwd.cc, oct-syscalls.cc, oct-time.cc, oct-uname.cc, cmd-edit.cc, cmd-hist.cc, data-conv.cc, f2c-main.c, glob-match.cc, kpse.cc, lo-array-errwarn.cc, lo-array-gripes.cc, lo-cutils.c, lo-ieee.cc, lo-regexp.cc, lo-utils.cc, oct-base64.cc, oct-glob.cc, oct-inttypes.cc, oct-locbuf.cc, oct-mutex.cc, oct-rl-edit.c, oct-rl-hist.c, oct-shlib.cc, oct-sort.cc, pathsearch.cc, singleton-cleanup.cc, sparse-sort.cc, sparse-util.cc, str-vec.cc, unwind-prot.cc, url-transfer.cc, display-available.c, main-cli.cc, main-gui.cc, main.in.cc, mkoctfile.in.cc, octave-config.in.cc: Use '#include "config.h"' rather than <config.h>.
author Rik <rik@octave.org>
date Thu, 18 Feb 2016 13:34:50 -0800
parents fcac5dbbf9ed
children aba2e6293dd8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
1 /*
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
2
19697
4197fc428c7d maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents: 18533
diff changeset
3 Copyright (C) 1996-2015 John W. Eaton
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
4
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
5 This file is part of Octave.
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
6
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
7 Octave is free software; you can redistribute it and/or modify it
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
8 under the terms of the GNU General Public License as published by the
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6708
diff changeset
9 Free Software Foundation; either version 3 of the License, or (at your
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6708
diff changeset
10 option) any later version.
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
11
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
12 Octave is distributed in the hope that it will be useful, but WITHOUT
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
15 for more details.
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
16
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6708
diff changeset
18 along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6708
diff changeset
19 <http://www.gnu.org/licenses/>.
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
20
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
21 */
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
22
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
23 #ifdef HAVE_CONFIG_H
21301
40de9f8f23a6 Use '#include "config.h"' rather than <config.h>.
Rik <rik@octave.org>
parents: 21200
diff changeset
24 # include "config.h"
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
25 #endif
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
26
13983
7dd7cccf0757 clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents: 13095
diff changeset
27 #include "Array.h"
7dd7cccf0757 clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents: 13095
diff changeset
28 #include "singleton-cleanup.h"
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
29
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
30 #include "defun.h"
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
31 #include "error.h"
13983
7dd7cccf0757 clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents: 13095
diff changeset
32 #include "ov-typeinfo.h"
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
33
2479
26e9ee533d87 [project @ 1996-11-07 17:46:14 by jwe]
jwe
parents: 2457
diff changeset
34 const int
26e9ee533d87 [project @ 1996-11-07 17:46:14 by jwe]
jwe
parents: 2457
diff changeset
35 octave_value_typeinfo::init_tab_sz (16);
26e9ee533d87 [project @ 1996-11-07 17:46:14 by jwe]
jwe
parents: 2457
diff changeset
36
26e9ee533d87 [project @ 1996-11-07 17:46:14 by jwe]
jwe
parents: 2457
diff changeset
37 octave_value_typeinfo *
26e9ee533d87 [project @ 1996-11-07 17:46:14 by jwe]
jwe
parents: 2457
diff changeset
38 octave_value_typeinfo::instance (0);
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
39
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2882
diff changeset
40 bool
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2882
diff changeset
41 octave_value_typeinfo::instance_ok (void)
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2882
diff changeset
42 {
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2882
diff changeset
43 bool retval = true;
13983
7dd7cccf0757 clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents: 13095
diff changeset
44
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2882
diff changeset
45 if (! instance)
13983
7dd7cccf0757 clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents: 13095
diff changeset
46 {
7dd7cccf0757 clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents: 13095
diff changeset
47 instance = new octave_value_typeinfo ();
7dd7cccf0757 clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents: 13095
diff changeset
48
7dd7cccf0757 clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents: 13095
diff changeset
49 if (instance)
7dd7cccf0757 clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents: 13095
diff changeset
50 singleton_cleanup_list::add (cleanup_instance);
7dd7cccf0757 clean up memory allocated for singletons before exit
John W. Eaton <jwe@octave.org>
parents: 13095
diff changeset
51 }
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2882
diff changeset
52
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2882
diff changeset
53 if (! instance)
20956
850e3d2533d4 maint: Eliminate more useless statements after error().
Rik <rik@octave.org>
parents: 20939
diff changeset
54 error ("unable to create value type info object!");
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2882
diff changeset
55
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2882
diff changeset
56 return retval;
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2882
diff changeset
57 }
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2882
diff changeset
58
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
59 int
4612
d44675070f1a [project @ 2003-11-14 19:49:56 by jwe]
jwe
parents: 4594
diff changeset
60 octave_value_typeinfo::register_type (const std::string& t_name,
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
61 const std::string& c_name,
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
62 const octave_value& val)
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
63 {
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2882
diff changeset
64 return (instance_ok ())
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
65 ? instance->do_register_type (t_name, c_name, val) : -1;
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
66 }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
67
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
68 bool
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
69 octave_value_typeinfo::register_unary_class_op (octave_value::unary_op op,
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
70 octave_value_typeinfo::unary_class_op_fcn f)
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
71 {
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
72 return (instance_ok ())
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
73 ? instance->do_register_unary_class_op (op, f) : false;
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
74 }
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
75
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
76 bool
3203
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3196
diff changeset
77 octave_value_typeinfo::register_unary_op (octave_value::unary_op op,
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
78 int t,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
79 octave_value_typeinfo::unary_op_fcn f)
3203
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3196
diff changeset
80 {
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3196
diff changeset
81 return (instance_ok ())
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
82 ? instance->do_register_unary_op (op, t, f) : false;
3203
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3196
diff changeset
83 }
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3196
diff changeset
84
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3196
diff changeset
85 bool
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3196
diff changeset
86 octave_value_typeinfo::register_non_const_unary_op (octave_value::unary_op op,
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
87 int t,
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
88 octave_value_typeinfo::non_const_unary_op_fcn f)
3203
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3196
diff changeset
89 {
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3196
diff changeset
90 return (instance_ok ())
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
91 ? instance->do_register_non_const_unary_op (op, t, f) : false;
3203
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3196
diff changeset
92 }
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3196
diff changeset
93
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3196
diff changeset
94 bool
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
95 octave_value_typeinfo::register_binary_class_op (octave_value::binary_op op,
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
96 octave_value_typeinfo::binary_class_op_fcn f)
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
97 {
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
98 return (instance_ok ())
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
99 ? instance->do_register_binary_class_op (op, f) : false;
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
100 }
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
101
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
102 bool
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
103 octave_value_typeinfo::register_binary_op (octave_value::binary_op op,
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
104 int t1, int t2,
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
105 octave_value_typeinfo::binary_op_fcn f)
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
106 {
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2882
diff changeset
107 return (instance_ok ())
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
108 ? instance->do_register_binary_op (op, t1, t2, f) : false;
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
109 }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
110
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
111 bool
7800
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7433
diff changeset
112 octave_value_typeinfo::register_binary_class_op (octave_value::compound_binary_op op,
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
113 octave_value_typeinfo::binary_class_op_fcn f)
7800
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7433
diff changeset
114 {
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7433
diff changeset
115 return (instance_ok ())
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
116 ? instance->do_register_binary_class_op (op, f) : false;
7800
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7433
diff changeset
117 }
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7433
diff changeset
118
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7433
diff changeset
119 bool
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7433
diff changeset
120 octave_value_typeinfo::register_binary_op (octave_value::compound_binary_op op,
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
121 int t1, int t2,
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
122 octave_value_typeinfo::binary_op_fcn f)
7800
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7433
diff changeset
123 {
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7433
diff changeset
124 return (instance_ok ())
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
125 ? instance->do_register_binary_op (op, t1, t2, f) : false;
7800
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7433
diff changeset
126 }
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7433
diff changeset
127
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7433
diff changeset
128 bool
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
129 octave_value_typeinfo::register_cat_op (int t1, int t2,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
130 octave_value_typeinfo::cat_op_fcn f)
4915
c638c144d4da [project @ 2004-07-23 19:01:22 by jwe]
jwe
parents: 4901
diff changeset
131 {
c638c144d4da [project @ 2004-07-23 19:01:22 by jwe]
jwe
parents: 4901
diff changeset
132 return (instance_ok ())
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
133 ? instance->do_register_cat_op (t1, t2, f) : false;
4915
c638c144d4da [project @ 2004-07-23 19:01:22 by jwe]
jwe
parents: 4901
diff changeset
134 }
c638c144d4da [project @ 2004-07-23 19:01:22 by jwe]
jwe
parents: 4901
diff changeset
135
c638c144d4da [project @ 2004-07-23 19:01:22 by jwe]
jwe
parents: 4901
diff changeset
136 bool
2882
05926e1b367d [project @ 1997-04-24 09:48:59 by jwe]
jwe
parents: 2847
diff changeset
137 octave_value_typeinfo::register_assign_op (octave_value::assign_op op,
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
138 int t_lhs, int t_rhs,
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
139 octave_value_typeinfo::assign_op_fcn f)
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
140 {
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2882
diff changeset
141 return (instance_ok ())
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
142 ? instance->do_register_assign_op (op, t_lhs, t_rhs, f) : -1;
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
143 }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
144
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
145 bool
3196
3ac3e8edc258 [project @ 1998-10-28 23:04:39 by jwe]
jwe
parents: 3014
diff changeset
146 octave_value_typeinfo::register_assignany_op (octave_value::assign_op op,
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
147 int t_lhs, octave_value_typeinfo::assignany_op_fcn f)
3196
3ac3e8edc258 [project @ 1998-10-28 23:04:39 by jwe]
jwe
parents: 3014
diff changeset
148 {
3ac3e8edc258 [project @ 1998-10-28 23:04:39 by jwe]
jwe
parents: 3014
diff changeset
149 return (instance_ok ())
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
150 ? instance->do_register_assignany_op (op, t_lhs, f) : -1;
3196
3ac3e8edc258 [project @ 1998-10-28 23:04:39 by jwe]
jwe
parents: 3014
diff changeset
151 }
3ac3e8edc258 [project @ 1998-10-28 23:04:39 by jwe]
jwe
parents: 3014
diff changeset
152
3ac3e8edc258 [project @ 1998-10-28 23:04:39 by jwe]
jwe
parents: 3014
diff changeset
153 bool
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
154 octave_value_typeinfo::register_pref_assign_conv (int t_lhs, int t_rhs,
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11570
diff changeset
155 int t_result)
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
156 {
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2882
diff changeset
157 return (instance_ok ())
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
158 ? instance->do_register_pref_assign_conv (t_lhs, t_rhs, t_result)
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
159 : false;
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
160 }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
161
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
162 bool
4901
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents: 4687
diff changeset
163 octave_value_typeinfo::register_type_conv_op (int t, int t_result,
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
164 octave_base_value::type_conv_fcn f)
4901
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents: 4687
diff changeset
165 {
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents: 4687
diff changeset
166 return (instance_ok ())
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
167 ? instance->do_register_type_conv_op (t, t_result, f) : false;
4901
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents: 4687
diff changeset
168 }
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents: 4687
diff changeset
169
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents: 4687
diff changeset
170 bool
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
171 octave_value_typeinfo::register_widening_op (int t, int t_result,
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
172 octave_base_value::type_conv_fcn f)
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
173 {
2926
66ef74ee5d9f [project @ 1997-05-05 03:20:52 by jwe]
jwe
parents: 2882
diff changeset
174 return (instance_ok ())
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
175 ? instance->do_register_widening_op (t, t_result, f) : false;
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
176 }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
177
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
178 // FIXME: we should also store all class names and provide a
4687
e95c86d48732 [project @ 2004-01-06 21:53:34 by jwe]
jwe
parents: 4640
diff changeset
179 // way to list them (calling class with nargin == 0?).
e95c86d48732 [project @ 2004-01-06 21:53:34 by jwe]
jwe
parents: 4640
diff changeset
180
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
181 int
4612
d44675070f1a [project @ 2003-11-14 19:49:56 by jwe]
jwe
parents: 4594
diff changeset
182 octave_value_typeinfo::do_register_type (const std::string& t_name,
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
183 const std::string& /* c_name */,
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
184 const octave_value& val)
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
185 {
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
186 int i = 0;
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
187
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
188 for (i = 0; i < num_types; i++)
4612
d44675070f1a [project @ 2003-11-14 19:49:56 by jwe]
jwe
parents: 4594
diff changeset
189 if (t_name == types (i))
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
190 return i;
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
191
20232
a9574e3c6e9e Deprecate Array::length() and Sparse::length() in favour of ::numel().
Carnë Draug <carandraug@octave.org>
parents: 20163
diff changeset
192 int len = types.numel ();
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
193
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
194 if (i == len)
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
195 {
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
196 len *= 2;
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
197
21017
93748bcaec17 maint: Replace emtpy 'std::string ()' calls with "".
Rik <rik@octave.org>
parents: 20956
diff changeset
198 types.resize (dim_vector (len, 1), "");
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
199
11570
57632dea2446 attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
200 vals.resize (dim_vector (len, 1), octave_value ());
4640
2d237a76dbdd [project @ 2003-11-22 11:24:44 by jwe]
jwe
parents: 4625
diff changeset
201
11570
57632dea2446 attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
202 unary_ops.resize (dim_vector (octave_value::num_unary_ops, len), 0);
3203
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3196
diff changeset
203
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3196
diff changeset
204 non_const_unary_ops.resize
11570
57632dea2446 attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
205 (dim_vector (octave_value::num_unary_ops, len), 0);
3203
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3196
diff changeset
206
11570
57632dea2446 attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
207 binary_ops.resize
57632dea2446 attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
208 (dim_vector (octave_value::num_binary_ops, len, len), 0);
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
209
11570
57632dea2446 attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
210 compound_binary_ops.resize
57632dea2446 attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
211 (dim_vector (octave_value::num_compound_binary_ops, len, len), 0);
7800
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7433
diff changeset
212
11570
57632dea2446 attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
213 cat_ops.resize (dim_vector (len, len), 0);
4915
c638c144d4da [project @ 2004-07-23 19:01:22 by jwe]
jwe
parents: 4901
diff changeset
214
11570
57632dea2446 attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
215 assign_ops.resize
57632dea2446 attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
216 (dim_vector (octave_value::num_assign_ops, len, len), 0);
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
217
11570
57632dea2446 attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
218 assignany_ops.resize
57632dea2446 attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
219 (dim_vector (octave_value::num_assign_ops, len), 0);
3196
3ac3e8edc258 [project @ 1998-10-28 23:04:39 by jwe]
jwe
parents: 3014
diff changeset
220
11570
57632dea2446 attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
221 pref_assign_conv.resize (dim_vector (len, len), -1);
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
222
11570
57632dea2446 attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
223 type_conv_ops.resize (dim_vector (len, len), 0);
4901
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents: 4687
diff changeset
224
11570
57632dea2446 attempt better backward compatibility for Array constructors
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
225 widening_ops.resize (dim_vector (len, len), 0);
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
226 }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
227
4612
d44675070f1a [project @ 2003-11-14 19:49:56 by jwe]
jwe
parents: 4594
diff changeset
228 types (i) = t_name;
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
229
4640
2d237a76dbdd [project @ 2003-11-22 11:24:44 by jwe]
jwe
parents: 4625
diff changeset
230 vals (i) = val;
2d237a76dbdd [project @ 2003-11-22 11:24:44 by jwe]
jwe
parents: 4625
diff changeset
231
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
232 num_types++;
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
233
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
234 return i;
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
235 }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
236
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
237 bool
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
238 octave_value_typeinfo::do_register_unary_class_op (octave_value::unary_op op,
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
239 octave_value_typeinfo::unary_class_op_fcn f)
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
240 {
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
241 if (lookup_unary_class_op (op))
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
242 {
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
243 std::string op_name = octave_value::unary_op_as_string (op);
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
244
15466
d174210ce1ec use ' instead of ` in error messages, warnings and most comments
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
245 warning ("duplicate unary operator '%s' for class dispatch",
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
246 op_name.c_str ());
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
247 }
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
248
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
249 unary_class_ops.checkelem (static_cast<int> (op))
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
250 = reinterpret_cast<void *> (f);
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
251
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
252 return false;
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
253 }
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
254
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
255 bool
3203
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3196
diff changeset
256 octave_value_typeinfo::do_register_unary_op (octave_value::unary_op op,
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
257 int t,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
258 octave_value_typeinfo::unary_op_fcn f)
3203
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3196
diff changeset
259 {
4508
2bc437206787 [project @ 2003-09-11 01:06:43 by jwe]
jwe
parents: 4192
diff changeset
260 if (lookup_unary_op (op, t))
2bc437206787 [project @ 2003-09-11 01:06:43 by jwe]
jwe
parents: 4192
diff changeset
261 {
2bc437206787 [project @ 2003-09-11 01:06:43 by jwe]
jwe
parents: 4192
diff changeset
262 std::string op_name = octave_value::unary_op_as_string (op);
2bc437206787 [project @ 2003-09-11 01:06:43 by jwe]
jwe
parents: 4192
diff changeset
263 std::string type_name = types(t);
2bc437206787 [project @ 2003-09-11 01:06:43 by jwe]
jwe
parents: 4192
diff changeset
264
15466
d174210ce1ec use ' instead of ` in error messages, warnings and most comments
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
265 warning ("duplicate unary operator '%s' for type '%s'",
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
266 op_name.c_str (), type_name.c_str ());
4508
2bc437206787 [project @ 2003-09-11 01:06:43 by jwe]
jwe
parents: 4192
diff changeset
267 }
2bc437206787 [project @ 2003-09-11 01:06:43 by jwe]
jwe
parents: 4192
diff changeset
268
9223
902a4597dce8 use Array<void *> in ov-typeinfo.h
Jaroslav Hajek <highegg@gmail.com>
parents: 9219
diff changeset
269 unary_ops.checkelem (static_cast<int> (op), t) = reinterpret_cast<void *> (f);
3203
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3196
diff changeset
270
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3196
diff changeset
271 return false;
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3196
diff changeset
272 }
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3196
diff changeset
273
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3196
diff changeset
274 bool
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3196
diff changeset
275 octave_value_typeinfo::do_register_non_const_unary_op
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
276 (octave_value::unary_op op, int t,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
277 octave_value_typeinfo::non_const_unary_op_fcn f)
3203
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3196
diff changeset
278 {
4508
2bc437206787 [project @ 2003-09-11 01:06:43 by jwe]
jwe
parents: 4192
diff changeset
279 if (lookup_non_const_unary_op (op, t))
2bc437206787 [project @ 2003-09-11 01:06:43 by jwe]
jwe
parents: 4192
diff changeset
280 {
2bc437206787 [project @ 2003-09-11 01:06:43 by jwe]
jwe
parents: 4192
diff changeset
281 std::string op_name = octave_value::unary_op_as_string (op);
2bc437206787 [project @ 2003-09-11 01:06:43 by jwe]
jwe
parents: 4192
diff changeset
282 std::string type_name = types(t);
2bc437206787 [project @ 2003-09-11 01:06:43 by jwe]
jwe
parents: 4192
diff changeset
283
15466
d174210ce1ec use ' instead of ` in error messages, warnings and most comments
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
284 warning ("duplicate unary operator '%s' for type '%s'",
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
285 op_name.c_str (), type_name.c_str ());
4508
2bc437206787 [project @ 2003-09-11 01:06:43 by jwe]
jwe
parents: 4192
diff changeset
286 }
2bc437206787 [project @ 2003-09-11 01:06:43 by jwe]
jwe
parents: 4192
diff changeset
287
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
288 non_const_unary_ops.checkelem (static_cast<int> (op), t)
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
289 = reinterpret_cast<void *> (f);
3203
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3196
diff changeset
290
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3196
diff changeset
291 return false;
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3196
diff changeset
292 }
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3196
diff changeset
293
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3196
diff changeset
294 bool
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
295 octave_value_typeinfo::do_register_binary_class_op (octave_value::binary_op op,
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
296 octave_value_typeinfo::binary_class_op_fcn f)
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
297 {
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
298 if (lookup_binary_class_op (op))
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
299 {
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
300 std::string op_name = octave_value::binary_op_as_string (op);
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
301
15466
d174210ce1ec use ' instead of ` in error messages, warnings and most comments
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
302 warning ("duplicate binary operator '%s' for class dispatch",
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
303 op_name.c_str ());
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
304 }
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
305
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
306 binary_class_ops.checkelem (static_cast<int> (op))
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
307 = reinterpret_cast<void *> (f);
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
308
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
309 return false;
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
310 }
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
311
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
312 bool
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
313 octave_value_typeinfo::do_register_binary_op (octave_value::binary_op op,
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
314 int t1, int t2,
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
315 octave_value_typeinfo::binary_op_fcn f)
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
316 {
4508
2bc437206787 [project @ 2003-09-11 01:06:43 by jwe]
jwe
parents: 4192
diff changeset
317 if (lookup_binary_op (op, t1, t2))
2bc437206787 [project @ 2003-09-11 01:06:43 by jwe]
jwe
parents: 4192
diff changeset
318 {
2bc437206787 [project @ 2003-09-11 01:06:43 by jwe]
jwe
parents: 4192
diff changeset
319 std::string op_name = octave_value::binary_op_as_string (op);
2bc437206787 [project @ 2003-09-11 01:06:43 by jwe]
jwe
parents: 4192
diff changeset
320 std::string t1_name = types(t1);
2bc437206787 [project @ 2003-09-11 01:06:43 by jwe]
jwe
parents: 4192
diff changeset
321 std::string t2_name = types(t2);
2bc437206787 [project @ 2003-09-11 01:06:43 by jwe]
jwe
parents: 4192
diff changeset
322
15466
d174210ce1ec use ' instead of ` in error messages, warnings and most comments
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
323 warning ("duplicate binary operator '%s' for types '%s' and '%s'",
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
324 op_name.c_str (), t1_name.c_str (), t1_name.c_str ());
4508
2bc437206787 [project @ 2003-09-11 01:06:43 by jwe]
jwe
parents: 4192
diff changeset
325 }
2bc437206787 [project @ 2003-09-11 01:06:43 by jwe]
jwe
parents: 4192
diff changeset
326
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
327 binary_ops.checkelem (static_cast<int> (op), t1, t2)
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
328 = reinterpret_cast<void *> (f);
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
329
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
330 return false;
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
331 }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
332
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
333 bool
7800
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7433
diff changeset
334 octave_value_typeinfo::do_register_binary_class_op (octave_value::compound_binary_op op,
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
335 octave_value_typeinfo::binary_class_op_fcn f)
7800
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7433
diff changeset
336 {
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7433
diff changeset
337 if (lookup_binary_class_op (op))
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7433
diff changeset
338 {
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7433
diff changeset
339 std::string op_name = octave_value::binary_op_fcn_name (op);
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7433
diff changeset
340
15466
d174210ce1ec use ' instead of ` in error messages, warnings and most comments
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
341 warning ("duplicate compound binary operator '%s' for class dispatch",
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
342 op_name.c_str ());
7800
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7433
diff changeset
343 }
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7433
diff changeset
344
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
345 compound_binary_class_ops.checkelem (static_cast<int> (op))
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
346 = reinterpret_cast<void *> (f);
7800
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7433
diff changeset
347
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7433
diff changeset
348 return false;
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7433
diff changeset
349 }
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7433
diff changeset
350
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7433
diff changeset
351 bool
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7433
diff changeset
352 octave_value_typeinfo::do_register_binary_op (octave_value::compound_binary_op op,
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
353 int t1, int t2,
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
354 octave_value_typeinfo::binary_op_fcn f)
7800
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7433
diff changeset
355 {
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7433
diff changeset
356 if (lookup_binary_op (op, t1, t2))
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7433
diff changeset
357 {
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7433
diff changeset
358 std::string op_name = octave_value::binary_op_fcn_name (op);
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7433
diff changeset
359 std::string t1_name = types(t1);
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7433
diff changeset
360 std::string t2_name = types(t2);
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7433
diff changeset
361
15466
d174210ce1ec use ' instead of ` in error messages, warnings and most comments
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
362 warning ("duplicate compound binary operator '%s' for types '%s' and '%s'",
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
363 op_name.c_str (), t1_name.c_str (), t1_name.c_str ());
7800
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7433
diff changeset
364 }
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7433
diff changeset
365
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
366 compound_binary_ops.checkelem (static_cast<int> (op), t1, t2)
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
367 = reinterpret_cast<void *> (f);
7800
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7433
diff changeset
368
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7433
diff changeset
369 return false;
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7433
diff changeset
370 }
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7433
diff changeset
371
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7433
diff changeset
372 bool
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
373 octave_value_typeinfo::do_register_cat_op (int t1, int t2,
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
374 octave_value_typeinfo::cat_op_fcn f)
4915
c638c144d4da [project @ 2004-07-23 19:01:22 by jwe]
jwe
parents: 4901
diff changeset
375 {
c638c144d4da [project @ 2004-07-23 19:01:22 by jwe]
jwe
parents: 4901
diff changeset
376 if (lookup_cat_op (t1, t2))
c638c144d4da [project @ 2004-07-23 19:01:22 by jwe]
jwe
parents: 4901
diff changeset
377 {
c638c144d4da [project @ 2004-07-23 19:01:22 by jwe]
jwe
parents: 4901
diff changeset
378 std::string t1_name = types(t1);
c638c144d4da [project @ 2004-07-23 19:01:22 by jwe]
jwe
parents: 4901
diff changeset
379 std::string t2_name = types(t2);
c638c144d4da [project @ 2004-07-23 19:01:22 by jwe]
jwe
parents: 4901
diff changeset
380
15466
d174210ce1ec use ' instead of ` in error messages, warnings and most comments
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
381 warning ("duplicate concatenation operator for types '%s' and '%s'",
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
382 t1_name.c_str (), t1_name.c_str ());
4915
c638c144d4da [project @ 2004-07-23 19:01:22 by jwe]
jwe
parents: 4901
diff changeset
383 }
c638c144d4da [project @ 2004-07-23 19:01:22 by jwe]
jwe
parents: 4901
diff changeset
384
9223
902a4597dce8 use Array<void *> in ov-typeinfo.h
Jaroslav Hajek <highegg@gmail.com>
parents: 9219
diff changeset
385 cat_ops.checkelem (t1, t2) = reinterpret_cast<void *> (f);
4915
c638c144d4da [project @ 2004-07-23 19:01:22 by jwe]
jwe
parents: 4901
diff changeset
386
c638c144d4da [project @ 2004-07-23 19:01:22 by jwe]
jwe
parents: 4901
diff changeset
387 return false;
c638c144d4da [project @ 2004-07-23 19:01:22 by jwe]
jwe
parents: 4901
diff changeset
388 }
c638c144d4da [project @ 2004-07-23 19:01:22 by jwe]
jwe
parents: 4901
diff changeset
389
c638c144d4da [project @ 2004-07-23 19:01:22 by jwe]
jwe
parents: 4901
diff changeset
390 bool
2882
05926e1b367d [project @ 1997-04-24 09:48:59 by jwe]
jwe
parents: 2847
diff changeset
391 octave_value_typeinfo::do_register_assign_op (octave_value::assign_op op,
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
392 int t_lhs, int t_rhs,
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
393 octave_value_typeinfo::assign_op_fcn f)
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
394 {
4508
2bc437206787 [project @ 2003-09-11 01:06:43 by jwe]
jwe
parents: 4192
diff changeset
395 if (lookup_assign_op (op, t_lhs, t_rhs))
2bc437206787 [project @ 2003-09-11 01:06:43 by jwe]
jwe
parents: 4192
diff changeset
396 {
2bc437206787 [project @ 2003-09-11 01:06:43 by jwe]
jwe
parents: 4192
diff changeset
397 std::string op_name = octave_value::assign_op_as_string (op);
2bc437206787 [project @ 2003-09-11 01:06:43 by jwe]
jwe
parents: 4192
diff changeset
398 std::string t_lhs_name = types(t_lhs);
2bc437206787 [project @ 2003-09-11 01:06:43 by jwe]
jwe
parents: 4192
diff changeset
399 std::string t_rhs_name = types(t_rhs);
2bc437206787 [project @ 2003-09-11 01:06:43 by jwe]
jwe
parents: 4192
diff changeset
400
15466
d174210ce1ec use ' instead of ` in error messages, warnings and most comments
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
401 warning ("duplicate assignment operator '%s' for types '%s' and '%s'",
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
402 op_name.c_str (), t_lhs_name.c_str (), t_rhs_name.c_str ());
4508
2bc437206787 [project @ 2003-09-11 01:06:43 by jwe]
jwe
parents: 4192
diff changeset
403 }
2bc437206787 [project @ 2003-09-11 01:06:43 by jwe]
jwe
parents: 4192
diff changeset
404
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
405 assign_ops.checkelem (static_cast<int> (op), t_lhs, t_rhs)
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
406 = reinterpret_cast<void *> (f);
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
407
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
408 return false;
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
409 }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
410
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
411 bool
3196
3ac3e8edc258 [project @ 1998-10-28 23:04:39 by jwe]
jwe
parents: 3014
diff changeset
412 octave_value_typeinfo::do_register_assignany_op (octave_value::assign_op op,
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
413 int t_lhs, octave_value_typeinfo::assignany_op_fcn f)
3196
3ac3e8edc258 [project @ 1998-10-28 23:04:39 by jwe]
jwe
parents: 3014
diff changeset
414 {
4508
2bc437206787 [project @ 2003-09-11 01:06:43 by jwe]
jwe
parents: 4192
diff changeset
415 if (lookup_assignany_op (op, t_lhs))
2bc437206787 [project @ 2003-09-11 01:06:43 by jwe]
jwe
parents: 4192
diff changeset
416 {
2bc437206787 [project @ 2003-09-11 01:06:43 by jwe]
jwe
parents: 4192
diff changeset
417 std::string op_name = octave_value::assign_op_as_string (op);
2bc437206787 [project @ 2003-09-11 01:06:43 by jwe]
jwe
parents: 4192
diff changeset
418 std::string t_lhs_name = types(t_lhs);
2bc437206787 [project @ 2003-09-11 01:06:43 by jwe]
jwe
parents: 4192
diff changeset
419
15466
d174210ce1ec use ' instead of ` in error messages, warnings and most comments
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
420 warning ("duplicate assignment operator '%s' for types '%s'",
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
421 op_name.c_str (), t_lhs_name.c_str ());
4508
2bc437206787 [project @ 2003-09-11 01:06:43 by jwe]
jwe
parents: 4192
diff changeset
422 }
2bc437206787 [project @ 2003-09-11 01:06:43 by jwe]
jwe
parents: 4192
diff changeset
423
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
424 assignany_ops.checkelem (static_cast<int> (op), t_lhs)
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
425 = reinterpret_cast<void *> (f);
3196
3ac3e8edc258 [project @ 1998-10-28 23:04:39 by jwe]
jwe
parents: 3014
diff changeset
426
3ac3e8edc258 [project @ 1998-10-28 23:04:39 by jwe]
jwe
parents: 3014
diff changeset
427 return false;
3ac3e8edc258 [project @ 1998-10-28 23:04:39 by jwe]
jwe
parents: 3014
diff changeset
428 }
3ac3e8edc258 [project @ 1998-10-28 23:04:39 by jwe]
jwe
parents: 3014
diff changeset
429
3ac3e8edc258 [project @ 1998-10-28 23:04:39 by jwe]
jwe
parents: 3014
diff changeset
430 bool
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
431 octave_value_typeinfo::do_register_pref_assign_conv (int t_lhs, int t_rhs,
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11570
diff changeset
432 int t_result)
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
433 {
4508
2bc437206787 [project @ 2003-09-11 01:06:43 by jwe]
jwe
parents: 4192
diff changeset
434 if (lookup_pref_assign_conv (t_lhs, t_rhs) >= 0)
2bc437206787 [project @ 2003-09-11 01:06:43 by jwe]
jwe
parents: 4192
diff changeset
435 {
2bc437206787 [project @ 2003-09-11 01:06:43 by jwe]
jwe
parents: 4192
diff changeset
436 std::string t_lhs_name = types(t_lhs);
2bc437206787 [project @ 2003-09-11 01:06:43 by jwe]
jwe
parents: 4192
diff changeset
437 std::string t_rhs_name = types(t_rhs);
2bc437206787 [project @ 2003-09-11 01:06:43 by jwe]
jwe
parents: 4192
diff changeset
438
15466
d174210ce1ec use ' instead of ` in error messages, warnings and most comments
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
439 warning ("overriding assignment conversion for types '%s' and '%s'",
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
440 t_lhs_name.c_str (), t_rhs_name.c_str ());
4508
2bc437206787 [project @ 2003-09-11 01:06:43 by jwe]
jwe
parents: 4192
diff changeset
441 }
2bc437206787 [project @ 2003-09-11 01:06:43 by jwe]
jwe
parents: 4192
diff changeset
442
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
443 pref_assign_conv.checkelem (t_lhs, t_rhs) = t_result;
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
444
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
445 return false;
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
446 }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
447
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
448 bool
4901
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents: 4687
diff changeset
449 octave_value_typeinfo::do_register_type_conv_op
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5307
diff changeset
450 (int t, int t_result, octave_base_value::type_conv_fcn f)
4901
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents: 4687
diff changeset
451 {
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents: 4687
diff changeset
452 if (lookup_type_conv_op (t, t_result))
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents: 4687
diff changeset
453 {
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents: 4687
diff changeset
454 std::string t_name = types(t);
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents: 4687
diff changeset
455 std::string t_result_name = types(t_result);
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents: 4687
diff changeset
456
15466
d174210ce1ec use ' instead of ` in error messages, warnings and most comments
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
457 warning ("overriding type conversion op for '%s' to '%s'",
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
458 t_name.c_str (), t_result_name.c_str ());
4901
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents: 4687
diff changeset
459 }
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents: 4687
diff changeset
460
9223
902a4597dce8 use Array<void *> in ov-typeinfo.h
Jaroslav Hajek <highegg@gmail.com>
parents: 9219
diff changeset
461 type_conv_ops.checkelem (t, t_result) = reinterpret_cast<void *> (f);
4901
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents: 4687
diff changeset
462
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents: 4687
diff changeset
463 return false;
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents: 4687
diff changeset
464 }
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents: 4687
diff changeset
465
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents: 4687
diff changeset
466 bool
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
467 octave_value_typeinfo::do_register_widening_op
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5307
diff changeset
468 (int t, int t_result, octave_base_value::type_conv_fcn f)
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
469 {
4508
2bc437206787 [project @ 2003-09-11 01:06:43 by jwe]
jwe
parents: 4192
diff changeset
470 if (lookup_widening_op (t, t_result))
2bc437206787 [project @ 2003-09-11 01:06:43 by jwe]
jwe
parents: 4192
diff changeset
471 {
2bc437206787 [project @ 2003-09-11 01:06:43 by jwe]
jwe
parents: 4192
diff changeset
472 std::string t_name = types(t);
2bc437206787 [project @ 2003-09-11 01:06:43 by jwe]
jwe
parents: 4192
diff changeset
473 std::string t_result_name = types(t_result);
2bc437206787 [project @ 2003-09-11 01:06:43 by jwe]
jwe
parents: 4192
diff changeset
474
15466
d174210ce1ec use ' instead of ` in error messages, warnings and most comments
John W. Eaton <jwe@octave.org>
parents: 14138
diff changeset
475 warning ("overriding widening op for '%s' to '%s'",
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
476 t_name.c_str (), t_result_name.c_str ());
4508
2bc437206787 [project @ 2003-09-11 01:06:43 by jwe]
jwe
parents: 4192
diff changeset
477 }
2bc437206787 [project @ 2003-09-11 01:06:43 by jwe]
jwe
parents: 4192
diff changeset
478
9223
902a4597dce8 use Array<void *> in ov-typeinfo.h
Jaroslav Hajek <highegg@gmail.com>
parents: 9219
diff changeset
479 widening_ops.checkelem (t, t_result) = reinterpret_cast<void *> (f);
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
480
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
481 return false;
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
482 }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
483
4640
2d237a76dbdd [project @ 2003-11-22 11:24:44 by jwe]
jwe
parents: 4625
diff changeset
484 octave_value
2d237a76dbdd [project @ 2003-11-22 11:24:44 by jwe]
jwe
parents: 4625
diff changeset
485 octave_value_typeinfo::do_lookup_type (const std::string& nm)
2d237a76dbdd [project @ 2003-11-22 11:24:44 by jwe]
jwe
parents: 4625
diff changeset
486 {
2d237a76dbdd [project @ 2003-11-22 11:24:44 by jwe]
jwe
parents: 4625
diff changeset
487 octave_value retval;
2d237a76dbdd [project @ 2003-11-22 11:24:44 by jwe]
jwe
parents: 4625
diff changeset
488
2d237a76dbdd [project @ 2003-11-22 11:24:44 by jwe]
jwe
parents: 4625
diff changeset
489 for (int i = 0; i < num_types; i++)
2d237a76dbdd [project @ 2003-11-22 11:24:44 by jwe]
jwe
parents: 4625
diff changeset
490 {
2d237a76dbdd [project @ 2003-11-22 11:24:44 by jwe]
jwe
parents: 4625
diff changeset
491 if (nm == types(i))
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
492 {
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
493 retval = vals(i);
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
494 retval.make_unique ();
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
495 break;
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
496 }
4640
2d237a76dbdd [project @ 2003-11-22 11:24:44 by jwe]
jwe
parents: 4625
diff changeset
497 }
2d237a76dbdd [project @ 2003-11-22 11:24:44 by jwe]
jwe
parents: 4625
diff changeset
498
2d237a76dbdd [project @ 2003-11-22 11:24:44 by jwe]
jwe
parents: 4625
diff changeset
499 return retval;
2d237a76dbdd [project @ 2003-11-22 11:24:44 by jwe]
jwe
parents: 4625
diff changeset
500 }
2d237a76dbdd [project @ 2003-11-22 11:24:44 by jwe]
jwe
parents: 4625
diff changeset
501
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
502 octave_value_typeinfo::unary_class_op_fcn
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
503 octave_value_typeinfo::do_lookup_unary_class_op (octave_value::unary_op op)
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
504 {
9223
902a4597dce8 use Array<void *> in ov-typeinfo.h
Jaroslav Hajek <highegg@gmail.com>
parents: 9219
diff changeset
505 void *f = unary_class_ops.checkelem (static_cast<int> (op));
902a4597dce8 use Array<void *> in ov-typeinfo.h
Jaroslav Hajek <highegg@gmail.com>
parents: 9219
diff changeset
506 return reinterpret_cast<octave_value_typeinfo::unary_class_op_fcn> (f);
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
507 }
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
508
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5307
diff changeset
509 octave_value_typeinfo::unary_op_fcn
3203
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3196
diff changeset
510 octave_value_typeinfo::do_lookup_unary_op (octave_value::unary_op op, int t)
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3196
diff changeset
511 {
9223
902a4597dce8 use Array<void *> in ov-typeinfo.h
Jaroslav Hajek <highegg@gmail.com>
parents: 9219
diff changeset
512 void *f = unary_ops.checkelem (static_cast<int> (op), t);
902a4597dce8 use Array<void *> in ov-typeinfo.h
Jaroslav Hajek <highegg@gmail.com>
parents: 9219
diff changeset
513 return reinterpret_cast<octave_value_typeinfo::unary_op_fcn> (f);
3203
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3196
diff changeset
514 }
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3196
diff changeset
515
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5307
diff changeset
516 octave_value_typeinfo::non_const_unary_op_fcn
3203
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3196
diff changeset
517 octave_value_typeinfo::do_lookup_non_const_unary_op
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3196
diff changeset
518 (octave_value::unary_op op, int t)
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3196
diff changeset
519 {
9223
902a4597dce8 use Array<void *> in ov-typeinfo.h
Jaroslav Hajek <highegg@gmail.com>
parents: 9219
diff changeset
520 void *f = non_const_unary_ops.checkelem (static_cast<int> (op), t);
902a4597dce8 use Array<void *> in ov-typeinfo.h
Jaroslav Hajek <highegg@gmail.com>
parents: 9219
diff changeset
521 return reinterpret_cast<octave_value_typeinfo::non_const_unary_op_fcn> (f);
3203
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3196
diff changeset
522 }
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3196
diff changeset
523
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
524 octave_value_typeinfo::binary_class_op_fcn
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
525 octave_value_typeinfo::do_lookup_binary_class_op (octave_value::binary_op op)
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
526 {
9223
902a4597dce8 use Array<void *> in ov-typeinfo.h
Jaroslav Hajek <highegg@gmail.com>
parents: 9219
diff changeset
527 void *f = binary_class_ops.checkelem (static_cast<int> (op));
902a4597dce8 use Array<void *> in ov-typeinfo.h
Jaroslav Hajek <highegg@gmail.com>
parents: 9219
diff changeset
528 return reinterpret_cast<octave_value_typeinfo::binary_class_op_fcn> (f);
7336
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
529 }
745a8299c2b5 [project @ 2007-12-28 20:56:55 by jwe]
jwe
parents: 7017
diff changeset
530
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5307
diff changeset
531 octave_value_typeinfo::binary_op_fcn
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
532 octave_value_typeinfo::do_lookup_binary_op (octave_value::binary_op op,
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
533 int t1, int t2)
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
534 {
9223
902a4597dce8 use Array<void *> in ov-typeinfo.h
Jaroslav Hajek <highegg@gmail.com>
parents: 9219
diff changeset
535 void *f = binary_ops.checkelem (static_cast<int> (op), t1, t2);
902a4597dce8 use Array<void *> in ov-typeinfo.h
Jaroslav Hajek <highegg@gmail.com>
parents: 9219
diff changeset
536 return reinterpret_cast<octave_value_typeinfo::binary_op_fcn> (f);
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
537 }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
538
7800
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7433
diff changeset
539 octave_value_typeinfo::binary_class_op_fcn
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7433
diff changeset
540 octave_value_typeinfo::do_lookup_binary_class_op (octave_value::compound_binary_op op)
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7433
diff changeset
541 {
9223
902a4597dce8 use Array<void *> in ov-typeinfo.h
Jaroslav Hajek <highegg@gmail.com>
parents: 9219
diff changeset
542 void *f = compound_binary_class_ops.checkelem (static_cast<int> (op));
902a4597dce8 use Array<void *> in ov-typeinfo.h
Jaroslav Hajek <highegg@gmail.com>
parents: 9219
diff changeset
543 return reinterpret_cast<octave_value_typeinfo::binary_class_op_fcn> (f);
7800
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7433
diff changeset
544 }
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7433
diff changeset
545
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7433
diff changeset
546 octave_value_typeinfo::binary_op_fcn
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7433
diff changeset
547 octave_value_typeinfo::do_lookup_binary_op (octave_value::compound_binary_op op,
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
548 int t1, int t2)
7800
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7433
diff changeset
549 {
9223
902a4597dce8 use Array<void *> in ov-typeinfo.h
Jaroslav Hajek <highegg@gmail.com>
parents: 9219
diff changeset
550 void *f = compound_binary_ops.checkelem (static_cast<int> (op), t1, t2);
902a4597dce8 use Array<void *> in ov-typeinfo.h
Jaroslav Hajek <highegg@gmail.com>
parents: 9219
diff changeset
551 return reinterpret_cast<octave_value_typeinfo::binary_op_fcn> (f);
7800
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7433
diff changeset
552 }
5861b95e9879 support for compound operators, implement trans_mul, mul_trans, herm_mul and mul_herm
Jaroslav Hajek <highegg@gmail.com>
parents: 7433
diff changeset
553
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5307
diff changeset
554 octave_value_typeinfo::cat_op_fcn
4915
c638c144d4da [project @ 2004-07-23 19:01:22 by jwe]
jwe
parents: 4901
diff changeset
555 octave_value_typeinfo::do_lookup_cat_op (int t1, int t2)
c638c144d4da [project @ 2004-07-23 19:01:22 by jwe]
jwe
parents: 4901
diff changeset
556 {
9223
902a4597dce8 use Array<void *> in ov-typeinfo.h
Jaroslav Hajek <highegg@gmail.com>
parents: 9219
diff changeset
557 void *f = cat_ops.checkelem (t1, t2);
902a4597dce8 use Array<void *> in ov-typeinfo.h
Jaroslav Hajek <highegg@gmail.com>
parents: 9219
diff changeset
558 return reinterpret_cast<octave_value_typeinfo::cat_op_fcn> (f);
4915
c638c144d4da [project @ 2004-07-23 19:01:22 by jwe]
jwe
parents: 4901
diff changeset
559 }
c638c144d4da [project @ 2004-07-23 19:01:22 by jwe]
jwe
parents: 4901
diff changeset
560
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5307
diff changeset
561 octave_value_typeinfo::assign_op_fcn
2882
05926e1b367d [project @ 1997-04-24 09:48:59 by jwe]
jwe
parents: 2847
diff changeset
562 octave_value_typeinfo::do_lookup_assign_op (octave_value::assign_op op,
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
563 int t_lhs, int t_rhs)
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
564 {
9223
902a4597dce8 use Array<void *> in ov-typeinfo.h
Jaroslav Hajek <highegg@gmail.com>
parents: 9219
diff changeset
565 void *f = assign_ops.checkelem (static_cast<int> (op), t_lhs, t_rhs);
902a4597dce8 use Array<void *> in ov-typeinfo.h
Jaroslav Hajek <highegg@gmail.com>
parents: 9219
diff changeset
566 return reinterpret_cast<octave_value_typeinfo::assign_op_fcn> (f);
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
567 }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
568
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5307
diff changeset
569 octave_value_typeinfo::assignany_op_fcn
3196
3ac3e8edc258 [project @ 1998-10-28 23:04:39 by jwe]
jwe
parents: 3014
diff changeset
570 octave_value_typeinfo::do_lookup_assignany_op (octave_value::assign_op op,
10315
57a59eae83cc untabify src C++ source files
John W. Eaton <jwe@octave.org>
parents: 10160
diff changeset
571 int t_lhs)
3196
3ac3e8edc258 [project @ 1998-10-28 23:04:39 by jwe]
jwe
parents: 3014
diff changeset
572 {
9223
902a4597dce8 use Array<void *> in ov-typeinfo.h
Jaroslav Hajek <highegg@gmail.com>
parents: 9219
diff changeset
573 void *f = assignany_ops.checkelem (static_cast<int> (op), t_lhs);
902a4597dce8 use Array<void *> in ov-typeinfo.h
Jaroslav Hajek <highegg@gmail.com>
parents: 9219
diff changeset
574 return reinterpret_cast<octave_value_typeinfo::assignany_op_fcn> (f);
3196
3ac3e8edc258 [project @ 1998-10-28 23:04:39 by jwe]
jwe
parents: 3014
diff changeset
575 }
3ac3e8edc258 [project @ 1998-10-28 23:04:39 by jwe]
jwe
parents: 3014
diff changeset
576
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
577 int
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
578 octave_value_typeinfo::do_lookup_pref_assign_conv (int t_lhs, int t_rhs)
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
579 {
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
580 return pref_assign_conv.checkelem (t_lhs, t_rhs);
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
581 }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
582
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5307
diff changeset
583 octave_base_value::type_conv_fcn
4901
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents: 4687
diff changeset
584 octave_value_typeinfo::do_lookup_type_conv_op (int t, int t_result)
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents: 4687
diff changeset
585 {
9223
902a4597dce8 use Array<void *> in ov-typeinfo.h
Jaroslav Hajek <highegg@gmail.com>
parents: 9219
diff changeset
586 void *f = type_conv_ops.checkelem (t, t_result);
902a4597dce8 use Array<void *> in ov-typeinfo.h
Jaroslav Hajek <highegg@gmail.com>
parents: 9219
diff changeset
587 return reinterpret_cast<octave_base_value::type_conv_fcn> (f);
4901
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents: 4687
diff changeset
588 }
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents: 4687
diff changeset
589
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5307
diff changeset
590 octave_base_value::type_conv_fcn
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
591 octave_value_typeinfo::do_lookup_widening_op (int t, int t_result)
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
592 {
9223
902a4597dce8 use Array<void *> in ov-typeinfo.h
Jaroslav Hajek <highegg@gmail.com>
parents: 9219
diff changeset
593 void *f = widening_ops.checkelem (t, t_result);
902a4597dce8 use Array<void *> in ov-typeinfo.h
Jaroslav Hajek <highegg@gmail.com>
parents: 9219
diff changeset
594 return reinterpret_cast<octave_base_value::type_conv_fcn> (f);
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
595 }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
596
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
597 string_vector
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
598 octave_value_typeinfo::do_installed_type_names (void)
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
599 {
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
600 string_vector retval (num_types);
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
601
11438
9e8497537319 typeinfo: return cellstr, not char array
John W. Eaton <jwe@octave.org>
parents: 10352
diff changeset
602 for (int i = 0; i < num_types; i++)
9e8497537319 typeinfo: return cellstr, not char array
John W. Eaton <jwe@octave.org>
parents: 10352
diff changeset
603 retval(i) = types(i);
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
604
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
605 return retval;
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
606 }
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
607
2457
5be3f6f5986a [project @ 1996-11-03 02:54:44 by jwe]
jwe
parents: 2427
diff changeset
608 DEFUN (typeinfo, args, ,
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
609 "-*- texinfo -*-\n\
20853
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20797
diff changeset
610 @deftypefn {} {} typeinfo ()\n\
1142cf6abc0d 2015 Code Sprint: remove class of function from docstring for all C++ files.
Rik <rik@octave.org>
parents: 20797
diff changeset
611 @deftypefnx {} {} typeinfo (@var{expr})\n\
2822
7cacd6c766d2 [project @ 1997-03-24 19:13:01 by jwe]
jwe
parents: 2800
diff changeset
612 \n\
20163
075a5e2e1ba5 doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19697
diff changeset
613 Return the type of the expression @var{expr}, as a string.\n\
075a5e2e1ba5 doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19697
diff changeset
614 \n\
075a5e2e1ba5 doc: Update more docstrings to have one sentence summary as first line.
Rik <rik@octave.org>
parents: 19697
diff changeset
615 If @var{expr} is omitted, return a cell array of strings containing all the\n\
3445
c3eed8ac845a [project @ 2000-01-17 09:06:51 by jwe]
jwe
parents: 3203
diff changeset
616 currently installed data types.\n\
18533
ea0d4dea1a17 doc: Update documentation for functions in octave-value dir.
Rik <rik@octave.org>
parents: 17787
diff changeset
617 @seealso{class, isa}\n\
3445
c3eed8ac845a [project @ 2000-01-17 09:06:51 by jwe]
jwe
parents: 3203
diff changeset
618 @end deftypefn")
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
619 {
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
620 int nargin = args.length ();
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
621
20797
492738d32c60 eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20428
diff changeset
622 if (nargin > 1)
492738d32c60 eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20428
diff changeset
623 print_usage ();
492738d32c60 eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20428
diff changeset
624
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
625 if (nargin == 0)
20939
b17fda023ca6 maint: Use new C++ archetype in more files.
Rik <rik@octave.org>
parents: 20853
diff changeset
626 return ovl (Cell (octave_value_typeinfo::installed_type_names ()));
20797
492738d32c60 eliminate return statements after calls to print_usage
John W. Eaton <jwe@octave.org>
parents: 20428
diff changeset
627 else
20939
b17fda023ca6 maint: Use new C++ archetype in more files.
Rik <rik@octave.org>
parents: 20853
diff changeset
628 return ovl (args(0).type_name ());
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
629 }
13095
32fdd834c09a tests for typeinfo function
John W. Eaton <jwe@octave.org>
parents: 12546
diff changeset
630
32fdd834c09a tests for typeinfo function
John W. Eaton <jwe@octave.org>
parents: 12546
diff changeset
631 /*
14429
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
632 %!assert (iscellstr (typeinfo ()))
13095
32fdd834c09a tests for typeinfo function
John W. Eaton <jwe@octave.org>
parents: 12546
diff changeset
633
14429
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
634 %!assert (typeinfo ({"cell"}), "cell")
13095
32fdd834c09a tests for typeinfo function
John W. Eaton <jwe@octave.org>
parents: 12546
diff changeset
635
14429
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
636 %!assert (typeinfo (1), "scalar")
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
637 %!assert (typeinfo (double (1)), "scalar")
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
638 %!assert (typeinfo (i), "complex scalar")
13095
32fdd834c09a tests for typeinfo function
John W. Eaton <jwe@octave.org>
parents: 12546
diff changeset
639
14429
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
640 %!assert (typeinfo ([1, 2]), "matrix")
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
641 %!assert (typeinfo (double ([1, 2])), "matrix")
13095
32fdd834c09a tests for typeinfo function
John W. Eaton <jwe@octave.org>
parents: 12546
diff changeset
642 %!assert (typeinfo (diag ([1, 2])), "diagonal matrix")
14429
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
643 %!assert (typeinfo ([i, 2]), "complex matrix")
13095
32fdd834c09a tests for typeinfo function
John W. Eaton <jwe@octave.org>
parents: 12546
diff changeset
644 %!assert (typeinfo (diag ([i, 2])), "complex diagonal matrix")
14429
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
645
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
646 %!assert (typeinfo (1:2), "range")
13095
32fdd834c09a tests for typeinfo function
John W. Eaton <jwe@octave.org>
parents: 12546
diff changeset
647
14429
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
648 %!assert (typeinfo (false), "bool")
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
649 %!assert (typeinfo ([true, false]), "bool matrix")
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
650
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
651 %!assert (typeinfo ("string"), "string")
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
652 %!assert (typeinfo ('string'), "sq_string")
13095
32fdd834c09a tests for typeinfo function
John W. Eaton <jwe@octave.org>
parents: 12546
diff changeset
653
14429
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
654 %!assert (typeinfo (int8 (1)), "int8 scalar")
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
655 %!assert (typeinfo (int16 (1)), "int16 scalar")
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
656 %!assert (typeinfo (int32 (1)), "int32 scalar")
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
657 %!assert (typeinfo (int64 (1)), "int64 scalar")
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
658 %!assert (typeinfo (uint8 (1)), "uint8 scalar")
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
659 %!assert (typeinfo (uint16 (1)), "uint16 scalar")
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
660 %!assert (typeinfo (uint32 (1)), "uint32 scalar")
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
661 %!assert (typeinfo (uint64 (1)), "uint64 scalar")
13095
32fdd834c09a tests for typeinfo function
John W. Eaton <jwe@octave.org>
parents: 12546
diff changeset
662
14429
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
663 %!assert (typeinfo (int8 ([1,2])), "int8 matrix")
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
664 %!assert (typeinfo (int16 ([1,2])), "int16 matrix")
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
665 %!assert (typeinfo (int32 ([1,2])), "int32 matrix")
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
666 %!assert (typeinfo (int64 ([1,2])), "int64 matrix")
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
667 %!assert (typeinfo (uint8 ([1,2])), "uint8 matrix")
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
668 %!assert (typeinfo (uint16 ([1,2])), "uint16 matrix")
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
669 %!assert (typeinfo (uint32 ([1,2])), "uint32 matrix")
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
670 %!assert (typeinfo (uint64 ([1,2])), "uint64 matrix")
13095
32fdd834c09a tests for typeinfo function
John W. Eaton <jwe@octave.org>
parents: 12546
diff changeset
671
14429
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
672 %!assert (typeinfo (sparse ([true, false])), "sparse bool matrix")
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
673 %!assert (typeinfo (logical (sparse (i * eye (10)))), "sparse bool matrix")
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
674 %!assert (typeinfo (sparse ([1,2])), "sparse matrix")
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
675 %!assert (typeinfo (sparse (eye (10))), "sparse matrix")
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
676 %!assert (typeinfo (sparse ([i,2])), "sparse complex matrix")
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
677 %!assert (typeinfo (sparse (i * eye (10))), "sparse complex matrix")
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
678
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
679 %!test
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
680 %! s(2).a = 1;
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
681 %! assert (typeinfo (s), "struct");
13095
32fdd834c09a tests for typeinfo function
John W. Eaton <jwe@octave.org>
parents: 12546
diff changeset
682
32fdd834c09a tests for typeinfo function
John W. Eaton <jwe@octave.org>
parents: 12546
diff changeset
683 %!test
32fdd834c09a tests for typeinfo function
John W. Eaton <jwe@octave.org>
parents: 12546
diff changeset
684 %! s.a = 1;
32fdd834c09a tests for typeinfo function
John W. Eaton <jwe@octave.org>
parents: 12546
diff changeset
685 %! assert (typeinfo (s), "scalar struct");
32fdd834c09a tests for typeinfo function
John W. Eaton <jwe@octave.org>
parents: 12546
diff changeset
686
14429
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
687 ## FIXME: This doesn't work as a test for comma-separated list
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
688 %!#test
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
689 %! clist = {1, 2, 3};
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
690 %! assert (typeinfo (clist{:}), "cs-list");
13095
32fdd834c09a tests for typeinfo function
John W. Eaton <jwe@octave.org>
parents: 12546
diff changeset
691
14429
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
692 %!assert (typeinfo (@sin), "function handle")
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
693 %!assert (typeinfo (@(x) x), "function handle")
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
694
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
695 %!assert (typeinfo (inline ("x^2")), "inline function")
13095
32fdd834c09a tests for typeinfo function
John W. Eaton <jwe@octave.org>
parents: 12546
diff changeset
696
14429
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
697 %!assert (typeinfo (single (1)), "float scalar")
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
698 %!assert (typeinfo (single (i)), "float complex scalar")
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
699 %!assert (typeinfo (single ([1, 2])), "float matrix")
13095
32fdd834c09a tests for typeinfo function
John W. Eaton <jwe@octave.org>
parents: 12546
diff changeset
700
14429
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
701 %!assert (typeinfo (single (diag ([1, 2]))), "float diagonal matrix")
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
702 %!assert (typeinfo (diag (single ([1, 2]))), "float diagonal matrix")
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
703 %!assert (typeinfo (single (diag ([i, 2]))), "float complex diagonal matrix")
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
704 %!assert (typeinfo (diag (single ([i, 2]))), "float complex diagonal matrix")
13095
32fdd834c09a tests for typeinfo function
John W. Eaton <jwe@octave.org>
parents: 12546
diff changeset
705
14429
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
706 %!assert (typeinfo (eye(3)(:,[1 3 2])), "permutation matrix")
13095
32fdd834c09a tests for typeinfo function
John W. Eaton <jwe@octave.org>
parents: 12546
diff changeset
707 %!test
32fdd834c09a tests for typeinfo function
John W. Eaton <jwe@octave.org>
parents: 12546
diff changeset
708 %! [l, u, p] = lu (rand (3));
32fdd834c09a tests for typeinfo function
John W. Eaton <jwe@octave.org>
parents: 12546
diff changeset
709 %! assert (typeinfo (p), "permutation matrix");
14429
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
710
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
711 %!assert (typeinfo ([]), "null_matrix")
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
712 %!assert (typeinfo (""), "null_string")
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
713 %!assert (typeinfo (''), "null_sq_string")
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
714
15810
87a61a4d8fd2 Add typeinfo %!tests for onCleanup and octave_java types.
Rik <rik@octave.org>
parents: 15467
diff changeset
715 %!test
87a61a4d8fd2 Add typeinfo %!tests for onCleanup and octave_java types.
Rik <rik@octave.org>
parents: 15467
diff changeset
716 %! cvar = onCleanup (@() "");
87a61a4d8fd2 Add typeinfo %!tests for onCleanup and octave_java types.
Rik <rik@octave.org>
parents: 15467
diff changeset
717 %! assert (typeinfo (cvar), "onCleanup");
87a61a4d8fd2 Add typeinfo %!tests for onCleanup and octave_java types.
Rik <rik@octave.org>
parents: 15467
diff changeset
718
87a61a4d8fd2 Add typeinfo %!tests for onCleanup and octave_java types.
Rik <rik@octave.org>
parents: 15467
diff changeset
719 %!testif HAVE_JAVA
87a61a4d8fd2 Add typeinfo %!tests for onCleanup and octave_java types.
Rik <rik@octave.org>
parents: 15467
diff changeset
720 %! x = javaObject ("java.lang.StringBuffer");
87a61a4d8fd2 Add typeinfo %!tests for onCleanup and octave_java types.
Rik <rik@octave.org>
parents: 15467
diff changeset
721 %! assert (typeinfo (x), "octave_java");
87a61a4d8fd2 Add typeinfo %!tests for onCleanup and octave_java types.
Rik <rik@octave.org>
parents: 15467
diff changeset
722
87a61a4d8fd2 Add typeinfo %!tests for onCleanup and octave_java types.
Rik <rik@octave.org>
parents: 15467
diff changeset
723 ## Test input validation
14429
eff4a5933e28 Update %!tests in src/ directory with Octave coding conventions.
Rik <octave@nomad.inbox5.com>
parents: 14138
diff changeset
724 %!error typeinfo ("foo", 1)
13095
32fdd834c09a tests for typeinfo function
John W. Eaton <jwe@octave.org>
parents: 12546
diff changeset
725 */