Mercurial > hg > octave-lojdl
changeset 9588:319e2ab9b8ae
warn about the complex comparison ops
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Sun, 30 Aug 2009 21:48:19 +0200 |
parents | 5ab448e3febe |
children | 8e42bb4ad34d |
files | src/ChangeLog src/OPERATORS/op-cm-cm.cc src/OPERATORS/op-cm-cs.cc src/OPERATORS/op-cm-m.cc src/OPERATORS/op-cm-s.cc src/OPERATORS/op-cs-cm.cc src/OPERATORS/op-cs-cs.cc src/OPERATORS/op-cs-m.cc src/OPERATORS/op-fcm-fcm.cc src/OPERATORS/op-fcm-fcs.cc src/OPERATORS/op-fcm-fm.cc src/OPERATORS/op-fcm-fs.cc src/OPERATORS/op-fcs-fcm.cc src/OPERATORS/op-fcs-fcs.cc src/OPERATORS/op-fcs-fm.cc src/OPERATORS/op-fm-fcm.cc src/OPERATORS/op-fm-fcs.cc src/OPERATORS/op-fs-fcm.cc src/OPERATORS/op-m-cm.cc src/OPERATORS/op-m-cs.cc src/OPERATORS/op-s-cm.cc src/error.cc src/gripes.cc src/gripes.h src/ops.h |
diffstat | 25 files changed, 175 insertions(+), 120 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,31 @@ +2009-08-30 Jaroslav Hajek <highegg@gmail.com> + + * ops.h (DEFCMPLXCMPOP_OP, DEFNDCMPLXCMPOP_FN): New macros. + * gripes.cc (gripe_warn_complex_cmp): New function. + * gripes.h: declare it. + + * OPERATORS/op-cm-cm.cc: Call the new macros. + * OPERATORS/op-cm-cs.cc: Ditto. + * OPERATORS/op-cm-m.cc: Ditto. + * OPERATORS/op-cm-s.cc: Ditto. + * OPERATORS/op-cs-cm.cc: Ditto. + * OPERATORS/op-cs-cs.cc: Ditto. + * OPERATORS/op-cs-m.cc: Ditto. + * OPERATORS/op-fcm-fcm.cc: Ditto. + * OPERATORS/op-fcm-fcs.cc: Ditto. + * OPERATORS/op-fcm-fm.cc: Ditto. + * OPERATORS/op-fcm-fs.cc: Ditto. + * OPERATORS/op-fcs-fcm.cc: Ditto. + * OPERATORS/op-fcs-fcs.cc: Ditto. + * OPERATORS/op-fcs-fm.cc: Ditto. + * OPERATORS/op-fm-fcm.cc: Ditto. + * OPERATORS/op-fm-fcs.cc: Ditto. + * OPERATORS/op-fs-fcm.cc: Ditto. + * OPERATORS/op-m-cm.cc: Ditto. + * OPERATORS/op-m-cs.cc: Ditto. + * OPERATORS/op-s-cm.cc: Ditto. + + 2009-08-30 Jaroslav Hajek <highegg@gmail.com> * ops.h (BOOL_OP1, BOOL_OP2, BOOL_OP3, SC_MX_BOOL_OP, MX_SC_BOOL_OP,
--- a/src/OPERATORS/op-cm-cm.cc +++ b/src/OPERATORS/op-cm-cm.cc @@ -136,12 +136,12 @@ true, true, v2.complex_matrix_value ())); } -DEFNDBINOP_FN (lt, complex_matrix, complex_matrix, complex_array, complex_array, mx_el_lt) -DEFNDBINOP_FN (le, complex_matrix, complex_matrix, complex_array, complex_array, mx_el_le) -DEFNDBINOP_FN (eq, complex_matrix, complex_matrix, complex_array, complex_array, mx_el_eq) -DEFNDBINOP_FN (ge, complex_matrix, complex_matrix, complex_array, complex_array, mx_el_ge) -DEFNDBINOP_FN (gt, complex_matrix, complex_matrix, complex_array, complex_array, mx_el_gt) -DEFNDBINOP_FN (ne, complex_matrix, complex_matrix, complex_array, complex_array, mx_el_ne) +DEFNDCMPLXCMPOP_FN (lt, complex_matrix, complex_matrix, complex_array, complex_array, mx_el_lt) +DEFNDCMPLXCMPOP_FN (le, complex_matrix, complex_matrix, complex_array, complex_array, mx_el_le) +DEFNDCMPLXCMPOP_FN (eq, complex_matrix, complex_matrix, complex_array, complex_array, mx_el_eq) +DEFNDCMPLXCMPOP_FN (ge, complex_matrix, complex_matrix, complex_array, complex_array, mx_el_ge) +DEFNDCMPLXCMPOP_FN (gt, complex_matrix, complex_matrix, complex_array, complex_array, mx_el_gt) +DEFNDCMPLXCMPOP_FN (ne, complex_matrix, complex_matrix, complex_array, complex_array, mx_el_ne) DEFNDBINOP_FN (el_mul, complex_matrix, complex_matrix, complex_array, complex_array, product) DEFNDBINOP_FN (el_div, complex_matrix, complex_matrix, complex_array, complex_array, quotient)
--- a/src/OPERATORS/op-cm-cs.cc +++ b/src/OPERATORS/op-cm-cs.cc @@ -69,12 +69,12 @@ return ret; } -DEFNDBINOP_FN (lt, complex_matrix, complex, complex_array, complex, mx_el_lt) -DEFNDBINOP_FN (le, complex_matrix, complex, complex_array, complex, mx_el_le) -DEFNDBINOP_FN (eq, complex_matrix, complex, complex_array, complex, mx_el_eq) -DEFNDBINOP_FN (ge, complex_matrix, complex, complex_array, complex, mx_el_ge) -DEFNDBINOP_FN (gt, complex_matrix, complex, complex_array, complex, mx_el_gt) -DEFNDBINOP_FN (ne, complex_matrix, complex, complex_array, complex, mx_el_ne) +DEFNDCMPLXCMPOP_FN (lt, complex_matrix, complex, complex_array, complex, mx_el_lt) +DEFNDCMPLXCMPOP_FN (le, complex_matrix, complex, complex_array, complex, mx_el_le) +DEFNDCMPLXCMPOP_FN (eq, complex_matrix, complex, complex_array, complex, mx_el_eq) +DEFNDCMPLXCMPOP_FN (ge, complex_matrix, complex, complex_array, complex, mx_el_ge) +DEFNDCMPLXCMPOP_FN (gt, complex_matrix, complex, complex_array, complex, mx_el_gt) +DEFNDCMPLXCMPOP_FN (ne, complex_matrix, complex, complex_array, complex, mx_el_ne) DEFNDBINOP_OP (el_mul, complex_matrix, complex, complex_array, complex, *)
--- a/src/OPERATORS/op-cm-m.cc +++ b/src/OPERATORS/op-cm-m.cc @@ -78,12 +78,12 @@ return ret; } -DEFNDBINOP_FN (lt, complex_matrix, matrix, complex_array, array, mx_el_lt) -DEFNDBINOP_FN (le, complex_matrix, matrix, complex_array, array, mx_el_le) -DEFNDBINOP_FN (eq, complex_matrix, matrix, complex_array, array, mx_el_eq) -DEFNDBINOP_FN (ge, complex_matrix, matrix, complex_array, array, mx_el_ge) -DEFNDBINOP_FN (gt, complex_matrix, matrix, complex_array, array, mx_el_gt) -DEFNDBINOP_FN (ne, complex_matrix, matrix, complex_array, array, mx_el_ne) +DEFNDCMPLXCMPOP_FN (lt, complex_matrix, matrix, complex_array, array, mx_el_lt) +DEFNDCMPLXCMPOP_FN (le, complex_matrix, matrix, complex_array, array, mx_el_le) +DEFNDCMPLXCMPOP_FN (eq, complex_matrix, matrix, complex_array, array, mx_el_eq) +DEFNDCMPLXCMPOP_FN (ge, complex_matrix, matrix, complex_array, array, mx_el_ge) +DEFNDCMPLXCMPOP_FN (gt, complex_matrix, matrix, complex_array, array, mx_el_gt) +DEFNDCMPLXCMPOP_FN (ne, complex_matrix, matrix, complex_array, array, mx_el_ne) DEFNDBINOP_FN (el_mul, complex_matrix, matrix, complex_array, array, product) DEFNDBINOP_FN (el_div, complex_matrix, matrix, complex_array, array, quotient)
--- a/src/OPERATORS/op-cm-s.cc +++ b/src/OPERATORS/op-cm-s.cc @@ -73,12 +73,12 @@ return ret; } -DEFNDBINOP_FN (lt, complex_matrix, scalar, complex_array, scalar, mx_el_lt) -DEFNDBINOP_FN (le, complex_matrix, scalar, complex_array, scalar, mx_el_le) -DEFNDBINOP_FN (eq, complex_matrix, scalar, complex_array, scalar, mx_el_eq) -DEFNDBINOP_FN (ge, complex_matrix, scalar, complex_array, scalar, mx_el_ge) -DEFNDBINOP_FN (gt, complex_matrix, scalar, complex_array, scalar, mx_el_gt) -DEFNDBINOP_FN (ne, complex_matrix, scalar, complex_array, scalar, mx_el_ne) +DEFNDCMPLXCMPOP_FN (lt, complex_matrix, scalar, complex_array, scalar, mx_el_lt) +DEFNDCMPLXCMPOP_FN (le, complex_matrix, scalar, complex_array, scalar, mx_el_le) +DEFNDCMPLXCMPOP_FN (eq, complex_matrix, scalar, complex_array, scalar, mx_el_eq) +DEFNDCMPLXCMPOP_FN (ge, complex_matrix, scalar, complex_array, scalar, mx_el_ge) +DEFNDCMPLXCMPOP_FN (gt, complex_matrix, scalar, complex_array, scalar, mx_el_gt) +DEFNDCMPLXCMPOP_FN (ne, complex_matrix, scalar, complex_array, scalar, mx_el_ne) DEFNDBINOP_OP (el_mul, complex_matrix, scalar, complex_array, scalar, *)
--- a/src/OPERATORS/op-cs-cm.cc +++ b/src/OPERATORS/op-cs-cm.cc @@ -69,12 +69,12 @@ return octave_value (v2.complex_array_value () / d); } -DEFNDBINOP_FN (lt, complex, complex_matrix, complex, complex_array, mx_el_lt) -DEFNDBINOP_FN (le, complex, complex_matrix, complex, complex_array, mx_el_le) -DEFNDBINOP_FN (eq, complex, complex_matrix, complex, complex_array, mx_el_eq) -DEFNDBINOP_FN (ge, complex, complex_matrix, complex, complex_array, mx_el_ge) -DEFNDBINOP_FN (gt, complex, complex_matrix, complex, complex_array, mx_el_gt) -DEFNDBINOP_FN (ne, complex, complex_matrix, complex, complex_array, mx_el_ne) +DEFNDCMPLXCMPOP_FN (lt, complex, complex_matrix, complex, complex_array, mx_el_lt) +DEFNDCMPLXCMPOP_FN (le, complex, complex_matrix, complex, complex_array, mx_el_le) +DEFNDCMPLXCMPOP_FN (eq, complex, complex_matrix, complex, complex_array, mx_el_eq) +DEFNDCMPLXCMPOP_FN (ge, complex, complex_matrix, complex, complex_array, mx_el_ge) +DEFNDCMPLXCMPOP_FN (gt, complex, complex_matrix, complex, complex_array, mx_el_gt) +DEFNDCMPLXCMPOP_FN (ne, complex, complex_matrix, complex, complex_array, mx_el_ne) DEFNDBINOP_OP (el_mul, complex, complex_matrix, complex, complex_array, *) DEFNDBINOP_FN (el_div, complex, complex_matrix, complex, complex_array, x_el_div)
--- a/src/OPERATORS/op-cs-cs.cc +++ b/src/OPERATORS/op-cs-cs.cc @@ -96,12 +96,12 @@ return octave_value (v2.complex_value () / d); } -DEFBINOP_OP (lt, complex, complex, <) -DEFBINOP_OP (le, complex, complex, <=) -DEFBINOP_OP (eq, complex, complex, ==) -DEFBINOP_OP (ge, complex, complex, >=) -DEFBINOP_OP (gt, complex, complex, >) -DEFBINOP_OP (ne, complex, complex, !=) +DEFCMPLXCMPOP_OP (lt, complex, complex, <) +DEFCMPLXCMPOP_OP (le, complex, complex, <=) +DEFCMPLXCMPOP_OP (eq, complex, complex, ==) +DEFCMPLXCMPOP_OP (ge, complex, complex, >=) +DEFCMPLXCMPOP_OP (gt, complex, complex, >) +DEFCMPLXCMPOP_OP (ne, complex, complex, !=) DEFBINOP_OP (el_mul, complex, complex, *)
--- a/src/OPERATORS/op-cs-m.cc +++ b/src/OPERATORS/op-cs-m.cc @@ -75,12 +75,12 @@ return octave_value (v2.array_value () / d); } -DEFNDBINOP_FN (lt, complex, matrix, complex, array, mx_el_lt) -DEFNDBINOP_FN (le, complex, matrix, complex, array, mx_el_le) -DEFNDBINOP_FN (eq, complex, matrix, complex, array, mx_el_eq) -DEFNDBINOP_FN (ge, complex, matrix, complex, array, mx_el_ge) -DEFNDBINOP_FN (gt, complex, matrix, complex, array, mx_el_gt) -DEFNDBINOP_FN (ne, complex, matrix, complex, array, mx_el_ne) +DEFNDCMPLXCMPOP_FN (lt, complex, matrix, complex, array, mx_el_lt) +DEFNDCMPLXCMPOP_FN (le, complex, matrix, complex, array, mx_el_le) +DEFNDCMPLXCMPOP_FN (eq, complex, matrix, complex, array, mx_el_eq) +DEFNDCMPLXCMPOP_FN (ge, complex, matrix, complex, array, mx_el_ge) +DEFNDCMPLXCMPOP_FN (gt, complex, matrix, complex, array, mx_el_gt) +DEFNDCMPLXCMPOP_FN (ne, complex, matrix, complex, array, mx_el_ne) DEFNDBINOP_OP (el_mul, complex, matrix, complex, array, *) DEFNDBINOP_FN (el_div, complex, matrix, complex, array, x_el_div)
--- a/src/OPERATORS/op-fcm-fcm.cc +++ b/src/OPERATORS/op-fcm-fcm.cc @@ -140,17 +140,17 @@ true, true, v2.float_complex_matrix_value ())); } -DEFNDBINOP_FN (lt, float_complex_matrix, float_complex_matrix, +DEFNDCMPLXCMPOP_FN (lt, float_complex_matrix, float_complex_matrix, float_complex_array, float_complex_array, mx_el_lt) -DEFNDBINOP_FN (le, float_complex_matrix, float_complex_matrix, +DEFNDCMPLXCMPOP_FN (le, float_complex_matrix, float_complex_matrix, float_complex_array, float_complex_array, mx_el_le) -DEFNDBINOP_FN (eq, float_complex_matrix, float_complex_matrix, +DEFNDCMPLXCMPOP_FN (eq, float_complex_matrix, float_complex_matrix, float_complex_array, float_complex_array, mx_el_eq) -DEFNDBINOP_FN (ge, float_complex_matrix, float_complex_matrix, +DEFNDCMPLXCMPOP_FN (ge, float_complex_matrix, float_complex_matrix, float_complex_array, float_complex_array, mx_el_ge) -DEFNDBINOP_FN (gt, float_complex_matrix, float_complex_matrix, +DEFNDCMPLXCMPOP_FN (gt, float_complex_matrix, float_complex_matrix, float_complex_array, float_complex_array, mx_el_gt) -DEFNDBINOP_FN (ne, float_complex_matrix, float_complex_matrix, +DEFNDCMPLXCMPOP_FN (ne, float_complex_matrix, float_complex_matrix, float_complex_array, float_complex_array, mx_el_ne) DEFNDBINOP_FN (el_mul, float_complex_matrix, float_complex_matrix,
--- a/src/OPERATORS/op-fcm-fcs.cc +++ b/src/OPERATORS/op-fcm-fcs.cc @@ -75,17 +75,17 @@ return ret; } -DEFNDBINOP_FN (lt, float_complex_matrix, float_complex, +DEFNDCMPLXCMPOP_FN (lt, float_complex_matrix, float_complex, float_complex_array, float_complex, mx_el_lt) -DEFNDBINOP_FN (le, float_complex_matrix, float_complex, +DEFNDCMPLXCMPOP_FN (le, float_complex_matrix, float_complex, float_complex_array, float_complex, mx_el_le) -DEFNDBINOP_FN (eq, float_complex_matrix, float_complex, +DEFNDCMPLXCMPOP_FN (eq, float_complex_matrix, float_complex, float_complex_array, float_complex, mx_el_eq) -DEFNDBINOP_FN (ge, float_complex_matrix, float_complex, +DEFNDCMPLXCMPOP_FN (ge, float_complex_matrix, float_complex, float_complex_array, float_complex, mx_el_ge) -DEFNDBINOP_FN (gt, float_complex_matrix, float_complex, +DEFNDCMPLXCMPOP_FN (gt, float_complex_matrix, float_complex, float_complex_array, float_complex, mx_el_gt) -DEFNDBINOP_FN (ne, float_complex_matrix, float_complex, +DEFNDCMPLXCMPOP_FN (ne, float_complex_matrix, float_complex, float_complex_array, float_complex, mx_el_ne) DEFNDBINOP_OP (el_mul, float_complex_matrix, float_complex,
--- a/src/OPERATORS/op-fcm-fm.cc +++ b/src/OPERATORS/op-fcm-fm.cc @@ -82,17 +82,17 @@ return ret; } -DEFNDBINOP_FN (lt, float_complex_matrix, float_matrix, +DEFNDCMPLXCMPOP_FN (lt, float_complex_matrix, float_matrix, float_complex_array, float_array, mx_el_lt) -DEFNDBINOP_FN (le, float_complex_matrix, float_matrix, +DEFNDCMPLXCMPOP_FN (le, float_complex_matrix, float_matrix, float_complex_array, float_array, mx_el_le) -DEFNDBINOP_FN (eq, float_complex_matrix, float_matrix, +DEFNDCMPLXCMPOP_FN (eq, float_complex_matrix, float_matrix, float_complex_array, float_array, mx_el_eq) -DEFNDBINOP_FN (ge, float_complex_matrix, float_matrix, +DEFNDCMPLXCMPOP_FN (ge, float_complex_matrix, float_matrix, float_complex_array, float_array, mx_el_ge) -DEFNDBINOP_FN (gt, float_complex_matrix, float_matrix, +DEFNDCMPLXCMPOP_FN (gt, float_complex_matrix, float_matrix, float_complex_array, float_array, mx_el_gt) -DEFNDBINOP_FN (ne, float_complex_matrix, float_matrix, +DEFNDCMPLXCMPOP_FN (ne, float_complex_matrix, float_matrix, float_complex_array, float_array, mx_el_ne) DEFNDBINOP_FN (el_mul, float_complex_matrix, float_matrix,
--- a/src/OPERATORS/op-fcm-fs.cc +++ b/src/OPERATORS/op-fcm-fs.cc @@ -75,17 +75,17 @@ return ret; } -DEFNDBINOP_FN (lt, float_complex_matrix, float_scalar, float_complex_array, +DEFNDCMPLXCMPOP_FN (lt, float_complex_matrix, float_scalar, float_complex_array, float_scalar, mx_el_lt) -DEFNDBINOP_FN (le, float_complex_matrix, float_scalar, float_complex_array, +DEFNDCMPLXCMPOP_FN (le, float_complex_matrix, float_scalar, float_complex_array, float_scalar, mx_el_le) -DEFNDBINOP_FN (eq, float_complex_matrix, float_scalar, float_complex_array, +DEFNDCMPLXCMPOP_FN (eq, float_complex_matrix, float_scalar, float_complex_array, float_scalar, mx_el_eq) -DEFNDBINOP_FN (ge, float_complex_matrix, float_scalar, float_complex_array, +DEFNDCMPLXCMPOP_FN (ge, float_complex_matrix, float_scalar, float_complex_array, float_scalar, mx_el_ge) -DEFNDBINOP_FN (gt, float_complex_matrix, float_scalar, float_complex_array, +DEFNDCMPLXCMPOP_FN (gt, float_complex_matrix, float_scalar, float_complex_array, float_scalar, mx_el_gt) -DEFNDBINOP_FN (ne, float_complex_matrix, float_scalar, float_complex_array, +DEFNDCMPLXCMPOP_FN (ne, float_complex_matrix, float_scalar, float_complex_array, float_scalar, mx_el_ne) DEFNDBINOP_OP (el_mul, float_complex_matrix, float_scalar, float_complex_array,
--- a/src/OPERATORS/op-fcs-fcm.cc +++ b/src/OPERATORS/op-fcs-fcm.cc @@ -71,17 +71,17 @@ return octave_value (v2.float_complex_array_value () / d); } -DEFNDBINOP_FN (lt, float_complex, float_complex_matrix, float_complex, +DEFNDCMPLXCMPOP_FN (lt, float_complex, float_complex_matrix, float_complex, float_complex_array, mx_el_lt) -DEFNDBINOP_FN (le, float_complex, float_complex_matrix, float_complex, +DEFNDCMPLXCMPOP_FN (le, float_complex, float_complex_matrix, float_complex, float_complex_array, mx_el_le) -DEFNDBINOP_FN (eq, float_complex, float_complex_matrix, float_complex, +DEFNDCMPLXCMPOP_FN (eq, float_complex, float_complex_matrix, float_complex, float_complex_array, mx_el_eq) -DEFNDBINOP_FN (ge, float_complex, float_complex_matrix, float_complex, +DEFNDCMPLXCMPOP_FN (ge, float_complex, float_complex_matrix, float_complex, float_complex_array, mx_el_ge) -DEFNDBINOP_FN (gt, float_complex, float_complex_matrix, float_complex, +DEFNDCMPLXCMPOP_FN (gt, float_complex, float_complex_matrix, float_complex, float_complex_array, mx_el_gt) -DEFNDBINOP_FN (ne, float_complex, float_complex_matrix, float_complex, +DEFNDCMPLXCMPOP_FN (ne, float_complex, float_complex_matrix, float_complex, float_complex_array, mx_el_ne) DEFNDBINOP_OP (el_mul, float_complex, float_complex_matrix, float_complex,
--- a/src/OPERATORS/op-fcs-fcs.cc +++ b/src/OPERATORS/op-fcs-fcs.cc @@ -94,12 +94,12 @@ return octave_value (v2.float_complex_value () / d); } -DEFBINOP_OP (lt, float_complex, float_complex, <) -DEFBINOP_OP (le, float_complex, float_complex, <=) -DEFBINOP_OP (eq, float_complex, float_complex, ==) -DEFBINOP_OP (ge, float_complex, float_complex, >=) -DEFBINOP_OP (gt, float_complex, float_complex, >) -DEFBINOP_OP (ne, float_complex, float_complex, !=) +DEFCMPLXCMPOP_OP (lt, float_complex, float_complex, <) +DEFCMPLXCMPOP_OP (le, float_complex, float_complex, <=) +DEFCMPLXCMPOP_OP (eq, float_complex, float_complex, ==) +DEFCMPLXCMPOP_OP (ge, float_complex, float_complex, >=) +DEFCMPLXCMPOP_OP (gt, float_complex, float_complex, >) +DEFCMPLXCMPOP_OP (ne, float_complex, float_complex, !=) DEFBINOP_OP (el_mul, float_complex, float_complex, *)
--- a/src/OPERATORS/op-fcs-fm.cc +++ b/src/OPERATORS/op-fcs-fm.cc @@ -78,17 +78,17 @@ return octave_value (v2.float_array_value () / d); } -DEFNDBINOP_FN (lt, float_complex, float_matrix, float_complex, +DEFNDCMPLXCMPOP_FN (lt, float_complex, float_matrix, float_complex, float_array, mx_el_lt) -DEFNDBINOP_FN (le, float_complex, float_matrix, float_complex, +DEFNDCMPLXCMPOP_FN (le, float_complex, float_matrix, float_complex, float_array, mx_el_le) -DEFNDBINOP_FN (eq, float_complex, float_matrix, float_complex, +DEFNDCMPLXCMPOP_FN (eq, float_complex, float_matrix, float_complex, float_array, mx_el_eq) -DEFNDBINOP_FN (ge, float_complex, float_matrix, float_complex, +DEFNDCMPLXCMPOP_FN (ge, float_complex, float_matrix, float_complex, float_array, mx_el_ge) -DEFNDBINOP_FN (gt, float_complex, float_matrix, float_complex, +DEFNDCMPLXCMPOP_FN (gt, float_complex, float_matrix, float_complex, float_array, mx_el_gt) -DEFNDBINOP_FN (ne, float_complex, float_matrix, float_complex, +DEFNDCMPLXCMPOP_FN (ne, float_complex, float_matrix, float_complex, float_array, mx_el_ne) DEFNDBINOP_OP (el_mul, float_complex, float_matrix, float_complex,
--- a/src/OPERATORS/op-fm-fcm.cc +++ b/src/OPERATORS/op-fm-fcm.cc @@ -83,17 +83,17 @@ return ret; } -DEFNDBINOP_FN (lt, float_matrix, float_complex_matrix, float_array, +DEFNDCMPLXCMPOP_FN (lt, float_matrix, float_complex_matrix, float_array, float_complex_array, mx_el_lt) -DEFNDBINOP_FN (le, float_matrix, float_complex_matrix, float_array, +DEFNDCMPLXCMPOP_FN (le, float_matrix, float_complex_matrix, float_array, float_complex_array, mx_el_le) -DEFNDBINOP_FN (eq, float_matrix, float_complex_matrix, float_array, +DEFNDCMPLXCMPOP_FN (eq, float_matrix, float_complex_matrix, float_array, float_complex_array, mx_el_eq) -DEFNDBINOP_FN (ge, float_matrix, float_complex_matrix, float_array, +DEFNDCMPLXCMPOP_FN (ge, float_matrix, float_complex_matrix, float_array, float_complex_array, mx_el_ge) -DEFNDBINOP_FN (gt, float_matrix, float_complex_matrix, float_array, +DEFNDCMPLXCMPOP_FN (gt, float_matrix, float_complex_matrix, float_array, float_complex_array, mx_el_gt) -DEFNDBINOP_FN (ne, float_matrix, float_complex_matrix, float_array, +DEFNDCMPLXCMPOP_FN (ne, float_matrix, float_complex_matrix, float_array, float_complex_array, mx_el_ne) DEFNDBINOP_FN (el_mul, float_matrix, float_complex_matrix, float_array,
--- a/src/OPERATORS/op-fm-fcs.cc +++ b/src/OPERATORS/op-fm-fcs.cc @@ -78,17 +78,17 @@ return ret; } -DEFNDBINOP_FN (lt, float_matrix, float_complex, float_array, +DEFNDCMPLXCMPOP_FN (lt, float_matrix, float_complex, float_array, float_complex, mx_el_lt) -DEFNDBINOP_FN (le, float_matrix, float_complex, float_array, +DEFNDCMPLXCMPOP_FN (le, float_matrix, float_complex, float_array, float_complex, mx_el_le) -DEFNDBINOP_FN (eq, float_matrix, float_complex, float_array, +DEFNDCMPLXCMPOP_FN (eq, float_matrix, float_complex, float_array, float_complex, mx_el_eq) -DEFNDBINOP_FN (ge, float_matrix, float_complex, float_array, +DEFNDCMPLXCMPOP_FN (ge, float_matrix, float_complex, float_array, float_complex, mx_el_ge) -DEFNDBINOP_FN (gt, float_matrix, float_complex, float_array, +DEFNDCMPLXCMPOP_FN (gt, float_matrix, float_complex, float_array, float_complex, mx_el_gt) -DEFNDBINOP_FN (ne, float_matrix, float_complex, float_array, +DEFNDCMPLXCMPOP_FN (ne, float_matrix, float_complex, float_array, float_complex, mx_el_ne) DEFNDBINOP_OP (el_mul, float_matrix, float_complex, float_array,
--- a/src/OPERATORS/op-fs-fcm.cc +++ b/src/OPERATORS/op-fs-fcm.cc @@ -82,17 +82,17 @@ return octave_value (v2.float_complex_array_value () / d); } -DEFNDBINOP_FN (lt, float_scalar, float_complex_matrix, float_scalar, +DEFNDCMPLXCMPOP_FN (lt, float_scalar, float_complex_matrix, float_scalar, float_complex_array, mx_el_lt) -DEFNDBINOP_FN (le, float_scalar, float_complex_matrix, float_scalar, +DEFNDCMPLXCMPOP_FN (le, float_scalar, float_complex_matrix, float_scalar, float_complex_array, mx_el_le) -DEFNDBINOP_FN (eq, float_scalar, float_complex_matrix, float_scalar, +DEFNDCMPLXCMPOP_FN (eq, float_scalar, float_complex_matrix, float_scalar, float_complex_array, mx_el_eq) -DEFNDBINOP_FN (ge, float_scalar, float_complex_matrix, float_scalar, +DEFNDCMPLXCMPOP_FN (ge, float_scalar, float_complex_matrix, float_scalar, float_complex_array, mx_el_ge) -DEFNDBINOP_FN (gt, float_scalar, float_complex_matrix, float_scalar, +DEFNDCMPLXCMPOP_FN (gt, float_scalar, float_complex_matrix, float_scalar, float_complex_array, mx_el_gt) -DEFNDBINOP_FN (ne, float_scalar, float_complex_matrix, float_scalar, +DEFNDCMPLXCMPOP_FN (ne, float_scalar, float_complex_matrix, float_scalar, float_complex_array, mx_el_ne) DEFNDBINOP_OP (el_mul, float_scalar, float_complex_matrix, float_scalar,
--- a/src/OPERATORS/op-m-cm.cc +++ b/src/OPERATORS/op-m-cm.cc @@ -79,12 +79,12 @@ return ret; } -DEFNDBINOP_FN (lt, matrix, complex_matrix, array, complex_array, mx_el_lt) -DEFNDBINOP_FN (le, matrix, complex_matrix, array, complex_array, mx_el_le) -DEFNDBINOP_FN (eq, matrix, complex_matrix, array, complex_array, mx_el_eq) -DEFNDBINOP_FN (ge, matrix, complex_matrix, array, complex_array, mx_el_ge) -DEFNDBINOP_FN (gt, matrix, complex_matrix, array, complex_array, mx_el_gt) -DEFNDBINOP_FN (ne, matrix, complex_matrix, array, complex_array, mx_el_ne) +DEFNDCMPLXCMPOP_FN (lt, matrix, complex_matrix, array, complex_array, mx_el_lt) +DEFNDCMPLXCMPOP_FN (le, matrix, complex_matrix, array, complex_array, mx_el_le) +DEFNDCMPLXCMPOP_FN (eq, matrix, complex_matrix, array, complex_array, mx_el_eq) +DEFNDCMPLXCMPOP_FN (ge, matrix, complex_matrix, array, complex_array, mx_el_ge) +DEFNDCMPLXCMPOP_FN (gt, matrix, complex_matrix, array, complex_array, mx_el_gt) +DEFNDCMPLXCMPOP_FN (ne, matrix, complex_matrix, array, complex_array, mx_el_ne) DEFNDBINOP_FN (el_mul, matrix, complex_matrix, array, complex_array, product) DEFNDBINOP_FN (el_div, matrix, complex_matrix, array, complex_array, quotient)
--- a/src/OPERATORS/op-m-cs.cc +++ b/src/OPERATORS/op-m-cs.cc @@ -77,12 +77,12 @@ return ret; } -DEFNDBINOP_FN (lt, matrix, complex, array, complex, mx_el_lt) -DEFNDBINOP_FN (le, matrix, complex, array, complex, mx_el_le) -DEFNDBINOP_FN (eq, matrix, complex, array, complex, mx_el_eq) -DEFNDBINOP_FN (ge, matrix, complex, array, complex, mx_el_ge) -DEFNDBINOP_FN (gt, matrix, complex, array, complex, mx_el_gt) -DEFNDBINOP_FN (ne, matrix, complex, array, complex, mx_el_ne) +DEFNDCMPLXCMPOP_FN (lt, matrix, complex, array, complex, mx_el_lt) +DEFNDCMPLXCMPOP_FN (le, matrix, complex, array, complex, mx_el_le) +DEFNDCMPLXCMPOP_FN (eq, matrix, complex, array, complex, mx_el_eq) +DEFNDCMPLXCMPOP_FN (ge, matrix, complex, array, complex, mx_el_ge) +DEFNDCMPLXCMPOP_FN (gt, matrix, complex, array, complex, mx_el_gt) +DEFNDCMPLXCMPOP_FN (ne, matrix, complex, array, complex, mx_el_ne) DEFNDBINOP_OP (el_mul, matrix, complex, array, complex, *)
--- a/src/OPERATORS/op-s-cm.cc +++ b/src/OPERATORS/op-s-cm.cc @@ -77,12 +77,12 @@ return octave_value (v2.complex_array_value () / d); } -DEFNDBINOP_FN (lt, scalar, complex_matrix, scalar, complex_array, mx_el_lt) -DEFNDBINOP_FN (le, scalar, complex_matrix, scalar, complex_array, mx_el_le) -DEFNDBINOP_FN (eq, scalar, complex_matrix, scalar, complex_array, mx_el_eq) -DEFNDBINOP_FN (ge, scalar, complex_matrix, scalar, complex_array, mx_el_ge) -DEFNDBINOP_FN (gt, scalar, complex_matrix, scalar, complex_array, mx_el_gt) -DEFNDBINOP_FN (ne, scalar, complex_matrix, scalar, complex_array, mx_el_ne) +DEFNDCMPLXCMPOP_FN (lt, scalar, complex_matrix, scalar, complex_array, mx_el_lt) +DEFNDCMPLXCMPOP_FN (le, scalar, complex_matrix, scalar, complex_array, mx_el_le) +DEFNDCMPLXCMPOP_FN (eq, scalar, complex_matrix, scalar, complex_array, mx_el_eq) +DEFNDCMPLXCMPOP_FN (ge, scalar, complex_matrix, scalar, complex_array, mx_el_ge) +DEFNDCMPLXCMPOP_FN (gt, scalar, complex_matrix, scalar, complex_array, mx_el_gt) +DEFNDCMPLXCMPOP_FN (ne, scalar, complex_matrix, scalar, complex_array, mx_el_ne) DEFNDBINOP_OP (el_mul, scalar, complex_matrix, scalar, complex_array, *) DEFNDBINOP_FN (el_div, scalar, complex_matrix, scalar, complex_array, x_el_div)
--- a/src/error.cc +++ b/src/error.cc @@ -1406,6 +1406,7 @@ disable_warning ("Octave:int-convert-non-int-val"); disable_warning ("Octave:int-convert-overflow"); disable_warning ("Octave:int-math-overflow"); + disable_warning ("Octave:complex-cmp-ops"); } DEFUN (lasterror, args, ,
--- a/src/gripes.cc +++ b/src/gripes.cc @@ -271,6 +271,13 @@ error ("a cs-list cannot be further indexed"); } +void +gripe_warn_complex_cmp (void) +{ + warning_with_id ("Octave:matlab-incompatible", + "potential Matlab compatibility problem: comparing complex numbers"); +} + /* ;;; Local Variables: *** ;;; mode: C++ ***
--- a/src/gripes.h +++ b/src/gripes.h @@ -140,6 +140,9 @@ extern OCTINTERP_API void gripe_indexed_cs_list (void); +extern OCTINTERP_API void +gripe_warn_complex_cmp (void); + #endif /*
--- a/src/ops.h +++ b/src/ops.h @@ -287,6 +287,15 @@ (v1.CONCAT2(t1, _value) () op v2.CONCAT2(t2, _value) ()); \ } +#define DEFCMPLXCMPOP_OP(name, t1, t2, op) \ + BINOPDECL (name, a1, a2) \ + { \ + CAST_BINOP_ARGS (const CONCAT2(octave_, t1)&, const CONCAT2(octave_, t2)&); \ + gripe_warn_complex_cmp (); \ + return octave_value \ + (v1.CONCAT2(t1, _value) () op v2.CONCAT2(t2, _value) ()); \ + } + #define DEFSCALARBOOLOP_OP(name, t1, t2, op) \ BINOPDECL (name, a1, a2) \ { \ @@ -325,6 +334,13 @@ return octave_value (f (v1.CONCAT2(e1, _value) (), v2.CONCAT2(e2, _value) ())); \ } +#define DEFNDCMPLXCMPOP_FN(name, t1, t2, e1, e2, f) \ + BINOPDECL (name, a1, a2) \ + { \ + CAST_BINOP_ARGS (const CONCAT2(octave_, t1)&, const CONCAT2(octave_, t2)&); \ + return octave_value (f (v1.CONCAT2(e1, _value) (), v2.CONCAT2(e2, _value) ())); \ + } + #define BINOP_NONCONFORMANT(msg) \ gripe_nonconformant (msg, \ a1.rows (), a1.columns (), \