Mercurial > hg > octave-lyh
changeset 2258:9dc512bdc19b
[project @ 1996-05-22 21:07:35 by jwe]
author | jwe |
---|---|
date | Wed, 22 May 1996 21:07:35 +0000 |
parents | 22f40c3d0600 |
children | 22893e3c7fbf |
files | src/pt-const.cc |
diffstat | 1 files changed, 45 insertions(+), 31 deletions(-) [+] |
line wrap: on
line diff
--- a/src/pt-const.cc +++ b/src/pt-const.cc @@ -2608,38 +2608,52 @@ } } - octave_value tmp_a = a.make_numeric (); - - if (error_state) - return retval; - - switch (tmp_a.const_type ()) + // XXX FIXME XXX -- it is very unlikely that this is the correct + // place for this special case... + + if (a.const_type () == OCT_VAL_REP::char_matrix_constant_str + && t == tree_expression::transpose) + { + charMatrix chm = a.all_strings (); + + if (! error_state) + retval = octave_value (chm.transpose (), true); + } + else { - case OCT_VAL_REP::scalar_constant: - retval = do_unary_op (tmp_a.double_value (), t); - break; - - case OCT_VAL_REP::matrix_constant: - { - Matrix m = tmp_a.matrix_value (); - retval = do_unary_op (m, t); - } - break; - - case OCT_VAL_REP::complex_scalar_constant: - retval = do_unary_op (tmp_a.complex_value (), t); - break; - - case OCT_VAL_REP::complex_matrix_constant: - { - ComplexMatrix m = tmp_a.complex_matrix_value (); - retval = do_unary_op (m, t); - } - break; - - default: - gripe_wrong_type_arg_for_unary_op (tmp_a); - break; + octave_value tmp_a = a.make_numeric (); + + if (error_state) + return retval; + + switch (tmp_a.const_type ()) + { + case OCT_VAL_REP::scalar_constant: + retval = do_unary_op (tmp_a.double_value (), t); + break; + + case OCT_VAL_REP::matrix_constant: + { + Matrix m = tmp_a.matrix_value (); + retval = do_unary_op (m, t); + } + break; + + case OCT_VAL_REP::complex_scalar_constant: + retval = do_unary_op (tmp_a.complex_value (), t); + break; + + case OCT_VAL_REP::complex_matrix_constant: + { + ComplexMatrix m = tmp_a.complex_matrix_value (); + retval = do_unary_op (m, t); + } + break; + + default: + gripe_wrong_type_arg_for_unary_op (tmp_a); + break; + } } return retval;