annotate libinterp/operators/op-class.cc @ 29989:b260322f6730

move xdiv, xnorm, and xpow inside octave namespace * xdiv.h, xdiv.cc (elem_xdiv): Rename from x_el_div. (elem_xdiv, xdiv): Move inside octave namespace. Change all uses. Provide deprecated wrapper functions to preserve old names. * xnorm.h, xnorm.cc (xnorm, xcolnorms, xrownorms, xfrobnorm): Move inside octave namespace. Change all uses. Provide deprecated wrapper functions to preserve old names. * xpow.h, xpow.cc (elem_xpow, xpow): Move inside octave namespace. Change all uses. Provide deprecated wrapper functions to preserve old names. * ov-base.cc (install_base_type_conversions): Move inside octave namespace. * ops.h: Don't declare install_ops function here. * ov-typeinfo.cc: Declare install_ops in source file instead of including ops.h. * mk-ops.sh: Move generated code inside octave namespace. * 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-fcdm-fcdm.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-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-m-cm.cc, op-m-cs.cc, op-m-m.cc, op-m-s.cc, op-m-scm.cc, op-m-sm.cc, op-mi.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: Move operator functions inside octave namespace.
author John W. Eaton <jwe@octave.org>
date Mon, 16 Aug 2021 21:38:22 -0400
parents 0a5b15007766
children 796f54d4ddbf
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
1 ////////////////////////////////////////////////////////////////////////
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
2 //
29358
0a5b15007766 update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents: 27923
diff changeset
3 // Copyright (C) 2007-2021 The Octave Project Developers
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
4 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
5 // See the file COPYRIGHT.md in the top-level directory of this
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
6 // distribution or <https://octave.org/copyright/>.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
7 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
8 // This file is part of Octave.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
9 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
10 // Octave is free software: you can redistribute it and/or modify it
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
11 // under the terms of the GNU General Public License as published by
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
12 // the Free Software Foundation, either version 3 of the License, or
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
13 // (at your option) any later version.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
14 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
15 // Octave is distributed in the hope that it will be useful, but
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
18 // GNU General Public License for more details.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
19 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
20 // You should have received a copy of the GNU General Public License
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
21 // along with Octave; see the file COPYING. If not, see
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
22 // <https://www.gnu.org/licenses/>.
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
23 //
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
24 ////////////////////////////////////////////////////////////////////////
7338
5215422865e0 [project @ 2007-12-28 22:31:35 by jwe]
jwe
parents:
diff changeset
25
27098
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
26 //! @file op-class.cc
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
27 //! Unary and binary operators for classdef and old style classes.
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
28
21724
aba2e6293dd8 use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents: 21301
diff changeset
29 #if defined (HAVE_CONFIG_H)
21301
40de9f8f23a6 Use '#include "config.h"' rather than <config.h>.
Rik <rik@octave.org>
parents: 21200
diff changeset
30 # include "config.h"
7338
5215422865e0 [project @ 2007-12-28 22:31:35 by jwe]
jwe
parents:
diff changeset
31 #endif
5215422865e0 [project @ 2007-12-28 22:31:35 by jwe]
jwe
parents:
diff changeset
32
5215422865e0 [project @ 2007-12-28 22:31:35 by jwe]
jwe
parents:
diff changeset
33 #include "oct-time.h"
5215422865e0 [project @ 2007-12-28 22:31:35 by jwe]
jwe
parents:
diff changeset
34
21100
e39e05d90788 Switch gripe_XXX to either err_XXX or warn_XXX naming scheme.
Rik <rik@octave.org>
parents: 20940
diff changeset
35 #include "errwarn.h"
23599
5cb3a2bb5e1e don't use singleton for symbol_table
John W. Eaton <jwe@octave.org>
parents: 23587
diff changeset
36 #include "interpreter-private.h"
7338
5215422865e0 [project @ 2007-12-28 22:31:35 by jwe]
jwe
parents:
diff changeset
37 #include "load-path.h"
20940
48b2ad5ee801 maint: Rename oct-obj.[cc|h] to ovl.[cc|h] for clarity.
Rik <rik@octave.org>
parents: 20833
diff changeset
38 #include "ovl.h"
7338
5215422865e0 [project @ 2007-12-28 22:31:35 by jwe]
jwe
parents:
diff changeset
39 #include "ov.h"
5215422865e0 [project @ 2007-12-28 22:31:35 by jwe]
jwe
parents:
diff changeset
40 #include "ov-class.h"
5215422865e0 [project @ 2007-12-28 22:31:35 by jwe]
jwe
parents:
diff changeset
41 #include "ov-typeinfo.h"
5215422865e0 [project @ 2007-12-28 22:31:35 by jwe]
jwe
parents:
diff changeset
42 #include "ops.h"
5215422865e0 [project @ 2007-12-28 22:31:35 by jwe]
jwe
parents:
diff changeset
43 #include "symtab.h"
5215422865e0 [project @ 2007-12-28 22:31:35 by jwe]
jwe
parents:
diff changeset
44 #include "parse.h"
5215422865e0 [project @ 2007-12-28 22:31:35 by jwe]
jwe
parents:
diff changeset
45
29989
b260322f6730 move xdiv, xnorm, and xpow inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
46 OCTAVE_NAMESPACE_BEGIN
b260322f6730 move xdiv, xnorm, and xpow inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
47
27098
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
48 //! Default unary class operator.
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
49 //!
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
50 //! @param a operand
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
51 //! @param opname operator name
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
52
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
53 static octave_value
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
54 oct_unop_default (const octave_value& a, const std::string& opname)
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
55 {
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
56 std::string class_name = a.class_name ();
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
57
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
58 octave_value meth
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
59 = octave::__get_symbol_table__ ("oct_unop_" + opname)
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
60 .find_method (opname, class_name);
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
61
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
62 if (meth.is_defined ())
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
63 {
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
64 // Call overloaded unary class operator.
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
65 octave_value_list tmp = octave::feval (meth.function_value (),
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
66 ovl (a), 1);
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
67
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
68 // Return first element if present.
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
69 if (tmp.length () > 0)
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
70 return tmp(0);
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
71
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
72 return octave_value ();
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
73 }
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
74
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
75 // Matlab compatibility: If (conjugate) transpose is not overloaded and
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
76 // the number of dimensions is maximal two, just transpose the array of
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
77 // that class.
7338
5215422865e0 [project @ 2007-12-28 22:31:35 by jwe]
jwe
parents:
diff changeset
78
27098
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
79 if ((opname == "transpose") || (opname == "ctranspose"))
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
80 {
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
81 if (a.ndims () > 2)
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
82 error ("%s not defined for N-D objects of %s class", opname.c_str (),
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
83 class_name.c_str ());
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
84
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
85 if (a.is_classdef_object ())
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
86 {
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
87 // FIXME: Default transposition for classdef arrays.
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
88
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
89 error ("%s method not defined for %s class", opname.c_str (),
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
90 class_name.c_str ());
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
91 }
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
92 else
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
93 {
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
94 const octave_class& v
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
95 = dynamic_cast<const octave_class&> (a.get_rep ());
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
96
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
97 return octave_value (v.map_value ().transpose (),
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
98 v.class_name (),
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
99 v.parent_class_name_list ());
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
100 }
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
101 }
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
102 else
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
103 error ("%s method not defined for %s class", opname.c_str (),
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
104 class_name.c_str ());
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
105 }
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
106
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
107 //! Helper macro to define unary class operators.
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
108
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
109 #define DEF_CLASS_UNOP(opname) \
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
110 static octave_value \
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
111 oct_unop_ ## opname (const octave_value& a) \
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
112 { \
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
113 return oct_unop_default (a, #opname); \
7338
5215422865e0 [project @ 2007-12-28 22:31:35 by jwe]
jwe
parents:
diff changeset
114 }
5215422865e0 [project @ 2007-12-28 22:31:35 by jwe]
jwe
parents:
diff changeset
115
27098
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
116 DEF_CLASS_UNOP (not) // !a or ~a
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
117 DEF_CLASS_UNOP (uplus) // +a
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
118 DEF_CLASS_UNOP (uminus) // -a
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
119 DEF_CLASS_UNOP (transpose) // a.'
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
120 DEF_CLASS_UNOP (ctranspose) // a'
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
121 #undef DEF_CLASS_UNOP
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
122
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
123 //! Default binary class operator.
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
124 //!
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
125 //! @param a1 first operand
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
126 //! @param a2 second operand
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
127 //! @param opname operator name
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
128 //!
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
129 //! The operator precedence is as follows:
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
130 //!
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
131 //! 1. If exactly one of the operands is a user defined class object, then
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
132 //! the class method of that operand is invoked.
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
133 //!
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
134 //! 2. If both operands are user defined class objects, then
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
135 //! 2.1 The superior class method is invoked.
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
136 //! 2.2 The leftmost class method is invoked if both classes are the same
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
137 //! or their precedence is not defined by superiorto/inferiorto.
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
138
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
139 static octave_value
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
140 oct_binop_default (const octave_value& a1, const octave_value& a2,
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
141 const std::string& opname)
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
142 {
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
143 octave::symbol_table& symtab
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
144 = octave::__get_symbol_table__ ("oct_binop_" + opname);
27095
4ae89360ca16 Default (c)transpose for old style class arrays (bug #56323).
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 26376
diff changeset
145
27098
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
146 // Dispatch to first (leftmost) operand by default.
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
147 std::string dispatch_type = a1.class_name ();
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
148
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
149 // Determine, if second operand takes precedence (see rules above).
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
150 if (! a1.isobject ()
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
151 || (a1.isobject () && a2.isobject ()
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
152 && symtab.is_superiorto (a2.class_name (), dispatch_type)))
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
153 dispatch_type = a2.class_name ();
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
154
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
155 octave_value meth = symtab.find_method (opname, dispatch_type);
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
156
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
157 if (meth.is_undefined ())
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
158 error ("%s method not defined for %s class", opname.c_str (),
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
159 dispatch_type.c_str ());
27095
4ae89360ca16 Default (c)transpose for old style class arrays (bug #56323).
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 26376
diff changeset
160
27098
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
161 octave_value_list tmp = octave::feval (meth.function_value (),
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
162 ovl (a1, a2), 1);
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
163
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
164 if (tmp.length () > 0)
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
165 return tmp(0);
27095
4ae89360ca16 Default (c)transpose for old style class arrays (bug #56323).
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 26376
diff changeset
166
27098
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
167 return octave_value ();
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
168 }
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
169
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
170 //! Helper macro to define binary class operators.
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
171
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
172 #define DEF_CLASS_BINOP(opname) \
27095
4ae89360ca16 Default (c)transpose for old style class arrays (bug #56323).
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 26376
diff changeset
173 static octave_value \
27098
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
174 oct_binop_ ## opname (const octave_value& a1, const octave_value& a2) \
27095
4ae89360ca16 Default (c)transpose for old style class arrays (bug #56323).
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 26376
diff changeset
175 { \
27098
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
176 return oct_binop_default (a1, a2, #opname); \
27095
4ae89360ca16 Default (c)transpose for old style class arrays (bug #56323).
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 26376
diff changeset
177 }
4ae89360ca16 Default (c)transpose for old style class arrays (bug #56323).
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 26376
diff changeset
178
27098
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
179 DEF_CLASS_BINOP (plus) // a1 + a2
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
180 DEF_CLASS_BINOP (minus) // a1 - a2
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
181 DEF_CLASS_BINOP (mtimes) // a1 * a2
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
182 DEF_CLASS_BINOP (mrdivide) // a1 / a2
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
183 DEF_CLASS_BINOP (mpower) // a1 ^ a2
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
184 DEF_CLASS_BINOP (mldivide) // a1 \ a2
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
185 DEF_CLASS_BINOP (lt) // a1 < a2
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
186 DEF_CLASS_BINOP (le) // a1 <= a2
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
187 DEF_CLASS_BINOP (eq) // a1 <= a2
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
188 DEF_CLASS_BINOP (ge) // a1 >= a2
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
189 DEF_CLASS_BINOP (gt) // a1 > a2
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
190 DEF_CLASS_BINOP (ne) // a1 ~= a2 or a1 != a2
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
191 DEF_CLASS_BINOP (times) // a1 .* a2
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
192 DEF_CLASS_BINOP (rdivide) // a1 ./ a2
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
193 DEF_CLASS_BINOP (power) // a1 .^ a2
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
194 DEF_CLASS_BINOP (ldivide) // a1 .\ a2
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
195 DEF_CLASS_BINOP (and) // a1 & a2
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
196 DEF_CLASS_BINOP (or) // a1 | a2
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
197 #undef DEF_CLASS_BINOP
7338
5215422865e0 [project @ 2007-12-28 22:31:35 by jwe]
jwe
parents:
diff changeset
198
5215422865e0 [project @ 2007-12-28 22:31:35 by jwe]
jwe
parents:
diff changeset
199 void
24540
46440078d73b don't use singleton for octave_value_typeinfo
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
200 install_class_ops (octave::type_info& ti)
7338
5215422865e0 [project @ 2007-12-28 22:31:35 by jwe]
jwe
parents:
diff changeset
201 {
27098
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
202 ti.install_unary_class_op (octave_value::op_not, oct_unop_not);
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
203 ti.install_unary_class_op (octave_value::op_uplus, oct_unop_uplus);
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
204 ti.install_unary_class_op (octave_value::op_uminus, oct_unop_uminus);
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
205 ti.install_unary_class_op (octave_value::op_transpose, oct_unop_transpose);
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
206 ti.install_unary_class_op (octave_value::op_hermitian, oct_unop_ctranspose);
7338
5215422865e0 [project @ 2007-12-28 22:31:35 by jwe]
jwe
parents:
diff changeset
207
27098
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
208 ti.install_binary_class_op (octave_value::op_add, oct_binop_plus);
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
209 ti.install_binary_class_op (octave_value::op_sub, oct_binop_minus);
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
210 ti.install_binary_class_op (octave_value::op_mul, oct_binop_mtimes);
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
211 ti.install_binary_class_op (octave_value::op_div, oct_binop_mrdivide);
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
212 ti.install_binary_class_op (octave_value::op_pow, oct_binop_mpower);
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
213 ti.install_binary_class_op (octave_value::op_ldiv, oct_binop_mldivide);
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
214 ti.install_binary_class_op (octave_value::op_lt, oct_binop_lt);
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
215 ti.install_binary_class_op (octave_value::op_le, oct_binop_le);
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
216 ti.install_binary_class_op (octave_value::op_eq, oct_binop_eq);
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
217 ti.install_binary_class_op (octave_value::op_ge, oct_binop_ge);
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
218 ti.install_binary_class_op (octave_value::op_gt, oct_binop_gt);
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
219 ti.install_binary_class_op (octave_value::op_ne, oct_binop_ne);
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
220 ti.install_binary_class_op (octave_value::op_el_mul, oct_binop_times);
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
221 ti.install_binary_class_op (octave_value::op_el_div, oct_binop_rdivide);
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
222 ti.install_binary_class_op (octave_value::op_el_pow, oct_binop_power);
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
223 ti.install_binary_class_op (octave_value::op_el_ldiv, oct_binop_ldivide);
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
224 ti.install_binary_class_op (octave_value::op_el_and, oct_binop_and);
5fa8d1459b35 * libinterp/operators/op-class.cc: Overhaul file and document code.
Kai T. Ohlhus <k.ohlhus@gmail.com>
parents: 27095
diff changeset
225 ti.install_binary_class_op (octave_value::op_el_or, oct_binop_or);
7338
5215422865e0 [project @ 2007-12-28 22:31:35 by jwe]
jwe
parents:
diff changeset
226 }
29989
b260322f6730 move xdiv, xnorm, and xpow inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
227
b260322f6730 move xdiv, xnorm, and xpow inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
228 OCTAVE_NAMESPACE_END