forked from 3-manifolds/SnapPy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
symplectic basis for triangulated 3 manifolds
- Loading branch information
Showing
24 changed files
with
5,562 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# To compile project | ||
# - run 'cmake -S . -B build/' in the dev/symplectic_basis dir | ||
# - run 'cmake --build build/' | ||
|
||
# For clangd copy 'dev/symplectic_basis/build/compile_commands.json' to 'build/' | ||
|
||
cmake_minimum_required(VERSION 3.12) | ||
set(CMAKE_C_COMPILER "gcc") | ||
set(CMAKE_CXX_COMPILER "g++") | ||
|
||
project(SnapPea) | ||
set(CMAKE_EXPORT_COMPILE_COMMANDS 1) | ||
|
||
# Set the name of your program | ||
set(YOUR_PROGRAM symplectic_basis) | ||
|
||
# Set the location of the SnapPea kernel code | ||
set(SNAPPEA_KERNEL ${PROJECT_SOURCE_DIR}/../../kernel) | ||
|
||
# Compiler options | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -Wall -fanalyzer") | ||
|
||
# Add include directories | ||
include_directories(${SNAPPEA_KERNEL}/addl_code ${SNAPPEA_KERNEL}/headers ${SNAPPEA_KERNEL}/real_type ${SNAPPEA_KERNEL}/unix_kit ${SNAPPEA_KERNEL}/) | ||
|
||
# Add source files | ||
file(GLOB KERNEL_SOURCES ${SNAPPEA_KERNEL}/*/*.c) | ||
file(GLOB HEADER_FILES ${SNAPPEA_KERNEL}/*/*.h) | ||
file(COPY ${CMAKE_SOURCE_DIR}/CuspedCensusData DESTINATION ${CMAKE_SOURCE_DIR}/build) # Copy census data to be used by program | ||
|
||
# Create executable target | ||
add_executable(${YOUR_PROGRAM} ${YOUR_PROGRAM}_main.c ${KERNEL_SOURCES} ${HEADER_FILES} ${CUSPED_CENSUS}) | ||
|
||
# Link math library | ||
target_link_libraries(${YOUR_PROGRAM} m) | ||
|
||
# Define custom target to create BuildDate file | ||
#add_custom_target(BuildDate ALL | ||
# COMMAND date > ${CMAKE_SOURCE_DIR}/BuildDate | ||
# DEPENDS ${KERNEL_SOURCES} ${HEADER_FILES} | ||
# WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} | ||
# ) | ||
|
||
# testing binary | ||
add_executable(${YOUR_PROGRAM}_test ${YOUR_PROGRAM}_test.c ${KERNEL_SOURCES} ${HEADER_FILES} ${CUSPED_CENSUS}) | ||
target_link_libraries(${YOUR_PROGRAM}_test m) | ||
|
||
# enable testing functionality | ||
enable_testing() | ||
|
||
# define tests | ||
add_test( | ||
NAME symplectic_test | ||
COMMAND $<TARGET_FILE:${YOUR_PROGRAM}_test> | ||
) | ||
|
||
# Clean target | ||
add_custom_target(clean-all | ||
COMMAND ${CMAKE_COMMAND} -E remove ${YOUR_PROGRAM} ${YOUR_PROGRAM}.o | ||
COMMAND ${CMAKE_COMMAND} -E remove_directory KernelObjects | ||
COMMAND ${CMAKE_COMMAND} -E remove *.pyc | ||
) | ||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
SnapPea Matrix Generators File Format | ||
|
||
A generators file must begin with the line | ||
|
||
% Generators | ||
|
||
to distinguish it from a triangulation file, which begins with | ||
"% Triangulation", or a link projection file which begins with | ||
"% Link Projection". Next comes an integer telling how many matrices | ||
are present. The matrices may by in either O(3,1) or SL(2,C). | ||
Orientation-reversing generators are allowed in O(3,1) but not in | ||
PSL(2,C). If the matrices are in SL(2,C), read_generators() will | ||
convert them to O(3,1). read_generators() can tell which format | ||
you are using by comparing the total number of matrix entries to | ||
the total number of matrices. (SL(2,C) matrices contain 8 real entries | ||
each, while O(3,1) matrices contain 16 real entries each.) | ||
|
||
In PSL(2,C), the entries of a matrix | ||
|
||
a b | ||
c d | ||
|
||
should be written as | ||
|
||
Re(a) Im(a) | ||
Re(b) Im(b) | ||
Re(c) Im(c) | ||
Re(d) Im(d). | ||
|
||
Actually, the arrangement of the white space (blanks, tabs and returns) | ||
is irrelevant, so if you prefer you may write a PSL(2,C) matrix as, say, | ||
|
||
Re(a) Im(a) Re(b) Im(b) | ||
Re(c) Im(c) Re(d) Im(d). | ||
|
||
In O(3,1) the entries of each matrix should be written as | ||
|
||
m00 m01 m02 m03 | ||
m10 m11 m12 m13 | ||
m20 m21 m22 m23 | ||
m30 m31 m32 m33 | ||
|
||
where the 0-th coordinate is the timelike one. Again, the arrangement | ||
of the white space is irrelevant. | ||
|
||
Here are two sample files. | ||
|
||
Sample #1. PSL(2,C) generators for the Borromean rings complement. | ||
|
||
% Generators | ||
6 | ||
0.000000000000000 0.000000000000000 | ||
0.000000000000000 -1.000000000000000 | ||
0.000000000000000 -1.000000000000000 | ||
2.000000000000000 0.000000000000000 | ||
|
||
0.000000000000000 0.000000000000000 | ||
0.000000000000000 1.000000000000000 | ||
0.000000000000000 1.000000000000000 | ||
2.000000000000000 0.000000000000000 | ||
|
||
1.000000000000000 -1.000000000000000 | ||
0.000000000000000 -1.000000000000000 | ||
0.000000000000000 1.000000000000000 | ||
1.000000000000000 1.000000000000000 | ||
|
||
1.000000000000000 -1.000000000000000 | ||
0.000000000000000 1.000000000000000 | ||
0.000000000000000 -1.000000000000000 | ||
1.000000000000000 1.000000000000000 | ||
|
||
1.000000000000000 0.000000000000000 | ||
-2.000000000000000 0.000000000000000 | ||
0.000000000000000 0.000000000000000 | ||
1.000000000000000 0.000000000000000 | ||
|
||
1.000000000000000 0.000000000000000 | ||
0.000000000000000 0.000000000000000 | ||
-2.000000000000000 0.000000000000000 | ||
1.000000000000000 0.000000000000000 | ||
|
||
Sample #2. O(3,1) generators for a mirrored regular ideal tetrahedron. | ||
|
||
% Generators | ||
|
||
4 | ||
|
||
1.25 -0.433012 -0.433012 -0.433012 | ||
0.433012 0.25 -0.75 -0.75 | ||
0.433012 -0.75 0.25 -0.75 | ||
0.433012 -0.75 -0.75 0.25 | ||
|
||
1.25 -0.433012 +0.433012 +0.433012 | ||
0.433012 0.25 +0.75 +0.75 | ||
-0.433012 +0.75 0.25 -0.75 | ||
-0.433012 +0.75 -0.75 0.25 | ||
|
||
1.25 +0.433012 -0.433012 +0.433012 | ||
-0.433012 0.25 +0.75 -0.75 | ||
0.433012 +0.75 0.25 +0.75 | ||
-0.433012 -0.75 +0.75 0.25 | ||
|
||
1.25 +0.433012 +0.433012 -0.433012 | ||
-0.433012 0.25 -0.75 +0.75 | ||
-0.433012 -0.75 0.25 +0.75 | ||
0.433012 +0.75 +0.75 0.25 | ||
|
||
(Note: I truncated sqrt(3)/4 = 0.433012701892219323... to 0.433012 | ||
to fit the above matrices within the width of this window. | ||
If you want to try out this example, please restore the | ||
high-precision value.) |
Oops, something went wrong.