bug concatenating vectors in 3.1.51+
Ben Abbott
bpabbott at mac.com
Sun Oct 12 13:59:40 CDT 2008
I attempted a fresh build last night. My tip is
changeset: 8210:a10397d26114
tag: tip
user: John W. Eaton <jwe at octave.org>
date: Fri Oct 10 15:10:58 2008 -0400
summary: graphics.cc (base_graphics_properties::adopt): place new
child at front of list, not end; make children a column vector instead
of a row vector
The bug is fairly easy to see
[ones(1,0); zeros(5,1)]
error: number of columns must match (1 != 0)
In Matlab
>> [ones(1,0);zeros(5,1)]
ans =
0
0
0
0
0
Presently Octave will not build for me.
if [ -f gplot.eps ] ; then gs -dBATCH -dEPSCrop -dNOPAUSE -q -
sDEVICE=pdfwrite -sOutputFile=gplot.pdf gplot.eps ; fi
../../run-octave -f -q -H -p . --eval "sparseimages ('grid', 'eps');"
error: number of rows must match (79 != 1) near line 937, column 23
error: called from:
error: /Users/bpabbott/Development/mercurial/octave-3.1.51/scripts/
plot/__go_draw_axes__.m at line 937, column 6
error: /Users/bpabbott/Development/mercurial/octave-3.1.51/scripts/
plot/__go_draw_figure__.m at line 59, column 8
error: /Users/bpabbott/Development/mercurial/octave-3.1.51/scripts/
plot/gnuplot_drawnow.m at line 55, column 7
error: /Users/bpabbott/Development/mercurial/octave-3.1.51/scripts/
plot/print.m at line 447, column 7
error: /Users/bpabbott/Development/mercurial/octave-3.1.51/doc/
interpreter/sparseimages.m at line 231, column 5
error: /Users/bpabbott/Development/mercurial/octave-3.1.51/doc/
interpreter/sparseimages.m at line 33, column 2
make[3]: *** [grid.eps] Error 1
make[2]: *** [interpreter] Error 2
make[1]: *** [doc] Error 2
make: *** [all] Error 2
The offending line in __go_draw_axes__.m is
kids = [obj.children, kids];
Which with John's change from row to column vector for handles needs
to be
kids = [obj.children; kids];
However, in this instance an empty vector with size [1, 0] fails.
I replaced the line with
if (isempty (kids))
kids = obj.children;
elseif (! isempty (obj.children))
kids = [obj.children; kids];
endif
and "make" and "make check" completed without further problems.
I could offer a changeset to resolve the problem with
__go_draw_axes__, but expect the the proper solution would to fix the
concatenation of column vectors.
Might someone with c++ skill take care of this, or if there are
substantial problem with that, say the word and I'll submit a
changeset for __go_draw_axes__.
Ben
Ben
More information about the Bug-octave
mailing list