annotate libinterp/operators/ops.h @ 22197:e43d83253e28

refill multi-line macro definitions Use the Emacs C++ mode style for line continuation markers in multi-line macro definitions. * make_int.cc, __dsearchn__.cc, __magick_read__.cc, besselj.cc, bitfcns.cc, bsxfun.cc, cellfun.cc, data.cc, defun-dld.h, defun-int.h, defun.h, det.cc, error.h, find.cc, gcd.cc, graphics.cc, interpreter.h, jit-ir.h, jit-typeinfo.h, lookup.cc, ls-mat5.cc, max.cc, mexproto.h, mxarray.in.h, oct-stream.cc, ordschur.cc, pr-output.cc, profiler.h, psi.cc, regexp.cc, sparse-xdiv.cc, sparse-xpow.cc, tril.cc, txt-eng.h, utils.cc, variables.cc, variables.h, xdiv.cc, xpow.cc, __glpk__.cc, ov-base.cc, ov-base.h, ov-cell.cc, ov-ch-mat.cc, ov-classdef.cc, ov-complex.cc, ov-cx-mat.cc, ov-cx-sparse.cc, ov-float.cc, ov-float.h, ov-flt-complex.cc, ov-flt-cx-mat.cc, ov-flt-re-mat.cc, ov-int-traits.h, ov-lazy-idx.h, ov-perm.cc, ov-re-mat.cc, ov-re-sparse.cc, ov-scalar.cc, ov-scalar.h, ov-str-mat.cc, ov-type-conv.h, ov.cc, ov.h, op-class.cc, op-int-conv.cc, op-int.h, op-str-str.cc, ops.h, lex.ll, Array.cc, CMatrix.cc, CSparse.cc, MArray.cc, MArray.h, MDiagArray2.cc, MDiagArray2.h, MSparse.h, Sparse.cc, dMatrix.cc, dSparse.cc, fCMatrix.cc, fMatrix.cc, idx-vector.cc, f77-fcn.h, quit.h, bsxfun-decl.h, bsxfun-defs.cc, lo-specfun.cc, oct-convn.cc, oct-convn.h, oct-norm.cc, oct-norm.h, oct-rand.cc, Sparse-op-decls.h, Sparse-op-defs.h, mx-inlines.cc, mx-op-decl.h, mx-op-defs.h, mach-info.cc, oct-group.cc, oct-passwd.cc, oct-syscalls.cc, oct-time.cc, data-conv.cc, kpse.cc, lo-ieee.h, lo-macros.h, oct-cmplx.h, oct-glob.cc, oct-inttypes.cc, oct-inttypes.h, oct-locbuf.h, oct-sparse.h, url-transfer.cc, oct-conf-post.in.h, shared-fcns.h: Refill macro definitions.
author John W. Eaton <jwe@octave.org>
date Mon, 01 Aug 2016 12:40:18 -0400
parents 2aef506f3fec
children 8b18f46f6427
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
1 /*
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
2
19697
4197fc428c7d maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents: 17787
diff changeset
3 Copyright (C) 1996-2015 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
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
8 Octave is free software; you can redistribute it and/or modify it
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
9 under the terms of the GNU General Public License as published by the
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6871
diff changeset
10 Free Software Foundation; either version 3 of the License, or (at your
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6871
diff changeset
11 option) any later version.
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
12
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
13 Octave is distributed in the hope that it will be useful, but WITHOUT
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
16 for more details.
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
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6871
diff changeset
20 <http://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
8366
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents: 8150
diff changeset
31 // 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
32 #define CONCAT2X(x, y) x ## y
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
33 #define CONCAT2(x, y) CONCAT2X (x, y)
8366
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents: 8150
diff changeset
34
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
35 #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
36 #define CONCAT3(x, y, z) CONCAT3X (x, y, z)
8366
8b1a2555c4e2 implement diagonal matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents: 8150
diff changeset
37
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
38 extern void install_ops (void);
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
39
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
40 #define INSTALL_UNOP(op, t, f) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
41 octave_value_typeinfo::register_unary_op \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
42 (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
43
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
44 #define INSTALL_NCUNOP(op, t, f) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
45 octave_value_typeinfo::register_non_const_unary_op \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
46 (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
47
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
48 #define INSTALL_BINOP(op, t1, t2, f) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
49 octave_value_typeinfo::register_binary_op \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
50 (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
51 CONCAT2 (oct_binop_, f));
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
52
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
53 #define INSTALL_CATOP(t1, t2, f) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
54 octave_value_typeinfo::register_cat_op \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
55 (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
56
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
57 #define INSTALL_ASSIGNOP(op, t1, t2, f) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
58 octave_value_typeinfo::register_assign_op \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
59 (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
60 CONCAT2 (oct_assignop_, f));
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
61
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
62 #define INSTALL_ASSIGNANYOP(op, t1, f) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
63 octave_value_typeinfo::register_assignany_op \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
64 (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
65
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
66 #define INSTALL_ASSIGNCONV(t1, t2, tr) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
67 octave_value_typeinfo::register_pref_assign_conv \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
68 (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
69
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
70 #define INSTALL_CONVOP(t1, t2, f) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
71 octave_value_typeinfo::register_type_conv_op \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
72 (t1::static_type_id (), t2::static_type_id (), CONCAT2 (oct_conv_, f));
4901
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents: 4686
diff changeset
73
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
74 #define INSTALL_WIDENOP(t1, t2, f) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
75 octave_value_typeinfo::register_widening_op \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
76 (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
77
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
78 #define DEFASSIGNOP(name, t1, t2) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
79 static octave_value \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
80 CONCAT2 (oct_assignop_, name) (octave_base_value& a1, \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
81 const octave_value_list& idx, \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
82 const octave_base_value& a2)
5759
ce79d238f142 [project @ 2006-04-13 13:04:32 by jwe]
jwe
parents: 5533
diff changeset
83
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
84 #define DEFASSIGNOP_FN(name, t1, t2, f) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
85 static octave_value \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
86 CONCAT2 (oct_assignop_, name) (octave_base_value& a1, \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
87 const octave_value_list& idx, \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
88 const octave_base_value& a2) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
89 { \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
90 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
91 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
92 \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
93 v1.f (idx, v2.CONCAT2 (t1, _value) ()); \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
94 return octave_value (); \
2914
d6a3e3723736 [project @ 1997-04-30 20:43:31 by jwe]
jwe
parents: 2879
diff changeset
95 }
d6a3e3723736 [project @ 1997-04-30 20:43:31 by jwe]
jwe
parents: 2879
diff changeset
96
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
97 #define DEFNULLASSIGNOP_FN(name, t, f) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
98 static octave_value \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
99 CONCAT2 (oct_assignop_, name) (octave_base_value& a, \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
100 const octave_value_list& idx, \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
101 const octave_base_value&) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
102 { \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
103 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
104 \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
105 v.f (idx); \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
106 return octave_value (); \
8150
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents: 7997
diff changeset
107 }
283989f2da9b make null assignment matlab compatible
Jaroslav Hajek <highegg@gmail.com>
parents: 7997
diff changeset
108
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
109 #define DEFNDASSIGNOP_FN(name, t1, t2, e, f) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
110 static octave_value \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
111 CONCAT2 (oct_assignop_, name) (octave_base_value& a1, \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
112 const octave_value_list& idx, \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
113 const octave_base_value& a2) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
114 { \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
115 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
116 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
117 \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
118 v1.f (idx, v2.CONCAT2 (e, _value) ()); \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
119 return octave_value (); \
4686
c7ae43dfdea4 [project @ 2004-01-06 19:29:23 by jwe]
jwe
parents: 4669
diff changeset
120 }
c7ae43dfdea4 [project @ 2004-01-06 19:29:23 by jwe]
jwe
parents: 4669
diff changeset
121
9548
e5f7aee2ab8c optimize &=, |= operators
Jaroslav Hajek <highegg@gmail.com>
parents: 9546
diff changeset
122 // 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
123 #define DEFNDASSIGNOP_OP(name, t1, t2, f, op) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
124 static octave_value \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
125 CONCAT2 (oct_assignop_, name) (octave_base_value& a1, \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
126 const octave_value_list& idx, \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
127 const octave_base_value& a2) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
128 { \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
129 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
130 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
131 \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
132 assert (idx.empty ()); \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
133 v1.matrix_ref () op v2.CONCAT2 (f, _value) (); \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
134 \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
135 return octave_value (); \
9546
1beb23d2b892 optimize op= in common cases
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
136 }
1beb23d2b892 optimize op= in common cases
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
137
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
138 #define DEFNDASSIGNOP_FNOP(name, t1, t2, f, fnop) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
139 static octave_value \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
140 CONCAT2 (oct_assignop_, name) (octave_base_value& a1, \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
141 const octave_value_list& idx, \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
142 const octave_base_value& a2) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
143 { \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
144 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
145 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
146 \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
147 assert (idx.empty ()); \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
148 fnop (v1.matrix_ref (), v2.CONCAT2 (f, _value) ()); \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
149 \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
150 return octave_value (); \
9548
e5f7aee2ab8c optimize &=, |= operators
Jaroslav Hajek <highegg@gmail.com>
parents: 9546
diff changeset
151 }
e5f7aee2ab8c optimize &=, |= operators
Jaroslav Hajek <highegg@gmail.com>
parents: 9546
diff changeset
152
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
153 #define DEFASSIGNANYOP_FN(name, t1, f) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
154 static octave_value \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
155 CONCAT2 (oct_assignop_, name) (octave_base_value& a1, \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
156 const octave_value_list& idx, \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
157 const octave_value& a2) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
158 { \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
159 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
160 \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
161 v1.f (idx, a2); \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
162 return octave_value (); \
3195
7a5a5da64756 [project @ 1998-10-28 22:54:04 by jwe]
jwe
parents: 2914
diff changeset
163 }
7a5a5da64756 [project @ 1998-10-28 22:54:04 by jwe]
jwe
parents: 2914
diff changeset
164
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
165 #define CONVDECL(name) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
166 static octave_base_value * \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
167 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
168
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
169 #define CONVDECLX(name) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
170 static octave_base_value * \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
171 CONCAT2 (oct_conv_, name) (const octave_base_value&)
2914
d6a3e3723736 [project @ 1997-04-30 20:43:31 by jwe]
jwe
parents: 2879
diff changeset
172
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
173 #define DEFCONV(name, a_dummy, b_dummy) \
2914
d6a3e3723736 [project @ 1997-04-30 20:43:31 by jwe]
jwe
parents: 2879
diff changeset
174 CONVDECL (name)
d6a3e3723736 [project @ 1997-04-30 20:43:31 by jwe]
jwe
parents: 2879
diff changeset
175
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
176 #define DEFCONVFNX(name, tfrom, ovtto, tto, e) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
177 CONVDECL (name) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
178 { \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
179 const CONCAT2 (octave_, tfrom)& v = dynamic_cast<const CONCAT2 (octave_, tfrom)&> (a); \
22197
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 return new CONCAT2 (octave_, ovtto) (CONCAT2 (tto, NDArray) (v.CONCAT2 (e, array_value) ())); \
4901
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents: 4686
diff changeset
182 }
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents: 4686
diff changeset
183
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
184 #define DEFCONVFNX2(name, tfrom, ovtto, e) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
185 CONVDECL (name) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
186 { \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
187 const CONCAT2 (octave_, tfrom)& v = dynamic_cast<const CONCAT2 (octave_, tfrom)&> (a); \
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
188 \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
189 return new CONCAT2 (octave_, ovtto) (v.CONCAT2 (e, array_value) ()); \
7997
2b8952e133c9 implement checked conversions between integers
Jaroslav Hajek <highegg@gmail.com>
parents: 7922
diff changeset
190 }
2b8952e133c9 implement checked conversions between integers
Jaroslav Hajek <highegg@gmail.com>
parents: 7922
diff changeset
191
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
192 #define DEFDBLCONVFN(name, ovtfrom, e) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
193 CONVDECL (name) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
194 { \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
195 const CONCAT2 (octave_, ovtfrom)& v = dynamic_cast<const CONCAT2 (octave_, ovtfrom)&> (a); \
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
196 \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
197 return new octave_matrix (NDArray (v.CONCAT2 (e, _value) ())); \
4901
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents: 4686
diff changeset
198 }
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents: 4686
diff changeset
199
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
200 #define DEFFLTCONVFN(name, ovtfrom, e) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
201 CONVDECL (name) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
202 { \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
203 const CONCAT2 (octave_, ovtfrom)& v = dynamic_cast<const CONCAT2 (octave_, ovtfrom)&> (a); \
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
204 \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
205 return new octave_float_matrix (FloatNDArray (v.CONCAT2 (e, _value) ())); \
8852
86088b49a6d7 single conversions
John W. Eaton <jwe@octave.org>
parents: 8366
diff changeset
206 }
86088b49a6d7 single conversions
John W. Eaton <jwe@octave.org>
parents: 8366
diff changeset
207
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
208 #define DEFSTRINTCONVFN(name, tto) \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
209 DEFCONVFNX(name, char_matrix_str, CONCAT2 (tto, _matrix), tto, char_)
5032
3361e0846469 [project @ 2004-09-24 03:56:41 by jwe]
jwe
parents: 4915
diff changeset
210
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
211 #define DEFSTRDBLCONVFN(name, tfrom) \
5992
4289ed95dde8 [project @ 2006-09-15 20:29:18 by jwe]
jwe
parents: 5775
diff changeset
212 DEFCONVFNX(name, tfrom, matrix, , char_)
5032
3361e0846469 [project @ 2004-09-24 03:56:41 by jwe]
jwe
parents: 4915
diff changeset
213
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
214 #define DEFSTRFLTCONVFN(name, tfrom) \
8852
86088b49a6d7 single conversions
John W. Eaton <jwe@octave.org>
parents: 8366
diff changeset
215 DEFCONVFNX(name, tfrom, float_matrix, Float, char_)
86088b49a6d7 single conversions
John W. Eaton <jwe@octave.org>
parents: 8366
diff changeset
216
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
217 #define DEFCONVFN(name, tfrom, tto) \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
218 DEFCONVFNX2 (name, tfrom, CONCAT2 (tto, _matrix), CONCAT2 (tto, _))
4901
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents: 4686
diff changeset
219
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
220 #define DEFCONVFN2(name, tfrom, sm, tto) \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
221 DEFCONVFNX2 (name, CONCAT3 (tfrom, _, sm), CONCAT2 (tto, _matrix), CONCAT2 (tto, _))
4901
35bfb4e0b96b [project @ 2004-06-14 18:33:02 by jwe]
jwe
parents: 4686
diff changeset
222
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
223 #define DEFUNOPX(name, t) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
224 static octave_value \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
225 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
226
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
227 #define DEFUNOP(name, t) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
228 static octave_value \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
229 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
230
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
231 #define DEFUNOP_OP(name, t, op) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
232 static octave_value \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
233 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
234 { \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
235 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
236 return octave_value (op v.CONCAT2 (t, _value) ()); \
3203
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3195
diff changeset
237 }
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3195
diff changeset
238
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
239 #define DEFNDUNOP_OP(name, t, e, op) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
240 static octave_value \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
241 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
242 { \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
243 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
244 return octave_value (op v.CONCAT2 (e, _value) ()); \
4543
79df15d4470c [project @ 2003-10-18 03:53:52 by jwe]
jwe
parents: 3203
diff changeset
245 }
79df15d4470c [project @ 2003-10-18 03:53:52 by jwe]
jwe
parents: 3203
diff changeset
246
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
247 // 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
248
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
249 #define DEFUNOP_FN(name, t, f) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
250 static octave_value \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
251 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
252 { \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
253 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
254 return octave_value (f (v.CONCAT2 (t, _value) ())); \
3203
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3195
diff changeset
255 }
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3195
diff changeset
256
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
257 #define DEFNDUNOP_FN(name, t, e, f) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
258 static octave_value \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
259 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
260 { \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
261 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
262 return octave_value (f (v.CONCAT2 (e, _value) ())); \
4543
79df15d4470c [project @ 2003-10-18 03:53:52 by jwe]
jwe
parents: 3203
diff changeset
263 }
79df15d4470c [project @ 2003-10-18 03:53:52 by jwe]
jwe
parents: 3203
diff changeset
264
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
265 #define DEFNCUNOP_METHOD(name, t, method) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
266 static void \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
267 CONCAT2 (oct_unop_, name) (octave_base_value& a) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
268 { \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
269 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
270 v.method (); \
3203
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3195
diff changeset
271 }
bc61b0e8d60e [project @ 1998-10-30 20:26:27 by jwe]
jwe
parents: 3195
diff changeset
272
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
273 #define DEFBINOPX(name, t1, t2) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
274 static octave_value \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
275 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
276 const octave_base_value&)
21647
66cae7a6dc47 eliminate some macros for operator definitions
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
277
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
278 #define DEFBINOP(name, t1, t2) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
279 static octave_value \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
280 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
281 const octave_base_value& a2)
2914
d6a3e3723736 [project @ 1997-04-30 20:43:31 by jwe]
jwe
parents: 2879
diff changeset
282
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
283 #define DEFBINOP_OP(name, t1, t2, op) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
284 static octave_value \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
285 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
286 const octave_base_value& a2) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
287 { \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
288 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
289 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
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) ()); \
2914
d6a3e3723736 [project @ 1997-04-30 20:43:31 by jwe]
jwe
parents: 2879
diff changeset
293 }
d6a3e3723736 [project @ 1997-04-30 20:43:31 by jwe]
jwe
parents: 2879
diff changeset
294
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
295 #define DEFCMPLXCMPOP_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 \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
303 warn_complex_cmp (); \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
304 \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
305 return octave_value \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
306 (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
307 }
319e2ab9b8ae warn about the complex comparison ops
Jaroslav Hajek <highegg@gmail.com>
parents: 9587
diff changeset
308
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
309 #define DEFSCALARBOOLOP_OP(name, t1, t2, op) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
310 static octave_value \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
311 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
312 const octave_base_value& a2) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
313 { \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
314 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
315 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
316 \
21782
2aef506f3fec use namespace for lo-mappers.h functions
John W. Eaton <jwe@octave.org>
parents: 21649
diff changeset
317 if (octave::math::isnan (v1.CONCAT2 (t1, _value) ()) || octave::math::isnan (v2.CONCAT2 (t2, _value) ())) \
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
318 err_nan_to_logical_conversion (); \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
319 \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
320 return octave_value \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
321 (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
322 }
935be827eaf8 error for NaN values in & and | expressions
John W. Eaton <jwe@octave.org>
parents: 7017
diff changeset
323
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
324 #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
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 \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
332 return octave_value \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
333 (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
334 }
79df15d4470c [project @ 2003-10-18 03:53:52 by jwe]
jwe
parents: 3203
diff changeset
335
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
336 // 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
337
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
338 #define DEFBINOP_FN(name, t1, t2, f) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
339 static octave_value \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
340 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
341 const octave_base_value& a2) \
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 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
344 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
345 \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
346 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
347 }
d6a3e3723736 [project @ 1997-04-30 20:43:31 by jwe]
jwe
parents: 2879
diff changeset
348
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
349 #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
350 static octave_value \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
351 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
352 const octave_base_value& a2) \
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 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
355 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
356 \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
357 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
358 }
79df15d4470c [project @ 2003-10-18 03:53:52 by jwe]
jwe
parents: 3203
diff changeset
359
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
360 #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
361 static octave_value \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
362 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
363 const octave_base_value& a2) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
364 { \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
365 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
366 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
367 \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
368 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
369 }
319e2ab9b8ae warn about the complex comparison ops
Jaroslav Hajek <highegg@gmail.com>
parents: 9587
diff changeset
370
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
371 #define DEFCATOPX(name, t1, t2) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
372 static octave_value \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
373 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
374 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
375
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
376 #define DEFCATOP(name, t1, t2) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
377 static octave_value \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
378 CONCAT2 (oct_catop_, name) (octave_base_value& a1, \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
379 const octave_base_value& a2, \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
380 const Array<octave_idx_type>& ra_idx)
4915
c638c144d4da [project @ 2004-07-23 19:01:22 by jwe]
jwe
parents: 4901
diff changeset
381
17787
175b392e91fe Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents: 17744
diff changeset
382 // 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
383
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
384 #define DEFCATOP_FN(name, t1, t2, f) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
385 static octave_value \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
386 CONCAT2 (oct_catop_, name) (octave_base_value& a1, \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
387 const octave_base_value& a2, \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
388 const Array<octave_idx_type>& ra_idx) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
389 { \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
390 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
391 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
392 \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
393 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
394 }
c638c144d4da [project @ 2004-07-23 19:01:22 by jwe]
jwe
parents: 4901
diff changeset
395
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
396 #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
397 static octave_value \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
398 CONCAT2 (oct_catop_, name) (octave_base_value& a1, \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
399 const octave_base_value& a2, \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
400 const Array<octave_idx_type>& ra_idx) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
401 { \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
402 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
403 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
404 \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
405 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
406 }
667ad2becb63 [project @ 2005-11-10 21:40:48 by jwe]
jwe
parents: 5307
diff changeset
407
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
408 #define DEFNDCHARCATOP_FN(name, t1, t2, f) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
409 static octave_value \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
410 CONCAT2 (oct_catop_, name) (octave_base_value& a1, \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
411 const octave_base_value& a2, \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
412 const Array<octave_idx_type>& ra_idx) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
413 { \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
414 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
415 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
416 \
5533
667ad2becb63 [project @ 2005-11-10 21:40:48 by jwe]
jwe
parents: 5307
diff changeset
417 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
418 ((a1.is_sq_string () || a2.is_sq_string ()) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
419 ? '\'' : '"')); \
4915
c638c144d4da [project @ 2004-07-23 19:01:22 by jwe]
jwe
parents: 4901
diff changeset
420 }
c638c144d4da [project @ 2004-07-23 19:01:22 by jwe]
jwe
parents: 4901
diff changeset
421
5075
b6a9f78f60e9 [project @ 2004-11-10 03:13:26 by jwe]
jwe
parents: 5073
diff changeset
422 // 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
423 // of the first. Hmm.
b6a9f78f60e9 [project @ 2004-11-10 03:13:26 by jwe]
jwe
parents: 5073
diff changeset
424
22197
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
425 #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
426 static octave_value \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
427 CONCAT2 (oct_catop_, name) (octave_base_value& a1, \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
428 const octave_base_value& a2, \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
429 const Array<octave_idx_type>& ra_idx) \
e43d83253e28 refill multi-line macro definitions
John W. Eaton <jwe@octave.org>
parents: 21782
diff changeset
430 { \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
431 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
432 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
433 \
21649
0822917dfcf5 * ops.h, op-int.h: Style fixes.
John W. Eaton <jwe@octave.org>
parents: 21648
diff changeset
434 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
435 }
b6a9f78f60e9 [project @ 2004-11-10 03:13:26 by jwe]
jwe
parents: 5073
diff changeset
436
2376
2142216bf85a [project @ 1996-10-12 01:39:07 by jwe]
jwe
parents:
diff changeset
437 #endif