annotate libinterp/operators/ops.h @ 24540:46440078d73b

don't use singleton for octave_value_typeinfo * ov-typeinfo.h, ov-typeinfo.cc (type_info): New class containing the functionaity provided by the non-static functions in the octave_value_typeinfo class. Define in octave namespace. (octave_value_typeinfo): Now a namespace containing global functions instead of a class containing all static functions. Provided for backward compatibility, so all functions are tagged as deprecated. * ops.h (INSTALL_UNOP_TI, INSTALL_NCUNOP_TI, INSTALL_BINOP_TI, INSTALL_CATOP_TI, INSTALL_ASSIGNOP_TI, INSTALL_ASSIGNANYOP_TI, INSTALL_ASSIGNCONV_TI, INSTALL_WIDENOP_TI): New macros. (install_ops): Accept reference to type_info object as an argument. * mk-ops.sh: Generate function decls and calls that pass reference to type_info object as an argument. * 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-int.h, 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): Use new _T1 macros. Update install_TYPE_ops function for each type to accept reference to type_info object as argument. * interpreter.h, interpreter.cc (interpreter::m_type_info): New member variable. (interpreter::get_type_info): New function. (interpreter::interpreter): Initialize m_type_info before m_symbol_table. Don't call install_types or install ops. That is now handled by the in type_info constructor. Don't call m_cdef_manager. That is now handled by the cdef_manager constructor. * interpreter-private.h, interpreter-private.cc (__get_type_info__): New function. Use where necessary to get reference to interpreter::m_type_info object. * ov-classdef.cc, ov-classdef.h (octave_classdef::octave_classdef): Handle all initialization here. (octave_classdef::initialize): Delete unused function. * ov.h, ov.cc (install_types): Accept reference to type_info object as argument. Pass on to individual register_type functions. * ov-base.h, ov-base.cc (DEFINE_OV_TYPEID_FUNCTIONS_AND_DATA): Update to define additional register_type functions that accepts reference to type_info object. (install_base_type_conversions): Update to use new *_TI macros.
author John W. Eaton <jwe@octave.org>
date Fri, 05 Jan 2018 18:44:53 -0500
parents 194eb4bd202b
children 6652d3823428
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
23219
3ac9f9ecfae5 maint: Update copyright dates.
John W. Eaton <jwe@octave.org>
parents: 23083
diff changeset
3 Copyright (C) 1996-2017 John W. Eaton
9601
a9b37bae1802 add a couple of missing copyright statements
Jaroslav Hajek <highegg@gmail.com>
parents: 9588
diff changeset
4 Copyright (C) 2009 VZLU Prague, a.s.
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
5
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
6 This file is part of Octave.
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
7
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 23220
diff changeset
8 Octave is free software: you can redistribute it and/or modify it
22755
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22407
diff changeset
9 under the terms of the GNU General Public License as published by
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 23220
diff changeset
10 the Free Software Foundation, either version 3 of the License, or
22755
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22407
diff changeset
11 (at your option) any later version.
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
12
22755
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22407
diff changeset
13 Octave is distributed in the hope that it will be useful, but
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22407
diff changeset
14 WITHOUT ANY WARRANTY; without even the implied warranty of
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22407
diff changeset
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3a2b891d0b33 maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents: 22407
diff changeset
16 GNU General Public License for more details.
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
17
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
18 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: 6871
diff changeset
19 along with Octave; see the file COPYING. If not, see
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 23220
diff changeset
20 <https://www.gnu.org/licenses/>.
2376
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
20791
f7084eae3318 maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents: 19697
diff changeset
24 #if ! defined (octave_ops_h)
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
25 #define octave_ops_h 1
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
26
21244
1473547f50f5 include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents: 21129
diff changeset
27 #include "octave-config.h"
1473547f50f5 include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents: 21129
diff changeset
28
4669
334a27c8f453 [project @ 2003-11-26 07:02:42 by jwe]
jwe
parents: 4550
diff changeset
29 #include "Array-util.h"
334a27c8f453 [project @ 2003-11-26 07:02:42 by jwe]
jwe
parents: 4550
diff changeset
30
24540
46440078d73b don't use singleton for octave_value_typeinfo
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
31 namespace octave
46440078d73b don't use singleton for octave_value_typeinfo
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
32 {
46440078d73b don't use singleton for octave_value_typeinfo
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
33 class type_info;
46440078d73b don't use singleton for octave_value_typeinfo
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
34 }
46440078d73b don't use singleton for octave_value_typeinfo
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
35
8366
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents: 8150
diff changeset
36 // Concatenation macros that enforce argument prescan
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
37 #define CONCAT2X(x, y) x ## y
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
38 #define CONCAT2(x, y) CONCAT2X (x, y)
8366
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents: 8150
diff changeset
39
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
40 #define CONCAT3X(x, y, z) x ## y ## z
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
41 #define CONCAT3(x, y, z) CONCAT3X (x, y, z)
8366
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents: 8150
diff changeset
42
24540
46440078d73b don't use singleton for octave_value_typeinfo
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
43 extern void install_ops (octave::type_info&);
46440078d73b don't use singleton for octave_value_typeinfo
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
44
46440078d73b don't use singleton for octave_value_typeinfo
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
45 #define INSTALL_UNOP_TI(ti, op, t, f) \
46440078d73b don't use singleton for octave_value_typeinfo
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
46 ti.install_unary_op \
46440078d73b don't use singleton for octave_value_typeinfo
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
47 (octave_value::op, t::static_type_id (), CONCAT2 (oct_unop_, f));
46440078d73b don't use singleton for octave_value_typeinfo
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
48
46440078d73b don't use singleton for octave_value_typeinfo
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
49 #define INSTALL_NCUNOP_TI(ti, op, t, f) \
46440078d73b don't use singleton for octave_value_typeinfo
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
50 ti.install_non_const_unary_op \
46440078d73b don't use singleton for octave_value_typeinfo
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
51 (octave_value::op, t::static_type_id (), CONCAT2 (oct_unop_, f));
46440078d73b don't use singleton for octave_value_typeinfo
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
52
46440078d73b don't use singleton for octave_value_typeinfo
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
53 #define INSTALL_BINOP_TI(ti, op, t1, t2, f) \
46440078d73b don't use singleton for octave_value_typeinfo
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
54 ti.install_binary_op \
46440078d73b don't use singleton for octave_value_typeinfo
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
55 (octave_value::op, t1::static_type_id (), t2::static_type_id (), \
46440078d73b don't use singleton for octave_value_typeinfo
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
56 CONCAT2 (oct_binop_, f));
46440078d73b don't use singleton for octave_value_typeinfo
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
57
46440078d73b don't use singleton for octave_value_typeinfo
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
58 #define INSTALL_CATOP_TI(ti, t1, t2, f) \
46440078d73b don't use singleton for octave_value_typeinfo
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
59 ti.install_cat_op \
46440078d73b don't use singleton for octave_value_typeinfo
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
60 (t1::static_type_id (), t2::static_type_id (), CONCAT2 (oct_catop_, f));
46440078d73b don't use singleton for octave_value_typeinfo
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
61
46440078d73b don't use singleton for octave_value_typeinfo
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
62 #define INSTALL_ASSIGNOP_TI(ti, op, t1, t2, f) \
46440078d73b don't use singleton for octave_value_typeinfo
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
63 ti.install_assign_op \
46440078d73b don't use singleton for octave_value_typeinfo
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
64 (octave_value::op, t1::static_type_id (), t2::static_type_id (), \
46440078d73b don't use singleton for octave_value_typeinfo
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
65 CONCAT2 (oct_assignop_, f));
46440078d73b don't use singleton for octave_value_typeinfo
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
66
46440078d73b don't use singleton for octave_value_typeinfo
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
67 #define INSTALL_ASSIGNANYOP_TI(ti, op, t1, f) \
46440078d73b don't use singleton for octave_value_typeinfo
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
68 ti.install_assignany_op \
46440078d73b don't use singleton for octave_value_typeinfo
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
69 (octave_value::op, t1::static_type_id (), CONCAT2 (oct_assignop_, f));
46440078d73b don't use singleton for octave_value_typeinfo
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
70
46440078d73b don't use singleton for octave_value_typeinfo
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
71 #define INSTALL_ASSIGNCONV_TI(ti, t1, t2, tr) \
46440078d73b don't use singleton for octave_value_typeinfo
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
72 ti.install_pref_assign_conv \
46440078d73b don't use singleton for octave_value_typeinfo
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
73 (t1::static_type_id (), t2::static_type_id (), tr::static_type_id ());
46440078d73b don't use singleton for octave_value_typeinfo
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
74
46440078d73b don't use singleton for octave_value_typeinfo
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
75 #define INSTALL_WIDENOP_TI(ti, t1, t2, f) \
46440078d73b don't use singleton for octave_value_typeinfo
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
76 ti.install_widening_op \
46440078d73b don't use singleton for octave_value_typeinfo
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
77 (t1::static_type_id (), t2::static_type_id (), CONCAT2 (oct_conv_, f));
46440078d73b don't use singleton for octave_value_typeinfo
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
78
46440078d73b don't use singleton for octave_value_typeinfo
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
79 // The following INSTALL_* macros are obsolete.
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
80
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
81 #define INSTALL_UNOP(op, t, f) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
82 octave_value_typeinfo::register_unary_op \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
83 (octave_value::op, t::static_type_id (), CONCAT2 (oct_unop_, f));
3203
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3195
diff changeset
84
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
85 #define INSTALL_NCUNOP(op, t, f) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
86 octave_value_typeinfo::register_non_const_unary_op \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
87 (octave_value::op, t::static_type_id (), CONCAT2 (oct_unop_, f));
3203
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3195
diff changeset
88
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
89 #define INSTALL_BINOP(op, t1, t2, f) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
90 octave_value_typeinfo::register_binary_op \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
91 (octave_value::op, t1::static_type_id (), t2::static_type_id (), \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
92 CONCAT2 (oct_binop_, f));
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
93
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
94 #define INSTALL_CATOP(t1, t2, f) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
95 octave_value_typeinfo::register_cat_op \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
96 (t1::static_type_id (), t2::static_type_id (), CONCAT2 (oct_catop_, f));
4915
c638c144d4da [project @ 2004-07-23 19:01:22 by jwe]
jwe
parents: 4901
diff changeset
97
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
98 #define INSTALL_ASSIGNOP(op, t1, t2, f) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
99 octave_value_typeinfo::register_assign_op \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
100 (octave_value::op, t1::static_type_id (), t2::static_type_id (), \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
101 CONCAT2 (oct_assignop_, f));
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
102
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
103 #define INSTALL_ASSIGNANYOP(op, t1, f) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
104 octave_value_typeinfo::register_assignany_op \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
105 (octave_value::op, t1::static_type_id (), CONCAT2 (oct_assignop_, f));
3195
7a5a5da64756 [project @ 1998-10-28 22:54:04 by jwe]
jwe
parents: 2914
diff changeset
106
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
107 #define INSTALL_ASSIGNCONV(t1, t2, tr) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
108 octave_value_typeinfo::register_pref_assign_conv \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
109 (t1::static_type_id (), t2::static_type_id (), tr::static_type_id ());
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
110
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
111 #define INSTALL_WIDENOP(t1, t2, f) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
112 octave_value_typeinfo::register_widening_op \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
113 (t1::static_type_id (), t2::static_type_id (), CONCAT2 (oct_conv_, f));
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
114
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
115 #define DEFASSIGNOP(name, t1, t2) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
116 static octave_value \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
117 CONCAT2 (oct_assignop_, name) (octave_base_value& a1, \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
118 const octave_value_list& idx, \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
119 const octave_base_value& a2)
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5533
diff changeset
120
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
121 #define DEFASSIGNOP_FN(name, t1, t2, f) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
122 static octave_value \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
123 CONCAT2 (oct_assignop_, name) (octave_base_value& a1, \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
124 const octave_value_list& idx, \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
125 const octave_base_value& a2) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
126 { \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
127 CONCAT2 (octave_, t1)& v1 = dynamic_cast<CONCAT2 (octave_, t1)&> (a1); \
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
128 const CONCAT2 (octave_, t2)& v2 = dynamic_cast<const CONCAT2 (octave_, t2)&> (a2); \
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
129 \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
130 v1.f (idx, v2.CONCAT2 (t1, _value) ()); \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
131 return octave_value (); \
2914
d6a3e3723736 [project @ 1997-04-30 20:43:31 by jwe]
jwe
parents: 2879
diff changeset
132 }
d6a3e3723736 [project @ 1997-04-30 20:43:31 by jwe]
jwe
parents: 2879
diff changeset
133
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
134 #define DEFNULLASSIGNOP_FN(name, t, f) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
135 static octave_value \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
136 CONCAT2 (oct_assignop_, name) (octave_base_value& a, \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
137 const octave_value_list& idx, \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
138 const octave_base_value&) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
139 { \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
140 CONCAT2 (octave_, t)& v = dynamic_cast<CONCAT2 (octave_, t)&> (a); \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
141 \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
142 v.f (idx); \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
143 return octave_value (); \
8150
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents: 7997
diff changeset
144 }
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents: 7997
diff changeset
145
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
146 #define DEFNDASSIGNOP_FN(name, t1, t2, e, f) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
147 static octave_value \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
148 CONCAT2 (oct_assignop_, name) (octave_base_value& a1, \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
149 const octave_value_list& idx, \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
150 const octave_base_value& a2) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
151 { \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
152 CONCAT2 (octave_, t1)& v1 = dynamic_cast<CONCAT2 (octave_, t1)&> (a1); \
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
153 const CONCAT2 (octave_, t2)& v2 = dynamic_cast<const CONCAT2 (octave_, t2)&> (a2); \
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
154 \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
155 v1.f (idx, v2.CONCAT2 (e, _value) ()); \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
156 return octave_value (); \
4686
c7ae43dfdea4 [project @ 2004-01-06 19:29:23 by jwe]
jwe
parents: 4669
diff changeset
157 }
c7ae43dfdea4 [project @ 2004-01-06 19:29:23 by jwe]
jwe
parents: 4669
diff changeset
158
9548
e5f7aee2ab8c optimize &=, |= operators
Jaroslav Hajek <highegg@gmail.com>
parents: 9546
diff changeset
159 // FIXME: the following currently don't handle index.
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
160 #define DEFNDASSIGNOP_OP(name, t1, t2, f, op) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
161 static octave_value \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
162 CONCAT2 (oct_assignop_, name) (octave_base_value& a1, \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
163 const octave_value_list& idx, \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
164 const octave_base_value& a2) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
165 { \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
166 CONCAT2 (octave_, t1)& v1 = dynamic_cast<CONCAT2 (octave_, t1)&> (a1); \
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
167 const CONCAT2 (octave_, t2)& v2 = dynamic_cast<const CONCAT2 (octave_, t2)&> (a2); \
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
168 \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
169 assert (idx.empty ()); \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
170 v1.matrix_ref () op v2.CONCAT2 (f, _value) (); \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
171 \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
172 return octave_value (); \
9546
1beb23d2b892 optimize op= in common cases
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
173 }
1beb23d2b892 optimize op= in common cases
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
174
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
175 #define DEFNDASSIGNOP_FNOP(name, t1, t2, f, fnop) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
176 static octave_value \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
177 CONCAT2 (oct_assignop_, name) (octave_base_value& a1, \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
178 const octave_value_list& idx, \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
179 const octave_base_value& a2) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
180 { \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
181 CONCAT2 (octave_, t1)& v1 = dynamic_cast<CONCAT2 (octave_, t1)&> (a1); \
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
182 const CONCAT2 (octave_, t2)& v2 = dynamic_cast<const CONCAT2 (octave_, t2)&> (a2); \
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
183 \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
184 assert (idx.empty ()); \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
185 fnop (v1.matrix_ref (), v2.CONCAT2 (f, _value) ()); \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
186 \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
187 return octave_value (); \
9548
e5f7aee2ab8c optimize &=, |= operators
Jaroslav Hajek <highegg@gmail.com>
parents: 9546
diff changeset
188 }
e5f7aee2ab8c optimize &=, |= operators
Jaroslav Hajek <highegg@gmail.com>
parents: 9546
diff changeset
189
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
190 #define DEFASSIGNANYOP_FN(name, t1, f) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
191 static octave_value \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
192 CONCAT2 (oct_assignop_, name) (octave_base_value& a1, \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
193 const octave_value_list& idx, \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
194 const octave_value& a2) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
195 { \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
196 CONCAT2 (octave_, t1)& v1 = dynamic_cast<CONCAT2 (octave_, t1)&> (a1); \
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
197 \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
198 v1.f (idx, a2); \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
199 return octave_value (); \
3195
7a5a5da64756 [project @ 1998-10-28 22:54:04 by jwe]
jwe
parents: 2914
diff changeset
200 }
7a5a5da64756 [project @ 1998-10-28 22:54:04 by jwe]
jwe
parents: 2914
diff changeset
201
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
202 #define CONVDECL(name) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
203 static octave_base_value * \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
204 CONCAT2 (oct_conv_, name) (const octave_base_value& a)
3203
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3195
diff changeset
205
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
206 #define DEFCONV(name, a_dummy, b_dummy) \
2914
d6a3e3723736 [project @ 1997-04-30 20:43:31 by jwe]
jwe
parents: 2879
diff changeset
207 CONVDECL (name)
d6a3e3723736 [project @ 1997-04-30 20:43:31 by jwe]
jwe
parents: 2879
diff changeset
208
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
209 #define DEFUNOPX(name, t) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
210 static octave_value \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
211 CONCAT2 (oct_unop_, name) (const octave_base_value&)
21647
66cae7a6dc47 eliminate some macros for operator definitions
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
212
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
213 #define DEFUNOP(name, t) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
214 static octave_value \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
215 CONCAT2 (oct_unop_, name) (const octave_base_value& a)
3203
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3195
diff changeset
216
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
217 #define DEFUNOP_OP(name, t, op) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
218 static octave_value \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
219 CONCAT2 (oct_unop_, name) (const octave_base_value& a) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
220 { \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
221 const CONCAT2 (octave_, t)& v = dynamic_cast<const CONCAT2 (octave_, t)&> (a); \
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
222 return octave_value (op v.CONCAT2 (t, _value) ()); \
3203
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3195
diff changeset
223 }
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3195
diff changeset
224
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
225 #define DEFNDUNOP_OP(name, t, e, op) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
226 static octave_value \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
227 CONCAT2 (oct_unop_, name) (const octave_base_value& a) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
228 { \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
229 const CONCAT2 (octave_, t)& v = dynamic_cast<const CONCAT2 (octave_, t)&> (a); \
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
230 return octave_value (op v.CONCAT2 (e, _value) ()); \
4543
79df15d4470c [project @ 2003-10-18 03:53:52 by jwe]
jwe
parents: 3203
diff changeset
231 }
79df15d4470c [project @ 2003-10-18 03:53:52 by jwe]
jwe
parents: 3203
diff changeset
232
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
233 // FIXME: in some cases, the constructor isn't necessary.
3203
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3195
diff changeset
234
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
235 #define DEFUNOP_FN(name, t, f) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
236 static octave_value \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
237 CONCAT2 (oct_unop_, name) (const octave_base_value& a) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
238 { \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
239 const CONCAT2 (octave_, t)& v = dynamic_cast<const CONCAT2 (octave_, t)&> (a); \
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
240 return octave_value (f (v.CONCAT2 (t, _value) ())); \
3203
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3195
diff changeset
241 }
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3195
diff changeset
242
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
243 #define DEFNDUNOP_FN(name, t, e, f) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
244 static octave_value \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
245 CONCAT2 (oct_unop_, name) (const octave_base_value& a) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
246 { \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
247 const CONCAT2 (octave_, t)& v = dynamic_cast<const CONCAT2 (octave_, t)&> (a); \
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
248 return octave_value (f (v.CONCAT2 (e, _value) ())); \
4543
79df15d4470c [project @ 2003-10-18 03:53:52 by jwe]
jwe
parents: 3203
diff changeset
249 }
79df15d4470c [project @ 2003-10-18 03:53:52 by jwe]
jwe
parents: 3203
diff changeset
250
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
251 #define DEFNCUNOP_METHOD(name, t, method) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
252 static void \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
253 CONCAT2 (oct_unop_, name) (octave_base_value& a) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
254 { \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
255 CONCAT2 (octave_, t)& v = dynamic_cast<CONCAT2 (octave_, t)&> (a); \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
256 v.method (); \
3203
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3195
diff changeset
257 }
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3195
diff changeset
258
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
259 #define DEFBINOPX(name, t1, t2) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
260 static octave_value \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
261 CONCAT2 (oct_binop_, name) (const octave_base_value&, \
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
262 const octave_base_value&)
21647
66cae7a6dc47 eliminate some macros for operator definitions
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
263
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
264 #define DEFBINOP(name, t1, t2) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
265 static octave_value \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
266 CONCAT2 (oct_binop_, name) (const octave_base_value& a1, \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
267 const octave_base_value& a2)
2914
d6a3e3723736 [project @ 1997-04-30 20:43:31 by jwe]
jwe
parents: 2879
diff changeset
268
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
269 #define DEFBINOP_OP(name, t1, t2, op) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
270 static octave_value \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
271 CONCAT2 (oct_binop_, name) (const octave_base_value& a1, \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
272 const octave_base_value& a2) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
273 { \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
274 const CONCAT2 (octave_, t1)& v1 = dynamic_cast<const CONCAT2 (octave_, t1)&> (a1); \
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
275 const CONCAT2 (octave_, t2)& v2 = dynamic_cast<const CONCAT2 (octave_, t2)&> (a2); \
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
276 \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
277 return octave_value \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
278 (v1.CONCAT2 (t1, _value) () op v2.CONCAT2 (t2, _value) ()); \
2914
d6a3e3723736 [project @ 1997-04-30 20:43:31 by jwe]
jwe
parents: 2879
diff changeset
279 }
d6a3e3723736 [project @ 1997-04-30 20:43:31 by jwe]
jwe
parents: 2879
diff changeset
280
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
281 #define DEFCMPLXCMPOP_OP(name, t1, t2, op) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
282 static octave_value \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
283 CONCAT2 (oct_binop_, name) (const octave_base_value& a1, \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
284 const octave_base_value& a2) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
285 { \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
286 const CONCAT2 (octave_, t1)& v1 = dynamic_cast<const CONCAT2 (octave_, t1)&> (a1); \
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
287 const CONCAT2 (octave_, t2)& v2 = dynamic_cast<const CONCAT2 (octave_, t2)&> (a2); \
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
288 \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
289 warn_complex_cmp (); \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
290 \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
291 return octave_value \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
292 (v1.CONCAT2 (t1, _value) () op v2.CONCAT2 (t2, _value) ()); \
9588
319e2ab9b8ae warn about the complex comparison ops
Jaroslav Hajek <highegg@gmail.com>
parents: 9587
diff changeset
293 }
319e2ab9b8ae warn about the complex comparison ops
Jaroslav Hajek <highegg@gmail.com>
parents: 9587
diff changeset
294
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
295 #define DEFSCALARBOOLOP_OP(name, t1, t2, op) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
296 static octave_value \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
297 CONCAT2 (oct_binop_, name) (const octave_base_value& a1, \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
298 const octave_base_value& a2) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
299 { \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
300 const CONCAT2 (octave_, t1)& v1 = dynamic_cast<const CONCAT2 (octave_, t1)&> (a1); \
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
301 const CONCAT2 (octave_, t2)& v2 = dynamic_cast<const CONCAT2 (octave_, t2)&> (a2); \
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
302 \
21782
2aef506f3fec use namespace for lo-mappers.h functions
John W. Eaton <jwe@octave.org>
parents: 21649
diff changeset
303 if (octave::math::isnan (v1.CONCAT2 (t1, _value) ()) || octave::math::isnan (v2.CONCAT2 (t2, _value) ())) \
22327
d0562b3159c7 move more classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 22323
diff changeset
304 octave::err_nan_to_logical_conversion (); \
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
305 \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
306 return octave_value \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
307 (v1.CONCAT2 (t1, _value) () op v2.CONCAT2 (t2, _value) ()); \
7922
935be827eaf8 error for NaN values in & and | expressions
John W. Eaton <jwe@octave.org>
parents: 7017
diff changeset
308 }
935be827eaf8 error for NaN values in & and | expressions
John W. Eaton <jwe@octave.org>
parents: 7017
diff changeset
309
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
310 #define DEFNDBINOP_OP(name, t1, t2, e1, e2, op) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
311 static octave_value \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
312 CONCAT2 (oct_binop_, name) (const octave_base_value& a1, \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
313 const octave_base_value& a2) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
314 { \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
315 const CONCAT2 (octave_, t1)& v1 = dynamic_cast<const CONCAT2 (octave_, t1)&> (a1); \
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
316 const CONCAT2 (octave_, t2)& v2 = dynamic_cast<const CONCAT2 (octave_, t2)&> (a2); \
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
317 \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
318 return octave_value \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
319 (v1.CONCAT2 (e1, _value) () op v2.CONCAT2 (e2, _value) ()); \
4543
79df15d4470c [project @ 2003-10-18 03:53:52 by jwe]
jwe
parents: 3203
diff changeset
320 }
79df15d4470c [project @ 2003-10-18 03:53:52 by jwe]
jwe
parents: 3203
diff changeset
321
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
322 // FIXME: in some cases, the constructor isn't necessary.
2914
d6a3e3723736 [project @ 1997-04-30 20:43:31 by jwe]
jwe
parents: 2879
diff changeset
323
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
324 #define DEFBINOP_FN(name, t1, t2, f) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
325 static octave_value \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
326 CONCAT2 (oct_binop_, name) (const octave_base_value& a1, \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
327 const octave_base_value& a2) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
328 { \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
329 const CONCAT2 (octave_, t1)& v1 = dynamic_cast<const CONCAT2 (octave_, t1)&> (a1); \
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
330 const CONCAT2 (octave_, t2)& v2 = dynamic_cast<const CONCAT2 (octave_, t2)&> (a2); \
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
331 \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
332 return octave_value (f (v1.CONCAT2 (t1, _value) (), v2.CONCAT2 (t2, _value) ())); \
2914
d6a3e3723736 [project @ 1997-04-30 20:43:31 by jwe]
jwe
parents: 2879
diff changeset
333 }
d6a3e3723736 [project @ 1997-04-30 20:43:31 by jwe]
jwe
parents: 2879
diff changeset
334
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
335 #define DEFNDBINOP_FN(name, t1, t2, e1, e2, f) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
336 static octave_value \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
337 CONCAT2 (oct_binop_, name) (const octave_base_value& a1, \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
338 const octave_base_value& a2) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
339 { \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
340 const CONCAT2 (octave_, t1)& v1 = dynamic_cast<const CONCAT2 (octave_, t1)&> (a1); \
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
341 const CONCAT2 (octave_, t2)& v2 = dynamic_cast<const CONCAT2 (octave_, t2)&> (a2); \
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
342 \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
343 return octave_value (f (v1.CONCAT2 (e1, _value) (), v2.CONCAT2 (e2, _value) ())); \
4543
79df15d4470c [project @ 2003-10-18 03:53:52 by jwe]
jwe
parents: 3203
diff changeset
344 }
79df15d4470c [project @ 2003-10-18 03:53:52 by jwe]
jwe
parents: 3203
diff changeset
345
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
346 #define DEFNDCMPLXCMPOP_FN(name, t1, t2, e1, e2, f) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
347 static octave_value \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
348 CONCAT2 (oct_binop_, name) (const octave_base_value& a1, \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
349 const octave_base_value& a2) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
350 { \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
351 const CONCAT2 (octave_, t1)& v1 = dynamic_cast<const CONCAT2 (octave_, t1)&> (a1); \
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
352 const CONCAT2 (octave_, t2)& v2 = dynamic_cast<const CONCAT2 (octave_, t2)&> (a2); \
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
353 \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
354 return octave_value (f (v1.CONCAT2 (e1, _value) (), v2.CONCAT2 (e2, _value) ())); \
9588
319e2ab9b8ae warn about the complex comparison ops
Jaroslav Hajek <highegg@gmail.com>
parents: 9587
diff changeset
355 }
319e2ab9b8ae warn about the complex comparison ops
Jaroslav Hajek <highegg@gmail.com>
parents: 9587
diff changeset
356
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
357 #define DEFCATOPX(name, t1, t2) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
358 static octave_value \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
359 CONCAT2 (oct_catop_, name) (octave_base_value&, const octave_base_value&, \
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
360 const Array<octave_idx_type>& ra_idx)
21647
66cae7a6dc47 eliminate some macros for operator definitions
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
361
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
362 #define DEFCATOP(name, t1, t2) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
363 static octave_value \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
364 CONCAT2 (oct_catop_, name) (octave_base_value& a1, \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
365 const octave_base_value& a2, \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
366 const Array<octave_idx_type>& ra_idx)
4915
c638c144d4da [project @ 2004-07-23 19:01:22 by jwe]
jwe
parents: 4901
diff changeset
367
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
368 // FIXME: in some cases, the constructor isn't necessary.
4915
c638c144d4da [project @ 2004-07-23 19:01:22 by jwe]
jwe
parents: 4901
diff changeset
369
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
370 #define DEFCATOP_FN(name, t1, t2, f) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
371 static octave_value \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
372 CONCAT2 (oct_catop_, name) (octave_base_value& a1, \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
373 const octave_base_value& a2, \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
374 const Array<octave_idx_type>& ra_idx) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
375 { \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
376 CONCAT2 (octave_, t1)& v1 = dynamic_cast<CONCAT2 (octave_, t1)&> (a1); \
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
377 const CONCAT2 (octave_, t2)& v2 = dynamic_cast<const CONCAT2 (octave_, t2)&> (a2); \
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
378 \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
379 return octave_value (v1.CONCAT2 (t1, _value) () . f (v2.CONCAT2 (t2, _value) (), ra_idx)); \
4915
c638c144d4da [project @ 2004-07-23 19:01:22 by jwe]
jwe
parents: 4901
diff changeset
380 }
c638c144d4da [project @ 2004-07-23 19:01:22 by jwe]
jwe
parents: 4901
diff changeset
381
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
382 #define DEFNDCATOP_FN(name, t1, t2, e1, e2, f) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
383 static octave_value \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
384 CONCAT2 (oct_catop_, name) (octave_base_value& a1, \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
385 const octave_base_value& a2, \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
386 const Array<octave_idx_type>& ra_idx) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
387 { \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
388 CONCAT2 (octave_, t1)& v1 = dynamic_cast<CONCAT2 (octave_, t1)&> (a1); \
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
389 const CONCAT2 (octave_, t2)& v2 = dynamic_cast<const CONCAT2 (octave_, t2)&> (a2); \
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
390 \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
391 return octave_value (v1.CONCAT2 (e1, _value) () . f (v2.CONCAT2 (e2, _value) (), ra_idx)); \
5533
667ad2becb63 [project @ 2005-11-10 21:40:48 by jwe]
jwe
parents: 5307
diff changeset
392 }
667ad2becb63 [project @ 2005-11-10 21:40:48 by jwe]
jwe
parents: 5307
diff changeset
393
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
394 #define DEFNDCHARCATOP_FN(name, t1, t2, f) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
395 static octave_value \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
396 CONCAT2 (oct_catop_, name) (octave_base_value& a1, \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
397 const octave_base_value& a2, \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
398 const Array<octave_idx_type>& ra_idx) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
399 { \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
400 CONCAT2 (octave_, t1)& v1 = dynamic_cast<CONCAT2 (octave_, t1)&> (a1); \
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
401 const CONCAT2 (octave_, t2)& v2 = dynamic_cast<const CONCAT2 (octave_, t2)&> (a2); \
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
402 \
5533
667ad2becb63 [project @ 2005-11-10 21:40:48 by jwe]
jwe
parents: 5307
diff changeset
403 return octave_value (v1.char_array_value () . f (v2.char_array_value (), ra_idx), \
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
404 ((a1.is_sq_string () || a2.is_sq_string ()) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
405 ? '\'' : '"')); \
4915
c638c144d4da [project @ 2004-07-23 19:01:22 by jwe]
jwe
parents: 4901
diff changeset
406 }
c638c144d4da [project @ 2004-07-23 19:01:22 by jwe]
jwe
parents: 4901
diff changeset
407
5075
b6a9f78f60e9 [project @ 2004-11-10 03:13:26 by jwe]
jwe
parents: 5073
diff changeset
408 // For compatibility, the second arg is always converted to the type
b6a9f78f60e9 [project @ 2004-11-10 03:13:26 by jwe]
jwe
parents: 5073
diff changeset
409 // of the first. Hmm.
b6a9f78f60e9 [project @ 2004-11-10 03:13:26 by jwe]
jwe
parents: 5073
diff changeset
410
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
411 #define DEFNDCATOP_FN2(name, t1, t2, tc1, tc2, e1, e2, f) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
412 static octave_value \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
413 CONCAT2 (oct_catop_, name) (octave_base_value& a1, \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
414 const octave_base_value& a2, \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
415 const Array<octave_idx_type>& ra_idx) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
416 { \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
417 CONCAT2 (octave_, t1)& v1 = dynamic_cast<CONCAT2 (octave_, t1)&> (a1); \
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
418 const CONCAT2 (octave_, t2)& v2 = dynamic_cast<const CONCAT2 (octave_, t2)&> (a2); \
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
419 \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
420 return octave_value (tc1 (v1.CONCAT2 (e1, _value) ()) . f (tc2 (v2.CONCAT2 (e2, _value) ()), ra_idx)); \
5075
b6a9f78f60e9 [project @ 2004-11-10 03:13:26 by jwe]
jwe
parents: 5073
diff changeset
421 }
b6a9f78f60e9 [project @ 2004-11-10 03:13:26 by jwe]
jwe
parents: 5073
diff changeset
422
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
423 #endif