Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added method for double n-gon #290

Merged
merged 3 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 29 additions & 1 deletion gap/Library/library.gd
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,6 @@ DeclareOperation( "JanusHead", [] );
#! [ [ 1, 2, 5 ], [ 2, 3, 6 ], [ 3, 4, 7 ], [ 1, 4, 8 ] ]
#! gap> VerticesOfFaces(umb4);
#! [ [ 1, 2, 5 ], [ 2, 3, 5 ], [ 3, 4, 5 ], [ 1, 4, 5 ] ]
#! gap>
#! gap> umb2 := SimplicialUmbrella(2);
#! simplicial surface (3 vertices, 4 edges, and 2 faces)
#! gap> VerticesOfEdges(umb2);
Expand All @@ -476,6 +475,35 @@ DeclareOperation( "JanusHead", [] );
DeclareOperation( "SimplicialUmbrella", [ IsPosInt ] );
#! @EndGroup

#! <ManSection Label="SimplicialDoubleUmbrella">
#! <Oper Name="SimplicialDoubleUmbrella" Arg="nrFaces" Label="for IsPosInt"/>
#! <Filt Name="SimplicialDoubleGon" Arg="nrFaces" Type="operation"/>
#! <Returns><K>a simplicial surface</K></Returns>
#! <Description>
#! Return a simplicial surface consisting of two closed umbrella-paths
#! with <A>nrFaces</A> triangles which are joined at their boundary.
#! The labels of one umbrella are assigned according to the illustration for <E>SimplicialUmbrella</E>,
#! the additional vertex is labelled with <A>nrFaces+2</A>, the incident edges to this vertex
#! are labelled from <A>2*nrFaces+1</A> to <A>4*nrFaces</A> and the incident faces are labelled from
#! <A>nrFaces+1</A> to <A>2*nrFaces</A>.
#! @ExampleSession
#! gap> doubleumb2:=SimplicialDoubleUmbrella(2);
#! simplicial surface (4 vertices, 6 edges, and 4 faces)
#! gap> VerticesOfEdges(doubleumb2);
#! [ [ 1, 3 ], [ 2, 3 ], [ 1, 2 ], [ 1, 2 ], [ 1, 4 ], [ 2, 4 ] ]
#! gap> EdgesOfFaces(doubleumb2);
#! [ [ 1, 2, 3 ], [ 1, 2, 4 ], [ 3, 5, 6 ], [ 4, 5, 6 ] ]
#! gap> doubleumb4:=SimplicialDoubleUmbrella(4);
#! simplicial surface (6 vertices, 12 edges, and 8 faces)
#! gap> IsIsomorphic(doubleumb4,Octahedron());
#! true
#! @EndExampleSession
#! </Description>
#! </ManSection>
# here no AutoDoc documentation since synonyms can't be handled automatically
DeclareOperation("SimplicialDoubleUmbrella", [ IsPosInt ] );
DeclareSynonym("SimplicialDoubleGon", SimplicialDoubleUmbrella);

#! @BeginGroup SimplicialOpenGeodesic
#! @Description
#! Return a simplicial surface consisting of one non-closed geodesic-path
Expand Down
24 changes: 24 additions & 0 deletions gap/Library/library.gi
Original file line number Diff line number Diff line change
Expand Up @@ -827,6 +827,30 @@
end
);

InstallMethod(SimplicialDoubleUmbrella, "for an integer at least 2", [IsPosInt],
function(nrFaces)
local umbr, verticesOfEdges, edgesOfFaces, i;

if nrFaces = 1 then
Error("SimplicialUmbrella: Argument has to be greater than 1.");

Check warning on line 835 in gap/Library/library.gi

View check run for this annotation

Codecov / codecov/patch

gap/Library/library.gi#L835

Added line #L835 was not covered by tests
fi;

umbr:=SimplicialUmbrella(nrFaces);
verticesOfEdges:=ShallowCopy(VerticesOfEdges(umbr));
edgesOfFaces:=ShallowCopy(EdgesOfFaces(umbr));

for i in [1..nrFaces-1] do
edgesOfFaces[i+nrFaces] := [i+nrFaces,2*nrFaces+i,2*nrFaces+i+1];

verticesOfEdges[2*nrFaces+i] := [i,nrFaces+2];
od;
edgesOfFaces[2*nrFaces] := [2*nrFaces,2*nrFaces+nrFaces, 2*nrFaces+1];
verticesOfEdges[2*nrFaces+nrFaces]:=[nrFaces, nrFaces+2];

return SimplicialSurfaceByDownwardIncidenceNC(verticesOfEdges, edgesOfFaces);
end);


InstallMethod( SimplicialOpenGeodesic, "for an integer at least 1", [IsPosInt],
function(nrFaces)
local verticesOfFaces;
Expand Down
Loading