From bug-octave-request at octave dot org Wed Apr 21 14:08:47 2004 Subject: Small bug From: "John W. Eaton" To: David Bateman Cc: bugs at octave dot org Date: Wed, 21 Apr 2004 14:07:37 -0500 On 19-Apr-2004, David Bateman wrote: | The following gives a strange printout | | a = randn(2,2,2); all(all(all(a))) | ans = ans = 1 | | It seems that the trailing singleton dimensions aren't being removed in | this operation... Please try the following patch. Thanks, jwe liboctave/ChangeLog: 2004-04-21 John W. Eaton * mx-inlines.cc (MX_ND_REDUCTION): Chop trailing singletons. Index: liboctave/mx-inlines.cc =================================================================== RCS file: /usr/local/cvsroot/octave/liboctave/mx-inlines.cc,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- a/liboctave/mx-inlines.cc 2 Apr 2004 20:12:24 -0000 1.33 +++ b/liboctave/mx-inlines.cc 21 Apr 2004 19:05:28 -0000 1.34 at @ -482,6 +482,8 @@ increment_index (iter_idx, dv); \ } \ \ + retval.chop_trailing_singletons (); \ + \ return retval #define MX_ND_REAL_OP_REDUCTION(ASN_EXPR, INIT_VAL) \ ------------------------------------------------------------- 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 -------------------------------------------------------------