From 309d5aa575735acefabc33abade72637c52fb931 Mon Sep 17 00:00:00 2001 From: skachano Date: Fri, 7 Oct 2016 16:08:41 +0000 Subject: Added a big chunk of documentation. +small fixes git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/relaxed-witness@1679 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: d3166034bf662121bc21583bb027c67f736e904c --- src/Witness_complex/doc/Witness_complex_doc.h | 46 ++++++++++++++++++++------- 1 file changed, 34 insertions(+), 12 deletions(-) (limited to 'src/Witness_complex/doc/Witness_complex_doc.h') diff --git a/src/Witness_complex/doc/Witness_complex_doc.h b/src/Witness_complex/doc/Witness_complex_doc.h index 60dfd27b..1d6e9da2 100644 --- a/src/Witness_complex/doc/Witness_complex_doc.h +++ b/src/Witness_complex/doc/Witness_complex_doc.h @@ -6,33 +6,55 @@ \author Siargey Kachanovich - \image html "Witness_complex_representation.png" "Witness complex representation" + \image html "Witness_complex_representation.png" "Witness complex representation in a Simplex tree (from \cite boissonnatmariasimplextreealgorithmica)" \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$: + Witness complex 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**. + \li \f$L\f$ set of **landmarks**. + + Even though often the set of landmarks \f$L\f$ is a subset of the set of witnesses \f$ W\f$, it is not a requirement for the current implementation. The simplices are based on landmarks - and a simplex belongs to the witness complex if and only if it is witnessed, that is: + and witnesses help to decide on which simplices are inserted via a predicate "is witnessed". + + De Silva and Carlsson in their paper \cite de2004topological differentiate **weak witnessing** and **strong witnessing**: + + - *weak*: \f$ \sigma \subset L \f$ is witnessed by \f$ w \in W\f$ if \f$ \forall l \in \sigma,\ \forall l' \in L \setminus \sigma,\ d(w,l) \leq d(w,l') \f$ + - *strong*: \f$ \sigma \subset L \f$ is witnessed by \f$ w \in W\f$ if \f$ \forall l \in \sigma,\ \forall l' \in L,\ d(w,l) \leq d(w,l') \f$ + + where \f$ d(.,.) \f$ is a distance function. + + Both definitions can be relaxed by a real value \f$\alpha\f$: + + - *weak*: \f$ \sigma \subset L \f$ is \f$\alpha\f$-witnessed by \f$ w \in W\f$ if \f$ \forall l \in \sigma,\ \forall l' \in L \setminus \sigma,\ d(w,l)^2 \leq d(w,l')^2 + \alpha^2 \f$ + - *strong*: \f$ \sigma \subset L \f$ is \f$\alpha\f$-witnessed by \f$ w \in W\f$ if \f$ \forall l \in \sigma,\ \forall l' \in L,\ d(w,l)^2 \leq d(w,l')^2 + \alpha^2 \f$ - \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. - - The data structure is described in \cite boissonnatmariasimplextreealgorithmica . + which leads to definitions of **weak relaxed witness complex** (or just relaxed witness complex for short) and **strong relaxed witness complex** respectively. \section Implementation + + The two complexes described above are implemented in the corresponding classes + - Gudhi::witness_complex::Witness_complex + - Gudhi::witness_complex::Strong_witness_complex + + The construction of both of them follow the same scheme: + 1. Construct a search tree on landmarks (for that Gudhi::spatial_searching::Kd_tree_search is used internally). + 2. Construct lists of nearest landmarks for each witness (special internal structure Gudhi::spatial_searching::Active_witness is used internally). + 3. Construct the witness complex for nearest landmark lists. + + The constructors take on the step 1, while the function 'create_complex' executes the steps 2 and 3. - The principal class of this module is Gudhi::Witness_complex. + \section Examples - 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. + Here is an example of constructing a strong witness complex filtration and computing persistence on it: + + \include Witness_complex/example_strong_witness_persistence.cpp *\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. -- cgit v1.2.3 From c40e693be35b97684c102c17424205f3a6379f16 Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Mon, 10 Oct 2016 14:35:09 +0000 Subject: Modify witness complex representation git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/relaxed-witness@1684 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: c11cfb9da10c1987cc1fc218b3e13d64b7ba7a52 --- src/Witness_complex/doc/Witness_complex_doc.h | 2 +- .../doc/Witness_complex_representation.ipe | 280 +++++++++++++++++++++ .../doc/Witness_complex_representation.png | Bin 48899 -> 21202 bytes 3 files changed, 281 insertions(+), 1 deletion(-) create mode 100644 src/Witness_complex/doc/Witness_complex_representation.ipe (limited to 'src/Witness_complex/doc/Witness_complex_doc.h') diff --git a/src/Witness_complex/doc/Witness_complex_doc.h b/src/Witness_complex/doc/Witness_complex_doc.h index 1d6e9da2..14cb92ad 100644 --- a/src/Witness_complex/doc/Witness_complex_doc.h +++ b/src/Witness_complex/doc/Witness_complex_doc.h @@ -6,7 +6,7 @@ \author Siargey Kachanovich - \image html "Witness_complex_representation.png" "Witness complex representation in a Simplex tree (from \cite boissonnatmariasimplextreealgorithmica)" + \image html "Witness_complex_representation.png" "Witness complex representation" \section Definitions diff --git a/src/Witness_complex/doc/Witness_complex_representation.ipe b/src/Witness_complex/doc/Witness_complex_representation.ipe new file mode 100644 index 00000000..f9c45d5d --- /dev/null +++ b/src/Witness_complex/doc/Witness_complex_representation.ipe @@ -0,0 +1,280 @@ + + + + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-0.8 0 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-0.8 0 l +-1 -0.333 l +h + + + + +0.6 0 0 0.6 0 0 e +0.4 0 0 0.4 0 0 e + + + + +0.6 0 0 0.6 0 0 e + + + + + +0.5 0 0 0.5 0 0 e + + +0.6 0 0 0.6 0 0 e +0.4 0 0 0.4 0 0 e + + + + + +-0.6 -0.6 m +0.6 -0.6 l +0.6 0.6 l +-0.6 0.6 l +h +-0.4 -0.4 m +0.4 -0.4 l +0.4 0.4 l +-0.4 0.4 l +h + + + + +-0.6 -0.6 m +0.6 -0.6 l +0.6 0.6 l +-0.6 0.6 l +h + + + + + +-0.5 -0.5 m +0.5 -0.5 l +0.5 0.5 l +-0.5 0.5 l +h + + +-0.6 -0.6 m +0.6 -0.6 l +0.6 0.6 l +-0.6 0.6 l +h +-0.4 -0.4 m +0.4 -0.4 l +0.4 0.4 l +-0.4 0.4 l +h + + + + + + +-0.43 -0.57 m +0.57 0.43 l +0.43 0.57 l +-0.57 -0.43 l +h + + +-0.43 0.57 m +0.57 -0.43 l +0.43 -0.57 l +-0.57 0.43 l +h + + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-0.8 0 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-0.8 0 l +-1 -0.333 l +h + + + + +-1 0.333 m +0 0 l +-1 -0.333 l + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h +-1 0 m +-2 0.333 l +-2 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h +-1 0 m +-2 0.333 l +-2 -0.333 l +h + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +48.8262 0 0 48.8262 288 672 e + +$\omega$ + +284 720 m +280 624 l +268 648 l +h + + + + +$\sigma$ + + + + + + + + + diff --git a/src/Witness_complex/doc/Witness_complex_representation.png b/src/Witness_complex/doc/Witness_complex_representation.png index 1d31a490..16e0504e 100644 Binary files a/src/Witness_complex/doc/Witness_complex_representation.png and b/src/Witness_complex/doc/Witness_complex_representation.png differ -- cgit v1.2.3 From 20c9874582833bd4c0cc1f90769bb27341dd299f Mon Sep 17 00:00:00 2001 From: skachano Date: Tue, 18 Oct 2016 12:37:47 +0000 Subject: Modified doc in Witness_complex_doc.h spatial_searching -> witness_complex git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/relaxed-witness@1732 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 46932441f1f7e042f18cbbc7da26984357b3735b --- src/Witness_complex/doc/Witness_complex_doc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Witness_complex/doc/Witness_complex_doc.h') diff --git a/src/Witness_complex/doc/Witness_complex_doc.h b/src/Witness_complex/doc/Witness_complex_doc.h index 14cb92ad..e17b0fa6 100644 --- a/src/Witness_complex/doc/Witness_complex_doc.h +++ b/src/Witness_complex/doc/Witness_complex_doc.h @@ -42,7 +42,7 @@ The construction of both of them follow the same scheme: 1. Construct a search tree on landmarks (for that Gudhi::spatial_searching::Kd_tree_search is used internally). - 2. Construct lists of nearest landmarks for each witness (special internal structure Gudhi::spatial_searching::Active_witness is used internally). + 2. Construct lists of nearest landmarks for each witness (special internal structure Gudhi::witness_complex::Active_witness is used internally). 3. Construct the witness complex for nearest landmark lists. The constructors take on the step 1, while the function 'create_complex' executes the steps 2 and 3. -- cgit v1.2.3 From 2fbcf3afe9bf246774ace4ff8b3524b45b2a869b Mon Sep 17 00:00:00 2001 From: skachano Date: Tue, 18 Oct 2016 13:06:24 +0000 Subject: Added Doxygen names for Witness_complex_doc sections git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/relaxed-witness@1734 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: c860505be703779dccad23af24945b6298caf27e --- src/Witness_complex/doc/Witness_complex_doc.h | 6 +++--- src/Witness_complex/test/CMakeLists.txt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Witness_complex/doc/Witness_complex_doc.h') diff --git a/src/Witness_complex/doc/Witness_complex_doc.h b/src/Witness_complex/doc/Witness_complex_doc.h index e17b0fa6..4f3671e5 100644 --- a/src/Witness_complex/doc/Witness_complex_doc.h +++ b/src/Witness_complex/doc/Witness_complex_doc.h @@ -8,7 +8,7 @@ \image html "Witness_complex_representation.png" "Witness complex representation" - \section Definitions + \section witnessdefinitions Definitions Witness complex is a simplicial complex defined on two sets of points in \f$\mathbb{R}^D\f$: @@ -34,7 +34,7 @@ which leads to definitions of **weak relaxed witness complex** (or just relaxed witness complex for short) and **strong relaxed witness complex** respectively. - \section Implementation + \section witnessimplementation Implementation The two complexes described above are implemented in the corresponding classes - Gudhi::witness_complex::Witness_complex @@ -47,7 +47,7 @@ The constructors take on the step 1, while the function 'create_complex' executes the steps 2 and 3. - \section Examples + \section witnessexamples Examples Here is an example of constructing a strong witness complex filtration and computing persistence on it: diff --git a/src/Witness_complex/test/CMakeLists.txt b/src/Witness_complex/test/CMakeLists.txt index c616ccdf..8d68ea1f 100644 --- a/src/Witness_complex/test/CMakeLists.txt +++ b/src/Witness_complex/test/CMakeLists.txt @@ -17,4 +17,4 @@ target_link_libraries(Witness_complex_test_simple_witness_complex ${Boost_SYSTEM add_test(NAME simple_witness_complex COMMAND ${CMAKE_CURRENT_BINARY_DIR}/Witness_complex_test_simple_witness_complex # XML format for Jenkins xUnit plugin - --log_format=XML --log_sink=${CMAKE_SOURCE_DIR}/Witness_complex_test_simple_witness_complex.xml --log_level=test_suite --report_level=no) + --log_format=XML --log_sink=${CMAKE_SOURCE_DIR}/Witness_complex_test_simple_witness_complexUT.xml --log_level=test_suite --report_level=no) -- cgit v1.2.3 From fe79f2dcfd8b1540485d8a81fa7cedd07f5c8fac Mon Sep 17 00:00:00 2001 From: skachano Date: Wed, 19 Oct 2016 08:19:49 +0000 Subject: Clément's remarks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/relaxed-witness@1735 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: c3bc66a081a0bc73874246e1e12ab98c6bf2a53e --- src/Witness_complex/doc/Witness_complex_doc.h | 10 +++++-- .../example/example_strong_witness_persistence.cpp | 28 ++---------------- .../example/example_witness_complex_off.cpp | 28 ++---------------- .../example_witness_complex_persistence.cpp | 28 ++---------------- .../example/example_witness_complex_sphere.cpp | 27 ++--------------- .../include/gudhi/Strong_witness_complex.h | 27 ++++++++--------- .../include/gudhi/Witness_complex.h | 32 +++++++------------- .../test/test_simple_witness_complex.cpp | 34 +++------------------- 8 files changed, 43 insertions(+), 171 deletions(-) (limited to 'src/Witness_complex/doc/Witness_complex_doc.h') diff --git a/src/Witness_complex/doc/Witness_complex_doc.h b/src/Witness_complex/doc/Witness_complex_doc.h index 4f3671e5..2831f107 100644 --- a/src/Witness_complex/doc/Witness_complex_doc.h +++ b/src/Witness_complex/doc/Witness_complex_doc.h @@ -17,7 +17,7 @@ Even though often the set of landmarks \f$L\f$ is a subset of the set of witnesses \f$ W\f$, it is not a requirement for the current implementation. - The simplices are based on landmarks + Landmarks are the vertices of the simplicial complex and witnesses help to decide on which simplices are inserted via a predicate "is witnessed". De Silva and Carlsson in their paper \cite de2004topological differentiate **weak witnessing** and **strong witnessing**: @@ -47,7 +47,13 @@ The constructors take on the step 1, while the function 'create_complex' executes the steps 2 and 3. - \section witnessexamples Examples + \section witnessexample1 Example 1: Constructing weak relaxed witness complex from an off file + + Let's start with a simple example, which reads an off point file and computes a weak witness complex. + + \include Witness_complex/example_witness_complex_off.cpp + + \section witnessexample2 Example2: Computing persistence using strong relaxed witness complex Here is an example of constructing a strong witness complex filtration and computing persistence on it: diff --git a/src/Witness_complex/example/example_strong_witness_persistence.cpp b/src/Witness_complex/example/example_strong_witness_persistence.cpp index f43cba52..a0563ee2 100644 --- a/src/Witness_complex/example/example_strong_witness_persistence.cpp +++ b/src/Witness_complex/example/example_strong_witness_persistence.cpp @@ -1,25 +1,3 @@ -/* 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) 2016 INRIA (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 . - */ - #include #include #include @@ -81,10 +59,8 @@ int main(int argc, char * argv[]) { Gudhi::subsampling::pick_n_random_points(witnesses, nbL, std::back_inserter(landmarks)); // Compute witness complex - Strong_witness_complex strong_witness_complex(landmarks.begin(), - landmarks.end(), - witnesses.begin(), - witnesses.end()); + Strong_witness_complex strong_witness_complex(landmarks, + witnesses); strong_witness_complex.create_complex(simplex_tree, max_squared_alpha); diff --git a/src/Witness_complex/example/example_witness_complex_off.cpp b/src/Witness_complex/example/example_witness_complex_off.cpp index 94088370..2677499a 100644 --- a/src/Witness_complex/example/example_witness_complex_off.cpp +++ b/src/Witness_complex/example/example_witness_complex_off.cpp @@ -1,25 +1,3 @@ -/* 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) 2015 INRIA (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 . - */ - #include #include @@ -72,10 +50,8 @@ int main(int argc, char * const argv[]) { // Compute witness complex start = clock(); - Witness_complex witness_complex(landmarks.begin(), - landmarks.end(), - point_vector.begin(), - point_vector.end()); + Witness_complex witness_complex(landmarks, + point_vector); witness_complex.create_complex(simplex_tree, alpha2, lim_dim); end = clock(); diff --git a/src/Witness_complex/example/example_witness_complex_persistence.cpp b/src/Witness_complex/example/example_witness_complex_persistence.cpp index b1b415fa..00f00aae 100644 --- a/src/Witness_complex/example/example_witness_complex_persistence.cpp +++ b/src/Witness_complex/example/example_witness_complex_persistence.cpp @@ -1,25 +1,3 @@ -/* 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) 2016 INRIA (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 . - */ - #include #include #include @@ -81,10 +59,8 @@ int main(int argc, char * argv[]) { Gudhi::subsampling::pick_n_random_points(witnesses, nbL, std::back_inserter(landmarks)); // Compute witness complex - Witness_complex witness_complex(landmarks.begin(), - landmarks.end(), - witnesses.begin(), - witnesses.end()); + Witness_complex witness_complex(landmarks, + witnesses); witness_complex.create_complex(simplex_tree, max_squared_alpha); diff --git a/src/Witness_complex/example/example_witness_complex_sphere.cpp b/src/Witness_complex/example/example_witness_complex_sphere.cpp index d21195fa..42fb9f8d 100644 --- a/src/Witness_complex/example/example_witness_complex_sphere.cpp +++ b/src/Witness_complex/example/example_witness_complex_sphere.cpp @@ -1,24 +1,3 @@ -/* 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) 2015 INRIA (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 . - */ #define BOOST_PARAMETER_MAX_ARITY 12 @@ -80,10 +59,8 @@ int main(int argc, char * const argv[]) { Gudhi::subsampling::pick_n_random_points(point_vector, number_of_landmarks, std::back_inserter(landmarks)); // Compute witness complex - Witness_complex witness_complex(landmarks.begin(), - landmarks.end(), - point_vector.begin(), - point_vector.end()); + Witness_complex witness_complex(landmarks, + point_vector); witness_complex.create_complex(simplex_tree, 0); end = clock(); double time = static_cast(end - start) / CLOCKS_PER_SEC; diff --git a/src/Witness_complex/include/gudhi/Strong_witness_complex.h b/src/Witness_complex/include/gudhi/Strong_witness_complex.h index 7ef8d3e5..c7b8c27b 100644 --- a/src/Witness_complex/include/gudhi/Strong_witness_complex.h +++ b/src/Witness_complex/include/gudhi/Strong_witness_complex.h @@ -94,22 +94,18 @@ private: /** * \brief Initializes member variables before constructing simplicial complex. - * \details Records landmarks from the range [landmarks_first, landmarks_last) into a - * table internally, as well as witnesses from the range [witnesses_first, witnesses_last). - * All iterator parameters should satisfy InputIterator - * C++ concept. + * \details Records landmarks from the range 'landmarks' into a + * table internally, as well as witnesses from the range 'witnesses'. */ - template< typename InputIteratorLandmarks, - typename InputIteratorWitnesses > - Strong_witness_complex(InputIteratorLandmarks landmarks_first, - InputIteratorLandmarks landmarks_last, - InputIteratorWitnesses witnesses_first, - InputIteratorWitnesses witnesses_last) - : witnesses_(witnesses_first, witnesses_last), landmarks_(landmarks_first, landmarks_last), landmark_tree_(landmarks_) + template< typename LandmarkRange, + typename WitnessRange > + Strong_witness_complex(const LandmarkRange & landmarks, + const WitnessRange & witnesses) + : witnesses_(witnesses), landmarks_(landmarks), landmark_tree_(landmarks_) { } + /** \brief Returns the point corresponding to the given vertex. */ template @@ -118,9 +114,10 @@ private: return landmarks_[vertex]; } - /** \brief Outputs the strong witness complex in a simplicial complex data structure. - * @param[out] complex Simplicial complex data structure compatible with 'find' and 'insert' operations. - * (Cf SimplicialComplexForWitness) + /** \brief Outputs the strong witness complex of relaxation 'max_alpha_square' + * in a simplicial complex data structure. + * @param[out] complex Simplicial complex data structure, which is a model of + * SimplicialComplexForWitness concept. * @param[in] max_alpha_square Maximal squared relaxation parameter. * @param[in] limit_dimension Represents the maximal dimension of the simplicial complex * (default value = no limit). diff --git a/src/Witness_complex/include/gudhi/Witness_complex.h b/src/Witness_complex/include/gudhi/Witness_complex.h index ac0e8f66..c1d402c6 100644 --- a/src/Witness_complex/include/gudhi/Witness_complex.h +++ b/src/Witness_complex/include/gudhi/Witness_complex.h @@ -46,12 +46,6 @@ namespace witness_complex { * \tparam Kernel_ requires a CGAL::Epick_d class, which * can be static if you know the ambiant dimension at compile-time, or dynamic if you don't. - * \tparam DimensionTag can be either Dimension_tag - * if you know the intrinsic dimension at compile-time, - * or CGAL::Dynamic_dimension_tag - * if you don't. */ template< class Kernel_ > class Witness_complex { @@ -94,19 +88,14 @@ private: /** * \brief Initializes member variables before constructing simplicial complex. - * \details Records landmarks from the range [landmarks_first, landmarks_last) into a - * table internally, as well as witnesses from the range [witnesses_first, witnesses_last). - * All iterator parameters should satisfy InputIterator - * C++ concept. + * \details Records landmarks from the range 'landmarks' into a + * table internally, as well as witnesses from the range 'witnesses'. */ - template< typename InputIteratorLandmarks, - typename InputIteratorWitnesses > - Witness_complex(InputIteratorLandmarks landmarks_first, - InputIteratorLandmarks landmarks_last, - InputIteratorWitnesses witnesses_first, - InputIteratorWitnesses witnesses_last) - : witnesses_(witnesses_first, witnesses_last), landmarks_(landmarks_first, landmarks_last), landmark_tree_(landmarks_) + template< typename LandmarkRange, + typename WitnessRange > + Witness_complex(const LandmarkRange & landmarks, + const WitnessRange & witnesses) + : witnesses_(witnesses), landmarks_(landmarks), landmark_tree_(landmarks_) { } @@ -118,9 +107,10 @@ private: return landmarks_[vertex]; } - /** \brief Outputs the (weak) witness complex in a simplicial complex data structure. - * @param[out] complex Simplicial complex data structure compatible with 'find' and 'insert' operations. - * (Cf SimplicialComplexForWitness) + /** \brief Outputs the (weak) witness complex of relaxation 'max_alpha_square' + * in a simplicial complex data structure. + * @param[out] complex Simplicial complex data structure compatible which is a model of + * SimplicialComplexForWitness concept. * @param[in] max_alpha_square Maximal squared relaxation parameter. * @param[in] limit_dimension Represents the maximal dimension of the simplicial complex * (default value = no limit). diff --git a/src/Witness_complex/test/test_simple_witness_complex.cpp b/src/Witness_complex/test/test_simple_witness_complex.cpp index 90b6cfa2..a0a1b36c 100644 --- a/src/Witness_complex/test/test_simple_witness_complex.cpp +++ b/src/Witness_complex/test/test_simple_witness_complex.cpp @@ -1,25 +1,3 @@ -/* 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) 2016 INRIA (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 . - */ - #define BOOST_TEST_DYN_LINK #define BOOST_TEST_MODULE "simple_witness_complex" #include @@ -79,10 +57,8 @@ BOOST_AUTO_TEST_CASE(simple_witness_complex) { witnesses.push_back(Point_d(std::vector{ 2,-1})); witnesses.push_back(Point_d(std::vector{ 2, 1})); - WitnessComplex witness_complex(landmarks.begin(), - landmarks.end(), - witnesses.begin(), - witnesses.end()); + WitnessComplex witness_complex(landmarks, + witnesses); witness_complex.create_complex(complex, 0); std::cout << "complex.num_simplices() = " << complex.num_simplices() << std::endl; @@ -93,10 +69,8 @@ BOOST_AUTO_TEST_CASE(simple_witness_complex) { std::cout << "relaxed_complex.num_simplices() = " << relaxed_complex.num_simplices() << std::endl; BOOST_CHECK(relaxed_complex.num_simplices() == 239); - StrongWitnessComplex strong_witness_complex(landmarks.begin(), - landmarks.end(), - witnesses.begin(), - witnesses.end()); + StrongWitnessComplex strong_witness_complex(landmarks, + witnesses); strong_witness_complex.create_complex(strong_relaxed_complex, 9.1); -- cgit v1.2.3 From f891467fe38d7757aa3d92705ca99e847cdd68d9 Mon Sep 17 00:00:00 2001 From: skachano Date: Fri, 18 Nov 2016 16:07:44 +0000 Subject: Modified doc git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/relaxed-witness@1760 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: d4e7410ecfdd7ae8867ce3e95e69e1e83948b579 --- src/Witness_complex/doc/Witness_complex_doc.h | 59 +- src/Witness_complex/doc/swit.svg | 1303 +++++++++++++++++++++++++ src/common/doc/main_page.h | 6 +- 3 files changed, 1358 insertions(+), 10 deletions(-) create mode 100644 src/Witness_complex/doc/swit.svg (limited to 'src/Witness_complex/doc/Witness_complex_doc.h') diff --git a/src/Witness_complex/doc/Witness_complex_doc.h b/src/Witness_complex/doc/Witness_complex_doc.h index 2831f107..ba258ddc 100644 --- a/src/Witness_complex/doc/Witness_complex_doc.h +++ b/src/Witness_complex/doc/Witness_complex_doc.h @@ -22,18 +22,24 @@ De Silva and Carlsson in their paper \cite de2004topological differentiate **weak witnessing** and **strong witnessing**: - - *weak*: \f$ \sigma \subset L \f$ is witnessed by \f$ w \in W\f$ if \f$ \forall l \in \sigma,\ \forall l' \in L \setminus \sigma,\ d(w,l) \leq d(w,l') \f$ - - *strong*: \f$ \sigma \subset L \f$ is witnessed by \f$ w \in W\f$ if \f$ \forall l \in \sigma,\ \forall l' \in L,\ d(w,l) \leq d(w,l') \f$ + - *weak*: \f$ \sigma \subset L \f$ is witnessed by \f$ w \in W\f$ if \f$ \forall l \in \sigma,\ \forall l' \in \mathbf{L \setminus \sigma},\ d(w,l) \leq d(w,l') \f$ + - *strong*: \f$ \sigma \subset L \f$ is witnessed by \f$ w \in W\f$ if \f$ \forall l \in \sigma,\ \forall l' \in \mathbf{L},\ d(w,l) \leq d(w,l') \f$ where \f$ d(.,.) \f$ is a distance function. Both definitions can be relaxed by a real value \f$\alpha\f$: - - *weak*: \f$ \sigma \subset L \f$ is \f$\alpha\f$-witnessed by \f$ w \in W\f$ if \f$ \forall l \in \sigma,\ \forall l' \in L \setminus \sigma,\ d(w,l)^2 \leq d(w,l')^2 + \alpha^2 \f$ - - *strong*: \f$ \sigma \subset L \f$ is \f$\alpha\f$-witnessed by \f$ w \in W\f$ if \f$ \forall l \in \sigma,\ \forall l' \in L,\ d(w,l)^2 \leq d(w,l')^2 + \alpha^2 \f$ + - *weak*: \f$ \sigma \subset L \f$ is \f$\alpha\f$-witnessed by \f$ w \in W\f$ if \f$ \forall l \in \sigma,\ \forall l' \in \mathbf{L \setminus \sigma},\ d(w,l)^2 \leq d(w,l')^2 + \alpha^2 \f$ + - *strong*: \f$ \sigma \subset L \f$ is \f$\alpha\f$-witnessed by \f$ w \in W\f$ if \f$ \forall l \in \sigma,\ \forall l' \in \mathbf{L},\ d(w,l)^2 \leq d(w,l')^2 + \alpha^2 \f$ which leads to definitions of **weak relaxed witness complex** (or just relaxed witness complex for short) and **strong relaxed witness complex** respectively. + \image html "swit.svg" "Strong witness witnesses the whole simplex in the witnessing ball" + + In particular case of 0-relaxation, weak complex corresponds to **witness complex** introduced in \cite de2004topological, whereas 0-relaxed strong witness complex consists of just vertices and is not very interesting. + Hence for small relaxation weak version is preferable. + However, to capture the homotopy type (for example using Gudhi::persistent_cohomology::Persistent_cohomology) it is often necessary to work with higher filtration values. In this case strong relaxed witness complex is faster to compute and offers similar results. + \section witnessimplementation Implementation The two complexes described above are implemented in the corresponding classes @@ -51,7 +57,47 @@ Let's start with a simple example, which reads an off point file and computes a weak witness complex. - \include Witness_complex/example_witness_complex_off.cpp + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp} + +#include +#include +#include +#include + +#include + +#include +#include + +typedef CGAL::Epick_d K; +typedef typename K::Point_d Point_d; +typedef typename Gudhi::witness_complex::Witness_complex Witness_complex; +typedef std::vector< Vertex_handle > typeVectorVertex; +typedef std::vector< Point_d > Point_vector; + +int main(int argc, char * const argv[]) { + std::string file_name = argv[1]; + int nbL = atoi(argv[2]), lim_dim = atoi(argv[4]); + double alpha2 = atof(argv[3]); + Gudhi::Simplex_tree<> simplex_tree; + + // Read the point file + Point_vector point_vector, landmarks; + Gudhi::Points_off_reader off_reader(file_name); + point_vector = Point_vector(off_reader.get_point_cloud()); + + // Choose landmarks + Gudhi::subsampling::pick_n_random_points(point_vector, nbL, std::back_inserter(landmarks)); + + // Compute witness complex + Witness_complex witness_complex(landmarks, + point_vector); + + witness_complex.create_complex(simplex_tree, alpha2, lim_dim); +} + + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ \section witnessexample2 Example2: Computing persistence using strong relaxed witness complex @@ -59,9 +105,6 @@ \include Witness_complex/example_strong_witness_persistence.cpp - *\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. diff --git a/src/Witness_complex/doc/swit.svg b/src/Witness_complex/doc/swit.svg new file mode 100644 index 00000000..6ffb5fff --- /dev/null +++ b/src/Witness_complex/doc/swit.svg @@ -0,0 +1,1303 @@ + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/common/doc/main_page.h b/src/common/doc/main_page.h index 21cf6925..0b5588da 100644 --- a/src/common/doc/main_page.h +++ b/src/common/doc/main_page.h @@ -337,7 +337,9 @@ make \endverbatim * @example Skeleton_blocker/Skeleton_blocker_from_simplices.cpp * @example Skeleton_blocker/Skeleton_blocker_iteration.cpp * @example Skeleton_blocker/Skeleton_blocker_link.cpp - * @example Witness_complex/witness_complex_from_file.cpp - * @example Witness_complex/witness_complex_sphere.cpp + * @example Witness_complex/example_strong_witness_persistence.cpp + * @example Witness_complex/example_witness_complex_off.cpp + * @example Witness_complex/example_witness_complex_persistence.cpp + * @example Witness_complex/example_witness_complex_sphere.cpp */ -- cgit v1.2.3 From 22f0bc7f98e4ead21616fa10a3b3c3279a922ee4 Mon Sep 17 00:00:00 2001 From: skachano Date: Mon, 21 Nov 2016 16:15:13 +0000 Subject: Fixed small bug in an example. Thanks to Clément MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/relaxed-witness@1765 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: ef71f8be01c177a6b0da8ff58849f1041659e523 --- src/Witness_complex/doc/Witness_complex_doc.h | 2 +- src/Witness_complex/example/example_witness_complex_off.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Witness_complex/doc/Witness_complex_doc.h') diff --git a/src/Witness_complex/doc/Witness_complex_doc.h b/src/Witness_complex/doc/Witness_complex_doc.h index ba258ddc..fa45e359 100644 --- a/src/Witness_complex/doc/Witness_complex_doc.h +++ b/src/Witness_complex/doc/Witness_complex_doc.h @@ -34,7 +34,7 @@ which leads to definitions of **weak relaxed witness complex** (or just relaxed witness complex for short) and **strong relaxed witness complex** respectively. - \image html "swit.svg" "Strong witness witnesses the whole simplex in the witnessing ball" + \image html "swit.svg" "Strongly witnessed simplex" In particular case of 0-relaxation, weak complex corresponds to **witness complex** introduced in \cite de2004topological, whereas 0-relaxed strong witness complex consists of just vertices and is not very interesting. Hence for small relaxation weak version is preferable. diff --git a/src/Witness_complex/example/example_witness_complex_off.cpp b/src/Witness_complex/example/example_witness_complex_off.cpp index 2677499a..c057c118 100644 --- a/src/Witness_complex/example/example_witness_complex_off.cpp +++ b/src/Witness_complex/example/example_witness_complex_off.cpp @@ -21,7 +21,7 @@ typedef std::vector< Vertex_handle > typeVectorVertex; typedef std::vector< Point_d > Point_vector; int main(int argc, char * const argv[]) { - if (argc != 4) { + if (argc != 5) { std::cerr << "Usage: " << argv[0] << " path_to_point_file number_of_landmarks max_squared_alpha limit_dimension\n"; return 0; -- cgit v1.2.3 From 9335a9dae7bfb76a7d6cb5e15f0975dcbb20f17e Mon Sep 17 00:00:00 2001 From: skachano Date: Wed, 18 Jan 2017 10:52:01 +0000 Subject: Fixed thedocumentation. Even without an additional concept. git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/relaxed-witness@1947 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 3efb3fc30ca069b720fe1134ab3d64d284feb7ad --- src/Witness_complex/concept/Simplicial_complex_for_witness.h | 2 +- src/Witness_complex/doc/Witness_complex_doc.h | 2 ++ src/Witness_complex/include/gudhi/Strong_witness_complex.h | 9 ++++++--- src/Witness_complex/include/gudhi/Witness_complex.h | 8 ++++++-- 4 files changed, 15 insertions(+), 6 deletions(-) (limited to 'src/Witness_complex/doc/Witness_complex_doc.h') diff --git a/src/Witness_complex/concept/Simplicial_complex_for_witness.h b/src/Witness_complex/concept/Simplicial_complex_for_witness.h index b47de809..df294f19 100644 --- a/src/Witness_complex/concept/Simplicial_complex_for_witness.h +++ b/src/Witness_complex/concept/Simplicial_complex_for_witness.h @@ -27,7 +27,7 @@ namespace Gudhi { namespace witness_complex { -/** \brief The concept Simplicial_Complex describes the requirements +/** \brief The concept SimplicialComplexForWitness describes the requirements * for a type to implement a simplicial complex, * used for example to build a Witness_complex. */ diff --git a/src/Witness_complex/doc/Witness_complex_doc.h b/src/Witness_complex/doc/Witness_complex_doc.h index fa45e359..1ed3fd4e 100644 --- a/src/Witness_complex/doc/Witness_complex_doc.h +++ b/src/Witness_complex/doc/Witness_complex_doc.h @@ -44,7 +44,9 @@ The two complexes described above are implemented in the corresponding classes - Gudhi::witness_complex::Witness_complex + - Gudhi::witness_complex::Euclidean_witness_complex - Gudhi::witness_complex::Strong_witness_complex + - Gudhi::witness_complex::Euclidean_strong_witness_complex The construction of both of them follow the same scheme: 1. Construct a search tree on landmarks (for that Gudhi::spatial_searching::Kd_tree_search is used internally). diff --git a/src/Witness_complex/include/gudhi/Strong_witness_complex.h b/src/Witness_complex/include/gudhi/Strong_witness_complex.h index 20f9da8d..abfc879c 100644 --- a/src/Witness_complex/include/gudhi/Strong_witness_complex.h +++ b/src/Witness_complex/include/gudhi/Strong_witness_complex.h @@ -43,7 +43,9 @@ namespace witness_complex { * \brief Constructs strong witness complex for a given table of nearest landmarks with respect to witnesses. * \ingroup witness_complex * - * \tparam Nearest_landmark_table_ needs to be a range of a model of NearestLandmarkRange concept. + * \tparam Nearest_landmark_table_ needs to be a range of a range of nearest landmarks. + * The range of nearest landmarks should admit a member type 'iterator'. The dereference type + * of the nearest landmark range iterator needs to be 'std::pair'. */ template< class Nearest_landmark_table_ > class Strong_witness_complex { @@ -71,8 +73,9 @@ private: /** * \brief Initializes member variables before constructing simplicial complex. * \details Records nearest landmark table. - * @param[in] nearest_landmark_table should be a range of a model of NearestLandmarkRange concept. - */ + * @param[in] nearest_landmark_table needs to be a range of a range of nearest landmarks. + * The range of nearest landmarks should admit a member type 'iterator'. The dereference type + * of the nearest landmark range iterator needs to be 'std::pair'. */ Strong_witness_complex(Nearest_landmark_table_ & nearest_landmark_table) : nearest_landmark_table_(nearest_landmark_table) { diff --git a/src/Witness_complex/include/gudhi/Witness_complex.h b/src/Witness_complex/include/gudhi/Witness_complex.h index 70d51677..3305a8e2 100644 --- a/src/Witness_complex/include/gudhi/Witness_complex.h +++ b/src/Witness_complex/include/gudhi/Witness_complex.h @@ -44,7 +44,9 @@ namespace witness_complex { * \brief Constructs (weak) witness complex for a given table of nearest landmarks with respect to witnesses. * \ingroup witness_complex * - * \tparam Nearest_landmark_table_ needs to be a range of a model of NearestLandmarkRange concept. + * \tparam Nearest_landmark_table_ needs to be a range of a range of nearest landmarks. + * The range of nearest landmarks should admit a member type 'iterator'. The dereference type + * of the nearest landmark range iterator needs to be 'std::pair'. */ template< class Nearest_landmark_table_ > class Witness_complex { @@ -72,7 +74,9 @@ private: /** * \brief Initializes member variables before constructing simplicial complex. * \details Records nearest landmark table. - @param[in] nearest_landmark_table should be a range of a model of NearestLandmarkRange concept. + * @param[in] nearest_landmark_table needs to be a range of a range of nearest landmarks. + * The range of nearest landmarks should admit a member type 'iterator'. The dereference type + * of the nearest landmark range iterator needs to be 'std::pair'. */ Witness_complex(Nearest_landmark_table_ & nearest_landmark_table) -- cgit v1.2.3 From f0fe875e5046dc31ed8cea9771500a5d0972c118 Mon Sep 17 00:00:00 2001 From: skachano Date: Thu, 19 Jan 2017 12:17:03 +0000 Subject: Fixed gss namespace git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/relaxed-witness@1957 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: a2d69f25deac0ee99f2b92abeaef7fc6026e11cb --- src/Witness_complex/doc/Witness_complex_doc.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/Witness_complex/doc/Witness_complex_doc.h') diff --git a/src/Witness_complex/doc/Witness_complex_doc.h b/src/Witness_complex/doc/Witness_complex_doc.h index 1ed3fd4e..8d99b381 100644 --- a/src/Witness_complex/doc/Witness_complex_doc.h +++ b/src/Witness_complex/doc/Witness_complex_doc.h @@ -48,11 +48,13 @@ - Gudhi::witness_complex::Strong_witness_complex - Gudhi::witness_complex::Euclidean_strong_witness_complex - The construction of both of them follow the same scheme: + The construction of the Euclidean versions of complexes follow the same scheme: 1. Construct a search tree on landmarks (for that Gudhi::spatial_searching::Kd_tree_search is used internally). - 2. Construct lists of nearest landmarks for each witness (special internal structure Gudhi::witness_complex::Active_witness is used internally). + 2. Construct lists of nearest landmarks for each witness (special structure Gudhi::witness_complex::Active_witness is used internally). 3. Construct the witness complex for nearest landmark lists. + In the non-Euclidean classes, the lists of nearest landmarks are supposed to be given as input. + The constructors take on the step 1, while the function 'create_complex' executes the steps 2 and 3. \section witnessexample1 Example 1: Constructing weak relaxed witness complex from an off file -- cgit v1.2.3 From 3928fcbc37c2226e42e66e8fe7a90233e536ed7f Mon Sep 17 00:00:00 2001 From: skachano Date: Mon, 30 Jan 2017 04:45:58 +0000 Subject: Two of Marc's remarks git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/relaxed-witness@2020 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: d8fa5a1307da3172198d1cafd7f3f5bd42c99acc --- src/Witness_complex/doc/Witness_complex_doc.h | 4 ++-- src/Witness_complex/include/gudhi/Strong_witness_complex.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Witness_complex/doc/Witness_complex_doc.h') diff --git a/src/Witness_complex/doc/Witness_complex_doc.h b/src/Witness_complex/doc/Witness_complex_doc.h index 8d99b381..247d862a 100644 --- a/src/Witness_complex/doc/Witness_complex_doc.h +++ b/src/Witness_complex/doc/Witness_complex_doc.h @@ -64,7 +64,7 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.cpp} #include -#include +#include #include #include @@ -75,7 +75,7 @@ typedef CGAL::Epick_d K; typedef typename K::Point_d Point_d; -typedef typename Gudhi::witness_complex::Witness_complex Witness_complex; +typedef typename Gudhi::witness_complex::Euclidean_witness_complex Witness_complex; typedef std::vector< Vertex_handle > typeVectorVertex; typedef std::vector< Point_d > Point_vector; diff --git a/src/Witness_complex/include/gudhi/Strong_witness_complex.h b/src/Witness_complex/include/gudhi/Strong_witness_complex.h index 87965b6e..5bcd1b6e 100644 --- a/src/Witness_complex/include/gudhi/Strong_witness_complex.h +++ b/src/Witness_complex/include/gudhi/Strong_witness_complex.h @@ -61,7 +61,7 @@ private: typedef Landmark_id Vertex_handle; private: - Nearest_landmark_table_& nearest_landmark_table_; + Nearest_landmark_table_ nearest_landmark_table_; public: ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3 From ba522fc8c114b2de36c4b399d74edce8883d2577 Mon Sep 17 00:00:00 2001 From: skachano Date: Mon, 30 Jan 2017 12:37:32 +0000 Subject: Added a line to doc following Clément's comment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/relaxed-witness@2026 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: a3d4afc6110079c9826045c9de61fab9bc52f31e --- src/Witness_complex/doc/Witness_complex_doc.h | 4 +++- src/Witness_complex/example/example_strong_witness_complex_off.cpp | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'src/Witness_complex/doc/Witness_complex_doc.h') diff --git a/src/Witness_complex/doc/Witness_complex_doc.h b/src/Witness_complex/doc/Witness_complex_doc.h index 247d862a..cd54887a 100644 --- a/src/Witness_complex/doc/Witness_complex_doc.h +++ b/src/Witness_complex/doc/Witness_complex_doc.h @@ -53,9 +53,11 @@ 2. Construct lists of nearest landmarks for each witness (special structure Gudhi::witness_complex::Active_witness is used internally). 3. Construct the witness complex for nearest landmark lists. + All the computations of nearest landmarks in Euclidean case are exact thanks to Gudhi::spatial_searching::Kd_tree_search data structure. + In the non-Euclidean classes, the lists of nearest landmarks are supposed to be given as input. - The constructors take on the step 1, while the function 'create_complex' executes the steps 2 and 3. + The constructors take on the steps 1 and 2, while the function 'create_complex' executes the step 3. \section witnessexample1 Example 1: Constructing weak relaxed witness complex from an off file diff --git a/src/Witness_complex/example/example_strong_witness_complex_off.cpp b/src/Witness_complex/example/example_strong_witness_complex_off.cpp index 80699e78..61b8bc4a 100644 --- a/src/Witness_complex/example/example_strong_witness_complex_off.cpp +++ b/src/Witness_complex/example/example_strong_witness_complex_off.cpp @@ -37,7 +37,7 @@ int main(int argc, char * const argv[]) { Point_vector point_vector, landmarks; Gudhi::Points_off_reader off_reader(file_name); if (!off_reader.is_valid()) { - std::cerr << "Witness complex - Unable to read file " << file_name << "\n"; + std::cerr << "Strong witness complex - Unable to read file " << file_name << "\n"; exit(-1); // ----- >> } point_vector = Point_vector(off_reader.get_point_cloud()); @@ -55,7 +55,7 @@ int main(int argc, char * const argv[]) { witness_complex.create_complex(simplex_tree, alpha2, lim_dim); end = clock(); - std::cout << "Witness complex took " + std::cout << "Strong witness complex took " << static_cast(end - start) / CLOCKS_PER_SEC << " s. \n"; std::cout << "Number of simplices is: " << simplex_tree.num_simplices() << "\n"; } -- cgit v1.2.3 From a63c390725163a69943a0f144f78659debb8ae09 Mon Sep 17 00:00:00 2001 From: skachano Date: Mon, 30 Jan 2017 14:22:57 +0000 Subject: Removed a line to doc following Clément's comment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/relaxed-witness@2028 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: ea36d149b9771bba2a40816e564ffde02080b931 --- src/Witness_complex/doc/Witness_complex_doc.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/Witness_complex/doc/Witness_complex_doc.h') diff --git a/src/Witness_complex/doc/Witness_complex_doc.h b/src/Witness_complex/doc/Witness_complex_doc.h index cd54887a..171a185f 100644 --- a/src/Witness_complex/doc/Witness_complex_doc.h +++ b/src/Witness_complex/doc/Witness_complex_doc.h @@ -53,8 +53,6 @@ 2. Construct lists of nearest landmarks for each witness (special structure Gudhi::witness_complex::Active_witness is used internally). 3. Construct the witness complex for nearest landmark lists. - All the computations of nearest landmarks in Euclidean case are exact thanks to Gudhi::spatial_searching::Kd_tree_search data structure. - In the non-Euclidean classes, the lists of nearest landmarks are supposed to be given as input. The constructors take on the steps 1 and 2, while the function 'create_complex' executes the step 3. -- cgit v1.2.3