summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2015-12-11 15:41:39 +0000
committervrouvrea <vrouvrea@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2015-12-11 15:41:39 +0000
commitf9b5b9b3306f3f00f5bfa2724cbfa087d5161fcb (patch)
treecaf08060f8a3969d562588f7a8c61b0421447c77
parentc79ddda239336378d50255ef99ea6c34ceefbb47 (diff)
Commit code and doc review
Still issue and lot of logs in simplex_tree::prune_above_filtration git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/alphashapes@945 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: cd4f60ddcacb0444e0eb3b9323d8042eb49b132e
-rw-r--r--CMakeLists.txt4
-rw-r--r--biblio/bibliography.bib16
-rw-r--r--src/Alpha_complex/doc/Intro_alpha_complex.h8
-rw-r--r--src/Alpha_complex/doc/alpha_complex_doc.ipe24
-rw-r--r--src/Alpha_complex/doc/alpha_complex_doc.pngbin46746 -> 49973 bytes
-rw-r--r--src/Alpha_complex/doc/alpha_complex_doc_135.ipe88
-rw-r--r--src/Alpha_complex/doc/alpha_complex_doc_135.pngbin127130 -> 80794 bytes
-rw-r--r--src/Alpha_complex/doc/alpha_complex_representation.pngbin0 -> 16737 bytes
-rw-r--r--src/Alpha_complex/example/Alpha_complex_from_points.cpp22
-rw-r--r--src/Alpha_complex/include/gudhi/Alpha_complex.h6
-rw-r--r--src/Alpha_complex/test/CMakeLists.txt2
-rw-r--r--src/Simplex_tree/include/gudhi/Simplex_tree.h95
-rw-r--r--src/Simplex_tree/include/gudhi/Simplex_tree/Simplex_tree_siblings.h4
-rw-r--r--src/Simplex_tree/test/simplex_tree_unit_test.cpp266
-rw-r--r--src/common/example/dtoffrw_alphashapedoc_result.off15
-rw-r--r--src/common/example/dtoffrw_alphashapedoc_result.txt1
-rw-r--r--src/common/include/gudhi/Delaunay_triangulation_off_io.h2
-rw-r--r--src/common/test/dtoffrw_unit_test.cpp4
18 files changed, 436 insertions, 121 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d42f7af7..d0770dd7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -22,8 +22,8 @@ if(MSVC)
# Turn off some VC++ warnings
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267 /wd4668 /wd4311 /wd4800 /wd4820 /wd4503 /wd4244 /wd4345 /wd4996 /wd4396 /wd4018")
else()
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -std=c++11 -Wall -Wpedantic -Wsign-compare")
- set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -ggdb -O0")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -std=c++11 -fsanitize=memory -fno-omit-frame-pointer -Wall -Wpedantic -Wsign-compare")
+ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -ggdb -O1")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
endif()
diff --git a/biblio/bibliography.bib b/biblio/bibliography.bib
index 859696b4..3fd1c10a 100644
--- a/biblio/bibliography.bib
+++ b/biblio/bibliography.bib
@@ -897,22 +897,6 @@ language={English}
bibsource = {DBLP, http://dblp.uni-trier.de}
}
-@ARTICLE{AlphaShapesDefinition,
- author = {N. Akkiraju, H. Edelsbrunner, M. Facello, P. Fu, E. P. Mucke, and C. Varela},
- title = {\href{http://pub.ist.ac.at/~edels/Papers/1995-P-06-AlphaShapesSoftware.pdf}{Alpha shapes: definition and software}},
- journal = {Proc. Internat. Comput. Geom. Software Workshop 1995},
- year = {1995},
- bibsource = {http://pub.ist.ac.at}
-}
-
-@ARTICLE{AlphaShapesIntroduction,
- author = {Kaspar Fischer},
- title = {\href{http://www.cs.uu.nl/docs/vakken/ddm/texts/Delaunay/alphashapes.pdf}{Introduction to Alpha Shapes}},
- journal = {Unknown},
- year = {Unknown},
- bibsource = {http://www.cs.uu.nl}
-}
-
misc{buddha_stanford_scan,
author = "",
title = "The Stanford 3D Scanning Repository",
diff --git a/src/Alpha_complex/doc/Intro_alpha_complex.h b/src/Alpha_complex/doc/Intro_alpha_complex.h
index 685a4c2f..12d62ac0 100644
--- a/src/Alpha_complex/doc/Intro_alpha_complex.h
+++ b/src/Alpha_complex/doc/Intro_alpha_complex.h
@@ -37,10 +37,10 @@ namespace alphacomplex {
* \section definition Definition
*
* Alpha_complex is a <a target="_blank" href="https://en.wikipedia.org/wiki/Simplicial_complex">simplicial complex</a>
- * constructed from each finite cell of a Delaunay Triangulation.
+ * constructed from the finite cells of a Delaunay Triangulation.
*
- * The filtration value of each simplex is computed from the alpha square value of the simplex if it is Gabriel or
- * from the alpha value of the simplex coface that makes the simplex not Gabriel.
+ * The filtration value of each simplex is computed from the circumradius of the simplex if it is Gabriel or
+ * from the alpha value of the simplex cofaces that make it not Gabriel.
*
* All simplices that have a filtration value strictly greater than a given alpha square value are not inserted into
* the simplex.
@@ -78,7 +78,7 @@ namespace alphacomplex {
*
* \subsection datastructure Data structure
*
- * In order to build the alpha complex, first, a Simplex tree is build from the cells of a Delaunay Triangulation.
+ * In order to build the alpha complex, first, a Simplex tree is built from the cells of a Delaunay Triangulation.
* (The filtration value is set to NaN, which stands for unknown value):
* \image html "alpha_complex_doc.png" "Simplex tree structure construction example"
*
diff --git a/src/Alpha_complex/doc/alpha_complex_doc.ipe b/src/Alpha_complex/doc/alpha_complex_doc.ipe
index b5601143..e74f9bc4 100644
--- a/src/Alpha_complex/doc/alpha_complex_doc.ipe
+++ b/src/Alpha_complex/doc/alpha_complex_doc.ipe
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!DOCTYPE ipe SYSTEM "ipe.dtd">
-<ipe version="70005" creator="Ipe 7.1.4">
-<info created="D:20150603143945" modified="D:20150831170130"/>
+<ipe version="70107" creator="Ipe 7.1.10">
+<info created="D:20150603143945" modified="D:20151130095407"/>
<ipestyle name="basic">
<symbol name="arrow/arc(spx)">
<path stroke="sym-stroke" fill="sym-stroke" pen="sym-pen">
@@ -202,13 +202,13 @@ h
<dashstyle name="dash dotted" value="[4 2 1 2] 0"/>
<dashstyle name="dash dot dotted" value="[4 2 1 2 1 2] 0"/>
<textsize name="large" value="\large"/>
+<textsize name="small" value="\small"/>
+<textsize name="tiny" value="\tiny"/>
<textsize name="Large" value="\Large"/>
<textsize name="LARGE" value="\LARGE"/>
<textsize name="huge" value="\huge"/>
<textsize name="Huge" value="\Huge"/>
-<textsize name="small" value="\small"/>
<textsize name="footnote" value="\footnotesize"/>
-<textsize name="tiny" value="\tiny"/>
<textstyle name="center" begin="\begin{center}" end="\end{center}"/>
<textstyle name="itemize" begin="\begin{itemize}" end="\end{itemize}"/>
<textstyle name="item" begin="\begin{itemize}\item{}" end="\end{itemize}"/>
@@ -232,14 +232,7 @@ h
<page>
<layer name="alpha"/>
<view layers="alpha" active="alpha"/>
-<use layer="alpha" matrix="1 0 0 1 -240 0" name="mark/fdisk(sfx)" pos="280 660" size="normal" stroke="black" fill="white"/>
-<use matrix="1 0 0 1 -239.3 -10.1537" name="mark/fdisk(sfx)" pos="300 720" size="normal" stroke="black" fill="white"/>
-<use matrix="1 0 0 1 -240 0" name="mark/fdisk(sfx)" pos="370 690" size="normal" stroke="black" fill="white"/>
-<use matrix="1 0 0 1 -240 0" name="mark/fdisk(sfx)" pos="290 530" size="normal" stroke="black" fill="white"/>
-<use matrix="1 0 0 1 -240 0" name="mark/fdisk(sfx)" pos="350 520" size="normal" stroke="black" fill="white"/>
-<use matrix="1 0 0 1 -240 0" name="mark/fdisk(sfx)" pos="320 580" size="normal" stroke="black" fill="white"/>
-<use matrix="1 0 0 1 -240 0" name="mark/fdisk(sfx)" pos="370 580" size="normal" stroke="black" fill="white"/>
-<path matrix="1 0 0 1 -240 0" stroke="darkcyan">
+<path layer="alpha" matrix="1 0 0 1 -240 0" stroke="darkcyan">
320 580 m
350 520 l
290 530 l
@@ -434,5 +427,12 @@ h
280 610 m
170 610 l
</path>
+<use matrix="1 0 0 1 -239.3 -10.1537" name="mark/fdisk(sfx)" pos="300 720" size="normal" stroke="black" fill="white"/>
+<use matrix="1 0 0 1 -240 0" name="mark/fdisk(sfx)" pos="370 690" size="normal" stroke="black" fill="white"/>
+<use matrix="1 0 0 1 -240 0" name="mark/fdisk(sfx)" pos="280 660" size="normal" stroke="black" fill="white"/>
+<use matrix="1 0 0 1 -240 0" name="mark/fdisk(sfx)" pos="320 580" size="normal" stroke="black" fill="white"/>
+<use matrix="1 0 0 1 -240 0" name="mark/fdisk(sfx)" pos="370 580" size="normal" stroke="black" fill="white"/>
+<use matrix="1 0 0 1 -240 0" name="mark/fdisk(sfx)" pos="350 520" size="normal" stroke="black" fill="white"/>
+<use matrix="1 0 0 1 -240 0" name="mark/fdisk(sfx)" pos="290 530" size="normal" stroke="black" fill="white"/>
</page>
</ipe>
diff --git a/src/Alpha_complex/doc/alpha_complex_doc.png b/src/Alpha_complex/doc/alpha_complex_doc.png
index 601ac051..c9eab275 100644
--- a/src/Alpha_complex/doc/alpha_complex_doc.png
+++ b/src/Alpha_complex/doc/alpha_complex_doc.png
Binary files differ
diff --git a/src/Alpha_complex/doc/alpha_complex_doc_135.ipe b/src/Alpha_complex/doc/alpha_complex_doc_135.ipe
index 28b893b8..5d1d29d4 100644
--- a/src/Alpha_complex/doc/alpha_complex_doc_135.ipe
+++ b/src/Alpha_complex/doc/alpha_complex_doc_135.ipe
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!DOCTYPE ipe SYSTEM "ipe.dtd">
-<ipe version="70005" creator="Ipe 7.1.4">
-<info created="D:20150603143945" modified="D:20150901093044"/>
+<ipe version="70107" creator="Ipe 7.1.10">
+<info created="D:20150603143945" modified="D:20151130095019"/>
<ipestyle name="basic">
<symbol name="arrow/arc(spx)">
<path stroke="sym-stroke" fill="sym-stroke" pen="sym-pen">
@@ -202,13 +202,13 @@ h
<dashstyle name="dash dotted" value="[4 2 1 2] 0"/>
<dashstyle name="dash dot dotted" value="[4 2 1 2 1 2] 0"/>
<textsize name="large" value="\large"/>
+<textsize name="small" value="\small"/>
+<textsize name="tiny" value="\tiny"/>
<textsize name="Large" value="\Large"/>
<textsize name="LARGE" value="\LARGE"/>
<textsize name="huge" value="\huge"/>
<textsize name="Huge" value="\Huge"/>
-<textsize name="small" value="\small"/>
<textsize name="footnote" value="\footnotesize"/>
-<textsize name="tiny" value="\tiny"/>
<textstyle name="center" begin="\begin{center}" end="\end{center}"/>
<textstyle name="itemize" begin="\begin{itemize}" end="\end{itemize}"/>
<textstyle name="item" begin="\begin{itemize}\item{}" end="\end{itemize}"/>
@@ -232,14 +232,7 @@ h
<page>
<layer name="alpha"/>
<view layers="alpha" active="alpha"/>
-<use layer="alpha" matrix="1 0 0 1 0 80" name="mark/fdisk(sfx)" pos="280 660" size="normal" stroke="black" fill="white"/>
-<use matrix="1 0 0 1 0.700256 69.8463" name="mark/fdisk(sfx)" pos="300 720" size="normal" stroke="black" fill="white"/>
-<use matrix="1 0 0 1 0 80" name="mark/fdisk(sfx)" pos="370 690" size="normal" stroke="black" fill="white"/>
-<use matrix="1 0 0 1 0 80" name="mark/fdisk(sfx)" pos="290 530" size="normal" stroke="black" fill="white"/>
-<use matrix="1 0 0 1 0 80" name="mark/fdisk(sfx)" pos="350 520" size="normal" stroke="black" fill="white"/>
-<use matrix="1 0 0 1 0 80" name="mark/fdisk(sfx)" pos="320 580" size="normal" stroke="black" fill="white"/>
-<use matrix="1 0 0 1 0 80" name="mark/fdisk(sfx)" pos="370 580" size="normal" stroke="black" fill="white"/>
-<path matrix="1 0 0 1 0 80" stroke="lightgray">
+<path layer="alpha" matrix="1 0 0 1 0 80" stroke="lightgray">
320 580 m
350 520 l
290 530 l
@@ -288,19 +281,11 @@ h
<path matrix="1 0 0 1 0 80" stroke="darkcyan">
77.2727 0 0 77.2727 243.636 591.818 e
</path>
-<use matrix="1 0 0 1 0 80" name="mark/fdisk(sfx)" pos="243.636 591.818" size="normal" stroke="darkcyan" fill="white"/>
<path matrix="1 0 0 1 0 80" stroke="darkcyan">
243.428 591.569 m
186.061 643.28 l
</path>
<text matrix="1 0 0 1 0 80" transformations="translations" pos="212.724 627.389" stroke="darkcyan" type="label" width="18.785" height="4.294" depth="1.49" valign="baseline">$\alpha_{420}$</text>
-<use matrix="1 0 0 1 -264 -162" name="mark/fdisk(sfx)" pos="280 660" size="normal" stroke="black" fill="white"/>
-<use matrix="1 0 0 1 -263.3 -172.154" name="mark/fdisk(sfx)" pos="300 720" size="normal" stroke="black" fill="white"/>
-<use matrix="1 0 0 1 -264 -162" name="mark/fdisk(sfx)" pos="370 690" size="normal" stroke="black" fill="white"/>
-<use matrix="1 0 0 1 -264 -162" name="mark/fdisk(sfx)" pos="290 530" size="normal" stroke="black" fill="white"/>
-<use matrix="1 0 0 1 -264 -162" name="mark/fdisk(sfx)" pos="350 520" size="normal" stroke="black" fill="white"/>
-<use matrix="1 0 0 1 -264 -162" name="mark/fdisk(sfx)" pos="320 580" size="normal" stroke="black" fill="white"/>
-<use matrix="1 0 0 1 -264 -162" name="mark/fdisk(sfx)" pos="370 580" size="normal" stroke="black" fill="white"/>
<path matrix="1 0 0 1 -264 -162" stroke="lightgray">
320 580 m
350 520 l
@@ -325,7 +310,6 @@ h
modified (NaN)
</text>
<text matrix="1 0 0 1 -266.155 -165.501" transformations="translations" pos="282.952 524.893" stroke="black" type="label" width="4.981" height="6.42" depth="0" valign="baseline">0</text>
-<text matrix="1 0 0 1 -264 -162" transformations="translations" pos="352.708 510.349" stroke="black" type="label" width="4.981" height="6.42" depth="0" valign="baseline">1</text>
<text matrix="1 0 0 1 -264 -162" transformations="translations" pos="310.693 578.759" stroke="black" type="label" width="4.981" height="6.42" depth="0" valign="baseline">2</text>
<text matrix="1 0 0 1 -264 -162" transformations="translations" pos="375.332 578.49" stroke="black" type="label" width="4.981" height="6.42" depth="0" valign="baseline">3</text>
<text matrix="1 0 0 1 -264 -172" transformations="translations" pos="272.179 660.635" stroke="black" type="label" width="4.981" height="6.42" depth="0" valign="baseline">4</text>
@@ -357,18 +341,10 @@ modified (NaN)
<path matrix="1 0 0 1 -264 -162" stroke="darkcyan">
29.1548 0 0 29.1548 305 555 e
</path>
-<use matrix="1 0 0 1 -264 -162" name="mark/fdisk(sfx)" pos="305 555" size="normal" stroke="darkcyan" fill="white"/>
<path matrix="1 0 0 1 -264 -162" stroke="darkcyan">
304.883 555.015 m
334.509 555.015 l
</path>
-<use matrix="1 0 0 1 -38 -164" name="mark/fdisk(sfx)" pos="280 660" size="normal" stroke="black" fill="white"/>
-<use matrix="1 0 0 1 -37.2997 -174.154" name="mark/fdisk(sfx)" pos="300 720" size="normal" stroke="black" fill="white"/>
-<use matrix="1 0 0 1 -38 -164" name="mark/fdisk(sfx)" pos="370 690" size="normal" stroke="black" fill="white"/>
-<use matrix="1 0 0 1 -38 -164" name="mark/fdisk(sfx)" pos="290 530" size="normal" stroke="black" fill="white"/>
-<use matrix="1 0 0 1 -38 -164" name="mark/fdisk(sfx)" pos="350 520" size="normal" stroke="black" fill="white"/>
-<use matrix="1 0 0 1 -38 -164" name="mark/fdisk(sfx)" pos="320 580" size="normal" stroke="darkred" fill="white"/>
-<use matrix="1 0 0 1 -38 -164" name="mark/fdisk(sfx)" pos="370 580" size="normal" stroke="black" fill="white"/>
<path matrix="1 0 0 1 -37.2997 -163.65" stroke="lightgray">
320 580 m
350 520 l
@@ -391,10 +367,7 @@ modified (NaN)
</path>
<text matrix="1 0 0 1 -199.21 -189.117" transformations="translations" pos="380 530" stroke="darkred" type="label" width="168.308" height="8.965" depth="2.99" valign="baseline" size="large">[0,4] is not Gabriel $\rightarrow$ $\alpha_{40} = \alpha_{420}$</text>
<text matrix="1 0 0 1 -40.1546 -167.501" transformations="translations" pos="282.952 524.893" stroke="black" type="label" width="4.981" height="6.42" depth="0" valign="baseline">0</text>
-<text matrix="1 0 0 1 -38 -164" transformations="translations" pos="352.708 510.349" stroke="black" type="label" width="4.981" height="6.42" depth="0" valign="baseline">1</text>
-<text matrix="1 0 0 1 -38 -164" transformations="translations" pos="310.693 578.759" stroke="darkred" type="label" width="4.981" height="6.42" depth="0" valign="baseline">2</text>
<text matrix="1 0 0 1 -38 -164" transformations="translations" pos="375.332 578.49" stroke="black" type="label" width="4.981" height="6.42" depth="0" valign="baseline">3</text>
-<text matrix="1 0 0 1 -38 -164" transformations="translations" pos="272.179 660.635" stroke="black" type="label" width="4.981" height="6.42" depth="0" valign="baseline">4</text>
<text matrix="1 0 0 1 -37.2997 -174.154" transformations="translations" pos="296.419 724.197" stroke="black" type="label" width="4.981" height="6.42" depth="0" valign="baseline">5</text>
<text matrix="1 0 0 1 -38 -164" transformations="translations" pos="375.332 689.453" stroke="black" type="label" width="4.981" height="6.42" depth="0" valign="baseline">6</text>
<path matrix="1 0 0 1 -38 -164" stroke="lightgray">
@@ -420,16 +393,6 @@ modified (NaN)
290 530 m
280 660 l
</path>
-<path matrix="1 0 0 1 -38 -164" stroke="darkred" pen="heavier">
-65.192 0 0 65.192 285 595 e
-</path>
-<use matrix="1 0 0 1 126 -162" name="mark/fdisk(sfx)" pos="280 660" size="normal" stroke="black" fill="white"/>
-<use matrix="1 0 0 1 126.7 -172.154" name="mark/fdisk(sfx)" pos="300 720" size="normal" stroke="black" fill="white"/>
-<use matrix="1 0 0 1 126 -162" name="mark/fdisk(sfx)" pos="370 690" size="normal" stroke="black" fill="white"/>
-<use matrix="1 0 0 1 126 -162" name="mark/fdisk(sfx)" pos="290 530" size="normal" stroke="black" fill="white"/>
-<use matrix="1 0 0 1 126 -162" name="mark/fdisk(sfx)" pos="350 520" size="normal" stroke="black" fill="white"/>
-<use matrix="1 0 0 1 126 -162" name="mark/fdisk(sfx)" pos="320 580" size="normal" stroke="black" fill="white"/>
-<use matrix="1 0 0 1 126 -162" name="mark/fdisk(sfx)" pos="370 580" size="normal" stroke="black" fill="white"/>
<path matrix="1 0 0 1 126 -162" stroke="lightgray">
320 580 m
350 520 l
@@ -483,7 +446,6 @@ modified (NaN)
<path stroke="darkcyan">
44.5799 0 0 44.5799 425.934 457.774 e
</path>
-<use name="mark/fdisk(sfx)" pos="425.934 457.774" size="normal" stroke="darkcyan" fill="white"/>
<path stroke="darkcyan">
425.854 457.774 m
470.795 457.774 l
@@ -505,10 +467,48 @@ modified (NaN)
<text matrix="1 0 0 1 39.645 -2.36686" transformations="translations" pos="199.703 569.464" stroke="darkblue" type="label" width="93.206" height="7.473" depth="2.49" valign="baseline">For all faces of [4,2,0]</text>
<text matrix="1 0 0 1 -93.391 2.68003" transformations="translations" pos="104.437 300.174" stroke="black" type="label" width="208.621" height="6.926" depth="1.93" valign="baseline">N.B. : is Gabriel on a single point has no sense.</text>
<text matrix="1 0 0 1 -36.9231 10" transformations="translations" pos="48 784" stroke="black" type="label" width="118.324" height="7.473" depth="2.49" valign="baseline">Dimension =2 - $\sigma$ = [4,2,0]</text>
-<use name="mark/fdisk(sfx)" pos="247 431" size="normal" stroke="darkcyan" fill="white"/>
<path stroke="darkcyan">
247.333 430.892 m
311.764 430.892 l
</path>
+<use matrix="1 0 0 1 0.700256 69.8463" name="mark/fdisk(sfx)" pos="300 720" size="normal" stroke="black" fill="white"/>
+<use matrix="1 0 0 1 0 80" name="mark/fdisk(sfx)" pos="370 690" size="normal" stroke="black" fill="white"/>
+<use matrix="1 0 0 1 0 80" name="mark/fdisk(sfx)" pos="280 660" size="normal" stroke="black" fill="white"/>
+<use matrix="1 0 0 1 0 80" name="mark/fdisk(sfx)" pos="243.636 591.818" size="normal" stroke="darkcyan" fill="white"/>
+<use matrix="1 0 0 1 0 80" name="mark/fdisk(sfx)" pos="370 580" size="normal" stroke="black" fill="white"/>
+<use matrix="1 0 0 1 0 80" name="mark/fdisk(sfx)" pos="350 520" size="normal" stroke="black" fill="white"/>
+<use matrix="1 0 0 1 0 80" name="mark/fdisk(sfx)" pos="320 580" size="normal" stroke="black" fill="white"/>
+<use matrix="1 0 0 1 0 80" name="mark/fdisk(sfx)" pos="290 530" size="normal" stroke="black" fill="white"/>
+<use matrix="1 0 0 1 -263.3 -172.154" name="mark/fdisk(sfx)" pos="300 720" size="normal" stroke="black" fill="white"/>
+<use matrix="1 0 0 1 -264 -162" name="mark/fdisk(sfx)" pos="280 660" size="normal" stroke="black" fill="white"/>
+<use matrix="1 0 0 1 -264 -162" name="mark/fdisk(sfx)" pos="370 690" size="normal" stroke="black" fill="white"/>
+<use matrix="1 0 0 1 -264 -162" name="mark/fdisk(sfx)" pos="370 580" size="normal" stroke="black" fill="white"/>
+<use matrix="1 0 0 1 -264 -162" name="mark/fdisk(sfx)" pos="350 520" size="normal" stroke="black" fill="white"/>
+<text matrix="1 0 0 1 -264 -162" transformations="translations" pos="352.708 510.349" stroke="black" type="label" width="4.981" height="6.42" depth="0" valign="baseline">1</text>
+<use matrix="1 0 0 1 -264 -162" name="mark/fdisk(sfx)" pos="305 555" size="normal" stroke="darkcyan" fill="white"/>
+<use matrix="1 0 0 1 -264 -162" name="mark/fdisk(sfx)" pos="290 530" size="normal" stroke="black" fill="white"/>
+<use matrix="1 0 0 1 -264 -162" name="mark/fdisk(sfx)" pos="320 580" size="normal" stroke="black" fill="white"/>
+<use matrix="1 0 0 1 -37.2997 -174.154" name="mark/fdisk(sfx)" pos="300 720" size="normal" stroke="black" fill="white"/>
+<use matrix="1 0 0 1 -38 -164" name="mark/fdisk(sfx)" pos="370 690" size="normal" stroke="black" fill="white"/>
+<text matrix="1 0 0 1 -38 -164" transformations="translations" pos="272.179 660.635" stroke="black" type="label" width="4.981" height="6.42" depth="0" valign="baseline">4</text>
+<use name="mark/fdisk(sfx)" pos="247 431" size="normal" stroke="darkcyan" fill="white"/>
+<use matrix="1 0 0 1 -38 -164" name="mark/fdisk(sfx)" pos="350 520" size="normal" stroke="black" fill="white"/>
+<text matrix="1 0 0 1 -38 -164" transformations="translations" pos="352.708 510.349" stroke="black" type="label" width="4.981" height="6.42" depth="0" valign="baseline">1</text>
+<use matrix="1 0 0 1 -38 -164" name="mark/fdisk(sfx)" pos="370 580" size="normal" stroke="black" fill="white"/>
+<use matrix="1 0 0 1 -38 -164" name="mark/fdisk(sfx)" pos="320 580" size="normal" stroke="darkred" fill="white"/>
+<text matrix="1 0 0 1 -38 -164" transformations="translations" pos="310.693 578.759" stroke="darkred" type="label" width="4.981" height="6.42" depth="0" valign="baseline">2</text>
+<path matrix="1 0 0 1 -38 -164" stroke="darkred" pen="heavier">
+65.192 0 0 65.192 285 595 e
+</path>
+<use matrix="1 0 0 1 -38 -164" name="mark/fdisk(sfx)" pos="290 530" size="normal" stroke="black" fill="white"/>
+<use matrix="1 0 0 1 126 -162" name="mark/fdisk(sfx)" pos="290 530" size="normal" stroke="black" fill="white"/>
+<use matrix="1 0 0 1 126.7 -172.154" name="mark/fdisk(sfx)" pos="300 720" size="normal" stroke="black" fill="white"/>
+<use matrix="1 0 0 1 126 -162" name="mark/fdisk(sfx)" pos="370 690" size="normal" stroke="black" fill="white"/>
+<use matrix="1 0 0 1 126 -162" name="mark/fdisk(sfx)" pos="280 660" size="normal" stroke="black" fill="white"/>
+<use name="mark/fdisk(sfx)" pos="425.934 457.774" size="normal" stroke="darkcyan" fill="white"/>
+<use matrix="1 0 0 1 126 -162" name="mark/fdisk(sfx)" pos="320 580" size="normal" stroke="black" fill="white"/>
+<use matrix="1 0 0 1 126 -162" name="mark/fdisk(sfx)" pos="370 580" size="normal" stroke="black" fill="white"/>
+<use matrix="1 0 0 1 126 -162" name="mark/fdisk(sfx)" pos="350 520" size="normal" stroke="black" fill="white"/>
+<use matrix="1 0 0 1 -38 -164" name="mark/fdisk(sfx)" pos="280 660" size="normal" stroke="black" fill="white"/>
</page>
</ipe>
diff --git a/src/Alpha_complex/doc/alpha_complex_doc_135.png b/src/Alpha_complex/doc/alpha_complex_doc_135.png
index 5dce5edd..ef7187f7 100644
--- a/src/Alpha_complex/doc/alpha_complex_doc_135.png
+++ b/src/Alpha_complex/doc/alpha_complex_doc_135.png
Binary files differ
diff --git a/src/Alpha_complex/doc/alpha_complex_representation.png b/src/Alpha_complex/doc/alpha_complex_representation.png
new file mode 100644
index 00000000..06e54c06
--- /dev/null
+++ b/src/Alpha_complex/doc/alpha_complex_representation.png
Binary files differ
diff --git a/src/Alpha_complex/example/Alpha_complex_from_points.cpp b/src/Alpha_complex/example/Alpha_complex_from_points.cpp
index 62f594d1..00e988a6 100644
--- a/src/Alpha_complex/example/Alpha_complex_from_points.cpp
+++ b/src/Alpha_complex/example/Alpha_complex_from_points.cpp
@@ -30,21 +30,13 @@ int main(int argc, char **argv) {
// Init of a list of points
// ----------------------------------------------------------------------------
Vector_of_points points;
-
- std::vector<double> coords = { 1.0, 1.0 };
- points.push_back(Point(coords.begin(), coords.end()));
- coords = { 7.0, 0.0 };
- points.push_back(Point(coords.begin(), coords.end()));
- coords = { 4.0, 6.0 };
- points.push_back(Point(coords.begin(), coords.end()));
- coords = { 9.0, 6.0 };
- points.push_back(Point(coords.begin(), coords.end()));
- coords = { 0.0, 14.0 };
- points.push_back(Point(coords.begin(), coords.end()));
- coords = { 2.0, 19.0 };
- points.push_back(Point(coords.begin(), coords.end()));
- coords = { 9.0, 17.0 };
- points.push_back(Point(coords.begin(), coords.end()));
+ points.push_back(Point(1.0, 1.0));
+ points.push_back(Point(7.0, 0.0));
+ points.push_back(Point(4.0, 6.0));
+ points.push_back(Point(9.0, 6.0));
+ points.push_back(Point(0.0, 14.0));
+ points.push_back(Point(2.0, 19.0));
+ points.push_back(Point(9.0, 17.0));
// ----------------------------------------------------------------------------
// Init of an alpha complex from the list of points
diff --git a/src/Alpha_complex/include/gudhi/Alpha_complex.h b/src/Alpha_complex/include/gudhi/Alpha_complex.h
index 2dae4028..9f931066 100644
--- a/src/Alpha_complex/include/gudhi/Alpha_complex.h
+++ b/src/Alpha_complex/include/gudhi/Alpha_complex.h
@@ -125,7 +125,9 @@ class Alpha_complex : public Simplex_tree<> {
/** \brief Alpha_complex constructor from a Delaunay triangulation.
*
- * @param[in] triangulation_ptr Pointer on a Delaunay triangulation.
+ * @param[in] triangulation_ptr Pointer on a <a target="_blank"
+ * href="http://doc.cgal.org/latest/Triangulation/index.html#Chapter_Triangulations">
+ * CGAL::Delaunay_triangulation<Kernel></a> \cite cgal:hdj-t-15b.
* @param[in] max_alpha_square maximum for alpha square value. Default value is +\f$\infty\f$.
*/
Alpha_complex(Delaunay_triangulation* triangulation_ptr,
@@ -170,7 +172,7 @@ class Alpha_complex : public Simplex_tree<> {
}
}
- /** \brief Alpha_complex destructor from a Delaunay triangulation.
+ /** \brief Alpha_complex destructor.
*
* @warning Deletes the Delaunay triangulation.
*/
diff --git a/src/Alpha_complex/test/CMakeLists.txt b/src/Alpha_complex/test/CMakeLists.txt
index fa24e1b1..d7c13da0 100644
--- a/src/Alpha_complex/test/CMakeLists.txt
+++ b/src/Alpha_complex/test/CMakeLists.txt
@@ -18,6 +18,8 @@ if(CGAL_FOUND)
add_executable ( AlphaComplexUT Alpha_complex_unit_test.cpp )
target_link_libraries(AlphaComplexUT ${Boost_SYSTEM_LIBRARY} ${CGAL_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
+ add_executable ( cerr cerr.cpp )
+
# Do not forget to copy test files in current binary dir
file(COPY "${CMAKE_SOURCE_DIR}/data/points/alphacomplexdoc.off" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
diff --git a/src/Simplex_tree/include/gudhi/Simplex_tree.h b/src/Simplex_tree/include/gudhi/Simplex_tree.h
index 3adf06d3..4b04e75a 100644
--- a/src/Simplex_tree/include/gudhi/Simplex_tree.h
+++ b/src/Simplex_tree/include/gudhi/Simplex_tree.h
@@ -530,7 +530,7 @@ class Simplex_tree {
return dimension_;
}
- /** \brief Returns true iff the node in the simplex tree pointed by
+ /** \brief Returns true if the node in the simplex tree pointed by
* sh has children.*/
bool has_children(Simplex_handle sh) const {
return (sh->second.children()->parent() == sh->first);
@@ -1134,7 +1134,6 @@ class Simplex_tree {
if (sh->second.filtration() < upper_filtration) {
// Store the filtration modification information
modified = true;
- std::cout << "modified" << std::endl;
sh->second.assign_filtration(upper_filtration);
}
if (has_children(sh)) {
@@ -1154,21 +1153,51 @@ class Simplex_tree {
* call `initialize_filtration()` to recompute it.
*/
void prune_above_filtration(Filtration_value filtration) {
- if (filtration < threshold_) {
- threshold_ = filtration;
- // Initialize filtration_vect_ if required
- if (filtration_vect_.empty()) {
- initialize_filtration();
- }
+std::cout << "prune_above_filtration - filtration=" << filtration << std::endl;
+ // No action if filtration is not stored
+ if (Options::store_filtration) {
+ if (filtration < threshold_) {
+ threshold_ = filtration;
+ // Initialize filtration_vect_ if required
+ if (filtration_vect_.empty()) {
+std::cout << "prune_above_filtration - initialize_filtration" << std::endl;
+ initialize_filtration();
+ }
+
+std::cout << "prune_above_filtration - after initialize_filtration ";
+for(auto sh : filtration_vect_) {
+for (auto vertex : simplex_vertex_range(sh)) {
+std::cout << (int) vertex << ", ";
+}
+std::cout << " - filtration=" << sh->second.filtration() << " - " << &(sh->second) << std::endl;
+}
- // Loop in reverse mode until threshold is reached
- auto f_simplex = filtration_vect_.rbegin();
- for (; f_simplex != filtration_vect_.rend() && ((*f_simplex)->second.filtration() > threshold_); f_simplex++) {
- remove_maximal_simplex(*f_simplex);
+
+ // Loop in reverse mode until threshold is reached
+ auto f_simplex = filtration_vect_.rbegin();
+ for (; (f_simplex != filtration_vect_.rend()) && ((*f_simplex)->second.filtration() > threshold_); f_simplex++) {
+
+std::cout << "prune_above_filtration - remove ";
+for (auto vertex : simplex_vertex_range(*f_simplex)) {
+std::cout << (int) vertex << ", ";
+}
+std::cout << " - " << &((*f_simplex)->second) << std::endl;
+
+ remove_maximal_simplex(*f_simplex);
+ }
+std::cout << "prune_above_filtration - remove STOPPED ON ";
+for (auto vertex : simplex_vertex_range(*f_simplex)) {
+std::cout << (int) vertex << ", ";
+}
+std::cout << " - filtration=" << (*f_simplex)->second.filtration() << " - " << &(*f_simplex->second) << std::endl;
+ if (f_simplex != filtration_vect_.rbegin()) {
+ // Do not forget to update filtration_vect_ - resize is enough
+ std::size_t new_size = filtration_vect_.size() - (f_simplex - filtration_vect_.rbegin());
+std::cout << "prune_above_filtration - resize" << new_size << std::endl;
+ filtration_vect_.resize(new_size);
+ }
+
}
- // Do not forget to update filtration_vect_ - resize is enough
- std::size_t new_size = filtration_vect_.size() - (f_simplex - filtration_vect_.rbegin());
- filtration_vect_.resize(new_size);
}
}
@@ -1187,14 +1216,46 @@ class Simplex_tree {
if ((child->size() > 1) || (child == root())) {
// Not alone, just remove it from members
// Special case when child is the root of the simplex tree, just remove it from members
- child->members().erase(sh->first);
+std::cout << "remove_maximal_simplex - members removal" << std::endl;
+ child->erase(sh->first);
} else {
// Sibling is emptied : must be deleted, and its parent must point on his own Sibling
+std::cout << "remove_maximal_simplex - members is empty" << std::endl;
child->oncles()->members().at(child->parent()).assign_children(child->oncles());
delete child;
}
}
-
+/***************************************************************************************************************/
+ public:
+ /** \brief Prints the simplex_tree hierarchically.
+ * Since it prints the vertices recursively, one can watch its tree shape.
+ */
+ void print_tree() {
+ for (auto sh = root_.members().begin(); sh != root_.members().end(); ++sh) {
+ std::cout << sh->first << " ";
+ if (has_children(sh)) {
+ std::cout << "(";
+ rec_print(sh->second.children());
+ std::cout << ")";
+ }
+ std::cout << std::endl;
+ }
+ }
+
+
+ /** \brief Recursively prints the simplex_tree, using depth first search. */
+ private:
+ void rec_print(Siblings * sib) {
+ for (auto sh = sib->members().begin(); sh != sib->members().end(); ++sh) {
+ std::cout << " " << sh->first << " ";
+ if (has_children(sh)) {
+ std::cout << "(";
+ rec_print(sh->second.children());
+ std::cout << ")";
+ }
+ }
+ }
+/*****************************************************************************************************************/
private:
Vertex_handle null_vertex_;
/** \brief Upper bound on the filtration values of the simplices.*/
diff --git a/src/Simplex_tree/include/gudhi/Simplex_tree/Simplex_tree_siblings.h b/src/Simplex_tree/include/gudhi/Simplex_tree/Simplex_tree_siblings.h
index 158ee1f7..c1ff8bf2 100644
--- a/src/Simplex_tree/include/gudhi/Simplex_tree/Simplex_tree_siblings.h
+++ b/src/Simplex_tree/include/gudhi/Simplex_tree/Simplex_tree_siblings.h
@@ -116,6 +116,10 @@ class Simplex_tree_siblings {
return members_.size();
}
+ void erase(const Vertex_handle vh) {
+ members_.erase(vh);
+ }
+
Simplex_tree_siblings * oncles_;
Vertex_handle parent_;
Dictionary members_;
diff --git a/src/Simplex_tree/test/simplex_tree_unit_test.cpp b/src/Simplex_tree/test/simplex_tree_unit_test.cpp
index 00cf69bc..f6bd5411 100644
--- a/src/Simplex_tree/test/simplex_tree_unit_test.cpp
+++ b/src/Simplex_tree/test/simplex_tree_unit_test.cpp
@@ -362,7 +362,9 @@ BOOST_AUTO_TEST_CASE(simplex_tree_insertion) {
}
-bool sort_in_decr_order (Vertex_handle i,Vertex_handle j) { return (i>j); }
+bool sort_in_decr_order(Vertex_handle i, Vertex_handle j) {
+ return (i > j);
+}
BOOST_AUTO_TEST_CASE(NSimplexAndSubfaces_tree_insertion) {
std::cout << "********************************************************************" << std::endl;
@@ -476,7 +478,7 @@ BOOST_AUTO_TEST_CASE(NSimplexAndSubfaces_tree_insertion) {
BOOST_CHECK(vertex == SimplexVector6[position]);
position++;
}
-
+
/* Inserted simplex: */
/* 1 6 */
/* o---o */
@@ -720,14 +722,268 @@ BOOST_AUTO_TEST_CASE(copy_move_on_simplex_tree) {
// Check there is a new simplex tree reference
BOOST_CHECK(&st_move != &st_copy);
BOOST_CHECK(&st_move != &st);
-
+
typeST st_empty;
// Check st has been emptied by the move
BOOST_CHECK(st == st_empty);
BOOST_CHECK(st.filtration() == 0);
BOOST_CHECK(st.dimension() == -1);
BOOST_CHECK(st.num_simplices() == 0);
- BOOST_CHECK(st.num_vertices() == (size_t)0);
-
+ BOOST_CHECK(st.num_vertices() == (size_t) 0);
+
std::cout << "Printing st once again- address = " << &st << std::endl;
}
+
+BOOST_AUTO_TEST_CASE(make_filtration_non_decreasing) {
+ std::cout << "********************************************************************" << std::endl;
+ std::cout << "MAKE FILTRATION NON DECREASING" << std::endl;
+ typeST st;
+
+ st.insert_simplex_and_subfaces({2, 1, 0}, 4.0);
+ st.insert_simplex_and_subfaces({3, 0}, 3.0);
+ st.insert_simplex_and_subfaces({3, 4, 5}, 2.0);
+ // Because of non decreasing property of simplex tree, { 0 } , { 1 } and { 0, 1 } are going to be set from value 4.0
+ // to 1.0
+ st.insert_simplex_and_subfaces({0, 1, 6, 7}, 1.0);
+
+ /* Inserted simplex: */
+ /* 1 6 */
+ /* o---o */
+ /* /X\7/ */
+ /* o---o---o---o */
+ /* 2 0 3\X/4 */
+ /* o */
+ /* 5 */
+
+ // FIXME
+ st.set_dimension(3);
+
+ // Copy constructor
+ typeST st_copy = st;
+
+ // Check default insertion ensures the filtration values are non decreasing
+ BOOST_CHECK(!st.make_filtration_non_decreasing());
+ // Check the simplex tree is not modified by the function
+ BOOST_CHECK(st == st_copy);
+
+ // Make { 0, 1 } decreasing
+ st.assign_filtration(st.find({0, 1}), 0.5);
+ // Make { 1, 6, 7 } decreasing
+ st.assign_filtration(st.find({1, 6, 7}), 0.4);
+ // Make { 3, 4 } decreasing
+ st.assign_filtration(st.find({3, 4}), 0.3);
+ // Make { 4, 5 } decreasing
+ st.assign_filtration(st.find({4, 5}), 0.1);
+
+ // Check the filtration values were decreasing
+ BOOST_CHECK(st.make_filtration_non_decreasing());
+ // Check the simplex tree has been modified by the function to retrieve the initial simplex tree
+ BOOST_CHECK(st == st_copy);
+
+ // Change { 0, 3 }, but still non decreasing
+ st.assign_filtration(st.find({0, 3}), 1.01);
+ // Change { 0, 1, 6, 7 }, but still non decreasing
+ st.assign_filtration(st.find({0, 1, 6, 7}), 1.201);
+ // Change { 1, 2 }, but still non decreasing
+ st.assign_filtration(st.find({1, 2}), 1.05);
+ // Change { 4 }, but still non decreasing
+ st.assign_filtration(st.find({4}), 1.123);
+
+ // Check the filtration values are non decreasing
+ BOOST_CHECK(!st.make_filtration_non_decreasing());
+ // Check the simplex tree has been modified from the original
+ BOOST_CHECK(st != st_copy);
+
+}
+
+struct MyOptions : Simplex_tree_options_full_featured {
+ // Not doing persistence, so we don't need those
+ static const bool store_key = false;
+ static const bool store_filtration = false;
+ // I have few vertices
+ typedef short Vertex_handle;
+};
+typedef Simplex_tree<MyOptions> miniST;
+
+/*BOOST_AUTO_TEST_CASE(remove_maximal_simplex) {
+ std::cout << "********************************************************************" << std::endl;
+ std::cout << "REMOVE MAXIMAL SIMPLEX" << std::endl;
+
+ miniST st;
+
+ // FIXME
+ st.set_dimension(3);
+
+ st.insert_simplex_and_subfaces({0, 1, 6, 7});
+ st.insert_simplex_and_subfaces({3, 4, 5});
+
+ // Constructs a copy at this state for further test purpose
+ miniST st_pruned = st;
+
+ st.insert_simplex_and_subfaces({3, 0});
+ st.insert_simplex_and_subfaces({2, 1, 0});
+
+ // Constructs a copy at this state for further test purpose
+ miniST st_complete = st;
+ // st_complete and st:
+ // 1 6
+ // o---o
+ // /X\7/
+ // o---o---o---o
+ // 2 0 3\X/4
+ // o
+ // 5
+ // st_pruned:
+ // 1 6
+ // o---o
+ // \7/
+ // o o---o
+ // 0 3\X/4
+ // o
+ // 5
+
+#ifdef GUDHI_DEBUG
+ std::cout << "Check exception throw in debug mode" << std::endl;
+ // throw excpt because sh has children
+ BOOST_CHECK_THROW (st.remove_maximal_simplex(st.find({0, 1, 6})), std::invalid_argument);
+ BOOST_CHECK_THROW (st.remove_maximal_simplex(st.find({3})), std::invalid_argument);
+ BOOST_CHECK(st == st_complete);
+#endif
+
+ st.remove_maximal_simplex(st.find({0, 2}));
+ st.remove_maximal_simplex(st.find({0, 1, 2}));
+ st.remove_maximal_simplex(st.find({1, 2}));
+ st.remove_maximal_simplex(st.find({2}));
+ st.remove_maximal_simplex(st.find({0, 3}));
+
+ BOOST_CHECK(st == st_pruned);
+ // Remove all, but as the simplex tree is not storing filtration, there is no modification
+ st.prune_above_filtration(0.0);
+ BOOST_CHECK(st == st_pruned);
+
+ miniST st_wo_seven;
+ // FIXME
+ st_wo_seven.set_dimension(3);
+
+ st_wo_seven.insert_simplex_and_subfaces({0, 1, 6});
+ st_wo_seven.insert_simplex_and_subfaces({3, 4, 5});
+ // st_wo_seven:
+ // 1 6
+ // o---o
+ // \X/
+ // o o---o
+ // 0 3\X/4
+ // o
+ // 5
+
+ // Remove all 7 to test the both remove_maximal_simplex cases (when _members is empty or not)
+ st.remove_maximal_simplex(st.find({0, 1, 6, 7}));
+ st.remove_maximal_simplex(st.find({0, 1, 7}));
+ st.remove_maximal_simplex(st.find({0, 6, 7}));
+ st.remove_maximal_simplex(st.find({0, 7}));
+ st.remove_maximal_simplex(st.find({1, 6, 7}));
+ st.remove_maximal_simplex(st.find({1, 7}));
+ st.remove_maximal_simplex(st.find({6, 7}));
+ st.remove_maximal_simplex(st.find({7}));
+
+ BOOST_CHECK(st == st_wo_seven);
+}*/
+
+BOOST_AUTO_TEST_CASE(prune_above_filtration) {
+ std::cout << "********************************************************************" << std::endl;
+ std::cout << "PRUNE ABOVE FILTRATION" << std::endl;
+ typeST st;
+
+ // FIXME
+ st.set_dimension(3);
+
+ st.insert_simplex_and_subfaces({0, 1, 6, 7}, 1.0);
+ st.insert_simplex_and_subfaces({3, 4, 5}, 2.0);
+ st.set_filtration(6.0);
+
+ // Constructs a copy at this state for further test purpose
+ typeST st_pruned = st;
+ st_pruned.initialize_filtration(); // reset
+
+ st.insert_simplex_and_subfaces({3, 0}, 3.0);
+ st.insert_simplex_and_subfaces({2, 1, 0}, 4.0);
+
+ // Constructs a copy at this state for further test purpose
+ typeST st_complete = st;
+ // st_complete and st:
+ // 1 6
+ // o---o
+ // /X\7/
+ // o---o---o---o
+ // 2 0 3\X/4
+ // o
+ // 5
+ // st_pruned:
+ // 1 6
+ // o---o
+ // \7/
+ // o o---o
+ // 0 3\X/4
+ // o
+ // 5
+
+ // Check the no action cases
+ // greater than initial filtration value
+ st.prune_above_filtration(10.0);
+ BOOST_CHECK(st == st_complete);
+ // equal to initial filtration value
+ st.prune_above_filtration(6.0);
+ BOOST_CHECK(st == st_complete);
+ // lower than initial filtration value, but still greater than the maximum filtration value
+ st_complete.set_filtration(5.0);
+ st.prune_above_filtration(5.0);
+ BOOST_CHECK(st == st_complete);
+
+ // Display the Simplex_tree - Can not be done in the middle of 2 inserts
+ std::cout << "The complex contains " << st.num_simplices() << " simplices" << std::endl;
+ std::cout << " - dimension " << st.dimension() << " - filtration " << st.filtration() << std::endl;
+ std::cout << std::endl << std::endl << "Iterator on Simplices in the filtration, with [filtration value]:" << std::endl;
+ for (auto f_simplex : st.filtration_simplex_range()) {
+ std::cout << " " << "[" << st.filtration(f_simplex) << "] ";
+ for (auto vertex : st.simplex_vertex_range(f_simplex)) {
+ std::cout << (int) vertex << " ";
+ }
+ std::cout << std::endl;
+ }
+
+ // Check the pruned cases
+ // Set the st_pruned filtration for operator==
+ st_pruned.set_filtration(2.5);
+ st.prune_above_filtration(2.5);
+ /*BOOST_CHECK(st == st_pruned);
+
+ st_pruned.set_filtration(2.0);
+ st.prune_above_filtration(2.0);
+ BOOST_CHECK(st == st_pruned);
+*/
+/* std::cout << "The complex contains " << st.num_simplices() << " simplices --------------------------" << std::endl;
+ std::cout << " - dimension " << st.dimension() << " - filtration " << st.filtration() << std::endl;
+ st.print_tree();
+
+ std::cout << "The pruned complex contains " << st_pruned.num_simplices() << " simplices --------------------------" << std::endl;
+ std::cout << " - dimension " << st_pruned.dimension() << " - filtration " << st_pruned.filtration() << std::endl;
+ st_pruned.print_tree();
+
+ typeST st_empty;
+ // FIXME
+ st_empty.set_dimension(3);
+ st.prune_above_filtration(0.0);
+ */
+ /*BOOST_CHECK(st == st_empty);
+
+ // Test case to the limit
+ st.prune_above_filtration(-1.0);
+ st_empty.set_filtration(-1.0);
+ BOOST_CHECK(st == st_empty);
+*/
+}
+
+/*BOOST_AUTO_TEST_CASE(sanitizer) {
+ int a[2] = {1, 0};
+ int b=a[2];
+}*/
diff --git a/src/common/example/dtoffrw_alphashapedoc_result.off b/src/common/example/dtoffrw_alphashapedoc_result.off
new file mode 100644
index 00000000..03b7ca75
--- /dev/null
+++ b/src/common/example/dtoffrw_alphashapedoc_result.off
@@ -0,0 +1,15 @@
+nOFF
+2 7 6 0
+1 1
+7 0
+4 6
+9 6
+0 14
+2 19
+9 17
+3 0 1 2
+3 3 2 1
+3 4 0 2
+3 4 2 6
+3 6 2 3
+3 5 4 6
diff --git a/src/common/example/dtoffrw_alphashapedoc_result.txt b/src/common/example/dtoffrw_alphashapedoc_result.txt
index 57761d14..8e659740 100644
--- a/src/common/example/dtoffrw_alphashapedoc_result.txt
+++ b/src/common/example/dtoffrw_alphashapedoc_result.txt
@@ -1,3 +1,2 @@
Number of vertices= 7
Number of finite full cells= 6
-
diff --git a/src/common/include/gudhi/Delaunay_triangulation_off_io.h b/src/common/include/gudhi/Delaunay_triangulation_off_io.h
index 6335d243..b3f4a299 100644
--- a/src/common/include/gudhi/Delaunay_triangulation_off_io.h
+++ b/src/common/include/gudhi/Delaunay_triangulation_off_io.h
@@ -135,7 +135,7 @@ class Delaunay_triangulation_off_visitor_reader {
*
* When launching:
*
- * \code $> ./dtoffrw ../../data/points/alphashapedoc.off triangulated.off
+ * \code $> ./dtoffrw ../../data/points/alphacomplexdoc triangulated.off
* \endcode
*
* the program output is:
diff --git a/src/common/test/dtoffrw_unit_test.cpp b/src/common/test/dtoffrw_unit_test.cpp
index 20094229..f682df1a 100644
--- a/src/common/test/dtoffrw_unit_test.cpp
+++ b/src/common/test/dtoffrw_unit_test.cpp
@@ -64,7 +64,7 @@ BOOST_AUTO_TEST_CASE( Delaunay_triangulation_doc_test )
BOOST_AUTO_TEST_CASE( Delaunay_triangulation_unexisting_file_read_test )
{
- Gudhi::Delaunay_triangulation_off_reader<T> off_reader("pouetpouet_tralala.off");
+ Gudhi::Delaunay_triangulation_off_reader<T> off_reader("some_impossible_weird_file_name.off");
// Check the read operation was correct
BOOST_CHECK(!off_reader.is_valid());
T* triangulation = off_reader.get_complex();
@@ -80,7 +80,7 @@ BOOST_AUTO_TEST_CASE( Delaunay_triangulation_unexisting_file_write_test )
T* triangulation = off_reader.get_complex();
// Write the OFF file (output file name given as parameter) with the points and triangulated cells as faces
- Gudhi::Delaunay_triangulation_off_writer<T> off_writer("/pouetpouet_tralala/pouetpouet_tralala/pouetpouet_tralala.off", triangulation);
+ Gudhi::Delaunay_triangulation_off_writer<T> off_writer("/some_impossible_weird_directory_name/another_weird_directory_name/some_impossible_weird_file_name.off", triangulation);
// Check the write operation was correct
BOOST_CHECK(!off_writer.is_valid());