diff --git a/gap/PolygonalComplexes/properties.gd b/gap/PolygonalComplexes/properties.gd index b035305a..55ee2a93 100644 --- a/gap/PolygonalComplexes/properties.gd +++ b/gap/PolygonalComplexes/properties.gd @@ -186,6 +186,38 @@ DeclareProperty( "IsSimplexRing", IsTwistedPolygonalComplex); DeclareProperty( "IsSimplexString", IsTwistedPolygonalComplex); #! @EndGroup +#! @BeginGroup FaceListOfRing +#! @Description +#! Compute the face list of a simplex ring where the list starts with the +#! smallest face in the case of a simplex ring. +#! +#! @BeginExampleSession +#! gap> ring:=SimplexRingByIsomorphismType([1,2,3]); +#! simplicial surface (6 vertices, 12 edges, and 6 faces) +#! gap> FaceListOfSimplexRing(ring); +#! [ 1, 2, 3, 4, 5, 6 ] +#! @EndExampleSession +#! +#! @Arguments simplex ring +DeclareAttribute( "FaceListOfSimplexRing", IsSimplexRing); +#! @EndGroup + +#! @BeginGroup FaceListOfString +#! @Description +#! Compute the face list of a simplex string where the list starts with the +#! smallest face that has two incident boundary edges in the case of a simplex string. +#! +#! @BeginExampleSession +#! gap> string:=SimplexStringByIsomorphismType([1,2,3]); +#! simplicial surface (8 vertices, 13 edges, and 6 faces) +#! gap> FaceListOfSimplexString(string); +#! [ 1, 2, 3, 4, 5, 6 ] +#! @EndExampleSession +#! +#! @Arguments simplex string +DeclareAttribute( "FaceListOfSimplexString", IsSimplexString); +#! @EndGroup + #! @BeginGroup IsMultiTetrahedralSphere #! @Description #! Check whether the given twisted polygonal complex is a multitetrahedral diff --git a/gap/PolygonalComplexes/properties.gi b/gap/PolygonalComplexes/properties.gi index 4c8ca157..f5f0cb39 100644 --- a/gap/PolygonalComplexes/properties.gi +++ b/gap/PolygonalComplexes/properties.gi @@ -55,6 +55,8 @@ InstallMethod( IsClosedSurface, "for a polygonal surface", end ); +### Simplex strings and rings + InstallMethod( IsSimplexRing, "for a twisted polygonal complex", [IsTwistedPolygonalComplex], function( complex ) @@ -109,6 +111,41 @@ InstallMethod( IsSimplexString, "for a twisted polygonal complex", end ); +BindGlobal("__SIMPLICIAL_FaceList",function(surface,startingFace) + local facedyclet,oldface, nextface, currentface, neighbours, neighbour; + + oldface:= startingFace; + facedyclet:= [oldface]; + nextface:= Minimum(NeighbourFacesOfFace(surface,oldface)); + Add(facedyclet, nextface); + currentface:=nextface; + + while Length(facedyclet)<>NumberOfFaces(surface) do + neighbours:= NeighbourFacesOfFace(surface,currentface); + neighbour:= Difference(neighbours,[oldface])[1]; + Add(facedyclet, neighbour); + oldface:=currentface; + currentface:=neighbour; + od; + + return facedyclet; + end +); + +InstallMethod(FaceListOfSimplexRing,"for a simplex ring",[IsSimplexRing], +function(ring) + return __SIMPLICIAL_FaceList(ring,Flat(Faces(ring))[1]); +end); + +InstallMethod(FaceListOfSimplexString,"for a simplex string",[IsSimplexString], +function(string) + local boundaryFaces; + boundaryFaces:=Filtered(Faces(string),f->Length(NeighbourFacesOfFace(string,f))=1); + return __SIMPLICIAL_FaceList(string, Minimum(boundaryFaces)); +end); + +### Multitetrahedral Spheres + InstallMethod( IsMultiTetrahedralSphere, "for a twisted polygonal complex", [IsTwistedPolygonalComplex], function(complex) @@ -117,7 +154,7 @@ InstallMethod( IsMultiTetrahedralSphere, "for a twisted polygonal complex", EulerCharacteristic(complex)=2 and IsVertexFaithful(complex)) then return false; fi; - waists:=AllThreeWaistsOfComplex(complex); + waists:=AllThreeWaistsOfComplex(complex); if Length(waists)=NumberOfFaces(complex)/2-2 then return true; else