summaryrefslogtreecommitdiff
path: root/src/Witness_complex/doc/Witness_complex_doc.h
diff options
context:
space:
mode:
authorskachano <skachano@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-11-18 16:07:44 +0000
committerskachano <skachano@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2016-11-18 16:07:44 +0000
commitf891467fe38d7757aa3d92705ca99e847cdd68d9 (patch)
tree282e408824823c2c640453b08e69f6ebb7aecfa2 /src/Witness_complex/doc/Witness_complex_doc.h
parentfe79f2dcfd8b1540485d8a81fa7cedd07f5c8fac (diff)
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
Diffstat (limited to 'src/Witness_complex/doc/Witness_complex_doc.h')
-rw-r--r--src/Witness_complex/doc/Witness_complex_doc.h59
1 files changed, 51 insertions, 8 deletions
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 <gudhi/Simplex_tree.h>
+#include <gudhi/Witness_complex.h>
+#include <gudhi/pick_n_random_points.h>
+#include <gudhi/Points_off_io.h>
+
+#include <CGAL/Epick_d.h>
+
+#include <string>
+#include <vector>
+
+typedef CGAL::Epick_d<CGAL::Dynamic_dimension_tag> K;
+typedef typename K::Point_d Point_d;
+typedef typename Gudhi::witness_complex::Witness_complex<K> 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<Point_d> 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.