From 01b7bec722e18851acfc826ca572d01a127339c1 Mon Sep 17 00:00:00 2001 From: mcarrier Date: Tue, 9 May 2017 14:04:29 +0000 Subject: git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/Nerve_GIC@2408 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 324d557360a52e7181d9cf3c7d77c8445a367808 --- src/Nerve_GIC/include/gudhi/GIC.h | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'src/Nerve_GIC/include/gudhi') diff --git a/src/Nerve_GIC/include/gudhi/GIC.h b/src/Nerve_GIC/include/gudhi/GIC.h index abd833e0..c373b25c 100644 --- a/src/Nerve_GIC/include/gudhi/GIC.h +++ b/src/Nerve_GIC/include/gudhi/GIC.h @@ -45,6 +45,7 @@ #include // for std::max #include // for std::uint32_t #include +#include #define CONSTANT 10 #define ETA 0.001 @@ -549,7 +550,7 @@ class Graph_induced_complex { * @param[in] off_file_name name of the input .OFF file. * */ - void set_color_from_coordinate(int k = 0, const std::string& off_file_name){ + void set_color_from_coordinate(const std::string& off_file_name, int k = 0){ Points_off_reader off_reader(off_file_name); int numpts = off_reader.get_point_cloud().size(); for(int i = 0; i < numpts; i++) func_color.insert(std::pair(i,off_reader.get_point_cloud()[i][k])); @@ -569,7 +570,7 @@ class Graph_induced_complex { /** \brief Creates a .dot file for neato once the simplicial complex is computed to get a .pdf output. */ void plot_with_neato(){ - char mapp[11] = "mapper.dot"; std::ofstream graphic(mapp); graphic << "graph Mapper {" << std::endl; + char mapp[11] = "SC.dot"; std::ofstream graphic(mapp); graphic << "graph Mapper {" << std::endl; double maxv, minv; maxv = std::numeric_limits::min(); minv = std::numeric_limits::max(); for (std::map >::iterator iit = cover_color.begin(); iit != cover_color.end(); iit++){ maxv = std::max(maxv, iit->second.second); minv = std::min(minv, iit->second.second); @@ -598,7 +599,7 @@ class Graph_induced_complex { void plot_with_KeplerMapper(){ int num_simplices = simplices.size(); int num_edges = 0; - char mapp[11] = "mapper.txt"; std::ofstream graphic(mapp); + char mapp[11] = "SC.txt"; std::ofstream graphic(mapp); for (int i = 0; i < num_simplices; i++) if (simplices[i].size() == 2) if (cover_color[simplices[i][0]].first > MASK && cover_color[simplices[i][1]].first > MASK) @@ -711,11 +712,17 @@ class Graph_induced_complex { } public: - /** \brief Computes the simplices in the Mapper Delta. + /** \brief Computes the simplices in the Mapper Delta by looking at all the edges of the graph + * and adding the corresponding edges in the Mapper Delta if the images of the endpoints belong + * to consecutive intervals. + * + * \remark WARNING: the output of this function is correct ONLY if the cover is minimal, i.e. + * the gain is less than 0.5!!! + * */ void find_GICMAP_simplices_with_functional_minimal_cover(){ - int v1, v2; + int v1, v2; assert(gain < 0.5); // Loop on all points. for(std::map >::iterator it = cover.begin(); it != cover.end(); it++){ -- cgit v1.2.3