summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2015-11-18 12:03:43 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2015-11-18 12:03:43 +0000
commitfe78c077b00e91b3d316f1d64541008a615664e7 (patch)
treea85cbd9780d5b9d2640609f349c7601626390313 /src/common
parentc972b77524faec5d6f297d442539f65b9351654e (diff)
rev911 rollback
code review fix fix prune_above_filtration removing every simplices git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/alphashapes@927 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 1660da972bd5198214a0f0384be9be66a5312e74
Diffstat (limited to 'src/common')
-rw-r--r--src/common/example/CMakeLists.txt4
-rw-r--r--src/common/example/Delaunay_triangulation_off_rw.cpp5
-rw-r--r--src/common/include/gudhi/Debug_utils.h24
-rw-r--r--src/common/include/gudhi/Delaunay_triangulation_off_io.h19
4 files changed, 28 insertions, 24 deletions
diff --git a/src/common/example/CMakeLists.txt b/src/common/example/CMakeLists.txt
index d29e31e7..089f0c04 100644
--- a/src/common/example/CMakeLists.txt
+++ b/src/common/example/CMakeLists.txt
@@ -26,6 +26,10 @@ if(CGAL_FOUND)
if (EIGEN3_FOUND)
message(STATUS "Eigen3 version: ${EIGEN3_VERSION}.")
include( ${EIGEN3_USE_FILE} )
+ if (CMAKE_BUILD_TYPE MATCHES Debug)
+ # For programs to be more verbose
+ add_definitions(-DDEBUG_TRACES)
+ endif()
add_executable ( dtoffrw Delaunay_triangulation_off_rw.cpp )
target_link_libraries(dtoffrw ${Boost_SYSTEM_LIBRARY} ${CGAL_LIBRARY})
diff --git a/src/common/example/Delaunay_triangulation_off_rw.cpp b/src/common/example/Delaunay_triangulation_off_rw.cpp
index 12accd10..75e4fafb 100644
--- a/src/common/example/Delaunay_triangulation_off_rw.cpp
+++ b/src/common/example/Delaunay_triangulation_off_rw.cpp
@@ -24,11 +24,6 @@ int main(int argc, char **argv) {
usage(argv[0]);
}
-
-#ifdef GUDHI_NDEBUG
- std::cout << "pouet pouet !!" << std::endl;
-#endif
-
std::string offInputFile(argv[1]);
// Read the OFF file (input file name given as parameter) and triangulates points
Gudhi::Delaunay_triangulation_off_reader<T> off_reader(offInputFile);
diff --git a/src/common/include/gudhi/Debug_utils.h b/src/common/include/gudhi/Debug_utils.h
index c479d435..48d61fef 100644
--- a/src/common/include/gudhi/Debug_utils.h
+++ b/src/common/include/gudhi/Debug_utils.h
@@ -24,14 +24,23 @@
#include <iostream>
-#ifdef NDEBUG
- // GUDHI_NDEBUG is the Gudhi official flag for debug mode.
- #define GUDHI_NDEBUG
+#ifndef NDEBUG
+ // GUDHI_DEBUG is the Gudhi official flag for debug mode.
+ #define GUDHI_DEBUG
+#endif
+
+// GUDHI_CHECK throw an exception on condition in debug mode, but does nothing in release mode
+// Could assert in release mode, but cmake sets NDEBUG (for "NO DEBUG") in this mode, means assert does nothing.
+#ifdef GUDHI_DEBUG
+ #define GUDHI_CHECK(cond, excpt) if (cond) throw excpt
+#else
+ #define GUDHI_CHECK(cond, excpt) (void) 0
#endif
#define PRINT(a) std::cerr << #a << ": " << (a) << " (DISP)" << std::endl
-#ifdef GUDHI_NDEBUG
+// #define DBG_VERBOSE
+#ifdef DBG_VERBOSE
#define DBG(a) std::cout << "DBG: " << (a) << std::endl
#define DBGMSG(a, b) std::cout << "DBG: " << a << b << std::endl
#define DBGVALUE(a) std::cout << "DBG: " << #a << ": " << a << std::endl
@@ -43,11 +52,4 @@
#define DBGCONT(a) (void) 0
#endif
-// GUDHI_CHECK throw an exception on condition in debug mode, but does nothing in release mode
-#ifdef GUDHI_NDEBUG
- #define GUDHI_CHECK(cond, excpt) if (cond) throw excpt
-#else
- #define GUDHI_CHECK(cond, excpt) (void) 0
-#endif
-
#endif // DEBUG_UTILS_H_
diff --git a/src/common/include/gudhi/Delaunay_triangulation_off_io.h b/src/common/include/gudhi/Delaunay_triangulation_off_io.h
index dfa70e40..4d26bb71 100644
--- a/src/common/include/gudhi/Delaunay_triangulation_off_io.h
+++ b/src/common/include/gudhi/Delaunay_triangulation_off_io.h
@@ -22,8 +22,6 @@
#ifndef DELAUNAY_TRIANGULATION_OFF_IO_H_
#define DELAUNAY_TRIANGULATION_OFF_IO_H_
-#include <gudhi/Debug_utils.h>
-
#include <string>
#include <vector>
#include <fstream>
@@ -66,10 +64,10 @@ class Delaunay_triangulation_off_visitor_reader {
* @param[in] num_edges number of edges in the OFF file (not used).
*/
void init(int dim, int num_vertices, int num_faces, int num_edges) {
- DBGMSG("Delaunay_triangulation_off_visitor_reader::init - dim=", dim);
- DBGMSG(" - num_vertices=", num_vertices);
- DBGMSG(" - num_faces=", num_faces);
- DBGMSG(" - num_edges=", num_edges);
+#ifdef DEBUG_TRACES
+ std::cout << "Delaunay_triangulation_off_visitor_reader::init - dim=" << dim << " - num_vertices=" <<
+ num_vertices << " - num_faces=" << num_faces << " - num_edges=" << num_edges << std::endl;
+#endif // DEBUG_TRACES
if (num_faces > 0) {
std::cerr << "Delaunay_triangulation_off_visitor_reader::init faces are not taken into account from OFF " <<
"file for Delaunay triangulation - faces are computed." << std::endl;
@@ -90,8 +88,13 @@ class Delaunay_triangulation_off_visitor_reader {
* @param[in] point vector of vertex coordinates.
*/
void point(const std::vector<double>& point) {
- DBG("Delaunay_triangulation_off_visitor_reader::point");
- DBGCONT(point);
+#ifdef DEBUG_TRACES
+ std::cout << "Delaunay_triangulation_off_visitor_reader::point ";
+ for (auto coordinate : point) {
+ std::cout << coordinate << " | ";
+ }
+ std::cout << std::endl;
+#endif // DEBUG_TRACES
complex_->insert(Point(point.size(), point.begin(), point.end()));
}