Mercurial > hg > octave-nkf
diff src/ov-str-mat.h @ 9688:90abfd8a2895
make squeeze and diag return char for char argument
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sun, 04 Oct 2009 01:04:29 -0400 |
parents | d865363208d6 |
children | 34d6f005db4b |
line wrap: on
line diff
--- a/src/ov-str-mat.h +++ b/src/ov-str-mat.h @@ -91,6 +91,9 @@ bool resize_ok = false) { return do_index_op_internal (idx, resize_ok); } + octave_value squeeze (void) const + { return octave_value (charNDArray (matrix.squeeze ()), true); } + octave_value reshape (const dim_vector& new_dims) const { return octave_value (charNDArray (matrix.reshape (new_dims)), true); } @@ -99,6 +102,9 @@ octave_value resize (const dim_vector& dv, bool fill = false) const; + octave_value diag (octave_idx_type k = 0) const + { return octave_value (matrix.diag (k), true); } + bool is_string (void) const { return true; } bool is_real_type (void) const { return false; } @@ -255,6 +261,9 @@ octave_base_value *clone (void) const { return new octave_char_matrix_sq_str (*this); } octave_base_value *empty_clone (void) const { return new octave_char_matrix_sq_str (); } + octave_value squeeze (void) const + { return octave_value (charNDArray (matrix.squeeze ()), true, '\''); } + octave_value reshape (const dim_vector& new_dims) const { return octave_value (charNDArray (matrix.reshape (new_dims)), true, '\''); } @@ -268,6 +277,9 @@ return octave_value (retval, true, '\''); } + octave_value diag (octave_idx_type k = 0) const + { return octave_value (matrix.diag (k), true, '\''); } + bool is_sq_string (void) const { return true; } octave_value do_index_op (const octave_value_list& idx,