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) \
264 xpow (const octave_ ## T1& a, const octave_ ## T2& b) \
270 xpow (const octave_ ## T1& a, double b) \
276 xpow (double a, const octave_ ## T1& b) \
282 xpow (const octave_ ## T1& a, float b) \
284 return powf (a, b); \
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) \
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); \
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); \
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); \
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); \
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 octave_value elem_xpow (T1 ## NDArray a, octave_ ## T2 b) \
539 T1 ## NDArray result (a.dims ()); \
540 for (int i = 0; i < a.numel (); i++) \
543 result (i) = pow (a(i), b); \
545 return octave_value (result); \
548 octave_value elem_xpow (T1 ## NDArray a, double b) \
550 T1 ## NDArray result (a.dims ()); \
551 for (int i = 0; i < a.numel (); i++) \
554 result (i) = pow (a(i), b); \
556 return octave_value (result); \
559 octave_value elem_xpow (NDArray a, octave_ ## T2 b) \
561 T2 ## NDArray result (a.dims ()); \
562 for (int i = 0; i < a.numel (); i++) \
565 result (i) = pow (a(i), b); \
567 return octave_value (result); \
570 octave_value elem_xpow (T1 ## NDArray a, float b) \
572 T1 ## NDArray result (a.dims ()); \
573 for (int i = 0; i < a.numel (); i++) \
576 result (i) = powf (a(i), b); \
578 return octave_value (result); \
581 octave_value elem_xpow (FloatNDArray a, octave_ ## T2 b) \
583 T2 ## NDArray result (a.dims ()); \
584 for (int i = 0; i < a.numel (); i++) \
587 result (i) = powf (a(i), b); \
589 return octave_value (result); \
592 #define OCTAVE_MS_INT_OPS(TYPE) \
593 OCTAVE_MS_POW_OPS (TYPE, TYPE) \
594 OCTAVE_MS_INT_ARITH_OPS (ms, TYPE ## _, TYPE ## _, TYPE) \
595 OCTAVE_MS_INT_ARITH_OPS (msx, TYPE ## _, , TYPE) \
596 OCTAVE_MS_INT_ARITH_OPS (mxs, , TYPE ## _, TYPE) \
597 OCTAVE_MS_INT_ARITH_OPS (msfx, TYPE ## _, float_, TYPE) \
598 OCTAVE_MS_INT_ARITH_OPS (mfxs, float_, TYPE ## _, TYPE) \
599 OCTAVE_MS_INT_CMP_OPS (ms, TYPE ## _, TYPE ## _) \
600 OCTAVE_MS_INT_CMP_OPS (mx, TYPE ## _, ) \
601 OCTAVE_MS_INT_CMP_OPS (mxs, , TYPE ## _) \
602 OCTAVE_MS_INT_CMP_OPS (mfx, TYPE ## _, float_) \
603 OCTAVE_MS_INT_CMP_OPS (mfxs, float_, TYPE ## _) \
604 OCTAVE_MS_INT_BOOL_OPS (ms, TYPE ## _, TYPE ## _) \
605 OCTAVE_MS_INT_BOOL_OPS (mx, TYPE ## _, ) \
606 OCTAVE_MS_INT_BOOL_OPS (mxs, , TYPE ## _) \
607 OCTAVE_MS_INT_BOOL_OPS (mfx, TYPE ## _, float_) \
608 OCTAVE_MS_INT_BOOL_OPS (mfxs, float_, TYPE ## _) \
609 OCTAVE_MS_INT_ASSIGN_OPS (ms, TYPE ## _, TYPE ## _, TYPE ## _) \
610 OCTAVE_MS_INT_ASSIGNEQ_OPS (mse, TYPE ## _) \
611 OCTAVE_MS_INT_ASSIGN_OPS (mx, TYPE ## _, , ) \
612 OCTAVE_MS_INT_ASSIGN_OPS (mfx, TYPE ## _, float_, float_)
615 #define OCTAVE_M_INT_UNOPS(TYPE) \
617 DEFNDUNOP_OP (m_not, TYPE ## _matrix, TYPE ## _array, !) \
618 DEFNDUNOP_OP (m_uplus, TYPE ## _matrix, TYPE ## _array, ) \
619 DEFUNOP (m_uminus, TYPE ## _matrix) \
621 const octave_ ## TYPE ## _matrix & v = dynamic_cast<const octave_ ## TYPE ## _matrix &> (a); \
622 octave_value retval = octave_value (- v. TYPE ## _array_value ()); \
626 DEFUNOP (m_transpose, TYPE ## _matrix) \
628 const octave_ ## TYPE ## _matrix& v = dynamic_cast<const octave_ ## TYPE ## _matrix&> (a); \
630 if (v.ndims () > 2) \
631 error ("transpose not defined for N-D objects"); \
633 return octave_value (v.TYPE ## _array_value ().transpose ()); \
636 DEFNCUNOP_METHOD (m_incr, TYPE ## _matrix, increment) \
637 DEFNCUNOP_METHOD (m_decr, TYPE ## _matrix, decrement) \
638 DEFNCUNOP_METHOD (m_changesign, TYPE ## _matrix, changesign)
641 #define OCTAVE_MM_INT_ARITH_OPS(PFX, T1, T2, T3) \
643 DEFINTNDBINOP_OP (PFX ## _add, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, +, T3) \
644 DEFINTNDBINOP_OP (PFX ## _sub, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, -, T3) \
649 DEFBINOPX (PFX ## _pow, T1 ## matrix, T2 ## matrix) \
651 error ("can't do A ^ B for A and B both matrices"); \
656 DEFINTNDBINOP_FN (PFX ## _el_mul, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, product, T3, .*) \
658 DEFINTNDBINOP_FN (PFX ## _el_div, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, quotient, T3, ./) \
660 DEFINTNDBINOP_FN (PFX ## _el_pow, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, elem_xpow, T3, .^) \
662 DEFBINOP (PFX ## _el_ldiv, T1 ## matrix, T2 ## matrix) \
664 const octave_ ## T1 ## matrix& v1 = dynamic_cast<const octave_ ## T1 ## matrix&> (a1); \
665 const octave_ ## T2 ## matrix& v2 = dynamic_cast<const octave_ ## T2 ## matrix&> (a2); \
667 octave_value retval = octave_value (quotient (v2.T2 ## array_value (), v1.T1 ## array_value ())); \
671 #define OCTAVE_MM_INT_CMP_OPS(PFX, T1, T2) \
672 DEFNDBINOP_FN (PFX ## _lt, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, mx_el_lt) \
673 DEFNDBINOP_FN (PFX ## _le, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, mx_el_le) \
674 DEFNDBINOP_FN (PFX ## _eq, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, mx_el_eq) \
675 DEFNDBINOP_FN (PFX ## _ge, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, mx_el_ge) \
676 DEFNDBINOP_FN (PFX ## _gt, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, mx_el_gt) \
677 DEFNDBINOP_FN (PFX ## _ne, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, mx_el_ne)
679 #define OCTAVE_MM_INT_BOOL_OPS(PFX, T1, T2) \
680 DEFNDBINOP_FN (PFX ## _el_and, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, mx_el_and) \
681 DEFNDBINOP_FN (PFX ## _el_or, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, mx_el_or) \
682 DEFNDBINOP_FN (PFX ## _el_not_and, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, mx_el_not_and) \
683 DEFNDBINOP_FN (PFX ## _el_not_or, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, mx_el_not_or) \
684 DEFNDBINOP_FN (PFX ## _el_and_not, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, mx_el_and_not) \
685 DEFNDBINOP_FN (PFX ## _el_or_not, T1 ## matrix, T2 ## matrix, T1 ## array, T2 ## array, mx_el_or_not)
687 #define OCTAVE_MM_INT_ASSIGN_OPS(PFX, TLHS, TRHS, TE) \
688 DEFNDASSIGNOP_FN (PFX ## _assign, TLHS ## matrix, TRHS ## matrix, TLHS ## array, assign)
690 #define OCTAVE_MM_INT_ASSIGNEQ_OPS(PFX, TM) \
691 DEFNDASSIGNOP_OP (PFX ## _assign_add, TM ## matrix, TM ## matrix, TM ## array, +=) \
692 DEFNDASSIGNOP_OP (PFX ## _assign_sub, TM ## matrix, TM ## matrix, TM ## array, -=) \
693 DEFNDASSIGNOP_FNOP (PFX ## _assign_el_mul, TM ## matrix, TM ## matrix, TM ## array, product_eq) \
694 DEFNDASSIGNOP_FNOP (PFX ## _assign_el_div, TM ## matrix, TM ## matrix, TM ## array, quotient_eq)
696 #define OCTAVE_MM_POW_OPS(T1, T2) \
698 elem_xpow (const T1 ## NDArray& a, const T2 ## NDArray& b) \
700 dim_vector a_dims = a.dims (); \
701 dim_vector b_dims = b.dims (); \
702 if (a_dims != b_dims) \
704 if (! is_valid_bsxfun ("operator .^", a_dims, b_dims)) \
705 octave::err_nonconformant ("operator .^", a_dims, b_dims); \
707 return bsxfun_pow (a, b); \
709 T1 ## NDArray result (a_dims); \
710 for (int i = 0; i < a.numel (); i++) \
713 result (i) = pow (a(i), b(i)); \
715 return octave_value (result); \
719 elem_xpow (const T1 ## NDArray& a, const NDArray& b) \
721 dim_vector a_dims = a.dims (); \
722 dim_vector b_dims = b.dims (); \
723 if (a_dims != b_dims) \
725 if (! is_valid_bsxfun ("operator .^", a_dims, b_dims)) \
726 octave::err_nonconformant ("operator .^", a_dims, b_dims); \
728 return bsxfun_pow (a, b); \
730 T1 ## NDArray result (a_dims); \
731 for (int i = 0; i < a.numel (); i++) \
734 result (i) = pow (a(i), b(i)); \
736 return octave_value (result); \
740 elem_xpow (const NDArray& a, const T2 ## NDArray& b) \
742 dim_vector a_dims = a.dims (); \
743 dim_vector b_dims = b.dims (); \
744 if (a_dims != b_dims) \
746 if (! is_valid_bsxfun ("operator .^", a_dims, b_dims)) \
747 octave::err_nonconformant ("operator .^", a_dims, b_dims); \
749 return bsxfun_pow (a, b); \
751 T2 ## NDArray result (a_dims); \
752 for (int i = 0; i < a.numel (); i++) \
755 result (i) = pow (a(i), b(i)); \
757 return octave_value (result); \
761 elem_xpow (const T1 ## NDArray& a, const FloatNDArray& b) \
763 dim_vector a_dims = a.dims (); \
764 dim_vector b_dims = b.dims (); \
765 if (a_dims != b_dims) \
767 if (! is_valid_bsxfun ("operator .^", a_dims, b_dims)) \
768 octave::err_nonconformant ("operator .^", a_dims, b_dims); \
770 return bsxfun_pow (a, b); \
772 T1 ## NDArray result (a_dims); \
773 for (int i = 0; i < a.numel (); i++) \
776 result (i) = powf (a(i), b(i)); \
778 return octave_value (result); \
782 elem_xpow (const FloatNDArray& a, const T2 ## NDArray& b) \
784 dim_vector a_dims = a.dims (); \
785 dim_vector b_dims = b.dims (); \
786 if (a_dims != b_dims) \
788 if (! is_valid_bsxfun ("operator .^", a_dims, b_dims)) \
789 octave::err_nonconformant ("operator .^", a_dims, b_dims); \
791 return bsxfun_pow (a, b); \
793 T2 ## NDArray result (a_dims); \
794 for (int i = 0; i < a.numel (); i++) \
797 result (i) = powf (a(i), b(i)); \
799 return octave_value (result); \
802 #define OCTAVE_MM_CONV(T1, T2) \
803 DEFCONV (T1 ## m_ ## T2 ## m_conv, T1 ## matrix, T2 ## matrix) \
805 const octave_ ## T1 ## matrix& v = dynamic_cast<const octave_ ## T1 ## matrix&> (a); \
807 return new octave_ ## T2 ## matrix (v.T2 ## array_value ()); \
810 #define OCTAVE_MM_INT_OPS(TYPE) \
811 OCTAVE_M_INT_UNOPS (TYPE) \
812 OCTAVE_MM_POW_OPS (TYPE, TYPE) \
813 OCTAVE_MM_INT_ARITH_OPS (mm, TYPE ## _, TYPE ## _, TYPE) \
814 OCTAVE_MM_INT_ARITH_OPS (mmx, TYPE ## _, , TYPE) \
815 OCTAVE_MM_INT_ARITH_OPS (mxm, , TYPE ## _, TYPE) \
816 OCTAVE_MM_INT_ARITH_OPS (mmfx, TYPE ## _, float_, TYPE) \
817 OCTAVE_MM_INT_ARITH_OPS (mfxm, float_, TYPE ## _, TYPE) \
818 OCTAVE_MM_INT_CMP_OPS (mm, TYPE ## _, TYPE ## _) \
819 OCTAVE_MM_INT_CMP_OPS (mmx, TYPE ## _, ) \
820 OCTAVE_MM_INT_CMP_OPS (mfxm, float_, TYPE ## _) \
821 OCTAVE_MM_INT_CMP_OPS (mmfx, TYPE ## _, float_) \
822 OCTAVE_MM_INT_CMP_OPS (mxm, , TYPE ## _) \
823 OCTAVE_MM_INT_BOOL_OPS (mm, TYPE ## _, TYPE ## _) \
824 OCTAVE_MM_INT_BOOL_OPS (mmx, TYPE ## _, ) \
825 OCTAVE_MM_INT_BOOL_OPS (mxm, , TYPE ## _) \
826 OCTAVE_MM_INT_BOOL_OPS (mmfx, TYPE ## _, float_) \
827 OCTAVE_MM_INT_BOOL_OPS (mfxm, float_, TYPE ## _) \
828 OCTAVE_MM_INT_ASSIGN_OPS (mm, TYPE ## _, TYPE ## _, TYPE ## _) \
829 OCTAVE_MM_INT_ASSIGNEQ_OPS (mme, TYPE ## _) \
830 OCTAVE_MM_INT_ASSIGN_OPS (mmx, TYPE ## _, , ) \
831 OCTAVE_MM_INT_ASSIGN_OPS (mmfx, TYPE ## _, float_, float_) \
832 OCTAVE_MM_CONV(TYPE ## _, complex_) \
833 OCTAVE_MM_CONV(TYPE ## _, float_complex_)
835 #define OCTAVE_RE_INT_ASSIGN_OPS(TYPE) \
836 DEFNDASSIGNOP_FN (TYPE ## ms_assign, matrix, TYPE ## _scalar, array, assign) \
837 DEFNDASSIGNOP_FN (TYPE ## mm_assign, matrix, TYPE ## _matrix, array, assign)
839 #define OCTAVE_FLT_RE_INT_ASSIGN_OPS(TYPE) \
840 DEFNDASSIGNOP_FN (TYPE ## fms_assign, float_matrix, TYPE ## _scalar, float_array, assign) \
841 DEFNDASSIGNOP_FN (TYPE ## fmm_assign, float_matrix, TYPE ## _matrix, float_array, assign)
843 #define OCTAVE_CX_INT_ASSIGN_OPS(TYPE) \
844 DEFNDASSIGNOP_FN (TYPE ## cms_assign, complex_matrix, TYPE ## _scalar, complex_array, assign) \
845 DEFNDASSIGNOP_FN (TYPE ## cmm_assign, complex_matrix, TYPE ## _matrix, complex_array, assign)
847 #define OCTAVE_FLT_CX_INT_ASSIGN_OPS(TYPE) \
848 DEFNDASSIGNOP_FN (TYPE ## fcms_assign, float_complex_matrix, TYPE ## _scalar, float_complex_array, assign) \
849 DEFNDASSIGNOP_FN (TYPE ## fcmm_assign, float_complex_matrix, TYPE ## _matrix, float_complex_array, assign)
851 #define OCTAVE_INT_NULL_ASSIGN_OPS(TYPE) \
852 DEFNULLASSIGNOP_FN (TYPE ## null_assign, TYPE ## _matrix, delete_elements)
854 #define OCTAVE_INT_OPS(TYPE) \
855 OCTAVE_SS_INT_OPS (TYPE) \
856 OCTAVE_SM_INT_OPS (TYPE) \
857 OCTAVE_MS_INT_OPS (TYPE) \
858 OCTAVE_MM_INT_OPS (TYPE) \
859 OCTAVE_CONCAT_FN (TYPE) \
860 OCTAVE_RE_INT_ASSIGN_OPS (TYPE) \
861 OCTAVE_FLT_RE_INT_ASSIGN_OPS (TYPE) \
862 OCTAVE_CX_INT_ASSIGN_OPS (TYPE) \
863 OCTAVE_FLT_CX_INT_ASSIGN_OPS (TYPE) \
864 OCTAVE_INT_NULL_ASSIGN_OPS(TYPE)
866 #define OCTAVE_INSTALL_S_INT_UNOPS(TYPE) \
867 INSTALL_UNOP_TI (ti, op_not, octave_ ## TYPE ## _scalar, s_not); \
868 INSTALL_UNOP_TI (ti, op_uplus, octave_ ## TYPE ## _scalar, s_uplus); \
869 INSTALL_UNOP_TI (ti, op_uminus, octave_ ## TYPE ## _scalar, s_uminus); \
870 INSTALL_UNOP_TI (ti, op_transpose, octave_ ## TYPE ## _scalar, s_transpose); \
871 INSTALL_UNOP_TI (ti, op_hermitian, octave_ ## TYPE ## _scalar, s_hermitian); \
873 INSTALL_NCUNOP_TI (ti, op_incr, octave_ ## TYPE ## _scalar, s_incr); \
874 INSTALL_NCUNOP_TI (ti, op_decr, octave_ ## TYPE ## _scalar, s_decr);
876 #define OCTAVE_INSTALL_SS_INT_ARITH_OPS(PFX, T1, T2) \
877 INSTALL_BINOP_TI (ti, op_add, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _add); \
878 INSTALL_BINOP_TI (ti, op_sub, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _sub); \
879 INSTALL_BINOP_TI (ti, op_mul, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _mul); \
880 INSTALL_BINOP_TI (ti, op_div, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _div); \
881 INSTALL_BINOP_TI (ti, op_pow, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _pow); \
882 INSTALL_BINOP_TI (ti, op_ldiv, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _ldiv); \
883 INSTALL_BINOP_TI (ti, op_el_mul, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _el_mul); \
884 INSTALL_BINOP_TI (ti, op_el_div, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _el_div); \
885 INSTALL_BINOP_TI (ti, op_el_pow, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _el_pow); \
886 INSTALL_BINOP_TI (ti, op_el_ldiv, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _el_ldiv);
888 #define OCTAVE_INSTALL_SS_INT_CMP_OPS(PFX, T1, T2) \
889 INSTALL_BINOP_TI (ti, op_lt, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _lt); \
890 INSTALL_BINOP_TI (ti, op_le, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _le); \
891 INSTALL_BINOP_TI (ti, op_eq, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _eq); \
892 INSTALL_BINOP_TI (ti, op_ge, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _ge); \
893 INSTALL_BINOP_TI (ti, op_gt, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _gt); \
894 INSTALL_BINOP_TI (ti, op_ne, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _ne);
896 #define OCTAVE_INSTALL_SS_INT_BOOL_OPS(PFX, T1, T2) \
897 INSTALL_BINOP_TI (ti, op_el_and, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _el_and); \
898 INSTALL_BINOP_TI (ti, op_el_or, octave_ ## T1 ## scalar, octave_ ## T2 ## scalar, PFX ## _el_or);
900 #define OCTAVE_INSTALL_SS_INT_OPS(TYPE) \
901 OCTAVE_INSTALL_S_INT_UNOPS (TYPE) \
902 OCTAVE_INSTALL_SS_INT_ARITH_OPS (ss, TYPE ## _, TYPE ## _) \
903 OCTAVE_INSTALL_SS_INT_ARITH_OPS (ssx, TYPE ## _, ) \
904 OCTAVE_INSTALL_SS_INT_ARITH_OPS (sxs, , TYPE ## _) \
905 OCTAVE_INSTALL_SS_INT_ARITH_OPS (ssfx, TYPE ## _, float_) \
906 OCTAVE_INSTALL_SS_INT_ARITH_OPS (sfxs, float_, TYPE ## _) \
907 OCTAVE_INSTALL_SS_INT_CMP_OPS (ss, TYPE ## _, TYPE ## _) \
908 OCTAVE_INSTALL_SS_INT_CMP_OPS (sx, TYPE ## _, ) \
909 OCTAVE_INSTALL_SS_INT_CMP_OPS (xs, , TYPE ## _) \
910 OCTAVE_INSTALL_SS_INT_CMP_OPS (sfx, TYPE ## _, float_) \
911 OCTAVE_INSTALL_SS_INT_CMP_OPS (fxs, float_, TYPE ## _) \
912 OCTAVE_INSTALL_SS_INT_BOOL_OPS (ss, TYPE ## _, TYPE ## _) \
913 OCTAVE_INSTALL_SS_INT_BOOL_OPS (sx, TYPE ## _, ) \
914 OCTAVE_INSTALL_SS_INT_BOOL_OPS (xs, , TYPE ## _) \
915 OCTAVE_INSTALL_SS_INT_BOOL_OPS (sfx, TYPE ## _, float_) \
916 OCTAVE_INSTALL_SS_INT_BOOL_OPS (fxs, float_, TYPE ## _) \
917 INSTALL_ASSIGNCONV_TI (ti, octave_ ## TYPE ## _scalar, octave_ ## TYPE ## _scalar, octave_ ## TYPE ## _matrix) \
918 INSTALL_ASSIGNCONV_TI (ti, octave_ ## TYPE ## _scalar, octave_scalar, octave_ ## TYPE ## _matrix) \
919 INSTALL_ASSIGNCONV_TI (ti, octave_ ## TYPE ## _scalar, octave_float_scalar, octave_ ## TYPE ## _matrix) \
920 INSTALL_ASSIGNCONV_TI (ti, octave_ ## TYPE ## _scalar, octave_complex_scalar, octave_complex_matrix) \
921 INSTALL_ASSIGNCONV_TI (ti, octave_ ## TYPE ## _scalar, octave_float_complex_scalar, octave_float_complex_matrix)
923 #define OCTAVE_INSTALL_SM_INT_ARITH_OPS(PFX, T1, T2) \
924 INSTALL_BINOP_TI (ti, op_add, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _add); \
925 INSTALL_BINOP_TI (ti, op_sub, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _sub); \
926 INSTALL_BINOP_TI (ti, op_mul, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _mul); \
929 INSTALL_BINOP_TI (ti, op_ldiv, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _ldiv); \
930 INSTALL_BINOP_TI (ti, op_el_mul, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _el_mul); \
931 INSTALL_BINOP_TI (ti, op_el_div, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _el_div); \
932 INSTALL_BINOP_TI (ti, op_el_pow, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _el_pow); \
933 INSTALL_BINOP_TI (ti, op_el_ldiv, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _el_ldiv);
935 #define OCTAVE_INSTALL_SM_INT_CMP_OPS(PFX, T1, T2) \
936 INSTALL_BINOP_TI (ti, op_lt, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _lt); \
937 INSTALL_BINOP_TI (ti, op_le, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _le); \
938 INSTALL_BINOP_TI (ti, op_eq, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _eq); \
939 INSTALL_BINOP_TI (ti, op_ge, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _ge); \
940 INSTALL_BINOP_TI (ti, op_gt, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _gt); \
941 INSTALL_BINOP_TI (ti, op_ne, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _ne);
943 #define OCTAVE_INSTALL_SM_INT_BOOL_OPS(PFX, T1, T2) \
944 INSTALL_BINOP_TI (ti, op_el_and, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _el_and); \
945 INSTALL_BINOP_TI (ti, op_el_or, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _el_or); \
946 INSTALL_BINOP_TI (ti, op_el_and_not, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _el_and_not); \
947 INSTALL_BINOP_TI (ti, op_el_or_not, octave_ ## T1 ## scalar, octave_ ## T2 ## matrix, PFX ## _el_or_not);
949 #define OCTAVE_INSTALL_SM_INT_OPS(TYPE) \
950 OCTAVE_INSTALL_SM_INT_ARITH_OPS (sm, TYPE ## _, TYPE ## _) \
951 OCTAVE_INSTALL_SM_INT_ARITH_OPS (smx, TYPE ## _, ) \
952 OCTAVE_INSTALL_SM_INT_ARITH_OPS (sxm, , TYPE ## _) \
953 OCTAVE_INSTALL_SM_INT_ARITH_OPS (smfx, TYPE ## _, float_) \
954 OCTAVE_INSTALL_SM_INT_ARITH_OPS (sfxm, float_, TYPE ## _) \
955 OCTAVE_INSTALL_SM_INT_CMP_OPS (sm, TYPE ## _, TYPE ## _) \
956 OCTAVE_INSTALL_SM_INT_CMP_OPS (xm, , TYPE ## _) \
957 OCTAVE_INSTALL_SM_INT_CMP_OPS (smx, TYPE ## _, ) \
958 OCTAVE_INSTALL_SM_INT_CMP_OPS (fxm, float_, TYPE ## _) \
959 OCTAVE_INSTALL_SM_INT_CMP_OPS (smfx, TYPE ## _, float_) \
960 OCTAVE_INSTALL_SM_INT_BOOL_OPS (sm, TYPE ## _, TYPE ## _) \
961 OCTAVE_INSTALL_SM_INT_BOOL_OPS (xm, , TYPE ## _) \
962 OCTAVE_INSTALL_SM_INT_BOOL_OPS (smx, TYPE ## _, ) \
963 OCTAVE_INSTALL_SM_INT_BOOL_OPS (fxm, float_, TYPE ## _) \
964 OCTAVE_INSTALL_SM_INT_BOOL_OPS (smfx, TYPE ## _, float_) \
965 INSTALL_WIDENOP_TI (ti, octave_ ## TYPE ## _scalar, octave_ ## TYPE ## _matrix, TYPE ## _s_ ## TYPE ## _m_conv) \
966 INSTALL_WIDENOP_TI (ti, octave_ ## TYPE ## _scalar, octave_complex_matrix, TYPE ## _s_complex_m_conv) \
967 INSTALL_WIDENOP_TI (ti, octave_ ## TYPE ## _scalar, octave_float_complex_matrix, TYPE ## _s_float_complex_m_conv) \
968 INSTALL_ASSIGNCONV_TI (ti, octave_ ## TYPE ## _scalar, octave_ ## TYPE ## _matrix, octave_ ## TYPE ## _matrix) \
969 INSTALL_ASSIGNCONV_TI (ti, octave_ ## TYPE ## _scalar, octave_matrix, octave_ ## TYPE ## _matrix) \
970 INSTALL_ASSIGNCONV_TI (ti, octave_ ## TYPE ## _scalar, octave_float_matrix, octave_ ## TYPE ## _matrix) \
971 INSTALL_ASSIGNCONV_TI (ti, octave_ ## TYPE ## _scalar, octave_complex_matrix, octave_complex_matrix) \
972 INSTALL_ASSIGNCONV_TI (ti, octave_ ## TYPE ## _scalar, octave_float_complex_matrix, octave_float_complex_matrix)
974 #define OCTAVE_INSTALL_MS_INT_ARITH_OPS(PFX, T1, T2) \
975 INSTALL_BINOP_TI (ti, op_add, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _add); \
976 INSTALL_BINOP_TI (ti, op_sub, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _sub); \
977 INSTALL_BINOP_TI (ti, op_mul, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _mul); \
978 INSTALL_BINOP_TI (ti, op_div, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _div); \
982 INSTALL_BINOP_TI (ti, op_el_mul, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _el_mul); \
983 INSTALL_BINOP_TI (ti, op_el_div, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _el_div); \
984 INSTALL_BINOP_TI (ti, op_el_pow, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _el_pow); \
985 INSTALL_BINOP_TI (ti, op_el_ldiv, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _el_ldiv);
987 #define OCTAVE_INSTALL_MS_INT_CMP_OPS(PFX, T1, T2) \
988 INSTALL_BINOP_TI (ti, op_lt, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _lt); \
989 INSTALL_BINOP_TI (ti, op_le, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _le); \
990 INSTALL_BINOP_TI (ti, op_eq, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _eq); \
991 INSTALL_BINOP_TI (ti, op_ge, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _ge); \
992 INSTALL_BINOP_TI (ti, op_gt, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _gt); \
993 INSTALL_BINOP_TI (ti, op_ne, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _ne);
995 #define OCTAVE_INSTALL_MS_INT_BOOL_OPS(PFX, T1, T2) \
996 INSTALL_BINOP_TI (ti, op_el_and, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _el_and); \
997 INSTALL_BINOP_TI (ti, op_el_or, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _el_or); \
998 INSTALL_BINOP_TI (ti, op_el_not_and, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _el_not_and); \
999 INSTALL_BINOP_TI (ti, op_el_not_or, octave_ ## T1 ## matrix, octave_ ## T2 ## scalar, PFX ## _el_not_or);
1001 #define OCTAVE_INSTALL_MS_INT_ASSIGN_OPS(PFX, TLHS, TRHS) \
1002 INSTALL_ASSIGNOP_TI (ti, op_asn_eq, octave_ ## TLHS ## matrix, octave_ ## TRHS ## scalar, PFX ## _assign)
1004 #define OCTAVE_INSTALL_MS_INT_ASSIGNEQ_OPS(PFX, TLHS, TRHS) \
1005 INSTALL_ASSIGNOP_TI (ti, op_add_eq, octave_ ## TLHS ## matrix, octave_ ## TRHS ## scalar, PFX ## _assign_add) \
1006 INSTALL_ASSIGNOP_TI (ti, op_sub_eq, octave_ ## TLHS ## matrix, octave_ ## TRHS ## scalar, PFX ## _assign_sub) \
1007 INSTALL_ASSIGNOP_TI (ti, op_mul_eq, octave_ ## TLHS ## matrix, octave_ ## TRHS ## scalar, PFX ## _assign_mul) \
1008 INSTALL_ASSIGNOP_TI (ti, op_div_eq, octave_ ## TLHS ## matrix, octave_ ## TRHS ## scalar, PFX ## _assign_div)
1010 #define OCTAVE_INSTALL_MS_INT_OPS(TYPE) \
1011 OCTAVE_INSTALL_MS_INT_ARITH_OPS (ms, TYPE ## _, TYPE ## _) \
1012 OCTAVE_INSTALL_MS_INT_ARITH_OPS (msx, TYPE ## _, ) \
1013 OCTAVE_INSTALL_MS_INT_ARITH_OPS (mxs, , TYPE ## _) \
1014 OCTAVE_INSTALL_MS_INT_ARITH_OPS (msfx, TYPE ## _, float_) \
1015 OCTAVE_INSTALL_MS_INT_ARITH_OPS (mfxs, float_, TYPE ## _) \
1016 OCTAVE_INSTALL_MS_INT_CMP_OPS (ms, TYPE ## _, TYPE ## _) \
1017 OCTAVE_INSTALL_MS_INT_CMP_OPS (mx, TYPE ## _, ) \
1018 OCTAVE_INSTALL_MS_INT_CMP_OPS (mxs, , TYPE ## _) \
1019 OCTAVE_INSTALL_MS_INT_CMP_OPS (mfx, TYPE ## _, float_) \
1020 OCTAVE_INSTALL_MS_INT_CMP_OPS (mfxs, float_, TYPE ## _) \
1021 OCTAVE_INSTALL_MS_INT_BOOL_OPS (ms, TYPE ## _, TYPE ## _) \
1022 OCTAVE_INSTALL_MS_INT_BOOL_OPS (mx, TYPE ## _, ) \
1023 OCTAVE_INSTALL_MS_INT_BOOL_OPS (mxs, , TYPE ## _) \
1024 OCTAVE_INSTALL_MS_INT_BOOL_OPS (mfx, TYPE ## _, float_) \
1025 OCTAVE_INSTALL_MS_INT_BOOL_OPS (mfxs, float_, TYPE ## _) \
1026 OCTAVE_INSTALL_MS_INT_ASSIGN_OPS (ms, TYPE ## _, TYPE ## _) \
1027 OCTAVE_INSTALL_MS_INT_ASSIGNEQ_OPS (mse, TYPE ## _, TYPE ## _) \
1028 OCTAVE_INSTALL_MS_INT_ASSIGN_OPS (mx, TYPE ## _, ) \
1029 OCTAVE_INSTALL_MS_INT_ASSIGN_OPS (mfx, TYPE ## _, float_) \
1030 INSTALL_ASSIGNCONV_TI (ti, octave_ ## TYPE ## _matrix, octave_complex_scalar, octave_complex_matrix) \
1031 INSTALL_ASSIGNCONV_TI (ti, octave_ ## TYPE ## _matrix, octave_float_complex_scalar, octave_float_complex_matrix)
1033 #define OCTAVE_INSTALL_M_INT_UNOPS(TYPE) \
1034 INSTALL_UNOP_TI (ti, op_not, octave_ ## TYPE ## _matrix, m_not); \
1035 INSTALL_UNOP_TI (ti, op_uplus, octave_ ## TYPE ## _matrix, m_uplus); \
1036 INSTALL_UNOP_TI (ti, op_uminus, octave_ ## TYPE ## _matrix, m_uminus); \
1037 INSTALL_UNOP_TI (ti, op_transpose, octave_ ## TYPE ## _matrix, m_transpose); \
1038 INSTALL_UNOP_TI (ti, op_hermitian, octave_ ## TYPE ## _matrix, m_transpose); \
1040 INSTALL_NCUNOP_TI (ti, op_incr, octave_ ## TYPE ## _matrix, m_incr); \
1041 INSTALL_NCUNOP_TI (ti, op_decr, octave_ ## TYPE ## _matrix, m_decr); \
1042 INSTALL_NCUNOP_TI (ti, op_uminus, octave_ ## TYPE ## _matrix, m_changesign);
1044 #define OCTAVE_INSTALL_MM_INT_ARITH_OPS(PFX, T1, T2) \
1045 INSTALL_BINOP_TI (ti, op_add, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _add); \
1046 INSTALL_BINOP_TI (ti, op_sub, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _sub); \
1049 INSTALL_BINOP_TI (ti, op_pow, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _pow); \
1051 INSTALL_BINOP_TI (ti, op_el_mul, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _el_mul); \
1052 INSTALL_BINOP_TI (ti, op_el_div, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _el_div); \
1053 INSTALL_BINOP_TI (ti, op_el_pow, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _el_pow); \
1054 INSTALL_BINOP_TI (ti, op_el_ldiv, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _el_ldiv);
1056 #define OCTAVE_INSTALL_MM_INT_CMP_OPS(PFX, T1, T2) \
1057 INSTALL_BINOP_TI (ti, op_lt, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _lt); \
1058 INSTALL_BINOP_TI (ti, op_le, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _le); \
1059 INSTALL_BINOP_TI (ti, op_eq, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _eq); \
1060 INSTALL_BINOP_TI (ti, op_ge, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _ge); \
1061 INSTALL_BINOP_TI (ti, op_gt, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _gt); \
1062 INSTALL_BINOP_TI (ti, op_ne, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _ne);
1064 #define OCTAVE_INSTALL_MM_INT_BOOL_OPS(PFX, T1, T2) \
1065 INSTALL_BINOP_TI (ti, op_el_and, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _el_and); \
1066 INSTALL_BINOP_TI (ti, op_el_or, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _el_or); \
1067 INSTALL_BINOP_TI (ti, op_el_not_and, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _el_not_and); \
1068 INSTALL_BINOP_TI (ti, op_el_not_or, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _el_not_or); \
1069 INSTALL_BINOP_TI (ti, op_el_and_not, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _el_and_not); \
1070 INSTALL_BINOP_TI (ti, op_el_or_not, octave_ ## T1 ## matrix, octave_ ## T2 ## matrix, PFX ## _el_or_not);
1072 #define OCTAVE_INSTALL_MM_INT_ASSIGN_OPS(PFX, TLHS, TRHS) \
1073 INSTALL_ASSIGNOP_TI (ti, op_asn_eq, octave_ ## TLHS ## matrix, octave_ ## TRHS ## matrix, PFX ## _assign)
1075 #define OCTAVE_INSTALL_MM_INT_ASSIGNEQ_OPS(PFX, TLHS, TRHS) \
1076 INSTALL_ASSIGNOP_TI (ti, op_add_eq, octave_ ## TLHS ## matrix, octave_ ## TRHS ## matrix, PFX ## _assign_add) \
1077 INSTALL_ASSIGNOP_TI (ti, op_sub_eq, octave_ ## TLHS ## matrix, octave_ ## TRHS ## matrix, PFX ## _assign_sub) \
1078 INSTALL_ASSIGNOP_TI (ti, op_el_mul_eq, octave_ ## TLHS ## matrix, octave_ ## TRHS ## matrix, PFX ## _assign_el_mul) \
1079 INSTALL_ASSIGNOP_TI (ti, op_el_div_eq, octave_ ## TLHS ## matrix, octave_ ## TRHS ## matrix, PFX ## _assign_el_div)
1081 #define OCTAVE_INSTALL_MM_INT_OPS(TYPE) \
1082 OCTAVE_INSTALL_M_INT_UNOPS (TYPE) \
1083 OCTAVE_INSTALL_MM_INT_ARITH_OPS (mm, TYPE ##_, TYPE ## _) \
1084 OCTAVE_INSTALL_MM_INT_ARITH_OPS (mmx, TYPE ##_, ) \
1085 OCTAVE_INSTALL_MM_INT_ARITH_OPS (mxm, , TYPE ##_) \
1086 OCTAVE_INSTALL_MM_INT_ARITH_OPS (mmfx, TYPE ##_, float_) \
1087 OCTAVE_INSTALL_MM_INT_ARITH_OPS (mfxm, float_, TYPE ##_) \
1088 OCTAVE_INSTALL_MM_INT_CMP_OPS (mm, TYPE ## _, TYPE ## _) \
1089 OCTAVE_INSTALL_MM_INT_CMP_OPS (mmx, TYPE ## _, ) \
1090 OCTAVE_INSTALL_MM_INT_CMP_OPS (mxm, , TYPE ## _) \
1091 OCTAVE_INSTALL_MM_INT_CMP_OPS (mmfx, TYPE ## _, float_) \
1092 OCTAVE_INSTALL_MM_INT_CMP_OPS (mfxm, float_, TYPE ## _) \
1093 OCTAVE_INSTALL_MM_INT_BOOL_OPS (mm, TYPE ## _, TYPE ## _) \
1094 OCTAVE_INSTALL_MM_INT_BOOL_OPS (mmx, TYPE ## _, ) \
1095 OCTAVE_INSTALL_MM_INT_BOOL_OPS (mxm, , TYPE ## _) \
1096 OCTAVE_INSTALL_MM_INT_BOOL_OPS (mmfx, TYPE ## _, float_) \
1097 OCTAVE_INSTALL_MM_INT_BOOL_OPS (mfxm, float_, TYPE ## _) \
1098 OCTAVE_INSTALL_MM_INT_ASSIGN_OPS (mm, TYPE ## _, TYPE ## _) \
1099 OCTAVE_INSTALL_MM_INT_ASSIGNEQ_OPS (mme, TYPE ## _, TYPE ## _) \
1100 OCTAVE_INSTALL_MM_INT_ASSIGN_OPS (mmx, TYPE ## _, ) \
1101 OCTAVE_INSTALL_MM_INT_ASSIGN_OPS (mmfx, TYPE ## _, float_) \
1102 INSTALL_WIDENOP_TI (ti, octave_ ## TYPE ## _matrix, octave_complex_matrix, TYPE ## _m_complex_m_conv) \
1103 INSTALL_WIDENOP_TI (ti, octave_ ## TYPE ## _matrix, octave_float_complex_matrix, TYPE ## _m_float_complex_m_conv) \
1104 INSTALL_ASSIGNCONV_TI (ti, octave_ ## TYPE ## _matrix, octave_complex_matrix, octave_complex_matrix) \
1105 INSTALL_ASSIGNCONV_TI (ti, octave_ ## TYPE ## _matrix, octave_float_complex_matrix, octave_float_complex_matrix)
1107 #define OCTAVE_INSTALL_RE_INT_ASSIGN_OPS(TYPE) \
1108 INSTALL_ASSIGNOP_TI (ti, op_asn_eq, octave_matrix, octave_ ## TYPE ## _scalar, TYPE ## ms_assign) \
1109 INSTALL_ASSIGNOP_TI (ti, op_asn_eq, octave_matrix, octave_ ## TYPE ## _matrix, TYPE ## mm_assign) \
1110 INSTALL_ASSIGNCONV_TI (ti, octave_scalar, octave_ ## TYPE ## _scalar, octave_matrix) \
1111 INSTALL_ASSIGNCONV_TI (ti, octave_matrix, octave_ ## TYPE ## _matrix, octave_matrix)
1113 #define OCTAVE_INSTALL_FLT_RE_INT_ASSIGN_OPS(TYPE) \
1114 INSTALL_ASSIGNOP_TI (ti, op_asn_eq, octave_float_matrix, octave_ ## TYPE ## _scalar, TYPE ## fms_assign) \
1115 INSTALL_ASSIGNOP_TI (ti, op_asn_eq, octave_float_matrix, octave_ ## TYPE ## _matrix, TYPE ## fmm_assign) \
1116 INSTALL_ASSIGNCONV_TI (ti, octave_float_scalar, octave_ ## TYPE ## _scalar, octave_float_matrix) \
1117 INSTALL_ASSIGNCONV_TI (ti, octave_float_matrix, octave_ ## TYPE ## _matrix, octave_float_matrix)
1119 #define OCTAVE_INSTALL_CX_INT_ASSIGN_OPS(TYPE) \
1120 INSTALL_ASSIGNOP_TI (ti, op_asn_eq, octave_complex_matrix, octave_ ## TYPE ## _scalar, TYPE ## cms_assign) \
1121 INSTALL_ASSIGNOP_TI (ti, op_asn_eq, octave_complex_matrix, octave_ ## TYPE ## _matrix, TYPE ## cmm_assign) \
1122 INSTALL_ASSIGNCONV_TI (ti, octave_complex_scalar, octave_ ## TYPE ## _scalar, octave_complex_matrix) \
1123 INSTALL_ASSIGNCONV_TI (ti, octave_complex_matrix, octave_ ## TYPE ## _matrix, octave_complex_matrix)
1125 #define OCTAVE_INSTALL_FLT_CX_INT_ASSIGN_OPS(TYPE) \
1126 INSTALL_ASSIGNOP_TI (ti, op_asn_eq, octave_float_complex_matrix, octave_ ## TYPE ## _scalar, TYPE ## fcms_assign) \
1127 INSTALL_ASSIGNOP_TI (ti, op_asn_eq, octave_float_complex_matrix, octave_ ## TYPE ## _matrix, TYPE ## fcmm_assign) \
1128 INSTALL_ASSIGNCONV_TI (ti, octave_float_complex_scalar, octave_ ## TYPE ## _scalar, octave_complex_matrix) \
1129 INSTALL_ASSIGNCONV_TI (ti, octave_float_complex_matrix, octave_ ## TYPE ## _matrix, octave_complex_matrix)
1131 #define OCTAVE_INSTALL_INT_NULL_ASSIGN_OPS(TYPE) \
1132 INSTALL_ASSIGNOP_TI (ti, op_asn_eq, octave_ ## TYPE ## _matrix, octave_null_matrix, TYPE ## null_assign) \
1133 INSTALL_ASSIGNOP_TI (ti, op_asn_eq, octave_ ## TYPE ## _matrix, octave_null_str, TYPE ## null_assign) \
1134 INSTALL_ASSIGNOP_TI (ti, op_asn_eq, octave_ ## TYPE ## _matrix, octave_null_sq_str, TYPE ## null_assign) \
1135 INSTALL_ASSIGNCONV_TI (ti, octave_ ## TYPE ## _scalar, octave_null_matrix, octave_ ## TYPE ## _matrix) \
1136 INSTALL_ASSIGNCONV_TI (ti, octave_## TYPE ## _scalar, octave_null_str, octave_ ## TYPE ## _matrix) \
1137 INSTALL_ASSIGNCONV_TI (ti, octave_## TYPE ## _scalar, octave_null_sq_str, octave_ ## TYPE ## _matrix)
1139 #define OCTAVE_INSTALL_INT_OPS(TYPE) \
1140 OCTAVE_INSTALL_SS_INT_OPS (TYPE) \
1141 OCTAVE_INSTALL_SM_INT_OPS (TYPE) \
1142 OCTAVE_INSTALL_MS_INT_OPS (TYPE) \
1143 OCTAVE_INSTALL_MM_INT_OPS (TYPE) \
1144 OCTAVE_INSTALL_CONCAT_FN (TYPE) \
1145 OCTAVE_INSTALL_RE_INT_ASSIGN_OPS (TYPE) \
1146 OCTAVE_INSTALL_FLT_RE_INT_ASSIGN_OPS (TYPE) \
1147 OCTAVE_INSTALL_CX_INT_ASSIGN_OPS (TYPE) \
1148 OCTAVE_INSTALL_FLT_CX_INT_ASSIGN_OPS (TYPE) \
1149 OCTAVE_INSTALL_INT_NULL_ASSIGN_OPS(TYPE)
1151 #define OCTAVE_INSTALL_SM_INT_ASSIGNCONV(TLHS, TRHS) \
1152 INSTALL_ASSIGNCONV_TI (ti, octave_ ## TLHS ## _scalar, octave_ ## TRHS ## _scalar, octave_ ## TLHS ## _matrix) \
1153 INSTALL_ASSIGNCONV_TI (ti, octave_ ## TLHS ## _scalar, octave_ ## TRHS ## _matrix, octave_ ## TLHS ## _matrix)
1155 #define OCTAVE_MIXED_INT_CMP_OPS(T1, T2) \
1156 OCTAVE_SS_INT_CMP_OPS (T1 ## _ ## T2 ## _ss, T1 ## _, T2 ## _) \
1157 OCTAVE_SM_INT_CMP_OPS (T1 ## _ ## T2 ## _sm, T1 ## _, T2 ## _) \
1158 OCTAVE_MS_INT_CMP_OPS (T1 ## _ ## T2 ## _ms, T1 ## _, T2 ## _) \
1159 OCTAVE_MM_INT_CMP_OPS (T1 ## _ ## T2 ## _mm, T1 ## _, T2 ## _)
1161 #define OCTAVE_INSTALL_MIXED_INT_CMP_OPS(T1, T2) \
1162 OCTAVE_INSTALL_SS_INT_CMP_OPS (T1 ## _ ## T2 ## _ss, T1 ## _, T2 ## _) \
1163 OCTAVE_INSTALL_SM_INT_CMP_OPS (T1 ## _ ## T2 ## _sm, T1 ## _, T2 ## _) \
1164 OCTAVE_INSTALL_MS_INT_CMP_OPS (T1 ## _ ## T2 ## _ms, T1 ## _, T2 ## _) \
1165 OCTAVE_INSTALL_MM_INT_CMP_OPS (T1 ## _ ## T2 ## _mm, T1 ## _, T2 ## _)