comparison src/OPERATORS/op-int.h @ 4915:c638c144d4da

[project @ 2004-07-23 19:01:22 by jwe]
author jwe
date Fri, 23 Jul 2004 19:01:23 +0000
parents f7a337f3fd9e
children bfd57b466752
comparison
equal deleted inserted replaced
4914:1c0442da75fd 4915:c638c144d4da
17 You should have received a copy of the GNU General Public License 17 You should have received a copy of the GNU General Public License
18 along with Octave; see the file COPYING. If not, write to the Free 18 along with Octave; see the file COPYING. If not, write to the Free
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 20
21 */ 21 */
22
23 #define OCTAVE_CONCAT_FN(TYPE) \
24 DEFNDCATOP_FN (TYPE ## _s_s, TYPE ## _scalar, TYPE ## _scalar, TYPE ## _array, TYPE ## _array, concat) \
25 DEFNDCATOP_FN (TYPE ## _s_m, TYPE ## _scalar, TYPE ## _matrix, TYPE ## _array, TYPE ## _array, concat) \
26 DEFNDCATOP_FN (TYPE ## _m_s, TYPE ## _matrix, TYPE ## _scalar, TYPE ## _array, TYPE ## _array, concat) \
27 DEFNDCATOP_FN (TYPE ## _m_m, TYPE ## _matrix, TYPE ## _matrix, TYPE ## _array, TYPE ## _array, concat)
28
29 #define OCTAVE_INSTALL_CONCAT_FN(TYPE) \
30 INSTALL_CATOP (octave_ ## TYPE ## _scalar, octave_ ## TYPE ## _scalar, TYPE ## _s_s) \
31 INSTALL_CATOP (octave_ ## TYPE ## _scalar, octave_ ## TYPE ## _matrix, TYPE ## _s_m) \
32 INSTALL_CATOP (octave_ ## TYPE ## _matrix, octave_ ## TYPE ## _scalar, TYPE ## _m_s) \
33 INSTALL_CATOP (octave_ ## TYPE ## _matrix, octave_ ## TYPE ## _matrix, TYPE ## _m_m)
22 34
23 #define OCTAVE_S_INT_UNOPS(TYPE) \ 35 #define OCTAVE_S_INT_UNOPS(TYPE) \
24 /* scalar unary ops. */ \ 36 /* scalar unary ops. */ \
25 \ 37 \
26 DEFUNOP_OP (s_not, TYPE ## _scalar, !) \ 38 DEFUNOP_OP (s_not, TYPE ## _scalar, !) \
146 /* return octave_value (v2.TS ## _scalar_value () / d); */ \ 158 /* return octave_value (v2.TS ## _scalar_value () / d); */ \
147 /* } */ \ 159 /* } */ \
148 \ 160 \
149 DEFNDBINOP_OP (sm_el_mul, TS ## _scalar, TM ## _matrix, TS ## _scalar, TM ## _array, *) \ 161 DEFNDBINOP_OP (sm_el_mul, TS ## _scalar, TM ## _matrix, TS ## _scalar, TM ## _array, *) \
150 /* DEFNDBINOP_FN (sm_el_div, TS ## _scalar, TM ## _matrix, TS ## _scalar, TM ## _array, x_el_div) */ \ 162 /* DEFNDBINOP_FN (sm_el_div, TS ## _scalar, TM ## _matrix, TS ## _scalar, TM ## _array, x_el_div) */ \
151 /* DEFNDBINOP_FN (sm_el_pow, TS ## _scalar, TM ## _matrix, TS ## _scalar, TM ## _array, elem_xpow) */ \ 163 DEFBINOP (sm_el_pow, TS ## _scalar, TM ## _matrix) \
164 { \
165 CAST_BINOP_ARGS (const octave_ ## TS ## _scalar&, const octave_ ## TM ## _matrix&); \
166 \
167 double d = v1.TS ## _scalar_value (); \
168 \
169 /* XXX FIXME XXX Return type wrong */ \
170 return octave_value (elem_xpow (d, v2.array_value())); \
171 } \
152 \ 172 \
153 /* DEFBINOP (sm_el_ldiv, TS ## _scalar, TM ## _matrix) */ \ 173 /* DEFBINOP (sm_el_ldiv, TS ## _scalar, TM ## _matrix) */ \
154 /* { */ \ 174 /* { */ \
155 /* CAST_BINOP_ARGS (const octave_ ## TS ## _scalar&, const octave_ ## TM ## _matrix&); */ \ 175 /* CAST_BINOP_ARGS (const octave_ ## TS ## _scalar&, const octave_ ## TM ## _matrix&); */ \
156 /* */ \ 176 /* */ \
348 368
349 #define OCTAVE_INT_OPS(TYPE) \ 369 #define OCTAVE_INT_OPS(TYPE) \
350 OCTAVE_SS_INT_OPS (TYPE) \ 370 OCTAVE_SS_INT_OPS (TYPE) \
351 OCTAVE_SM_INT_OPS (TYPE) \ 371 OCTAVE_SM_INT_OPS (TYPE) \
352 OCTAVE_MS_INT_OPS (TYPE) \ 372 OCTAVE_MS_INT_OPS (TYPE) \
353 OCTAVE_MM_INT_OPS (TYPE) 373 OCTAVE_MM_INT_OPS (TYPE) \
374 OCTAVE_CONCAT_FN (TYPE)
354 375
355 #define OCTAVE_INSTALL_S_INT_UNOPS(TYPE) \ 376 #define OCTAVE_INSTALL_S_INT_UNOPS(TYPE) \
356 INSTALL_UNOP (op_not, octave_ ## TYPE ## _scalar, s_not); \ 377 INSTALL_UNOP (op_not, octave_ ## TYPE ## _scalar, s_not); \
357 INSTALL_UNOP (op_uminus, octave_ ## TYPE ## _scalar, s_uminus); \ 378 INSTALL_UNOP (op_uminus, octave_ ## TYPE ## _scalar, s_uminus); \
358 INSTALL_UNOP (op_transpose, octave_ ## TYPE ## _scalar, s_transpose); \ 379 INSTALL_UNOP (op_transpose, octave_ ## TYPE ## _scalar, s_transpose); \
404 /* INSTALL_BINOP (op_div, octave_ ## T1 ## _scalar, octave_ ## T2 ## _matrix, sm_div); */ \ 425 /* INSTALL_BINOP (op_div, octave_ ## T1 ## _scalar, octave_ ## T2 ## _matrix, sm_div); */ \
405 /* INSTALL_BINOP (op_pow, octave_ ## T1 ## _scalar, octave_ ## T2 ## _matrix, sm_pow); */ \ 426 /* INSTALL_BINOP (op_pow, octave_ ## T1 ## _scalar, octave_ ## T2 ## _matrix, sm_pow); */ \
406 /* INSTALL_BINOP (op_ldiv, octave_ ## T1 ## _scalar, octave_ ## T2 ## _matrix, sm_ldiv); */ \ 427 /* INSTALL_BINOP (op_ldiv, octave_ ## T1 ## _scalar, octave_ ## T2 ## _matrix, sm_ldiv); */ \
407 INSTALL_BINOP (op_el_mul, octave_ ## T1 ## _scalar, octave_ ## T2 ## _matrix, sm_el_mul); \ 428 INSTALL_BINOP (op_el_mul, octave_ ## T1 ## _scalar, octave_ ## T2 ## _matrix, sm_el_mul); \
408 /* INSTALL_BINOP (op_el_div, octave_ ## T1 ## _scalar, octave_ ## T2 ## _matrix, sm_el_div); */ \ 429 /* INSTALL_BINOP (op_el_div, octave_ ## T1 ## _scalar, octave_ ## T2 ## _matrix, sm_el_div); */ \
409 /* INSTALL_BINOP (op_el_pow, octave_ ## T1 ## _scalar, octave_ ## T2 ## _matrix, sm_el_pow); */ \ 430 INSTALL_BINOP (op_el_pow, octave_ ## T1 ## _scalar, octave_ ## T2 ## _matrix, sm_el_pow); \
410 /* INSTALL_BINOP (op_el_ldiv, octave_ ## T1 ## _scalar, octave_ ## T2 ## _matrix, sm_el_ldiv); */ 431 /* INSTALL_BINOP (op_el_ldiv, octave_ ## T1 ## _scalar, octave_ ## T2 ## _matrix, sm_el_ldiv); */
411 432
412 #define OCTAVE_INSTALL_SM_INT_CMP_OPS(T1, T2) \ 433 #define OCTAVE_INSTALL_SM_INT_CMP_OPS(T1, T2) \
413 INSTALL_BINOP (op_lt, octave_ ## T1 ## _scalar, octave_ ## T2 ## _matrix, sm_lt); \ 434 INSTALL_BINOP (op_lt, octave_ ## T1 ## _scalar, octave_ ## T2 ## _matrix, sm_lt); \
414 INSTALL_BINOP (op_le, octave_ ## T1 ## _scalar, octave_ ## T2 ## _matrix, sm_le); \ 435 INSTALL_BINOP (op_le, octave_ ## T1 ## _scalar, octave_ ## T2 ## _matrix, sm_le); \
524 545
525 #define OCTAVE_INSTALL_INT_OPS(TYPE) \ 546 #define OCTAVE_INSTALL_INT_OPS(TYPE) \
526 OCTAVE_INSTALL_SS_INT_OPS (TYPE) \ 547 OCTAVE_INSTALL_SS_INT_OPS (TYPE) \
527 OCTAVE_INSTALL_SM_INT_OPS (TYPE) \ 548 OCTAVE_INSTALL_SM_INT_OPS (TYPE) \
528 OCTAVE_INSTALL_MS_INT_OPS (TYPE) \ 549 OCTAVE_INSTALL_MS_INT_OPS (TYPE) \
529 OCTAVE_INSTALL_MM_INT_OPS (TYPE) 550 OCTAVE_INSTALL_MM_INT_OPS (TYPE) \
551 OCTAVE_INSTALL_CONCAT_FN (TYPE)
530 552
531 /* 553 /*
532 ;;; Local Variables: *** 554 ;;; Local Variables: ***
533 ;;; mode: C++ *** 555 ;;; mode: C++ ***
534 ;;; End: *** 556 ;;; End: ***