Mercurial > octave-nkf
diff liboctave/Sparse.cc @ 8527:6b074f37e8d7
reshape: improve error message
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 15 Jan 2009 16:59:15 -0500 |
parents | 17e0ad741fac |
children | 095ae5e0a831 |
line wrap: on
line diff
--- a/liboctave/Sparse.cc Thu Jan 15 14:58:49 2009 -0500 +++ b/liboctave/Sparse.cc Thu Jan 15 16:59:15 2009 -0500 @@ -796,9 +796,14 @@ retval.xcidx(k+1) = new_nnz; } else - (*current_liboctave_error_handler) - ("reshape: size mismatch (%s != %s)", dimensions.str (), - new_dims.str ()); + { + std::string dimensions_str = dimensions.str (); + std::string new_dims_str = new_dims.str (); + + (*current_liboctave_error_handler) + ("reshape: can't reshape %s array to %s array", + dimensions_str.c_str (), new_dims_str.c_str ()); + } } else retval = *this;