Mercurial > hg > octave-lyh
changeset 4565:1db951a4fcd5
[project @ 2003-10-29 13:49:30 by jwe]
author | jwe |
---|---|
date | Wed, 29 Oct 2003 13:49:31 +0000 |
parents | 8a0a0eb77f0b |
children | 30ba814d6700 |
files | liboctave/ChangeLog liboctave/dim-vector.h src/ChangeLog src/data.cc src/input.cc |
diffstat | 5 files changed, 32 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,8 @@ +2003-10-29 John W. Eaton <jwe@bevo.che.wisc.edu> + + * dim-vector.h (dim_vector_rep::dim_vector_rep (int, const + dim_vector&)): Correctly handle case of n < dv->ndims. + 2003-10-28 John W. Eaton <jwe@bevo.che.wisc.edu> * dim-vector.h (dim_vector::any_zero): New function.
--- a/liboctave/dim-vector.h +++ b/liboctave/dim-vector.h @@ -85,7 +85,9 @@ { int dv_ndims = dv ? dv->ndims : 0; - for (int i = 0; i < dv_ndims; i++) + int min_len = n < dv_ndims ? n : dv_ndims; + + for (int i = 0; i < min_len; i++) dims[i] = dv->dims[i]; for (int i = dv_ndims; i < n; i++)
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2003-10-29 John W. Eaton <jwe@bevo.che.wisc.edu> + + * data.cc (fill_matrix): Remove trailing singletons before + allocating the result matrix. + + * input.cc (get_user_input): Don't forget about the diary here. + 2003-10-28 John W. Eaton <jwe@bevo.che.wisc.edu> * ov-list.h (octave_list::nelem): Delete.
--- a/src/data.cc +++ b/src/data.cc @@ -1027,6 +1027,16 @@ { ndim = dims.length (); + for (int i = ndim-1; i > 1; i--) + { + if (dims(i) == 1) + ndim--; + else + break; + } + + dims.resize (ndim); + check_dimensions (dims, fcn); if (! error_state)
--- a/src/input.cc +++ b/src/input.cc @@ -548,6 +548,8 @@ flush_octave_stdout (); + octave_diary << prompt; + std::string input_buf = gnu_readline (prompt.c_str (), true); if (! input_buf.empty ()) @@ -557,6 +559,11 @@ size_t len = input_buf.length (); + octave_diary << input_buf; + + if (input_buf[len - 1] != '\n') + octave_diary << "\n"; + if (len < 1) { if (debug)