Skip to content

Commit a9b0aa7

Browse files
committed
Merge branch 'stable-1.5'
2 parents 986d5be + c93810f commit a9b0aa7

File tree

12 files changed

+26
-67
lines changed

12 files changed

+26
-67
lines changed

etc/gaplint.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
#!/bin/bash
22
set -e
33

4-
gaplint --disable W004 *.g gap/*
5-
gaplint --disable W004 doc/*.xml
6-
gaplint --disable W004 tst/testinstall.tst tst/standard/*.tst tst/extreme/*.tst tst/workspaces/*.tst
4+
gaplint --disable W004 *.g gap/* doc/*.xml tst/testinstall.tst tst/standard/*.tst tst/extreme/*.tst tst/workspaces/*.tst

gap/attr.gi

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,15 +1407,13 @@ end);
14071407

14081408
InstallMethod(DigraphBicomponents, "for a digraph", [IsDigraph],
14091409
function(D)
1410-
local b;
14111410

14121411
# Attribute only applies to bipartite digraphs
14131412
if not IsBipartiteDigraph(D) then
14141413
return fail;
14151414
fi;
1416-
b := KernelOfTransformation(DIGRAPHS_Bipartite(D)[2],
1415+
return KernelOfTransformation(DIGRAPHS_Bipartite(D)[2],
14171416
DigraphNrVertices(D));
1418-
return b;
14191417
end);
14201418

14211419
InstallMethod(DigraphLoops, "for a digraph by out-neighbours",
@@ -1527,9 +1525,7 @@ function(D)
15271525
return DigraphVertices(D);
15281526
elif not IsStronglyConnectedDigraph(D) then
15291527
return fail;
1530-
fi;
1531-
1532-
if DigraphNrVertices(D) < 256 then
1528+
elif DigraphNrVertices(D) < 256 then
15331529
path := DigraphMonomorphism(CycleDigraph(DigraphNrVertices(D)), D);
15341530
if path = fail then
15351531
return fail;
@@ -1733,7 +1729,8 @@ InstallMethodThatReturnsDigraph(ReducedDigraph,
17331729
"for a digraph by out-neighbours",
17341730
[IsDigraphByOutNeighboursRep],
17351731
function(D)
1736-
local v, niv, old, C, i;
1732+
local v, niv, old, i;
1733+
17371734
if IsConnectedDigraph(D) then
17381735
return D;
17391736
fi;
@@ -1749,8 +1746,7 @@ function(D)
17491746
UniteBlistList(v, niv, old[i]);
17501747
fi;
17511748
od;
1752-
C := InducedSubdigraph(D, ListBlist(v, niv));
1753-
return C;
1749+
return InducedSubdigraph(D, ListBlist(v, niv));
17541750
end);
17551751

17561752
InstallMethod(DigraphRemoveAllMultipleEdges,

gap/cliques.gi

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,7 @@ function(arg)
175175
ErrorNoReturn("at least 1 argument is required,");
176176
elif not IsDigraph(arg[1]) then
177177
ErrorNoReturn("the 1st argument must be a digraph,");
178-
fi;
179-
if not IsBound(arg[2])
178+
elif not IsBound(arg[2])
180179
and HasDigraphMaximalIndependentSetsRepsAttr(arg[1]) then
181180
return DigraphMaximalIndependentSetsRepsAttr(arg[1]);
182181
fi;
@@ -203,8 +202,7 @@ function(arg)
203202
ErrorNoReturn("at least 1 argument is required,");
204203
elif not IsDigraph(arg[1]) then
205204
ErrorNoReturn("the 1st argument must be a digraph,");
206-
fi;
207-
if not IsBound(arg[2])
205+
elif not IsBound(arg[2])
208206
and HasDigraphMaximalIndependentSetsAttr(arg[1]) then
209207
return DigraphMaximalIndependentSetsAttr(arg[1]);
210208
fi;
@@ -552,9 +550,7 @@ function(digraph, hook, user_param, limit, include, exclude, max, size, reps)
552550

553551
if not IsDigraph(digraph) then
554552
ErrorNoReturn("the 1st argument <D> must be a digraph,");
555-
fi;
556-
557-
if hook <> fail then
553+
elif hook <> fail then
558554
if not (IsFunction(hook) and NumberArgumentsFunction(hook) = 2) then
559555
ErrorNoReturn("the 2nd argument <hook> must be fail, or a ",
560556
"function with 2 arguments,");
@@ -584,14 +580,10 @@ function(digraph, hook, user_param, limit, include, exclude, max, size, reps)
584580

585581
if not max in [true, false] then
586582
ErrorNoReturn("the 7th argument <max> must be true or false,");
587-
fi;
588-
589-
if size <> fail and not IsPosInt(size) then
583+
elif size <> fail and not IsPosInt(size) then
590584
ErrorNoReturn("the 8th argument <size> must be fail, or a ",
591585
"positive integer,");
592-
fi;
593-
594-
if not reps in [true, false] then
586+
elif not reps in [true, false] then
595587
ErrorNoReturn("the 9th argument <reps> must be true or false,");
596588
fi;
597589

gap/constructors.gi

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,7 @@ function(D)
159159
local G, opt;
160160
if not IsSymmetricDigraph(D) then
161161
ErrorNoReturn("the argument <D> must be a symmetric digraph,");
162-
fi;
163-
if HasDigraphGroup(D) then
162+
elif HasDigraphGroup(D) then
164163
G := DigraphGroup(D);
165164
else
166165
G := Group(());

gap/digraph.gd

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,7 @@ DeclareConstructor("DigraphByAdjacencyMatrixConsNC",
8181
[IsDigraph, IsHomogeneousList]);
8282

8383
DeclareOperation("DigraphByAdjacencyMatrix", [IsFunction, IsHomogeneousList]);
84-
DeclareOperation("DigraphByAdjacencyMatrixNC", [IsFunction, IsHomogeneousList]);
85-
8684
DeclareOperation("DigraphByAdjacencyMatrix", [IsHomogeneousList]);
87-
DeclareOperation("DigraphByAdjacencyMatrixNC", [IsHomogeneousList]);
8885

8986
DeclareConstructor("DigraphByEdgesCons", [IsDigraph, IsList]);
9087
DeclareConstructor("DigraphByEdgesCons", [IsDigraph, IsList, IsInt]);

gap/examples.gi

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1684,12 +1684,10 @@ InstallMethod(PermutationStarGraph, "for a function and two integers",
16841684
InstallMethod(PrismGraphCons, "for IsMutableDigraph and an integer",
16851685
[IsMutableDigraph, IsPosInt],
16861686
function(filt, n)
1687-
local D;
16881687
if n < 3 then
16891688
ErrorNoReturn("the argument <n> must be an integer equal to 3 or more,");
16901689
else
1691-
D := GeneralisedPetersenGraph(IsMutableDigraph, n, 1);
1692-
return D;
1690+
return GeneralisedPetersenGraph(IsMutableDigraph, n, 1);
16931691
fi;
16941692
end);
16951693

@@ -1797,8 +1795,7 @@ function(filt, n)
17971795
D := DigraphRemoveEdge(D, i + 1, i);
17981796
od;
17991797
D := DigraphRemoveEdge(D, n, 1);
1800-
D := DigraphRemoveEdge(D, 1, n);
1801-
return D;
1798+
return DigraphRemoveEdge(D, 1, n);
18021799
end);
18031800

18041801
InstallMethod(WebGraphCons,

gap/grahom.gi

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@ InstallMethod(DigraphColouring, "for a digraph and an integer",
9797
function(D, n)
9898
if n < 0 then
9999
ErrorNoReturn("the 2nd argument <n> must be a non-negative integer,");
100-
fi;
101-
if HasDigraphGreedyColouring(D) then
100+
elif HasDigraphGreedyColouring(D) then
102101
if DigraphGreedyColouring(D) = fail then
103102
return fail;
104103
elif RankOfTransformation(DigraphGreedyColouring(D),

gap/grape.gi

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,7 @@ function(G, edges, n)
188188
ErrorNoReturn("the 3rd argument <n> must be a non-negative integer,");
189189
elif n = 0 then
190190
return EmptyDigraph(0);
191-
fi;
192-
193-
if IsPosInt(edges[1]) then # E consists of a single edge
191+
elif IsPosInt(edges[1]) then # E consists of a single edge
194192
edges := [edges];
195193
fi;
196194

gap/io.gi

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ function(string, substring)
3636

3737
if Length(string) = 0 then
3838
return [];
39-
fi;
40-
if Length(substring) = 1 then
39+
elif Length(substring) = 1 then
4140
return SplitString(string, substring);
4241
fi;
4342

@@ -104,8 +103,7 @@ function(file, D)
104103
g := DigraphGroup(D);
105104
if IsTrivial(g) then
106105
TryNextMethod();
107-
fi;
108-
if IO_Write(file, "DIGG") = fail then
106+
elif IO_Write(file, "DIGG") = fail then
109107
return IO_Error;
110108
fi;
111109
out := [GeneratorsOfGroup(g),
@@ -499,9 +497,7 @@ function(arg)
499497
ErrorNoReturn("the argument <encoder> must be a function or fail,");
500498
elif not mode in ["a", "w"] then
501499
ErrorNoReturn("the argument <mode> must be \"a\" or \"w\",");
502-
fi;
503-
504-
if IsString(name) and not IsExistingFile(name) then
500+
elif IsString(name) and not IsExistingFile(name) then
505501
mode := "w";
506502
fi;
507503

gap/isomorph.gi

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -410,9 +410,7 @@ function(C, D, c1, c2)
410410
od;
411411
if not ForAll(class_sizes, x -> x = 0) then
412412
return false;
413-
fi;
414-
415-
if IsMultiDigraph(C) then
413+
elif IsMultiDigraph(C) then
416414
act := OnMultiDigraphs;
417415
else
418416
act := OnDigraphs;
@@ -443,9 +441,7 @@ function(C, D)
443441
return [label1[1] / label2[1], label1[2] / label2[2]];
444442
elif C = D then
445443
return ();
446-
fi;
447-
448-
if HasBlissCanonicalLabelling(C) and HasBlissCanonicalLabelling(D)
444+
elif HasBlissCanonicalLabelling(C) and HasBlissCanonicalLabelling(D)
449445
or not ((HasNautyCanonicalLabelling(C)
450446
and NautyCanonicalLabelling(C) <> fail)
451447
or (HasNautyCanonicalLabelling(D)
@@ -491,9 +487,7 @@ function(C, D, c1, c2)
491487
od;
492488
if not ForAll(class_sizes, x -> x = 0) then
493489
return fail;
494-
fi;
495-
496-
if DIGRAPHS_UsingBliss or IsMultiDigraph(C) then
490+
elif DIGRAPHS_UsingBliss or IsMultiDigraph(C) then
497491
label1 := BlissCanonicalLabelling(C, colour1);
498492
label2 := BlissCanonicalLabelling(D, colour2);
499493
else

0 commit comments

Comments
 (0)