Skip to content

Commit

Permalink
Merge branch 'stable-1.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
wilfwilson committed Feb 16, 2022
2 parents 986d5be + c93810f commit a9b0aa7
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 67 deletions.
4 changes: 1 addition & 3 deletions etc/gaplint.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#!/bin/bash
set -e

gaplint --disable W004 *.g gap/*
gaplint --disable W004 doc/*.xml
gaplint --disable W004 tst/testinstall.tst tst/standard/*.tst tst/extreme/*.tst tst/workspaces/*.tst
gaplint --disable W004 *.g gap/* doc/*.xml tst/testinstall.tst tst/standard/*.tst tst/extreme/*.tst tst/workspaces/*.tst
14 changes: 5 additions & 9 deletions gap/attr.gi
Original file line number Diff line number Diff line change
Expand Up @@ -1407,15 +1407,13 @@ end);

InstallMethod(DigraphBicomponents, "for a digraph", [IsDigraph],
function(D)
local b;

# Attribute only applies to bipartite digraphs
if not IsBipartiteDigraph(D) then
return fail;
fi;
b := KernelOfTransformation(DIGRAPHS_Bipartite(D)[2],
return KernelOfTransformation(DIGRAPHS_Bipartite(D)[2],
DigraphNrVertices(D));
return b;
end);

InstallMethod(DigraphLoops, "for a digraph by out-neighbours",
Expand Down Expand Up @@ -1527,9 +1525,7 @@ function(D)
return DigraphVertices(D);
elif not IsStronglyConnectedDigraph(D) then
return fail;
fi;

if DigraphNrVertices(D) < 256 then
elif DigraphNrVertices(D) < 256 then
path := DigraphMonomorphism(CycleDigraph(DigraphNrVertices(D)), D);
if path = fail then
return fail;
Expand Down Expand Up @@ -1733,7 +1729,8 @@ InstallMethodThatReturnsDigraph(ReducedDigraph,
"for a digraph by out-neighbours",
[IsDigraphByOutNeighboursRep],
function(D)
local v, niv, old, C, i;
local v, niv, old, i;

if IsConnectedDigraph(D) then
return D;
fi;
Expand All @@ -1749,8 +1746,7 @@ function(D)
UniteBlistList(v, niv, old[i]);
fi;
od;
C := InducedSubdigraph(D, ListBlist(v, niv));
return C;
return InducedSubdigraph(D, ListBlist(v, niv));
end);

InstallMethod(DigraphRemoveAllMultipleEdges,
Expand Down
18 changes: 5 additions & 13 deletions gap/cliques.gi
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,7 @@ function(arg)
ErrorNoReturn("at least 1 argument is required,");
elif not IsDigraph(arg[1]) then
ErrorNoReturn("the 1st argument must be a digraph,");
fi;
if not IsBound(arg[2])
elif not IsBound(arg[2])
and HasDigraphMaximalIndependentSetsRepsAttr(arg[1]) then
return DigraphMaximalIndependentSetsRepsAttr(arg[1]);
fi;
Expand All @@ -203,8 +202,7 @@ function(arg)
ErrorNoReturn("at least 1 argument is required,");
elif not IsDigraph(arg[1]) then
ErrorNoReturn("the 1st argument must be a digraph,");
fi;
if not IsBound(arg[2])
elif not IsBound(arg[2])
and HasDigraphMaximalIndependentSetsAttr(arg[1]) then
return DigraphMaximalIndependentSetsAttr(arg[1]);
fi;
Expand Down Expand Up @@ -552,9 +550,7 @@ function(digraph, hook, user_param, limit, include, exclude, max, size, reps)

if not IsDigraph(digraph) then
ErrorNoReturn("the 1st argument <D> must be a digraph,");
fi;

if hook <> fail then
elif hook <> fail then
if not (IsFunction(hook) and NumberArgumentsFunction(hook) = 2) then
ErrorNoReturn("the 2nd argument <hook> must be fail, or a ",
"function with 2 arguments,");
Expand Down Expand Up @@ -584,14 +580,10 @@ function(digraph, hook, user_param, limit, include, exclude, max, size, reps)

if not max in [true, false] then
ErrorNoReturn("the 7th argument <max> must be true or false,");
fi;

if size <> fail and not IsPosInt(size) then
elif size <> fail and not IsPosInt(size) then
ErrorNoReturn("the 8th argument <size> must be fail, or a ",
"positive integer,");
fi;

if not reps in [true, false] then
elif not reps in [true, false] then
ErrorNoReturn("the 9th argument <reps> must be true or false,");
fi;

Expand Down
3 changes: 1 addition & 2 deletions gap/constructors.gi
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,7 @@ function(D)
local G, opt;
if not IsSymmetricDigraph(D) then
ErrorNoReturn("the argument <D> must be a symmetric digraph,");
fi;
if HasDigraphGroup(D) then
elif HasDigraphGroup(D) then
G := DigraphGroup(D);
else
G := Group(());
Expand Down
3 changes: 0 additions & 3 deletions gap/digraph.gd
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,7 @@ DeclareConstructor("DigraphByAdjacencyMatrixConsNC",
[IsDigraph, IsHomogeneousList]);

DeclareOperation("DigraphByAdjacencyMatrix", [IsFunction, IsHomogeneousList]);
DeclareOperation("DigraphByAdjacencyMatrixNC", [IsFunction, IsHomogeneousList]);

DeclareOperation("DigraphByAdjacencyMatrix", [IsHomogeneousList]);
DeclareOperation("DigraphByAdjacencyMatrixNC", [IsHomogeneousList]);

DeclareConstructor("DigraphByEdgesCons", [IsDigraph, IsList]);
DeclareConstructor("DigraphByEdgesCons", [IsDigraph, IsList, IsInt]);
Expand Down
7 changes: 2 additions & 5 deletions gap/examples.gi
Original file line number Diff line number Diff line change
Expand Up @@ -1684,12 +1684,10 @@ InstallMethod(PermutationStarGraph, "for a function and two integers",
InstallMethod(PrismGraphCons, "for IsMutableDigraph and an integer",
[IsMutableDigraph, IsPosInt],
function(filt, n)
local D;
if n < 3 then
ErrorNoReturn("the argument <n> must be an integer equal to 3 or more,");
else
D := GeneralisedPetersenGraph(IsMutableDigraph, n, 1);
return D;
return GeneralisedPetersenGraph(IsMutableDigraph, n, 1);
fi;
end);

Expand Down Expand Up @@ -1797,8 +1795,7 @@ function(filt, n)
D := DigraphRemoveEdge(D, i + 1, i);
od;
D := DigraphRemoveEdge(D, n, 1);
D := DigraphRemoveEdge(D, 1, n);
return D;
return DigraphRemoveEdge(D, 1, n);
end);

InstallMethod(WebGraphCons,
Expand Down
3 changes: 1 addition & 2 deletions gap/grahom.gi
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ InstallMethod(DigraphColouring, "for a digraph and an integer",
function(D, n)
if n < 0 then
ErrorNoReturn("the 2nd argument <n> must be a non-negative integer,");
fi;
if HasDigraphGreedyColouring(D) then
elif HasDigraphGreedyColouring(D) then
if DigraphGreedyColouring(D) = fail then
return fail;
elif RankOfTransformation(DigraphGreedyColouring(D),
Expand Down
4 changes: 1 addition & 3 deletions gap/grape.gi
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,7 @@ function(G, edges, n)
ErrorNoReturn("the 3rd argument <n> must be a non-negative integer,");
elif n = 0 then
return EmptyDigraph(0);
fi;

if IsPosInt(edges[1]) then # E consists of a single edge
elif IsPosInt(edges[1]) then # E consists of a single edge
edges := [edges];
fi;

Expand Down
10 changes: 3 additions & 7 deletions gap/io.gi
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ function(string, substring)

if Length(string) = 0 then
return [];
fi;
if Length(substring) = 1 then
elif Length(substring) = 1 then
return SplitString(string, substring);
fi;

Expand Down Expand Up @@ -104,8 +103,7 @@ function(file, D)
g := DigraphGroup(D);
if IsTrivial(g) then
TryNextMethod();
fi;
if IO_Write(file, "DIGG") = fail then
elif IO_Write(file, "DIGG") = fail then
return IO_Error;
fi;
out := [GeneratorsOfGroup(g),
Expand Down Expand Up @@ -499,9 +497,7 @@ function(arg)
ErrorNoReturn("the argument <encoder> must be a function or fail,");
elif not mode in ["a", "w"] then
ErrorNoReturn("the argument <mode> must be \"a\" or \"w\",");
fi;

if IsString(name) and not IsExistingFile(name) then
elif IsString(name) and not IsExistingFile(name) then
mode := "w";
fi;

Expand Down
12 changes: 3 additions & 9 deletions gap/isomorph.gi
Original file line number Diff line number Diff line change
Expand Up @@ -410,9 +410,7 @@ function(C, D, c1, c2)
od;
if not ForAll(class_sizes, x -> x = 0) then
return false;
fi;

if IsMultiDigraph(C) then
elif IsMultiDigraph(C) then
act := OnMultiDigraphs;
else
act := OnDigraphs;
Expand Down Expand Up @@ -443,9 +441,7 @@ function(C, D)
return [label1[1] / label2[1], label1[2] / label2[2]];
elif C = D then
return ();
fi;

if HasBlissCanonicalLabelling(C) and HasBlissCanonicalLabelling(D)
elif HasBlissCanonicalLabelling(C) and HasBlissCanonicalLabelling(D)
or not ((HasNautyCanonicalLabelling(C)
and NautyCanonicalLabelling(C) <> fail)
or (HasNautyCanonicalLabelling(D)
Expand Down Expand Up @@ -491,9 +487,7 @@ function(C, D, c1, c2)
od;
if not ForAll(class_sizes, x -> x = 0) then
return fail;
fi;

if DIGRAPHS_UsingBliss or IsMultiDigraph(C) then
elif DIGRAPHS_UsingBliss or IsMultiDigraph(C) then
label1 := BlissCanonicalLabelling(C, colour1);
label2 := BlissCanonicalLabelling(D, colour2);
else
Expand Down
12 changes: 3 additions & 9 deletions gap/oper.gi
Original file line number Diff line number Diff line change
Expand Up @@ -853,9 +853,7 @@ InstallMethod(OnMultiDigraphs, "for a digraph and perm coll",
function(D, perms)
if Length(perms) <> 2 then
ErrorNoReturn("the 2nd argument <perms> must be a pair of permutations,");
fi;

if ForAny([1 .. DigraphNrEdges(D)],
elif ForAny([1 .. DigraphNrEdges(D)],
i -> i ^ perms[2] > DigraphNrEdges(D)) then
ErrorNoReturn("the 2nd entry of the 2nd argument <perms> must ",
"permute the edges of the digraph <D> that is the 1st ",
Expand Down Expand Up @@ -1745,9 +1743,7 @@ function(D, v)

if IsBound(layers[v]) then
return layers[v];
fi;

if HasDigraphGroup(D) then
elif HasDigraphGroup(D) then
gens := GeneratorsOfGroup(DigraphGroup(D));
sch := DigraphSchreierVector(D);
trace := DIGRAPHS_TraceSchreierVector(gens, sch, v);
Expand Down Expand Up @@ -1868,9 +1864,7 @@ function(D, list)

if Length(list) <> 2 then
ErrorNoReturn("the 2nd argument <list> must be a list of length 2,");
fi;

if list[1] > DigraphNrVertices(D) or
elif list[1] > DigraphNrVertices(D) or
list[2] > DigraphNrVertices(D) then
ErrorNoReturn("the 2nd argument <list> must consist of vertices of ",
"the 1st argument <D>,");
Expand Down
3 changes: 1 addition & 2 deletions gap/utils.gi
Original file line number Diff line number Diff line change
Expand Up @@ -600,8 +600,7 @@ function(arg)
Error("expected a string or a list as the 1st argument");
elif IsList(arg[1]) and not ForAll(arg[1], IsString) then
Error("expected a list of strings as the 1st argument");
fi;
if IsList(arg[1]) then
elif IsList(arg[1]) then
arg[1] := Concatenation(arg[1]);
fi;
msg := CallFuncList(StringFormatted, arg);
Expand Down

0 comments on commit a9b0aa7

Please sign in to comment.