Skip to content

Commit ef1373a

Browse files
io: fix DIGRAPHS_TournamentLineDecoder
1 parent c586c8a commit ef1373a

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

data/tourn4.txt

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
000000
2+
000101
3+
100010
4+
100100

gap/io.gi

+1
Original file line numberDiff line numberDiff line change
@@ -1254,6 +1254,7 @@ BindGlobal("DIGRAPHS_TournamentLineDecoder",
12541254
function(func, s)
12551255
local out, pos, n, i, j;
12561256
pos := 0;
1257+
s := Chomp(s);
12571258
n := (Sqrt(8 * Length(s) + 1) + 1) / 2;
12581259
out := List([1 .. n], x -> []);
12591260
for i in [1 .. n - 1] do

tst/standard/io.tst

+6
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,12 @@ gap> OutNeighbours(gr);
415415
[ [ 2, 4 ], [ ], [ 1, 2, 4 ], [ 2 ] ]
416416
gap> gr := TournamentLineDecoder("");
417417
<immutable empty digraph with 1 vertex>
418+
gap> fname := Concatenation(DIGRAPHS_Dir(), "/data/tourn4.txt");;
419+
gap> ReadDigraphs(fname, TournamentLineDecoder);
420+
[ <immutable digraph with 4 vertices, 6 edges>,
421+
<immutable digraph with 4 vertices, 6 edges>,
422+
<immutable digraph with 4 vertices, 6 edges>,
423+
<immutable digraph with 4 vertices, 6 edges> ]
418424
419425
# AdjacencyMatrixUpperTriangleLineDecoder
420426
gap> gr := AdjacencyMatrixUpperTriangleLineDecoder("100101");

0 commit comments

Comments
 (0)