diff options
author | vrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2018-01-26 14:01:39 +0000 |
---|---|---|
committer | vrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2018-01-26 14:01:39 +0000 |
commit | 06ff6fac211d2823c7d14a6d2f4a4db03f48d2e3 (patch) | |
tree | 441f0bf87786294f73295ae66e7a121187d14151 /src/Nerve_GIC | |
parent | 497f2e8edff6d44689dff5ecdf945caadd439993 (diff) |
Seperate installation and examples from main page
Move cover complex utilities from examples
GIC.cpp example was not compiled, nor tested. It is removed.
Persistence representation : no need to link with Boost_SYSTEM
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@3164 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: cf2bfa6c6de2ed359aaa165b9f80bca7e06defb1
Diffstat (limited to 'src/Nerve_GIC')
-rw-r--r-- | src/Nerve_GIC/doc/Intro_graph_induced_complex.h | 29 | ||||
-rw-r--r-- | src/Nerve_GIC/example/CMakeLists.txt | 12 | ||||
-rw-r--r-- | src/Nerve_GIC/example/GIC.cpp | 95 | ||||
-rw-r--r-- | src/Nerve_GIC/utilities/CMakeLists.txt | 22 | ||||
-rwxr-xr-x | src/Nerve_GIC/utilities/KeplerMapperVisuFromTxtFile.py (renamed from src/Nerve_GIC/example/KeplerMapperVisuFromTxtFile.py) | 0 | ||||
-rw-r--r-- | src/Nerve_GIC/utilities/Nerve.cpp (renamed from src/Nerve_GIC/example/Nerve.cpp) | 0 | ||||
-rw-r--r-- | src/Nerve_GIC/utilities/Nerve.txt (renamed from src/Nerve_GIC/example/Nerve.txt) | 0 | ||||
-rw-r--r-- | src/Nerve_GIC/utilities/VoronoiGIC.cpp (renamed from src/Nerve_GIC/example/VoronoiGIC.cpp) | 0 | ||||
-rwxr-xr-x | src/Nerve_GIC/utilities/km.py (renamed from src/Nerve_GIC/example/km.py) | 0 | ||||
-rw-r--r-- | src/Nerve_GIC/utilities/km.py.COPYRIGHT (renamed from src/Nerve_GIC/example/km.py.COPYRIGHT) | 0 |
10 files changed, 22 insertions, 136 deletions
diff --git a/src/Nerve_GIC/doc/Intro_graph_induced_complex.h b/src/Nerve_GIC/doc/Intro_graph_induced_complex.h index 7578cc53..344cb031 100644 --- a/src/Nerve_GIC/doc/Intro_graph_induced_complex.h +++ b/src/Nerve_GIC/doc/Intro_graph_induced_complex.h @@ -177,7 +177,6 @@ namespace cover_complex { * \image html "funcGICvisu.jpg" "Visualization with neato" * * \copyright GNU General Public License v3. - * \verbatim Contact: gudhi-users@lists.gforge.inria.fr \endverbatim */ /** @} */ // end defgroup cover_complex @@ -186,31 +185,3 @@ namespace cover_complex { } // namespace Gudhi #endif // DOC_COVER_COMPLEX_INTRO_COVER_COMPLEX_H_ - - -/* * \subsection gicexample Example with cover from function - * - * This example builds the GIC of a point cloud sampled on a 3D human shape (human.off). - * The cover C comes from the preimages of intervals (with length 0.075 and gain 0) - * covering the height function (coordinate 2), - * and the graph G comes from a Rips complex built with threshold 0.075. - * Note that if the gain is too big, the number of cliques increases a lot, - * which make the computation time much larger. - * - * \include Nerve_GIC/GIC.cpp - * - * When launching: - * - * \code $> ./GIC ../../data/points/human.off 0.075 2 0.075 0 --v - * \endcode - * - * the program outputs SC.txt, which can be visualized with python and firefox as before: - * - * \image html "gicvisu.jpg" "Visualization with KeplerMapper" - * */ - - -/* * Using e.g. - * - * \code $> python KeplerMapperVisuFromTxtFile.py && firefox SC.html - * \endcode */ diff --git a/src/Nerve_GIC/example/CMakeLists.txt b/src/Nerve_GIC/example/CMakeLists.txt index 73728dc0..434637fa 100644 --- a/src/Nerve_GIC/example/CMakeLists.txt +++ b/src/Nerve_GIC/example/CMakeLists.txt @@ -3,26 +3,14 @@ project(Nerve_GIC_examples) if (NOT CGAL_VERSION VERSION_LESS 4.8.1) - add_executable ( Nerve Nerve.cpp ) add_executable ( CoordGIC CoordGIC.cpp ) add_executable ( FuncGIC FuncGIC.cpp ) - add_executable ( VoronoiGIC VoronoiGIC.cpp ) if (TBB_FOUND) - target_link_libraries(Nerve ${TBB_LIBRARIES}) target_link_libraries(CoordGIC ${TBB_LIBRARIES}) target_link_libraries(FuncGIC ${TBB_LIBRARIES}) - target_link_libraries(VoronoiGIC ${TBB_LIBRARIES}) endif() - file(COPY KeplerMapperVisuFromTxtFile.py km.py DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/) - - add_test(NAME Nerve_GIC_example_nerve COMMAND $<TARGET_FILE:Nerve> - "${CMAKE_SOURCE_DIR}/data/points/human.off" "2" "10" "0.3") - - add_test(NAME Nerve_GIC_example_VoronoiGIC COMMAND $<TARGET_FILE:VoronoiGIC> - "${CMAKE_SOURCE_DIR}/data/points/human.off" "100") - add_test(NAME Nerve_GIC_example_CoordGIC COMMAND $<TARGET_FILE:CoordGIC> "${CMAKE_SOURCE_DIR}/data/points/tore3D_1307.off" "0") diff --git a/src/Nerve_GIC/example/GIC.cpp b/src/Nerve_GIC/example/GIC.cpp deleted file mode 100644 index 2bc24a4d..00000000 --- a/src/Nerve_GIC/example/GIC.cpp +++ /dev/null @@ -1,95 +0,0 @@ -/* This file is part of the Gudhi Library. The Gudhi library - * (Geometric Understanding in Higher Dimensions) is a generic C++ - * library for computational topology. - * - * Author(s): Mathieu Carrière - * - * Copyright (C) 2017 INRIA - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -#include <gudhi/GIC.h> - -#include <string> -#include <vector> - -void usage(int nbArgs, char *const progName) { - std::cerr << "Error: Number of arguments (" << nbArgs << ") is not correct\n"; - std::cerr << "Usage: " << progName << " filename.off threshold coordinate resolution gain [--v] \n"; - std::cerr << " i.e.: " << progName << " ../../data/points/human.off 0.075 2 0.075 0 --v \n"; - exit(-1); // ----- >> -} - -int main(int argc, char **argv) { - if ((argc != 6) && (argc != 7)) usage(argc, argv[0]); - - using Point = std::vector<float>; - - std::string off_file_name(argv[1]); - double threshold = atof(argv[2]); - int coord = atoi(argv[3]); - double resolution = atof(argv[4]); - double gain = atof(argv[5]); - bool verb = 0; - if (argc == 7) verb = 1; - - // ---------------------------------------------------------------------------- - // Init of a graph induced complex from an OFF file - // ---------------------------------------------------------------------------- - - Gudhi::graph_induced_complex::Graph_induced_complex<Point> GIC; - GIC.set_verbose(verb); - - bool check = GIC.read_point_cloud(off_file_name); - - if (!check) { - std::cout << "Incorrect OFF file." << std::endl; - } else { - GIC.set_color_from_coordinate(coord); - GIC.set_function_from_coordinate(coord); - - GIC.set_graph_from_rips(threshold, Gudhi::Euclidean_distance()); - - GIC.set_resolution_with_interval_length(resolution); - GIC.set_gain(gain); - GIC.set_cover_from_function(); - - GIC.find_GIC_simplices(); - - GIC.plot_TXT_for_KeplerMapper(); - - Gudhi::Simplex_tree<> stree; - GIC.create_complex(stree); - - // ---------------------------------------------------------------------------- - // Display information about the graph induced complex - // ---------------------------------------------------------------------------- - - if (verb) { - std::cout << "Graph induced complex is of dimension " << stree.dimension() << " - " << stree.num_simplices() - << " simplices - " << stree.num_vertices() << " vertices." << std::endl; - - std::cout << "Iterator on graph induced complex simplices" << std::endl; - for (auto f_simplex : stree.filtration_simplex_range()) { - for (auto vertex : stree.simplex_vertex_range(f_simplex)) { - std::cout << vertex << " "; - } - std::cout << std::endl; - } - } - } - - return 0; -} diff --git a/src/Nerve_GIC/utilities/CMakeLists.txt b/src/Nerve_GIC/utilities/CMakeLists.txt new file mode 100644 index 00000000..a0508dc2 --- /dev/null +++ b/src/Nerve_GIC/utilities/CMakeLists.txt @@ -0,0 +1,22 @@ +cmake_minimum_required(VERSION 2.6) +project(Nerve_GIC_examples) + +if (NOT CGAL_VERSION VERSION_LESS 4.8.1) + + add_executable ( Nerve Nerve.cpp ) + add_executable ( VoronoiGIC VoronoiGIC.cpp ) + + if (TBB_FOUND) + target_link_libraries(Nerve ${TBB_LIBRARIES}) + target_link_libraries(VoronoiGIC ${TBB_LIBRARIES}) + endif() + + file(COPY KeplerMapperVisuFromTxtFile.py km.py DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/) + + add_test(NAME Nerve_GIC_utilities_nerve COMMAND $<TARGET_FILE:Nerve> + "${CMAKE_SOURCE_DIR}/data/points/human.off" "2" "10" "0.3") + + add_test(NAME Nerve_GIC_utilities_VoronoiGIC COMMAND $<TARGET_FILE:VoronoiGIC> + "${CMAKE_SOURCE_DIR}/data/points/human.off" "100") + +endif (NOT CGAL_VERSION VERSION_LESS 4.8.1) diff --git a/src/Nerve_GIC/example/KeplerMapperVisuFromTxtFile.py b/src/Nerve_GIC/utilities/KeplerMapperVisuFromTxtFile.py index d2897774..d2897774 100755 --- a/src/Nerve_GIC/example/KeplerMapperVisuFromTxtFile.py +++ b/src/Nerve_GIC/utilities/KeplerMapperVisuFromTxtFile.py diff --git a/src/Nerve_GIC/example/Nerve.cpp b/src/Nerve_GIC/utilities/Nerve.cpp index 6abdedc7..6abdedc7 100644 --- a/src/Nerve_GIC/example/Nerve.cpp +++ b/src/Nerve_GIC/utilities/Nerve.cpp diff --git a/src/Nerve_GIC/example/Nerve.txt b/src/Nerve_GIC/utilities/Nerve.txt index 839ff45e..839ff45e 100644 --- a/src/Nerve_GIC/example/Nerve.txt +++ b/src/Nerve_GIC/utilities/Nerve.txt diff --git a/src/Nerve_GIC/example/VoronoiGIC.cpp b/src/Nerve_GIC/utilities/VoronoiGIC.cpp index 32431cc2..32431cc2 100644 --- a/src/Nerve_GIC/example/VoronoiGIC.cpp +++ b/src/Nerve_GIC/utilities/VoronoiGIC.cpp diff --git a/src/Nerve_GIC/example/km.py b/src/Nerve_GIC/utilities/km.py index 53024aab..53024aab 100755 --- a/src/Nerve_GIC/example/km.py +++ b/src/Nerve_GIC/utilities/km.py diff --git a/src/Nerve_GIC/example/km.py.COPYRIGHT b/src/Nerve_GIC/utilities/km.py.COPYRIGHT index bef7b121..bef7b121 100644 --- a/src/Nerve_GIC/example/km.py.COPYRIGHT +++ b/src/Nerve_GIC/utilities/km.py.COPYRIGHT |