From 2d8cc490a799d991fee29d923c15368c83d24f85 Mon Sep 17 00:00:00 2001 From: skachano Date: Thu, 11 Feb 2016 14:17:55 +0000 Subject: A small change in sphere example git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/witness@1015 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 4c479a899c1a3686ac53a03affea63bc96208c7c --- src/Witness_complex/example/witness_complex_sphere.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/Witness_complex') diff --git a/src/Witness_complex/example/witness_complex_sphere.cpp b/src/Witness_complex/example/witness_complex_sphere.cpp index 1ff35bff..f9d0b5a2 100644 --- a/src/Witness_complex/example/witness_complex_sphere.cpp +++ b/src/Witness_complex/example/witness_complex_sphere.cpp @@ -90,6 +90,7 @@ int main(int argc, char * const argv[]) { double time = static_cast(end - start) / CLOCKS_PER_SEC; std::cout << "Witness complex for " << nbL << " landmarks took " << time << " s. \n"; + std::cout << "Number of simplices is: " << simplex_tree.num_simplices() << "\n"; l_time.push_back(std::make_pair(nbP, time)); } write_data(l_time, "w_time.dat"); -- cgit v1.2.3 From b7796215d4eac6b4c43ad70998c3737a6527eebb Mon Sep 17 00:00:00 2001 From: skachano Date: Thu, 11 Feb 2016 16:05:15 +0000 Subject: Commited Marc's remarks git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/witness@1017 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: d87eb82f60f4f943f59622f33521bcdce7873091 --- src/Witness_complex/concept/Simplicial_complex.h | 11 ++--------- .../example/witness_complex_from_file.cpp | 13 +------------ src/Witness_complex/example/witness_complex_sphere.cpp | 10 +++++----- .../include/gudhi/Landmark_choice_by_random_point.h | 6 ++++++ src/Witness_complex/include/gudhi/Witness_complex.h | 18 ++++++------------ src/Witness_complex/test/simple_witness_complex.cpp | 2 +- src/Witness_complex/test/witness_complex_points.cpp | 4 ++-- 7 files changed, 23 insertions(+), 41 deletions(-) (limited to 'src/Witness_complex') diff --git a/src/Witness_complex/concept/Simplicial_complex.h b/src/Witness_complex/concept/Simplicial_complex.h index d7f3496d..9e9f2ff8 100644 --- a/src/Witness_complex/concept/Simplicial_complex.h +++ b/src/Witness_complex/concept/Simplicial_complex.h @@ -40,16 +40,11 @@ struct Simplicial_complex { /** Returns a Simplex_hanlde that is different from all simplex handles * of the simplices. */ Simplex_handle null_simplex(); - /** \brief Returns the number of simplices in the complex. - * - * Does not count the empty simplex. */ - size_t num_simplices(); /** \brief Iterator over the simplices of the complex, * in an arbitrary order. * * 'value_type' must be 'Simplex_handle'.*/ - typedef unspecified Complex_simplex_iterator; typedef unspecified Complex_simplex_range; /** @@ -71,19 +66,17 @@ struct Simplicial_complex { */ typedef unspecified Insertion_result_type; - /** \brief Input range of vertices. - * 'value_type' must be 'Vertex_handle'. */ - typedef unspecified Input_vertex_range; - /** \brief Inserts a simplex with vertices from a given range * 'vertex_range' in the simplicial complex. * */ + template< typedef Input_vertex_range > Insertion_result_type insert_simplex(Input_vertex_range const & vertex_range); /** \brief Finds a simplex with vertices given by a range * * If a simplex exists, its Simplex_handle is returned. * Otherwise null_simplex() is returned. */ + template< typedef Input_vertex_range > Simplex_handle find(Input_vertex_range const & vertex_range); }; diff --git a/src/Witness_complex/example/witness_complex_from_file.cpp b/src/Witness_complex/example/witness_complex_from_file.cpp index 77109512..98d1fe9c 100644 --- a/src/Witness_complex/example/witness_complex_from_file.cpp +++ b/src/Witness_complex/example/witness_complex_from_file.cpp @@ -68,17 +68,6 @@ read_points_cust(std::string file_name, std::vector< std::vector< double > > & p in_file.close(); } -/** Write a gnuplot readable file. - * Data range is a random access range of pairs (arg, value) - */ -template < typename Data_range > -void write_data(Data_range & data, std::string filename) { - std::ofstream ofs(filename, std::ofstream::out); - for (auto entry : data) - ofs << entry.first << ", " << entry.second << "\n"; - ofs.close(); -} - int main(int argc, char * const argv[]) { if (argc != 3) { std::cerr << "Usage: " << argv[0] @@ -109,7 +98,7 @@ int main(int argc, char * const argv[]) { // Compute witness complex start = clock(); - WitnessComplex(knn, simplex_tree, nbL, point_vector[0].size()); + WitnessComplex(knn, nbL, point_vector[0].size(), simplex_tree); end = clock(); std::cout << "Witness complex took " << static_cast(end - start) / CLOCKS_PER_SEC << " s. \n"; diff --git a/src/Witness_complex/example/witness_complex_sphere.cpp b/src/Witness_complex/example/witness_complex_sphere.cpp index f9d0b5a2..fae80d67 100644 --- a/src/Witness_complex/example/witness_complex_sphere.cpp +++ b/src/Witness_complex/example/witness_complex_sphere.cpp @@ -60,11 +60,11 @@ void write_data(Data_range & data, std::string filename) { int main(int argc, char * const argv[]) { if (argc != 2) { std::cerr << "Usage: " << argv[0] - << " nbL \n"; + << " number_of_landmarks \n"; return 0; } - int nbL = atoi(argv[1]); + int number_of_landmarks = atoi(argv[1]); clock_t start, end; // Construct the Simplex Tree @@ -82,13 +82,13 @@ int main(int argc, char * const argv[]) { // Choose landmarks start = clock(); std::vector > knn; - Gudhi::witness_complex::landmark_choice_by_random_point(point_vector, nbL, knn); + Gudhi::witness_complex::landmark_choice_by_random_point(point_vector, number_of_landmarks, knn); // Compute witness complex - WitnessComplex(knn, simplex_tree, nbL, point_vector[0].size()); + WitnessComplex(knn, number_of_landmarks, point_vector[0].size(), simplex_tree); end = clock(); double time = static_cast(end - start) / CLOCKS_PER_SEC; - std::cout << "Witness complex for " << nbL << " landmarks took " + std::cout << "Witness complex for " << number_of_landmarks << " landmarks took " << time << " s. \n"; std::cout << "Number of simplices is: " << simplex_tree.num_simplices() << "\n"; l_time.push_back(std::make_pair(nbP, time)); diff --git a/src/Witness_complex/include/gudhi/Landmark_choice_by_random_point.h b/src/Witness_complex/include/gudhi/Landmark_choice_by_random_point.h index dc364007..617c0258 100644 --- a/src/Witness_complex/include/gudhi/Landmark_choice_by_random_point.h +++ b/src/Witness_complex/include/gudhi/Landmark_choice_by_random_point.h @@ -35,6 +35,12 @@ namespace witness_complex { /** \brief Landmark choice strategy by taking random vertices for landmarks. * \details It chooses nbL distinct landmarks from a random access range `points` * and outputs a matrix {witness}*{closest landmarks} in knn. + * + * The type KNearestNeighbors can be seen as + * Witness_range>, where + * Witness_range and Closest_landmark_range are random access ranges and + * Vertex_handle is the label type of a vertex in a simplicial complex. + * Closest_landmark_range needs to have push_back operation. */ template Point_t; typedef std::vector< Point_t > Point_Vector; - // typedef typename Simplicial_complex::Filtration_value Filtration_value; typedef std::vector< Vertex_handle > typeVectorVertex; typedef std::pair< typeVectorVertex, Filtration_value> typeSimplex; typedef std::pair< Simplex_handle, bool > typePairSimplexBool; @@ -109,9 +108,9 @@ class Witness_complex { */ template< typename KNearestNeighbors > Witness_complex(KNearestNeighbors const & knn, - Simplicial_complex & sc_, int nbL_, - int dim) : nbL(nbL_), sc(sc_) { + int dim, + Simplicial_complex & sc_) : nbL(nbL_), sc(sc_) { // Construction of the active witness list int nbW = knn.size(); typeVectorVertex vv; @@ -120,7 +119,7 @@ class Witness_complex { * it will diminuish in the course of iterations */ ActiveWitnessList active_w; // = new ActiveWitnessList(); - for (int i = 0; i != nbL; ++i) { + for (Vertex_handle i = 0; i != nbL; ++i) { // initial fill of 0-dimensional simplices // by doing it we don't assume that landmarks are necessarily witnesses themselves anymore counter++; @@ -131,9 +130,7 @@ class Witness_complex { int k = 1; /* current dimension in iterative construction */ for (int i = 0; i != nbW; ++i) active_w.push_back(i); - // std::cout << "Successfully added edges" << std::endl; while (!active_w.empty() && k < dim) { - // std::cout << "Started the step k=" << k << std::endl; typename ActiveWitnessList::iterator it = active_w.begin(); while (it != active_w.end()) { typeVectorVertex simplex_vector; @@ -142,7 +139,7 @@ class Witness_complex { if (ok) { for (int i = 0; i != k + 1; ++i) simplex_vector.push_back(knn[*it][i]); - sc.insert_simplex(simplex_vector, 0.0); + sc.insert_simplex(simplex_vector); // TODO(SK) Error if not inserted : normally no need here though it++; } else { @@ -162,9 +159,7 @@ class Witness_complex { */ template bool all_faces_in(KNearestNeighbors const &knn, int witness_id, int k) { - // std::cout << "All face in with the landmark " << inserted_vertex << std::endl; std::vector< Vertex_handle > facet; - // Vertex_handle curr_vh = curr_sh->first; // CHECK ALL THE FACETS for (int i = 0; i != k + 1; ++i) { facet = {}; @@ -175,7 +170,6 @@ class Witness_complex { } // endfor if (sc.find(facet) == sc.null_simplex()) return false; - // std::cout << "++++ finished loop safely\n"; } // endfor return true; } @@ -206,12 +200,12 @@ class Witness_complex { bool is_witnessed = false; typeVectorVertex simplex; int nbV = 0; // number of verticed in the simplex - for (int v : sc.simplex_vertex_range(sh)) + for (Vertex_handle v : sc.simplex_vertex_range(sh)) simplex.push_back(v); nbV = simplex.size(); for (typeVectorVertex w : knn) { bool has_vertices = true; - for (int v : simplex) + for (Vertex_handle v : simplex) if (std::find(w.begin(), w.begin() + nbV, v) == w.begin() + nbV) { has_vertices = false; // break; diff --git a/src/Witness_complex/test/simple_witness_complex.cpp b/src/Witness_complex/test/simple_witness_complex.cpp index 7d44b90c..03df78ee 100644 --- a/src/Witness_complex/test/simple_witness_complex.cpp +++ b/src/Witness_complex/test/simple_witness_complex.cpp @@ -53,7 +53,7 @@ BOOST_AUTO_TEST_CASE(simple_witness_complex) { knn.push_back({5, 0, 1, 3, 6, 2, 4}); knn.push_back({5, 6, 1, 0, 2, 3, 4}); knn.push_back({1, 6, 0, 5, 2, 3, 4}); - WitnessComplex witnessComplex(knn, complex, 7, 7); + WitnessComplex witnessComplex(knn, 7, 7, complex); BOOST_CHECK(witnessComplex.is_witness_complex(knn, false)); } diff --git a/src/Witness_complex/test/witness_complex_points.cpp b/src/Witness_complex/test/witness_complex_points.cpp index cb1639e1..bd3df604 100644 --- a/src/Witness_complex/test/witness_complex_points.cpp +++ b/src/Witness_complex/test/witness_complex_points.cpp @@ -52,13 +52,13 @@ BOOST_AUTO_TEST_CASE(witness_complex_points) { Simplex_tree complex1; Gudhi::witness_complex::landmark_choice_by_random_point(points, 100, knn); assert(!knn.empty()); - WitnessComplex witnessComplex1(knn, complex1, 100, 3); + WitnessComplex witnessComplex1(knn, 100, 3, complex1); BOOST_CHECK(witnessComplex1.is_witness_complex(knn, b_print_output)); // Second test: furthest choice knn.clear(); Simplex_tree complex2; Gudhi::witness_complex::landmark_choice_by_furthest_point(points, 100, knn); - WitnessComplex witnessComplex2(knn, complex2, 100, 3); + WitnessComplex witnessComplex2(knn, 100, 3, complex2); BOOST_CHECK(witnessComplex2.is_witness_complex(knn, b_print_output)); } -- cgit v1.2.3 From 6496035f0c8232469bf652c1047eeb66645c1bd6 Mon Sep 17 00:00:00 2001 From: skachano Date: Thu, 11 Feb 2016 16:07:37 +0000 Subject: Changed concept's name to CamelCase git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/witness@1018 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: ddc6e2d57b2dd547407e42da44868d1d0658e57c --- src/Witness_complex/concept/Simplicial_complex.h | 2 +- src/Witness_complex/include/gudhi/Witness_complex.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Witness_complex') diff --git a/src/Witness_complex/concept/Simplicial_complex.h b/src/Witness_complex/concept/Simplicial_complex.h index 9e9f2ff8..74d60388 100644 --- a/src/Witness_complex/concept/Simplicial_complex.h +++ b/src/Witness_complex/concept/Simplicial_complex.h @@ -31,7 +31,7 @@ namespace witness_complex { * for a type to implement a simplicial complex, * used for example to build a 'Witness_complex'. */ -struct Simplicial_complex { +struct SimplicialComplex { /** Handle to specify a simplex. */ typedef unspecified Simplex_handle; /** Handle to specify a vertex. Must be a non-negative integer. */ diff --git a/src/Witness_complex/include/gudhi/Witness_complex.h b/src/Witness_complex/include/gudhi/Witness_complex.h index 3e14a623..455e008a 100644 --- a/src/Witness_complex/include/gudhi/Witness_complex.h +++ b/src/Witness_complex/include/gudhi/Witness_complex.h @@ -52,7 +52,7 @@ namespace witness_complex { \brief Constructs the witness complex for the given set of witnesses and landmarks. \ingroup witness_complex */ -template< class Simplicial_complex> +template< class SimplicialComplex> class Witness_complex { private: struct Active_witness { @@ -81,7 +81,7 @@ class Witness_complex { private: int nbL; // Number of landmarks - Simplicial_complex& sc; // Simplicial complex + SimplicialComplex& sc; // Simplicial complex public: ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -110,7 +110,7 @@ class Witness_complex { Witness_complex(KNearestNeighbors const & knn, int nbL_, int dim, - Simplicial_complex & sc_) : nbL(nbL_), sc(sc_) { + SimplicialComplex & sc_) : nbL(nbL_), sc(sc_) { // Construction of the active witness list int nbW = knn.size(); typeVectorVertex vv; -- cgit v1.2.3 From c9eb5f3526459162fdc241560802b8fa0c5bf6d6 Mon Sep 17 00:00:00 2001 From: skachano Date: Thu, 11 Feb 2016 16:08:34 +0000 Subject: now it compiles... git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/witness@1019 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 5b4cd7b1f767b47190a9bf2f6dd7eab2682df6e8 --- src/Witness_complex/include/gudhi/Witness_complex.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Witness_complex') diff --git a/src/Witness_complex/include/gudhi/Witness_complex.h b/src/Witness_complex/include/gudhi/Witness_complex.h index 455e008a..50058740 100644 --- a/src/Witness_complex/include/gudhi/Witness_complex.h +++ b/src/Witness_complex/include/gudhi/Witness_complex.h @@ -65,8 +65,8 @@ class Witness_complex { }; private: - typedef typename Simplicial_complex::Simplex_handle Simplex_handle; - typedef typename Simplicial_complex::Vertex_handle Vertex_handle; + typedef typename SimplicialComplex::Simplex_handle Simplex_handle; + typedef typename SimplicialComplex::Vertex_handle Vertex_handle; typedef std::vector< double > Point_t; typedef std::vector< Point_t > Point_Vector; -- cgit v1.2.3 From 897f3b6016dac740c5b990c72e2e0ba30cf29963 Mon Sep 17 00:00:00 2001 From: skachano Date: Tue, 16 Feb 2016 13:53:04 +0000 Subject: Moved the doc file + changed notations in Witness_complex.h git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/witness@1023 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 1053d8ac2f833be8086c81b50dbb34c18de07ebb --- src/Witness_complex/doc/Witness_complex_doc.h | 38 ++++++++++++++++++++++ .../include/gudhi/Witness_complex.h | 20 ++++++------ .../include/gudhi/Witness_complex_doc.h | 38 ---------------------- 3 files changed, 48 insertions(+), 48 deletions(-) create mode 100644 src/Witness_complex/doc/Witness_complex_doc.h delete mode 100644 src/Witness_complex/include/gudhi/Witness_complex_doc.h (limited to 'src/Witness_complex') diff --git a/src/Witness_complex/doc/Witness_complex_doc.h b/src/Witness_complex/doc/Witness_complex_doc.h new file mode 100644 index 00000000..e9f78170 --- /dev/null +++ b/src/Witness_complex/doc/Witness_complex_doc.h @@ -0,0 +1,38 @@ +#ifndef WITNESS_COMPLEX_DOC_H_ +#define WITNESS_COMPLEX_DOC_H_ + +/** + \defgroup witness_complex Witness complex + + \author Siargey Kachanovich + + \section Definitions + + Witness complex \f$ Wit(W,L) \f$ is a simplicial complex defined on two sets of points in \f$\mathbb{R}^D\f$: + + \li \f$W\f$ set of **witnesses** and + \li \f$L \subseteq W\f$ set of **landmarks**. + + The simplices are based on landmarks + and a simplex belongs to the witness complex if and only if it is witnessed, that is: + + \f$ \sigma \subset L \f$ is witnessed if there exists a point \f$w \in W\f$ such that + w is closer to the vertices of \f$ \sigma \f$ than other points in \f$ L \f$ and all of its faces are witnessed as well. + + \section Implementation + + The principal class of this module is Gudhi::Witness_complex. + + In both cases, the constructor for this class takes a {witness}x{closest_landmarks} table, where each row represents a witness and consists of landmarks sorted by distance to this witness. + This table can be constructed by two additional classes Landmark_choice_by_furthest_point and Landmark_choice_by_random_point also included in the module. + + *\image html "bench_Cy8.png" "Running time as function on number of landmarks" width=10cm + *\image html "bench_sphere.png" "Running time as function on number of witnesses for |L|=300" width=10cm + + + \copyright GNU General Public License v3. + + + */ + +#endif // WITNESS_COMPLEX_DOC_H_ diff --git a/src/Witness_complex/include/gudhi/Witness_complex.h b/src/Witness_complex/include/gudhi/Witness_complex.h index 50058740..dab80be6 100644 --- a/src/Witness_complex/include/gudhi/Witness_complex.h +++ b/src/Witness_complex/include/gudhi/Witness_complex.h @@ -80,8 +80,8 @@ class Witness_complex { typedef std::list< Vertex_handle > ActiveWitnessList; private: - int nbL; // Number of landmarks - SimplicialComplex& sc; // Simplicial complex + int nbL_; // Number of landmarks + SimplicialComplex& sc_; // Simplicial complex public: ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -108,9 +108,9 @@ class Witness_complex { */ template< typename KNearestNeighbors > Witness_complex(KNearestNeighbors const & knn, - int nbL_, + int nbL, int dim, - SimplicialComplex & sc_) : nbL(nbL_), sc(sc_) { + SimplicialComplex & sc) : nbL_(nbL), sc_(sc) { // Construction of the active witness list int nbW = knn.size(); typeVectorVertex vv; @@ -119,12 +119,12 @@ class Witness_complex { * it will diminuish in the course of iterations */ ActiveWitnessList active_w; // = new ActiveWitnessList(); - for (Vertex_handle i = 0; i != nbL; ++i) { + for (Vertex_handle i = 0; i != nbL_; ++i) { // initial fill of 0-dimensional simplices // by doing it we don't assume that landmarks are necessarily witnesses themselves anymore counter++; vv = {i}; - sc.insert_simplex(vv); + sc_.insert_simplex(vv); // TODO(SK) Error if not inserted : normally no need here though } int k = 1; /* current dimension in iterative construction */ @@ -139,7 +139,7 @@ class Witness_complex { if (ok) { for (int i = 0; i != k + 1; ++i) simplex_vector.push_back(knn[*it][i]); - sc.insert_simplex(simplex_vector); + sc_.insert_simplex(simplex_vector); // TODO(SK) Error if not inserted : normally no need here though it++; } else { @@ -168,7 +168,7 @@ class Witness_complex { facet.push_back(knn[witness_id][j]); } } // endfor - if (sc.find(facet) == sc.null_simplex()) + if (sc_.find(facet) == sc_.null_simplex()) return false; } // endfor return true; @@ -196,11 +196,11 @@ class Witness_complex { template< class KNearestNeighbors > bool is_witness_complex(KNearestNeighbors const & knn, bool print_output) { // bool final_result = true; - for (Simplex_handle sh : sc.complex_simplex_range()) { + for (Simplex_handle sh : sc_.complex_simplex_range()) { bool is_witnessed = false; typeVectorVertex simplex; int nbV = 0; // number of verticed in the simplex - for (Vertex_handle v : sc.simplex_vertex_range(sh)) + for (Vertex_handle v : sc_.simplex_vertex_range(sh)) simplex.push_back(v); nbV = simplex.size(); for (typeVectorVertex w : knn) { diff --git a/src/Witness_complex/include/gudhi/Witness_complex_doc.h b/src/Witness_complex/include/gudhi/Witness_complex_doc.h deleted file mode 100644 index e9f78170..00000000 --- a/src/Witness_complex/include/gudhi/Witness_complex_doc.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef WITNESS_COMPLEX_DOC_H_ -#define WITNESS_COMPLEX_DOC_H_ - -/** - \defgroup witness_complex Witness complex - - \author Siargey Kachanovich - - \section Definitions - - Witness complex \f$ Wit(W,L) \f$ is a simplicial complex defined on two sets of points in \f$\mathbb{R}^D\f$: - - \li \f$W\f$ set of **witnesses** and - \li \f$L \subseteq W\f$ set of **landmarks**. - - The simplices are based on landmarks - and a simplex belongs to the witness complex if and only if it is witnessed, that is: - - \f$ \sigma \subset L \f$ is witnessed if there exists a point \f$w \in W\f$ such that - w is closer to the vertices of \f$ \sigma \f$ than other points in \f$ L \f$ and all of its faces are witnessed as well. - - \section Implementation - - The principal class of this module is Gudhi::Witness_complex. - - In both cases, the constructor for this class takes a {witness}x{closest_landmarks} table, where each row represents a witness and consists of landmarks sorted by distance to this witness. - This table can be constructed by two additional classes Landmark_choice_by_furthest_point and Landmark_choice_by_random_point also included in the module. - - *\image html "bench_Cy8.png" "Running time as function on number of landmarks" width=10cm - *\image html "bench_sphere.png" "Running time as function on number of witnesses for |L|=300" width=10cm - - - \copyright GNU General Public License v3. - - - */ - -#endif // WITNESS_COMPLEX_DOC_H_ -- cgit v1.2.3 From c5469621436305badbc4c5a64380881b6571f7bc Mon Sep 17 00:00:00 2001 From: skachano Date: Tue, 16 Feb 2016 15:02:50 +0000 Subject: Commented is_witness_complex's documentation git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/witness@1026 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 912a482e67e92b02a20db1be8b602ff8576632ae --- .../include/gudhi/Landmark_choice_by_furthest_point.h | 1 + src/Witness_complex/include/gudhi/Witness_complex.h | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'src/Witness_complex') diff --git a/src/Witness_complex/include/gudhi/Landmark_choice_by_furthest_point.h b/src/Witness_complex/include/gudhi/Landmark_choice_by_furthest_point.h index 47cd888d..2491b319 100644 --- a/src/Witness_complex/include/gudhi/Landmark_choice_by_furthest_point.h +++ b/src/Witness_complex/include/gudhi/Landmark_choice_by_furthest_point.h @@ -34,6 +34,7 @@ namespace witness_complex { typedef std::vector typeVectorVertex; /** + * \ingroup witness_complex * \brief Landmark choice strategy by iteratively adding the furthest witness from the * current landmark set as the new landmark. * \details It chooses nbL landmarks from a random access range `points` and diff --git a/src/Witness_complex/include/gudhi/Witness_complex.h b/src/Witness_complex/include/gudhi/Witness_complex.h index dab80be6..046343db 100644 --- a/src/Witness_complex/include/gudhi/Witness_complex.h +++ b/src/Witness_complex/include/gudhi/Witness_complex.h @@ -188,11 +188,11 @@ class Witness_complex { } public: - /** - * \brief Verification if every simplex in the complex is witnessed by witnesses in knn. - * \param print_output =true will print the witnesses for each simplex - * \remark Added for debugging purposes. - */ + // /** + // * \brief Verification if every simplex in the complex is witnessed by witnesses in knn. + // * \param print_output =true will print the witnesses for each simplex + // * \remark Added for debugging purposes. + // */ template< class KNearestNeighbors > bool is_witness_complex(KNearestNeighbors const & knn, bool print_output) { // bool final_result = true; -- cgit v1.2.3 From 67f7ecf8e35b51256304b5120daf2827450b6dcd Mon Sep 17 00:00:00 2001 From: skachano Date: Thu, 18 Feb 2016 13:02:25 +0000 Subject: The rest of changes git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/witness@1031 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: af29326bd4293697211c20001fc120108a38b3f4 --- .../include/gudhi/Landmark_choice_by_furthest_point.h | 7 ++++++- .../include/gudhi/Landmark_choice_by_random_point.h | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'src/Witness_complex') diff --git a/src/Witness_complex/include/gudhi/Landmark_choice_by_furthest_point.h b/src/Witness_complex/include/gudhi/Landmark_choice_by_furthest_point.h index 2491b319..472cc0f7 100644 --- a/src/Witness_complex/include/gudhi/Landmark_choice_by_furthest_point.h +++ b/src/Witness_complex/include/gudhi/Landmark_choice_by_furthest_point.h @@ -39,6 +39,11 @@ namespace witness_complex { * current landmark set as the new landmark. * \details It chooses nbL landmarks from a random access range `points` and * writes {witness}*{closest landmarks} matrix in `knn`. + * + * The type KNearestNeighbors can be seen as + * Witness_range>, where + * Witness_range and Closest_landmark_range are random access ranges + * */ template Date: Fri, 11 Mar 2016 10:36:42 +0000 Subject: Put the class Witness_complex to private in doc git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/witness@1037 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 351b135de4d345830ab7fb796eb69b23063fd494 --- .../example/witness_complex_from_file.cpp | 4 +-- .../example/witness_complex_sphere.cpp | 4 +-- .../include/gudhi/Witness_complex.h | 29 ++++++++++++++++++++++ 3 files changed, 32 insertions(+), 5 deletions(-) (limited to 'src/Witness_complex') diff --git a/src/Witness_complex/example/witness_complex_from_file.cpp b/src/Witness_complex/example/witness_complex_from_file.cpp index 98d1fe9c..a8294bad 100644 --- a/src/Witness_complex/example/witness_complex_from_file.cpp +++ b/src/Witness_complex/example/witness_complex_from_file.cpp @@ -40,7 +40,7 @@ using namespace Gudhi::witness_complex; typedef std::vector< Vertex_handle > typeVectorVertex; typedef std::vector< std::vector > Point_Vector; -typedef Witness_complex< Simplex_tree<> > WitnessComplex; +//typedef Witness_complex< Simplex_tree<> > WitnessComplex; /** * \brief Customized version of read_points @@ -98,7 +98,7 @@ int main(int argc, char * const argv[]) { // Compute witness complex start = clock(); - WitnessComplex(knn, nbL, point_vector[0].size(), simplex_tree); + Gudhi::witness_complex::witness_complex(knn, nbL, point_vector[0].size(), simplex_tree); end = clock(); std::cout << "Witness complex took " << static_cast(end - start) / CLOCKS_PER_SEC << " s. \n"; diff --git a/src/Witness_complex/example/witness_complex_sphere.cpp b/src/Witness_complex/example/witness_complex_sphere.cpp index fae80d67..7bbf983a 100644 --- a/src/Witness_complex/example/witness_complex_sphere.cpp +++ b/src/Witness_complex/example/witness_complex_sphere.cpp @@ -44,8 +44,6 @@ using namespace Gudhi::witness_complex; typedef std::vector< Vertex_handle > typeVectorVertex; -typedef Witness_complex< Simplex_tree<> > WitnessComplex; - /** Write a gnuplot readable file. * Data range is a random access range of pairs (arg, value) */ @@ -85,7 +83,7 @@ int main(int argc, char * const argv[]) { Gudhi::witness_complex::landmark_choice_by_random_point(point_vector, number_of_landmarks, knn); // Compute witness complex - WitnessComplex(knn, number_of_landmarks, point_vector[0].size(), simplex_tree); + Gudhi::witness_complex::witness_complex(knn, number_of_landmarks, point_vector[0].size(), simplex_tree); end = clock(); double time = static_cast(end - start) / CLOCKS_PER_SEC; std::cout << "Witness complex for " << number_of_landmarks << " landmarks took " diff --git a/src/Witness_complex/include/gudhi/Witness_complex.h b/src/Witness_complex/include/gudhi/Witness_complex.h index 046343db..524912cf 100644 --- a/src/Witness_complex/include/gudhi/Witness_complex.h +++ b/src/Witness_complex/include/gudhi/Witness_complex.h @@ -48,6 +48,7 @@ namespace Gudhi { namespace witness_complex { /** + * \private \class Witness_complex \brief Constructs the witness complex for the given set of witnesses and landmarks. \ingroup witness_complex @@ -236,6 +237,34 @@ class Witness_complex { } }; + /** + * \ingroup witness_complex + * \brief Iterative construction of the witness complex. + * \details The witness complex is written in simplicial complex sc_ + * basing on a matrix knn of + * nearest neighbours of the form {witnesses}x{landmarks}. + * + * The type KNearestNeighbors can be seen as + * Witness_range>, where + * Witness_range and Closest_landmark_range are random access ranges. + * + * Procedure takes into account at most (dim+1) + * first landmarks from each landmark range to construct simplices. + * + * Landmarks are supposed to be in [0,nbL_-1] + */ + + + template + void witness_complex(KNearestNeighbors const & knn, + int nbL, + int dim, + SimplicialComplexForWitness & sc) + { + + Witness_complex(knn, nbL, dim, sc); + } + } // namespace witness_complex } // namespace Gudhi -- cgit v1.2.3 From b94ae59cf3441a2aa93824e081baa102abf0c286 Mon Sep 17 00:00:00 2001 From: skachano Date: Fri, 11 Mar 2016 13:33:20 +0000 Subject: concept and documentation git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/witness@1038 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: d96a449cd155761d4ae5c61987046733b864e11e --- src/Witness_complex/concept/Simplicial_complex.h | 87 ---------------------- .../concept/Simplicial_complex_for_witness.h | 87 ++++++++++++++++++++++ .../include/gudhi/Witness_complex.h | 20 ++--- 3 files changed, 97 insertions(+), 97 deletions(-) delete mode 100644 src/Witness_complex/concept/Simplicial_complex.h create mode 100644 src/Witness_complex/concept/Simplicial_complex_for_witness.h (limited to 'src/Witness_complex') diff --git a/src/Witness_complex/concept/Simplicial_complex.h b/src/Witness_complex/concept/Simplicial_complex.h deleted file mode 100644 index 74d60388..00000000 --- a/src/Witness_complex/concept/Simplicial_complex.h +++ /dev/null @@ -1,87 +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): Siargey Kachanovich - * - * Copyright (C) 2014 INRIA Sophia Antipolis-Méditerranée (France) - * - * 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 . - */ - -#ifndef CONCEPT_WITNESS_COMPLEX_SIMPLICIAL_COMPLEX_H_ -#define CONCEPT_WITNESS_COMPLEX_SIMPLICIAL_COMPLEX_H_ - -namespace Gudhi { - -namespace witness_complex { - -/** \brief The concept Simplicial_Complex describes the requirements - * for a type to implement a simplicial complex, - * used for example to build a 'Witness_complex'. - */ -struct SimplicialComplex { - /** Handle to specify a simplex. */ - typedef unspecified Simplex_handle; - /** Handle to specify a vertex. Must be a non-negative integer. */ - typedef unspecified Vertex_handle; - - /** Returns a Simplex_hanlde that is different from all simplex handles - * of the simplices. */ - Simplex_handle null_simplex(); - - /** \brief Iterator over the simplices of the complex, - * in an arbitrary order. - * - * 'value_type' must be 'Simplex_handle'.*/ - typedef unspecified Complex_simplex_range; - - /** - * \brief Returns a range over all the simplices of a - * complex. - */ - Complex_simplex_range complex_simplex_range(); - - /** \brief Iterator over vertices of a simplex. - * - * 'value type' must be 'Vertex_handle'.*/ - typedef unspecified Simplex_vertex_range; - - /** \brief Returns a range over vertices of a given - * simplex. */ - Simplex_vertex_range simplex_vertex_range(Simplex_handle const & simplex); - - /** \brief Return type of an insertion of a simplex - */ - typedef unspecified Insertion_result_type; - - /** \brief Inserts a simplex with vertices from a given range - * 'vertex_range' in the simplicial complex. - * */ - template< typedef Input_vertex_range > - Insertion_result_type insert_simplex(Input_vertex_range const & vertex_range); - - /** \brief Finds a simplex with vertices given by a range - * - * If a simplex exists, its Simplex_handle is returned. - * Otherwise null_simplex() is returned. */ - template< typedef Input_vertex_range > - Simplex_handle find(Input_vertex_range const & vertex_range); -}; - -} // namespace witness_complex - -} // namespace Gudhi - -#endif // CONCEPT_WITNESS_COMPLEX_SIMPLICIAL_COMPLEX_H_ diff --git a/src/Witness_complex/concept/Simplicial_complex_for_witness.h b/src/Witness_complex/concept/Simplicial_complex_for_witness.h new file mode 100644 index 00000000..a4cf3c77 --- /dev/null +++ b/src/Witness_complex/concept/Simplicial_complex_for_witness.h @@ -0,0 +1,87 @@ +/* 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): Siargey Kachanovich + * + * Copyright (C) 2014 INRIA Sophia Antipolis-Méditerranée (France) + * + * 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 . + */ + +#ifndef CONCEPT_WITNESS_COMPLEX_SIMPLICIAL_COMPLEX_H_ +#define CONCEPT_WITNESS_COMPLEX_SIMPLICIAL_COMPLEX_H_ + +namespace Gudhi { + +namespace witness_complex { + +/** \brief The concept Simplicial_Complex describes the requirements + * for a type to implement a simplicial complex, + * used for example to build a 'Witness_complex'. + */ +struct SimplicialComplexForWitness { + /** Handle to specify a simplex. */ + typedef unspecified Simplex_handle; + /** Handle to specify a vertex. Must be a non-negative integer. */ + typedef unspecified Vertex_handle; + + /** Returns a Simplex_hanlde that is different from all simplex handles + * of the simplices. */ + Simplex_handle null_simplex(); + + /** \brief Iterator over the simplices of the complex, + * in an arbitrary order. + * + * 'value_type' must be 'Simplex_handle'.*/ + typedef unspecified Complex_simplex_range; + + /** + * \brief Returns a range over all the simplices of a + * complex. + */ + Complex_simplex_range complex_simplex_range(); + + /** \brief Iterator over vertices of a simplex. + * + * 'value type' must be 'Vertex_handle'.*/ + typedef unspecified Simplex_vertex_range; + + /** \brief Returns a range over vertices of a given + * simplex. */ + Simplex_vertex_range simplex_vertex_range(Simplex_handle const & simplex); + + /** \brief Return type of an insertion of a simplex + */ + typedef unspecified Insertion_result_type; + + /** \brief Inserts a simplex with vertices from a given range + * 'vertex_range' in the simplicial complex. + * */ + template< typedef Input_vertex_range > + Insertion_result_type insert_simplex(Input_vertex_range const & vertex_range); + + /** \brief Finds a simplex with vertices given by a range + * + * If a simplex exists, its Simplex_handle is returned. + * Otherwise null_simplex() is returned. */ + template< typedef Input_vertex_range > + Simplex_handle find(Input_vertex_range const & vertex_range); +}; + +} // namespace witness_complex + +} // namespace Gudhi + +#endif // CONCEPT_WITNESS_COMPLEX_SIMPLICIAL_COMPLEX_H_ diff --git a/src/Witness_complex/include/gudhi/Witness_complex.h b/src/Witness_complex/include/gudhi/Witness_complex.h index 524912cf..60734efe 100644 --- a/src/Witness_complex/include/gudhi/Witness_complex.h +++ b/src/Witness_complex/include/gudhi/Witness_complex.h @@ -47,12 +47,12 @@ namespace Gudhi { namespace witness_complex { -/** - * \private - \class Witness_complex - \brief Constructs the witness complex for the given set of witnesses and landmarks. - \ingroup witness_complex - */ +// /* +// * \private +// \class Witness_complex +// \brief Constructs the witness complex for the given set of witnesses and landmarks. +// \ingroup witness_complex +// */ template< class SimplicialComplex> class Witness_complex { private: @@ -86,14 +86,14 @@ class Witness_complex { public: ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /** @name Constructor + /* @name Constructor */ //@{ // Witness_range> - /** + /* * \brief Iterative construction of the witness complex. * \details The witness complex is written in sc_ basing on a matrix knn of * nearest neighbours of the form {witnesses}x{landmarks}. @@ -154,7 +154,7 @@ class Witness_complex { //@} private: - /** \brief Check if the facets of the k-dimensional simplex witnessed + /* \brief Check if the facets of the k-dimensional simplex witnessed * by witness witness_id are already in the complex. * inserted_vertex is the handle of the (k+1)-th vertex witnessed by witness_id */ @@ -189,7 +189,7 @@ class Witness_complex { } public: - // /** + // /* // * \brief Verification if every simplex in the complex is witnessed by witnesses in knn. // * \param print_output =true will print the witnesses for each simplex // * \remark Added for debugging purposes. -- cgit v1.2.3 From 4b19b4553e909c46b1710fde0bec2b5702e1cb73 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Fri, 18 Mar 2016 15:07:43 +0000 Subject: Fix cpplint/cppcheck issues git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/witness@1054 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 9f850be55ab0565a2004ba23f6a5098aa227a92a --- .../concept/Simplicial_complex_for_witness.h | 6 +++--- .../example/witness_complex_from_file.cpp | 7 +------ src/Witness_complex/example/witness_complex_sphere.cpp | 7 +------ .../include/gudhi/Landmark_choice_by_furthest_point.h | 2 +- .../include/gudhi/Landmark_choice_by_random_point.h | 2 +- src/Witness_complex/include/gudhi/Witness_complex.h | 16 +++++----------- 6 files changed, 12 insertions(+), 28 deletions(-) (limited to 'src/Witness_complex') diff --git a/src/Witness_complex/concept/Simplicial_complex_for_witness.h b/src/Witness_complex/concept/Simplicial_complex_for_witness.h index a4cf3c77..caaf0db6 100644 --- a/src/Witness_complex/concept/Simplicial_complex_for_witness.h +++ b/src/Witness_complex/concept/Simplicial_complex_for_witness.h @@ -20,8 +20,8 @@ * along with this program. If not, see . */ -#ifndef CONCEPT_WITNESS_COMPLEX_SIMPLICIAL_COMPLEX_H_ -#define CONCEPT_WITNESS_COMPLEX_SIMPLICIAL_COMPLEX_H_ +#ifndef CONCEPT_WITNESS_COMPLEX_SIMPLICIAL_COMPLEX_FOR_WITNESS_H_ +#define CONCEPT_WITNESS_COMPLEX_SIMPLICIAL_COMPLEX_FOR_WITNESS_H_ namespace Gudhi { @@ -84,4 +84,4 @@ struct SimplicialComplexForWitness { } // namespace Gudhi -#endif // CONCEPT_WITNESS_COMPLEX_SIMPLICIAL_COMPLEX_H_ +#endif // CONCEPT_WITNESS_COMPLEX_SIMPLICIAL_COMPLEX_FOR_WITNESS_H_ diff --git a/src/Witness_complex/example/witness_complex_from_file.cpp b/src/Witness_complex/example/witness_complex_from_file.cpp index a8294bad..53207ad2 100644 --- a/src/Witness_complex/example/witness_complex_from_file.cpp +++ b/src/Witness_complex/example/witness_complex_from_file.cpp @@ -34,14 +34,9 @@ #include #include -using namespace Gudhi; -using namespace Gudhi::witness_complex; - typedef std::vector< Vertex_handle > typeVectorVertex; typedef std::vector< std::vector > Point_Vector; -//typedef Witness_complex< Simplex_tree<> > WitnessComplex; - /** * \brief Customized version of read_points * which takes into account a possible nbP first line @@ -80,7 +75,7 @@ int main(int argc, char * const argv[]) { clock_t start, end; // Construct the Simplex Tree - Simplex_tree<> simplex_tree; + Gudhi::Simplex_tree<> simplex_tree; // Read the point file Point_Vector point_vector; diff --git a/src/Witness_complex/example/witness_complex_sphere.cpp b/src/Witness_complex/example/witness_complex_sphere.cpp index 7bbf983a..b26c9f36 100644 --- a/src/Witness_complex/example/witness_complex_sphere.cpp +++ b/src/Witness_complex/example/witness_complex_sphere.cpp @@ -39,11 +39,6 @@ #include "generators.h" -using namespace Gudhi; -using namespace Gudhi::witness_complex; - -typedef std::vector< Vertex_handle > typeVectorVertex; - /** Write a gnuplot readable file. * Data range is a random access range of pairs (arg, value) */ @@ -66,7 +61,7 @@ int main(int argc, char * const argv[]) { clock_t start, end; // Construct the Simplex Tree - Simplex_tree<> simplex_tree; + Gudhi::Simplex_tree<> simplex_tree; std::vector< std::pair > l_time; diff --git a/src/Witness_complex/include/gudhi/Landmark_choice_by_furthest_point.h b/src/Witness_complex/include/gudhi/Landmark_choice_by_furthest_point.h index 472cc0f7..86d8ac61 100644 --- a/src/Witness_complex/include/gudhi/Landmark_choice_by_furthest_point.h +++ b/src/Witness_complex/include/gudhi/Landmark_choice_by_furthest_point.h @@ -31,7 +31,7 @@ namespace Gudhi { namespace witness_complex { - typedef std::vector typeVectorVertex; + typedef std::vector typeVectorVertex; /** * \ingroup witness_complex diff --git a/src/Witness_complex/include/gudhi/Landmark_choice_by_random_point.h b/src/Witness_complex/include/gudhi/Landmark_choice_by_random_point.h index 7da74066..a73c04ac 100644 --- a/src/Witness_complex/include/gudhi/Landmark_choice_by_random_point.h +++ b/src/Witness_complex/include/gudhi/Landmark_choice_by_random_point.h @@ -68,7 +68,7 @@ namespace witness_complex { typedef bool (*comp)(dist_i, dist_i); knn = KNearestNeighbours(nbP); for (int points_i = 0; points_i < nbP; points_i++) { - std::priority_queue, comp> l_heap([&](dist_i j1, dist_i j2) { + std::priority_queue, comp> l_heap([](dist_i j1, dist_i j2) { return j1.first > j2.first; }); std::set::iterator landmarks_it; diff --git a/src/Witness_complex/include/gudhi/Witness_complex.h b/src/Witness_complex/include/gudhi/Witness_complex.h index 60734efe..52f374f3 100644 --- a/src/Witness_complex/include/gudhi/Witness_complex.h +++ b/src/Witness_complex/include/gudhi/Witness_complex.h @@ -142,7 +142,7 @@ class Witness_complex { simplex_vector.push_back(knn[*it][i]); sc_.insert_simplex(simplex_vector); // TODO(SK) Error if not inserted : normally no need here though - it++; + ++it; } else { active_w.erase(it++); // First increase the iterator and then erase the previous element } @@ -196,7 +196,6 @@ class Witness_complex { // */ template< class KNearestNeighbors > bool is_witness_complex(KNearestNeighbors const & knn, bool print_output) { - // bool final_result = true; for (Simplex_handle sh : sc_.complex_simplex_range()) { bool is_witnessed = false; typeVectorVertex simplex; @@ -209,7 +208,6 @@ class Witness_complex { for (Vertex_handle v : simplex) if (std::find(w.begin(), w.begin() + nbV, v) == w.begin() + nbV) { has_vertices = false; - // break; } if (has_vertices) { is_witnessed = true; @@ -244,27 +242,23 @@ class Witness_complex { * basing on a matrix knn of * nearest neighbours of the form {witnesses}x{landmarks}. * - * The type KNearestNeighbors can be seen as + * The type KNearestNeighbors can be seen as * Witness_range>, where * Witness_range and Closest_landmark_range are random access ranges. * - * Procedure takes into account at most (dim+1) + * Procedure takes into account at most (dim+1) * first landmarks from each landmark range to construct simplices. * * Landmarks are supposed to be in [0,nbL_-1] */ - - template void witness_complex(KNearestNeighbors const & knn, int nbL, int dim, - SimplicialComplexForWitness & sc) - { - + SimplicialComplexForWitness & sc) { Witness_complex(knn, nbL, dim, sc); } - + } // namespace witness_complex } // namespace Gudhi -- cgit v1.2.3 From c19dafdee66ca80c5bf5e71129d9cca9b9243c92 Mon Sep 17 00:00:00 2001 From: glisse Date: Sun, 20 Mar 2016 13:04:38 +0000 Subject: Let the witness code match its doc better. git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@1057 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 99dc557a03f1ea85730ce286b80e384257ab2a77 --- .../include/gudhi/Landmark_choice_by_furthest_point.h | 14 +++++++++----- .../include/gudhi/Landmark_choice_by_random_point.h | 7 +++++-- src/Witness_complex/include/gudhi/Witness_complex.h | 5 ++--- 3 files changed, 16 insertions(+), 10 deletions(-) (limited to 'src/Witness_complex') diff --git a/src/Witness_complex/include/gudhi/Landmark_choice_by_furthest_point.h b/src/Witness_complex/include/gudhi/Landmark_choice_by_furthest_point.h index 86d8ac61..df93155b 100644 --- a/src/Witness_complex/include/gudhi/Landmark_choice_by_furthest_point.h +++ b/src/Witness_complex/include/gudhi/Landmark_choice_by_furthest_point.h @@ -23,7 +23,10 @@ #ifndef LANDMARK_CHOICE_BY_FURTHEST_POINT_H_ #define LANDMARK_CHOICE_BY_FURTHEST_POINT_H_ +#include + #include // for numeric_limits<> +#include #include // for sort #include @@ -51,7 +54,7 @@ namespace witness_complex { void landmark_choice_by_furthest_point(Point_random_access_range const &points, int nbL, KNearestNeighbours &knn) { - int nb_points = points.end() - points.begin(); + int nb_points = boost::size(points); assert(nb_points >= nbL); // distance matrix witness x landmarks std::vector> wit_land_dist(nb_points, std::vector()); @@ -65,6 +68,7 @@ namespace witness_complex { std::vector< double > dist_to_L(nb_points, infty); // vector of current distances to L from points // TODO(SK) Consider using rand_r(...) instead of rand(...) for improved thread safety + // or better yet std::uniform_int_distribution int rand_int = rand() % nb_points; int curr_max_w = rand_int; // For testing purposes a pseudo-random number is used here @@ -73,7 +77,7 @@ namespace witness_complex { chosen_landmarks.push_back(curr_max_w); unsigned i = 0; for (auto& p : points) { - double curr_dist = euclidean_distance(p, *(points.begin() + chosen_landmarks[current_number_of_landmarks])); + double curr_dist = euclidean_distance(p, *(std::begin(points) + chosen_landmarks[current_number_of_landmarks])); wit_land_dist[i].push_back(curr_dist); knn[i].push_back(current_number_of_landmarks); if (curr_dist < dist_to_L[i]) @@ -87,9 +91,9 @@ namespace witness_complex { curr_max_w = i; } } - for (unsigned i = 0; i < nb_points; ++i) - std::sort(knn[i].begin(), - knn[i].end(), + for (int i = 0; i < nb_points; ++i) + std::sort(std::begin(knn[i]), + std::end(knn[i]), [&wit_land_dist, i](int a, int b) { return wit_land_dist[i][a] < wit_land_dist[i][b]; }); } diff --git a/src/Witness_complex/include/gudhi/Landmark_choice_by_random_point.h b/src/Witness_complex/include/gudhi/Landmark_choice_by_random_point.h index a73c04ac..ebf6aad1 100644 --- a/src/Witness_complex/include/gudhi/Landmark_choice_by_random_point.h +++ b/src/Witness_complex/include/gudhi/Landmark_choice_by_random_point.h @@ -23,8 +23,11 @@ #ifndef LANDMARK_CHOICE_BY_RANDOM_POINT_H_ #define LANDMARK_CHOICE_BY_RANDOM_POINT_H_ +#include + #include // for priority_queue<> #include // for pair<> +#include #include #include @@ -50,7 +53,7 @@ namespace witness_complex { void landmark_choice_by_random_point(Point_random_access_range const &points, int nbL, KNearestNeighbours &knn) { - int nbP = points.end() - points.begin(); + int nbP = boost::size(points); assert(nbP >= nbL); std::set landmarks; int current_number_of_landmarks = 0; // counter for landmarks @@ -63,7 +66,7 @@ namespace witness_complex { landmarks.insert(chosen_landmark); } - int dim = points.begin()->size(); + int dim = boost::size(*std::begin(points)); typedef std::pair dist_i; typedef bool (*comp)(dist_i, dist_i); knn = KNearestNeighbours(nbP); diff --git a/src/Witness_complex/include/gudhi/Witness_complex.h b/src/Witness_complex/include/gudhi/Witness_complex.h index 52f374f3..489cdf11 100644 --- a/src/Witness_complex/include/gudhi/Witness_complex.h +++ b/src/Witness_complex/include/gudhi/Witness_complex.h @@ -28,8 +28,7 @@ #include #include -#include -#include +#include #include @@ -113,7 +112,7 @@ class Witness_complex { int dim, SimplicialComplex & sc) : nbL_(nbL), sc_(sc) { // Construction of the active witness list - int nbW = knn.size(); + int nbW = boost::size(knn); typeVectorVertex vv; int counter = 0; /* The list of still useful witnesses -- cgit v1.2.3 From 607fc8aa10122089aa2b3debf36e48250e2dfb5b Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Fri, 8 Apr 2016 13:34:12 +0000 Subject: Modification on CMakeLists.txt for code coverage were not propagated on these 2 test files git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@1109 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 8dc143d808040f903ac9c5e0b967fcf3fc4c9ba4 --- src/Bitmap_cubical_complex/test/CMakeLists.txt | 4 ---- src/Witness_complex/test/CMakeLists.txt | 4 ---- 2 files changed, 8 deletions(-) (limited to 'src/Witness_complex') diff --git a/src/Bitmap_cubical_complex/test/CMakeLists.txt b/src/Bitmap_cubical_complex/test/CMakeLists.txt index 97c374e6..b6fc8a3b 100644 --- a/src/Bitmap_cubical_complex/test/CMakeLists.txt +++ b/src/Bitmap_cubical_complex/test/CMakeLists.txt @@ -4,14 +4,10 @@ project(GUDHIBitmapCCUT) if (GCOVR_PATH) # for gcovr to make coverage reports - Corbera Jenkins plugin set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage") - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fprofile-arcs -ftest-coverage") - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fprofile-arcs -ftest-coverage") endif() if (GPROF_PATH) # for gprof to make coverage reports - Jenkins set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg") - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -pg") - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -pg") endif() add_executable ( BitmapCCUT Bitmap_test.cpp ) diff --git a/src/Witness_complex/test/CMakeLists.txt b/src/Witness_complex/test/CMakeLists.txt index 9422c152..37bef2d0 100644 --- a/src/Witness_complex/test/CMakeLists.txt +++ b/src/Witness_complex/test/CMakeLists.txt @@ -4,14 +4,10 @@ project(GUDHIWitnessComplexUT) if (GCOVR_PATH) # for gcovr to make coverage reports - Corbera Jenkins plugin set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage") - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fprofile-arcs -ftest-coverage") - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fprofile-arcs -ftest-coverage") endif() if (GPROF_PATH) # for gprof to make coverage reports - Jenkins set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pg") - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -pg") - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -pg") endif() add_executable ( simple_witness_complexUT simple_witness_complex.cpp ) -- cgit v1.2.3 From 75a8bf8132d2bade9ccc31147db00bf29eeb7589 Mon Sep 17 00:00:00 2001 From: cjamin Date: Tue, 7 Jun 2016 14:59:23 +0000 Subject: Rename projects in CMakeLists.txt git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/fix_naming@1257 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: a51e43d795b0c246d0949c7566aa57d3e15925c7 --- src/Alpha_complex/example/CMakeLists.txt | 2 +- src/Alpha_complex/test/CMakeLists.txt | 2 +- src/Bitmap_cubical_complex/example/CMakeLists.txt | 2 +- src/Bitmap_cubical_complex/test/CMakeLists.txt | 2 +- src/Bottleneck/example/CMakeLists.txt | 2 +- src/Bottleneck/test/CMakeLists.txt | 2 +- src/Contraction/example/CMakeLists.txt | 2 +- src/Persistent_cohomology/example/CMakeLists.txt | 2 +- src/Persistent_cohomology/test/CMakeLists.txt | 2 +- src/Simplex_tree/example/CMakeLists.txt | 2 +- src/Simplex_tree/test/CMakeLists.txt | 2 +- src/Skeleton_blocker/example/CMakeLists.txt | 2 +- src/Skeleton_blocker/test/CMakeLists.txt | 2 +- src/Witness_complex/example/CMakeLists.txt | 2 +- src/Witness_complex/test/CMakeLists.txt | 2 +- src/common/example/CMakeLists.txt | 2 +- src/common/test/CMakeLists.txt | 2 +- 17 files changed, 17 insertions(+), 17 deletions(-) (limited to 'src/Witness_complex') diff --git a/src/Alpha_complex/example/CMakeLists.txt b/src/Alpha_complex/example/CMakeLists.txt index f1346867..36d3cb1f 100644 --- a/src/Alpha_complex/example/CMakeLists.txt +++ b/src/Alpha_complex/example/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 2.6) -project(GUDHIAlphaShapesExample) +project(Alpha_shapes_examples) # need CGAL 4.7 # cmake -DCGAL_DIR=~/workspace/CGAL-4.7-Ic-41 ../../.. diff --git a/src/Alpha_complex/test/CMakeLists.txt b/src/Alpha_complex/test/CMakeLists.txt index e24588d7..d4b34126 100644 --- a/src/Alpha_complex/test/CMakeLists.txt +++ b/src/Alpha_complex/test/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 2.6) -project(GUDHIAlphaComplexTest) +project(Alpha_shapes_tests) if (GCOVR_PATH) # for gcovr to make coverage reports - Corbera Jenkins plugin diff --git a/src/Bitmap_cubical_complex/example/CMakeLists.txt b/src/Bitmap_cubical_complex/example/CMakeLists.txt index ad86b763..b26999d0 100644 --- a/src/Bitmap_cubical_complex/example/CMakeLists.txt +++ b/src/Bitmap_cubical_complex/example/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 2.6) -project(GUDHIBitmap) +project(Bitmap_cubical_complex_examples) add_executable ( Bitmap_cubical_complex Bitmap_cubical_complex.cpp ) target_link_libraries(Bitmap_cubical_complex ${Boost_SYSTEM_LIBRARY}) diff --git a/src/Bitmap_cubical_complex/test/CMakeLists.txt b/src/Bitmap_cubical_complex/test/CMakeLists.txt index 0e5340c7..e98251c2 100644 --- a/src/Bitmap_cubical_complex/test/CMakeLists.txt +++ b/src/Bitmap_cubical_complex/test/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 2.6) -project(GUDHIBitmapCCUT) +project(Bitmap_cubical_complex_tests) if (GCOVR_PATH) # for gcovr to make coverage reports - Corbera Jenkins plugin diff --git a/src/Bottleneck/example/CMakeLists.txt b/src/Bottleneck/example/CMakeLists.txt index 2ff009c4..77797202 100644 --- a/src/Bottleneck/example/CMakeLists.txt +++ b/src/Bottleneck/example/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 2.6) -project(GUDHIBottleneckExample) +project(Bottleneck_examples) add_executable ( RandomDiagrams random_diagrams.cpp ) add_test(RandomDiagrams ${CMAKE_CURRENT_BINARY_DIR}/RandomDiagrams) diff --git a/src/Bottleneck/test/CMakeLists.txt b/src/Bottleneck/test/CMakeLists.txt index ad63c080..9d88ab25 100644 --- a/src/Bottleneck/test/CMakeLists.txt +++ b/src/Bottleneck/test/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 2.6) -project(GUDHIBottleneckUT) +project(Bottleneck_tests) if (GCOVR_PATH) # for gcovr to make coverage reports - Corbera Jenkins plugin diff --git a/src/Contraction/example/CMakeLists.txt b/src/Contraction/example/CMakeLists.txt index 4889b82f..b8384cb3 100644 --- a/src/Contraction/example/CMakeLists.txt +++ b/src/Contraction/example/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 2.6) -project(GUDHIskbl) +project(Contraction_examples) add_executable(RipsContraction Rips_contraction.cpp) diff --git a/src/Persistent_cohomology/example/CMakeLists.txt b/src/Persistent_cohomology/example/CMakeLists.txt index 186a6c33..f85c50f9 100644 --- a/src/Persistent_cohomology/example/CMakeLists.txt +++ b/src/Persistent_cohomology/example/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 2.6) -project(GUDHIExPersCohom) +project(Persistent_cohomology_examples) # problem with Visual Studio link on Boost program_options add_definitions( -DBOOST_ALL_NO_LIB ) diff --git a/src/Persistent_cohomology/test/CMakeLists.txt b/src/Persistent_cohomology/test/CMakeLists.txt index a034031a..ff6b38a6 100644 --- a/src/Persistent_cohomology/test/CMakeLists.txt +++ b/src/Persistent_cohomology/test/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 2.6) -project(GUDHIPersistentCohomologyUT) +project(Persistent_cohomology_tests) if (GCOVR_PATH) # for gcovr to make coverage reports - Corbera Jenkins plugin diff --git a/src/Simplex_tree/example/CMakeLists.txt b/src/Simplex_tree/example/CMakeLists.txt index 89a4e053..d3013c50 100644 --- a/src/Simplex_tree/example/CMakeLists.txt +++ b/src/Simplex_tree/example/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 2.6) -project(GUDHISimplexTreeFromFile) +project(Simplex_tree_examples) add_executable ( simplex_tree_from_cliques_of_graph simplex_tree_from_cliques_of_graph.cpp ) if (TBB_FOUND) diff --git a/src/Simplex_tree/test/CMakeLists.txt b/src/Simplex_tree/test/CMakeLists.txt index 609d8669..7ed0ce75 100644 --- a/src/Simplex_tree/test/CMakeLists.txt +++ b/src/Simplex_tree/test/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 2.6) -project(GUDHISimplexTreeUT) +project(Simplex_tree_tests) if (GCOVR_PATH) # for gcovr to make coverage reports - Corbera Jenkins plugin diff --git a/src/Skeleton_blocker/example/CMakeLists.txt b/src/Skeleton_blocker/example/CMakeLists.txt index de0c7bba..cc7f37f3 100644 --- a/src/Skeleton_blocker/example/CMakeLists.txt +++ b/src/Skeleton_blocker/example/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 2.6) -project(GUDHIskbl) +project(Skeleton_blocker_examples) add_executable(SkeletonBlockerFromSimplices Skeleton_blocker_from_simplices.cpp) add_executable(SkeletonBlockerIteration Skeleton_blocker_iteration.cpp) diff --git a/src/Skeleton_blocker/test/CMakeLists.txt b/src/Skeleton_blocker/test/CMakeLists.txt index 5e063845..a4576b36 100644 --- a/src/Skeleton_blocker/test/CMakeLists.txt +++ b/src/Skeleton_blocker/test/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 2.6) -project(GUDHIskbl) +project(Skeleton_blocker_tests) if (GCOVR_PATH) # for gcovr to make coverage reports - Corbera Jenkins plugin diff --git a/src/Witness_complex/example/CMakeLists.txt b/src/Witness_complex/example/CMakeLists.txt index b304479e..e6a916cd 100644 --- a/src/Witness_complex/example/CMakeLists.txt +++ b/src/Witness_complex/example/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 2.6) -project(GUDHIWitnessComplex) +project(Witness_complex_examples) # A simple example add_executable( witness_complex_from_file witness_complex_from_file.cpp ) diff --git a/src/Witness_complex/test/CMakeLists.txt b/src/Witness_complex/test/CMakeLists.txt index 37bef2d0..bb55b0f1 100644 --- a/src/Witness_complex/test/CMakeLists.txt +++ b/src/Witness_complex/test/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 2.6) -project(GUDHIWitnessComplexUT) +project(Witness_complex_tests) if (GCOVR_PATH) # for gcovr to make coverage reports - Corbera Jenkins plugin diff --git a/src/common/example/CMakeLists.txt b/src/common/example/CMakeLists.txt index 83f874e1..59ee12c4 100644 --- a/src/common/example/CMakeLists.txt +++ b/src/common/example/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 2.6) -project(GUDHIDelaunayTriangulationOffFileReadWrite) +project(Common_examples) # need CGAL 4.7 if(CGAL_FOUND) diff --git a/src/common/test/CMakeLists.txt b/src/common/test/CMakeLists.txt index 789546ae..5f9c5dde 100644 --- a/src/common/test/CMakeLists.txt +++ b/src/common/test/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 2.6) -project(GUDHIDelaunayTriangulationOffFileReadWriteUT) +project(Common_tests) if (GCOVR_PATH) # for gcovr to make coverage reports - Corbera Jenkins plugin -- cgit v1.2.3 From 2ef73a660a093b8350edea9474e887cd6792f8e8 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Fri, 1 Jul 2016 09:26:36 +0000 Subject: Eigen3 find_package factorization CGAL find package in root CMakeLists.txt for Witness complex git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/eigen3_cmake_factorization@1377 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 32137f7687837c63ecfab3a2d11114b27873a1f2 --- CMakeLists.txt | 18 ++++-- data/points/generator/CMakeLists.txt | 6 -- src/Alpha_complex/example/CMakeLists.txt | 10 +--- src/Alpha_complex/test/CMakeLists.txt | 11 +--- src/CMakeLists.txt | 10 ++++ src/Persistent_cohomology/example/CMakeLists.txt | 71 ++++++++++-------------- src/Witness_complex/example/CMakeLists.txt | 24 -------- src/common/example/CMakeLists.txt | 9 +-- src/common/test/CMakeLists.txt | 8 +-- 9 files changed, 62 insertions(+), 105 deletions(-) (limited to 'src/Witness_complex') diff --git a/CMakeLists.txt b/CMakeLists.txt index 9e85be8a..1d151455 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,9 +20,11 @@ else() find_package(GMP) if(GMP_FOUND) + message(STATUS "GMP_LIBRARIES = ${GMP_LIBRARIES}") INCLUDE_DIRECTORIES(${GMP_INCLUDE_DIR}) find_package(GMPXX) if(GMPXX_FOUND) + message(STATUS "GMPXX_LIBRARIES = ${GMPXX_LIBRARIES}") INCLUDE_DIRECTORIES(${GMPXX_INCLUDE_DIR}) endif() endif() @@ -40,6 +42,7 @@ else() unset(CGAL_FOUND) endif() if(CGAL_FOUND) + message(STATUS "CGAL version: ${CGAL_VERSION}.") include( ${CGAL_USE_FILE} ) endif() @@ -69,6 +72,13 @@ else() add_definitions(-DGUDHI_USE_TBB) endif() + find_package(Eigen3 3.1.0) + if (EIGEN3_FOUND) + message(STATUS "Eigen3 version: ${EIGEN3_VERSION}.") + include( ${EIGEN3_USE_FILE} ) + #include_directories (BEFORE "../../include") + endif (EIGEN3_FOUND) + # Required programs for unitary tests purpose FIND_PROGRAM( GCOVR_PATH gcovr ) if (GCOVR_PATH) @@ -79,10 +89,10 @@ else() if (GPROF_PATH) message("gprof found in ${GPROF_PATH}") endif() -FIND_PROGRAM( DIFF_PATH diff ) -if (DIFF_PATH) - message("diff found in ${DIFF_PATH}") -endif() + FIND_PROGRAM( DIFF_PATH diff ) + if (DIFF_PATH) + message("diff found in ${DIFF_PATH}") + endif() # BOOST ISSUE result_of vs C++11 add_definitions(-DBOOST_RESULT_OF_USE_DECLTYPE) diff --git a/data/points/generator/CMakeLists.txt b/data/points/generator/CMakeLists.txt index 13fb84fd..e29eb19c 100644 --- a/data/points/generator/CMakeLists.txt +++ b/data/points/generator/CMakeLists.txt @@ -3,13 +3,7 @@ project(Data_points_generator) if(CGAL_FOUND) if (NOT CGAL_VERSION VERSION_LESS 4.6.0) - message(STATUS "CGAL version: ${CGAL_VERSION}.") - - find_package(Eigen3 3.1.0) if (EIGEN3_FOUND) - include( ${EIGEN3_USE_FILE} ) - include_directories (BEFORE "../../include") - add_executable ( hypergenerator hypergenerator.cpp ) target_link_libraries(hypergenerator ${Boost_SYSTEM_LIBRARY}) add_test(hypergenerator_on_sphere_3000_10_5.0 ${CMAKE_CURRENT_BINARY_DIR}/hypergenerator on sphere onSphere.off 3000 10 5.0) diff --git a/src/Alpha_complex/example/CMakeLists.txt b/src/Alpha_complex/example/CMakeLists.txt index c0ecf0d1..f1c7ae97 100644 --- a/src/Alpha_complex/example/CMakeLists.txt +++ b/src/Alpha_complex/example/CMakeLists.txt @@ -5,13 +5,7 @@ project(Alpha_complex_examples) # cmake -DCGAL_DIR=~/workspace/CGAL-4.7-Ic-41 ../../.. if(CGAL_FOUND) if (NOT CGAL_VERSION VERSION_LESS 4.7.0) - message(STATUS "CGAL version: ${CGAL_VERSION}.") - - find_package(Eigen3 3.1.0) if (EIGEN3_FOUND) - message(STATUS "Eigen3 version: ${EIGEN3_VERSION}.") - include( ${EIGEN3_USE_FILE} ) - add_executable ( alphapoints Alpha_complex_from_points.cpp ) target_link_libraries(alphapoints ${Boost_SYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY} ${CGAL_LIBRARY}) add_executable ( alphaoffreader Alpha_complex_from_off.cpp ) @@ -35,9 +29,9 @@ if(CGAL_FOUND) add_test(alphaoffreader_doc_32_diff_files ${DIFF_PATH} ${CMAKE_CURRENT_BINARY_DIR}/alphaoffreader_result_32.txt ${CMAKE_CURRENT_BINARY_DIR}/alphaoffreader_for_doc_32.txt) endif() else() - message(WARNING "Eigen3 not found. Version 3.1.0 is required for Alpha shapes feature.") + message(WARNING "Eigen3 not found. Version 3.1.0 is required for Alpha complex examples.") endif() else() - message(WARNING "CGAL version: ${CGAL_VERSION} is too old to compile Alpha shapes feature. Version 4.6.0 is required.") + message(WARNING "CGAL version: ${CGAL_VERSION} is too old to compile Alpha complex examples. Version 4.7.0 is required.") endif () endif() diff --git a/src/Alpha_complex/test/CMakeLists.txt b/src/Alpha_complex/test/CMakeLists.txt index dae0d45f..b0723a41 100644 --- a/src/Alpha_complex/test/CMakeLists.txt +++ b/src/Alpha_complex/test/CMakeLists.txt @@ -14,14 +14,7 @@ endif() # cmake -DCGAL_DIR=~/workspace/CGAL-4.7-Ic-41 ../../.. if(CGAL_FOUND) if (NOT CGAL_VERSION VERSION_LESS 4.7.0) - message(STATUS "CGAL version: ${CGAL_VERSION}.") - - find_package(Eigen3 3.1.0) if (EIGEN3_FOUND) - message(STATUS "Eigen3 version: ${EIGEN3_VERSION}.") - include( ${EIGEN3_USE_FILE} ) - include_directories (BEFORE "../../include") - add_executable ( AlphaComplexUT Alpha_complex_unit_test.cpp ) target_link_libraries(AlphaComplexUT ${Boost_SYSTEM_LIBRARY} ${Boost_THREAD_LIBRARY} ${CGAL_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) if (TBB_FOUND) @@ -36,10 +29,10 @@ if(CGAL_FOUND) --log_format=XML --log_sink=${CMAKE_SOURCE_DIR}/AlphaComplexUT.xml --log_level=test_suite --report_level=no) else() - message(WARNING "Eigen3 not found. Version 3.1.0 is required for Alpha complex feature.") + message(WARNING "Eigen3 not found. Version 3.1.0 is required for Alpha complex unitary tests.") endif() else() - message(WARNING "CGAL version: ${CGAL_VERSION} is too old to compile Alpha complex feature. Version 4.6.0 is required.") + message(WARNING "CGAL version: ${CGAL_VERSION} is too old to compile Alpha complex unitary tests. Version 4.7.0 is required.") endif () endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e55e4395..80f6e1ff 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -17,9 +17,11 @@ else() find_package(GMP) if(GMP_FOUND) + message(STATUS "GMP_LIBRARIES = ${GMP_LIBRARIES}") INCLUDE_DIRECTORIES(${GMP_INCLUDE_DIR}) find_package(GMPXX) if(GMPXX_FOUND) + message(STATUS "GMPXX_LIBRARIES = ${GMPXX_LIBRARIES}") INCLUDE_DIRECTORIES(${GMPXX_INCLUDE_DIR}) endif() endif() @@ -37,6 +39,7 @@ else() unset(CGAL_FOUND) endif() if(CGAL_FOUND) + message(STATUS "CGAL version: ${CGAL_VERSION}.") include( ${CGAL_USE_FILE} ) endif() @@ -66,6 +69,13 @@ else() add_definitions(-DGUDHI_USE_TBB) endif() + find_package(Eigen3 3.1.0) + if (EIGEN3_FOUND) + message(STATUS "Eigen3 version: ${EIGEN3_VERSION}.") + include( ${EIGEN3_USE_FILE} ) + #include_directories (BEFORE "../../include") + endif (EIGEN3_FOUND) + # BOOST ISSUE result_of vs C++11 add_definitions(-DBOOST_RESULT_OF_USE_DECLTYPE) # BOOST ISSUE with Libraries name resolution under Windows diff --git a/src/Persistent_cohomology/example/CMakeLists.txt b/src/Persistent_cohomology/example/CMakeLists.txt index 5fb4ba12..94b9fbfa 100644 --- a/src/Persistent_cohomology/example/CMakeLists.txt +++ b/src/Persistent_cohomology/example/CMakeLists.txt @@ -36,11 +36,7 @@ add_test(persistence_from_file_3_2_0 ${CMAKE_CURRENT_BINARY_DIR}/persistence_fro add_test(persistence_from_file_3_3_100 ${CMAKE_CURRENT_BINARY_DIR}/persistence_from_file ${CMAKE_SOURCE_DIR}/data/points/bunny_5000.st -p 3 -m 100) if(GMP_FOUND) - message("GMP_LIBRARIES = ${GMP_LIBRARIES}") - if(GMPXX_FOUND) - message("GMPXX_LIBRARIES = ${GMPXX_LIBRARIES}") - add_executable(rips_multifield_persistence rips_multifield_persistence.cpp ) target_link_libraries(rips_multifield_persistence ${Boost_SYSTEM_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY} ${GMPXX_LIBRARIES} ${GMP_LIBRARIES}) add_executable ( performance_rips_persistence performance_rips_persistence.cpp ) @@ -56,49 +52,42 @@ else() # message(WARNING "GMP not found.") endif(GMP_FOUND) - if(CGAL_FOUND) - add_executable(alpha_complex_3d_persistence alpha_complex_3d_persistence.cpp) - target_link_libraries(alpha_complex_3d_persistence ${Boost_SYSTEM_LIBRARY} ${CGAL_LIBRARY}) - - if (TBB_FOUND) - target_link_libraries(alpha_complex_3d_persistence ${TBB_LIBRARIES}) - endif(TBB_FOUND) - add_test(alpha_complex_3d_persistence_2_0_5 ${CMAKE_CURRENT_BINARY_DIR}/alpha_complex_3d_persistence ${CMAKE_SOURCE_DIR}/data/points/tore3D_300.off 2 0.45) - +if(CGAL_FOUND) + add_executable(alpha_complex_3d_persistence alpha_complex_3d_persistence.cpp) + target_link_libraries(alpha_complex_3d_persistence ${Boost_SYSTEM_LIBRARY} ${CGAL_LIBRARY}) - if (NOT CGAL_VERSION VERSION_LESS 4.7.0) - message(STATUS "CGAL version: ${CGAL_VERSION}.") + if (TBB_FOUND) + target_link_libraries(alpha_complex_3d_persistence ${TBB_LIBRARIES}) + endif(TBB_FOUND) + add_test(alpha_complex_3d_persistence_2_0_5 ${CMAKE_CURRENT_BINARY_DIR}/alpha_complex_3d_persistence ${CMAKE_SOURCE_DIR}/data/points/tore3D_300.off 2 0.45) - find_package(Eigen3 3.1.0) - if (EIGEN3_FOUND) - message(STATUS "Eigen3 version: ${EIGEN3_VERSION}.") - include( ${EIGEN3_USE_FILE} ) - add_executable (alpha_complex_persistence alpha_complex_persistence.cpp) - target_link_libraries(alpha_complex_persistence ${Boost_SYSTEM_LIBRARY} ${CGAL_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY}) + if (NOT CGAL_VERSION VERSION_LESS 4.7.0) + if (EIGEN3_FOUND) + add_executable (alpha_complex_persistence alpha_complex_persistence.cpp) + target_link_libraries(alpha_complex_persistence ${Boost_SYSTEM_LIBRARY} ${CGAL_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY}) - add_executable(periodic_alpha_complex_3d_persistence periodic_alpha_complex_3d_persistence.cpp) - target_link_libraries(periodic_alpha_complex_3d_persistence ${Boost_SYSTEM_LIBRARY} ${CGAL_LIBRARY}) + add_executable(periodic_alpha_complex_3d_persistence periodic_alpha_complex_3d_persistence.cpp) + target_link_libraries(periodic_alpha_complex_3d_persistence ${Boost_SYSTEM_LIBRARY} ${CGAL_LIBRARY}) - add_executable(custom_persistence_sort custom_persistence_sort.cpp) - target_link_libraries(custom_persistence_sort ${Boost_SYSTEM_LIBRARY} ${CGAL_LIBRARY}) + add_executable(custom_persistence_sort custom_persistence_sort.cpp) + target_link_libraries(custom_persistence_sort ${Boost_SYSTEM_LIBRARY} ${CGAL_LIBRARY}) - if (TBB_FOUND) - target_link_libraries(alpha_complex_persistence ${TBB_LIBRARIES}) - target_link_libraries(periodic_alpha_complex_3d_persistence ${TBB_LIBRARIES}) - target_link_libraries(custom_persistence_sort ${TBB_LIBRARIES}) - endif(TBB_FOUND) - add_test(alpha_complex_persistence_2_0_45 ${CMAKE_CURRENT_BINARY_DIR}/alpha_complex_persistence ${CMAKE_SOURCE_DIR}/data/points/tore3D_300.off -m 0.45 -p 2) - add_test(periodic_alpha_complex_3d_persistence_2_0 ${CMAKE_CURRENT_BINARY_DIR}/periodic_alpha_complex_3d_persistence ${CMAKE_SOURCE_DIR}/data/points/grid_10_10_10_in_0_1.off ${CMAKE_SOURCE_DIR}/data/points/iso_cuboid_3_in_0_1.txt 2 0) - add_test(custom_persistence_sort ${CMAKE_CURRENT_BINARY_DIR}/custom_persistence_sort) + if (TBB_FOUND) + target_link_libraries(alpha_complex_persistence ${TBB_LIBRARIES}) + target_link_libraries(periodic_alpha_complex_3d_persistence ${TBB_LIBRARIES}) + target_link_libraries(custom_persistence_sort ${TBB_LIBRARIES}) + endif(TBB_FOUND) + add_test(alpha_complex_persistence_2_0_45 ${CMAKE_CURRENT_BINARY_DIR}/alpha_complex_persistence ${CMAKE_SOURCE_DIR}/data/points/tore3D_300.off -m 0.45 -p 2) + add_test(periodic_alpha_complex_3d_persistence_2_0 ${CMAKE_CURRENT_BINARY_DIR}/periodic_alpha_complex_3d_persistence ${CMAKE_SOURCE_DIR}/data/points/grid_10_10_10_in_0_1.off ${CMAKE_SOURCE_DIR}/data/points/iso_cuboid_3_in_0_1.txt 2 0) + add_test(custom_persistence_sort ${CMAKE_CURRENT_BINARY_DIR}/custom_persistence_sort) - else() - message(WARNING "Eigen3 not found. Version 3.1.0 is required for Alpha shapes feature.") - endif(EIGEN3_FOUND) else() - message(WARNING "CGAL version: ${CGAL_VERSION} is too old to compile Alpha shapes feature. Version 4.6.0 is required.") - endif () + message(WARNING "Eigen3 not found. Version 3.1.0 is required for Alpha complex persistence examples.") + endif(EIGEN3_FOUND) else() - # message(WARNING "CGAL not found.") - endif(CGAL_FOUND) - + message(WARNING "CGAL version: ${CGAL_VERSION} is too old to compile Alpha complex persistence examples. Version 4.7.0 is required.") + endif () +else() + # message(WARNING "CGAL not found.") +endif(CGAL_FOUND) diff --git a/src/Witness_complex/example/CMakeLists.txt b/src/Witness_complex/example/CMakeLists.txt index e6a916cd..48ba9279 100644 --- a/src/Witness_complex/example/CMakeLists.txt +++ b/src/Witness_complex/example/CMakeLists.txt @@ -7,31 +7,7 @@ project(Witness_complex_examples) if(CGAL_FOUND) if (NOT CGAL_VERSION VERSION_LESS 4.6.0) - message(STATUS "CGAL version: ${CGAL_VERSION}.") - - include( ${CGAL_USE_FILE} ) - # In CMakeLists.txt, when include(${CGAL_USE_FILE}), CXX_FLAGS are overwritten. - # cf. http://doc.cgal.org/latest/Manual/installation.html#title40 - # A workaround is to add "-std=c++11" again. - # A fix would be to use https://cmake.org/cmake/help/v3.1/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.html - # or even better https://cmake.org/cmake/help/v3.1/variable/CMAKE_CXX_STANDARD.html - # but it implies to use cmake version 3.1 at least. - if(NOT MSVC) - include(CheckCXXCompilerFlag) - CHECK_CXX_COMPILER_FLAG(-std=c++11 COMPILER_SUPPORTS_CXX11) - if(COMPILER_SUPPORTS_CXX11) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") - endif() - endif() - # - End of workaround - - find_package(Eigen3 3.1.0) if (EIGEN3_FOUND) - message(STATUS "Eigen3 version: ${EIGEN3_VERSION}.") - include( ${EIGEN3_USE_FILE} ) - message(STATUS "Eigen3 use file: ${EIGEN3_USE_FILE}.") - include_directories (BEFORE "../../include") - add_executable ( witness_complex_sphere witness_complex_sphere.cpp ) target_link_libraries(witness_complex_sphere ${Boost_SYSTEM_LIBRARY} ${CGAL_LIBRARY}) add_test( witness_complex_sphere_10 ${CMAKE_CURRENT_BINARY_DIR}/witness_complex_sphere 10) diff --git a/src/common/example/CMakeLists.txt b/src/common/example/CMakeLists.txt index 59ee12c4..4ea8c9cb 100644 --- a/src/common/example/CMakeLists.txt +++ b/src/common/example/CMakeLists.txt @@ -8,19 +8,14 @@ if(CGAL_FOUND) add_test(cgal3Doffreader ${CMAKE_CURRENT_BINARY_DIR}/cgal3Doffreader ${CMAKE_SOURCE_DIR}/data/points/tore3D_300.off) if (NOT CGAL_VERSION VERSION_LESS 4.7.0) - find_package(Eigen3 3.1.0) if (EIGEN3_FOUND) - message(STATUS "Eigen3 version: ${EIGEN3_VERSION}.") - include( ${EIGEN3_USE_FILE} ) - add_executable ( cgaloffreader CGAL_points_off_reader.cpp ) target_link_libraries(cgaloffreader ${Boost_SYSTEM_LIBRARY} ${CGAL_LIBRARY}) add_test(cgaloffreader ${CMAKE_CURRENT_BINARY_DIR}/cgaloffreader ${CMAKE_SOURCE_DIR}/data/points/alphacomplexdoc.off) - else() - message(WARNING "Eigen3 not found. Version 3.1.0 is required for Alpha shapes feature.") + message(WARNING "Eigen3 not found. Version 3.1.0 is required for cgaloffreader example.") endif() else() - message(WARNING "CGAL version: ${CGAL_VERSION} is too old to compile Alpha shapes feature. Version 4.6.0 is required.") + message(WARNING "CGAL version: ${CGAL_VERSION} is too old to compile cgaloffreader example. Version 4.7.0 is required.") endif () endif() diff --git a/src/common/test/CMakeLists.txt b/src/common/test/CMakeLists.txt index 5f9c5dde..0a88cf8e 100644 --- a/src/common/test/CMakeLists.txt +++ b/src/common/test/CMakeLists.txt @@ -13,11 +13,7 @@ endif() # need CGAL 4.7 if(CGAL_FOUND) if (NOT CGAL_VERSION VERSION_LESS 4.7.0) - find_package(Eigen3 3.1.0) if (EIGEN3_FOUND) - message(STATUS "Eigen3 version: ${EIGEN3_VERSION}.") - include( ${EIGEN3_USE_FILE} ) - add_executable ( poffreader_UT points_off_reader_unit_test.cpp ) target_link_libraries(poffreader_UT ${Boost_SYSTEM_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) @@ -30,10 +26,10 @@ if(CGAL_FOUND) --log_format=XML --log_sink=${CMAKE_SOURCE_DIR}/poffreader_UT.xml --log_level=test_suite --report_level=no) else() - message(WARNING "Eigen3 not found. Version 3.1.0 is required for Alpha shapes feature.") + message(WARNING "Eigen3 not found. Version 3.1.0 is required for points_off_reader unitary tests.") endif() else() - message(WARNING "CGAL version: ${CGAL_VERSION} is too old to compile Alpha shapes feature. Version 4.6.0 is required.") + message(WARNING "CGAL version: ${CGAL_VERSION} is too old to compile points_off_reader unitary tests. Version 4.7.0 is required.") endif () endif() -- cgit v1.2.3 From c4f7417b79dfe7610a9e7b5ffbf487abfe7fa3a0 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Thu, 4 Aug 2016 15:41:38 +0000 Subject: Make GUDHI Cmake less verbose on CGAL package finding git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/trunk@1415 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 2eebce43b0f75ab1cef3a2fe6f2c1bd0b38672a9 --- data/points/generator/CMakeLists.txt | 8 +++----- src/Alpha_complex/example/CMakeLists.txt | 10 +++------- src/CMakeLists.txt | 8 +++++--- src/Persistent_cohomology/example/CMakeLists.txt | 11 +---------- src/Witness_complex/example/CMakeLists.txt | 8 ++------ src/common/example/CMakeLists.txt | 8 ++------ 6 files changed, 16 insertions(+), 37 deletions(-) (limited to 'src/Witness_complex') diff --git a/data/points/generator/CMakeLists.txt b/data/points/generator/CMakeLists.txt index e29eb19c..f559610c 100644 --- a/data/points/generator/CMakeLists.txt +++ b/data/points/generator/CMakeLists.txt @@ -13,8 +13,6 @@ if(CGAL_FOUND) # on cube is not available in CGAL add_test(hypergenerator_in_cube_7000_12_10.8 ${CMAKE_CURRENT_BINARY_DIR}/hypergenerator in cube inCube.off 7000 12 10.8) add_test(hypergenerator_in_cube_50000_2 ${CMAKE_CURRENT_BINARY_DIR}/hypergenerator in cube inCube.off 50000 3) - endif() - else() - message(WARNING "CGAL version: ${CGAL_VERSION} is too old to compile hypergenerator. Version 4.6.0 is required.") - endif () -endif() + endif(EIGEN3_FOUND) + endif(NOT CGAL_VERSION VERSION_LESS 4.6.0) +endif(CGAL_FOUND) diff --git a/src/Alpha_complex/example/CMakeLists.txt b/src/Alpha_complex/example/CMakeLists.txt index f1c7ae97..71a95d61 100644 --- a/src/Alpha_complex/example/CMakeLists.txt +++ b/src/Alpha_complex/example/CMakeLists.txt @@ -28,10 +28,6 @@ if(CGAL_FOUND) add_test(alphaoffreader_doc_60_diff_files ${DIFF_PATH} ${CMAKE_CURRENT_BINARY_DIR}/alphaoffreader_result_60.txt ${CMAKE_CURRENT_BINARY_DIR}/alphaoffreader_for_doc_60.txt) add_test(alphaoffreader_doc_32_diff_files ${DIFF_PATH} ${CMAKE_CURRENT_BINARY_DIR}/alphaoffreader_result_32.txt ${CMAKE_CURRENT_BINARY_DIR}/alphaoffreader_for_doc_32.txt) endif() - else() - message(WARNING "Eigen3 not found. Version 3.1.0 is required for Alpha complex examples.") - endif() - else() - message(WARNING "CGAL version: ${CGAL_VERSION} is too old to compile Alpha complex examples. Version 4.7.0 is required.") - endif () -endif() + endif(EIGEN3_FOUND) + endif(NOT CGAL_VERSION VERSION_LESS 4.7.0) +endif(CGAL_FOUND) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 80f6e1ff..c02f816d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -32,12 +32,14 @@ else() # A fix would be to use https://cmake.org/cmake/help/v3.1/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.html # or even better https://cmake.org/cmake/help/v3.1/variable/CMAKE_CXX_STANDARD.html # but it implies to use cmake version 3.1 at least. - find_package(CGAL) + + # find CGAL in QUIET mode for cmake to be less verbose when CGAL is not found. + find_package(CGAL QUIET) # Only CGAL versions > 4.4 supports what Gudhi uses from CGAL - if (CGAL_VERSION VERSION_LESS 4.4.0) + if (CGAL_VERSION VERSION_LESS 4.4.0 AND CGAL_FOUND) message("CGAL version ${CGAL_VERSION} is considered too old to be used by Gudhi.") unset(CGAL_FOUND) - endif() + endif(CGAL_VERSION VERSION_LESS 4.4.0 AND CGAL_FOUND) if(CGAL_FOUND) message(STATUS "CGAL version: ${CGAL_VERSION}.") include( ${CGAL_USE_FILE} ) diff --git a/src/Persistent_cohomology/example/CMakeLists.txt b/src/Persistent_cohomology/example/CMakeLists.txt index 94b9fbfa..d97d1b63 100644 --- a/src/Persistent_cohomology/example/CMakeLists.txt +++ b/src/Persistent_cohomology/example/CMakeLists.txt @@ -48,8 +48,6 @@ if(GMP_FOUND) add_test(rips_multifield_persistence_2_71 ${CMAKE_CURRENT_BINARY_DIR}/rips_multifield_persistence ${CMAKE_SOURCE_DIR}/data/points/Kl.txt -r 0.2 -d 3 -p 2 -q 71 -m 100) endif(GMPXX_FOUND) -else() - # message(WARNING "GMP not found.") endif(GMP_FOUND) if(CGAL_FOUND) @@ -81,13 +79,6 @@ if(CGAL_FOUND) add_test(alpha_complex_persistence_2_0_45 ${CMAKE_CURRENT_BINARY_DIR}/alpha_complex_persistence ${CMAKE_SOURCE_DIR}/data/points/tore3D_300.off -m 0.45 -p 2) add_test(periodic_alpha_complex_3d_persistence_2_0 ${CMAKE_CURRENT_BINARY_DIR}/periodic_alpha_complex_3d_persistence ${CMAKE_SOURCE_DIR}/data/points/grid_10_10_10_in_0_1.off ${CMAKE_SOURCE_DIR}/data/points/iso_cuboid_3_in_0_1.txt 2 0) add_test(custom_persistence_sort ${CMAKE_CURRENT_BINARY_DIR}/custom_persistence_sort) - - else() - message(WARNING "Eigen3 not found. Version 3.1.0 is required for Alpha complex persistence examples.") endif(EIGEN3_FOUND) - else() - message(WARNING "CGAL version: ${CGAL_VERSION} is too old to compile Alpha complex persistence examples. Version 4.7.0 is required.") - endif () -else() - # message(WARNING "CGAL not found.") + endif (NOT CGAL_VERSION VERSION_LESS 4.7.0) endif(CGAL_FOUND) diff --git a/src/Witness_complex/example/CMakeLists.txt b/src/Witness_complex/example/CMakeLists.txt index 48ba9279..4d67e0d0 100644 --- a/src/Witness_complex/example/CMakeLists.txt +++ b/src/Witness_complex/example/CMakeLists.txt @@ -11,10 +11,6 @@ if(CGAL_FOUND) add_executable ( witness_complex_sphere witness_complex_sphere.cpp ) target_link_libraries(witness_complex_sphere ${Boost_SYSTEM_LIBRARY} ${CGAL_LIBRARY}) add_test( witness_complex_sphere_10 ${CMAKE_CURRENT_BINARY_DIR}/witness_complex_sphere 10) - else() - message(WARNING "Eigen3 not found. Version 3.1.0 is required for witness_complex_sphere example.") - endif() - else() - message(WARNING "CGAL version: ${CGAL_VERSION} is too old to compile witness_complex_sphere example. Version 4.6.0 is required.") - endif () + endif(EIGEN3_FOUND) + endif (NOT CGAL_VERSION VERSION_LESS 4.6.0) endif() diff --git a/src/common/example/CMakeLists.txt b/src/common/example/CMakeLists.txt index 4ea8c9cb..0da3dcc0 100644 --- a/src/common/example/CMakeLists.txt +++ b/src/common/example/CMakeLists.txt @@ -12,10 +12,6 @@ if(CGAL_FOUND) add_executable ( cgaloffreader CGAL_points_off_reader.cpp ) target_link_libraries(cgaloffreader ${Boost_SYSTEM_LIBRARY} ${CGAL_LIBRARY}) add_test(cgaloffreader ${CMAKE_CURRENT_BINARY_DIR}/cgaloffreader ${CMAKE_SOURCE_DIR}/data/points/alphacomplexdoc.off) - else() - message(WARNING "Eigen3 not found. Version 3.1.0 is required for cgaloffreader example.") - endif() - else() - message(WARNING "CGAL version: ${CGAL_VERSION} is too old to compile cgaloffreader example. Version 4.7.0 is required.") - endif () + endif(EIGEN3_FOUND) + endif (NOT CGAL_VERSION VERSION_LESS 4.7.0) endif() -- cgit v1.2.3