summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/points/generator/CMakeLists.txt2
-rw-r--r--data/points/generator/hypergenerator.cpp9
-rwxr-xr-xscripts/generate_version.sh20
-rw-r--r--src/Doxyfile8
-rw-r--r--src/GudhUI/CMakeLists.txt17
-rw-r--r--src/Persistent_cohomology/example/CMakeLists.txt7
-rw-r--r--src/Simplex_tree/test/simplex_tree_unit_test.cpp74
7 files changed, 108 insertions, 29 deletions
diff --git a/data/points/generator/CMakeLists.txt b/data/points/generator/CMakeLists.txt
index 0f2674c4..0d045450 100644
--- a/data/points/generator/CMakeLists.txt
+++ b/data/points/generator/CMakeLists.txt
@@ -21,6 +21,6 @@ if(CGAL_FOUND)
add_test(hypergenerator_in_cube_50000_2 ${CMAKE_CURRENT_BINARY_DIR}/hypergenerator in cube inCube.off 50000 3)
endif()
else()
- message(WARNING "CGAL version: ${CGAL_VERSION} is too old to compile Alpha shapes feature. Version 4.6.0 is required.")
+ message(WARNING "CGAL version: ${CGAL_VERSION} is too old to compile hypergenerator. Version 4.6.0 is required.")
endif ()
endif()
diff --git a/data/points/generator/hypergenerator.cpp b/data/points/generator/hypergenerator.cpp
index f4ea6b07..32ef450d 100644
--- a/data/points/generator/hypergenerator.cpp
+++ b/data/points/generator/hypergenerator.cpp
@@ -86,8 +86,13 @@ int main(int argc, char **argv) {
}
std::ofstream diagram_out(argv[3]);
- diagram_out << "OFF" << std::endl;
- diagram_out << points_number << " 0 0" << std::endl;
+ if (dimension == 3) {
+ diagram_out << "OFF" << std::endl;
+ diagram_out << points_number << " 0 0" << std::endl;
+ } else {
+ diagram_out << "nOFF" << std::endl;
+ diagram_out << dimension << " " << points_number << " 0 0" << std::endl;
+ }
if (diagram_out.is_open()) {
// Instanciate a random point generator
diff --git a/scripts/generate_version.sh b/scripts/generate_version.sh
index 4d28cf53..e7575282 100755
--- a/scripts/generate_version.sh
+++ b/scripts/generate_version.sh
@@ -2,6 +2,8 @@
#usage bash generate_version.sh : dont generate if svn st non empty
#usage bash generate_version.sh -f : generate even if svn is empty
#usage bash generate_version.sh -f DIR : generate even if svn is empty and save library in dir
+#
+# 23/06/2015 - Remove source, add biblio, and doc
# VERSION CHECK
ROOT_DIR=..
VERSION_FILE="$ROOT_DIR/Version.txt"
@@ -48,11 +50,13 @@ cp $ROOT_DIR/COPYING $VERSION_DIR
cp -R $ROOT_DIR/data $VERSION_DIR
cp $ROOT_DIR/src/CMakeLists.txt $VERSION_DIR
cp $ROOT_DIR/src/Doxyfile $VERSION_DIR
+cp -R $ROOT_DIR/biblio $VERSION_DIR
# PACKAGE LEVEL COPY
PACKAGE_INC_DIR="/include"
-PACKAGE_SRC_DIR="/source"
+#PACKAGE_SRC_DIR="/source"
PACKAGE_EX_DIR="/example"
+PACKAGE_DOC_DIR="/doc"
for package in `ls $ROOT_DIR/src/`
do
echo $package
@@ -77,20 +81,16 @@ do
fi
cp -R $ROOT_DIR/src/$package$PACKAGE_INC_DIR/* $VERSION_DIR$PACKAGE_INC_DIR/
fi
- if [ -d "$ROOT_DIR/src/$package$PACKAGE_SRC_DIR" ]
- then
- if [ ! -d "$VERSION_DIR$PACKAGE_SRC_DIR" ]
- then
- # MUST CREATE DIRECTORY ON FIRST LOOP
- mkdir $VERSION_DIR$PACKAGE_INC_DIR
- fi
- cp -R $ROOT_DIR/src/$package$PACKAGE_SRC_DIR/* $VERSION_DIR$PACKAGE_SRC_DIR/
- fi
if [ -d "$ROOT_DIR/src/$package$PACKAGE_EX_DIR" ]
then
mkdir -p $VERSION_DIR$PACKAGE_EX_DIR/$package
cp -R $ROOT_DIR/src/$package$PACKAGE_EX_DIR/* $VERSION_DIR$PACKAGE_EX_DIR/$package
fi
+ if [ -d "$ROOT_DIR/src/$package$PACKAGE_DOC_DIR" ]
+ then
+ mkdir -p $VERSION_DIR$PACKAGE_DOC_DIR/$package
+ cp -R $ROOT_DIR/src/$package$PACKAGE_DOC_DIR/* $VERSION_DIR$PACKAGE_DOC_DIR/$package
+ fi
fi
fi
done
diff --git a/src/Doxyfile b/src/Doxyfile
index 62412627..85c496a8 100644
--- a/src/Doxyfile
+++ b/src/Doxyfile
@@ -672,7 +672,7 @@ LAYOUT_FILE =
# search path. Do not use file names with spaces, bibtex cannot handle them. See
# also \cite for info how to create references.
-CITE_BIB_FILES = ../biblio/bibliography.bib
+CITE_BIB_FILES = biblio/bibliography.bib
#---------------------------------------------------------------------------
# Configuration options related to warning and progress messages
@@ -831,9 +831,9 @@ EXAMPLE_RECURSIVE = NO
# that contain images that are to be included in the documentation (see the
# \image command).
-IMAGE_PATH = Skeleton_blocker/doc/ \
- common/doc/ \
- Contraction/doc/
+IMAGE_PATH = doc/Skeleton_blocker/ \
+ doc/common/ \
+ doc/Contraction/
# The INPUT_FILTER tag can be used to specify a program that doxygen should
diff --git a/src/GudhUI/CMakeLists.txt b/src/GudhUI/CMakeLists.txt
index 9348868a..e896f42c 100644
--- a/src/GudhUI/CMakeLists.txt
+++ b/src/GudhUI/CMakeLists.txt
@@ -6,10 +6,6 @@ find_package(Qt4)
find_package(QGLViewer)
find_package(OpenGL)
-message("CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}")
-message("CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG}")
-message("CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE}")
-
if ( CGAL_FOUND AND QT4_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND )
set( QT_USE_QTXML TRUE )
set( QT_USE_QTMAIN TRUE )
@@ -23,6 +19,19 @@ if ( CGAL_FOUND AND QT4_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND )
include(${QT_USE_FILE})
include(${CGAL_USE_FILE})
+
+if(MSVC)
+ # Turn off some VC++ warnings
+ SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267 /wd4668 /wd4311 /wd4800 /wd4820 /wd4503 /wd4244 /wd4345 /wd4996 /wd4396 /wd4018")
+else()
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -std=c++11 -Wall -Wpedantic -Wsign-compare")
+ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -ggdb -O0")
+ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
+endif()
+
+message("CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}")
+message("CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG}")
+message("CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE}")
include_directories (${QGLVIEWER_INCLUDE_DIR})
include_directories(.)
diff --git a/src/Persistent_cohomology/example/CMakeLists.txt b/src/Persistent_cohomology/example/CMakeLists.txt
index 9487cce6..3276989d 100644
--- a/src/Persistent_cohomology/example/CMakeLists.txt
+++ b/src/Persistent_cohomology/example/CMakeLists.txt
@@ -28,8 +28,11 @@ if (NOT MSVC)
target_link_libraries(performance_rips_persistence ${Boost_SYSTEM_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY} ${GMPXX_LIBRARIES} ${GMP_LIBRARIES})
if(CGAL_FOUND)
- # uncomment to display debug traces
- # add_definitions(-DDEBUG_TRACES)
+ if (CMAKE_BUILD_TYPE MATCHES Debug)
+ # For programs to be more verbose
+ add_definitions(-DDEBUG_TRACES)
+ endif()
+
add_executable(alpha_shapes_persistence alpha_shapes_persistence.cpp)
target_link_libraries(alpha_shapes_persistence ${Boost_SYSTEM_LIBRARY} ${GMPXX_LIBRARIES} ${GMP_LIBRARIES} ${CGAL_LIBRARY})
add_test(alpha_shapes_persistence_2_0_5 ${CMAKE_CURRENT_BINARY_DIR}/alpha_shapes_persistence ${CMAKE_SOURCE_DIR}/data/points/bunny_5000 2 0.5)
diff --git a/src/Simplex_tree/test/simplex_tree_unit_test.cpp b/src/Simplex_tree/test/simplex_tree_unit_test.cpp
index 5733dda1..1539ad2b 100644
--- a/src/Simplex_tree/test/simplex_tree_unit_test.cpp
+++ b/src/Simplex_tree/test/simplex_tree_unit_test.cpp
@@ -359,59 +359,121 @@ BOOST_AUTO_TEST_CASE(simplex_tree_insertion) {
}
+bool sort_in_decr_order (Vertex_handle i,Vertex_handle j) { return (i>j); }
+
BOOST_AUTO_TEST_CASE(NSimplexAndSubfaces_tree_insertion) {
std::cout << "********************************************************************" << std::endl;
std::cout << "TEST OF RECURSIVE INSERTION" << std::endl;
typeST st;
+ typePairSimplexBool returnValue;
+ int position = 0;
// ++ FIRST
std::cout << " - INSERT (2,1,0)" << std::endl;
typeVectorVertex SimplexVector1{2, 1, 0};
BOOST_CHECK(SimplexVector1.size() == 3);
- st.insert_simplex_and_subfaces(SimplexVector1);
+ returnValue = st.insert_simplex_and_subfaces(SimplexVector1);
BOOST_CHECK(st.num_vertices() == (size_t) 3); // +3 (2, 1 and 0 are not existing)
+ // Check it is well inserted
+ BOOST_CHECK(true == returnValue.second);
+ position = 0;
+ std::sort(SimplexVector1.begin(), SimplexVector1.end(), sort_in_decr_order);
+ for (auto vertex : st.simplex_vertex_range(returnValue.first)) {
+ // Check returned Simplex_handle
+ std::cout << "vertex = " << vertex << " | vector[" << position << "] = " << SimplexVector1[position] << std::endl;
+ BOOST_CHECK(vertex == SimplexVector1[position]);
+ position++;
+ }
+
// ++ SECOND
std::cout << " - INSERT 3" << std::endl;
typeVectorVertex SimplexVector2{3};
BOOST_CHECK(SimplexVector2.size() == 1);
- st.insert_simplex_and_subfaces(SimplexVector2);
+ returnValue = st.insert_simplex_and_subfaces(SimplexVector2);
BOOST_CHECK(st.num_vertices() == (size_t) 4); // +1 (3 is not existing)
+ // Check it is well inserted
+ BOOST_CHECK(true == returnValue.second);
+ position = 0;
+ std::sort(SimplexVector2.begin(), SimplexVector2.end(), sort_in_decr_order);
+ for (auto vertex : st.simplex_vertex_range(returnValue.first)) {
+ // Check returned Simplex_handle
+ std::cout << "vertex = " << vertex << " | vector[" << position << "] = " << SimplexVector2[position] << std::endl;
+ BOOST_CHECK(vertex == SimplexVector2[position]);
+ position++;
+ }
+
// ++ THIRD
std::cout << " - INSERT (0,3)" << std::endl;
typeVectorVertex SimplexVector3{3, 0};
BOOST_CHECK(SimplexVector3.size() == 2);
- st.insert_simplex_and_subfaces(SimplexVector3);
+ returnValue = st.insert_simplex_and_subfaces(SimplexVector3);
BOOST_CHECK(st.num_vertices() == (size_t) 4); // Not incremented (all are existing)
+ // Check it is well inserted
+ BOOST_CHECK(true == returnValue.second);
+ position = 0;
+ std::sort(SimplexVector3.begin(), SimplexVector3.end(), sort_in_decr_order);
+ for (auto vertex : st.simplex_vertex_range(returnValue.first)) {
+ // Check returned Simplex_handle
+ std::cout << "vertex = " << vertex << " | vector[" << position << "] = " << SimplexVector3[position] << std::endl;
+ BOOST_CHECK(vertex == SimplexVector3[position]);
+ position++;
+ }
+
// ++ FOURTH
std::cout << " - INSERT (1,0) (already inserted)" << std::endl;
typeVectorVertex SimplexVector4{1, 0};
BOOST_CHECK(SimplexVector4.size() == 2);
- st.insert_simplex_and_subfaces(SimplexVector4);
+ returnValue = st.insert_simplex_and_subfaces(SimplexVector4);
BOOST_CHECK(st.num_vertices() == (size_t) 4); // Not incremented (all are existing)
+ // Check it was not inserted (already there from {2,1,0} insertion)
+ BOOST_CHECK(false == returnValue.second);
+
// ++ FIFTH
std::cout << " - INSERT (3,4,5)" << std::endl;
typeVectorVertex SimplexVector5{3, 4, 5};
BOOST_CHECK(SimplexVector5.size() == 3);
- st.insert_simplex_and_subfaces(SimplexVector5);
+ returnValue = st.insert_simplex_and_subfaces(SimplexVector5);
BOOST_CHECK(st.num_vertices() == (size_t) 6);
+ // Check it is well inserted
+ BOOST_CHECK(true == returnValue.second);
+ position = 0;
+ std::sort(SimplexVector5.begin(), SimplexVector5.end(), sort_in_decr_order);
+ for (auto vertex : st.simplex_vertex_range(returnValue.first)) {
+ // Check returned Simplex_handle
+ std::cout << "vertex = " << vertex << " | vector[" << position << "] = " << SimplexVector5[position] << std::endl;
+ BOOST_CHECK(vertex == SimplexVector5[position]);
+ position++;
+ }
+
// ++ SIXTH
std::cout << " - INSERT (0,1,6,7)" << std::endl;
typeVectorVertex SimplexVector6{0, 1, 6, 7};
BOOST_CHECK(SimplexVector6.size() == 4);
- st.insert_simplex_and_subfaces(SimplexVector6);
+ returnValue = st.insert_simplex_and_subfaces(SimplexVector6);
BOOST_CHECK(st.num_vertices() == (size_t) 8); // +2 (6 and 7 are not existing - 0 and 1 are already existing)
+ // Check it is well inserted
+ BOOST_CHECK(true == returnValue.second);
+ position = 0;
+ std::sort(SimplexVector6.begin(), SimplexVector6.end(), sort_in_decr_order);
+ for (auto vertex : st.simplex_vertex_range(returnValue.first)) {
+ // Check returned Simplex_handle
+ std::cout << "vertex = " << vertex << " | vector[" << position << "] = " << SimplexVector6[position] << std::endl;
+ BOOST_CHECK(vertex == SimplexVector6[position]);
+ position++;
+ }
+
/* Inserted simplex: */
/* 1 6 */
/* o---o */