26 #if ! defined (octave_op_int_h)
27 #define octave_op_int_h 1
29 #include "octave-config.h"
34 #define DEFINTBINOP_OP(name, t1, t2, op, t3) \
36 CONCAT2 (oct_binop_, name) (const octave_base_value& a1, \
37 const octave_base_value& a2) \
39 const octave_ ## t1& v1 = dynamic_cast<const octave_ ## t1&> (a1); \
40 const octave_ ## t2& v2 = dynamic_cast<const octave_ ## t2&> (a2); \
41 octave_value retval = octave_value \
42 (v1.t1 ## _value () op v2.t2 ## _value ()); \
46 #define DEFINTNDBINOP_OP(name, t1, t2, e1, e2, op, t3) \
48 CONCAT2 (oct_binop_, name) (const octave_base_value& a1, \
49 const octave_base_value& a2) \
51 const octave_ ## t1& v1 = dynamic_cast<const octave_ ## t1&> (a1); \
52 const octave_ ## t2& v2 = dynamic_cast<const octave_ ## t2&> (a2); \
53 octave_value retval = octave_value \
54 (v1.e1 ## _value () op v2.e2 ## _value ()); \
58 #define DEFINTBINOP_FN(name, t1, t2, f, t3, op) \
60 CONCAT2 (oct_binop_, name) (const octave_base_value& a1, \
61 const octave_base_value& a2) \
63 const octave_ ## t1& v1 = dynamic_cast<const octave_ ## t1&> (a1); \
64 const octave_ ## t2& v2 = dynamic_cast<const octave_ ## t2&> (a2); \
65 octave_value retval = octave_value (f (v1.t1 ## _value (), v2.t2 ## _value ())); \
69 #define DEFINTNDBINOP_FN(name, t1, t2, e1, e2, f, t3, op) \
71 CONCAT2 (oct_binop_, name) (const octave_base_value& a1, \
72 const octave_base_value& a2) \
74 const octave_ ## t1& v1 = dynamic_cast<const octave_ ## t1&> (a1); \
75 const octave_ ## t2& v2 = dynamic_cast<const octave_ ## t2&> (a2); \
76 octave_value retval = octave_value (f (v1.e1 ## _value (), v2.e2 ## _value ())); \
80 #define OCTAVE_CONCAT_FN2(T1, T2) \
81 DEFNDCATOP_FN2 (T1 ## _ ## T2 ## _s_s, T1 ## _scalar, T2 ## _scalar, , T1 ## NDArray, T1 ## _array, T2 ## _array, concat) \
82 DEFNDCATOP_FN2 (T1 ## _ ## T2 ## _s_m, T1 ## _scalar, T2 ## _matrix, , T1 ## NDArray, T1 ## _array, T2 ## _array, concat) \
83 DEFNDCATOP_FN2 (T1 ## _ ## T2 ## _m_s, T1 ## _matrix, T2 ## _scalar, , T1 ## NDArray, T1 ## _array, T2 ## _array, concat) \
84 DEFNDCATOP_FN2 (T1 ## _ ## T2 ## _m_m, T1 ## _matrix, T2 ## _matrix, , T1 ## NDArray, T1 ## _array, T2 ## _array, concat)
86 #define OCTAVE_INSTALL_CONCAT_FN2(T1, T2) \
87 INSTALL_CATOP_TI (ti, octave_ ## T1 ## _scalar, octave_ ## T2 ## _scalar, T1 ## _ ## T2 ## _s_s) \
88 INSTALL_CATOP_TI (ti, octave_ ## T1 ## _scalar, octave_ ## T2 ## _matrix, T1 ## _ ## T2 ## _s_m) \
89 INSTALL_CATOP_TI (ti, octave_ ## T1 ## _matrix, octave_ ## T2 ## _scalar, T1 ## _ ## T2 ## _m_s) \
90 INSTALL_CATOP_TI (ti, octave_ ## T1 ## _matrix, octave_ ## T2 ## _matrix, T1 ## _ ## T2 ## _m_m)
92 #define OCTAVE_DOUBLE_INT_CONCAT_FN(TYPE) \
93 DEFNDCATOP_FN2 (double ## _ ## TYPE ## _s_s, scalar, TYPE ## _scalar, TYPE ## NDArray, , array, TYPE ## _array, concat) \
94 DEFNDCATOP_FN2 (double ## _ ## TYPE ## _s_m, scalar, TYPE ## _matrix, TYPE ## NDArray, , array, TYPE ## _array, concat) \
95 DEFNDCATOP_FN2 (double ## _ ## TYPE ## _m_s, matrix, TYPE ## _scalar, TYPE ## NDArray, , array, TYPE ## _array, concat) \
96 DEFNDCATOP_FN2 (double ## _ ## TYPE ## _m_m, matrix, TYPE ## _matrix, TYPE ## NDArray, , array, TYPE ## _array, concat)
98 #define OCTAVE_INSTALL_DOUBLE_INT_CONCAT_FN(TYPE) \
99 INSTALL_CATOP_TI (ti, octave_scalar, octave_ ## TYPE ## _scalar, double ## _ ## TYPE ## _s_s) \
100 INSTALL_CATOP_TI (ti, octave_scalar, octave_ ## TYPE ## _matrix, double ## _ ## TYPE ## _s_m) \
101 INSTALL_CATOP_TI (ti, octave_matrix, octave_ ## TYPE ## _scalar, double ## _ ## TYPE ## _m_s) \
102 INSTALL_CATOP_TI (ti, octave_matrix, octave_ ## TYPE ## _matrix, double ## _ ## TYPE ## _m_m)
104 #define OCTAVE_INT_DOUBLE_CONCAT_FN(TYPE) \
105 DEFNDCATOP_FN2 (TYPE ## _ ## double ## _s_s, TYPE ## _scalar, scalar, , TYPE ## NDArray, TYPE ## _array, array, concat) \
106 DEFNDCATOP_FN2 (TYPE ## _ ## double ## _s_m, TYPE ## _scalar, matrix, , TYPE ## NDArray, TYPE ## _array, array, concat) \
107 DEFNDCATOP_FN2 (TYPE ## _ ## double ## _m_s, TYPE ## _matrix, scalar, , TYPE ## NDArray, TYPE ## _array, array, concat) \
108 DEFNDCATOP_FN2 (TYPE ## _ ## double ## _m_m, TYPE ## _matrix, matrix, , TYPE ## NDArray, TYPE ## _array, array, concat)
110 #define OCTAVE_INSTALL_INT_DOUBLE_CONCAT_FN(TYPE) \
111 INSTALL_CATOP_TI (ti, octave_ ## TYPE ## _scalar, octave_scalar, TYPE ## _ ## double ## _s_s) \
112 INSTALL_CATOP_TI (ti, octave_ ## TYPE ## _scalar, octave_matrix, TYPE ## _ ## double ## _s_m) \
113 INSTALL_CATOP_TI (ti, octave_ ## TYPE ## _matrix, octave_scalar, TYPE ## _ ## double ## _m_s) \
114 INSTALL_CATOP_TI (ti, octave_ ## TYPE ## _matrix, octave_matrix, TYPE ## _ ## double ## _m_m)
116 #define OCTAVE_FLOAT_INT_CONCAT_FN(TYPE) \
117 DEFNDCATOP_FN2 (float ## _ ## TYPE ## _s_s, float_scalar, TYPE ## _scalar, TYPE ## NDArray, , float_array, TYPE ## _array, concat) \
118 DEFNDCATOP_FN2 (float ## _ ## TYPE ## _s_m, float_scalar, TYPE ## _matrix, TYPE ## NDArray, , float_array, TYPE ## _array, concat) \
119 DEFNDCATOP_FN2 (float ## _ ## TYPE ## _m_s, float_matrix, TYPE ## _scalar, TYPE ## NDArray, , float_array, TYPE ## _array, concat) \
120 DEFNDCATOP_FN2 (float ## _ ## TYPE ## _m_m, float_matrix, TYPE ## _matrix, TYPE ## NDArray, , float_array, TYPE ## _array, concat)
122 #define OCTAVE_INSTALL_FLOAT_INT_CONCAT_FN(TYPE) \
123 INSTALL_CATOP_TI (ti, octave_float_scalar, octave_ ## TYPE ## _scalar, float ## _ ## TYPE ## _s_s) \
124 INSTALL_CATOP_TI (ti, octave_float_scalar, octave_ ## TYPE ## _matrix, float ## _ ## TYPE ## _s_m) \
125 INSTALL_CATOP_TI (ti, octave_float_matrix, octave_ ## TYPE ## _scalar, float ## _ ## TYPE ## _m_s) \
126 INSTALL_CATOP_TI (ti, octave_float_matrix, octave_ ## TYPE ## _matrix, float ## _ ## TYPE ## _m_m)
128 #define OCTAVE_INT_FLOAT_CONCAT_FN(TYPE) \
129 DEFNDCATOP_FN2 (TYPE ## _ ## float ## _s_s, TYPE ## _scalar, float_scalar, , TYPE ## NDArray, TYPE ## _array, float_array, concat) \
130 DEFNDCATOP_FN2 (TYPE ## _ ## float ## _s_m, TYPE ## _scalar, float_matrix, , TYPE ## NDArray, TYPE ## _array, float_array, concat) \
131 DEFNDCATOP_FN2 (TYPE ## _ ## float ## _m_s, TYPE ## _matrix, float_scalar, , TYPE ## NDArray, TYPE ## _array, float_array, concat) \
132 DEFNDCATOP_FN2 (TYPE ## _ ## float ## _m_m, TYPE ## _matrix, float_matrix, , TYPE ## NDArray, TYPE ## _array, float_array, concat)
134 #define OCTAVE_INSTALL_INT_FLOAT_CONCAT_FN(TYPE) \
135 INSTALL_CATOP_TI (ti, octave_ ## TYPE ## _scalar, octave_float_scalar, TYPE ## _ ## float ## _s_s) \
136 INSTALL_CATOP_TI (ti, octave_ ## TYPE ## _scalar, octave_float_matrix, TYPE ## _ ## float ## _s_m) \
137 INSTALL_CATOP_TI (ti, octave_ ## TYPE ## _matrix, octave_float_scalar, TYPE ## _ ## float ## _m_s) \
138 INSTALL_CATOP_TI (ti, octave_ ## TYPE ## _matrix, octave_float_matrix, TYPE ## _ ## float ## _m_m)
143 #define OCTAVE_CHAR_INT_CONCAT_FN(TYPE) \
144 DEFNDCHARCATOP_FN (char ## _ ## TYPE ## _m_s, char_matrix, TYPE ## _scalar, concat) \
145 DEFNDCHARCATOP_FN (char ## _ ## TYPE ## _m_m, char_matrix, TYPE ## _matrix, concat)
147 #define OCTAVE_INSTALL_CHAR_INT_CONCAT_FN(TYPE) \
148 INSTALL_CATOP_TI (ti, octave_char_matrix_str, octave_ ## TYPE ## _scalar, char ## _ ## TYPE ## _m_s) \
149 INSTALL_CATOP_TI (ti, octave_char_matrix_str, octave_ ## TYPE ## _matrix, char ## _ ## TYPE ## _m_m) \
150 INSTALL_CATOP_TI (ti, octave_char_matrix_sq_str, octave_ ## TYPE ## _scalar, char ## _ ## TYPE ## _m_s) \
151 INSTALL_CATOP_TI (ti, octave_char_matrix_sq_str, octave_ ## TYPE ## _matrix, char ## _ ## TYPE ## _m_m)
153 #define OCTAVE_INT_CHAR_CONCAT_FN(TYPE) \
154 DEFNDCHARCATOP_FN (TYPE ## _ ## char ## _s_m, TYPE ## _scalar, char_matrix, concat) \
155 DEFNDCHARCATOP_FN (TYPE ## _ ## char ## _m_m, TYPE ## _matrix, char_matrix, concat)
157 #define OCTAVE_INSTALL_INT_CHAR_CONCAT_FN(TYPE) \
158 INSTALL_CATOP_TI (ti, octave_ ## TYPE ## _scalar, octave_char_matrix_str, TYPE ## _ ## char ## _s_m) \
159 INSTALL_CATOP_TI (ti, octave_ ## TYPE ## _matrix, octave_char_matrix_str, TYPE ## _ ## char ## _m_m) \
160 INSTALL_CATOP_TI (ti, octave_ ## TYPE ## _scalar, octave_char_matrix_sq_str, TYPE ## _ ## char ## _s_m) \
161 INSTALL_CATOP_TI (ti, octave_ ## TYPE ## _matrix, octave_char_matrix_sq_str, TYPE ## _ ## char ## _m_m)
163 #define OCTAVE_CONCAT_FN(TYPE) \
164 DEFNDCATOP_FN (TYPE ## _s_s, TYPE ## _scalar, TYPE ## _scalar, TYPE ## _array, TYPE ## _array, concat) \
165 DEFNDCATOP_FN (TYPE ## _s_m, TYPE ## _scalar, TYPE ## _matrix, TYPE ## _array, TYPE ## _array, concat) \
166 DEFNDCATOP_FN (TYPE ## _m_s, TYPE ## _matrix, TYPE ## _scalar, TYPE ## _array, TYPE ## _array, concat) \
167 DEFNDCATOP_FN (TYPE ## _m_m, TYPE ## _matrix, TYPE ## _matrix, TYPE ## _array, TYPE ## _array, concat)
169 #define OCTAVE_INSTALL_CONCAT_FN(TYPE) \
170 INSTALL_CATOP_TI (ti, octave_ ## TYPE ## _scalar, octave_ ## TYPE ## _scalar, TYPE ## _s_s) \
171 INSTALL_CATOP_TI (ti, octave_ ## TYPE ## _scalar, octave_ ## TYPE ## _matrix, TYPE ## _s_m) \
172 INSTALL_CATOP_TI (ti, octave_ ## TYPE ## _matrix, octave_ ## TYPE ## _scalar, TYPE ## _m_s) \
173 INSTALL_CATOP_TI (ti, octave_ ## TYPE ## _matrix, octave_ ## TYPE ## _matrix, TYPE ## _m_m)
176 #define OCTAVE_S_INT_UNOPS(TYPE) \
178 DEFUNOP_OP (s_not, TYPE ## _scalar, !) \
179 DEFUNOP_OP (s_uplus, TYPE ## _scalar, ) \
180 DEFUNOP (s_uminus, TYPE ## _scalar) \
182 const octave_ ## TYPE ## _scalar & v = dynamic_cast<const octave_ ## TYPE ## _scalar &> (a); \
183 octave_value retval = octave_value (- v. TYPE ## _scalar_value ()); \
186 DEFUNOP_OP (s_transpose, TYPE ## _scalar, ) \
187 DEFUNOP_OP (s_hermitian, TYPE ## _scalar, ) \
189 DEFNCUNOP_METHOD (s_incr, TYPE ## _scalar, increment) \
190 DEFNCUNOP_METHOD (s_decr, TYPE ## _scalar, decrement)
193 #define OCTAVE_SS_INT_ARITH_OPS(PFX, T1, T2, T3) \
195 DEFINTBINOP_OP (PFX ## _add, T1 ## scalar, T2 ## scalar, +, T3) \
196 DEFINTBINOP_OP (PFX ## _sub, T1 ## scalar, T2 ## scalar, -, T3) \
197 DEFINTBINOP_OP (PFX ## _mul, T1 ## scalar, T2 ## scalar, *, T3) \
199 DEFBINOP (PFX ## _div, T1 ## scalar, T2 ## scalar) \
201 const octave_ ## T1 ## scalar& v1 = dynamic_cast<const octave_ ## T1 ## scalar&> (a1); \
202 const octave_ ## T2 ## scalar& v2 = dynamic_cast<const octave_ ## T2 ## scalar&> (a2); \
204 return octave_value (v1.T1 ## scalar_value () / v2.T2 ## scalar_value ()); \
207 DEFINTBINOP_FN (PFX ## _pow, T1 ## scalar, T2 ## scalar, xpow, T3, ^) \
209 DEFBINOP (PFX ## _ldiv, T1 ## scalar, T2 ## scalar) \
211 const octave_ ## T1 ## scalar& v1 = dynamic_cast<const octave_ ## T1 ## scalar&> (a1); \
212 const octave_ ## T2 ## scalar& v2 = dynamic_cast<const octave_ ## T2 ## scalar&> (a2); \
214 return octave_value (v2.T2 ## scalar_value () / v1.T1 ## scalar_value ()); \
217 DEFINTBINOP_OP (PFX ## _el_mul, T1 ## scalar, T2 ## scalar, *, T3) \
219 DEFBINOP (PFX ## _el_div, T1 ## scalar, T2 ## scalar) \
221 const octave_ ## T1 ## scalar& v1 = dynamic_cast<const octave_ ## T1 ## scalar&> (a1); \
222 const octave_ ## T2 ## scalar& v2 = dynamic_cast<const octave_ ## T2 ## scalar&> (a2); \
224 return octave_value (v1.T1 ## scalar_value () / v2.T2 ## scalar_value ()); \
227 DEFINTBINOP_FN (PFX ## _el_pow, T1 ## scalar, T2 ## scalar, xpow, T3, .^) \
229 DEFBINOP (PFX ## _el_ldiv, T1 ## scalar, T2 ## scalar) \
231 const octave_ ## T1 ## scalar& v1 = dynamic_cast<const octave_ ## T1 ## scalar&> (a1); \
232 const octave_ ## T2 ## scalar& v2 = dynamic_cast<const octave_ ## T2 ## scalar&> (a2); \
234 return octave_value (v2.T2 ## scalar_value () / v1.T1 ## scalar_value ()); \
237 #define OCTAVE_SS_INT_BOOL_OPS(PFX, T1, T2, Z1, Z2) \
238 DEFBINOP (PFX ## _el_and, T2, T2) \
240 const octave_ ## T1 ## scalar& v1 = dynamic_cast<const octave_ ## T1 ## scalar&> (a1); \
241 const octave_ ## T2 ## scalar& v2 = dynamic_cast<const octave_ ## T2 ## scalar&> (a2); \
243 return v1.T1 ## scalar_value () != Z1 && v2.T2 ## scalar_value () != Z2; \
246 DEFBINOP (PFX ## _el_or, T1, T2) \
248 const octave_ ## T1 ## scalar& v1 = dynamic_cast<const octave_ ## T1 ## scalar&> (a1); \
249 const octave_ ## T2 ## scalar& v2 = dynamic_cast<const octave_ ## T2 ## scalar&> (a2); \
251 return v1.T1 ## scalar_value () != Z1 || v2.T2 ## scalar_value () != Z2; \
254 #define OCTAVE_SS_INT_CMP_OPS(PFX, T1, T2) \
255 DEFBINOP_OP (PFX ## _lt, T1 ## scalar, T2 ## scalar, <) \
256 DEFBINOP_OP (PFX ## _le, T1 ## scalar, T2 ## scalar, <=) \
257 DEFBINOP_OP (PFX ## _eq, T1 ## scalar, T2 ## scalar, ==) \
258 DEFBINOP_OP (PFX ## _ge, T1 ## scalar, T2 ## scalar, >=) \
259 DEFBINOP_OP (PFX ## _gt, T1 ## scalar, T2 ## scalar, >) \
260 DEFBINOP_OP (PFX ## _ne, T1 ## scalar, T2 ## scalar, !=)
262 #define OCTAVE_SS_POW_OPS(T1, T2) \
263 static octave_value \
264 xpow (const octave_ ## T1& a, const octave_ ## T2& b) \
269 static octave_value \
270 xpow (const octave_ ## T1& a, double b) \
275 static octave_value \
276 xpow (double a, const octave_ ## T1& b) \
281 static octave_value \
282 xpow (const octave_ ## T1& a, float b) \
284 return powf (a, b); \
287 static octave_value \
288 xpow (float a, const octave_ ## T1& b) \
290 return powf (a, b); \
293 #define OCTAVE_SS_INT_OPS(TYPE) \
294 OCTAVE_S_INT_UNOPS (TYPE) \
295 OCTAVE_SS_POW_OPS (TYPE, TYPE) \
296 OCTAVE_SS_INT_ARITH_OPS (ss, TYPE ## _, TYPE ## _, TYPE) \
297 OCTAVE_SS_INT_ARITH_OPS (ssx, TYPE ## _, , TYPE) \
298 OCTAVE_SS_INT_ARITH_OPS (sxs, , TYPE ## _, TYPE) \
299 OCTAVE_SS_INT_ARITH_OPS (ssfx, TYPE ## _, float_, TYPE) \
300 OCTAVE_SS_INT_ARITH_OPS (sfxs, float_, TYPE ## _, TYPE) \
301 OCTAVE_SS_INT_CMP_OPS (ss, TYPE ## _, TYPE ## _) \
302 OCTAVE_SS_INT_CMP_OPS (sx, TYPE ## _, ) \
303 OCTAVE_SS_INT_CMP_OPS (xs, , TYPE ## _) \
304 OCTAVE_SS_INT_CMP_OPS (sfx, TYPE ## _, float_) \
305 OCTAVE_SS_INT_CMP_OPS (fxs, float_, TYPE ## _) \
306 OCTAVE_SS_INT_BOOL_OPS (ss, TYPE ## _, TYPE ## _, octave_ ## TYPE (0), octave_ ## TYPE (0)) \
307 OCTAVE_SS_INT_BOOL_OPS (sx, TYPE ## _, , octave_ ## TYPE (0), 0) \
308 OCTAVE_SS_INT_BOOL_OPS (xs, , TYPE ## _, 0, octave_ ## TYPE (0)) \
309 OCTAVE_SS_INT_BOOL_OPS (sfx, TYPE ## _, float_, octave_ ## TYPE (0), 0) \
310 OCTAVE_SS_INT_BOOL_OPS (fxs, float_, TYPE ## _, 0, octave_ ## TYPE (0))
313 #define OCTAVE_SM_INT_ARITH_OPS(PFX, TS, TM, TI) \
315 DEFINTNDBINOP_OP (PFX ## _add, TS ## scalar, TM ## matrix, TS ## scalar, TM ## array, +, TI) \
316 DEFINTNDBINOP_OP (PFX ## _sub, TS ## scalar, TM ## matrix, TS ## scalar, TM ## array, -, TI) \
317 DEFINTNDBINOP_OP (PFX ## _mul, TS ## scalar, TM ## matrix, TS ## scalar, TM ## array, *, TI) \
332 DEFBINOP (PFX ## _ldiv, TS ## scalar, TM ## matrix) \
334 const octave_ ## TS ## scalar& v1 = dynamic_cast<const octave_ ## TS ## scalar&> (a1); \
335 const octave_ ## TM ## matrix& v2 = dynamic_cast<const octave_ ## TM ## matrix&> (a2); \
337 return octave_value (v2.TM ## array_value () / v1.TS ## scalar_value ()); \
340 DEFINTNDBINOP_OP (PFX ## _el_mul, TS ## scalar, TM ## matrix, TS ## scalar, TM ## array, *, TI) \
341 DEFBINOP (PFX ## _el_div, TS ## scalar, TM ## matrix) \
343 const octave_ ## TS ## scalar& v1 = dynamic_cast<const octave_ ## TS ## scalar&> (a1); \
344 const octave_ ## TM ## matrix& v2 = dynamic_cast<const octave_ ## TM ## matrix&> (a2); \
346 octave_value retval = octave_value (v1.TS ## scalar_value () / v2.TM ## array_value ()); \
350 DEFINTNDBINOP_FN (PFX ## _el_pow, TS ## scalar, TM ## matrix, TS ## scalar, TM ## array, elem_xpow, TI, .^) \
352 DEFBINOP (PFX ## _el_ldiv, TS ## scalar, TM ## matrix) \
354 const octave_ ## TS ## scalar& v1 = dynamic_cast<const octave_ ## TS ## scalar&> (a1); \
355 const octave_ ## TM ## matrix& v2 = dynamic_cast<const octave_ ## TM ## matrix&> (a2); \
357 return octave_value (v2.TM ## array_value () / v1.TS ## scalar_value ()); \
360 #define OCTAVE_SM_INT_CMP_OPS(PFX, TS, TM) \
361 DEFNDBINOP_FN (PFX ## _lt, TS ## scalar, TM ## matrix, TS ## scalar, TM ## array, mx_el_lt) \
362 DEFNDBINOP_FN (PFX ## _le, TS ## scalar, TM ## matrix, TS ## scalar, TM ## array, mx_el_le) \
363 DEFNDBINOP_FN (PFX ## _eq, TS ## scalar, TM ## matrix, TS ## scalar, TM ## array, mx_el_eq) \
364 DEFNDBINOP_FN (PFX ## _ge, TS ## scalar, TM ## matrix, TS ## scalar, TM ## array, mx_el_ge) \
365 DEFNDBINOP_FN (PFX ## _gt, TS ## scalar, TM ## matrix, TS ## scalar, TM ## array, mx_el_gt) \
366 DEFNDBINOP_FN (PFX ## _ne, TS ## scalar, TM ## matrix, TS ## scalar, TM ## array, mx_el_ne)
368 #define OCTAVE_SM_INT_BOOL_OPS(PFX, TS, TM) \
369 DEFNDBINOP_FN (PFX ## _el_and, TS ## scalar, TM ## matrix, TS ## scalar, TM ## array, mx_el_and) \
370 DEFNDBINOP_FN (PFX ## _el_or, TS ## scalar, TM ## matrix, TS ## scalar, TM ## array, mx_el_or) \
371 DEFNDBINOP_FN (PFX ## _el_and_not, TS ## scalar, TM ## matrix, TS ## scalar, TM ## array, mx_el_and_not) \
372 DEFNDBINOP_FN (PFX ## _el_or_not, TS ## scalar, TM ## matrix, TS ## scalar, TM ## array, mx_el_or_not)
374 #define OCTAVE_SM_POW_OPS(T1, T2) \
375 static octave_value \
376 elem_xpow (const octave_ ## T1& a, const T2 ## NDArray& b) \
378 T2 ## NDArray result (b.dims ()); \
379 for (int i = 0; i < b.numel (); i++) \
382 result (i) = pow (a, b(i)); \
384 return octave_value (result); \
387 static octave_value \
388 elem_xpow (const octave_ ## T1& a, const NDArray& b) \
390 T1 ## NDArray result (b.dims ()); \
391 for (int i = 0; i < b.numel (); i++) \
394 result (i) = pow (a, b(i)); \
396 return octave_value (result); \
399 static octave_value \
400 elem_xpow (double a, const T2 ## NDArray& b) \
402 T2 ## NDArray result (b.dims ()); \
403 for (int i = 0; i < b.numel (); i++) \
406 result (i) = pow (a, b(i)); \
408 return octave_value (result); \
411 static octave_value \
412 elem_xpow (const octave_ ## T1& a, const FloatNDArray& b) \
414 T1 ## NDArray result (b.dims ()); \
415 for (int i = 0; i < b.numel (); i++) \
418 result (i) = powf (a, b(i)); \
420 return octave_value (result); \
423 static octave_value \
424 elem_xpow (float a, const T2 ## NDArray& b) \
426 T2 ## NDArray result (b.dims ()); \
427 for (int i = 0; i < b.numel (); i++) \
430 result (i) = powf (a, b(i)); \
432 return octave_value (result); \
435 #define OCTAVE_SM_CONV(TS, TM) \
436 DEFCONV (TS ## s_ ## TM ## m_conv, TM ## scalar, TM ## matrix) \
438 const octave_ ## TS ## scalar& v = dynamic_cast<const octave_ ## TS ## scalar&> (a); \
440 return new octave_ ## TM ## matrix (v.TM ## array_value ()); \
443 #define OCTAVE_SM_INT_OPS(TYPE) \
444 OCTAVE_SM_POW_OPS (TYPE, TYPE) \
445 OCTAVE_SM_INT_ARITH_OPS (sm, TYPE ## _, TYPE ## _, TYPE) \
446 OCTAVE_SM_INT_ARITH_OPS (smx, TYPE ## _, , TYPE) \
447 OCTAVE_SM_INT_ARITH_OPS (sxm, , TYPE ## _, TYPE) \
448 OCTAVE_SM_INT_ARITH_OPS (smfx, TYPE ## _, float_, TYPE) \
449 OCTAVE_SM_INT_ARITH_OPS (sfxm, float_, TYPE ## _, TYPE) \
450 OCTAVE_SM_INT_CMP_OPS (sm, TYPE ## _, TYPE ## _) \
451 OCTAVE_SM_INT_CMP_OPS (xm, , TYPE ## _) \
452 OCTAVE_SM_INT_CMP_OPS (smx, TYPE ## _, ) \
453 OCTAVE_SM_INT_CMP_OPS (fxm, float_, TYPE ## _) \
454 OCTAVE_SM_INT_CMP_OPS (smfx, TYPE ## _, float_) \
455 OCTAVE_SM_INT_BOOL_OPS (sm, TYPE ## _, TYPE ## _) \
456 OCTAVE_SM_INT_BOOL_OPS (xm, , TYPE ## _) \
457 OCTAVE_SM_INT_BOOL_OPS (smx, TYPE ## _, ) \
458 OCTAVE_SM_INT_BOOL_OPS (fxm, float_, TYPE ## _) \
459 OCTAVE_SM_INT_BOOL_OPS (smfx, TYPE ## _, float_) \
460 OCTAVE_SM_CONV (TYPE ## _, TYPE ## _) \
461 OCTAVE_SM_CONV (TYPE ## _, complex_) \
462 OCTAVE_SM_CONV (TYPE ## _, float_complex_)
465 #define OCTAVE_MS_INT_ARITH_OPS(PFX, TM, TS, TI) \
467 DEFINTNDBINOP_OP (PFX ## _add, TM ## matrix, TS ## scalar, TM ## array, TS ## scalar, +, TI) \
468 DEFINTNDBINOP_OP (PFX ## _sub, TM ## matrix, TS ## scalar, TM ## array, TS ## scalar, -, TI) \
469 DEFINTNDBINOP_OP (PFX ## _mul, TM ## matrix, TS ## scalar, TM ## array, TS ## scalar, *, TI) \
471 DEFBINOP (PFX ## _div, TM ## matrix, TS ## scalar) \
473 const octave_ ## TM ## matrix& v1 = dynamic_cast<const octave_ ## TM ## matrix&> (a1); \
474 const octave_ ## TS ## scalar& v2 = dynamic_cast<const octave_ ## TS ## scalar&> (a2); \
476 return octave_value (v1.TM ## array_value () / v2.TS ## scalar_value ()); \
492 DEFINTNDBINOP_OP (PFX ## _el_mul, TM ## matrix, TS ## scalar, TM ## array, TS ## scalar, *, TI) \
494 DEFBINOP (PFX ## _el_div, TM ## matrix, TS ## scalar) \
496 const octave_ ## TM ## matrix& v1 = dynamic_cast<const octave_ ## TM ## matrix&> (a1); \
497 const octave_ ## TS ## scalar& v2 = dynamic_cast<const octave_ ## TS ## scalar&> (a2); \
499 return octave_value (v1.TM ## array_value () / v2.TS ## scalar_value ()); \
502 DEFINTNDBINOP_FN (PFX ## _el_pow, TM ## matrix, TS ## scalar, TM ## array, TS ## scalar, elem_xpow, TI, .^) \
504 DEFBINOP (PFX ## _el_ldiv, TM ## matrix, TS ## scalar) \
506 const octave_ ## TM ## matrix& v1 = dynamic_cast<const octave_ ## TM ## matrix&> (a1); \
507 const octave_ ## TS ## scalar& v2 = dynamic_cast<const octave_ ## TS ## scalar&> (a2); \
509 octave_value retval = v2.TS ## scalar_value () / v1.TM ## array_value (); \
513 #define OCTAVE_MS_INT_CMP_OPS(PFX, TM, TS) \
514 DEFNDBINOP_FN (PFX ## _lt, TM ## matrix, TS ## scalar, TM ## array, TS ## scalar, mx_el_lt) \
515 DEFNDBINOP_FN (PFX ## _le, TM ## matrix, TS ## scalar, TM ## array, TS ## scalar, mx_el_le) \
516 DEFNDBINOP_FN (PFX ## _eq, TM ## matrix, TS ## scalar, TM ## array, TS ## scalar, mx_el_eq) \
517 DEFNDBINOP_FN (PFX ## _ge, TM ## matrix, TS ## scalar, TM ## array, TS ## scalar, mx_el_ge) \
518 DEFNDBINOP_FN (PFX ## _gt, TM ## matrix, TS ## scalar, TM ## array, TS ## scalar, mx_el_gt) \
519 DEFNDBINOP_FN (PFX ## _ne, TM ## matrix, TS ## scalar, TM ## array, TS ## scalar, mx_el_ne)
521 #define OCTAVE_MS_INT_BOOL_OPS(PFX, TM, TS) \
522 DEFNDBINOP_FN (PFX ## _el_and, TM ## matrix, TS ## scalar, TM ## array, TS ## scalar, mx_el_and) \
523 DEFNDBINOP_FN (PFX ## _el_or, TM ## matrix, TS ## scalar, TM ## array, TS ## scalar, mx_el_or) \
524 DEFNDBINOP_FN (PFX ## _el_not_and, TM ## matrix, TS ## scalar, TM ## array, TS ## scalar, mx_el_not_and) \
525 DEFNDBINOP_FN (PFX ## _el_not_or, TM ## matrix, TS ## scalar, TM ## array, TS ## scalar, mx_el_not_or)
527 #define OCTAVE_MS_INT_ASSIGN_OPS(PFX, TM, TS, TE) \
528 DEFNDASSIGNOP_FN (PFX ## _assign, TM ## matrix, TS ## scalar, TM ## scalar, assign)
530 #define OCTAVE_MS_INT_ASSIGNEQ_OPS(PFX, TM) \
531 DEFNDASSIGNOP_OP (PFX ## _assign_add, TM ## matrix, TM ## scalar, TM ## scalar, +=) \
532 DEFNDASSIGNOP_OP (PFX ## _assign_sub, TM ## matrix, TM ## scalar, TM ## scalar, -=) \
533 DEFNDASSIGNOP_OP (PFX ## _assign_mul, TM ## matrix, TM ## scalar, TM ## scalar, *=) \
534 DEFNDASSIGNOP_OP (PFX ## _assign_div, TM ## matrix, TM ## scalar, TM ## scalar, /=)
536 #define OCTAVE_MS_POW_OPS(T1, T2) \
537 static octave_value \
538 elem_xpow (T1 ## NDArray a, octave_ ## T2 b) \
540 T1 ## NDArray result (a.dims ()); \
541 for (int i = 0; i < a.numel (); i++) \
544 result (i) = pow (a(i), b); \
546 return octave_value (result); \
549 static octave_value \
550 elem_xpow (T1 ## NDArray a, double b) \
552 T1 ## NDArray result (a.dims ()); \
553 for (int i = 0; i < a.numel (); i++) \
556 result (i) = pow (a(i), b); \
558 return octave_value (result); \
561 static octave_value \
562 elem_xpow (NDArray a, octave_ ## T2 b) \
564 T2 ## NDArray result (a.dims ()); \
565 for (int i = 0; i < a.numel (); i++) \
568 result (i) = pow (a(i), b); \
570 return octave_value (result); \
573 static octave_value \
574 elem_xpow (T1 ## NDArray a, float b) \
576 T1 ## NDArray result (a.dims ()); \
577 for (int i = 0; i < a.numel (); i++) \
580 result (i) = powf (a(i), b); \
582 return octave_value (result); \
585 static octave_value \
586 elem_xpow (FloatNDArray a, octave_ ## T2 b) \
588 T2 ## NDArray result (a.dims ()); \
589 for (int i = 0; i < a.numel (); i++) \
592 result (i) = powf (a(i), b); \
594 return octave_value (result); \
597 #define OCTAVE_MS_INT_OPS(TYPE) \
598 OCTAVE_MS_POW_OPS (TYPE, TYPE) \
599 OCTAVE_MS_INT_ARITH_OPS (ms, TYPE ## _, TYPE ## _, TYPE) \
600 OCTAVE_MS_INT_ARITH_OPS (msx, TYPE ## _, , TYPE) \
601 OCTAVE_MS_INT_ARITH_OPS (mxs, , TYPE ## _, TYPE) \
602 OCTAVE_MS_INT_ARITH_OPS (msfx, TYPE ## _, float_, TYPE) \
603 OCTAVE_MS_INT_ARITH_OPS (mfxs, float_, TYPE ## _, TYPE) \
604 OCTAVE_MS_INT_CMP_OPS (ms, TYPE ## _, TYPE ## _) \
605 OCTAVE_MS_INT_CMP_OPS (mx, TYPE ## _, ) \
606 OCTAVE_MS_INT_CMP_OPS (mxs, , TYPE ## _) \
607 OCTAVE_MS_INT_CMP_OPS (mfx, TYPE ## _, float_) \
608 OCTAVE_MS_INT_CMP_OPS (mfxs, float_, TYPE ## _) \
609 OCTAVE_MS_INT_BOOL_OPS (ms, TYPE ## _, TYPE ## _) \
610 OCTAVE_MS_INT_BOOL_OPS (mx, TYPE ## _, ) \
611 OCTAVE_MS_INT_BOOL_OPS (mxs, , TYPE ## _) \
612 OCTAVE_MS_INT_BOOL_OPS (mfx, TYPE ## _, float_) \
613 OCTAVE_MS_INT_BOOL_OPS (mfxs, float_, TYPE ## _) \
614 OCTAVE_MS_INT_ASSIGN_OPS (ms, TYPE ## _, TYPE ## _, TYPE ## _) \
615 OCTAVE_MS_INT_ASSIGNEQ_OPS (mse, TYPE ## _) \
616 OCTAVE_MS_INT_ASSIGN_OPS (mx, TYPE ## _, , ) \
617 OCTAVE_MS_INT_ASSIGN_OPS (mfx, TYPE ## _, float_, float_)
620 #define OCTAVE_M_INT_UNOPS(TYPE) \
622 DEFNDUNOP_OP (m_not, TYPE ## _matrix, TYPE ## _array, !) \
623 DEFNDUNOP_OP (m_uplus, TYPE ## _matrix, TYPE ## _array, ) \
624 DEFUNOP (m_uminus, TYPE ## _matrix) \
626 const octave_ ## TYPE ## _matrix & v = dynamic_cast<const octave_ ## TYPE ## _matrix &> (a); \
627 octave_value retval = octave_value (- v. TYPE ## _array_value ()); \
631 DEFUNOP (m_transpose, TYPE ## _matrix) \
633 const octave_ ## TYPE ## _matrix& v = dynamic_cast<const octave_ ## TYPE ## _matrix&> (a); \
635 if (v.ndims () > 2) \
636 error ("transpose not defined for N-D objects"); \
638 return octave_value (v.TYPE ## _array_value ().transpose ()); \
641 DEFNCUNOP_METHOD (m_incr, TYPE ## _matrix, increment) \
642 DEFNCUNOP_METHOD (m_decr, TYPE ## _matrix, decrement) \
643 DEFNCUNOP_METHOD (m_changesign, TYPE ## _matrix, changesign)
646 #define OCTAVE_MM_INT_ARITH_OPS(PFX, T1, T2, T3) \
648 DEFINTNDBINOP_OP (PFX ## _add, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, +, T3) \
649 DEFINTNDBINOP_OP (PFX ## _sub, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, -, T3) \
654 DEFBINOPX (PFX ## _pow, T1 ## matrix, T2 ## matrix) \
656 error ("can't do A ^ B for A and B both matrices"); \
661 DEFINTNDBINOP_FN (PFX ## _el_mul, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, product, T3, .*) \
663 DEFINTNDBINOP_FN (PFX ## _el_div, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, quotient, T3, ./) \
665 DEFINTNDBINOP_FN (PFX ## _el_pow, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, elem_xpow, T3, .^) \
667 DEFBINOP (PFX ## _el_ldiv, T1 ## matrix, T2 ## matrix) \
669 const octave_ ## T1 ## matrix& v1 = dynamic_cast<const octave_ ## T1 ## matrix&> (a1); \
670 const octave_ ## T2 ## matrix& v2 = dynamic_cast<const octave_ ## T2 ## matrix&> (a2); \
672 octave_value retval = octave_value (quotient (v2.T2 ## array_value (), v1.T1 ## array_value ())); \
676 #define OCTAVE_MM_INT_CMP_OPS(PFX, T1, T2) \
677 DEFNDBINOP_FN (PFX ## _lt, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, mx_el_lt) \
678 DEFNDBINOP_FN (PFX ## _le, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, mx_el_le) \
679 DEFNDBINOP_FN (PFX ## _eq, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, mx_el_eq) \
680 DEFNDBINOP_FN (PFX ## _ge, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, mx_el_ge) \
681 DEFNDBINOP_FN (PFX ## _gt, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, mx_el_gt) \
682 DEFNDBINOP_FN (PFX ## _ne, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, mx_el_ne)
684 #define OCTAVE_MM_INT_BOOL_OPS(PFX, T1, T2) \
685 DEFNDBINOP_FN (PFX ## _el_and, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, mx_el_and) \
686 DEFNDBINOP_FN (PFX ## _el_or, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, mx_el_or) \
687 DEFNDBINOP_FN (PFX ## _el_not_and, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, mx_el_not_and) \
688 DEFNDBINOP_FN (PFX ## _el_not_or, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, mx_el_not_or) \
689 DEFNDBINOP_FN (PFX ## _el_and_not, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, mx_el_and_not) \
690 DEFNDBINOP_FN (PFX ## _el_or_not, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, mx_el_or_not)
692 #define OCTAVE_MM_INT_ASSIGN_OPS(PFX, TLHS, TRHS, TE) \
693 DEFNDASSIGNOP_FN (PFX ## _assign, TLHS ## matrix, TRHS ## matrix, TLHS ## array, assign)
695 #define OCTAVE_MM_INT_ASSIGNEQ_OPS(PFX, TM) \
696 DEFNDASSIGNOP_OP (PFX ## _assign_add, TM ## matrix, TM ## matrix, TM ## array, +=) \
697 DEFNDASSIGNOP_OP (PFX ## _assign_sub, TM ## matrix, TM ## matrix, TM ## array, -=) \
698 DEFNDASSIGNOP_FNOP (PFX ## _assign_el_mul, TM ## matrix, TM ## matrix, TM ## array, product_eq) \
699 DEFNDASSIGNOP_FNOP (PFX ## _assign_el_div, TM ## matrix, TM ## matrix, TM ## array, quotient_eq)
701 #define OCTAVE_MM_POW_OPS(T1, T2) \
702 static octave_value \
703 elem_xpow (const T1 ## NDArray& a, const T2 ## NDArray& b) \
705 dim_vector a_dims = a.dims (); \
706 dim_vector b_dims = b.dims (); \
707 if (a_dims != b_dims) \
709 if (! is_valid_bsxfun ("operator .^", a_dims, b_dims)) \
710 octave::err_nonconformant ("operator .^", a_dims, b_dims); \
712 return bsxfun_pow (a, b); \
714 T1 ## NDArray result (a_dims); \
715 for (int i = 0; i < a.numel (); i++) \
718 result (i) = pow (a(i), b(i)); \
720 return octave_value (result); \
723 static octave_value \
724 elem_xpow (const T1 ## NDArray& a, const NDArray& b) \
726 dim_vector a_dims = a.dims (); \
727 dim_vector b_dims = b.dims (); \
728 if (a_dims != b_dims) \
730 if (! is_valid_bsxfun ("operator .^", a_dims, b_dims)) \
731 octave::err_nonconformant ("operator .^", a_dims, b_dims); \
733 return bsxfun_pow (a, b); \
735 T1 ## NDArray result (a_dims); \
736 for (int i = 0; i < a.numel (); i++) \
739 result (i) = pow (a(i), b(i)); \
741 return octave_value (result); \
744 static octave_value \
745 elem_xpow (const NDArray& a, const T2 ## NDArray& b) \
747 dim_vector a_dims = a.dims (); \
748 dim_vector b_dims = b.dims (); \
749 if (a_dims != b_dims) \
751 if (! is_valid_bsxfun ("operator .^", a_dims, b_dims)) \
752 octave::err_nonconformant ("operator .^", a_dims, b_dims); \
754 return bsxfun_pow (a, b); \
756 T2 ## NDArray result (a_dims); \
757 for (int i = 0; i < a.numel (); i++) \
760 result (i) = pow (a(i), b(i)); \
762 return octave_value (result); \
765 static octave_value \
766 elem_xpow (const T1 ## NDArray& a, const FloatNDArray& b) \
768 dim_vector a_dims = a.dims (); \
769 dim_vector b_dims = b.dims (); \
770 if (a_dims != b_dims) \
772 if (! is_valid_bsxfun ("operator .^", a_dims, b_dims)) \
773 octave::err_nonconformant ("operator .^", a_dims, b_dims); \
775 return bsxfun_pow (a, b); \
777 T1 ## NDArray result (a_dims); \
778 for (int i = 0; i < a.numel (); i++) \
781 result (i) = powf (a(i), b(i)); \
783 return octave_value (result); \
786 static octave_value \
787 elem_xpow (const FloatNDArray& a, const T2 ## NDArray& b) \
789 dim_vector a_dims = a.dims (); \
790 dim_vector b_dims = b.dims (); \
791 if (a_dims != b_dims) \
793 if (! is_valid_bsxfun ("operator .^", a_dims, b_dims)) \
794 octave::err_nonconformant ("operator .^", a_dims, b_dims); \
796 return bsxfun_pow (a, b); \
798 T2 ## NDArray result (a_dims); \
799 for (int i = 0; i < a.numel (); i++) \
802 result (i) = powf (a(i), b(i)); \
804 return octave_value (result); \
807 #define OCTAVE_MM_CONV(T1, T2) \
808 DEFCONV (T1 ## m_ ## T2 ## m_conv, T1 ## matrix, T2 ## matrix) \
810 const octave_ ## T1 ## matrix& v = dynamic_cast<const octave_ ## T1 ## matrix&> (a); \
812 return new octave_ ## T2 ## matrix (v.T2 ## array_value ()); \
815 #define OCTAVE_MM_INT_OPS(TYPE) \
816 OCTAVE_M_INT_UNOPS (TYPE) \
817 OCTAVE_MM_POW_OPS (TYPE, TYPE) \
818 OCTAVE_MM_INT_ARITH_OPS (mm, TYPE ## _, TYPE ## _, TYPE) \
819 OCTAVE_MM_INT_ARITH_OPS (mmx, TYPE ## _, , TYPE) \
820 OCTAVE_MM_INT_ARITH_OPS (mxm, , TYPE ## _, TYPE) \
821 OCTAVE_MM_INT_ARITH_OPS (mmfx, TYPE ## _, float_, TYPE) \
822 OCTAVE_MM_INT_ARITH_OPS (mfxm, float_, TYPE ## _, TYPE) \
823 OCTAVE_MM_INT_CMP_OPS (mm, TYPE ## _, TYPE ## _) \
824 OCTAVE_MM_INT_CMP_OPS (mmx, TYPE ## _, ) \
825 OCTAVE_MM_INT_CMP_OPS (mfxm, float_, TYPE ## _) \
826 OCTAVE_MM_INT_CMP_OPS (mmfx, TYPE ## _, float_) \
827 OCTAVE_MM_INT_CMP_OPS (mxm, , TYPE ## _) \
828 OCTAVE_MM_INT_BOOL_OPS (mm, TYPE ## _, TYPE ## _) \
829 OCTAVE_MM_INT_BOOL_OPS (mmx, TYPE ## _, ) \
830 OCTAVE_MM_INT_BOOL_OPS (mxm, , TYPE ## _) \
831 OCTAVE_MM_INT_BOOL_OPS (mmfx, TYPE ## _, float_) \
832 OCTAVE_MM_INT_BOOL_OPS (mfxm, float_, TYPE ## _) \
833 OCTAVE_MM_INT_ASSIGN_OPS (mm, TYPE ## _, TYPE ## _, TYPE ## _) \
834 OCTAVE_MM_INT_ASSIGNEQ_OPS (mme, TYPE ## _) \
835 OCTAVE_MM_INT_ASSIGN_OPS (mmx, TYPE ## _, , ) \
836 OCTAVE_MM_INT_ASSIGN_OPS (mmfx, TYPE ## _, float_, float_) \
837 OCTAVE_MM_CONV(TYPE ## _, complex_) \
838 OCTAVE_MM_CONV(TYPE ## _, float_complex_)
840 #define OCTAVE_RE_INT_ASSIGN_OPS(TYPE) \
841 DEFNDASSIGNOP_FN (TYPE ## ms_assign, matrix, TYPE ## _scalar, array, assign) \
842 DEFNDASSIGNOP_FN (TYPE ## mm_assign, matrix, TYPE ## _matrix, array, assign)
844 #define OCTAVE_FLT_RE_INT_ASSIGN_OPS(TYPE) \
845 DEFNDASSIGNOP_FN (TYPE ## fms_assign, float_matrix, TYPE ## _scalar, float_array, assign) \
846 DEFNDASSIGNOP_FN (TYPE ## fmm_assign, float_matrix, TYPE ## _matrix, float_array, assign)
848 #define OCTAVE_CX_INT_ASSIGN_OPS(TYPE) \
849 DEFNDASSIGNOP_FN (TYPE ## cms_assign, complex_matrix, TYPE ## _scalar, complex_array, assign) \
850 DEFNDASSIGNOP_FN (TYPE ## cmm_assign, complex_matrix, TYPE ## _matrix, complex_array, assign)
852 #define OCTAVE_FLT_CX_INT_ASSIGN_OPS(TYPE) \
853 DEFNDASSIGNOP_FN (TYPE ## fcms_assign, float_complex_matrix, TYPE ## _scalar, float_complex_array, assign) \
854 DEFNDASSIGNOP_FN (TYPE ## fcmm_assign, float_complex_matrix, TYPE ## _matrix, float_complex_array, assign)
856 #define OCTAVE_INT_NULL_ASSIGN_OPS(TYPE) \
857 DEFNULLASSIGNOP_FN (TYPE ## null_assign, TYPE ## _matrix, delete_elements)
859 #define OCTAVE_INT_OPS(TYPE) \
860 OCTAVE_SS_INT_OPS (TYPE) \
861 OCTAVE_SM_INT_OPS (TYPE) \
862 OCTAVE_MS_INT_OPS (TYPE) \
863 OCTAVE_MM_INT_OPS (TYPE) \
864 OCTAVE_CONCAT_FN (TYPE) \
865 OCTAVE_RE_INT_ASSIGN_OPS (TYPE) \
866 OCTAVE_FLT_RE_INT_ASSIGN_OPS (TYPE) \
867 OCTAVE_CX_INT_ASSIGN_OPS (TYPE) \
868 OCTAVE_FLT_CX_INT_ASSIGN_OPS (TYPE) \
869 OCTAVE_INT_NULL_ASSIGN_OPS(TYPE)
871 #define OCTAVE_INSTALL_S_INT_UNOPS(TYPE) \
872 INSTALL_UNOP_TI (ti, op_not, octave_ ## TYPE ## _scalar, s_not); \
873 INSTALL_UNOP_TI (ti, op_uplus, octave_ ## TYPE ## _scalar, s_uplus); \
874 INSTALL_UNOP_TI (ti, op_uminus, octave_ ## TYPE ## _scalar, s_uminus); \
875 INSTALL_UNOP_TI (ti, op_transpose, octave_ ## TYPE ## _scalar, s_transpose); \
876 INSTALL_UNOP_TI (ti, op_hermitian, octave_ ## TYPE ## _scalar, s_hermitian); \
878 INSTALL_NCUNOP_TI (ti, op_incr, octave_ ## TYPE ## _scalar, s_incr); \
879 INSTALL_NCUNOP_TI (ti, op_decr, octave_ ## TYPE ## _scalar, s_decr);
881 #define OCTAVE_INSTALL_SS_INT_ARITH_OPS(PFX, T1, T2) \
882 INSTALL_BINOP_TI (ti, op_add, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _add); \
883 INSTALL_BINOP_TI (ti, op_sub, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _sub); \
884 INSTALL_BINOP_TI (ti, op_mul, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _mul); \
885 INSTALL_BINOP_TI (ti, op_div, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _div); \
886 INSTALL_BINOP_TI (ti, op_pow, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _pow); \
887 INSTALL_BINOP_TI (ti, op_ldiv, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _ldiv); \
888 INSTALL_BINOP_TI (ti, op_el_mul, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _el_mul); \
889 INSTALL_BINOP_TI (ti, op_el_div, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _el_div); \
890 INSTALL_BINOP_TI (ti, op_el_pow, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _el_pow); \
891 INSTALL_BINOP_TI (ti, op_el_ldiv, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _el_ldiv);
893 #define OCTAVE_INSTALL_SS_INT_CMP_OPS(PFX, T1, T2) \
894 INSTALL_BINOP_TI (ti, op_lt, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _lt); \
895 INSTALL_BINOP_TI (ti, op_le, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _le); \
896 INSTALL_BINOP_TI (ti, op_eq, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _eq); \
897 INSTALL_BINOP_TI (ti, op_ge, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _ge); \
898 INSTALL_BINOP_TI (ti, op_gt, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _gt); \
899 INSTALL_BINOP_TI (ti, op_ne, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _ne);
901 #define OCTAVE_INSTALL_SS_INT_BOOL_OPS(PFX, T1, T2) \
902 INSTALL_BINOP_TI (ti, op_el_and, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _el_and); \
903 INSTALL_BINOP_TI (ti, op_el_or, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _el_or);
905 #define OCTAVE_INSTALL_SS_INT_OPS(TYPE) \
906 OCTAVE_INSTALL_S_INT_UNOPS (TYPE) \
907 OCTAVE_INSTALL_SS_INT_ARITH_OPS (ss, TYPE ## _, TYPE ## _) \
908 OCTAVE_INSTALL_SS_INT_ARITH_OPS (ssx, TYPE ## _, ) \
909 OCTAVE_INSTALL_SS_INT_ARITH_OPS (sxs, , TYPE ## _) \
910 OCTAVE_INSTALL_SS_INT_ARITH_OPS (ssfx, TYPE ## _, float_) \
911 OCTAVE_INSTALL_SS_INT_ARITH_OPS (sfxs, float_, TYPE ## _) \
912 OCTAVE_INSTALL_SS_INT_CMP_OPS (ss, TYPE ## _, TYPE ## _) \
913 OCTAVE_INSTALL_SS_INT_CMP_OPS (sx, TYPE ## _, ) \
914 OCTAVE_INSTALL_SS_INT_CMP_OPS (xs, , TYPE ## _) \
915 OCTAVE_INSTALL_SS_INT_CMP_OPS (sfx, TYPE ## _, float_) \
916 OCTAVE_INSTALL_SS_INT_CMP_OPS (fxs, float_, TYPE ## _) \
917 OCTAVE_INSTALL_SS_INT_BOOL_OPS (ss, TYPE ## _, TYPE ## _) \
918 OCTAVE_INSTALL_SS_INT_BOOL_OPS (sx, TYPE ## _, ) \
919 OCTAVE_INSTALL_SS_INT_BOOL_OPS (xs, , TYPE ## _) \
920 OCTAVE_INSTALL_SS_INT_BOOL_OPS (sfx, TYPE ## _, float_) \
921 OCTAVE_INSTALL_SS_INT_BOOL_OPS (fxs, float_, TYPE ## _) \
922 INSTALL_ASSIGNCONV_TI (ti, octave_ ## TYPE ## _scalar, octave_ ## TYPE ## _scalar, octave_ ## TYPE ## _matrix) \
923 INSTALL_ASSIGNCONV_TI (ti, octave_ ## TYPE ## _scalar, octave_scalar, octave_ ## TYPE ## _matrix) \
924 INSTALL_ASSIGNCONV_TI (ti, octave_ ## TYPE ## _scalar, octave_float_scalar, octave_ ## TYPE ## _matrix) \
925 INSTALL_ASSIGNCONV_TI (ti, octave_ ## TYPE ## _scalar, octave_complex_scalar, octave_complex_matrix) \
926 INSTALL_ASSIGNCONV_TI (ti, octave_ ## TYPE ## _scalar, octave_float_complex_scalar, octave_float_complex_matrix)
928 #define OCTAVE_INSTALL_SM_INT_ARITH_OPS(PFX, T1, T2) \
929 INSTALL_BINOP_TI (ti, op_add, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _add); \
930 INSTALL_BINOP_TI (ti, op_sub, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _sub); \
931 INSTALL_BINOP_TI (ti, op_mul, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _mul); \
934 INSTALL_BINOP_TI (ti, op_ldiv, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _ldiv); \
935 INSTALL_BINOP_TI (ti, op_el_mul, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _el_mul); \
936 INSTALL_BINOP_TI (ti, op_el_div, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _el_div); \
937 INSTALL_BINOP_TI (ti, op_el_pow, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _el_pow); \
938 INSTALL_BINOP_TI (ti, op_el_ldiv, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _el_ldiv);
940 #define OCTAVE_INSTALL_SM_INT_CMP_OPS(PFX, T1, T2) \
941 INSTALL_BINOP_TI (ti, op_lt, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _lt); \
942 INSTALL_BINOP_TI (ti, op_le, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _le); \
943 INSTALL_BINOP_TI (ti, op_eq, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _eq); \
944 INSTALL_BINOP_TI (ti, op_ge, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _ge); \
945 INSTALL_BINOP_TI (ti, op_gt, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _gt); \
946 INSTALL_BINOP_TI (ti, op_ne, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _ne);
948 #define OCTAVE_INSTALL_SM_INT_BOOL_OPS(PFX, T1, T2) \
949 INSTALL_BINOP_TI (ti, op_el_and, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _el_and); \
950 INSTALL_BINOP_TI (ti, op_el_or, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _el_or); \
951 INSTALL_BINOP_TI (ti, op_el_and_not, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _el_and_not); \
952 INSTALL_BINOP_TI (ti, op_el_or_not, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _el_or_not);
954 #define OCTAVE_INSTALL_SM_INT_OPS(TYPE) \
955 OCTAVE_INSTALL_SM_INT_ARITH_OPS (sm, TYPE ## _, TYPE ## _) \
956 OCTAVE_INSTALL_SM_INT_ARITH_OPS (smx, TYPE ## _, ) \
957 OCTAVE_INSTALL_SM_INT_ARITH_OPS (sxm, , TYPE ## _) \
958 OCTAVE_INSTALL_SM_INT_ARITH_OPS (smfx, TYPE ## _, float_) \
959 OCTAVE_INSTALL_SM_INT_ARITH_OPS (sfxm, float_, TYPE ## _) \
960 OCTAVE_INSTALL_SM_INT_CMP_OPS (sm, TYPE ## _, TYPE ## _) \
961 OCTAVE_INSTALL_SM_INT_CMP_OPS (xm, , TYPE ## _) \
962 OCTAVE_INSTALL_SM_INT_CMP_OPS (smx, TYPE ## _, ) \
963 OCTAVE_INSTALL_SM_INT_CMP_OPS (fxm, float_, TYPE ## _) \
964 OCTAVE_INSTALL_SM_INT_CMP_OPS (smfx, TYPE ## _, float_) \
965 OCTAVE_INSTALL_SM_INT_BOOL_OPS (sm, TYPE ## _, TYPE ## _) \
966 OCTAVE_INSTALL_SM_INT_BOOL_OPS (xm, , TYPE ## _) \
967 OCTAVE_INSTALL_SM_INT_BOOL_OPS (smx, TYPE ## _, ) \
968 OCTAVE_INSTALL_SM_INT_BOOL_OPS (fxm, float_, TYPE ## _) \
969 OCTAVE_INSTALL_SM_INT_BOOL_OPS (smfx, TYPE ## _, float_) \
970 INSTALL_WIDENOP_TI (ti, octave_ ## TYPE ## _scalar, octave_ ## TYPE ## _matrix, TYPE ## _s_ ## TYPE ## _m_conv) \
971 INSTALL_WIDENOP_TI (ti, octave_ ## TYPE ## _scalar, octave_complex_matrix, TYPE ## _s_complex_m_conv) \
972 INSTALL_WIDENOP_TI (ti, octave_ ## TYPE ## _scalar, octave_float_complex_matrix, TYPE ## _s_float_complex_m_conv) \
973 INSTALL_ASSIGNCONV_TI (ti, octave_ ## TYPE ## _scalar, octave_ ## TYPE ## _matrix, octave_ ## TYPE ## _matrix) \
974 INSTALL_ASSIGNCONV_TI (ti, octave_ ## TYPE ## _scalar, octave_matrix, octave_ ## TYPE ## _matrix) \
975 INSTALL_ASSIGNCONV_TI (ti, octave_ ## TYPE ## _scalar, octave_float_matrix, octave_ ## TYPE ## _matrix) \
976 INSTALL_ASSIGNCONV_TI (ti, octave_ ## TYPE ## _scalar, octave_complex_matrix, octave_complex_matrix) \
977 INSTALL_ASSIGNCONV_TI (ti, octave_ ## TYPE ## _scalar, octave_float_complex_matrix, octave_float_complex_matrix)
979 #define OCTAVE_INSTALL_MS_INT_ARITH_OPS(PFX, T1, T2) \
980 INSTALL_BINOP_TI (ti, op_add, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _add); \
981 INSTALL_BINOP_TI (ti, op_sub, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _sub); \
982 INSTALL_BINOP_TI (ti, op_mul, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _mul); \
983 INSTALL_BINOP_TI (ti, op_div, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _div); \
987 INSTALL_BINOP_TI (ti, op_el_mul, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _el_mul); \
988 INSTALL_BINOP_TI (ti, op_el_div, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _el_div); \
989 INSTALL_BINOP_TI (ti, op_el_pow, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _el_pow); \
990 INSTALL_BINOP_TI (ti, op_el_ldiv, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _el_ldiv);
992 #define OCTAVE_INSTALL_MS_INT_CMP_OPS(PFX, T1, T2) \
993 INSTALL_BINOP_TI (ti, op_lt, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _lt); \
994 INSTALL_BINOP_TI (ti, op_le, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _le); \
995 INSTALL_BINOP_TI (ti, op_eq, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _eq); \
996 INSTALL_BINOP_TI (ti, op_ge, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _ge); \
997 INSTALL_BINOP_TI (ti, op_gt, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _gt); \
998 INSTALL_BINOP_TI (ti, op_ne, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _ne);
1000 #define OCTAVE_INSTALL_MS_INT_BOOL_OPS(PFX, T1, T2) \
1001 INSTALL_BINOP_TI (ti, op_el_and, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _el_and); \
1002 INSTALL_BINOP_TI (ti, op_el_or, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _el_or); \
1003 INSTALL_BINOP_TI (ti, op_el_not_and, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _el_not_and); \
1004 INSTALL_BINOP_TI (ti, op_el_not_or, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _el_not_or);
1006 #define OCTAVE_INSTALL_MS_INT_ASSIGN_OPS(PFX, TLHS, TRHS) \
1007 INSTALL_ASSIGNOP_TI (ti, op_asn_eq, octave_ ## TLHS ## matrix, octave_ ## TRHS ## scalar, PFX ## _assign)
1009 #define OCTAVE_INSTALL_MS_INT_ASSIGNEQ_OPS(PFX, TLHS, TRHS) \
1010 INSTALL_ASSIGNOP_TI (ti, op_add_eq, octave_ ## TLHS ## matrix, octave_ ## TRHS ## scalar, PFX ## _assign_add) \
1011 INSTALL_ASSIGNOP_TI (ti, op_sub_eq, octave_ ## TLHS ## matrix, octave_ ## TRHS ## scalar, PFX ## _assign_sub) \
1012 INSTALL_ASSIGNOP_TI (ti, op_mul_eq, octave_ ## TLHS ## matrix, octave_ ## TRHS ## scalar, PFX ## _assign_mul) \
1013 INSTALL_ASSIGNOP_TI (ti, op_div_eq, octave_ ## TLHS ## matrix, octave_ ## TRHS ## scalar, PFX ## _assign_div)
1015 #define OCTAVE_INSTALL_MS_INT_OPS(TYPE) \
1016 OCTAVE_INSTALL_MS_INT_ARITH_OPS (ms, TYPE ## _, TYPE ## _) \
1017 OCTAVE_INSTALL_MS_INT_ARITH_OPS (msx, TYPE ## _, ) \
1018 OCTAVE_INSTALL_MS_INT_ARITH_OPS (mxs, , TYPE ## _) \
1019 OCTAVE_INSTALL_MS_INT_ARITH_OPS (msfx, TYPE ## _, float_) \
1020 OCTAVE_INSTALL_MS_INT_ARITH_OPS (mfxs, float_, TYPE ## _) \
1021 OCTAVE_INSTALL_MS_INT_CMP_OPS (ms, TYPE ## _, TYPE ## _) \
1022 OCTAVE_INSTALL_MS_INT_CMP_OPS (mx, TYPE ## _, ) \
1023 OCTAVE_INSTALL_MS_INT_CMP_OPS (mxs, , TYPE ## _) \
1024 OCTAVE_INSTALL_MS_INT_CMP_OPS (mfx, TYPE ## _, float_) \
1025 OCTAVE_INSTALL_MS_INT_CMP_OPS (mfxs, float_, TYPE ## _) \
1026 OCTAVE_INSTALL_MS_INT_BOOL_OPS (ms, TYPE ## _, TYPE ## _) \
1027 OCTAVE_INSTALL_MS_INT_BOOL_OPS (mx, TYPE ## _, ) \
1028 OCTAVE_INSTALL_MS_INT_BOOL_OPS (mxs, , TYPE ## _) \
1029 OCTAVE_INSTALL_MS_INT_BOOL_OPS (mfx, TYPE ## _, float_) \
1030 OCTAVE_INSTALL_MS_INT_BOOL_OPS (mfxs, float_, TYPE ## _) \
1031 OCTAVE_INSTALL_MS_INT_ASSIGN_OPS (ms, TYPE ## _, TYPE ## _) \
1032 OCTAVE_INSTALL_MS_INT_ASSIGNEQ_OPS (mse, TYPE ## _, TYPE ## _) \
1033 OCTAVE_INSTALL_MS_INT_ASSIGN_OPS (mx, TYPE ## _, ) \
1034 OCTAVE_INSTALL_MS_INT_ASSIGN_OPS (mfx, TYPE ## _, float_) \
1035 INSTALL_ASSIGNCONV_TI (ti, octave_ ## TYPE ## _matrix, octave_complex_scalar, octave_complex_matrix) \
1036 INSTALL_ASSIGNCONV_TI (ti, octave_ ## TYPE ## _matrix, octave_float_complex_scalar, octave_float_complex_matrix)
1038 #define OCTAVE_INSTALL_M_INT_UNOPS(TYPE) \
1039 INSTALL_UNOP_TI (ti, op_not, octave_ ## TYPE ## _matrix, m_not); \
1040 INSTALL_UNOP_TI (ti, op_uplus, octave_ ## TYPE ## _matrix, m_uplus); \
1041 INSTALL_UNOP_TI (ti, op_uminus, octave_ ## TYPE ## _matrix, m_uminus); \
1042 INSTALL_UNOP_TI (ti, op_transpose, octave_ ## TYPE ## _matrix, m_transpose); \
1043 INSTALL_UNOP_TI (ti, op_hermitian, octave_ ## TYPE ## _matrix, m_transpose); \
1045 INSTALL_NCUNOP_TI (ti, op_incr, octave_ ## TYPE ## _matrix, m_incr); \
1046 INSTALL_NCUNOP_TI (ti, op_decr, octave_ ## TYPE ## _matrix, m_decr); \
1047 INSTALL_NCUNOP_TI (ti, op_uminus, octave_ ## TYPE ## _matrix, m_changesign);
1049 #define OCTAVE_INSTALL_MM_INT_ARITH_OPS(PFX, T1, T2) \
1050 INSTALL_BINOP_TI (ti, op_add, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _add); \
1051 INSTALL_BINOP_TI (ti, op_sub, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _sub); \
1054 INSTALL_BINOP_TI (ti, op_pow, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _pow); \
1056 INSTALL_BINOP_TI (ti, op_el_mul, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _el_mul); \
1057 INSTALL_BINOP_TI (ti, op_el_div, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _el_div); \
1058 INSTALL_BINOP_TI (ti, op_el_pow, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _el_pow); \
1059 INSTALL_BINOP_TI (ti, op_el_ldiv, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _el_ldiv);
1061 #define OCTAVE_INSTALL_MM_INT_CMP_OPS(PFX, T1, T2) \
1062 INSTALL_BINOP_TI (ti, op_lt, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _lt); \
1063 INSTALL_BINOP_TI (ti, op_le, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _le); \
1064 INSTALL_BINOP_TI (ti, op_eq, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _eq); \
1065 INSTALL_BINOP_TI (ti, op_ge, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _ge); \
1066 INSTALL_BINOP_TI (ti, op_gt, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _gt); \
1067 INSTALL_BINOP_TI (ti, op_ne, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _ne);
1069 #define OCTAVE_INSTALL_MM_INT_BOOL_OPS(PFX, T1, T2) \
1070 INSTALL_BINOP_TI (ti, op_el_and, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _el_and); \
1071 INSTALL_BINOP_TI (ti, op_el_or, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _el_or); \
1072 INSTALL_BINOP_TI (ti, op_el_not_and, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _el_not_and); \
1073 INSTALL_BINOP_TI (ti, op_el_not_or, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _el_not_or); \
1074 INSTALL_BINOP_TI (ti, op_el_and_not, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _el_and_not); \
1075 INSTALL_BINOP_TI (ti, op_el_or_not, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _el_or_not);
1077 #define OCTAVE_INSTALL_MM_INT_ASSIGN_OPS(PFX, TLHS, TRHS) \
1078 INSTALL_ASSIGNOP_TI (ti, op_asn_eq, octave_ ## TLHS ## matrix, octave_ ## TRHS ## matrix, PFX ## _assign)
1080 #define OCTAVE_INSTALL_MM_INT_ASSIGNEQ_OPS(PFX, TLHS, TRHS) \
1081 INSTALL_ASSIGNOP_TI (ti, op_add_eq, octave_ ## TLHS ## matrix, octave_ ## TRHS ## matrix, PFX ## _assign_add) \
1082 INSTALL_ASSIGNOP_TI (ti, op_sub_eq, octave_ ## TLHS ## matrix, octave_ ## TRHS ## matrix, PFX ## _assign_sub) \
1083 INSTALL_ASSIGNOP_TI (ti, op_el_mul_eq, octave_ ## TLHS ## matrix, octave_ ## TRHS ## matrix, PFX ## _assign_el_mul) \
1084 INSTALL_ASSIGNOP_TI (ti, op_el_div_eq, octave_ ## TLHS ## matrix, octave_ ## TRHS ## matrix, PFX ## _assign_el_div)
1086 #define OCTAVE_INSTALL_MM_INT_OPS(TYPE) \
1087 OCTAVE_INSTALL_M_INT_UNOPS (TYPE) \
1088 OCTAVE_INSTALL_MM_INT_ARITH_OPS (mm, TYPE ##_, TYPE ## _) \
1089 OCTAVE_INSTALL_MM_INT_ARITH_OPS (mmx, TYPE ##_, ) \
1090 OCTAVE_INSTALL_MM_INT_ARITH_OPS (mxm, , TYPE ##_) \
1091 OCTAVE_INSTALL_MM_INT_ARITH_OPS (mmfx, TYPE ##_, float_) \
1092 OCTAVE_INSTALL_MM_INT_ARITH_OPS (mfxm, float_, TYPE ##_) \
1093 OCTAVE_INSTALL_MM_INT_CMP_OPS (mm, TYPE ## _, TYPE ## _) \
1094 OCTAVE_INSTALL_MM_INT_CMP_OPS (mmx, TYPE ## _, ) \
1095 OCTAVE_INSTALL_MM_INT_CMP_OPS (mxm, , TYPE ## _) \
1096 OCTAVE_INSTALL_MM_INT_CMP_OPS (mmfx, TYPE ## _, float_) \
1097 OCTAVE_INSTALL_MM_INT_CMP_OPS (mfxm, float_, TYPE ## _) \
1098 OCTAVE_INSTALL_MM_INT_BOOL_OPS (mm, TYPE ## _, TYPE ## _) \
1099 OCTAVE_INSTALL_MM_INT_BOOL_OPS (mmx, TYPE ## _, ) \
1100 OCTAVE_INSTALL_MM_INT_BOOL_OPS (mxm, , TYPE ## _) \
1101 OCTAVE_INSTALL_MM_INT_BOOL_OPS (mmfx, TYPE ## _, float_) \
1102 OCTAVE_INSTALL_MM_INT_BOOL_OPS (mfxm, float_, TYPE ## _) \
1103 OCTAVE_INSTALL_MM_INT_ASSIGN_OPS (mm, TYPE ## _, TYPE ## _) \
1104 OCTAVE_INSTALL_MM_INT_ASSIGNEQ_OPS (mme, TYPE ## _, TYPE ## _) \
1105 OCTAVE_INSTALL_MM_INT_ASSIGN_OPS (mmx, TYPE ## _, ) \
1106 OCTAVE_INSTALL_MM_INT_ASSIGN_OPS (mmfx, TYPE ## _, float_) \
1107 INSTALL_WIDENOP_TI (ti, octave_ ## TYPE ## _matrix, octave_complex_matrix, TYPE ## _m_complex_m_conv) \
1108 INSTALL_WIDENOP_TI (ti, octave_ ## TYPE ## _matrix, octave_float_complex_matrix, TYPE ## _m_float_complex_m_conv) \
1109 INSTALL_ASSIGNCONV_TI (ti, octave_ ## TYPE ## _matrix, octave_complex_matrix, octave_complex_matrix) \
1110 INSTALL_ASSIGNCONV_TI (ti, octave_ ## TYPE ## _matrix, octave_float_complex_matrix, octave_float_complex_matrix)
1112 #define OCTAVE_INSTALL_RE_INT_ASSIGN_OPS(TYPE) \
1113 INSTALL_ASSIGNOP_TI (ti, op_asn_eq, octave_matrix, octave_ ## TYPE ## _scalar, TYPE ## ms_assign) \
1114 INSTALL_ASSIGNOP_TI (ti, op_asn_eq, octave_matrix, octave_ ## TYPE ## _matrix, TYPE ## mm_assign) \
1115 INSTALL_ASSIGNCONV_TI (ti, octave_scalar, octave_ ## TYPE ## _scalar, octave_matrix) \
1116 INSTALL_ASSIGNCONV_TI (ti, octave_matrix, octave_ ## TYPE ## _matrix, octave_matrix)
1118 #define OCTAVE_INSTALL_FLT_RE_INT_ASSIGN_OPS(TYPE) \
1119 INSTALL_ASSIGNOP_TI (ti, op_asn_eq, octave_float_matrix, octave_ ## TYPE ## _scalar, TYPE ## fms_assign) \
1120 INSTALL_ASSIGNOP_TI (ti, op_asn_eq, octave_float_matrix, octave_ ## TYPE ## _matrix, TYPE ## fmm_assign) \
1121 INSTALL_ASSIGNCONV_TI (ti, octave_float_scalar, octave_ ## TYPE ## _scalar, octave_float_matrix) \
1122 INSTALL_ASSIGNCONV_TI (ti, octave_float_matrix, octave_ ## TYPE ## _matrix, octave_float_matrix)
1124 #define OCTAVE_INSTALL_CX_INT_ASSIGN_OPS(TYPE) \
1125 INSTALL_ASSIGNOP_TI (ti, op_asn_eq, octave_complex_matrix, octave_ ## TYPE ## _scalar, TYPE ## cms_assign) \
1126 INSTALL_ASSIGNOP_TI (ti, op_asn_eq, octave_complex_matrix, octave_ ## TYPE ## _matrix, TYPE ## cmm_assign) \
1127 INSTALL_ASSIGNCONV_TI (ti, octave_complex_scalar, octave_ ## TYPE ## _scalar, octave_complex_matrix) \
1128 INSTALL_ASSIGNCONV_TI (ti, octave_complex_matrix, octave_ ## TYPE ## _matrix, octave_complex_matrix)
1130 #define OCTAVE_INSTALL_FLT_CX_INT_ASSIGN_OPS(TYPE) \
1131 INSTALL_ASSIGNOP_TI (ti, op_asn_eq, octave_float_complex_matrix, octave_ ## TYPE ## _scalar, TYPE ## fcms_assign) \
1132 INSTALL_ASSIGNOP_TI (ti, op_asn_eq, octave_float_complex_matrix, octave_ ## TYPE ## _matrix, TYPE ## fcmm_assign) \
1133 INSTALL_ASSIGNCONV_TI (ti, octave_float_complex_scalar, octave_ ## TYPE ## _scalar, octave_complex_matrix) \
1134 INSTALL_ASSIGNCONV_TI (ti, octave_float_complex_matrix, octave_ ## TYPE ## _matrix, octave_complex_matrix)
1136 #define OCTAVE_INSTALL_INT_NULL_ASSIGN_OPS(TYPE) \
1137 INSTALL_ASSIGNOP_TI (ti, op_asn_eq, octave_ ## TYPE ## _matrix, octave_null_matrix, TYPE ## null_assign) \
1138 INSTALL_ASSIGNOP_TI (ti, op_asn_eq, octave_ ## TYPE ## _matrix, octave_null_str, TYPE ## null_assign) \
1139 INSTALL_ASSIGNOP_TI (ti, op_asn_eq, octave_ ## TYPE ## _matrix, octave_null_sq_str, TYPE ## null_assign) \
1140 INSTALL_ASSIGNCONV_TI (ti, octave_ ## TYPE ## _scalar, octave_null_matrix, octave_ ## TYPE ## _matrix) \
1141 INSTALL_ASSIGNCONV_TI (ti, octave_## TYPE ## _scalar, octave_null_str, octave_ ## TYPE ## _matrix) \
1142 INSTALL_ASSIGNCONV_TI (ti, octave_## TYPE ## _scalar, octave_null_sq_str, octave_ ## TYPE ## _matrix)
1144 #define OCTAVE_INSTALL_INT_OPS(TYPE) \
1145 OCTAVE_INSTALL_SS_INT_OPS (TYPE) \
1146 OCTAVE_INSTALL_SM_INT_OPS (TYPE) \
1147 OCTAVE_INSTALL_MS_INT_OPS (TYPE) \
1148 OCTAVE_INSTALL_MM_INT_OPS (TYPE) \
1149 OCTAVE_INSTALL_CONCAT_FN (TYPE) \
1150 OCTAVE_INSTALL_RE_INT_ASSIGN_OPS (TYPE) \
1151 OCTAVE_INSTALL_FLT_RE_INT_ASSIGN_OPS (TYPE) \
1152 OCTAVE_INSTALL_CX_INT_ASSIGN_OPS (TYPE) \
1153 OCTAVE_INSTALL_FLT_CX_INT_ASSIGN_OPS (TYPE) \
1154 OCTAVE_INSTALL_INT_NULL_ASSIGN_OPS(TYPE)
1156 #define OCTAVE_INSTALL_SM_INT_ASSIGNCONV(TLHS, TRHS) \
1157 INSTALL_ASSIGNCONV_TI (ti, octave_ ## TLHS ## _scalar, octave_ ## TRHS ## _scalar, octave_ ## TLHS ## _matrix) \
1158 INSTALL_ASSIGNCONV_TI (ti, octave_ ## TLHS ## _scalar, octave_ ## TRHS ## _matrix, octave_ ## TLHS ## _matrix)
1160 #define OCTAVE_MIXED_INT_CMP_OPS(T1, T2) \
1161 OCTAVE_SS_INT_CMP_OPS (T1 ## _ ## T2 ## _ss, T1 ## _, T2 ## _) \
1162 OCTAVE_SM_INT_CMP_OPS (T1 ## _ ## T2 ## _sm, T1 ## _, T2 ## _) \
1163 OCTAVE_MS_INT_CMP_OPS (T1 ## _ ## T2 ## _ms, T1 ## _, T2 ## _) \
1164 OCTAVE_MM_INT_CMP_OPS (T1 ## _ ## T2 ## _mm, T1 ## _, T2 ## _)
1166 #define OCTAVE_INSTALL_MIXED_INT_CMP_OPS(T1, T2) \
1167 OCTAVE_INSTALL_SS_INT_CMP_OPS (T1 ## _ ## T2 ## _ss, T1 ## _, T2 ## _) \
1168 OCTAVE_INSTALL_SM_INT_CMP_OPS (T1 ## _ ## T2 ## _sm, T1 ## _, T2 ## _) \
1169 OCTAVE_INSTALL_MS_INT_CMP_OPS (T1 ## _ ## T2 ## _ms, T1 ## _, T2 ## _) \
1170 OCTAVE_INSTALL_MM_INT_CMP_OPS (T1 ## _ ## T2 ## _mm, T1 ## _, T2 ## _)