summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/doc/installation.h7
-rw-r--r--src/common/doc/main_page.md5
-rw-r--r--src/common/include/gudhi/Unitary_tests_utils.h12
-rw-r--r--src/common/include/gudhi/random_point_generators.h2
-rw-r--r--src/common/include/gudhi/reader_utils.h10
-rw-r--r--src/common/test/CMakeLists.txt13
6 files changed, 35 insertions, 14 deletions
diff --git a/src/common/doc/installation.h b/src/common/doc/installation.h
index 2e64bef8..ce2c5448 100644
--- a/src/common/doc/installation.h
+++ b/src/common/doc/installation.h
@@ -32,7 +32,10 @@ make \endverbatim
*
* \subsection testsuites Test suites
* To test your build, run the following command in a terminal:
- * \verbatim make test \endverbatim
+ * \verbatim make test \endverbatim
+ * `make test` is using <a href="https://cmake.org/cmake/help/latest/manual/ctest.1.html">Ctest</a> (CMake test driver
+ * program). If some of the tests are failing, please send us the result of the following command:
+ * \verbatim ctest --output-on-failure \endverbatim
*
* \subsection documentationgeneration Documentation
* To generate the documentation, <a target="_blank" href="http://www.doxygen.org/">Doxygen</a> is required.
@@ -71,7 +74,7 @@ make doxygen
* your operating system is detailed here http://doc.cgal.org/latest/Manual/installation.html
*
* The following examples/utilities require the <a target="_blank" href="http://www.cgal.org/">Computational Geometry Algorithms
- * Library</a> (CGAL \cite cgal:eb-15b) and will not be built if CGAL version 4.11.0 or higher is not installed:
+ * Library</a> (CGAL \cite cgal:eb-19b) and will not be built if CGAL version 4.11.0 or higher is not installed:
* \li <a href="_simplex_tree_2example_alpha_shapes_3_simplex_tree_from_off_file_8cpp-example.html">
* Simplex_tree/example_alpha_shapes_3_simplex_tree_from_off_file.cpp</a>
* \li <a href="_witness_complex_2strong_witness_persistence_8cpp-example.html">
diff --git a/src/common/doc/main_page.md b/src/common/doc/main_page.md
index d8cbf97f..0b4bfb7a 100644
--- a/src/common/doc/main_page.md
+++ b/src/common/doc/main_page.md
@@ -43,8 +43,9 @@
The filtration value of each simplex is computed as the square of the circumradius of the simplex if the
circumsphere is empty (the simplex is then said to be Gabriel), and as the minimum of the filtration
values of the codimension 1 cofaces that make it not Gabriel otherwise.
- All simplices that have a filtration value strictly greater than a given alpha squared value are not inserted into
- the complex.<br>
+ All simplices that have a filtration value \f$ > \alpha^2 \f$ are removed from the Delaunay complex
+ when creating the simplicial complex if it is specified.<br>
+ For performances reasons, it is advised to use \ref cgal &ge; 5.0.0.
</td>
<td width="15%">
<b>Author:</b> Vincent Rouvreau<br>
diff --git a/src/common/include/gudhi/Unitary_tests_utils.h b/src/common/include/gudhi/Unitary_tests_utils.h
index 4ad4dae8..9b86460a 100644
--- a/src/common/include/gudhi/Unitary_tests_utils.h
+++ b/src/common/include/gudhi/Unitary_tests_utils.h
@@ -14,6 +14,7 @@
#include <iostream>
#include <limits> // for std::numeric_limits<>
+#include <cmath> // for std::fabs
template<typename FloatingType >
void GUDHI_TEST_FLOAT_EQUALITY_CHECK(FloatingType a, FloatingType b,
@@ -25,4 +26,15 @@ void GUDHI_TEST_FLOAT_EQUALITY_CHECK(FloatingType a, FloatingType b,
BOOST_CHECK(std::fabs(a - b) <= epsilon);
}
+// That's the usual x86 issue where a+b==a+b can return false (without any NaN) because one of them was stored in
+// memory (and thus rounded to 64 bits) while the other is still in a register (80 bits).
+template<typename FloatingType >
+FloatingType GUDHI_PROTECT_FLOAT(FloatingType value) {
+ volatile FloatingType protected_value = value;
+#ifdef DEBUG_TRACES
+ std::cout << "GUDHI_PROTECT_FLOAT - " << protected_value << std::endl;
+#endif
+ return protected_value;
+}
+
#endif // UNITARY_TESTS_UTILS_H_
diff --git a/src/common/include/gudhi/random_point_generators.h b/src/common/include/gudhi/random_point_generators.h
index fb69f832..9dd88ac4 100644
--- a/src/common/include/gudhi/random_point_generators.h
+++ b/src/common/include/gudhi/random_point_generators.h
@@ -21,7 +21,7 @@
// Make compilation fail - required for external projects - https://github.com/GUDHI/gudhi-devel/issues/10
#if CGAL_VERSION_NR < 1041101000
-# error Alpha_complex_3d is only available for CGAL >= 4.11
+# error random_point_generators is only available for CGAL >= 4.11
#endif
namespace Gudhi {
diff --git a/src/common/include/gudhi/reader_utils.h b/src/common/include/gudhi/reader_utils.h
index 98335552..db31bf5c 100644
--- a/src/common/include/gudhi/reader_utils.h
+++ b/src/common/include/gudhi/reader_utils.h
@@ -293,6 +293,9 @@ Note: the function does not check that birth <= death.
**/
template <typename OutputIterator>
void read_persistence_intervals_and_dimension(std::string const& filename, OutputIterator out) {
+#ifdef DEBUG_TRACES
+ std::cout << "read_persistence_intervals_and_dimension - " << filename << std::endl;
+#endif // DEBUG_TRACES
std::ifstream in(filename);
if (!in.is_open()) {
std::string error_str("read_persistence_intervals_and_dimension - Unable to open file ");
@@ -307,6 +310,13 @@ void read_persistence_intervals_and_dimension(std::string const& filename, Outpu
if (line.length() != 0 && line[0] != '#') {
double numbers[4];
int n = sscanf(line.c_str(), "%lf %lf %lf %lf", &numbers[0], &numbers[1], &numbers[2], &numbers[3]);
+#ifdef DEBUG_TRACES
+ std::cout << "[" << n << "] = ";
+ for (int i = 0; i < n; i++) {
+ std::cout << numbers[i] << ",";
+ }
+ std::cout << std::endl;
+#endif // DEBUG_TRACES
if (n >= 2) {
int dim = (n >= 3 ? static_cast<int>(numbers[n - 3]) : -1);
*out++ = std::make_tuple(dim, numbers[n - 2], numbers[n - 1]);
diff --git a/src/common/test/CMakeLists.txt b/src/common/test/CMakeLists.txt
index 0b49fa1e..34de7398 100644
--- a/src/common/test/CMakeLists.txt
+++ b/src/common/test/CMakeLists.txt
@@ -1,15 +1,10 @@
project(Common_tests)
-include(GUDHI_test_coverage)
+include(GUDHI_boost_test)
add_executable ( Common_test_points_off_reader test_points_off_reader.cpp )
-target_link_libraries(Common_test_points_off_reader ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
-
add_executable ( Common_test_distance_matrix_reader test_distance_matrix_reader.cpp )
-target_link_libraries(Common_test_distance_matrix_reader ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
-
add_executable ( Common_test_persistence_intervals_reader test_persistence_intervals_reader.cpp )
-target_link_libraries(Common_test_persistence_intervals_reader ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
# Do not forget to copy test files in current binary dir
file(COPY "${CMAKE_SOURCE_DIR}/data/points/alphacomplexdoc.off" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
@@ -19,6 +14,6 @@ file(COPY "${CMAKE_SOURCE_DIR}/src/common/test/persistence_intervals_with_dimens
file(COPY "${CMAKE_SOURCE_DIR}/src/common/test/persistence_intervals_with_field.pers" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
file(COPY "${CMAKE_SOURCE_DIR}/src/common/test/persistence_intervals_without_dimension.pers" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
-gudhi_add_coverage_test(Common_test_points_off_reader)
-gudhi_add_coverage_test(Common_test_distance_matrix_reader)
-gudhi_add_coverage_test(Common_test_persistence_intervals_reader)
+gudhi_add_boost_test(Common_test_points_off_reader)
+gudhi_add_boost_test(Common_test_distance_matrix_reader)
+gudhi_add_boost_test(Common_test_persistence_intervals_reader)