summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsalinasd <salinasd@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2014-12-17 11:54:05 +0000
committersalinasd <salinasd@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2014-12-17 11:54:05 +0000
commitcb0f18f67e819d623ef1bfdd6f14240c86c5918a (patch)
treeaec839366906c12f3dd4cd83edc13dd0a22cba00
parent06b195e44a5430678ee87527e8c0ba320b4c1105 (diff)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@368 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: 7fc3ede363e13434a4061c8f69189e4fc3d0a25d
-rw-r--r--CMakeLists.txt2
-rwxr-xr-xdata/meshes/SO3_10000.off3
-rw-r--r--src/Contraction/include/gudhi/Edge_contraction.h36
-rw-r--r--src/Persistent_cohomology/example/CMakeLists.txt4
-rw-r--r--src/Skeleton_blocker/doc/sphere_contraction.pngbin0 -> 48755 bytes
5 files changed, 32 insertions, 13 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c5d139fa..65329f90 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -14,7 +14,7 @@ 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")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -std=c++11 -Wall -Wpedantic -Wsign-compare")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -O0")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
endif()
diff --git a/data/meshes/SO3_10000.off b/data/meshes/SO3_10000.off
index f890ed74..fbf9b273 100755
--- a/data/meshes/SO3_10000.off
+++ b/data/meshes/SO3_10000.off
@@ -9999,5 +9999,4 @@ OFF
0.869792 0.348899 -0.3489 -0.492949 0.645295 -0.583606 0.0215234 0.679606 0.733262
0.869792 0.348899 -0.3489 0.492949 -0.645295 0.583606 -0.0215234 -0.679606 -0.733262
0.86979 0.3489 -0.3489 -0.265114 -0.26591 -0.926825 -0.416146 0.898643 -0.138787
-0.86979 0.3489 -0.3489 0.265114 0.26591 0.926825 0.416146 -0.898643 0.138787
-3 1 2 3
+0.86979 0.3489 -0.3489 0.265114 0.26591 0.926825 0.416146 -0.898643 0.138787
diff --git a/src/Contraction/include/gudhi/Edge_contraction.h b/src/Contraction/include/gudhi/Edge_contraction.h
index 71bcb38e..b5d85ae4 100644
--- a/src/Contraction/include/gudhi/Edge_contraction.h
+++ b/src/Contraction/include/gudhi/Edge_contraction.h
@@ -166,7 +166,6 @@ int main (int argc, char *argv[])
return -1;
}
- boost::timer::auto_cpu_timer t;
Complex complex;
// load the points
@@ -175,32 +174,53 @@ int main (int argc, char *argv[])
std::cerr << "Unable to read file:"<<argv[1]<<std::endl;
return EXIT_FAILURE;
}
- std::cout << "build the Rips complex"<<std::endl;
+ std::cout << "Build the Rips complex"<<std::endl;
build_rips(complex,atof(argv[2]));
+ boost::timer::auto_cpu_timer t;
std::cout << "Initial complex has "<<
- complex.num_vertices()<<" vertices, and "<<
- complex.num_edges()<<" edges."<<std::endl;
+ complex.num_vertices()<<" vertices and "<<
+ complex.num_edges()<<" edges"<<std::endl;
Complex_contractor contractor(complex,
- new Edge_length_cost<Profile>,
+ new Edge_length_cost<Profile>,
contraction::make_first_vertex_placement<Profile>(),
contraction::make_link_valid_contraction<Profile>(),
contraction::make_remove_popable_blockers_visitor<Profile>());
contractor.contract_edges();
- std::cout << "Resulting complex has "<<
+ std::cout << "Counting final number of simplices \n";
+ unsigned num_simplices = std::distance(complex.simplex_range().begin(),complex.simplex_range().end());
+
+ std::cout << "Final complex has "<<
complex.num_vertices()<<" vertices, "<<
- complex.num_edges()<<"edges and "<<
- complex.num_blockers()<<" blockers"<<std::endl;
+ complex.num_edges()<<" edges, "<<
+ complex.num_blockers()<<" blockers and "<<
+ num_simplices<<" simplices"<<std::endl;
+
+
+ std::cout << "Time to simplify and enumerate simplices:\n";
return EXIT_SUCCESS;
}
+}
\endcode
+\verbatim
+./example/Contraction/RipsContraction ../../data/SO3_10000.off 0.3
+[ 50%] [100%] Built target SkeletonBlockerIteration
+Built target RipsContraction
+Build the Rips complex
+Initial complex has 10000 vertices and 195664 edges
+Counting final number of simplices
+Final complex has 15 vertices, 101 edges, 165 blockers and 714 simplices
+Time to simplify and enumerate simplices:
+ 3.166621s wall, 3.150000s user + 0.010000s system = 3.160000s CPU (99.8%)
+\endverbatim
+
\copyright GNU General Public License v3.
diff --git a/src/Persistent_cohomology/example/CMakeLists.txt b/src/Persistent_cohomology/example/CMakeLists.txt
index a8392e8c..5c337f0b 100644
--- a/src/Persistent_cohomology/example/CMakeLists.txt
+++ b/src/Persistent_cohomology/example/CMakeLists.txt
@@ -2,12 +2,12 @@ cmake_minimum_required(VERSION 2.6)
project(GUDHIExPersCohom)
add_executable(rips_persistence rips_persistence.cpp)
-#target_link_libraries(rips_persistence ${Boost_PROGRAM_OPTIONS_LIBRARY})
+target_link_libraries(rips_persistence ${Boost_PROGRAM_OPTIONS_LIBRARY} ${Boost_SYSTEM_LIBRARY})
add_test(rips_persistence_2 ${CMAKE_CURRENT_BINARY_DIR}/rips_persistence ${CMAKE_SOURCE_DIR}/data/points/Kl.txt -r 0.25 -d 3 -p 2 -m 100)
add_test(rips_persistence_3 ${CMAKE_CURRENT_BINARY_DIR}/rips_persistence ${CMAKE_SOURCE_DIR}/data/points/Kl.txt -r 0.25 -d 3 -p 3 -m 100)
add_executable(rips_persistence_from_alpha_shape_3 rips_persistence_from_alpha_shape_3.cpp )
-#target_link_libraries(rips_persistence_from_alpha_shape_3 ${Boost_PROGRAM_OPTIONS_LIBRARY})
+target_link_libraries(rips_persistence_from_alpha_shape_3 ${Boost_PROGRAM_OPTIONS_LIBRARY} ${Boost_SYSTEM_LIBRARY})
if(GMPXX_FOUND AND GMP_FOUND)
message("GMPXX_LIBRARIES = ${GMPXX_LIBRARIES}")
diff --git a/src/Skeleton_blocker/doc/sphere_contraction.png b/src/Skeleton_blocker/doc/sphere_contraction.png
new file mode 100644
index 00000000..502f73f7
--- /dev/null
+++ b/src/Skeleton_blocker/doc/sphere_contraction.png
Binary files differ