# HG changeset patch # User jwe # Date 1067269315 0 # Node ID 69a9b22a72a2c2484701e8210014f0f89731de28 # Parent 2d393bead213ae193407a6ba280f3ef03e26e56e [project @ 2003-10-27 15:41:55 by jwe] diff -r 2d393bead213 -r 69a9b22a72a2 src/ChangeLog --- a/src/ChangeLog Mon Oct 27 03:31:29 2003 +0000 +++ b/src/ChangeLog Mon Oct 27 15:41:55 2003 +0000 @@ -1,3 +1,30 @@ +2003-10-27 John W. Eaton + + * ops.h (DEFNDUNOP_OP, DEFNDUNOP_FN): New arg e, to name value + extractor function prefix. + * OPERATORS/op-bm-bm.cc, OPERATORS/op-cm-cm.cc, OPERATORS/op-m-m.cc: + Change all uses. + + * ov-cx-mat.h (octave_complex_matrix::complex_array_value, + octave_char_matrix::char_array_value, + octave_bool_matrix::bool_array_value): Rename from array_value. + * OPERATORS/op-bm-bm.cc, OPERATORS/op-cm-cm.cc, + OPERATORS/op-cm-cs.cc, OPERATORS/op-cm-m.cc, + OPERATORS/op-cm-s.cc, OPERATORS/op-cs-cm.cc, + OPERATORS/op-m-cm.cc, OPERATORS/op-m-m.cc, + OPERATORS/op-s-cm.cc: Use complex_array, char_array, and + bool_array as appropriate (instead of just array). + + * ov-base.cc (octave_base_value::array_value, + octave_base_value::bool_array_value, + octave_base_value::complex_array_value, + octave_base_value::char_array_value): Provide default implementations. + * ov-base.h: Provide decls. + + * ov.h (octave_value::array_value, octave_value::bool_array_value, + octave_value::complex_array_value, octave_value::char_array_value): + New virtual functions. + 2003-10-25 John W. Eaton * pt-idx.cc (make_subs_cell): Pass dim_vector object to resize. diff -r 2d393bead213 -r 69a9b22a72a2 src/OPERATORS/op-bm-bm.cc --- a/src/OPERATORS/op-bm-bm.cc Mon Oct 27 03:31:29 2003 +0000 +++ b/src/OPERATORS/op-bm-bm.cc Mon Oct 27 15:41:55 2003 +0000 @@ -39,7 +39,7 @@ // unary bool matrix ops. -DEFNDUNOP_OP (not, bool_matrix, !) +DEFNDUNOP_OP (not, bool_matrix, bool_array, !) DEFUNOP (transpose, bool_matrix) { @@ -50,8 +50,8 @@ // bool matrix by bool matrix ops. -DEFNDBINOP_FN (eq, bool_matrix, bool_matrix, array, array, mx_el_eq) -DEFNDBINOP_FN (ne, bool_matrix, bool_matrix, array, array, mx_el_ne) +DEFNDBINOP_FN (eq, bool_matrix, bool_matrix, bool_array, bool_array, mx_el_eq) +DEFNDBINOP_FN (ne, bool_matrix, bool_matrix, bool_array, bool_array, mx_el_ne) void install_bm_bm_ops (void) diff -r 2d393bead213 -r 69a9b22a72a2 src/OPERATORS/op-cm-cm.cc --- a/src/OPERATORS/op-cm-cm.cc Mon Oct 27 03:31:29 2003 +0000 +++ b/src/OPERATORS/op-cm-cm.cc Mon Oct 27 15:41:55 2003 +0000 @@ -39,8 +39,8 @@ // unary complex matrix ops. -DEFNDUNOP_OP (not, complex_matrix, !) -DEFNDUNOP_OP (uminus, complex_matrix, -) +DEFNDUNOP_OP (not, complex_matrix, complex_array, !) +DEFNDUNOP_OP (uminus, complex_matrix, complex_array, -) DEFUNOP (transpose, complex_matrix) { @@ -61,8 +61,8 @@ // complex matrix by complex matrix ops. -DEFNDBINOP_OP (add, complex_matrix, complex_matrix, array, array, +) -DEFNDBINOP_OP (sub, complex_matrix, complex_matrix, array, array, -) +DEFNDBINOP_OP (add, complex_matrix, complex_matrix, complex_array, complex_array, +) +DEFNDBINOP_OP (sub, complex_matrix, complex_matrix, complex_array, complex_array, -) DEFBINOP_OP (mul, complex_matrix, complex_matrix, *) DEFBINOP_FN (div, complex_matrix, complex_matrix, xdiv) @@ -75,26 +75,26 @@ DEFBINOP_FN (ldiv, complex_matrix, complex_matrix, xleftdiv) -DEFNDBINOP_FN (lt, complex_matrix, complex_matrix, array, array, mx_el_lt) -DEFNDBINOP_FN (le, complex_matrix, complex_matrix, array, array, mx_el_le) -DEFNDBINOP_FN (eq, complex_matrix, complex_matrix, array, array, mx_el_eq) -DEFNDBINOP_FN (ge, complex_matrix, complex_matrix, array, array, mx_el_ge) -DEFNDBINOP_FN (gt, complex_matrix, complex_matrix, array, array, mx_el_gt) -DEFNDBINOP_FN (ne, complex_matrix, complex_matrix, array, array, mx_el_ne) +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) -DEFNDBINOP_FN (el_mul, complex_matrix, complex_matrix, array, array, product) -DEFNDBINOP_FN (el_div, complex_matrix, complex_matrix, array, array, quotient) -DEFNDBINOP_FN (el_pow, complex_matrix, complex_matrix, array, array, elem_xpow) +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) +DEFNDBINOP_FN (el_pow, complex_matrix, complex_matrix, complex_array, complex_array, elem_xpow) DEFBINOP (el_ldiv, complex_matrix, complex_matrix) { CAST_BINOP_ARGS (const octave_complex_matrix&, const octave_complex_matrix&); - return octave_value (quotient (v2.array_value (), v1.array_value ())); + return octave_value (quotient (v2.complex_array_value (), v1.complex_array_value ())); } -DEFNDBINOP_FN (el_and, complex_matrix, complex_matrix, array, array, mx_el_and) -DEFNDBINOP_FN (el_or, complex_matrix, complex_matrix, array, array, mx_el_or) +DEFNDBINOP_FN (el_and, complex_matrix, complex_matrix, complex_array, complex_array, mx_el_and) +DEFNDBINOP_FN (el_or, complex_matrix, complex_matrix, complex_array, complex_array, mx_el_or) DEFASSIGNOP_FN (assign, complex_matrix, complex_matrix, assign) diff -r 2d393bead213 -r 69a9b22a72a2 src/OPERATORS/op-cm-cs.cc --- a/src/OPERATORS/op-cm-cs.cc Mon Oct 27 03:31:29 2003 +0000 +++ b/src/OPERATORS/op-cm-cs.cc Mon Oct 27 15:41:55 2003 +0000 @@ -40,9 +40,9 @@ // complex matrix by complex scalar ops. -DEFNDBINOP_OP (add, complex_matrix, complex, array, complex, +) -DEFNDBINOP_OP (sub, complex_matrix, complex, array, complex, -) -DEFNDBINOP_OP (mul, complex_matrix, complex, array, complex, *) +DEFNDBINOP_OP (add, complex_matrix, complex, complex_array, complex, +) +DEFNDBINOP_OP (sub, complex_matrix, complex, complex_array, complex, -) +DEFNDBINOP_OP (mul, complex_matrix, complex, complex_array, complex, *) DEFBINOP (div, complex_matrix, complex) { @@ -53,7 +53,7 @@ if (d == 0.0) gripe_divide_by_zero (); - return octave_value (v1.array_value () / d); + return octave_value (v1.complex_array_value () / d); } DEFBINOP_FN (pow, complex_matrix, complex, xpow) @@ -68,14 +68,14 @@ return octave_value (xleftdiv (m1, m2)); } -DEFNDBINOP_FN (lt, complex_matrix, complex, array, complex, mx_el_lt) -DEFNDBINOP_FN (le, complex_matrix, complex, array, complex, mx_el_le) -DEFNDBINOP_FN (eq, complex_matrix, complex, array, complex, mx_el_eq) -DEFNDBINOP_FN (ge, complex_matrix, complex, array, complex, mx_el_ge) -DEFNDBINOP_FN (gt, complex_matrix, complex, array, complex, mx_el_gt) -DEFNDBINOP_FN (ne, complex_matrix, complex, array, complex, mx_el_ne) +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) -DEFNDBINOP_OP (el_mul, complex_matrix, complex, array, complex, *) +DEFNDBINOP_OP (el_mul, complex_matrix, complex, complex_array, complex, *) DEFBINOP (el_div, complex_matrix, complex) { @@ -86,20 +86,20 @@ if (d == 0.0) gripe_divide_by_zero (); - return octave_value (v1.array_value () / d); + return octave_value (v1.complex_array_value () / d); } -DEFNDBINOP_FN (el_pow, complex_matrix, complex, array, complex, elem_xpow) +DEFNDBINOP_FN (el_pow, complex_matrix, complex, complex_array, complex, elem_xpow) DEFBINOP (el_ldiv, complex_matrix, complex) { CAST_BINOP_ARGS (const octave_complex_matrix&, const octave_complex&); - return x_el_div (v2.complex_value (), v1.array_value ()); + return x_el_div (v2.complex_value (), v1.complex_array_value ()); } -DEFNDBINOP_FN (el_and, complex_matrix, complex, array, complex, mx_el_and) -DEFNDBINOP_FN (el_or, complex_matrix, complex, array, complex, mx_el_or) +DEFNDBINOP_FN (el_and, complex_matrix, complex, complex_array, complex, mx_el_and) +DEFNDBINOP_FN (el_or, complex_matrix, complex, complex_array, complex, mx_el_or) DEFASSIGNOP_FN (assign, complex_matrix, complex, assign) diff -r 2d393bead213 -r 69a9b22a72a2 src/OPERATORS/op-cm-m.cc --- a/src/OPERATORS/op-cm-m.cc Mon Oct 27 03:31:29 2003 +0000 +++ b/src/OPERATORS/op-cm-m.cc Mon Oct 27 15:41:55 2003 +0000 @@ -45,8 +45,8 @@ // complex matrix by matrix ops. -DEFNDBINOP_OP (add, complex_matrix, matrix, array, array, +) -DEFNDBINOP_OP (sub, complex_matrix, matrix, array, array, -) +DEFNDBINOP_OP (add, complex_matrix, matrix, complex_array, array, +) +DEFNDBINOP_OP (sub, complex_matrix, matrix, complex_array, array, -) DEFBINOP_OP (mul, complex_matrix, matrix, *) DEFBINOP_FN (div, complex_matrix, matrix, xdiv) @@ -59,26 +59,26 @@ DEFBINOP_FN (ldiv, complex_matrix, matrix, xleftdiv) -DEFNDBINOP_FN (lt, complex_matrix, matrix, array, array, mx_el_lt) -DEFNDBINOP_FN (le, complex_matrix, matrix, array, array, mx_el_le) -DEFNDBINOP_FN (eq, complex_matrix, matrix, array, array, mx_el_eq) -DEFNDBINOP_FN (ge, complex_matrix, matrix, array, array, mx_el_ge) -DEFNDBINOP_FN (gt, complex_matrix, matrix, array, array, mx_el_gt) -DEFNDBINOP_FN (ne, complex_matrix, matrix, array, array, mx_el_ne) +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) -DEFNDBINOP_FN (el_mul, complex_matrix, matrix, array, array, product) -DEFNDBINOP_FN (el_div, complex_matrix, matrix, array, array, quotient) -DEFNDBINOP_FN (el_pow, complex_matrix, matrix, array, array, elem_xpow) +DEFNDBINOP_FN (el_mul, complex_matrix, matrix, complex_array, array, product) +DEFNDBINOP_FN (el_div, complex_matrix, matrix, complex_array, array, quotient) +DEFNDBINOP_FN (el_pow, complex_matrix, matrix, complex_array, array, elem_xpow) DEFBINOP (el_ldiv, complex_matrix, matrix) { CAST_BINOP_ARGS (const octave_complex_matrix&, const octave_matrix&); - return quotient (v2.array_value (), v1.array_value ()); + return quotient (v2.array_value (), v1.complex_array_value ()); } -DEFNDBINOP_FN (el_and, complex_matrix, matrix, array, array, mx_el_and) -DEFNDBINOP_FN (el_or, complex_matrix, matrix, array, array, mx_el_or) +DEFNDBINOP_FN (el_and, complex_matrix, matrix, complex_array, array, mx_el_and) +DEFNDBINOP_FN (el_or, complex_matrix, matrix, complex_array, array, mx_el_or) DEFASSIGNOP_FN (assign, complex_matrix, matrix, assign) diff -r 2d393bead213 -r 69a9b22a72a2 src/OPERATORS/op-cm-s.cc --- a/src/OPERATORS/op-cm-s.cc Mon Oct 27 03:31:29 2003 +0000 +++ b/src/OPERATORS/op-cm-s.cc Mon Oct 27 15:41:55 2003 +0000 @@ -44,9 +44,9 @@ // complex matrix by scalar ops. -DEFNDBINOP_OP (add, complex_matrix, scalar, array, scalar, +) -DEFNDBINOP_OP (sub, complex_matrix, scalar, array, scalar, -) -DEFNDBINOP_OP (mul, complex_matrix, scalar, array, scalar, *) +DEFNDBINOP_OP (add, complex_matrix, scalar, complex_array, scalar, +) +DEFNDBINOP_OP (sub, complex_matrix, scalar, complex_array, scalar, -) +DEFNDBINOP_OP (mul, complex_matrix, scalar, complex_array, scalar, *) DEFBINOP (div, complex_matrix, scalar) { @@ -57,7 +57,7 @@ if (d == 0.0) gripe_divide_by_zero (); - return octave_value (v1.array_value () / d); + return octave_value (v1.complex_array_value () / d); } DEFBINOP_FN (pow, complex_matrix, scalar, xpow) @@ -72,12 +72,12 @@ return octave_value (xleftdiv (m1, m2)); } -DEFNDBINOP_FN (lt, complex_matrix, scalar, array, scalar, mx_el_lt) -DEFNDBINOP_FN (le, complex_matrix, scalar, array, scalar, mx_el_le) -DEFNDBINOP_FN (eq, complex_matrix, scalar, array, scalar, mx_el_eq) -DEFNDBINOP_FN (ge, complex_matrix, scalar, array, scalar, mx_el_ge) -DEFNDBINOP_FN (gt, complex_matrix, scalar, array, scalar, mx_el_gt) -DEFNDBINOP_FN (ne, complex_matrix, scalar, array, scalar, mx_el_ne) +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) DEFBINOP_OP (el_mul, complex_matrix, scalar, *) @@ -90,20 +90,20 @@ if (d == 0.0) gripe_divide_by_zero (); - return octave_value (v1.array_value () / d); + return octave_value (v1.complex_array_value () / d); } -DEFNDBINOP_FN (el_pow, complex_matrix, scalar, array, scalar, elem_xpow) +DEFNDBINOP_FN (el_pow, complex_matrix, scalar, complex_array, scalar, elem_xpow) DEFBINOP (el_ldiv, complex_matrix, scalar) { CAST_BINOP_ARGS (const octave_complex_matrix&, const octave_scalar&); - return x_el_div (v2.double_value (), v1.array_value ()); + return x_el_div (v2.double_value (), v1.complex_array_value ()); } -DEFNDBINOP_FN (el_and, complex_matrix, scalar, array, scalar, mx_el_and) -DEFNDBINOP_FN (el_or, complex_matrix, scalar, array, scalar, mx_el_or) +DEFNDBINOP_FN (el_and, complex_matrix, scalar, complex_array, scalar, mx_el_and) +DEFNDBINOP_FN (el_or, complex_matrix, scalar, complex_array, scalar, mx_el_or) DEFASSIGNOP_FN (assign, complex_matrix, scalar, assign) diff -r 2d393bead213 -r 69a9b22a72a2 src/OPERATORS/op-cs-cm.cc --- a/src/OPERATORS/op-cs-cm.cc Mon Oct 27 03:31:29 2003 +0000 +++ b/src/OPERATORS/op-cs-cm.cc Mon Oct 27 15:41:55 2003 +0000 @@ -40,9 +40,9 @@ // complex scalar by complex matrix ops. -DEFNDBINOP_OP (add, complex, complex_matrix, complex, array, +) -DEFNDBINOP_OP (sub, complex, complex_matrix, complex, array, -) -DEFNDBINOP_OP (mul, complex, complex_matrix, complex, array, *) +DEFNDBINOP_OP (add, complex, complex_matrix, complex, complex_array, +) +DEFNDBINOP_OP (sub, complex, complex_matrix, complex, complex_array, -) +DEFNDBINOP_OP (mul, complex, complex_matrix, complex, complex_array, *) DEFBINOP (div, complex, complex_matrix) { @@ -65,19 +65,19 @@ if (d == 0.0) gripe_divide_by_zero (); - return octave_value (v2.array_value () / d); + return octave_value (v2.complex_array_value () / d); } -DEFNDBINOP_FN (lt, complex, complex_matrix, complex, array, mx_el_lt) -DEFNDBINOP_FN (le, complex, complex_matrix, complex, array, mx_el_le) -DEFNDBINOP_FN (eq, complex, complex_matrix, complex, array, mx_el_eq) -DEFNDBINOP_FN (ge, complex, complex_matrix, complex, array, mx_el_ge) -DEFNDBINOP_FN (gt, complex, complex_matrix, complex, array, mx_el_gt) -DEFNDBINOP_FN (ne, complex, complex_matrix, complex, array, mx_el_ne) +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) -DEFNDBINOP_OP (el_mul, complex, complex_matrix, complex, array, *) -DEFNDBINOP_FN (el_div, complex, complex_matrix, complex, array, x_el_div) -DEFNDBINOP_FN (el_pow, complex, complex_matrix, complex, array, elem_xpow) +DEFNDBINOP_OP (el_mul, complex, complex_matrix, complex, complex_array, *) +DEFNDBINOP_FN (el_div, complex, complex_matrix, complex, complex_array, x_el_div) +DEFNDBINOP_FN (el_pow, complex, complex_matrix, complex, complex_array, elem_xpow) DEFBINOP (el_ldiv, complex, complex_matrix) { @@ -88,11 +88,11 @@ if (d == 0.0) gripe_divide_by_zero (); - return octave_value (v2.array_value () / d); + return octave_value (v2.complex_array_value () / d); } -DEFNDBINOP_FN (el_and, complex, complex_matrix, complex, array, mx_el_and) -DEFNDBINOP_FN (el_or, complex, complex_matrix, complex, array, mx_el_or) +DEFNDBINOP_FN (el_and, complex, complex_matrix, complex, complex_array, mx_el_and) +DEFNDBINOP_FN (el_or, complex, complex_matrix, complex, complex_array, mx_el_or) DEFCONV (complex_matrix_conv, complex, complex_matrix) { diff -r 2d393bead213 -r 69a9b22a72a2 src/OPERATORS/op-m-cm.cc --- a/src/OPERATORS/op-m-cm.cc Mon Oct 27 03:31:29 2003 +0000 +++ b/src/OPERATORS/op-m-cm.cc Mon Oct 27 15:41:55 2003 +0000 @@ -45,8 +45,8 @@ // matrix by complex matrix ops. -DEFNDBINOP_OP (add, matrix, complex_matrix, array, array, +) -DEFNDBINOP_OP (sub, matrix, complex_matrix, array, array, -) +DEFNDBINOP_OP (add, matrix, complex_matrix, array, complex_array, +) +DEFNDBINOP_OP (sub, matrix, complex_matrix, array, complex_array, -) DEFBINOP_OP (mul, matrix, complex_matrix, *) DEFBINOP_FN (div, matrix, complex_matrix, xdiv) @@ -59,26 +59,26 @@ DEFBINOP_FN (ldiv, matrix, complex_matrix, xleftdiv) -DEFNDBINOP_FN (lt, matrix, complex_matrix, array, array, mx_el_lt) -DEFNDBINOP_FN (le, matrix, complex_matrix, array, array, mx_el_le) -DEFNDBINOP_FN (eq, matrix, complex_matrix, array, array, mx_el_eq) -DEFNDBINOP_FN (ge, matrix, complex_matrix, array, array, mx_el_ge) -DEFNDBINOP_FN (gt, matrix, complex_matrix, array, array, mx_el_gt) -DEFNDBINOP_FN (ne, matrix, complex_matrix, array, array, mx_el_ne) +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) -DEFNDBINOP_FN (el_mul, matrix, complex_matrix, array, array, product) -DEFNDBINOP_FN (el_div, matrix, complex_matrix, array, array, quotient) -DEFNDBINOP_FN (el_pow, matrix, complex_matrix, array, array, elem_xpow) +DEFNDBINOP_FN (el_mul, matrix, complex_matrix, array, complex_array, product) +DEFNDBINOP_FN (el_div, matrix, complex_matrix, array, complex_array, quotient) +DEFNDBINOP_FN (el_pow, matrix, complex_matrix, array, complex_array, elem_xpow) DEFBINOP (el_ldiv, matrix, complex_matrix) { CAST_BINOP_ARGS (const octave_matrix&, const octave_complex_matrix&); - return quotient (v2.array_value (), v1.array_value ()); + return quotient (v2.complex_array_value (), v1.array_value ()); } -DEFNDBINOP_FN (el_and, matrix, complex_matrix, array, array, mx_el_and) -DEFNDBINOP_FN (el_or, matrix, complex_matrix, array, array, mx_el_or) +DEFNDBINOP_FN (el_and, matrix, complex_matrix, array, complex_array, mx_el_and) +DEFNDBINOP_FN (el_or, matrix, complex_matrix, array, complex_array, mx_el_or) DEFCONV (complex_matrix_conv, matrix, complex_matrix) { diff -r 2d393bead213 -r 69a9b22a72a2 src/OPERATORS/op-m-m.cc --- a/src/OPERATORS/op-m-m.cc Mon Oct 27 03:31:29 2003 +0000 +++ b/src/OPERATORS/op-m-m.cc Mon Oct 27 15:41:55 2003 +0000 @@ -39,8 +39,8 @@ // matrix unary ops. -DEFNDUNOP_OP (not, matrix, !) -DEFNDUNOP_OP (uminus, matrix, -) +DEFNDUNOP_OP (not, matrix, array, !) +DEFNDUNOP_OP (uminus, matrix, array, -) DEFUNOP (transpose, matrix) { diff -r 2d393bead213 -r 69a9b22a72a2 src/OPERATORS/op-s-cm.cc --- a/src/OPERATORS/op-s-cm.cc Mon Oct 27 03:31:29 2003 +0000 +++ b/src/OPERATORS/op-s-cm.cc Mon Oct 27 15:41:55 2003 +0000 @@ -46,9 +46,9 @@ // scalar by complex matrix ops. -DEFNDBINOP_OP (add, scalar, complex_matrix, scalar, array, +) -DEFNDBINOP_OP (sub, scalar, complex_matrix, scalar, array, -) -DEFNDBINOP_OP (mul, scalar, complex_matrix, scalar, array, *) +DEFNDBINOP_OP (add, scalar, complex_matrix, scalar, complex_array, +) +DEFNDBINOP_OP (sub, scalar, complex_matrix, scalar, complex_array, -) +DEFNDBINOP_OP (mul, scalar, complex_matrix, scalar, complex_array, *) DEFBINOP (div, scalar, complex_matrix) { @@ -71,19 +71,19 @@ if (d == 0.0) gripe_divide_by_zero (); - return octave_value (v2.array_value () / d); + return octave_value (v2.complex_array_value () / d); } -DEFNDBINOP_FN (lt, scalar, complex_matrix, scalar, array, mx_el_lt) -DEFNDBINOP_FN (le, scalar, complex_matrix, scalar, array, mx_el_le) -DEFNDBINOP_FN (eq, scalar, complex_matrix, scalar, array, mx_el_eq) -DEFNDBINOP_FN (ge, scalar, complex_matrix, scalar, array, mx_el_ge) -DEFNDBINOP_FN (gt, scalar, complex_matrix, scalar, array, mx_el_gt) -DEFNDBINOP_FN (ne, scalar, complex_matrix, scalar, array, mx_el_ne) +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) -DEFNDBINOP_OP (el_mul, scalar, complex_matrix, scalar, array, *) -DEFNDBINOP_FN (el_div, scalar, complex_matrix, scalar, array, x_el_div) -DEFNDBINOP_FN (el_pow, scalar, complex_matrix, scalar, array, elem_xpow) +DEFNDBINOP_OP (el_mul, scalar, complex_matrix, scalar, complex_array, *) +DEFNDBINOP_FN (el_div, scalar, complex_matrix, scalar, complex_array, x_el_div) +DEFNDBINOP_FN (el_pow, scalar, complex_matrix, scalar, complex_array, elem_xpow) DEFBINOP (el_ldiv, scalar, complex_matrix) { @@ -94,21 +94,21 @@ if (d == 0.0) gripe_divide_by_zero (); - return octave_value (v2.array_value () / d); + return octave_value (v2.complex_array_value () / d); } DEFBINOP (el_and, scalar, complex_matrix) { CAST_BINOP_ARGS (const octave_scalar&, const octave_complex_matrix&); - return mx_el_and (v1.double_value (), v2.array_value ()); + return mx_el_and (v1.double_value (), v2.complex_array_value ()); } DEFBINOP (el_or, scalar, complex_matrix) { CAST_BINOP_ARGS (const octave_scalar&, const octave_complex_matrix&); - return mx_el_or (v1.double_value (), v2.array_value ()); + return mx_el_or (v1.double_value (), v2.complex_array_value ()); } DEFCONV (complex_matrix_conv, scalar, complex_matrix) diff -r 2d393bead213 -r 69a9b22a72a2 src/ops.h --- a/src/ops.h Mon Oct 27 03:31:29 2003 +0000 +++ b/src/ops.h Mon Oct 27 15:41:55 2003 +0000 @@ -190,11 +190,11 @@ return octave_value (op v.t ## _value ()); \ } -#define DEFNDUNOP_OP(name, t, op) \ +#define DEFNDUNOP_OP(name, t, e, op) \ UNOPDECL (name, a) \ { \ CAST_UNOP_ARG (const octave_ ## t&); \ - return octave_value (op v.array_value ()); \ + return octave_value (op v.e ## _value ()); \ } // XXX FIXME XXX -- in some cases, the constructor isn't necessary. @@ -206,11 +206,11 @@ return octave_value (f (v.t ## _value ())); \ } -#define DEFNDUNOP_FN(name, t, f) \ +#define DEFNDUNOP_FN(name, t, e, f) \ UNOPDECL (name, a) \ { \ CAST_UNOP_ARG (const octave_ ## t&); \ - return octave_value (f (v.array_value ())); \ + return octave_value (f (v.e ## _value ())); \ } #define DEFNCUNOP_METHOD(name, t, method) \ diff -r 2d393bead213 -r 69a9b22a72a2 src/ov-base.cc --- a/src/ov-base.cc Mon Oct 27 03:31:29 2003 +0000 +++ b/src/ov-base.cc Mon Oct 27 15:41:55 2003 +0000 @@ -300,11 +300,10 @@ } NDArray -octave_base_value::double_nd_array_value (bool) const +octave_base_value::array_value (bool) const { NDArray retval; - gripe_wrong_type_arg ("octave_base_value::double_nd_array_value()", - type_name ()); + gripe_wrong_type_arg ("octave_base_value::array_value()", type_name ()); return retval; } @@ -326,6 +325,41 @@ return retval; } +ComplexNDArray +octave_base_value::complex_array_value (bool) const +{ + ComplexNDArray retval; + gripe_wrong_type_arg ("octave_base_value::complex_array_value()", + type_name ()); + return retval; +} + +bool +octave_base_value::bool_value (void) const +{ + bool retval = false; + gripe_wrong_type_arg ("octave_base_value::bool_value()", type_name ()); + return retval; +} + +boolMatrix +octave_base_value::bool_matrix_value (void) const +{ + boolMatrix retval; + gripe_wrong_type_arg ("octave_base_value::bool_matrix_value()", + type_name ()); + return retval; +} + +boolNDArray +octave_base_value::bool_array_value (bool) const +{ + boolNDArray retval; + gripe_wrong_type_arg ("octave_base_value::bool_array_value()", + type_name ()); + return retval; +} + charMatrix octave_base_value::char_matrix_value (bool) const { @@ -339,6 +373,15 @@ return retval; } +charNDArray +octave_base_value::char_array_value (bool) const +{ + charNDArray retval; + gripe_wrong_type_arg ("octave_base_value::char_array_value()", + type_name ()); + return retval; +} + string_vector octave_base_value::all_strings (bool pad, bool force) const { @@ -435,23 +478,6 @@ return retval; } -bool -octave_base_value::bool_value (void) const -{ - bool retval = false; - gripe_wrong_type_arg ("octave_base_value::bool_value()", type_name ()); - return retval; -} - -boolMatrix -octave_base_value::bool_matrix_value (void) const -{ - boolMatrix retval; - gripe_wrong_type_arg ("octave_base_value::bool_matrix_value()", - type_name ()); - return retval; -} - CONVDECLX (matrix_conv) { return new octave_matrix (); diff -r 2d393bead213 -r 69a9b22a72a2 src/ov-base.h --- a/src/ov-base.h Mon Oct 27 03:31:29 2003 +0000 +++ b/src/ov-base.h Mon Oct 27 15:41:55 2003 +0000 @@ -195,14 +195,24 @@ Matrix matrix_value (bool = false) const; - NDArray double_nd_array_value (bool frc_str_conv = false) const; + NDArray array_value (bool = false) const; Complex complex_value (bool = false) const; ComplexMatrix complex_matrix_value (bool = false) const; + ComplexNDArray complex_array_value (bool = false) const; + + bool bool_value (void) const; + + boolMatrix bool_matrix_value (void) const; + + boolNDArray bool_array_value (bool = false) const; + charMatrix char_matrix_value (bool = false) const; + charNDArray char_array_value (bool = false) const; + string_vector all_strings (bool pad = false, bool force = false) const; std::string string_value (bool force = false) const; @@ -223,10 +233,6 @@ octave_value_list list_value (void) const; - bool bool_value (void) const; - - boolMatrix bool_matrix_value (void) const; - octave_value convert_to_str_internal (bool pad, bool force) const; void convert_to_row_or_column_vector (void); diff -r 2d393bead213 -r 69a9b22a72a2 src/ov-bool-mat.h --- a/src/ov-bool-mat.h Mon Oct 27 03:31:29 2003 +0000 +++ b/src/ov-bool-mat.h Mon Oct 27 15:41:55 2003 +0000 @@ -104,7 +104,7 @@ boolMatrix bool_matrix_value (void) const { return matrix.matrix_value (); } - boolNDArray array_value (bool = false) const + boolNDArray bool_array_value (bool = false) const { return matrix; } octave_value convert_to_str_internal (bool pad, bool force) const; diff -r 2d393bead213 -r 69a9b22a72a2 src/ov-ch-mat.h --- a/src/ov-ch-mat.h Mon Oct 27 03:31:29 2003 +0000 +++ b/src/ov-ch-mat.h Mon Oct 27 15:41:55 2003 +0000 @@ -106,7 +106,7 @@ charMatrix char_matrix_value (bool = false) const { return matrix.matrix_value (); } - charNDArray array_value (bool = false) const + charNDArray char_array_value (bool = false) const { return matrix; } octave_value convert_to_str_internal (bool, bool) const diff -r 2d393bead213 -r 69a9b22a72a2 src/ov-cx-mat.h --- a/src/ov-cx-mat.h Mon Oct 27 03:31:29 2003 +0000 +++ b/src/ov-cx-mat.h Mon Oct 27 15:41:55 2003 +0000 @@ -102,7 +102,7 @@ ComplexMatrix complex_matrix_value (bool = false) const; - ComplexNDArray array_value (void) const { return matrix; } + ComplexNDArray complex_array_value (bool = false) const { return matrix; } void increment (void) { matrix += Complex (1.0); } diff -r 2d393bead213 -r 69a9b22a72a2 src/ov-re-mat.h --- a/src/ov-re-mat.h Mon Oct 27 03:31:29 2003 +0000 +++ b/src/ov-re-mat.h Mon Oct 27 15:41:55 2003 +0000 @@ -101,8 +101,7 @@ ComplexMatrix complex_matrix_value (bool = false) const; - NDArray array_value (bool = false) const - { return matrix; } + NDArray array_value (bool = false) const { return matrix; } void increment (void) { matrix += 1.0; } diff -r 2d393bead213 -r 69a9b22a72a2 src/ov.h --- a/src/ov.h Mon Oct 27 03:31:29 2003 +0000 +++ b/src/ov.h Mon Oct 27 15:41:55 2003 +0000 @@ -485,8 +485,8 @@ virtual Matrix matrix_value (bool frc_str_conv = false) const { return rep->matrix_value (frc_str_conv); } - virtual NDArray double_nd_array_value (bool frc_str_conv = false) const - { return rep->double_nd_array_value (frc_str_conv); } + virtual NDArray array_value (bool frc_str_conv = false) const + { return rep->array_value (frc_str_conv); } virtual Complex complex_value (bool frc_str_conv = false) const { return rep->complex_value (frc_str_conv); } @@ -494,9 +494,24 @@ virtual ComplexMatrix complex_matrix_value (bool frc_str_conv = false) const { return rep->complex_matrix_value (frc_str_conv); } + virtual ComplexNDArray complex_array_value (bool frc_str_conv = false) const + { return rep->complex_array_value (frc_str_conv); } + + virtual bool bool_value (void) const + { return rep->bool_value (); } + + virtual boolMatrix bool_matrix_value (void) const + { return rep->bool_matrix_value (); } + + virtual boolNDArray bool_array_value (void) const + { return rep->bool_array_value (); } + virtual charMatrix char_matrix_value (bool frc_str_conv = false) const { return rep->char_matrix_value (frc_str_conv); } + virtual charNDArray char_array_value (bool frc_str_conv = false) const + { return rep->char_array_value (frc_str_conv); } + virtual string_vector all_strings (bool pad = false, bool force = false) const { return rep->all_strings (pad); } @@ -522,12 +537,6 @@ virtual octave_value_list list_value (void) const; - virtual bool bool_value (void) const - { return rep->bool_value (); } - - virtual boolMatrix bool_matrix_value (void) const - { return rep->bool_matrix_value (); } - ColumnVector column_vector_value (bool frc_str_conv = false, bool frc_vec_conv = false) const;