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

Update topcom Interface to latest topcom version #201

Merged
merged 5 commits into from
Oct 18, 2022
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
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
image: [gapsystem/gap-docker, gapsystem/gap-docker-master]
os: [ ubuntu-18.04, ubuntu-20.04, ubuntu-latest ]
os: [ ubuntu-22.04, ubuntu-20.04, ubuntu-latest ]
runs-on: ${{ matrix.os }}
container:
image: ${{ matrix.image }}
Expand Down
2 changes: 1 addition & 1 deletion TopcomInterface/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# TopcomInterface
A `Gap4`-package which provides an interface to the software `topcom` (http://www.rambau.wm.uni-bayreuth.de/TOPCOM/).
A `Gap4`-package which provides an interface to the software `topcom` (http://www.rambau.wm.uni-bayreuth.de/TOPCOM/). This interface requires `topcom` version 1.1.2. It may or may not work with newer version. Communication with older version is most likely not possibly with this software.


## Installation
Expand Down
66 changes: 34 additions & 32 deletions TopcomInterface/examples/examples.g
Original file line number Diff line number Diff line change
Expand Up @@ -29,61 +29,63 @@ chiro := Concatenation(
points2chiro( rays );
#! "3,2:+-+[]"
chiro2dual( chiro );
#! "12,8:0++----++-+--+-++--++--+---++-+++---+--++--+---++-++++-++--+++--\
#! +-++-++--++-++---+--+++--+--++---++-+--+---++---++-+--+--++-+++--++-++\
#! ---+--+++--+--++---++-+--+---++---++-+--+--++-++++--+++--+-++-++--+--+\
#! --+--+-++--+--+++-++---++-++--+++--+-++-+++--+++--+-++-++--+----++---+\
#! +-+--+--++-++-++-+++--++---++-+--+--++-++-++-+++-++-++---++--+--+++-++\
#! ---++---++---++-+--+---++---++-+--+--++-++++--+++--+-++-++--+--+--+---\
#! ++--+++--+-++-++--+--+--+---+--+--++--++---++-+--+-+--+--+--+----++-++\
#! ---++-++---"
#! "12,8:+--+--+-+--+-++-+-+++--+--0+++-+--+-+-+----+-+++-+--+-+++-+--++-+-++--+-\
#! +---++-+++-+-++-+---+-++--+-++-+-0++++--++---++-++-++-+-+-++++-+-----+--+-++++\
#! +--++----+-+++++--++---++-++++-+--0-++--+++--++-+++---++-+--++-+-++-+-+--+--+-\
#! -+-++-++--+++---+-++-++--+++--++-++0--+-+--++--+-+--++-+++-+-+++--+-+--++--+-+\
#! --++-+++-+-+++-++-++--+-+--+-+-++-+-0+++--+++-++++--++++-+++-++++--++++-++--+-\
#! ---+----++----+--++-+++++-+++--+----+0-+-++-++--+--+--+---+--+--++--++---++-+-\
#! -+-+--+--+--+----++-++---++-++---"
chiro2circuits( points2chiro( rays ) );
#! "3,2:[[[0,1,2],[]]]"
#! [ [ [ 0, 1, 2 ], [ ] ] ]
chiro2cocircuits( points2chiro( rays ) );
#! "3,2:[[[0],[1]][[1],[2]][[0],[2]]]"
#! "3,2:[[[1],[2]][[0],[2]][[0],[1]]]"
result := cocircuits2facets( chiro2cocircuits( chiro ) );
#! ""
points2facets( rays );
#! "3,2:[]"
points2nflips( rays );
#! 3
#! 0
points2flips( rays );
#! "[3,2:[[[0,1,2],[]]->0]]"
#! "[3,2:[]]"
chiro2placingtriang( chiro );
#! [ [ [ 0, 1, 2, 3 ], [ 1, 2, 3, 4 ], [ 0, 1, 3, 4 ], [ 0, 1, 2, 4 ],
#! [ 0, 2, 3, 5 ], [ 0, 3, 4, 6 ], [ 0, 2, 4, 6 ], [ 0, 3, 5, 6 ],
#! [ 0, 2, 5, 6 ], [ 2, 3, 4, 7 ], [ 2, 3, 5, 7 ], [ 3, 4, 7, 8 ],
#! [ 2, 4, 7, 8 ], [ 3, 5, 7, 8 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4, 6, 10 ],
#! [ 2, 4, 6, 10 ], [ 3, 5, 6, 10 ], [ 2, 5, 6, 11 ], [ 2, 6, 10, 11 ],
#! [ 5, 6, 10, 11 ], [ 2, 5, 10, 11 ] ] ]
#! [ [ [ 0, 1, 2, 3 ], [ 1, 2, 3, 4 ], [ 0, 1, 3, 4 ], [ 0, 1, 2, 4 ],
#! [ 0, 2, 3, 5 ], [ 2, 3, 4, 5 ], [ 0, 2, 4, 6 ], [ 0, 2, 5, 6 ],
#! [ 3, 4, 5, 6 ], [ 0, 3, 4, 7 ], [ 0, 3, 5, 7 ], [ 4, 5, 6, 7 ],
#! [ 3, 5, 6, 7 ], [ 3, 4, 6, 7 ], [ 0, 4, 6, 8 ], [ 0, 5, 6, 8 ],
#! [ 0, 4, 7, 8 ], [ 0, 5, 7, 8 ], [ 2, 4, 5, 9 ], [ 2, 4, 6, 9 ],
#! [ 4, 6, 8, 9 ], [ 5, 6, 8, 9 ], [ 4, 7, 8, 9 ], [ 5, 7, 8, 9 ],
#! [ 2, 5, 6, 10 ], [ 2, 6, 9, 10 ], [ 4, 7, 9, 10 ], [ 5, 7, 9, 10 ],
#! [ 4, 5, 7, 11 ], [ 2, 5, 9, 11 ], [ 2, 5, 10, 11 ], [ 4, 7, 10, 11 ] ] ]
points2finetriang( rays );
#! [ [ [ 0, 1 ], [ 1, 2 ], [ 0, 2 ] ] ]
chiro2triangs( points2chiro( rays ) );
#! "T[0]:=[0->3,2:[[0,1],[1,2],[0,2]]];T[1]:=[1->3,2:[]];"
#! [ [ [ 0, 1 ], [ 0, 2 ], [ 1, 2 ] ] ]
points2triangs( rays );
#! "T[0]:=[0->3,2:[[0,1],[1,2],[0,2]]];T[1]:=[1->3,2:[]];"
#! [ [ [ 0, 1 ], [ 0, 2 ], [ 1, 2 ] ] ]
chiro2ntriangs( points2chiro( rays ) );
#! 2
#! 1
points2ntriangs( rays );
#! 2
#! 1
chiro2finetriangs( points2chiro( rays ) );
#! "T[0]:=[0->3,2:[[0,1],[1,2],[0,2]]];T[1]:=[1->3,2:[]];"
#! [ [ [ 0, 1 ], [ 0, 2 ], [ 1, 2 ] ] ]
points2finetriang( rays );
#! [ [ [ 0, 1 ], [ 1, 2 ], [ 0, 2 ] ] ]
chiro2nfinetriangs( points2chiro( rays ) );
#! 2
#! 1
points2nfinetriangs( rays );
#! 2
#! 1
chiro2alltriangs( points2chiro( rays ) );
#! [ [ [ 0, 1 ], [ 0, 2 ], [ 1, 2 ] ] ]
points2alltriangs( rays );
Expand Down Expand Up @@ -111,5 +113,5 @@ rays2 := [ [0,0,1], [1,0,1], [2,0,1], [0,1,1],
sample_triang2 := [ [2,1,0,5,4,3,8,7,6], [0,3,6,1,4,7,2,5,8] ];
#! [ [ 2, 1, 0, 5, 4, 3, 8, 7, 6 ], [ 0, 3, 6, 1, 4, 7, 2, 5, 8 ] ]
points2ntriangs( rays2, sample_triang2, [] );
#! 69
#! 387
#! @EndExample
96 changes: 64 additions & 32 deletions TopcomInterface/gap/Functions.gi
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ InstallMethod( chiro2circuits,
[ IsString, IsList, IsList ],
function( input1, input2, options_list )

local topcomDirectory, result;
local topcomDirectory, result, substrings;

# find the topcom binary
topcomDirectory := FindTopcomDirectory( );
Expand All @@ -100,9 +100,13 @@ InstallMethod( chiro2circuits,
input2,
options_list );

# finally evaluate the output
return result;

# TODO Further processing necessary due to changed output of topcom
# TODO Further processing necessary due to changed output of topcom

# Split at every occurance of ":"
substrings := SplitString(result, ':' );
return List( [ 2 .. Length(substrings) ], i -> EvalString( List( [ 3 .. Length( substrings[ i ] ) ], j -> substrings[ i ][ j ] ) ) );

end );


Expand Down Expand Up @@ -418,7 +422,7 @@ InstallMethod( chiro2triangs,
[ IsString, IsList, IsList ],
function( input1, input2, options_list )

local topcomDirectory, result;
local topcomDirectory, result, substrings;

# find the topcom binary
topcomDirectory := FindTopcomDirectory( );
Expand All @@ -430,8 +434,12 @@ InstallMethod( chiro2triangs,
input2,
options_list );

# finally evaluate the output
return result;
# TODO Further processing necessary due to changed output of topcom
# TODO Further processing necessary due to changed output of topcom

# Split at every occurance of ":"
substrings := SplitString(result, ':' );
return List( [ 2 .. Length(substrings) ], i -> EvalString( List( [ 3 .. Length( substrings[ i ] ) ], j -> substrings[ i ][ j ] ) ) );

end );

Expand All @@ -451,7 +459,7 @@ InstallMethod( points2triangs,
[ IsList, IsList, IsList ],
function( input1, input2, options_list )

local topcomDirectory, result;
local topcomDirectory, result, substrings;

# find the topcom binary
topcomDirectory := FindTopcomDirectory( );
Expand All @@ -463,8 +471,12 @@ InstallMethod( points2triangs,
input2,
options_list );

# finally evaluate the output
return result;
# TODO Further processing necessary due to changed output of topcom
# TODO Further processing necessary due to changed output of topcom

# Split at every occurance of ":"
substrings := SplitString(result, ':' );
return List( [ 2 .. Length(substrings) ], i -> EvalString( List( [ 3 .. Length( substrings[ i ] ) ], j -> substrings[ i ][ j ] ) ) );

end );

Expand Down Expand Up @@ -550,7 +562,7 @@ InstallMethod( chiro2finetriangs,
[ IsString, IsList, IsList ],
function( input1, input2, options_list )

local topcomDirectory, result;
local topcomDirectory, result, substrings;

# find the topcom binary
topcomDirectory := FindTopcomDirectory( );
Expand All @@ -562,9 +574,13 @@ InstallMethod( chiro2finetriangs,
input2,
options_list );

# finally evaluate the output
return result;

# TODO Further processing necessary due to changed output of topcom
# TODO Further processing necessary due to changed output of topcom

# Split at every occurance of ":"
substrings := SplitString(result, ':' );
return List( [ 2 .. Length(substrings) ], i -> EvalString( List( [ 3 .. Length( substrings[ i ] ) ], j -> substrings[ i ][ j ] ) ) );

end );


Expand Down Expand Up @@ -682,7 +698,7 @@ InstallMethod( chiro2alltriangs,
[ IsString, IsList, IsList ],
function( input1, input2, options_list )

local topcomDirectory, result;
local topcomDirectory, result, substrings;

# find the topcom binary
topcomDirectory := FindTopcomDirectory( );
Expand All @@ -693,10 +709,14 @@ InstallMethod( chiro2alltriangs,
input1,
input2,
options_list );

# finally evaluate the output
return EvalString( Concatenation( "[", result, "]" ) );


# TODO Further processing necessary due to changed output of topcom
# TODO Further processing necessary due to changed output of topcom

# Split at every occurance of ":"
substrings := SplitString(result, ':' );
return List( [ 2 .. Length(substrings) ], i -> EvalString( List( [ 3 .. Length( substrings[ i ] ) ], j -> substrings[ i ][ j ] ) ) );

end );


Expand All @@ -715,7 +735,7 @@ InstallMethod( points2alltriangs,
[ IsList, IsList, IsList ],
function( input1, input2, options_list )

local topcomDirectory, result;
local topcomDirectory, result, substrings;

# find the topcom binary
topcomDirectory := FindTopcomDirectory( );
Expand All @@ -726,10 +746,14 @@ InstallMethod( points2alltriangs,
input1,
input2,
options_list );

# finally evaluate the output
return EvalString( Concatenation( "[", result, "]" ) );


# TODO Further processing necessary due to changed output of topcom
# TODO Further processing necessary due to changed output of topcom

# Split at every occurance of ":"
substrings := SplitString(result, ':' );
return List( [ 2 .. Length(substrings) ], i -> EvalString( List( [ 3 .. Length( substrings[ i ] ) ], j -> substrings[ i ][ j ] ) ) );

end );


Expand Down Expand Up @@ -814,7 +838,7 @@ InstallMethod( chiro2allfinetriangs,
[ IsString, IsList, IsList ],
function( input1, input2, options_list )

local topcomDirectory, result;
local topcomDirectory, result, substrings;

# find the topcom binary
topcomDirectory := FindTopcomDirectory( );
Expand All @@ -826,9 +850,13 @@ InstallMethod( chiro2allfinetriangs,
input2,
options_list );

# finally evaluate the output
return EvalString( Concatenation( "[", result, "]" ) );

# TODO Further processing necessary due to changed output of topcom
# TODO Further processing necessary due to changed output of topcom

# Split at every occurance of ":"
substrings := SplitString(result, ':' );
return List( [ 2 .. Length(substrings) ], i -> EvalString( List( [ 3 .. Length( substrings[ i ] ) ], j -> substrings[ i ][ j ] ) ) );

end );


Expand All @@ -847,7 +875,7 @@ InstallMethod( points2allfinetriangs,
[ IsList, IsList, IsList ],
function( points, ref_triangulation, options_list )

local topcomDirectory, result;
local topcomDirectory, result, substrings;

# find the topcom binary
topcomDirectory := FindTopcomDirectory( );
Expand All @@ -858,9 +886,13 @@ InstallMethod( points2allfinetriangs,
points,
ref_triangulation,
options_list );

# finally evaluate the output
return EvalString( Concatenation( "[", result, "]" ) );

# TODO Further processing necessary due to changed output of topcom
# TODO Further processing necessary due to changed output of topcom

# Split at every occurance of ":"
substrings := SplitString(result, ':' );
return List( [ 2 .. Length(substrings) ], i -> EvalString( List( [ 3 .. Length( substrings[ i ] ) ], j -> substrings[ i ][ j ] ) ) );

end );

Expand Down
Loading