exact-max-rectangle 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. exact_max_rectangle-0.2.0/.gitattributes +3 -0
  2. exact_max_rectangle-0.2.0/.gitignore +18 -0
  3. exact_max_rectangle-0.2.0/CITATION.cff +38 -0
  4. exact_max_rectangle-0.2.0/CMakeLists.txt +226 -0
  5. exact_max_rectangle-0.2.0/LICENSE +21 -0
  6. exact_max_rectangle-0.2.0/PKG-INFO +605 -0
  7. exact_max_rectangle-0.2.0/README.md +554 -0
  8. exact_max_rectangle-0.2.0/cmake/ChoiDependencies.cmake +17 -0
  9. exact_max_rectangle-0.2.0/cmake/choi_exactConfig.cmake.in +15 -0
  10. exact_max_rectangle-0.2.0/docs/profiling-workflow.md +112 -0
  11. exact_max_rectangle-0.2.0/examples/largest_rectangle/CMakeLists.txt +14 -0
  12. exact_max_rectangle-0.2.0/examples/largest_rectangle/README.md +128 -0
  13. exact_max_rectangle-0.2.0/examples/largest_rectangle/main.cpp +131 -0
  14. exact_max_rectangle-0.2.0/examples/largest_rectangle/plot.py +54 -0
  15. exact_max_rectangle-0.2.0/examples/python/01_basics.py +87 -0
  16. exact_max_rectangle-0.2.0/examples/python/02_plotting.py +305 -0
  17. exact_max_rectangle-0.2.0/examples/python/03_shapely.py +131 -0
  18. exact_max_rectangle-0.2.0/examples/python/04_geopandas_geojson.py +139 -0
  19. exact_max_rectangle-0.2.0/examples/python/05_numpy.py +52 -0
  20. exact_max_rectangle-0.2.0/examples/python/README.md +44 -0
  21. exact_max_rectangle-0.2.0/examples/python/figures/largest_by_type.png +0 -0
  22. exact_max_rectangle-0.2.0/examples/python/figures/largest_rectangle.png +0 -0
  23. exact_max_rectangle-0.2.0/examples/python/figures/scaling.png +0 -0
  24. exact_max_rectangle-0.2.0/examples/python/figures/tied_optima.png +0 -0
  25. exact_max_rectangle-0.2.0/examples/python/test_examples.py +95 -0
  26. exact_max_rectangle-0.2.0/include/choi/algebraic.hpp +1018 -0
  27. exact_max_rectangle-0.2.0/include/choi/area_bounds.hpp +243 -0
  28. exact_max_rectangle-0.2.0/include/choi/containment.hpp +248 -0
  29. exact_max_rectangle-0.2.0/include/choi/double_staircase.hpp +185 -0
  30. exact_max_rectangle-0.2.0/include/choi/event_map.hpp +381 -0
  31. exact_max_rectangle-0.2.0/include/choi/families.hpp +817 -0
  32. exact_max_rectangle-0.2.0/include/choi/general_position.hpp +111 -0
  33. exact_max_rectangle-0.2.0/include/choi/infinitesimal.hpp +99 -0
  34. exact_max_rectangle-0.2.0/include/choi/largest.hpp +686 -0
  35. exact_max_rectangle-0.2.0/include/choi/maintained_staircase.hpp +982 -0
  36. exact_max_rectangle-0.2.0/include/choi/mirror.hpp +56 -0
  37. exact_max_rectangle-0.2.0/include/choi/order_labels.hpp +64 -0
  38. exact_max_rectangle-0.2.0/include/choi/parallel.hpp +124 -0
  39. exact_max_rectangle-0.2.0/include/choi/rotation.hpp +249 -0
  40. exact_max_rectangle-0.2.0/include/choi/staircase.hpp +500 -0
  41. exact_max_rectangle-0.2.0/include/choi/staircase_traversal.hpp +167 -0
  42. exact_max_rectangle-0.2.0/include/choi/sweep_stats.hpp +66 -0
  43. exact_max_rectangle-0.2.0/include/choi/type_a.hpp +99 -0
  44. exact_max_rectangle-0.2.0/include/choi/type_b.hpp +722 -0
  45. exact_max_rectangle-0.2.0/include/choi/type_b3.hpp +643 -0
  46. exact_max_rectangle-0.2.0/include/choi/type_cd.hpp +699 -0
  47. exact_max_rectangle-0.2.0/include/choi/type_f.hpp +1870 -0
  48. exact_max_rectangle-0.2.0/pyproject.toml +105 -0
  49. exact_max_rectangle-0.2.0/python/exact_max_rectangle/__init__.py +320 -0
  50. exact_max_rectangle-0.2.0/python/exact_max_rectangle/_core.pyi +74 -0
  51. exact_max_rectangle-0.2.0/python/exact_max_rectangle/licenses/GPL-3.0.txt +674 -0
  52. exact_max_rectangle-0.2.0/python/exact_max_rectangle/licenses/LGPL-3.0.txt +165 -0
  53. exact_max_rectangle-0.2.0/python/exact_max_rectangle/licenses/LICENSE-OpenBLAS.txt +29 -0
  54. exact_max_rectangle-0.2.0/python/exact_max_rectangle/licenses/LICENSE-nanobind.txt +26 -0
  55. exact_max_rectangle-0.2.0/python/exact_max_rectangle/licenses/THIRD_PARTY_LICENSES.md +62 -0
  56. exact_max_rectangle-0.2.0/python/exact_max_rectangle/py.typed +0 -0
  57. exact_max_rectangle-0.2.0/python/src/bindings.cpp +345 -0
  58. exact_max_rectangle-0.2.0/tests/b_reference.hpp +585 -0
  59. exact_max_rectangle-0.2.0/tests/bench/pr_rings.txt +24 -0
  60. exact_max_rectangle-0.2.0/tests/check_b1_pinwheel_ends.cpp +219 -0
  61. exact_max_rectangle-0.2.0/tests/check_e2_witness.cpp +100 -0
  62. exact_max_rectangle-0.2.0/tests/choi_benchmark.cpp +595 -0
  63. exact_max_rectangle-0.2.0/tests/compare_family_maxima.hpp +20 -0
  64. exact_max_rectangle-0.2.0/tests/corpus/README.md +76 -0
  65. exact_max_rectangle-0.2.0/tests/corpus/convex_reference/README.md +28 -0
  66. exact_max_rectangle-0.2.0/tests/corpus/convex_reference/reference.csv +301 -0
  67. exact_max_rectangle-0.2.0/tests/corpus/convex_reference/rings.txt +600 -0
  68. exact_max_rectangle-0.2.0/tests/corpus/realistic/README.md +116 -0
  69. exact_max_rectangle-0.2.0/tests/corpus/realistic/corpus.json +4625 -0
  70. exact_max_rectangle-0.2.0/tests/corpus/realistic/projectmir_reference.jsonl +86 -0
  71. exact_max_rectangle-0.2.0/tests/corpus/realistic_manifest.json +660 -0
  72. exact_max_rectangle-0.2.0/tests/event_catalogue.hpp +140 -0
  73. exact_max_rectangle-0.2.0/tests/experiment_assembly.cpp +171 -0
  74. exact_max_rectangle-0.2.0/tests/experiment_collinear.cpp +228 -0
  75. exact_max_rectangle-0.2.0/tests/experiment_f_feasibility.cpp +88 -0
  76. exact_max_rectangle-0.2.0/tests/experiment_largest.cpp +123 -0
  77. exact_max_rectangle-0.2.0/tests/experiment_largest_f.cpp +90 -0
  78. exact_max_rectangle-0.2.0/tests/experiment_singletons.cpp +308 -0
  79. exact_max_rectangle-0.2.0/tests/experiment_type_bounds.cpp +132 -0
  80. exact_max_rectangle-0.2.0/tests/notched_ring.hpp +51 -0
  81. exact_max_rectangle-0.2.0/tests/package_consumer/CMakeLists.txt +10 -0
  82. exact_max_rectangle-0.2.0/tests/package_consumer/main.cpp +10 -0
  83. exact_max_rectangle-0.2.0/tests/pattern_reference.hpp +1164 -0
  84. exact_max_rectangle-0.2.0/tests/python/test_python_api.py +786 -0
  85. exact_max_rectangle-0.2.0/tests/rect_signature.hpp +187 -0
  86. exact_max_rectangle-0.2.0/tests/singleton_boundary_cases.hpp +108 -0
  87. exact_max_rectangle-0.2.0/tests/test_algebraic.cpp +286 -0
  88. exact_max_rectangle-0.2.0/tests/test_algebraic_rays.cpp +92 -0
  89. exact_max_rectangle-0.2.0/tests/test_area_bounds.cpp +75 -0
  90. exact_max_rectangle-0.2.0/tests/test_b_reference.cpp +354 -0
  91. exact_max_rectangle-0.2.0/tests/test_cde_vs_reference.cpp +305 -0
  92. exact_max_rectangle-0.2.0/tests/test_coincident_events.cpp +159 -0
  93. exact_max_rectangle-0.2.0/tests/test_convex_reference.py +76 -0
  94. exact_max_rectangle-0.2.0/tests/test_double_staircase.cpp +207 -0
  95. exact_max_rectangle-0.2.0/tests/test_event_catalogue.cpp +81 -0
  96. exact_max_rectangle-0.2.0/tests/test_general_corpus.py +367 -0
  97. exact_max_rectangle-0.2.0/tests/test_general_position.cpp +218 -0
  98. exact_max_rectangle-0.2.0/tests/test_largest.cpp +199 -0
  99. exact_max_rectangle-0.2.0/tests/test_maintained_staircase.cpp +321 -0
  100. exact_max_rectangle-0.2.0/tests/test_order_labels.cpp +95 -0
  101. exact_max_rectangle-0.2.0/tests/test_parallel.cpp +115 -0
  102. exact_max_rectangle-0.2.0/tests/test_pattern_reference.cpp +484 -0
  103. exact_max_rectangle-0.2.0/tests/test_perf_hotspots.py +180 -0
  104. exact_max_rectangle-0.2.0/tests/test_profile_archive.py +370 -0
  105. exact_max_rectangle-0.2.0/tests/test_profile_runner.py +973 -0
  106. exact_max_rectangle-0.2.0/tests/test_realistic_corpus.py +89 -0
  107. exact_max_rectangle-0.2.0/tests/test_regressions.cpp +425 -0
  108. exact_max_rectangle-0.2.0/tests/test_release_helper.py +200 -0
  109. exact_max_rectangle-0.2.0/tests/test_shared_families.cpp +83 -0
  110. exact_max_rectangle-0.2.0/tests/test_staircase.cpp +120 -0
  111. exact_max_rectangle-0.2.0/tests/test_staircase_construction.cpp +117 -0
  112. exact_max_rectangle-0.2.0/tests/test_staircase_traversal.cpp +100 -0
  113. exact_max_rectangle-0.2.0/tests/test_ties.cpp +109 -0
  114. exact_max_rectangle-0.2.0/tests/test_type_a.cpp +129 -0
  115. exact_max_rectangle-0.2.0/tests/test_type_b1.cpp +211 -0
  116. exact_max_rectangle-0.2.0/tests/test_type_b2.cpp +162 -0
  117. exact_max_rectangle-0.2.0/tests/test_type_b3.cpp +337 -0
  118. exact_max_rectangle-0.2.0/tests/test_type_cd.cpp +175 -0
  119. exact_max_rectangle-0.2.0/tests/test_type_f.cpp +624 -0
  120. exact_max_rectangle-0.2.0/tests/witness_staircase.cpp +186 -0
  121. exact_max_rectangle-0.2.0/tools/b3_midpoint_search.py +51 -0
  122. exact_max_rectangle-0.2.0/tools/benchmark.py +154 -0
  123. exact_max_rectangle-0.2.0/tools/compare_pr_benchmark.py +112 -0
  124. exact_max_rectangle-0.2.0/tools/compare_projectmir.py +72 -0
  125. exact_max_rectangle-0.2.0/tools/compare_projectmir_results.py +106 -0
  126. exact_max_rectangle-0.2.0/tools/convex_reference.py +268 -0
  127. exact_max_rectangle-0.2.0/tools/general_corpus.py +996 -0
  128. exact_max_rectangle-0.2.0/tools/perf_hotspots.py +279 -0
  129. exact_max_rectangle-0.2.0/tools/profile_archive.py +532 -0
  130. exact_max_rectangle-0.2.0/tools/profile_runner.py +1529 -0
  131. exact_max_rectangle-0.2.0/tools/prs-release.sha256 +4 -0
  132. exact_max_rectangle-0.2.0/tools/python/build_deps_linux.sh +105 -0
  133. exact_max_rectangle-0.2.0/tools/python/build_deps_macos.sh +30 -0
  134. exact_max_rectangle-0.2.0/tools/realistic_corpus.py +247 -0
  135. exact_max_rectangle-0.2.0/tools/release_helper.py +532 -0
