From 50f28ca1af0398a587254a696f02e887442a2eff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Meike=20Wei=C3=9F?= Date: Thu, 12 Sep 2024 16:45:48 +0200 Subject: [PATCH 1/2] bug fix --- gap/Paths/paths.gd | 14 ++++++++++++++ gap/Paths/paths.gi | 26 ++++++++++++++++++++------ 2 files changed, 34 insertions(+), 6 deletions(-) diff --git a/gap/Paths/paths.gd b/gap/Paths/paths.gd index ac091d19..526a9f25 100644 --- a/gap/Paths/paths.gd +++ b/gap/Paths/paths.gd @@ -1308,6 +1308,20 @@ DeclareAttribute( "AllTwoWaistsOfComplex", IsTwistedPolygonalComplex); #! gap> AllThreeWaistsOfComplex(Tetrahedron()); #! [ ] #! @EndExampleSession +#! As another example we consider the following simplicial surface: +#! @BeginExampleSession +#! gap> umbdesc:=[ (1,4,6,7,5,3), (1,7,5,8,2,3), (1,7,6,8,2,4),(2,4,6,8,5,3) ];; +#! gap> s:=SimplicialSurfaceByUmbrellaDescriptor(umbdesc);; +#! gap> AllThreeWaistsOfComplex(s); +#! [ ( v2, E1, v3, E6, v1, E11, v2 ), +#! ( v1, E1, v4, E8, v2, E10, v1 ), +#! ( v3, E2, v2, E6, v1, E9, v3 ), +#! ( v1, E2, v4, E7, v3, E12, v1 ), +#! ( v2, E3, v4, E4, v3, E12, v2 ), +#! ( v3, E3, v4, E5, v2, E10, v3 ), +#! ( v4, E4, v1, E8, v2, E9, v4 ), +#! ( v4, E5, v1, E7, v3, E11, v4 )] +#! @EndExampleSession #! #! @Returns a set of closed vertex-edge-paths #! @Arguments complex diff --git a/gap/Paths/paths.gi b/gap/Paths/paths.gi index 9f3aec5c..11fe1f84 100644 --- a/gap/Paths/paths.gi +++ b/gap/Paths/paths.gi @@ -1011,12 +1011,26 @@ end InstallMethod( AllThreeWaistsOfComplex, "for a twisted polygonal complex", [IsTwistedPolygonalComplex], function( surface ) - local w,eof,waists; - waists:=Combinations(Edges(surface),3); - waists:=Filtered(waists,w->Length(Union(VerticesOfEdges(surface){w}))=3); - waists:=Filtered(waists,w->Filtered(EdgesOfFaces(surface), - eof->Length(Intersection(w,eof))>=2)=[]); - return List(waists,w->VertexEdgePathByEdges(surface,w)); + local w,voe1,voe2,voe3,v1,v2,v3,eof,waists,verticesOfEdges,facesOfEdges,temp; + verticesOfEdges:=VerticesOfEdges(surface); + facesOfEdges:=FacesOfEdges(surface); + waists:=Combinations(InnerEdges(surface),3); + waists:=Filtered(waists,w->Length(Union(verticesOfEdges{w}))=3); + waists:=Filtered(waists,w->Length(Union(facesOfEdges{w}))=6); + temp:=waists; + waists:=[]; + for w in temp do + voe1:=verticesOfEdges[w[1]]; + voe2:=verticesOfEdges[w[2]]; + voe3:=verticesOfEdges[w[3]]; + v1:=Intersection(voe1,voe2)[1]; + v2:=Intersection(voe2,voe3)[1]; + v3:=Intersection(voe1,voe3)[1]; + if Length(Set([v1,v2,v3]))=3 then + Add(waists,[v1,w[1],v2,w[2],v3,w[3],v1]); + fi; + od; + return List(waists,w->VertexEdgePathNC(surface,w)); end ); From 0aec9ea016974f4e9f8bf0228f8effb5a7eb2248 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Meike=20Wei=C3=9F?= Date: Thu, 12 Sep 2024 17:08:13 +0200 Subject: [PATCH 2/2] fixed error --- gap/Paths/paths.gd | 12 ++++-------- gap/Paths/paths.gi | 2 +- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/gap/Paths/paths.gd b/gap/Paths/paths.gd index 526a9f25..5b56936e 100644 --- a/gap/Paths/paths.gd +++ b/gap/Paths/paths.gd @@ -1313,14 +1313,10 @@ DeclareAttribute( "AllTwoWaistsOfComplex", IsTwistedPolygonalComplex); #! gap> umbdesc:=[ (1,4,6,7,5,3), (1,7,5,8,2,3), (1,7,6,8,2,4),(2,4,6,8,5,3) ];; #! gap> s:=SimplicialSurfaceByUmbrellaDescriptor(umbdesc);; #! gap> AllThreeWaistsOfComplex(s); -#! [ ( v2, E1, v3, E6, v1, E11, v2 ), -#! ( v1, E1, v4, E8, v2, E10, v1 ), -#! ( v3, E2, v2, E6, v1, E9, v3 ), -#! ( v1, E2, v4, E7, v3, E12, v1 ), -#! ( v2, E3, v4, E4, v3, E12, v2 ), -#! ( v3, E3, v4, E5, v2, E10, v3 ), -#! ( v4, E4, v1, E8, v2, E9, v4 ), -#! ( v4, E5, v1, E7, v3, E11, v4 )] +#! [ ( v1, E1, v2, E6, v3, E11, v1 ), ( v2, E1, v1, E8, v4, E10, v2 ), +#! ( v1, E2, v3, E6, v2, E9, v1 ), ( v3, E2, v1, E7, v4, E12, v3 ), +#! ( v3, E3, v2, E4, v4, E12, v3 ), ( v2, E3, v3, E5, v4, E10, v2 ), +#! ( v2, E4, v4, E8, v1, E9, v2 ), ( v3, E5, v4, E7, v1, E11, v3 ) ] #! @EndExampleSession #! #! @Returns a set of closed vertex-edge-paths diff --git a/gap/Paths/paths.gi b/gap/Paths/paths.gi index 11fe1f84..5e15486e 100644 --- a/gap/Paths/paths.gi +++ b/gap/Paths/paths.gi @@ -1027,7 +1027,7 @@ InstallMethod( AllThreeWaistsOfComplex, "for a twisted polygonal complex", v2:=Intersection(voe2,voe3)[1]; v3:=Intersection(voe1,voe3)[1]; if Length(Set([v1,v2,v3]))=3 then - Add(waists,[v1,w[1],v2,w[2],v3,w[3],v1]); + Add(waists,[v3,w[1],v1,w[2],v2,w[3],v3]); fi; od; return List(waists,w->VertexEdgePathNC(surface,w));