From bug-octave-request at bevo dot che dot wisc dot edu Tue Dec 16 00:44:23 2003 Subject: [] & [] fails From: "John W. Eaton" To: Paul Kienzle Cc: bug-octave at bevo dot che dot wisc dot edu Date: Tue, 16 Dec 2003 00:44:13 -0600 On 16-Dec-2003, Paul Kienzle wrote: | octave-cvs-2003-12-15 on Debian. | | octave:1> find([]&[]) | error: invalid converstion of boolNDArray to boolMatrix | octave:1> []&[] | octave: /home/pkienzle/cvs/octave/src/pr-output.cc:1290: void | print_empty_nd_array(std::ostream&, const dim_vector&, bool): Assertion | `dims.any_zero ()' failed. | panic: Aborted -- stopping myself... | ans = attempting to save variables to `octave-core'... | save to `octave-core' complete The following patch should fix the crash. The find function still needs to be made N-d aware. Thanks, jwe src/ChangeLog: 2003-12-16 John W. Eaton * ov-base-mat.h (octave_base_matrix::octave_base_matrix (const MT&)): If arg has no dimensions, resize to be 0x0. Index: src/ov-base-mat.h =================================================================== RCS file: /usr/local/cvsroot/octave/src/ov-base-mat.h,v retrieving revision 1.28 diff -u -r1.28 ov-base-mat.h --- src/ov-base-mat.h 25 Nov 2003 05:41:36 -0000 1.28 +++ src/ov-base-mat.h 16 Dec 2003 06:40:09 -0000 at @ -56,7 +56,11 @@ : octave_base_value () { } octave_base_matrix (const MT& m) - : octave_base_value (), matrix (m) { } + : octave_base_value (), matrix (m) + { + if (matrix.ndims () == 0) + matrix.resize (dim_vector (0, 0)); + } octave_base_matrix (const octave_base_matrix& m) : octave_base_value (), matrix (m.matrix) { } ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------