Mercurial > octave-nkf
annotate src/OPERATORS/op-int.h @ 7914:e998e81224b5
Various compilation fixes for MSVC.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 10 Jul 2008 08:59:18 -0400 |
parents | 82be108cc558 |
children | cd90e2842080 |
rev | line source |
---|---|
4905 | 1 /* |
2 | |
7017 | 3 Copyright (C) 1996, 1997, 2004, 2005, 2006, 2007 John W. Eaton |
4905 | 4 |
5 This file is part of Octave. | |
6 | |
7 Octave is free software; you can redistribute it and/or modify it | |
8 under the terms of the GNU General Public License as published by the | |
7016 | 9 Free Software Foundation; either version 3 of the License, or (at your |
10 option) any later version. | |
4905 | 11 |
12 Octave is distributed in the hope that it will be useful, but WITHOUT | |
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
15 for more details. | |
16 | |
17 You should have received a copy of the GNU General Public License | |
7016 | 18 along with Octave; see the file COPYING. If not, see |
19 <http://www.gnu.org/licenses/>. | |
4905 | 20 |
21 */ | |
22 | |
4952 | 23 #include "quit.h" |
24 | |
5075 | 25 #define OCTAVE_CONCAT_FN2(T1, T2) \ |
26 DEFNDCATOP_FN2 (T1 ## _ ## T2 ## _s_s, T1 ## _scalar, T2 ## _scalar, , T1 ## NDArray, T1 ## _array, T2 ## _array, concat) \ | |
27 DEFNDCATOP_FN2 (T1 ## _ ## T2 ## _s_m, T1 ## _scalar, T2 ## _matrix, , T1 ## NDArray, T1 ## _array, T2 ## _array, concat) \ | |
28 DEFNDCATOP_FN2 (T1 ## _ ## T2 ## _m_s, T1 ## _matrix, T2 ## _scalar, , T1 ## NDArray, T1 ## _array, T2 ## _array, concat) \ | |
29 DEFNDCATOP_FN2 (T1 ## _ ## T2 ## _m_m, T1 ## _matrix, T2 ## _matrix, , T1 ## NDArray, T1 ## _array, T2 ## _array, concat) | |
30 | |
31 #define OCTAVE_INSTALL_CONCAT_FN2(T1, T2) \ | |
32 INSTALL_CATOP (octave_ ## T1 ## _scalar, octave_ ## T2 ## _scalar, T1 ## _ ## T2 ## _s_s) \ | |
33 INSTALL_CATOP (octave_ ## T1 ## _scalar, octave_ ## T2 ## _matrix, T1 ## _ ## T2 ## _s_m) \ | |
34 INSTALL_CATOP (octave_ ## T1 ## _matrix, octave_ ## T2 ## _scalar, T1 ## _ ## T2 ## _m_s) \ | |
35 INSTALL_CATOP (octave_ ## T1 ## _matrix, octave_ ## T2 ## _matrix, T1 ## _ ## T2 ## _m_m) | |
36 | |
37 #define OCTAVE_DOUBLE_INT_CONCAT_FN(TYPE) \ | |
38 DEFNDCATOP_FN2 (double ## _ ## TYPE ## _s_s, scalar, TYPE ## _scalar, TYPE ## NDArray, , array, TYPE ## _array, concat) \ | |
39 DEFNDCATOP_FN2 (double ## _ ## TYPE ## _s_m, scalar, TYPE ## _matrix, TYPE ## NDArray, , array, TYPE ## _array, concat) \ | |
40 DEFNDCATOP_FN2 (double ## _ ## TYPE ## _m_s, matrix, TYPE ## _scalar, TYPE ## NDArray, , array, TYPE ## _array, concat) \ | |
41 DEFNDCATOP_FN2 (double ## _ ## TYPE ## _m_m, matrix, TYPE ## _matrix, TYPE ## NDArray, , array, TYPE ## _array, concat) | |
42 | |
43 #define OCTAVE_INSTALL_DOUBLE_INT_CONCAT_FN(TYPE) \ | |
44 INSTALL_CATOP (octave_scalar, octave_ ## TYPE ## _scalar, double ## _ ## TYPE ## _s_s) \ | |
45 INSTALL_CATOP (octave_scalar, octave_ ## TYPE ## _matrix, double ## _ ## TYPE ## _s_m) \ | |
46 INSTALL_CATOP (octave_matrix, octave_ ## TYPE ## _scalar, double ## _ ## TYPE ## _m_s) \ | |
47 INSTALL_CATOP (octave_matrix, octave_ ## TYPE ## _matrix, double ## _ ## TYPE ## _m_m) | |
48 | |
49 #define OCTAVE_INT_DOUBLE_CONCAT_FN(TYPE) \ | |
50 DEFNDCATOP_FN2 (TYPE ## _ ## double ## _s_s, TYPE ## _scalar, scalar, , TYPE ## NDArray, TYPE ## _array, array, concat) \ | |
51 DEFNDCATOP_FN2 (TYPE ## _ ## double ## _s_m, TYPE ## _scalar, matrix, , TYPE ## NDArray, TYPE ## _array, array, concat) \ | |
52 DEFNDCATOP_FN2 (TYPE ## _ ## double ## _m_s, TYPE ## _matrix, scalar, , TYPE ## NDArray, TYPE ## _array, array, concat) \ | |
53 DEFNDCATOP_FN2 (TYPE ## _ ## double ## _m_m, TYPE ## _matrix, matrix, , TYPE ## NDArray, TYPE ## _array, array, concat) | |
54 | |
55 #define OCTAVE_INSTALL_INT_DOUBLE_CONCAT_FN(TYPE) \ | |
56 INSTALL_CATOP (octave_ ## TYPE ## _scalar, octave_scalar, TYPE ## _ ## double ## _s_s) \ | |
57 INSTALL_CATOP (octave_ ## TYPE ## _scalar, octave_matrix, TYPE ## _ ## double ## _s_m) \ | |
58 INSTALL_CATOP (octave_ ## TYPE ## _matrix, octave_scalar, TYPE ## _ ## double ## _m_s) \ | |
59 INSTALL_CATOP (octave_ ## TYPE ## _matrix, octave_matrix, TYPE ## _ ## double ## _m_m) | |
60 | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
61 #define OCTAVE_FLOAT_INT_CONCAT_FN(TYPE) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
62 DEFNDCATOP_FN2 (float ## _ ## TYPE ## _s_s, float_scalar, TYPE ## _scalar, TYPE ## NDArray, , float_array, TYPE ## _array, concat) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
63 DEFNDCATOP_FN2 (float ## _ ## TYPE ## _s_m, float_scalar, TYPE ## _matrix, TYPE ## NDArray, , float_array, TYPE ## _array, concat) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
64 DEFNDCATOP_FN2 (float ## _ ## TYPE ## _m_s, float_matrix, TYPE ## _scalar, TYPE ## NDArray, , float_array, TYPE ## _array, concat) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
65 DEFNDCATOP_FN2 (float ## _ ## TYPE ## _m_m, float_matrix, TYPE ## _matrix, TYPE ## NDArray, , float_array, TYPE ## _array, concat) |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
66 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
67 #define OCTAVE_INSTALL_FLOAT_INT_CONCAT_FN(TYPE) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
68 INSTALL_CATOP (octave_float_scalar, octave_ ## TYPE ## _scalar, float ## _ ## TYPE ## _s_s) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
69 INSTALL_CATOP (octave_float_scalar, octave_ ## TYPE ## _matrix, float ## _ ## TYPE ## _s_m) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
70 INSTALL_CATOP (octave_float_matrix, octave_ ## TYPE ## _scalar, float ## _ ## TYPE ## _m_s) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
71 INSTALL_CATOP (octave_float_matrix, octave_ ## TYPE ## _matrix, float ## _ ## TYPE ## _m_m) |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
72 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
73 #define OCTAVE_INT_FLOAT_CONCAT_FN(TYPE) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
74 DEFNDCATOP_FN2 (TYPE ## _ ## float ## _s_s, TYPE ## _scalar, float_scalar, , TYPE ## NDArray, TYPE ## _array, float_array, concat) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
75 DEFNDCATOP_FN2 (TYPE ## _ ## float ## _s_m, TYPE ## _scalar, float_matrix, , TYPE ## NDArray, TYPE ## _array, float_array, concat) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
76 DEFNDCATOP_FN2 (TYPE ## _ ## float ## _m_s, TYPE ## _matrix, float_scalar, , TYPE ## NDArray, TYPE ## _array, float_array, concat) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
77 DEFNDCATOP_FN2 (TYPE ## _ ## float ## _m_m, TYPE ## _matrix, float_matrix, , TYPE ## NDArray, TYPE ## _array, float_array, concat) |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
78 |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
79 #define OCTAVE_INSTALL_INT_FLOAT_CONCAT_FN(TYPE) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
80 INSTALL_CATOP (octave_ ## TYPE ## _scalar, octave_float_scalar, TYPE ## _ ## float ## _s_s) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
81 INSTALL_CATOP (octave_ ## TYPE ## _scalar, octave_float_matrix, TYPE ## _ ## float ## _s_m) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
82 INSTALL_CATOP (octave_ ## TYPE ## _matrix, octave_float_scalar, TYPE ## _ ## float ## _m_s) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
83 INSTALL_CATOP (octave_ ## TYPE ## _matrix, octave_float_matrix, TYPE ## _ ## float ## _m_m) |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
84 |
5533 | 85 // For compatibility, concatenation with a character always returns a |
86 // character. | |
87 | |
88 #define OCTAVE_CHAR_INT_CONCAT_FN(TYPE) \ | |
89 DEFNDCHARCATOP_FN (char ## _ ## TYPE ## _m_s, char_matrix, TYPE ## _scalar, concat) \ | |
90 DEFNDCHARCATOP_FN (char ## _ ## TYPE ## _m_m, char_matrix, TYPE ## _matrix, concat) | |
91 | |
92 #define OCTAVE_INSTALL_CHAR_INT_CONCAT_FN(TYPE) \ | |
93 INSTALL_CATOP (octave_char_matrix_str, octave_ ## TYPE ## _scalar, char ## _ ## TYPE ## _m_s) \ | |
94 INSTALL_CATOP (octave_char_matrix_str, octave_ ## TYPE ## _matrix, char ## _ ## TYPE ## _m_m) \ | |
95 INSTALL_CATOP (octave_char_matrix_sq_str, octave_ ## TYPE ## _scalar, char ## _ ## TYPE ## _m_s) \ | |
96 INSTALL_CATOP (octave_char_matrix_sq_str, octave_ ## TYPE ## _matrix, char ## _ ## TYPE ## _m_m) | |
97 | |
98 #define OCTAVE_INT_CHAR_CONCAT_FN(TYPE) \ | |
99 DEFNDCHARCATOP_FN (TYPE ## _ ## char ## _s_m, TYPE ## _scalar, char_matrix, concat) \ | |
100 DEFNDCHARCATOP_FN (TYPE ## _ ## char ## _m_m, TYPE ## _matrix, char_matrix, concat) | |
101 | |
102 #define OCTAVE_INSTALL_INT_CHAR_CONCAT_FN(TYPE) \ | |
103 INSTALL_CATOP (octave_ ## TYPE ## _scalar, octave_char_matrix_str, TYPE ## _ ## char ## _s_m) \ | |
104 INSTALL_CATOP (octave_ ## TYPE ## _matrix, octave_char_matrix_str, TYPE ## _ ## char ## _m_m) \ | |
105 INSTALL_CATOP (octave_ ## TYPE ## _scalar, octave_char_matrix_sq_str, TYPE ## _ ## char ## _s_m) \ | |
106 INSTALL_CATOP (octave_ ## TYPE ## _matrix, octave_char_matrix_sq_str, TYPE ## _ ## char ## _m_m) | |
107 | |
4915 | 108 #define OCTAVE_CONCAT_FN(TYPE) \ |
109 DEFNDCATOP_FN (TYPE ## _s_s, TYPE ## _scalar, TYPE ## _scalar, TYPE ## _array, TYPE ## _array, concat) \ | |
110 DEFNDCATOP_FN (TYPE ## _s_m, TYPE ## _scalar, TYPE ## _matrix, TYPE ## _array, TYPE ## _array, concat) \ | |
111 DEFNDCATOP_FN (TYPE ## _m_s, TYPE ## _matrix, TYPE ## _scalar, TYPE ## _array, TYPE ## _array, concat) \ | |
112 DEFNDCATOP_FN (TYPE ## _m_m, TYPE ## _matrix, TYPE ## _matrix, TYPE ## _array, TYPE ## _array, concat) | |
113 | |
114 #define OCTAVE_INSTALL_CONCAT_FN(TYPE) \ | |
115 INSTALL_CATOP (octave_ ## TYPE ## _scalar, octave_ ## TYPE ## _scalar, TYPE ## _s_s) \ | |
116 INSTALL_CATOP (octave_ ## TYPE ## _scalar, octave_ ## TYPE ## _matrix, TYPE ## _s_m) \ | |
117 INSTALL_CATOP (octave_ ## TYPE ## _matrix, octave_ ## TYPE ## _scalar, TYPE ## _m_s) \ | |
118 INSTALL_CATOP (octave_ ## TYPE ## _matrix, octave_ ## TYPE ## _matrix, TYPE ## _m_m) | |
119 | |
4905 | 120 #define OCTAVE_S_INT_UNOPS(TYPE) \ |
121 /* scalar unary ops. */ \ | |
122 \ | |
123 DEFUNOP_OP (s_not, TYPE ## _scalar, !) \ | |
4965 | 124 DEFUNOP_OP (s_uplus, TYPE ## _scalar, /* no-op */) \ |
4905 | 125 DEFUNOP_OP (s_uminus, TYPE ## _scalar, -) \ |
126 DEFUNOP_OP (s_transpose, TYPE ## _scalar, /* no-op */) \ | |
127 DEFUNOP_OP (s_hermitian, TYPE ## _scalar, /* no-op */) \ | |
128 \ | |
5829 | 129 DEFNCUNOP_METHOD (s_incr, TYPE ## _scalar, increment) \ |
130 DEFNCUNOP_METHOD (s_decr, TYPE ## _scalar, decrement) | |
4905 | 131 |
4953 | 132 #define OCTAVE_SS_INT_ARITH_OPS(PFX, T1, T2) \ |
4905 | 133 /* scalar by scalar ops. */ \ |
134 \ | |
4953 | 135 DEFBINOP_OP (PFX ## _add, T1 ## scalar, T2 ## scalar, +) \ |
136 DEFBINOP_OP (PFX ## _sub, T1 ## scalar, T2 ## scalar, -) \ | |
137 DEFBINOP_OP (PFX ## _mul, T1 ## scalar, T2 ## scalar, *) \ | |
4905 | 138 \ |
4953 | 139 DEFBINOP (PFX ## _div, T1 ## scalar, T2 ## scalar) \ |
4905 | 140 { \ |
4953 | 141 CAST_BINOP_ARGS (const octave_ ## T1 ## scalar&, const octave_ ## T2 ## scalar&); \ |
4905 | 142 \ |
4953 | 143 if (! v2.T2 ## scalar_value ()) \ |
4905 | 144 gripe_divide_by_zero (); \ |
145 \ | |
4953 | 146 return octave_value (v1.T1 ## scalar_value () / v2.T2 ## scalar_value ()); \ |
4905 | 147 } \ |
148 \ | |
4953 | 149 DEFBINOP_FN (PFX ## _pow, T1 ## scalar, T2 ## scalar, xpow) \ |
4905 | 150 \ |
4953 | 151 DEFBINOP (PFX ## _ldiv, T1 ## scalar, T2 ## scalar) \ |
4905 | 152 { \ |
4953 | 153 CAST_BINOP_ARGS (const octave_ ## T1 ## scalar&, const octave_ ## T2 ## scalar&); \ |
4905 | 154 \ |
4953 | 155 if (! v1.T1 ## scalar_value ()) \ |
4905 | 156 gripe_divide_by_zero (); \ |
157 \ | |
4953 | 158 return octave_value (v2.T2 ## scalar_value () / v1.T1 ## scalar_value ()); \ |
159 } \ | |
160 \ | |
161 DEFBINOP_OP (PFX ## _el_mul, T1 ## scalar, T2 ## scalar, *) \ | |
162 \ | |
163 DEFBINOP (PFX ## _el_div, T1 ## scalar, T2 ## scalar) \ | |
164 { \ | |
165 CAST_BINOP_ARGS (const octave_ ## T1 ## scalar&, const octave_ ## T2 ## scalar&); \ | |
166 \ | |
167 if (! v2.T2 ## scalar_value ()) \ | |
168 gripe_divide_by_zero (); \ | |
169 \ | |
170 return octave_value (v1.T1 ## scalar_value () / v2.T2 ## scalar_value ()); \ | |
4905 | 171 } \ |
172 \ | |
4953 | 173 DEFBINOP_FN (PFX ## _el_pow, T1 ## scalar, T2 ## scalar, xpow) \ |
4905 | 174 \ |
4953 | 175 DEFBINOP (PFX ## _el_ldiv, T1 ## scalar, T2 ## scalar) \ |
4905 | 176 { \ |
4953 | 177 CAST_BINOP_ARGS (const octave_ ## T1 ## scalar&, const octave_ ## T2 ## scalar&); \ |
4905 | 178 \ |
4953 | 179 if (! v1.T1 ## scalar_value ()) \ |
4905 | 180 gripe_divide_by_zero (); \ |
181 \ | |
4953 | 182 return octave_value (v2.T2 ## scalar_value () / v1.T1 ## scalar_value ()); \ |
183 } \ | |
184 | |
5030 | 185 #define OCTAVE_SS_INT_BOOL_OPS(PFX, T1, T2, Z1, Z2) \ |
4964 | 186 DEFBINOP (PFX ## _el_and, T2, T2) \ |
187 { \ | |
188 CAST_BINOP_ARGS (const octave_ ## T1 ## scalar&, const octave_ ## T2 ## scalar&); \ | |
189 \ | |
5030 | 190 return v1.T1 ## scalar_value () != Z1 && v2.T2 ## scalar_value () != Z2; \ |
4964 | 191 } \ |
192 \ | |
193 DEFBINOP (PFX ## _el_or, T1, T2) \ | |
194 { \ | |
195 CAST_BINOP_ARGS (const octave_ ## T1 ## scalar&, const octave_ ## T2 ## scalar&); \ | |
196 \ | |
5030 | 197 return v1.T1 ## scalar_value () != Z1 || v2.T2 ## scalar_value () != Z2; \ |
4964 | 198 } |
4953 | 199 |
200 #define OCTAVE_SS_INT_CMP_OPS(PFX, T1, T2) \ | |
201 DEFBINOP_OP (PFX ## _lt, T1 ## scalar, T2 ## scalar, <) \ | |
202 DEFBINOP_OP (PFX ## _le, T1 ## scalar, T2 ## scalar, <=) \ | |
203 DEFBINOP_OP (PFX ## _eq, T1 ## scalar, T2 ## scalar, ==) \ | |
204 DEFBINOP_OP (PFX ## _ge, T1 ## scalar, T2 ## scalar, >=) \ | |
205 DEFBINOP_OP (PFX ## _gt, T1 ## scalar, T2 ## scalar, >) \ | |
206 DEFBINOP_OP (PFX ## _ne, T1 ## scalar, T2 ## scalar, !=) | |
207 | |
208 #define OCTAVE_SS_POW_OPS(T1, T2) \ | |
209 octave_value \ | |
210 xpow (const octave_ ## T1& a, const octave_ ## T2& b) \ | |
211 { \ | |
212 return pow (a, b); \ | |
4905 | 213 } \ |
214 \ | |
4953 | 215 octave_value \ |
216 xpow (const octave_ ## T1& a, double b) \ | |
4905 | 217 { \ |
4953 | 218 return pow (a, b); \ |
4905 | 219 } \ |
4953 | 220 \ |
221 octave_value \ | |
222 xpow (double a, const octave_ ## T1& b) \ | |
223 { \ | |
224 return pow (a, b); \ | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
225 } \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
226 \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
227 octave_value \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
228 xpow (const octave_ ## T1& a, float b) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
229 { \ |
7914
e998e81224b5
Various compilation fixes for MSVC.
John W. Eaton <jwe@octave.org>
parents:
7789
diff
changeset
|
230 return powf (a, b); \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
231 } \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
232 \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
233 octave_value \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
234 xpow (float a, const octave_ ## T1& b) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
235 { \ |
7914
e998e81224b5
Various compilation fixes for MSVC.
John W. Eaton <jwe@octave.org>
parents:
7789
diff
changeset
|
236 return powf (a, b); \ |
4953 | 237 } |
4952 | 238 |
4905 | 239 #define OCTAVE_SS_INT_OPS(TYPE) \ |
240 OCTAVE_S_INT_UNOPS (TYPE) \ | |
4952 | 241 OCTAVE_SS_POW_OPS (TYPE, TYPE) \ |
4953 | 242 OCTAVE_SS_INT_ARITH_OPS (ss, TYPE ## _, TYPE ## _) \ |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
243 OCTAVE_SS_INT_ARITH_OPS (ssx, TYPE ## _, ) \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
244 OCTAVE_SS_INT_ARITH_OPS (sxs, , TYPE ## _) \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
245 OCTAVE_SS_INT_ARITH_OPS (ssfx, TYPE ## _, float_) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
246 OCTAVE_SS_INT_ARITH_OPS (sfxs, float_, TYPE ## _) \ |
4953 | 247 OCTAVE_SS_INT_CMP_OPS (ss, TYPE ## _, TYPE ## _) \ |
248 OCTAVE_SS_INT_CMP_OPS (sx, TYPE ## _, ) \ | |
249 OCTAVE_SS_INT_CMP_OPS (xs, , TYPE ## _) \ | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
250 OCTAVE_SS_INT_CMP_OPS (sfx, TYPE ## _, float_) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
251 OCTAVE_SS_INT_CMP_OPS (fxs, float_, TYPE ## _) \ |
5030 | 252 OCTAVE_SS_INT_BOOL_OPS (ss, TYPE ## _, TYPE ## _, octave_ ## TYPE (0), octave_ ## TYPE (0)) \ |
253 OCTAVE_SS_INT_BOOL_OPS (sx, TYPE ## _, , octave_ ## TYPE (0), 0) \ | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
254 OCTAVE_SS_INT_BOOL_OPS (xs, , TYPE ## _, 0, octave_ ## TYPE (0)) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
255 OCTAVE_SS_INT_BOOL_OPS (sfx, TYPE ## _, float_, octave_ ## TYPE (0), 0) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
256 OCTAVE_SS_INT_BOOL_OPS (fxs, float_, TYPE ## _, 0, octave_ ## TYPE (0)) |
4905 | 257 |
4953 | 258 #define OCTAVE_SM_INT_ARITH_OPS(PFX, TS, TM) \ |
4905 | 259 /* scalar by matrix ops. */ \ |
260 \ | |
4953 | 261 DEFNDBINOP_OP (PFX ## _add, TS ## scalar, TM ## matrix, TS ## scalar, TM ## array, +) \ |
262 DEFNDBINOP_OP (PFX ## _sub, TS ## scalar, TM ## matrix, TS ## scalar, TM ## array, -) \ | |
263 DEFNDBINOP_OP (PFX ## _mul, TS ## scalar, TM ## matrix, TS ## scalar, TM ## array, *) \ | |
4905 | 264 \ |
4953 | 265 /* DEFBINOP (PFX ## _div, TS ## scalar, TM ## matrix) */ \ |
4905 | 266 /* { */ \ |
4953 | 267 /* CAST_BINOP_ARGS (const octave_ ## TS ## scalar&, const octave_ ## TM ## matrix&); */ \ |
4905 | 268 /* */ \ |
4953 | 269 /* Matrix m1 = v1.TM ## matrix_value (); */ \ |
270 /* Matrix m2 = v2.TM ## matrix_value (); */ \ | |
4905 | 271 /* */ \ |
272 /* return octave_value (xdiv (m1, m2)); */ \ | |
273 /* } */ \ | |
274 \ | |
4953 | 275 /* DEFBINOP_FN (PFX ## _pow, TS ## scalar, TM ## matrix, xpow) */ \ |
276 \ | |
277 DEFBINOP (PFX ## _ldiv, TS ## scalar, TM ## matrix) \ | |
278 { \ | |
279 CAST_BINOP_ARGS (const octave_ ## TS ## scalar&, const octave_ ## TM ## matrix&); \ | |
4905 | 280 \ |
4953 | 281 if (! v1.TS ## scalar_value ()) \ |
282 gripe_divide_by_zero (); \ | |
4905 | 283 \ |
4953 | 284 return octave_value (v2.TS ## scalar_value () / v1.TS ## scalar_value ()); \ |
285 } \ | |
286 \ | |
287 DEFNDBINOP_OP (PFX ## _el_mul, TS ## scalar, TM ## matrix, TS ## scalar, TM ## array, *) \ | |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
288 DEFBINOP (PFX ## _el_div, TS ## scalar, TM ## matrix) \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
289 { \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
290 CAST_BINOP_ARGS (const octave_ ## TS ## scalar&, const octave_ ## TM ## matrix&); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
291 \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
292 return octave_value (v1.TS ## scalar_value () / v2.TM ## array_value ()); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
293 } \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
294 \ |
4953 | 295 DEFNDBINOP_FN (PFX ## _el_pow, TS ## scalar, TM ## matrix, TS ## scalar, TM ## array, elem_xpow) \ |
4905 | 296 \ |
4953 | 297 DEFBINOP (PFX ## _el_ldiv, TS ## scalar, TM ## matrix) \ |
298 { \ | |
299 CAST_BINOP_ARGS (const octave_ ## TS ## scalar&, const octave_ ## TM ## matrix&); \ | |
300 \ | |
301 if (! v1.TS ## scalar_value ()) \ | |
302 gripe_divide_by_zero (); \ | |
303 \ | |
304 return octave_value (v2.TM ## array_value () / v1.TS ## scalar_value ()); \ | |
305 } | |
4905 | 306 |
4953 | 307 #define OCTAVE_SM_INT_CMP_OPS(PFX, TS, TM) \ |
308 DEFNDBINOP_FN (PFX ## _lt, TS ## scalar, TM ## matrix, TS ## scalar, TM ## array, mx_el_lt) \ | |
309 DEFNDBINOP_FN (PFX ## _le, TS ## scalar, TM ## matrix, TS ## scalar, TM ## array, mx_el_le) \ | |
310 DEFNDBINOP_FN (PFX ## _eq, TS ## scalar, TM ## matrix, TS ## scalar, TM ## array, mx_el_eq) \ | |
311 DEFNDBINOP_FN (PFX ## _ge, TS ## scalar, TM ## matrix, TS ## scalar, TM ## array, mx_el_ge) \ | |
312 DEFNDBINOP_FN (PFX ## _gt, TS ## scalar, TM ## matrix, TS ## scalar, TM ## array, mx_el_gt) \ | |
313 DEFNDBINOP_FN (PFX ## _ne, TS ## scalar, TM ## matrix, TS ## scalar, TM ## array, mx_el_ne) | |
4905 | 314 |
4953 | 315 #define OCTAVE_SM_INT_BOOL_OPS(PFX, TS, TM) \ |
4964 | 316 DEFNDBINOP_FN (PFX ## _el_and, TS ## scalar, TM ## matrix, TS ## scalar, TM ## array, mx_el_and) \ |
317 DEFNDBINOP_FN (PFX ## _el_or, TS ## scalar, TM ## matrix, TS ## scalar, TM ## array, mx_el_or) | |
4905 | 318 |
4952 | 319 #define OCTAVE_SM_POW_OPS(T1, T2) \ |
4953 | 320 octave_value \ |
321 elem_xpow (const octave_ ## T1& a, const T2 ## NDArray& b) \ | |
322 { \ | |
323 T2 ## NDArray result (b.dims ()); \ | |
324 for (int i = 0; i < b.length (); i++) \ | |
325 { \ | |
326 OCTAVE_QUIT; \ | |
327 result (i) = pow (a, b(i)); \ | |
328 } \ | |
329 return octave_value (result); \ | |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
330 } \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
331 \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
332 octave_value \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
333 elem_xpow (const octave_ ## T1& a, const NDArray& b) \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
334 { \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
335 T1 ## NDArray result (b.dims ()); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
336 for (int i = 0; i < b.length (); i++) \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
337 { \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
338 OCTAVE_QUIT; \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
339 result (i) = pow (a, b(i)); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
340 } \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
341 return octave_value (result); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
342 } \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
343 \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
344 octave_value \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
345 elem_xpow (double a, const T2 ## NDArray& b) \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
346 { \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
347 T2 ## NDArray result (b.dims ()); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
348 for (int i = 0; i < b.length (); i++) \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
349 { \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
350 OCTAVE_QUIT; \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
351 result (i) = pow (a, b(i)); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
352 } \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
353 return octave_value (result); \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
354 } \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
355 \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
356 octave_value \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
357 elem_xpow (const octave_ ## T1& a, const FloatNDArray& b) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
358 { \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
359 T1 ## NDArray result (b.dims ()); \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
360 for (int i = 0; i < b.length (); i++) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
361 { \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
362 OCTAVE_QUIT; \ |
7914
e998e81224b5
Various compilation fixes for MSVC.
John W. Eaton <jwe@octave.org>
parents:
7789
diff
changeset
|
363 result (i) = powf (a, b(i)); \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
364 } \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
365 return octave_value (result); \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
366 } \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
367 \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
368 octave_value \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
369 elem_xpow (float a, const T2 ## NDArray& b) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
370 { \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
371 T2 ## NDArray result (b.dims ()); \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
372 for (int i = 0; i < b.length (); i++) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
373 { \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
374 OCTAVE_QUIT; \ |
7914
e998e81224b5
Various compilation fixes for MSVC.
John W. Eaton <jwe@octave.org>
parents:
7789
diff
changeset
|
375 result (i) = powf (a, b(i)); \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
376 } \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
377 return octave_value (result); \ |
4953 | 378 } |
4952 | 379 |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
380 |
4963 | 381 #define OCTAVE_SM_CONV(TS, TM) \ |
382 DEFCONV (TS ## s_ ## TM ## m_conv, TM ## scalar, TM ## matrix) \ | |
383 { \ | |
384 CAST_CONV_ARG (const octave_ ## TS ## scalar&); \ | |
385 \ | |
386 return new octave_ ## TM ## matrix (v.TM ## array_value ()); \ | |
387 } | |
388 | |
4905 | 389 #define OCTAVE_SM_INT_OPS(TYPE) \ |
4952 | 390 OCTAVE_SM_POW_OPS (TYPE, TYPE) \ |
4953 | 391 OCTAVE_SM_INT_ARITH_OPS (sm, TYPE ## _, TYPE ## _) \ |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
392 OCTAVE_SM_INT_ARITH_OPS (smx, TYPE ## _, ) \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
393 OCTAVE_SM_INT_ARITH_OPS (sxm, , TYPE ## _) \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
394 OCTAVE_SM_INT_ARITH_OPS (smfx, TYPE ## _, float_) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
395 OCTAVE_SM_INT_ARITH_OPS (sfxm, float_, TYPE ## _) \ |
4953 | 396 OCTAVE_SM_INT_CMP_OPS (sm, TYPE ## _, TYPE ## _) \ |
397 OCTAVE_SM_INT_CMP_OPS (xm, , TYPE ## _) \ | |
4964 | 398 OCTAVE_SM_INT_CMP_OPS (smx, TYPE ## _, ) \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
399 OCTAVE_SM_INT_CMP_OPS (fxm, float_, TYPE ## _) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
400 OCTAVE_SM_INT_CMP_OPS (smfx, TYPE ## _, float_) \ |
4953 | 401 OCTAVE_SM_INT_BOOL_OPS (sm, TYPE ## _, TYPE ## _) \ |
402 OCTAVE_SM_INT_BOOL_OPS (xm, , TYPE ## _) \ | |
4964 | 403 OCTAVE_SM_INT_BOOL_OPS (smx, TYPE ## _, ) \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
404 OCTAVE_SM_INT_BOOL_OPS (fxm, float_, TYPE ## _) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
405 OCTAVE_SM_INT_BOOL_OPS (smfx, TYPE ## _, float_) \ |
4963 | 406 OCTAVE_SM_CONV (TYPE ## _, TYPE ## _) \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
407 OCTAVE_SM_CONV (TYPE ## _, complex_) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
408 OCTAVE_SM_CONV (TYPE ## _, float_complex_) |
4905 | 409 |
4953 | 410 #define OCTAVE_MS_INT_ARITH_OPS(PFX, TM, TS) \ |
4905 | 411 /* matrix by scalar ops. */ \ |
412 \ | |
4953 | 413 DEFNDBINOP_OP (PFX ## _add, TM ## matrix, TS ## scalar, TM ## array, TS ## scalar, +) \ |
414 DEFNDBINOP_OP (PFX ## _sub, TM ## matrix, TS ## scalar, TM ## array, TS ## scalar, -) \ | |
415 DEFNDBINOP_OP (PFX ## _mul, TM ## matrix, TS ## scalar, TM ## array, TS ## scalar, *) \ | |
416 \ | |
417 DEFBINOP (PFX ## _div, TM ## matrix, TS ## scalar) \ | |
418 { \ | |
419 CAST_BINOP_ARGS (const octave_ ## TM ## matrix&, const octave_ ## TS ## scalar&); \ | |
4905 | 420 \ |
4953 | 421 if (! v2.TS ## scalar_value ()) \ |
422 gripe_divide_by_zero (); \ | |
423 \ | |
424 return octave_value (v1.TM ## array_value () / v2.TS ## scalar_value ()); \ | |
425 } \ | |
426 \ | |
427 /* DEFBINOP_FN (PFX ## _pow, TM ## matrix, TS ## scalar, xpow) */ \ | |
428 \ | |
429 /* DEFBINOP (PFX ## _ldiv, TM ## matrix, TS ## scalar) */ \ | |
4905 | 430 /* { */ \ |
4953 | 431 /* CAST_BINOP_ARGS (const octave_ ## TM ## matrix&, const octave_ ## TS ## scalar&); */ \ |
4905 | 432 /* */ \ |
4953 | 433 /* Matrix m1 = v1.TM ## matrix_value (); */ \ |
434 /* Matrix m2 = v2.TM ## matrix_value (); */ \ | |
4905 | 435 /* */ \ |
436 /* return octave_value (xleftdiv (m1, m2)); */ \ | |
437 /* } */ \ | |
438 \ | |
4953 | 439 DEFNDBINOP_OP (PFX ## _el_mul, TM ## matrix, TS ## scalar, TM ## array, TS ## scalar, *) \ |
440 \ | |
441 DEFBINOP (PFX ## _el_div, TM ## matrix, TS ## scalar) \ | |
442 { \ | |
443 CAST_BINOP_ARGS (const octave_ ## TM ## matrix&, const octave_ ## TS ## scalar&); \ | |
4905 | 444 \ |
4953 | 445 if (! v2.TS ## scalar_value ()) \ |
446 gripe_divide_by_zero (); \ | |
447 \ | |
448 return octave_value (v1.TM ## array_value () / v2.TS ## scalar_value ()); \ | |
449 } \ | |
450 \ | |
451 DEFNDBINOP_FN (PFX ## _el_pow, TM ## matrix, TS ## scalar, TM ## array, TS ## scalar, elem_xpow) \ | |
452 \ | |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
453 DEFBINOP (PFX ## _el_ldiv, TM ## matrix, TS ## scalar) \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
454 { \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
455 CAST_BINOP_ARGS (const octave_ ## TM ## matrix&, const octave_ ## TS ## scalar&); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
456 \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
457 return v2.TS ## scalar_value () / v1.TM ## array_value (); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
458 } |
4905 | 459 |
4953 | 460 #define OCTAVE_MS_INT_CMP_OPS(PFX, TM, TS) \ |
461 DEFNDBINOP_FN (PFX ## _lt, TM ## matrix, TS ## scalar, TM ## array, TS ## scalar, mx_el_lt) \ | |
462 DEFNDBINOP_FN (PFX ## _le, TM ## matrix, TS ## scalar, TM ## array, TS ## scalar, mx_el_le) \ | |
463 DEFNDBINOP_FN (PFX ## _eq, TM ## matrix, TS ## scalar, TM ## array, TS ## scalar, mx_el_eq) \ | |
464 DEFNDBINOP_FN (PFX ## _ge, TM ## matrix, TS ## scalar, TM ## array, TS ## scalar, mx_el_ge) \ | |
465 DEFNDBINOP_FN (PFX ## _gt, TM ## matrix, TS ## scalar, TM ## array, TS ## scalar, mx_el_gt) \ | |
4964 | 466 DEFNDBINOP_FN (PFX ## _ne, TM ## matrix, TS ## scalar, TM ## array, TS ## scalar, mx_el_ne) |
4905 | 467 |
4953 | 468 #define OCTAVE_MS_INT_BOOL_OPS(PFX, TM, TS) \ |
4964 | 469 DEFNDBINOP_FN (PFX ## _el_and, TM ## matrix, TS ## scalar, TM ## array, TS ## scalar, mx_el_and) \ |
470 DEFNDBINOP_FN (PFX ## _el_or, TM ## matrix, TS ## scalar, TM ## array, TS ## scalar, mx_el_or) | |
4905 | 471 |
4953 | 472 #define OCTAVE_MS_INT_ASSIGN_OPS(PFX, TM, TS, TE) \ |
473 DEFNDASSIGNOP_FN (PFX ## _assign, TM ## matrix, TS ## scalar, TE ## array, assign) | |
4905 | 474 |
4952 | 475 #define OCTAVE_MS_POW_OPS(T1, T2) \ |
476 octave_value elem_xpow (T1 ## NDArray a, octave_ ## T2 b) \ | |
477 { \ | |
478 T1 ## NDArray result (a.dims ()); \ | |
479 for (int i = 0; i < a.length (); i++) \ | |
480 { \ | |
481 OCTAVE_QUIT; \ | |
482 result (i) = pow (a(i), b); \ | |
483 } \ | |
484 return octave_value (result); \ | |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
485 } \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
486 \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
487 octave_value elem_xpow (T1 ## NDArray a, double b) \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
488 { \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
489 T1 ## NDArray result (a.dims ()); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
490 for (int i = 0; i < a.length (); i++) \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
491 { \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
492 OCTAVE_QUIT; \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
493 result (i) = pow (a(i), b); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
494 } \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
495 return octave_value (result); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
496 } \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
497 \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
498 octave_value elem_xpow (NDArray a, octave_ ## T2 b) \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
499 { \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
500 T2 ## NDArray result (a.dims ()); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
501 for (int i = 0; i < a.length (); i++) \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
502 { \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
503 OCTAVE_QUIT; \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
504 result (i) = pow (a(i), b); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
505 } \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
506 return octave_value (result); \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
507 } \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
508 \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
509 octave_value elem_xpow (T1 ## NDArray a, float b) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
510 { \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
511 T1 ## NDArray result (a.dims ()); \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
512 for (int i = 0; i < a.length (); i++) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
513 { \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
514 OCTAVE_QUIT; \ |
7914
e998e81224b5
Various compilation fixes for MSVC.
John W. Eaton <jwe@octave.org>
parents:
7789
diff
changeset
|
515 result (i) = powf (a(i), b); \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
516 } \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
517 return octave_value (result); \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
518 } \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
519 \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
520 octave_value elem_xpow (FloatNDArray a, octave_ ## T2 b) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
521 { \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
522 T2 ## NDArray result (a.dims ()); \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
523 for (int i = 0; i < a.length (); i++) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
524 { \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
525 OCTAVE_QUIT; \ |
7914
e998e81224b5
Various compilation fixes for MSVC.
John W. Eaton <jwe@octave.org>
parents:
7789
diff
changeset
|
526 result (i) = powf (a(i), b); \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
527 } \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
528 return octave_value (result); \ |
4952 | 529 } |
530 | |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
531 |
4905 | 532 #define OCTAVE_MS_INT_OPS(TYPE) \ |
4952 | 533 OCTAVE_MS_POW_OPS (TYPE, TYPE) \ |
4953 | 534 OCTAVE_MS_INT_ARITH_OPS (ms, TYPE ## _, TYPE ## _) \ |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
535 OCTAVE_MS_INT_ARITH_OPS (msx, TYPE ## _, ) \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
536 OCTAVE_MS_INT_ARITH_OPS (mxs, , TYPE ## _) \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
537 OCTAVE_MS_INT_ARITH_OPS (msfx, TYPE ## _, float_) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
538 OCTAVE_MS_INT_ARITH_OPS (mfxs, float_, TYPE ## _) \ |
4953 | 539 OCTAVE_MS_INT_CMP_OPS (ms, TYPE ## _, TYPE ## _) \ |
540 OCTAVE_MS_INT_CMP_OPS (mx, TYPE ## _, ) \ | |
4964 | 541 OCTAVE_MS_INT_CMP_OPS (mxs, , TYPE ## _) \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
542 OCTAVE_MS_INT_CMP_OPS (mfx, TYPE ## _, float_) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
543 OCTAVE_MS_INT_CMP_OPS (mfxs, float_, TYPE ## _) \ |
4953 | 544 OCTAVE_MS_INT_BOOL_OPS (ms, TYPE ## _, TYPE ## _) \ |
545 OCTAVE_MS_INT_BOOL_OPS (mx, TYPE ## _, ) \ | |
4964 | 546 OCTAVE_MS_INT_BOOL_OPS (mxs, , TYPE ## _) \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
547 OCTAVE_MS_INT_BOOL_OPS (mfx, TYPE ## _, float_) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
548 OCTAVE_MS_INT_BOOL_OPS (mfxs, float_, TYPE ## _) \ |
4953 | 549 OCTAVE_MS_INT_ASSIGN_OPS (ms, TYPE ## _, TYPE ## _, TYPE ## _) \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
550 OCTAVE_MS_INT_ASSIGN_OPS (mx, TYPE ## _, , ) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
551 OCTAVE_MS_INT_ASSIGN_OPS (mfx, TYPE ## _, float_, float_) |
4905 | 552 |
553 #define OCTAVE_M_INT_UNOPS(TYPE) \ | |
554 /* matrix unary ops. */ \ | |
555 \ | |
556 DEFNDUNOP_OP (m_not, TYPE ## _matrix, TYPE ## _array, !) \ | |
4965 | 557 DEFNDUNOP_OP (m_uplus, TYPE ## _matrix, TYPE ## _array, /* no-op */) \ |
4905 | 558 DEFNDUNOP_OP (m_uminus, TYPE ## _matrix, TYPE ## _array, -) \ |
559 \ | |
560 DEFUNOP (m_transpose, TYPE ## _matrix) \ | |
561 { \ | |
562 CAST_UNOP_ARG (const octave_ ## TYPE ## _matrix&); \ | |
563 \ | |
564 if (v.ndims () > 2) \ | |
565 { \ | |
566 error ("transpose not defined for N-d objects"); \ | |
567 return octave_value (); \ | |
568 } \ | |
569 else \ | |
570 return octave_value (v.TYPE ## _array_value().transpose ()); \ | |
571 } \ | |
572 \ | |
5829 | 573 DEFNCUNOP_METHOD (m_incr, TYPE ## _matrix, increment) \ |
574 DEFNCUNOP_METHOD (m_decr, TYPE ## _matrix, decrement) | |
4905 | 575 |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
576 #define OCTAVE_MM_INT_ARITH_OPS(PFX, T1, T2) \ |
4905 | 577 /* matrix by matrix ops. */ \ |
578 \ | |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
579 DEFNDBINOP_OP (PFX ## _add, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, +) \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
580 DEFNDBINOP_OP (PFX ## _sub, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, -) \ |
4905 | 581 \ |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
582 /* DEFBINOP_OP (PFX ## _mul, T1 ## matrix, T2 ## matrix, *) */ \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
583 /* DEFBINOP_FN (PFX ## _div, T1 ## matrix, T2 ## matrix, xdiv) */ \ |
4905 | 584 \ |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
585 DEFBINOPX (PFX ## _pow, T1 ## matrix, T2 ## matrix) \ |
4905 | 586 { \ |
587 error ("can't do A ^ B for A and B both matrices"); \ | |
588 return octave_value (); \ | |
589 } \ | |
590 \ | |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
591 /* DEFBINOP_FN (PFX ## _ldiv, T1 ## matrix, T2 ## matrix, xleftdiv) */ \ |
4905 | 592 \ |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
593 DEFNDBINOP_FN (PFX ## _el_mul, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, product) \ |
4905 | 594 \ |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
595 DEFNDBINOP_FN (PFX ## _el_div, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, quotient) \ |
4905 | 596 \ |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
597 DEFNDBINOP_FN (PFX ## _el_pow, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, elem_xpow) \ |
4905 | 598 \ |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
599 DEFBINOP (PFX ## _el_ldiv, T1 ## matrix, T2 ## matrix) \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
600 { \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
601 CAST_BINOP_ARGS (const octave_ ## T1 ## matrix&, const octave_ ## T2 ## matrix&); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
602 \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
603 return octave_value (quotient (v2.T2 ## array_value (), v1.T1 ## array_value ())); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
604 } |
4905 | 605 |
4964 | 606 #define OCTAVE_MM_INT_CMP_OPS(PFX, T1, T2) \ |
607 DEFNDBINOP_FN (PFX ## _lt, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, mx_el_lt) \ | |
608 DEFNDBINOP_FN (PFX ## _le, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, mx_el_le) \ | |
609 DEFNDBINOP_FN (PFX ## _eq, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, mx_el_eq) \ | |
610 DEFNDBINOP_FN (PFX ## _ge, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, mx_el_ge) \ | |
611 DEFNDBINOP_FN (PFX ## _gt, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, mx_el_gt) \ | |
612 DEFNDBINOP_FN (PFX ## _ne, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, mx_el_ne) | |
4905 | 613 |
4964 | 614 #define OCTAVE_MM_INT_BOOL_OPS(PFX, T1, T2) \ |
615 DEFNDBINOP_FN (PFX ## _el_and, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, mx_el_and) \ | |
616 DEFNDBINOP_FN (PFX ## _el_or, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, mx_el_or) | |
4905 | 617 |
4953 | 618 #define OCTAVE_MM_INT_ASSIGN_OPS(PFX, TLHS, TRHS, TE) \ |
619 DEFNDASSIGNOP_FN (PFX ## _assign, TLHS ## matrix, TRHS ## matrix, TE ## array, assign) | |
4905 | 620 |
4952 | 621 #define OCTAVE_MM_POW_OPS(T1, T2) \ |
4953 | 622 octave_value \ |
623 elem_xpow (const T1 ## NDArray& a, const T2 ## NDArray& b) \ | |
624 { \ | |
625 dim_vector a_dims = a.dims (); \ | |
626 dim_vector b_dims = b.dims (); \ | |
627 if (a_dims != b_dims) \ | |
628 { \ | |
629 gripe_nonconformant ("operator .^", a_dims, b_dims); \ | |
630 return octave_value (); \ | |
631 } \ | |
632 T1 ## NDArray result (a_dims); \ | |
633 for (int i = 0; i < a.length (); i++) \ | |
634 { \ | |
635 OCTAVE_QUIT; \ | |
636 result (i) = pow (a(i), b(i)); \ | |
637 } \ | |
638 return octave_value (result); \ | |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
639 } \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
640 \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
641 octave_value \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
642 elem_xpow (const T1 ## NDArray& a, const NDArray& b) \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
643 { \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
644 dim_vector a_dims = a.dims (); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
645 dim_vector b_dims = b.dims (); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
646 if (a_dims != b_dims) \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
647 { \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
648 gripe_nonconformant ("operator .^", a_dims, b_dims); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
649 return octave_value (); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
650 } \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
651 T1 ## NDArray result (a_dims); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
652 for (int i = 0; i < a.length (); i++) \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
653 { \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
654 OCTAVE_QUIT; \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
655 result (i) = pow (a(i), b(i)); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
656 } \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
657 return octave_value (result); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
658 } \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
659 \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
660 octave_value \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
661 elem_xpow (const NDArray& a, const T2 ## NDArray& b) \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
662 { \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
663 dim_vector a_dims = a.dims (); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
664 dim_vector b_dims = b.dims (); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
665 if (a_dims != b_dims) \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
666 { \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
667 gripe_nonconformant ("operator .^", a_dims, b_dims); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
668 return octave_value (); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
669 } \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
670 T2 ## NDArray result (a_dims); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
671 for (int i = 0; i < a.length (); i++) \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
672 { \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
673 OCTAVE_QUIT; \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
674 result (i) = pow (a(i), b(i)); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
675 } \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
676 return octave_value (result); \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
677 } \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
678 \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
679 octave_value \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
680 elem_xpow (const T1 ## NDArray& a, const FloatNDArray& b) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
681 { \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
682 dim_vector a_dims = a.dims (); \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
683 dim_vector b_dims = b.dims (); \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
684 if (a_dims != b_dims) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
685 { \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
686 gripe_nonconformant ("operator .^", a_dims, b_dims); \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
687 return octave_value (); \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
688 } \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
689 T1 ## NDArray result (a_dims); \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
690 for (int i = 0; i < a.length (); i++) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
691 { \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
692 OCTAVE_QUIT; \ |
7914
e998e81224b5
Various compilation fixes for MSVC.
John W. Eaton <jwe@octave.org>
parents:
7789
diff
changeset
|
693 result (i) = powf (a(i), b(i)); \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
694 } \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
695 return octave_value (result); \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
696 } \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
697 \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
698 octave_value \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
699 elem_xpow (const FloatNDArray& a, const T2 ## NDArray& b) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
700 { \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
701 dim_vector a_dims = a.dims (); \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
702 dim_vector b_dims = b.dims (); \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
703 if (a_dims != b_dims) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
704 { \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
705 gripe_nonconformant ("operator .^", a_dims, b_dims); \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
706 return octave_value (); \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
707 } \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
708 T2 ## NDArray result (a_dims); \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
709 for (int i = 0; i < a.length (); i++) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
710 { \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
711 OCTAVE_QUIT; \ |
7914
e998e81224b5
Various compilation fixes for MSVC.
John W. Eaton <jwe@octave.org>
parents:
7789
diff
changeset
|
712 result (i) = powf (a(i), b(i)); \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
713 } \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
714 return octave_value (result); \ |
4953 | 715 } |
4952 | 716 |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
717 |
4964 | 718 #define OCTAVE_MM_CONV(T1, T2) \ |
719 DEFCONV (T1 ## m_ ## T2 ## m_conv, T1 ## matrix, T2 ## matrix) \ | |
720 { \ | |
721 CAST_CONV_ARG (const octave_ ## T1 ## matrix&); \ | |
722 \ | |
723 return new octave_ ## T2 ## matrix (v.T2 ## array_value ()); \ | |
724 } | |
725 | |
4905 | 726 #define OCTAVE_MM_INT_OPS(TYPE) \ |
727 OCTAVE_M_INT_UNOPS (TYPE) \ | |
4952 | 728 OCTAVE_MM_POW_OPS (TYPE, TYPE) \ |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
729 OCTAVE_MM_INT_ARITH_OPS (mm, TYPE ## _, TYPE ## _) \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
730 OCTAVE_MM_INT_ARITH_OPS (mmx, TYPE ## _, ) \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
731 OCTAVE_MM_INT_ARITH_OPS (mxm, , TYPE ## _) \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
732 OCTAVE_MM_INT_ARITH_OPS (mmfx, TYPE ## _, float_) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
733 OCTAVE_MM_INT_ARITH_OPS (mfxm, float_, TYPE ## _) \ |
4964 | 734 OCTAVE_MM_INT_CMP_OPS (mm, TYPE ## _, TYPE ## _) \ |
735 OCTAVE_MM_INT_CMP_OPS (mmx, TYPE ## _, ) \ | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
736 OCTAVE_MM_INT_CMP_OPS (mfxm, float_, TYPE ## _) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
737 OCTAVE_MM_INT_CMP_OPS (mmfx, TYPE ## _, float_) \ |
5038 | 738 OCTAVE_MM_INT_CMP_OPS (mxm, , TYPE ## _) \ |
4964 | 739 OCTAVE_MM_INT_BOOL_OPS (mm, TYPE ## _, TYPE ## _) \ |
740 OCTAVE_MM_INT_BOOL_OPS (mmx, TYPE ## _, ) \ | |
5038 | 741 OCTAVE_MM_INT_BOOL_OPS (mxm, , TYPE ## _) \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
742 OCTAVE_MM_INT_BOOL_OPS (mmfx, TYPE ## _, float_) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
743 OCTAVE_MM_INT_BOOL_OPS (mfxm, float_, TYPE ## _) \ |
4953 | 744 OCTAVE_MM_INT_ASSIGN_OPS (mm, TYPE ## _, TYPE ## _, TYPE ## _) \ |
4964 | 745 OCTAVE_MM_INT_ASSIGN_OPS (mmx, TYPE ## _, , ) \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
746 OCTAVE_MM_INT_ASSIGN_OPS (mmfx, TYPE ## _, float_, float_) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
747 OCTAVE_MM_CONV(TYPE ## _, complex_) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
748 OCTAVE_MM_CONV(TYPE ## _, float_complex_) |
4905 | 749 |
4963 | 750 #define OCTAVE_RE_INT_ASSIGN_OPS(TYPE) \ |
751 DEFNDASSIGNOP_FN (TYPE ## ms_assign, matrix, TYPE ## _scalar, array, assign) \ | |
752 DEFNDASSIGNOP_FN (TYPE ## mm_assign, matrix, TYPE ## _matrix, array, assign) | |
753 | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
754 #define OCTAVE_FLT_RE_INT_ASSIGN_OPS(TYPE) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
755 DEFNDASSIGNOP_FN (TYPE ## fms_assign, float_matrix, TYPE ## _scalar, float_array, assign) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
756 DEFNDASSIGNOP_FN (TYPE ## fmm_assign, float_matrix, TYPE ## _matrix, float_array, assign) |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
757 |
4963 | 758 #define OCTAVE_CX_INT_ASSIGN_OPS(TYPE) \ |
759 DEFNDASSIGNOP_FN (TYPE ## cms_assign, complex_matrix, TYPE ## _scalar, complex_array, assign) \ | |
760 DEFNDASSIGNOP_FN (TYPE ## cmm_assign, complex_matrix, TYPE ## _matrix, complex_array, assign) | |
761 | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
762 #define OCTAVE_FLT_CX_INT_ASSIGN_OPS(TYPE) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
763 DEFNDASSIGNOP_FN (TYPE ## fcms_assign, float_complex_matrix, TYPE ## _scalar, float_complex_array, assign) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
764 DEFNDASSIGNOP_FN (TYPE ## fcmm_assign, float_complex_matrix, TYPE ## _matrix, float_complex_array, assign) |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
765 |
4905 | 766 #define OCTAVE_INT_OPS(TYPE) \ |
767 OCTAVE_SS_INT_OPS (TYPE) \ | |
768 OCTAVE_SM_INT_OPS (TYPE) \ | |
769 OCTAVE_MS_INT_OPS (TYPE) \ | |
4915 | 770 OCTAVE_MM_INT_OPS (TYPE) \ |
4963 | 771 OCTAVE_CONCAT_FN (TYPE) \ |
772 OCTAVE_RE_INT_ASSIGN_OPS (TYPE) \ | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
773 OCTAVE_FLT_RE_INT_ASSIGN_OPS (TYPE) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
774 OCTAVE_CX_INT_ASSIGN_OPS (TYPE) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
775 OCTAVE_FLT_CX_INT_ASSIGN_OPS (TYPE) |
4905 | 776 |
777 #define OCTAVE_INSTALL_S_INT_UNOPS(TYPE) \ | |
778 INSTALL_UNOP (op_not, octave_ ## TYPE ## _scalar, s_not); \ | |
4965 | 779 INSTALL_UNOP (op_uplus, octave_ ## TYPE ## _scalar, s_uplus); \ |
4905 | 780 INSTALL_UNOP (op_uminus, octave_ ## TYPE ## _scalar, s_uminus); \ |
781 INSTALL_UNOP (op_transpose, octave_ ## TYPE ## _scalar, s_transpose); \ | |
782 INSTALL_UNOP (op_hermitian, octave_ ## TYPE ## _scalar, s_hermitian); \ | |
783 \ | |
5829 | 784 INSTALL_NCUNOP (op_incr, octave_ ## TYPE ## _scalar, s_incr); \ |
785 INSTALL_NCUNOP (op_decr, octave_ ## TYPE ## _scalar, s_decr); | |
4905 | 786 |
4953 | 787 #define OCTAVE_INSTALL_SS_INT_ARITH_OPS(PFX, T1, T2) \ |
788 INSTALL_BINOP (op_add, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _add); \ | |
789 INSTALL_BINOP (op_sub, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _sub); \ | |
790 INSTALL_BINOP (op_mul, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _mul); \ | |
791 INSTALL_BINOP (op_div, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _div); \ | |
792 INSTALL_BINOP (op_pow, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _pow); \ | |
793 INSTALL_BINOP (op_ldiv, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _ldiv); \ | |
794 INSTALL_BINOP (op_el_mul, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _el_mul); \ | |
795 INSTALL_BINOP (op_el_div, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _el_div); \ | |
796 INSTALL_BINOP (op_el_pow, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _el_pow); \ | |
797 INSTALL_BINOP (op_el_ldiv, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _el_ldiv); | |
4905 | 798 |
4953 | 799 #define OCTAVE_INSTALL_SS_INT_CMP_OPS(PFX, T1, T2) \ |
800 INSTALL_BINOP (op_lt, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _lt); \ | |
801 INSTALL_BINOP (op_le, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _le); \ | |
802 INSTALL_BINOP (op_eq, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _eq); \ | |
803 INSTALL_BINOP (op_ge, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _ge); \ | |
804 INSTALL_BINOP (op_gt, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _gt); \ | |
805 INSTALL_BINOP (op_ne, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _ne); | |
4905 | 806 |
4953 | 807 #define OCTAVE_INSTALL_SS_INT_BOOL_OPS(PFX, T1, T2) \ |
4964 | 808 INSTALL_BINOP (op_el_and, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _el_and); \ |
809 INSTALL_BINOP (op_el_or, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _el_or); | |
4905 | 810 |
811 #define OCTAVE_INSTALL_SS_INT_OPS(TYPE) \ | |
812 OCTAVE_INSTALL_S_INT_UNOPS (TYPE) \ | |
4953 | 813 OCTAVE_INSTALL_SS_INT_ARITH_OPS (ss, TYPE ## _, TYPE ## _) \ |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
814 OCTAVE_INSTALL_SS_INT_ARITH_OPS (ssx, TYPE ## _, ) \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
815 OCTAVE_INSTALL_SS_INT_ARITH_OPS (sxs, , TYPE ## _) \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
816 OCTAVE_INSTALL_SS_INT_ARITH_OPS (ssfx, TYPE ## _, float_) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
817 OCTAVE_INSTALL_SS_INT_ARITH_OPS (sfxs, float_, TYPE ## _) \ |
4953 | 818 OCTAVE_INSTALL_SS_INT_CMP_OPS (ss, TYPE ## _, TYPE ## _) \ |
819 OCTAVE_INSTALL_SS_INT_CMP_OPS (sx, TYPE ## _, ) \ | |
820 OCTAVE_INSTALL_SS_INT_CMP_OPS (xs, , TYPE ## _) \ | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
821 OCTAVE_INSTALL_SS_INT_CMP_OPS (sfx, TYPE ## _, float_) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
822 OCTAVE_INSTALL_SS_INT_CMP_OPS (fxs, float_, TYPE ## _) \ |
4953 | 823 OCTAVE_INSTALL_SS_INT_BOOL_OPS (ss, TYPE ## _, TYPE ## _) \ |
824 OCTAVE_INSTALL_SS_INT_BOOL_OPS (sx, TYPE ## _, ) \ | |
825 OCTAVE_INSTALL_SS_INT_BOOL_OPS (xs, , TYPE ## _) \ | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
826 OCTAVE_INSTALL_SS_INT_BOOL_OPS (sfx, TYPE ## _, float_) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
827 OCTAVE_INSTALL_SS_INT_BOOL_OPS (fxs, float_, TYPE ## _) \ |
4963 | 828 INSTALL_ASSIGNCONV (octave_ ## TYPE ## _scalar, octave_ ## TYPE ## _scalar, octave_ ## TYPE ## _matrix) \ |
829 INSTALL_ASSIGNCONV (octave_ ## TYPE ## _scalar, octave_scalar, octave_ ## TYPE ## _matrix) \ | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
830 INSTALL_ASSIGNCONV (octave_ ## TYPE ## _scalar, octave_float_scalar, octave_ ## TYPE ## _matrix) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
831 INSTALL_ASSIGNCONV (octave_ ## TYPE ## _scalar, octave_complex_scalar, octave_complex_matrix) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
832 INSTALL_ASSIGNCONV (octave_ ## TYPE ## _scalar, octave_float_complex_scalar, octave_float_complex_matrix) |
4905 | 833 |
4953 | 834 #define OCTAVE_INSTALL_SM_INT_ARITH_OPS(PFX, T1, T2) \ |
835 INSTALL_BINOP (op_add, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _add); \ | |
836 INSTALL_BINOP (op_sub, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _sub); \ | |
837 INSTALL_BINOP (op_mul, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _mul); \ | |
838 /* INSTALL_BINOP (op_div, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _div); */ \ | |
839 /* INSTALL_BINOP (op_pow, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _pow); */ \ | |
840 INSTALL_BINOP (op_ldiv, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _ldiv); \ | |
841 INSTALL_BINOP (op_el_mul, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _el_mul); \ | |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
842 INSTALL_BINOP (op_el_div, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _el_div); \ |
4953 | 843 INSTALL_BINOP (op_el_pow, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _el_pow); \ |
844 INSTALL_BINOP (op_el_ldiv, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _el_ldiv); | |
4905 | 845 |
4953 | 846 #define OCTAVE_INSTALL_SM_INT_CMP_OPS(PFX, T1, T2) \ |
847 INSTALL_BINOP (op_lt, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _lt); \ | |
848 INSTALL_BINOP (op_le, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _le); \ | |
849 INSTALL_BINOP (op_eq, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _eq); \ | |
850 INSTALL_BINOP (op_ge, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _ge); \ | |
851 INSTALL_BINOP (op_gt, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _gt); \ | |
852 INSTALL_BINOP (op_ne, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _ne); | |
4905 | 853 |
4953 | 854 #define OCTAVE_INSTALL_SM_INT_BOOL_OPS(PFX, T1, T2) \ |
4964 | 855 INSTALL_BINOP (op_el_and, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _el_and); \ |
856 INSTALL_BINOP (op_el_or, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _el_or); | |
4905 | 857 |
858 #define OCTAVE_INSTALL_SM_INT_OPS(TYPE) \ | |
4953 | 859 OCTAVE_INSTALL_SM_INT_ARITH_OPS (sm, TYPE ## _, TYPE ## _) \ |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
860 OCTAVE_INSTALL_SM_INT_ARITH_OPS (smx, TYPE ## _, ) \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
861 OCTAVE_INSTALL_SM_INT_ARITH_OPS (sxm, , TYPE ## _) \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
862 OCTAVE_INSTALL_SM_INT_ARITH_OPS (smfx, TYPE ## _, float_) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
863 OCTAVE_INSTALL_SM_INT_ARITH_OPS (sfxm, float_, TYPE ## _) \ |
4953 | 864 OCTAVE_INSTALL_SM_INT_CMP_OPS (sm, TYPE ## _, TYPE ## _) \ |
865 OCTAVE_INSTALL_SM_INT_CMP_OPS (xm, , TYPE ## _) \ | |
4964 | 866 OCTAVE_INSTALL_SM_INT_CMP_OPS (smx, TYPE ## _, ) \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
867 OCTAVE_INSTALL_SM_INT_CMP_OPS (fxm, float_, TYPE ## _) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
868 OCTAVE_INSTALL_SM_INT_CMP_OPS (smfx, TYPE ## _, float_) \ |
4953 | 869 OCTAVE_INSTALL_SM_INT_BOOL_OPS (sm, TYPE ## _, TYPE ## _) \ |
870 OCTAVE_INSTALL_SM_INT_BOOL_OPS (xm, , TYPE ## _) \ | |
4964 | 871 OCTAVE_INSTALL_SM_INT_BOOL_OPS (smx, TYPE ## _, ) \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
872 OCTAVE_INSTALL_SM_INT_BOOL_OPS (fxm, float_, TYPE ## _) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
873 OCTAVE_INSTALL_SM_INT_BOOL_OPS (smfx, TYPE ## _, float_) \ |
4964 | 874 INSTALL_WIDENOP (octave_ ## TYPE ## _scalar, octave_ ## TYPE ## _matrix, TYPE ## _s_ ## TYPE ## _m_conv) \ |
875 INSTALL_WIDENOP (octave_ ## TYPE ## _scalar, octave_complex_matrix, TYPE ## _s_complex_m_conv) \ | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
876 INSTALL_WIDENOP (octave_ ## TYPE ## _scalar, octave_float_complex_matrix, TYPE ## _s_float_complex_m_conv) \ |
4963 | 877 INSTALL_ASSIGNCONV (octave_ ## TYPE ## _scalar, octave_ ## TYPE ## _matrix, octave_ ## TYPE ## _matrix) \ |
878 INSTALL_ASSIGNCONV (octave_ ## TYPE ## _scalar, octave_matrix, octave_ ## TYPE ## _matrix) \ | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
879 INSTALL_ASSIGNCONV (octave_ ## TYPE ## _scalar, octave_float_matrix, octave_ ## TYPE ## _matrix) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
880 INSTALL_ASSIGNCONV (octave_ ## TYPE ## _scalar, octave_complex_matrix, octave_complex_matrix) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
881 INSTALL_ASSIGNCONV (octave_ ## TYPE ## _scalar, octave_float_complex_matrix, octave_float_complex_matrix) |
4905 | 882 |
4953 | 883 #define OCTAVE_INSTALL_MS_INT_ARITH_OPS(PFX, T1, T2) \ |
884 INSTALL_BINOP (op_add, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _add); \ | |
885 INSTALL_BINOP (op_sub, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _sub); \ | |
886 INSTALL_BINOP (op_mul, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _mul); \ | |
887 INSTALL_BINOP (op_div, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _div); \ | |
888 /* INSTALL_BINOP (op_pow, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _pow); */ \ | |
889 /* INSTALL_BINOP (op_ldiv, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _ldiv); */ \ | |
4905 | 890 \ |
4953 | 891 INSTALL_BINOP (op_el_mul, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _el_mul); \ |
892 INSTALL_BINOP (op_el_div, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _el_div); \ | |
893 INSTALL_BINOP (op_el_pow, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _el_pow); \ | |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
894 INSTALL_BINOP (op_el_ldiv, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _el_ldiv); |
4905 | 895 |
4953 | 896 #define OCTAVE_INSTALL_MS_INT_CMP_OPS(PFX, T1, T2) \ |
897 INSTALL_BINOP (op_lt, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _lt); \ | |
898 INSTALL_BINOP (op_le, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _le); \ | |
899 INSTALL_BINOP (op_eq, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _eq); \ | |
900 INSTALL_BINOP (op_ge, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _ge); \ | |
901 INSTALL_BINOP (op_gt, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _gt); \ | |
902 INSTALL_BINOP (op_ne, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _ne); | |
903 | |
904 #define OCTAVE_INSTALL_MS_INT_BOOL_OPS(PFX, T1, T2) \ | |
4964 | 905 INSTALL_BINOP (op_el_and, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _el_and); \ |
906 INSTALL_BINOP (op_el_or, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _el_or); | |
4953 | 907 |
908 #define OCTAVE_INSTALL_MS_INT_ASSIGN_OPS(PFX, TLHS, TRHS) \ | |
909 INSTALL_ASSIGNOP (op_asn_eq, octave_ ## TLHS ## matrix, octave_ ## TRHS ## scalar, PFX ## _assign) | |
4905 | 910 |
911 #define OCTAVE_INSTALL_MS_INT_OPS(TYPE) \ | |
4953 | 912 OCTAVE_INSTALL_MS_INT_ARITH_OPS (ms, TYPE ## _, TYPE ## _) \ |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
913 OCTAVE_INSTALL_MS_INT_ARITH_OPS (msx, TYPE ## _, ) \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
914 OCTAVE_INSTALL_MS_INT_ARITH_OPS (mxs, , TYPE ## _) \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
915 OCTAVE_INSTALL_MS_INT_ARITH_OPS (msfx, TYPE ## _, float_) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
916 OCTAVE_INSTALL_MS_INT_ARITH_OPS (mfxs, float_, TYPE ## _) \ |
4953 | 917 OCTAVE_INSTALL_MS_INT_CMP_OPS (ms, TYPE ## _, TYPE ## _) \ |
918 OCTAVE_INSTALL_MS_INT_CMP_OPS (mx, TYPE ## _, ) \ | |
4964 | 919 OCTAVE_INSTALL_MS_INT_CMP_OPS (mxs, , TYPE ## _) \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
920 OCTAVE_INSTALL_MS_INT_CMP_OPS (mfx, TYPE ## _, float_) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
921 OCTAVE_INSTALL_MS_INT_CMP_OPS (mfxs, float_, TYPE ## _) \ |
4953 | 922 OCTAVE_INSTALL_MS_INT_BOOL_OPS (ms, TYPE ## _, TYPE ## _) \ |
923 OCTAVE_INSTALL_MS_INT_BOOL_OPS (mx, TYPE ## _, ) \ | |
4964 | 924 OCTAVE_INSTALL_MS_INT_BOOL_OPS (mxs, , TYPE ## _) \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
925 OCTAVE_INSTALL_MS_INT_BOOL_OPS (mfx, TYPE ## _, float_) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
926 OCTAVE_INSTALL_MS_INT_BOOL_OPS (mfxs, float_, TYPE ## _) \ |
4953 | 927 OCTAVE_INSTALL_MS_INT_ASSIGN_OPS (ms, TYPE ## _, TYPE ## _) \ |
928 OCTAVE_INSTALL_MS_INT_ASSIGN_OPS (mx, TYPE ## _, ) \ | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
929 OCTAVE_INSTALL_MS_INT_ASSIGN_OPS (mfx, TYPE ## _, float_) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
930 INSTALL_ASSIGNCONV (octave_ ## TYPE ## _matrix, octave_complex_scalar, octave_complex_matrix) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
931 INSTALL_ASSIGNCONV (octave_ ## TYPE ## _matrix, octave_float_complex_scalar, octave_float_complex_matrix) |
4905 | 932 |
933 #define OCTAVE_INSTALL_M_INT_UNOPS(TYPE) \ | |
934 INSTALL_UNOP (op_not, octave_ ## TYPE ## _matrix, m_not); \ | |
4965 | 935 INSTALL_UNOP (op_uplus, octave_ ## TYPE ## _matrix, m_uplus); \ |
4905 | 936 INSTALL_UNOP (op_uminus, octave_ ## TYPE ## _matrix, m_uminus); \ |
937 INSTALL_UNOP (op_transpose, octave_ ## TYPE ## _matrix, m_transpose); \ | |
938 INSTALL_UNOP (op_hermitian, octave_ ## TYPE ## _matrix, m_transpose); \ | |
939 \ | |
5829 | 940 INSTALL_NCUNOP (op_incr, octave_ ## TYPE ## _matrix, m_incr); \ |
941 INSTALL_NCUNOP (op_decr, octave_ ## TYPE ## _matrix, m_decr); | |
4905 | 942 |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
943 #define OCTAVE_INSTALL_MM_INT_ARITH_OPS(PFX, T1, T2) \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
944 INSTALL_BINOP (op_add, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _add); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
945 INSTALL_BINOP (op_sub, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _sub); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
946 /* INSTALL_BINOP (op_mul, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _mul); */ \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
947 /* INSTALL_BINOP (op_div, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _div); */ \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
948 INSTALL_BINOP (op_pow, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _pow); \ |
4905 | 949 /* INSTALL_BINOP (op_ldiv, octave_ ## T1 ## _matrix, octave_ ## T2 ## _matrix, mm_ldiv); */ \ |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
950 INSTALL_BINOP (op_el_mul, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _el_mul); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
951 INSTALL_BINOP (op_el_div, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _el_div); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
952 INSTALL_BINOP (op_el_pow, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _el_pow); \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
953 INSTALL_BINOP (op_el_ldiv, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _el_ldiv); |
4905 | 954 |
4964 | 955 #define OCTAVE_INSTALL_MM_INT_CMP_OPS(PFX, T1, T2) \ |
956 INSTALL_BINOP (op_lt, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _lt); \ | |
957 INSTALL_BINOP (op_le, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _le); \ | |
958 INSTALL_BINOP (op_eq, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _eq); \ | |
959 INSTALL_BINOP (op_ge, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _ge); \ | |
960 INSTALL_BINOP (op_gt, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _gt); \ | |
961 INSTALL_BINOP (op_ne, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _ne); | |
4905 | 962 |
4964 | 963 #define OCTAVE_INSTALL_MM_INT_BOOL_OPS(PFX, T1, T2) \ |
964 INSTALL_BINOP (op_el_and, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _el_and); \ | |
965 INSTALL_BINOP (op_el_or, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _el_or); | |
4905 | 966 |
4953 | 967 #define OCTAVE_INSTALL_MM_INT_ASSIGN_OPS(PFX, TLHS, TRHS) \ |
968 INSTALL_ASSIGNOP (op_asn_eq, octave_ ## TLHS ## matrix, octave_ ## TRHS ## matrix, PFX ## _assign) | |
4905 | 969 |
970 #define OCTAVE_INSTALL_MM_INT_OPS(TYPE) \ | |
971 OCTAVE_INSTALL_M_INT_UNOPS (TYPE) \ | |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
972 OCTAVE_INSTALL_MM_INT_ARITH_OPS (mm, TYPE ##_, TYPE ## _) \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
973 OCTAVE_INSTALL_MM_INT_ARITH_OPS (mmx, TYPE ##_, ) \ |
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
974 OCTAVE_INSTALL_MM_INT_ARITH_OPS (mxm, , TYPE ##_) \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
975 OCTAVE_INSTALL_MM_INT_ARITH_OPS (mmfx, TYPE ##_, float_) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
976 OCTAVE_INSTALL_MM_INT_ARITH_OPS (mfxm, float_, TYPE ##_) \ |
4964 | 977 OCTAVE_INSTALL_MM_INT_CMP_OPS (mm, TYPE ## _, TYPE ## _) \ |
978 OCTAVE_INSTALL_MM_INT_CMP_OPS (mmx, TYPE ## _, ) \ | |
5038 | 979 OCTAVE_INSTALL_MM_INT_CMP_OPS (mxm, , TYPE ## _) \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
980 OCTAVE_INSTALL_MM_INT_CMP_OPS (mmfx, TYPE ## _, float_) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
981 OCTAVE_INSTALL_MM_INT_CMP_OPS (mfxm, float_, TYPE ## _) \ |
4964 | 982 OCTAVE_INSTALL_MM_INT_BOOL_OPS (mm, TYPE ## _, TYPE ## _) \ |
983 OCTAVE_INSTALL_MM_INT_BOOL_OPS (mmx, TYPE ## _, ) \ | |
5038 | 984 OCTAVE_INSTALL_MM_INT_BOOL_OPS (mxm, , TYPE ## _) \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
985 OCTAVE_INSTALL_MM_INT_BOOL_OPS (mmfx, TYPE ## _, float_) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
986 OCTAVE_INSTALL_MM_INT_BOOL_OPS (mfxm, float_, TYPE ## _) \ |
4953 | 987 OCTAVE_INSTALL_MM_INT_ASSIGN_OPS (mm, TYPE ## _, TYPE ## _) \ |
988 OCTAVE_INSTALL_MM_INT_ASSIGN_OPS (mmx, TYPE ## _, ) \ | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
989 OCTAVE_INSTALL_MM_INT_ASSIGN_OPS (mmfx, TYPE ## _, float_) \ |
4964 | 990 INSTALL_WIDENOP (octave_ ## TYPE ## _matrix, octave_complex_matrix, TYPE ## _m_complex_m_conv) \ |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
991 INSTALL_WIDENOP (octave_ ## TYPE ## _matrix, octave_float_complex_matrix, TYPE ## _m_float_complex_m_conv) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
992 INSTALL_ASSIGNCONV (octave_ ## TYPE ## _matrix, octave_complex_matrix, octave_complex_matrix) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
993 INSTALL_ASSIGNCONV (octave_ ## TYPE ## _matrix, octave_float_complex_matrix, octave_float_complex_matrix) |
4905 | 994 |
4963 | 995 #define OCTAVE_INSTALL_RE_INT_ASSIGN_OPS(TYPE) \ |
996 INSTALL_ASSIGNOP (op_asn_eq, octave_matrix, octave_ ## TYPE ## _scalar, TYPE ## ms_assign) \ | |
997 INSTALL_ASSIGNOP (op_asn_eq, octave_matrix, octave_ ## TYPE ## _matrix, TYPE ## mm_assign) \ | |
998 INSTALL_ASSIGNCONV (octave_scalar, octave_ ## TYPE ## _scalar, octave_matrix) \ | |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
999 INSTALL_ASSIGNCONV (octave_matrix, octave_ ## TYPE ## _matrix, octave_matrix) |
4963 | 1000 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
1001 #define OCTAVE_INSTALL_FLT_RE_INT_ASSIGN_OPS(TYPE) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
1002 INSTALL_ASSIGNOP (op_asn_eq, octave_float_matrix, octave_ ## TYPE ## _scalar, TYPE ## fms_assign) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
1003 INSTALL_ASSIGNOP (op_asn_eq, octave_float_matrix, octave_ ## TYPE ## _matrix, TYPE ## fmm_assign) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
1004 INSTALL_ASSIGNCONV (octave_float_scalar, octave_ ## TYPE ## _scalar, octave_float_matrix) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
1005 INSTALL_ASSIGNCONV (octave_float_matrix, octave_ ## TYPE ## _matrix, octave_float_matrix) |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
1006 |
4963 | 1007 #define OCTAVE_INSTALL_CX_INT_ASSIGN_OPS(TYPE) \ |
1008 INSTALL_ASSIGNOP (op_asn_eq, octave_complex_matrix, octave_ ## TYPE ## _scalar, TYPE ## cms_assign) \ | |
1009 INSTALL_ASSIGNOP (op_asn_eq, octave_complex_matrix, octave_ ## TYPE ## _matrix, TYPE ## cmm_assign) \ | |
1010 INSTALL_ASSIGNCONV (octave_complex_scalar, octave_ ## TYPE ## _scalar, octave_complex_matrix) \ | |
7625
43e3efb2cbc2
Add integer el_div and el_ldiv operators to the binops that were missing them
David Bateman <dbateman@free.fr>
parents:
7017
diff
changeset
|
1011 INSTALL_ASSIGNCONV (octave_complex_matrix, octave_ ## TYPE ## _matrix, octave_complex_matrix) |
4963 | 1012 |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
1013 #define OCTAVE_INSTALL_FLT_CX_INT_ASSIGN_OPS(TYPE) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
1014 INSTALL_ASSIGNOP (op_asn_eq, octave_float_complex_matrix, octave_ ## TYPE ## _scalar, TYPE ## fcms_assign) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
1015 INSTALL_ASSIGNOP (op_asn_eq, octave_float_complex_matrix, octave_ ## TYPE ## _matrix, TYPE ## fcmm_assign) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
1016 INSTALL_ASSIGNCONV (octave_float_complex_scalar, octave_ ## TYPE ## _scalar, octave_complex_matrix) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
1017 INSTALL_ASSIGNCONV (octave_float_complex_matrix, octave_ ## TYPE ## _matrix, octave_complex_matrix) |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
1018 |
4905 | 1019 #define OCTAVE_INSTALL_INT_OPS(TYPE) \ |
1020 OCTAVE_INSTALL_SS_INT_OPS (TYPE) \ | |
1021 OCTAVE_INSTALL_SM_INT_OPS (TYPE) \ | |
1022 OCTAVE_INSTALL_MS_INT_OPS (TYPE) \ | |
4915 | 1023 OCTAVE_INSTALL_MM_INT_OPS (TYPE) \ |
4963 | 1024 OCTAVE_INSTALL_CONCAT_FN (TYPE) \ |
1025 OCTAVE_INSTALL_RE_INT_ASSIGN_OPS (TYPE) \ | |
7789
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
1026 OCTAVE_INSTALL_FLT_RE_INT_ASSIGN_OPS (TYPE) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
1027 OCTAVE_INSTALL_CX_INT_ASSIGN_OPS (TYPE) \ |
82be108cc558
First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
7625
diff
changeset
|
1028 OCTAVE_INSTALL_FLT_CX_INT_ASSIGN_OPS (TYPE) |
4963 | 1029 |
1030 #define OCTAVE_INSTALL_SM_INT_ASSIGNCONV(TLHS, TRHS) \ | |
1031 INSTALL_ASSIGNCONV (octave_ ## TLHS ## _scalar, octave_ ## TRHS ## _scalar, octave_ ## TLHS ## _matrix) \ | |
1032 INSTALL_ASSIGNCONV (octave_ ## TLHS ## _scalar, octave_ ## TRHS ## _matrix, octave_ ## TLHS ## _matrix) | |
4905 | 1033 |
4964 | 1034 #define OCTAVE_MIXED_INT_CMP_OPS(T1, T2) \ |
1035 OCTAVE_SS_INT_CMP_OPS (T1 ## _ ## T2 ## _ss, T1 ## _, T2 ## _) \ | |
1036 OCTAVE_SM_INT_CMP_OPS (T1 ## _ ## T2 ## _sm, T1 ## _, T2 ## _) \ | |
1037 OCTAVE_MS_INT_CMP_OPS (T1 ## _ ## T2 ## _ms, T1 ## _, T2 ## _) \ | |
1038 OCTAVE_MM_INT_CMP_OPS (T1 ## _ ## T2 ## _mm, T1 ## _, T2 ## _) | |
1039 | |
1040 #define OCTAVE_INSTALL_MIXED_INT_CMP_OPS(T1, T2) \ | |
1041 OCTAVE_INSTALL_SS_INT_CMP_OPS (T1 ## _ ## T2 ## _ss, T1 ## _, T2 ## _) \ | |
1042 OCTAVE_INSTALL_SM_INT_CMP_OPS (T1 ## _ ## T2 ## _sm, T1 ## _, T2 ## _) \ | |
1043 OCTAVE_INSTALL_MS_INT_CMP_OPS (T1 ## _ ## T2 ## _ms, T1 ## _, T2 ## _) \ | |
1044 OCTAVE_INSTALL_MM_INT_CMP_OPS (T1 ## _ ## T2 ## _mm, T1 ## _, T2 ## _) | |
1045 | |
4905 | 1046 /* |
1047 ;;; Local Variables: *** | |
1048 ;;; mode: C++ *** | |
1049 ;;; End: *** | |
1050 */ |