Skip to content

Commit

Permalink
Changes requested by Meike
Browse files Browse the repository at this point in the history
  • Loading branch information
alice authored and alice committed Sep 13, 2024
1 parent f8598c5 commit eede218
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion gap/PolygonalComplexes/discs.gi
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ InstallMethod( AllSimplicialSurfacesByEssentialButterflyInsertion,

allp := __SIMPLICIAL_AllEssentialTwoPaths(surf);

surfaces := List(allp, t-> ButterflyInsertionSurface(surf, t)[1]);
surfaces := List(allp, t-> ButterflyInsertion(surf, t)[1]);


return IsomorphismRepresentatives(surfaces);
Expand Down
13 changes: 7 additions & 6 deletions gap/PolygonalComplexes/modification.gd
Original file line number Diff line number Diff line change
Expand Up @@ -1581,10 +1581,11 @@ DeclareOperation("SplitAllVertices", [IsPolygonalComplex]);
#! butterfly along a edge-path of length 2. The edge-path is given either
#! as a list of three vertices such that these three vertices determine two
#! edges of <A>surface</A>, meeting in the middle vertex, or as a list
#! of two adjacend edges, or as a vertex-edge-path. The operation
#! of two adjacent edges, or as a vertex-edge path. The operation
#! <E>ButterflyInsertionSurface</E> can be viewed as splitting
#! the middle vertex of the given vertex-edge path in <A>surface</A> into
#! two new vertices.
#! two new vertices. The inner edge of the butterfly will be inserted such
#! that it is adjacent to the new vertices created by splitting the middle vertex.
#!
#! The function returns a list, where the first entry is the enlarged surface
#! <A>newSurface</A> which has two faces more than the input surface. The
Expand All @@ -1598,7 +1599,7 @@ DeclareOperation("SplitAllVertices", [IsPolygonalComplex]);
#! gap> disc := SimplicialUmbrella(5);
#! simplicial surface (6 vertices, 10 edges, and 5 faces)
#! gap> t:= [1,2,6];;
#! gap> discbig:=ButterflyInsertionSurface(disc,t)[1];
#! gap> discbig:=ButterflyInsertion(disc,t)[1];
#! simplicial surface (7 vertices, 13 edges, and 7 faces)
#! gap> CounterOfVertices(discbig);
#! counter of vertices ([ 2, 3, 6 ] degrees, and [ 3, 3, 1 ] multiplicities)
Expand All @@ -1623,11 +1624,11 @@ DeclareOperation("SplitAllVertices", [IsPolygonalComplex]);
#! <Alt Only = "Text">
#! Image omitted in terminal text
#! </Alt>
#! @Returns a pair, where the first entry is a surface and the second entry is the vertex edgepath encoding changes to the input surface.
#! @Returns a pair, where the first entry is a surface and the second entry is the vertex-edge path encoding changes to the input surface.
#! @Arguments surface, list
DeclareOperation( "ButterflyInsertionSurface", [IsSimplicialSurface, IsList] );
DeclareOperation( "ButterflyInsertion", [IsSimplicialSurface, IsList] );
#! @Arguments surface, vertex-edge-path
DeclareOperation( "ButterflyInsertionSurface", [IsSimplicialSurface, IsVertexEdgePath] );
DeclareOperation( "ButterflyInsertion", [IsSimplicialSurface, IsVertexEdgePath] );
#! @EndGroup


Expand Down
15 changes: 8 additions & 7 deletions gap/PolygonalComplexes/modification.gi
Original file line number Diff line number Diff line change
Expand Up @@ -1879,7 +1879,7 @@ InstallMethod( SplitAllVertices, "for a polygonal complex",
);
RedispatchOnCondition( SplitAllVertices, true, [IsTwistedPolygonalComplex], [IsPolygonalComplex], 0 );

InstallMethod( ButterflyInsertionSurface,
InstallMethod( ButterflyInsertion,
"for a simplicial surface and a pair of edges or a vertex list", [IsSimplicialSurface,IsList],

function( surface, t )
Expand All @@ -1892,10 +1892,11 @@ InstallMethod( ButterflyInsertionSurface,
Length(CommonVerticesOfEdgesNC(surface,t[1],t[2])) = 0 then
ErrorNoReturn("Requires a pair of adjacent edges");
fi;
t := Union(VerticesOfEdge(surface,t[1]),VerticesOfEdge(surface,t[2]));
if not t[2] in CommonVerticesOfEdgesNC(surface,t[1],t[2]) then
edges := t;
t := Union(VerticesOfEdge(surface,t[1]),VerticesOfEdge(surface,t[2]));
if not t[2] in CommonVerticesOfEdgesNC(surface,edges[1],edgest[2]) then
w := t[2]; t[2] := t[1]; t[1] := w;
fi;
fi;

Check warning on line 1899 in gap/PolygonalComplexes/modification.gi

View check run for this annotation

Codecov / codecov/patch

gap/PolygonalComplexes/modification.gi#L1891-L1899

Added lines #L1891 - L1899 were not covered by tests
elif Length(t) = 3 then
# we expect a vertex path of length 3
if not IsSubset(Vertices(surface),t) or
Expand Down Expand Up @@ -1939,8 +1940,8 @@ InstallMethod( ButterflyInsertionSurface,
i := First([1..3] , x-> Length(e[x][1])=1 and edges[1] in e[x][2] );
Assert(0,i<>fail,"incorrect path");

Check warning on line 1941 in gap/PolygonalComplexes/modification.gi

View check run for this annotation

Codecov / codecov/patch

gap/PolygonalComplexes/modification.gi#L1938-L1941

Added lines #L1938 - L1941 were not covered by tests
# now e[i] is a single edge, corresponding to first in the path
# w is set to the first vertex in the path to be split
w := t[1];

Check warning on line 1944 in gap/PolygonalComplexes/modification.gi

View check run for this annotation

Codecov / codecov/patch

gap/PolygonalComplexes/modification.gi#L1944

Added line #L1944 was not covered by tests
# w := CommonVerticesOfEdgesNC(surface,edges[1],edges[2])[1];
# find the other vertex of the image of w in the image edge
newverts := [];
newverts[1] := OtherVertexOfEdgeNC(newSurface,
Expand Down Expand Up @@ -2007,12 +2008,12 @@ InstallMethod( ButterflyInsertionSurface,
end
);

InstallMethod( ButterflyInsertionSurface,
InstallMethod( ButterflyInsertion,
"for a simplicial surface and vertex-edge path", [IsSimplicialSurface,IsVertexEdgePath],

function( surface, t )

return ButterflyInsertionSurface( surface, VerticesAsList(t));
return ButterflyInsertion( surface, VerticesAsList(t));

Check warning on line 2016 in gap/PolygonalComplexes/modification.gi

View check run for this annotation

Codecov / codecov/patch

gap/PolygonalComplexes/modification.gi#L2016

Added line #L2016 was not covered by tests

end
);
Expand Down

0 comments on commit eede218

Please sign in to comment.