@@ -0,0 +1,3 @@
1
+ * text=auto eol=lf
2
+ *.png binary
3
+ *.pdf binary
@@ -0,0 +1,18 @@
1
+ build/
2
+ build-*/
3
+ *.exe
4
+ *.o
5
+ *.obj
6
+ .vscode/
7
+ .idea/
8
+ __pycache__/
9
+ *.pyc
10
+ # Local run outputs (rings files, results) and local copies of the papers
11
+ *.log
12
+ /rings*.txt
13
+ /ours*.txt
14
+ /results*.csv
15
+ /corpus*.csv
16
+ *.pdf
17
+ # Local to-do list (not published)
18
+ TODO.local.md
@@ -0,0 +1,38 @@
1
+ cff-version: 1.2.0
2
+ message: "If you use this software, please cite it, and the paper whose algorithm it implements, as below."
3
+ title: "exact-max-rectangle: an exact implementation of Choi, Lee and Ahn's maximum-area rectangle algorithm"
4
+ authors:
5
+ - family-names: Goodstein
6
+ given-names: Daniel
7
+ license: MIT
8
+ version: 0.2.0
9
+ repository-code: "https://github.com/DanielJG123/exact-max-rectangle"
10
+ preferred-citation:
11
+ type: article
12
+ title: "Maximum-area and maximum-perimeter rectangles in polygons"
13
+ authors:
14
+ - family-names: Choi
15
+ given-names: Yujin
16
+ - family-names: Lee
17
+ given-names: Seungjun
18
+ - family-names: Ahn
19
+ given-names: Hee-Kap
20
+ journal: "Computational Geometry: Theory and Applications"
21
+ volume: 94
22
+ start: 101710
23
+ year: 2021
24
+ doi: "10.1016/j.comgeo.2020.101710"
25
+ references:
26
+ - type: article
27
+ title: "A pedestrian approach to ray shooting: Shoot a ray, take a walk"
28
+ authors:
29
+ - family-names: Hershberger
30
+ given-names: John
31
+ - family-names: Suri
32
+ given-names: Subhash
33
+ journal: "Journal of Algorithms"
34
+ volume: 18
35
+ issue: 3
36
+ start: 403
37
+ end: 431
38
+ year: 1995
@@ -0,0 +1,226 @@
1
+ cmake_minimum_required(VERSION 3.18)
2
+ project(choi_exact VERSION 0.2.0 LANGUAGES CXX)
3
+ include(GNUInstallDirs)
4
+ include(CMakePackageConfigHelpers)
5
+ if(POLICY CMP0167)
6
+ cmake_policy(SET CMP0167 NEW) # find_package(Boost) uses Boost's own CMake config
7
+ endif()
8
+
9
+ option(CHOI_BUILD_TESTS "Build the tests" ON)
10
+ option(CHOI_FAST_TESTS "Compile the test suite at -O1: about a third faster to build, at most a few percent slower to run" OFF)
11
+ option(CHOI_BUILD_PYTHON "Build the exact_max_rectangle Python extension module (issue #48)" OFF)
12
+ set(PRS_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../pedestrian-ray-shooting" CACHE PATH
13
+ "Local checkout of pedestrian-ray-shooting (fetched from GitHub if absent)")
14
+ set(PROJECTMIR_SRC "${CMAKE_CURRENT_SOURCE_DIR}/../ProjectMIR/cpp/src" CACHE PATH
15
+ "Optional: sources of ProjectMIR, an earlier exact solver (not public), for a cross-check in test_algebraic")
16
+
17
+ if(NOT CHOI_BUILD_TESTS AND NOT TARGET prs::prs AND NOT EXISTS "${PRS_SOURCE_DIR}/CMakeLists.txt")
18
+ find_package(pedestrian_ray_shooting 0.2.1 CONFIG QUIET)
19
+ endif()
20
+ if(NOT TARGET prs::prs)
21
+ set(PRS_BUILD_TESTS OFF)
22
+ set(PRS_BUILD_TOOLS OFF)
23
+ if(EXISTS "${PRS_SOURCE_DIR}/CMakeLists.txt")
24
+ add_subdirectory("${PRS_SOURCE_DIR}" prs EXCLUDE_FROM_ALL)
25
+ else()
26
+ include(FetchContent)
27
+ FetchContent_Declare(prs
28
+ GIT_REPOSITORY https://github.com/DanielJG123/pedestrian-ray-shooting.git
29
+ GIT_TAG 8c4e5962b5a4efffa617d3fba3e7f15522e2a6d9) # v0.2.1
30
+ FetchContent_MakeAvailable(prs)
31
+ set(PRS_SOURCE_DIR "${prs_SOURCE_DIR}") # its tests/ holds helpers the tests include
32
+ # Match the local checkout path: consumers install ray shooting separately.
33
+ set_property(DIRECTORY "${PRS_SOURCE_DIR}" PROPERTY EXCLUDE_FROM_ALL ON)
34
+ endif()
35
+ endif()
36
+
37
+ find_package(Threads REQUIRED)
38
+ include(cmake/ChoiDependencies.cmake)
39
+ if(NOT TARGET choi::dependencies)
40
+ message(FATAL_ERROR "choi_exact requires the FLINT 3 and MPFR development files")
41
+ endif()
42
+
43
+ add_library(choi INTERFACE)
44
+ add_library(choi::choi ALIAS choi)
45
+ target_include_directories(choi INTERFACE
46
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
47
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
48
+ target_link_libraries(choi INTERFACE choi::dependencies)
49
+ target_compile_features(choi INTERFACE cxx_std_17)
50
+
51
+ if(NOT CHOI_BUILD_PYTHON)
52
+ set(choi_config_dir "${CMAKE_INSTALL_LIBDIR}/cmake/choi_exact")
53
+ configure_package_config_file(cmake/choi_exactConfig.cmake.in
54
+ "${CMAKE_CURRENT_BINARY_DIR}/choi_exactConfig.cmake"
55
+ INSTALL_DESTINATION "${choi_config_dir}")
56
+ write_basic_package_version_file(
57
+ "${CMAKE_CURRENT_BINARY_DIR}/choi_exactConfigVersion.cmake"
58
+ COMPATIBILITY SameMinorVersion
59
+ ARCH_INDEPENDENT)
60
+
61
+ install(DIRECTORY include/choi DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
62
+ install(TARGETS choi EXPORT ChoiExactTargets)
63
+ install(EXPORT ChoiExactTargets NAMESPACE choi:: DESTINATION "${choi_config_dir}")
64
+ install(FILES
65
+ "${CMAKE_CURRENT_BINARY_DIR}/choi_exactConfig.cmake"
66
+ "${CMAKE_CURRENT_BINARY_DIR}/choi_exactConfigVersion.cmake"
67
+ cmake/ChoiDependencies.cmake
68
+ DESTINATION "${choi_config_dir}")
69
+ install(FILES LICENSE DESTINATION "${CMAKE_INSTALL_DOCDIR}")
70
+ endif()
71
+
72
+ if(CHOI_BUILD_PYTHON)
73
+ find_package(Python 3.9 REQUIRED COMPONENTS Interpreter Development.Module)
74
+ execute_process(
75
+ COMMAND "${Python_EXECUTABLE}" -m nanobind --cmake_dir
76
+ OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE _choi_nb_dir
77
+ RESULT_VARIABLE _choi_nb_rc
78
+ ERROR_QUIET)
79
+ if(_choi_nb_rc EQUAL 0 AND EXISTS "${_choi_nb_dir}")
80
+ list(PREPEND CMAKE_PREFIX_PATH "${_choi_nb_dir}")
81
+ endif()
82
+ find_package(nanobind CONFIG QUIET)
83
+ if(NOT nanobind_FOUND)
84
+ include(FetchContent)
85
+ FetchContent_Declare(nanobind
86
+ GIT_REPOSITORY https://github.com/wjakob/nanobind.git
87
+ GIT_TAG v2.4.0)
88
+ FetchContent_MakeAvailable(nanobind)
89
+ endif()
90
+ nanobind_add_module(_core NB_STATIC NOMINSIZE python/src/bindings.cpp)
91
+ target_link_libraries(_core PRIVATE choi::choi)
92
+ if(NOT MSVC)
93
+ target_compile_options(_core PRIVATE -Wall -Wextra)
94
+ endif()
95
+ install(TARGETS _core LIBRARY DESTINATION exact_max_rectangle RUNTIME DESTINATION exact_max_rectangle)
96
+ endif()
97
+
98
+ if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
99
+ set(CPACK_GENERATOR "TGZ")
100
+ set(CPACK_PACKAGE_NAME "exact-max-rectangle")
101
+ set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${PROJECT_VERSION}")
102
+ set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
103
+ include(CPack)
104
+ endif()
105
+
106
+ if(CHOI_BUILD_TESTS)
107
+ if(NOT EXISTS "${PRS_SOURCE_DIR}/tests/polygons.hpp")
108
+ message(FATAL_ERROR "CHOI_BUILD_TESTS requires PRS_SOURCE_DIR to point to the ray-shooting sources")
109
+ endif()
110
+ enable_testing()
111
+ set(split_tests test_b_reference test_pattern_reference test_parallel test_shared_families test_largest test_ties)
112
+ set(tests test_algebraic test_algebraic_rays test_staircase test_event_catalogue test_maintained_staircase test_double_staircase test_staircase_construction test_coincident_events test_order_labels test_b_reference test_type_a test_type_b1 test_type_b2 test_type_b3 test_type_cd test_type_f test_pattern_reference test_largest test_area_bounds test_shared_families test_parallel test_ties test_general_position test_regressions)
113
+ foreach(t ${tests})
114
+ add_executable(${t} tests/${t}.cpp)
115
+ target_link_libraries(${t} PRIVATE choi::choi)
116
+ target_include_directories(${t} PRIVATE ${PRS_SOURCE_DIR}/tests)
117
+ if(NOT MSVC)
118
+ target_compile_options(${t} PRIVATE -Wall -Wextra)
119
+ if(CHOI_FAST_TESTS)
120
+ target_compile_options(${t} PRIVATE -O1) # after the build type's -O3, so it wins
121
+ endif()
122
+ endif()
123
+ if(t STREQUAL "test_type_f")
124
+ add_test(NAME ${t} COMMAND ${t} 7 3)
125
+ elseif(NOT t IN_LIST split_tests)
126
+ add_test(NAME ${t} COMMAND ${t})
127
+ endif()
128
+ endforeach()
129
+ # Issue #61: invalid selectors must fail, not run zero checks and pass (each exits at once).
130
+ add_test(NAME test_type_cd_rejects_index COMMAND test_type_cd 3 C 3)
131
+ add_test(NAME test_type_cd_rejects_type COMMAND test_type_cd 3 X)
132
+ add_test(NAME test_type_cd_rejects_count COMMAND test_type_cd three)
133
+ set_tests_properties(test_type_cd_rejects_index test_type_cd_rejects_type test_type_cd_rejects_count PROPERTIES WILL_FAIL TRUE)
134
+ # Issue #61: the advertised count range holds at its boundary; the selected polygon runs alone.
135
+ add_test(NAME test_type_cd_boundary_count COMMAND test_type_cd 2147483647 C 2147483646)
136
+ # The heaviest tests run as one entry per polygon (or two halves): the same checks as one
137
+ # run of their default, spread over the cores by ctest -j (issue #8). COST (seconds alone,
138
+ # roughly) makes ctest start the longest first, before it has timings of its own.
139
+ foreach(s 0 1 2)
140
+ add_test(NAME test_b_reference_${s} COMMAND test_b_reference 3 ${s})
141
+ add_test(NAME test_pattern_reference_${s} COMMAND test_pattern_reference 3 ${s})
142
+ add_test(NAME test_parallel_${s} COMMAND test_parallel 3 8 ${s})
143
+ endforeach()
144
+ add_test(NAME test_parallel_convex COMMAND test_parallel --convex 8)
145
+ foreach(s 0 1 2 3 4 5)
146
+ add_test(NAME test_shared_families_${s} COMMAND test_shared_families 6 ${s})
147
+ endforeach()
148
+ foreach(s 0 1)
149
+ add_test(NAME test_largest_${s} COMMAND test_largest 2 ${s})
150
+ endforeach()
151
+ add_test(NAME test_ties_0_to_2 COMMAND test_ties 3 4 0)
152
+ add_test(NAME test_ties_3_to_5 COMMAND test_ties 6 4 3)
153
+ set_tests_properties(test_pattern_reference_0 PROPERTIES COST 80)
154
+ set_tests_properties(test_type_f test_ties_0_to_2 test_ties_3_to_5 PROPERTIES COST 60)
155
+ set_tests_properties(test_b_reference_0 test_b_reference_1 test_b_reference_2 PROPERTIES COST 40)
156
+ # A quick tier for edits in progress: ctest -L quick (a few seconds each).
157
+ set_tests_properties(test_algebraic test_algebraic_rays test_staircase test_order_labels test_type_a test_area_bounds
158
+ test_type_b3 test_type_cd test_coincident_events test_general_position test_type_b2 test_type_b1 test_regressions
159
+ PROPERTIES LABELS quick)
160
+ find_package(Python3 COMPONENTS Interpreter QUIET)
161
+ if(Python3_Interpreter_FOUND)
162
+ add_test(NAME test_general_corpus COMMAND ${Python3_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/tests/test_general_corpus.py")
163
+ add_test(NAME test_profile_runner COMMAND ${Python3_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/tests/test_profile_runner.py")
164
+ add_test(NAME test_profile_archive COMMAND ${Python3_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/tests/test_profile_archive.py")
165
+ add_test(NAME check_profile_archive COMMAND ${Python3_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/tools/profile_archive.py" check)
166
+ add_test(NAME test_perf_hotspots COMMAND ${Python3_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/tests/test_perf_hotspots.py")
167
+ add_test(NAME test_realistic_corpus COMMAND ${Python3_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/tests/test_realistic_corpus.py")
168
+ add_test(NAME test_convex_reference COMMAND ${Python3_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/tests/test_convex_reference.py")
169
+ set_tests_properties(test_general_corpus test_profile_runner test_profile_archive check_profile_archive
170
+ test_perf_hotspots test_realistic_corpus test_convex_reference PROPERTIES LABELS quick)
171
+ endif()
172
+ add_executable(check_b1_pinwheel_ends EXCLUDE_FROM_ALL tests/check_b1_pinwheel_ends.cpp)
173
+ target_link_libraries(check_b1_pinwheel_ends PRIVATE choi::choi)
174
+ target_include_directories(check_b1_pinwheel_ends PRIVATE ${PRS_SOURCE_DIR}/tests)
175
+ add_executable(experiment_f_feasibility EXCLUDE_FROM_ALL tests/experiment_f_feasibility.cpp)
176
+ target_link_libraries(experiment_f_feasibility PRIVATE choi::choi)
177
+ target_include_directories(experiment_f_feasibility PRIVATE ${PRS_SOURCE_DIR}/tests)
178
+ # Production C, D and E against the pattern reference (heavy; more polygons by hand). The
179
+ # suite runs it on polygon 2, the dedicated D2 witness (review 5).
180
+ add_executable(test_cde_vs_reference tests/test_cde_vs_reference.cpp)
181
+ target_link_libraries(test_cde_vs_reference PRIVATE choi::choi)
182
+ target_include_directories(test_cde_vs_reference PRIVATE ${PRS_SOURCE_DIR}/tests)
183
+ add_test(NAME test_cde_vs_reference_2 COMMAND test_cde_vs_reference 3 2)
184
+ set_tests_properties(test_cde_vs_reference_2 PROPERTIES COST 60)
185
+ # The B3 witness of spec/03 3.18 against the pattern reference.
186
+ add_executable(check_e2_witness EXCLUDE_FROM_ALL tests/check_e2_witness.cpp)
187
+ target_link_libraries(check_e2_witness PRIVATE choi::choi)
188
+ target_include_directories(check_e2_witness PRIVATE ${PRS_SOURCE_DIR}/tests)
189
+ add_executable(experiment_largest_f EXCLUDE_FROM_ALL tests/experiment_largest_f.cpp)
190
+ target_link_libraries(experiment_largest_f PRIVATE choi::choi)
191
+ target_include_directories(experiment_largest_f PRIVATE ${PRS_SOURCE_DIR}/tests)
192
+ add_executable(choi_benchmark EXCLUDE_FROM_ALL tests/choi_benchmark.cpp)
193
+ target_link_libraries(choi_benchmark PRIVATE choi::choi)
194
+ # Issue #3: the solvers on collinear input, against the perturbation limit.
195
+ add_executable(experiment_collinear EXCLUDE_FROM_ALL tests/experiment_collinear.cpp)
196
+ target_link_libraries(experiment_collinear PRIVATE choi::choi)
197
+ target_include_directories(experiment_collinear PRIVATE ${PRS_SOURCE_DIR}/tests)
198
+ # Issue #42: polygons with isolated feasible orientations, solvers against the references.
199
+ add_executable(experiment_singletons EXCLUDE_FROM_ALL tests/experiment_singletons.cpp)
200
+ target_link_libraries(experiment_singletons PRIVATE choi::choi)
201
+ target_include_directories(experiment_singletons PRIVATE ${PRS_SOURCE_DIR}/tests)
202
+ add_executable(experiment_largest EXCLUDE_FROM_ALL tests/experiment_largest.cpp)
203
+ target_link_libraries(experiment_largest PRIVATE choi::choi)
204
+ target_include_directories(experiment_largest PRIVATE ${PRS_SOURCE_DIR}/tests)
205
+ add_executable(experiment_assembly EXCLUDE_FROM_ALL tests/experiment_assembly.cpp)
206
+ target_link_libraries(experiment_assembly PRIVATE choi::choi)
207
+ add_executable(experiment_type_bounds EXCLUDE_FROM_ALL tests/experiment_type_bounds.cpp)
208
+ target_link_libraries(experiment_type_bounds PRIVATE choi::choi)
209
+ target_include_directories(experiment_type_bounds PRIVATE ${PRS_SOURCE_DIR}/tests)
210
+ # Experiments on the staircase construction, separate from the suite.
211
+ add_executable(experiment_staircase_traversal EXCLUDE_FROM_ALL tests/test_staircase_traversal.cpp)
212
+ target_link_libraries(experiment_staircase_traversal PRIVATE choi::choi)
213
+ target_include_directories(experiment_staircase_traversal PRIVATE ${PRS_SOURCE_DIR}/tests)
214
+ add_executable(experiment_staircase_witness EXCLUDE_FROM_ALL tests/witness_staircase.cpp)
215
+ target_link_libraries(experiment_staircase_witness PRIVATE choi::choi)
216
+ target_include_directories(experiment_staircase_witness PRIVATE ${PRS_SOURCE_DIR}/tests)
217
+ if(EXISTS "${PROJECTMIR_SRC}/event_angle.hpp")
218
+ find_package(Boost 1.70 REQUIRED)
219
+ target_include_directories(test_algebraic PRIVATE ${PROJECTMIR_SRC})
220
+ target_link_libraries(test_algebraic PRIVATE Boost::headers)
221
+ target_compile_definitions(test_algebraic PRIVATE CHOI_CROSSCHECK_PROJECTMIR=1)
222
+ endif()
223
+ # Experiments, references beyond the suite, and the benchmark are not in the default build
224
+ # (issue #8): cmake --build build --target experiments (or one of them by name).
225
+ add_custom_target(experiments DEPENDS experiment_collinear experiment_singletons check_b1_pinwheel_ends experiment_f_feasibility check_e2_witness experiment_largest_f choi_benchmark experiment_largest experiment_assembly experiment_type_bounds experiment_staircase_traversal experiment_staircase_witness)
226
+ endif()
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Daniel Goodstein
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.