Skip to content

Commit

Permalink
fix bug in Triangulations, caused by version change of Topcom. Tests …
Browse files Browse the repository at this point in the history
…added to check this.
  • Loading branch information
mikestillman committed Oct 25, 2024
1 parent cb15bd0 commit 550085b
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 10 deletions.
45 changes: 43 additions & 2 deletions M2/BUILD/mike/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,49 @@ BREWPREFIX := `brew --prefix`
## cmake build files ##
#######################

cmake-appleclang:
echo "git branch is " $(BRANCH)
mkdir -p builds.tmp/cmake-appleclang
cd builds.tmp/cmake-appleclang; cmake \
-GNinja \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_PREFIX_PATH="`brew --prefix libffi`" \
-DBUILD_NATIVE=off \
-DCMAKE_INSTALL_PREFIX=`pwd`/installed \
-DBUILD_TESTING=on \
-DBUILD_DOCS=on \
-DCMAKE_EXPORT_COMPILE_COMMANDS=true \
../../../..

cmake-clang:
echo "git branch is " $(BRANCH)
mkdir -p builds.tmp/cmake-clang
cd builds.tmp/cmake-clang; cmake \
-GNinja \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DBUILD_TESTING=on \
-DCMAKE_C_COMPILER="`brew --prefix llvm`/bin/clang" \
-DCMAKE_CXX_COMPILER="`brew --prefix llvm`/bin/clang++" \
-DBUILD_DOCS=on \
-DBUILD_NATIVE=off \
-DCMAKE_EXPORT_COMPILE_COMMANDS=true \
../../../..

cmake-gcc14:
mkdir -p builds.tmp/cmake-gcc14
cd builds.tmp/cmake-gcc14; cmake \
-GNinja \
-DCMAKE_C_COMPILER:FILEPATH=/opt/homebrew/opt/gcc/bin/gcc-14 \
-DCMAKE_CXX_COMPILER:FILEPATH=/opt/homebrew/opt/gcc/bin/g++-14 \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DBUILD_TESTING=on \
-DBUILD_DOCS=on \
../../../..

## clean up or remove all below here
## grab debug builds, autotools builds, profile builds (on linux at leasst)


cmake-make-appleclang:
echo "git branch is " $(BRANCH)
mkdir -p builds.tmp/cmake-make-appleclang-$(BRANCH)
Expand Down Expand Up @@ -59,8 +102,6 @@ cmake-appleclang:
-DBUILD_DOCS=on \
../../../..

# -DCMAKE_PREFIX_PATH="`brew --prefix tbb@2021`;`brew --prefix libffi`;`brew --prefix`" \
cmake-debug-appleclang:
mkdir -p builds.tmp/cmake-debug-appleclang
cd builds.tmp/cmake-debug-appleclang; cmake \
Expand Down
16 changes: 8 additions & 8 deletions M2/Macaulay2/packages/Triangulations.m2
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
newPackage(
"Triangulations",
Version => "0.1",
Date => "13 Nov 2022",
Version => "0.2",
Date => "25 Oct 2024",
Authors => {{
Name => "Mike Stillman",
Email => "[email protected]",
Expand Down Expand Up @@ -352,7 +352,7 @@ link(List, List) := (tau, triangulation) -> (

flips = method(Options => options topcomFlips)
flips Triangulation := List => opts -> T -> (
first topcomFlips(matrix T, max T, Homogenize => false, RegularOnly => opts.RegularOnly) -- TODO: "first" here is a hack, until topcom version is set.
topcomFlips(matrix T, max T, Homogenize => false, RegularOnly => opts.RegularOnly)
)

bistellarFlip = method()
Expand Down Expand Up @@ -875,8 +875,9 @@ TEST ///
T = regularFineTriangulation A
naiveIsTriangulation T -- TODO: doc this, and allow A to be homogenized? Same with topcomIsTriangulation
-- XX
flips T -- not really functional. Returns internal stuff. I don't understand the format...
assert(set flips T === set{{{0, 3}, {4}}, {{1, 2}, {4}}})
orientedCircuits A
assert isSubset(flips T, orientedCircuits A)
orientedCocircuits A
chirotope A
assert(naiveChirotopeString A === chirotopeString A)
Expand Down Expand Up @@ -1117,7 +1118,6 @@ TEST ///
needsPackage "Triangulations"
*-
debug needsPackage "Topcom"
topcompath = "/opt/homebrew/bin/"

-- this tests construction of the chirotope.
A = transpose matrix"0,0;1,1;3,1;5,0;1,5"
Expand All @@ -1137,17 +1137,17 @@ TEST ///
-- assert(tri/sort//sort == ({{0, 1, 2}, {0, 2, 3}, {1, 2, 4}, {0, 1, 4}, {2, 3, 4}})/sort//sort)

-- now find the possible flips. Can we get topcom to do the flips?
flips T -- output needs to change.
assert(set flips T === set {{{0, 2, 4}, {1}}, {{1, 3}, {0, 2}}})
assert(isSubset((flips T)/sort, (orientedCircuits A)/sort))
-- I don't see how to get topcom to use these though.
///

TEST ///
-*
-- XXX current test being worked on
restart
needsPackage "Triangulations"
*-
-- test if bistellar flips code.
-- test of bistellar flips code.

-- example 1.
debug needsPackage "Topcom"
Expand Down

0 comments on commit 550085b

Please sign in to comment.