ArrayIO.sac has very broken show() function
|
|
Bugzilla Link |
823 |
Created on |
Feb 11, 2011 16:43 |
Resolution |
FIXED |
Resolved on |
Feb 11, 2011 20:18 |
Version |
svn |
OS |
Linux |
Architecture |
PC |
Extended Description
Recent masterrun failures, e.g., see below, demonstrate that
the show() function in ~/sac/BASE/stdlib/world/stdio/ArrayIO.sac
is sadly broken on non-scalars:
For example, consider:
xx = ([(2 == 3), (3 == 3)]); /* Boolean vector */
show(xx);
StdIO::print( xx);
show(toi(xx));
StdIO::print( toi(xx));
This produces:
a.out
0
Dimension: 1
Shape : < 2>
< 0 1 >
0
Dimension: 1
Shape : < 2>
< 0 1 >
Since the whole purpose of ArrayFormat is to produce
character arrays without the ugly programmer-"friendly"
decorations, this is not quite adequate. Note that
the vectors are displaying as scalars.
If we do: xx = reshape( [2,1], xx), both work
properly, but tensors are very wrong, too.
Revision 1060 of ArrayIO gives us this much prettier
output for show( reshape( [ 2,3,4], iota(30))):
a.out
0 1 2 3 4
5 6 7 8 9
10 11 12 13 14
15 16 17 18 19
20 21 22 23 24
25 26 27 28 29
Dimension: 3
Shape : < 2, 3, 5>
< 0 1 2 3 4 > < 5 6 7 8 9 > <10 11 12 13 14 >
<15 16 17 18 19 > <20 21 22 23 24 > <25 26 27 28 29 >
Revision -r1141 (CAJ) works fine. Revision -r1258 (SKD)
does not build. Revision -r1260 (SBS) is broken.