diff options
author | anmoreau <anmoreau@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2015-07-07 10:28:19 +0000 |
---|---|---|
committer | anmoreau <anmoreau@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2015-07-07 10:28:19 +0000 |
commit | ca50369ef5c07808bd20941e4b82e26218dd500d (patch) | |
tree | 10531a35c6dce2294971eef1105dd434fd69e1be /src | |
parent | 505a0c3159b1c1a74884b8e28d9eb18aafa57cca (diff) | |
parent | c8c2f91db880218bb7ab275fbadda53a23f88d35 (diff) |
Merge + fix
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/coface@688 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: 0c732aea08e3999fb4cd54eedd1be9caf5b4b455
Diffstat (limited to 'src')
6 files changed, 26 insertions, 23 deletions
diff --git a/src/GudhUI/model/Model.h b/src/GudhUI/model/Model.h index 87545989..17a7d278 100644 --- a/src/GudhUI/model/Model.h +++ b/src/GudhUI/model/Model.h @@ -315,7 +315,8 @@ private: void run_chomp(){ save_complex_in_file_for_chomp(); std::cout << "Call CHOMP library\n"; - system("utils/homsimpl chomp.sim"); + int returnValue = system("utils/homsimpl chomp.sim"); + std::cout << "CHOMP returns" << returnValue << std::endl; } void save_complex_in_file_for_chomp(){ diff --git a/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Field_Zp.h b/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Field_Zp.h index 2349cdac..2a4c8692 100644 --- a/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Field_Zp.h +++ b/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Field_Zp.h @@ -85,7 +85,7 @@ class Field_Zp { return add_id_all; } /** \brief Returns the multiplicative identity \f$1_{\Bbbk}\f$ of the field.*/ - const Element& multiplicative_identity(Element P = 0) const { + const Element& multiplicative_identity(Element = 0) const { return mult_id_all; } /** Returns the inverse in the field. Modifies P.*/ diff --git a/src/Simplex_tree/include/gudhi/Simplex_tree.h b/src/Simplex_tree/include/gudhi/Simplex_tree.h index f5add449..0c2c851a 100644 --- a/src/Simplex_tree/include/gudhi/Simplex_tree.h +++ b/src/Simplex_tree/include/gudhi/Simplex_tree.h @@ -329,7 +329,7 @@ class Simplex_tree { /** \brief Returns the filtration value of a simplex. * * Called on the null_simplex, returns INFINITY. */ - Filtration_value filtration(Simplex_handle sh) { + Filtration_value filtration(Simplex_handle sh) const { if (sh != null_simplex()) { return sh->second.filtration(); } else { @@ -337,34 +337,34 @@ class Simplex_tree { } // filtration(); } } /** \brief Returns an upper bound of the filtration values of the simplices. */ - Filtration_value filtration() { + Filtration_value filtration() const { return threshold_; } /** \brief Returns a Simplex_handle different from all Simplex_handles * associated to the simplices in the simplicial complex. * * One can call filtration(null_simplex()). */ - Simplex_handle null_simplex() { + Simplex_handle null_simplex() const { return Dictionary_it(NULL); } /** \brief Returns a key different for all keys associated to the * simplices of the simplicial complex. */ - Simplex_key null_key() { + Simplex_key null_key() const { return -1; } /** \brief Returns a Vertex_handle different from all Vertex_handles associated * to the vertices of the simplicial complex. */ - Vertex_handle null_vertex() { + Vertex_handle null_vertex() const { return null_vertex_; } /** \brief Returns the number of vertices in the complex. */ - size_t num_vertices() { + size_t num_vertices() const { return root_.members_.size(); } /** \brief Returns the number of simplices in the complex. * * Does not count the empty simplex. */ - const unsigned int& num_simplices() const { + unsigned int num_simplices() const { return num_simplices_; } @@ -381,13 +381,13 @@ class Simplex_tree { return dim - 1; } /** \brief Returns an upper bound on the dimension of the simplicial complex. */ - int dimension() { + int dimension() const { return dimension_; } /** \brief Returns true iff the node in the simplex tree pointed by * sh has children.*/ - bool has_children(Simplex_handle sh) { + bool has_children(Simplex_handle sh) const { return (sh->second.children()->parent() == sh->first); } @@ -569,7 +569,7 @@ class Simplex_tree { threshold_ = fil; } /** Set a number of simplices for the simplicial complex. */ - void set_num_simplices(const unsigned int& num_simplices) { + void set_num_simplices(unsigned int num_simplices) { num_simplices_ = num_simplices; } /** Set a dimension for the simplicial complex. */ @@ -611,7 +611,7 @@ private: /** Recursive search of cofaces * This function uses DFS *\param vertices contains a list of vertices, which represent the vertices of the simplex not found yet. - *\param curr_nbVertices represents the number of vertices of the simplex found. + *\param curr_nbVertices represents the number of vertices of the simplex we reached by going through the tree. *\param cofaces contains a list of Simplex_handle, representing all the cofaces asked. *\param star true if we need the star of the simplex *\param nbVertices number of vertices of the cofaces we search @@ -865,10 +865,10 @@ public: } /** \brief Intersects Dictionary 1 [begin1;end1) with Dictionary 2 [begin2,end2) * and assigns the maximal possible Filtration_value to the Nodes. */ - void intersection(std::vector<std::pair<Vertex_handle, Node> >& intersection, - Dictionary_it begin1, Dictionary_it end1, - Dictionary_it begin2, Dictionary_it end2, - Filtration_value filtration) { + static void intersection(std::vector<std::pair<Vertex_handle, Node> >& intersection, + Dictionary_it begin1, Dictionary_it end1, + Dictionary_it begin2, Dictionary_it end2, + Filtration_value filtration) { if (begin1 == end1 || begin2 == end2) return; // ----->> while (true) { @@ -895,8 +895,8 @@ public: } } /** Maximum over 3 values.*/ - Filtration_value maximum(Filtration_value a, Filtration_value b, - Filtration_value c) { + static Filtration_value maximum(Filtration_value a, Filtration_value b, + Filtration_value c) { Filtration_value max = (a < b) ? b : a; return ((max < c) ? c : max); } diff --git a/src/Skeleton_blocker/example/Skeleton_blocker_iteration.cpp b/src/Skeleton_blocker/example/Skeleton_blocker_iteration.cpp index 92fa17f3..126e32ec 100644 --- a/src/Skeleton_blocker/example/Skeleton_blocker_iteration.cpp +++ b/src/Skeleton_blocker/example/Skeleton_blocker_iteration.cpp @@ -64,8 +64,10 @@ int main (int argc, char *argv[]){ // or edges, complex.num_vertices() and complex.num_edges() are // more appropriated! unsigned num_vertices = 0; - for(auto v : complex.vertex_range()) - ++num_vertices; + for(auto v : complex.vertex_range()) { + std::cout << "Vertex " << v <<std::endl; + ++num_vertices; + } // such loop can also be done directly with distance as iterators are STL compliant auto edges = complex.edge_range(); diff --git a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker.h b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker.h index 049db6d5..289819b5 100644 --- a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker.h +++ b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker.h @@ -109,7 +109,7 @@ and point access in addition. \subsection Visitor The class Skeleton_blocker_complex has a visitor that is called when usual operations such as adding an edge or remove a vertex are called. -You may want to use this visitor to compute statistics or to update another data-structure (for instance this visitor is heavily used in the \ref contr package. +You may want to use this visitor to compute statistics or to update another data-structure (for instance this visitor is heavily used in the \ref contr package). diff --git a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_simplifiable_complex.h b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_simplifiable_complex.h index 86a12d90..dd8d898e 100644 --- a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_simplifiable_complex.h +++ b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_simplifiable_complex.h @@ -223,7 +223,7 @@ void Skeleton_blocker_complex<SkeletonBlockerDS>::add_simplex(const Simplex_hand for (auto u_it = sigma.begin(); u_it != sigma.end(); ++u_it) for (auto v_it = u_it; ++v_it != sigma.end(); /**/) { - std::cout << "add edge" << *u_it << " " << *v_it << std::endl; + // std::cout << "add edge" << *u_it << " " << *v_it << std::endl; add_edge(*u_it, *v_it); } remove_blocker_include_in_simplex(sigma); |