From 11b195d4e26d48cdc56883957cbad16e298e43ca Mon Sep 17 00:00:00 2001 From: vrouvrea Date: Tue, 12 Jan 2016 16:07:10 +0000 Subject: Fix alpha complex remarks and bugs git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/alphashapes@957 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: fa837fd1a4373c2322db16353d98767907f34c79 --- CMakeLists.txt | 4 +- biblio/how_to_cite_cgal.bib | 947 +++++++++++++++++++++ src/Alpha_complex/test/CMakeLists.txt | 2 - src/GudhUI/alpha_complex_persistence.cpp | 78 -- src/GudhUI/utils/Bar_code_persistence.h | 3 +- src/GudhUI/utils/Persistence_compute.h | 15 +- src/Persistent_cohomology/example/CMakeLists.txt | 100 ++- .../example/alpha_complex_persistence.cpp | 92 +- .../example/rips_persistence.cpp | 3 +- src/Simplex_tree/include/gudhi/Simplex_tree.h | 81 +- src/Simplex_tree/test/simplex_tree_unit_test.cpp | 56 +- src/common/include/gudhi/distance_functions.h | 4 +- src/common/include/gudhi/reader_utils.h | 4 +- 13 files changed, 1140 insertions(+), 249 deletions(-) create mode 100644 biblio/how_to_cite_cgal.bib delete mode 100644 src/GudhUI/alpha_complex_persistence.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index d0770dd7..54e86f72 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,7 @@ endif() enable_testing() -set(CMAKE_PREFIX_PATH "${CMAKE_SOURCE_DIR}/src/cmake/modules/") +set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/src/cmake/modules/") message("CMAKE_MODULE_PATH = ${CMAKE_MODULE_PATH}") # Generate GUDHI official version file @@ -22,7 +22,7 @@ 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 -fsanitize=memory -fno-omit-frame-pointer -Wall -Wpedantic -Wsign-compare") + 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 -O1") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}") endif() diff --git a/biblio/how_to_cite_cgal.bib b/biblio/how_to_cite_cgal.bib new file mode 100644 index 00000000..7336ee81 --- /dev/null +++ b/biblio/how_to_cite_cgal.bib @@ -0,0 +1,947 @@ +@book{ cgal:eb-15b +, title = "{CGAL} User and Reference Manual" +, author = "{The CGAL Project}" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, year = 2015 +, url = "http://doc.cgal.org/4.7/Manual/packages.html" +} +@incollection{cgal:h-af-15b +, author = "Michael Hemmer" +, title = "Algebraic Foundations" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgAlgebraicFoundationsSummary" +, year = 2015 +} + +@incollection{cgal:hhkps-nt-15b +, author = "Michael Hemmer and Susan Hert and Sylvain Pion and Stefan Schirra" +, title = "Number Types" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgNumberTypesSummary" +, year = 2015 +} + +@incollection{cgal:h-ma-15b +, author = "Michael Hemmer and Sylvain Pion" +, title = "Modular Arithmetic" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgModularArithmeticSummary" +, year = 2015 +} + +@incollection{cgal:h-p-15b +, author = "Michael Hemmer" +, title = "Polynomial" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgPolynomialSummary" +, year = 2015 +} + +@incollection{cgal:bht-ak-15b +, author = "Eric Berberich and Michael Hemmer and Michael Kerber and Sylvain Lazard and Luis Pe{\~n}aranda and Monique Teillaud" +, title = "Algebraic Kernel" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgAlgebraicKerneldSummary" +, year = 2015 +} + +@incollection{cgal:h-msms-15b +, author = "Michael Hoffmann" +, title = "Monotone and Sorted Matrix Search" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgMatrixSearchSummary" +, year = 2015 +} + +@incollection{cgal:fgsw-lqps-15b +, author = "Kaspar Fischer and Bernd G{\"a}rtner and Sven Sch{\"o}nherr and Frans Wessendorp" +, title = "Linear and Quadratic Programming Solver" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgQPSolverSummary" +, year = 2015 +} + +@incollection{cgal:bfghhkps-lgk23-15b +, author = "Herv{\'e} Br{\"o}nnimann and Andreas Fabri and Geert-Jan Giezeman and Susan Hert and Michael Hoffmann and Lutz Kettner and Sylvain Pion and Stefan Schirra" +, title = "{2D} and {3D} Linear Geometry Kernel" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgKernel23Summary" +, year = 2015 +} + +@incollection{cgal:s-gkd-15b +, author = "Michael Seel" +, title = "{dD} Geometry Kernel" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgKernelDSummary" +, year = 2015 +} + +@incollection{cgal:cpt-cgk2-15b +, author = "Pedro Machado Manh{\~a}es de Castro and Sylvain Pion and Monique Teillaud" +, title = "{2D} Circular Geometry Kernel" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgCircularKernel2Summary" +, year = 2015 +} + +@incollection{cgal:cclt-sgk3-15b +, author = "Pedro Machado Manh{\~a}es de Castro and Fr{\'e}d{\'e}ric Cazals and S{\'e}bastien Loriot and Monique Teillaud" +, title = "{3D} Spherical Geometry Kernel" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgSphericalKernel3Summary" +, year = 2015 +} + +@incollection{cgal:hs-chep2-15b +, author = "Susan Hert and Stefan Schirra" +, title = "{2D} Convex Hulls and Extreme Points" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgConvexHull2Summary" +, year = 2015 +} + +@incollection{cgal:hs-ch3-15b +, author = "Susan Hert and Stefan Schirra" +, title = "{3D} Convex Hulls" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgConvexHull3Summary" +, year = 2015 +} + +@incollection{cgal:hs-chdt3-15b +, author = "Susan Hert and Michael Seel" +, title = "{dD} Convex Hulls and Delaunay Triangulations" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgConvexHullDSummary" +, year = 2015 +} + +@incollection{cgal:gw-p2-15b +, author = "Geert-Jan Giezeman and Wieger Wesselink" +, title = "{2D} Polygons" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgPolygon2Summary" +, year = 2015 +} + +@incollection{cgal:fwzh-rbso2-15b +, author = "Efi Fogel and Ophir Setter and Ron Wein and Guy Zucker and Baruch Zukerman and Dan Halperin" +, title = "{2D} Regularized Boolean Set-Operations" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgBooleanSetOperations2Summary" +, year = 2015 +} + +@incollection{cgal:s-bonp2-15b +, author = "Michael Seel" +, title = "{2D} Boolean Operations on Nef Polygons" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgNef2Summary" +, year = 2015 +} + +@incollection{cgal:hk-bonpes2-15b +, author = "Peter Hachenberger and Lutz Kettner" +, title = "{2D} Boolean Operations on Nef Polygons Embedded on the Sphere" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgNefS2Summary" +, year = 2015 +} + +@incollection{cgal:h-pp2-15b +, author = "Susan Hert" +, title = "{2D} Polygon Partitioning" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgPolygonPartitioning2Summary" +, year = 2015 +} + +@incollection{cgal:c-sspo2-15b +, author = "Fernando Cacciola" +, title = "{2D} Straight Skeleton and Polygon Offsetting" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgStraightSkeleton2Summary" +, year = 2015 +} + +@incollection{cgal:w-rms2-15b +, author = "Ron Wein and Alon Baram and Eyal Flato and Efi Fogel and Michael Hemmer and Sebastian Morr" +, title = "{2D} Minkowski Sums" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgMinkowskiSum2Summary" +, year = 2015 +} + +@incollection{cgal:f-ps2-15b +, author = "Andreas Fabri" +, title = "{2D} Polyline Simplification" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgPolylineSimplification2Summary" +, year = 2015 +} + +@incollection{hhb-visibility-2-15b +, author = "Michael Hemmer and Kan Huang and Francisc Bungiu and Ning Xu" +, title = "{2D} Visibility Computation" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgVisibility_2Summary" +, year = 2015 +} + +@incollection{cgal:k-ps-15b +, author = "Lutz Kettner" +, title = "{3D} Polyhedral Surface" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgPolyhedronSummary" +, year = 2015 +} + +@incollection{cgal:k-hds-15b +, author = "Lutz Kettner" +, title = "Halfedge Data Structures" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgHDSSummary" +, year = 2015 +} + +@incollection{cgal:bsmf-sm-15b +, author = "Mario Botsch and Daniel Sieger and Philipp Moeller and Andreas Fabri" +, title = "Surface Mesh" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgSurfaceMeshSummary" +, year = 2015 +} + +@incollection{cgal:d-cm-15b +, author = "Guillaume Damiand" +, title = "Combinatorial Maps" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgCombinatorialMapsSummary" +, year = 2015 +} + +@incollection{cgal:d-lcc-12-15b +, author = "Guillaume Damiand" +, title = "Linear Cell Complex" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgLinearCellComplexSummary" +, year = 2015 +} + +@incollection{cgal:hk-bonp3-15b +, author = "Peter Hachenberger and Lutz Kettner" +, title = "{3D} Boolean Operations on Nef Polyhedra" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgNef3Summary" +, year = 2015 +} + +@incollection{cgal:h-emspe-15b +, author = "Peter Hachenberger" +, title = "Convex Decomposition of Polyhedra" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgConvexDecomposition3Summary" +, year = 2015 +} + +@incollection{cgal:h-msp3-15b +, author = "Peter Hachenberger" +, title = "{3D} Minkowski Sum of Polyhedra" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgMinkowskiSum3Summary" +, year = 2015 +} + +@incollection{cgal:wfzh-a2-15b +, author = "Ron Wein and Eric Berberich and Efi Fogel and Dan Halperin and Michael Hemmer and Oren Salzman and Baruch Zukerman" +, title = "{2D} Arrangements" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgArrangement2Summary" +, year = 2015 +} + +@incollection{cgal:wfz-ic2-15b +, author = "Baruch Zukerman and Ron Wein and Efi Fogel" +, title = "{2D} Intersection of Curves" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgIntersectionOfCurves2Summary" +, year = 2015 +} + +@incollection{cgal:p-sr2-15b +, author = "Eli Packer" +, title = "{2D} Snap Rounding" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgSnapRounding2Summary" +, year = 2015 +} + +@incollection{cgal:w-e2-15b +, author = "Ron Wein" +, title = "{2D} Envelopes" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgEnvelope2Summary" +, year = 2015 +} + +@incollection{cgal:mwz-e3-15b +, author = "Dan Halperin and Michal Meyerovitch and Ron Wein and Baruch Zukerman" +, title = "{3D} Envelopes" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgEnvelope3Summary" +, year = 2015 +} + +@incollection{cgal:y-t2-15b +, author = "Mariette Yvinec" +, title = "{2D} Triangulation" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgTriangulation2Summary" +, year = 2015 +} + +@incollection{cgal:py-tds2-15b +, author = "Sylvain Pion and Mariette Yvinec" +, title = "{2D} Triangulation Data Structure" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgTDS2Summary" +, year = 2015 +} + +@incollection{cgal:k-pt2-13-15b +, author = "Nico Kruithof" +, title = "{2D} Periodic Triangulations" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgPeriodic2Triangulation2Summary" +, year = 2015 +} + +@incollection{cgal:pt-t3-15b +, author = "Cl{\'e}ment Jamin and Sylvain Pion and Monique Teillaud" +, title = "{3D} Triangulations" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgTriangulation3Summary" +, year = 2015 +} + +@incollection{cgal:pt-tds3-15b +, author = "Cl{\'e}ment Jamin and Sylvain Pion and Monique Teillaud" +, title = "{3D} Triangulation Data Structure" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgTDS3Summary" +, year = 2015 +} + +@incollection{cgal:ct-pt3-15b +, author = "Manuel Caroli and Monique Teillaud" +, title = "{3D} Periodic Triangulations" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgPeriodic3Triangulation3Summary" +, year = 2015 +} + +@incollection{cgal:hdj-t-15b +, author = "Samuel Hornus and Olivier Devillers and Cl{\'e}ment Jamin" +, title = "{dD} Triangulations" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgTriangulationsSummary" +, year = 2015 +} + +@incollection{cgal:d-as2-15b +, author = "Tran Kai Frank Da" +, title = "{2D} Alpha Shapes" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgAlphaShape2Summary" +, year = 2015 +} + +@incollection{cgal:dy-as3-15b +, author = "Tran Kai Frank Da and S{\'e}bastien Loriot and Mariette Yvinec" +, title = "{3D} Alpha Shapes" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgAlphaShapes3Summary" +, year = 2015 +} + +@incollection{cgal:k-sdg2-15b +, author = "Menelaos Karavelas" +, title = "{2D} Segment Delaunay Graphs" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgSegmentDelaunayGraph2Summary" +, year = 2015 +} + +@incollection{cgal:cdp-sdglinf2-15b +, author = "Panagiotis Cheilaris and Sandeep Kumar Dey and Evanthia Papadopoulou" +, title = "L Infinity Segment Delaunay Graphs" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgSDGLinfSummary" +, year = 2015 +} + +@incollection{cgal:ky-ag2-15b +, author = "Menelaos Karavelas and Mariette Yvinec" +, title = "{2D} Apollonius Graphs (Delaunay Graphs of Disks)" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgApolloniusGraph2Summary" +, year = 2015 +} + +@incollection{cgal:k-vda2-15b +, author = "Menelaos Karavelas" +, title = "{2D} Voronoi Diagram Adaptor" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgVoronoiDiagramAdaptor2Summary" +, year = 2015 +} + +@incollection{cgal:r-ctm2-15b +, author = "Laurent Rineau" +, title = "{2D} Conforming Triangulations and Meshes" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgMesh2Summary" +, year = 2015 +} + +@incollection{cgal:ry-smg-15b +, author = "Laurent Rineau and Mariette Yvinec" +, title = "{3D} Surface Mesh Generation" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgSurfaceMesher3Summary" +, year = 2015 +} + +@incollection{cgal:asg-srps-15b +, author = "Pierre Alliez and Laurent Saboret and Ga{\"e}l Guennebaud" +, title = "Surface Reconstruction from Point Sets" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgSurfaceReconstructionFromPointSetsSummary" +, year = 2015 +} + +@incollection{cgal:ssr3-15b +, author = "Thijs van Lankveld" +, title = "Scale-Space Surface Reconstruction" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgScaleSpaceReconstruction3Summary" +, year = 2015 +} + +@incollection{cgal:dc-afsr-15b +, author = "Tran Kai Frank Da and David Cohen-Steiner" +, title = "Advancing Front Surface Reconstruction" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgAdvancingFrontSurfaceReconstructionSummary" +, year = 2015 +} + +@incollection{cgal:k-ssm3-15b +, author = "Nico Kruithof" +, title = "{3D} Skin Surface Meshing" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgSkinSurface3Summary" +, year = 2015 +} + +@incollection{cgal:rty-m3-15b +, author = "Pierre Alliez and Cl{\'e}ment Jamin and Laurent Rineau and St{\'e}phane Tayeb and Jane Tournois and Mariette Yvinec" +, title = "{3D} Mesh Generation" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgMesh_3Summary" +, year = 2015 +} + +@incollection{cgal:lty-pmp-15b +, author = "S{\'e}bastien Loriot and Jane Tournois and Ilker O. Yaz" +, title = "Polygon Mesh Processing" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgPolygonMeshProcessingSummary" +, year = 2015 +} + +@incollection{cgal:s-ssm2-15b +, author = "Le-Jeng Andy Shiue" +, title = "{3D} Surface Subdivision Methods" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgSurfaceSubdivisionMethods3Summary" +, year = 2015 +} + +@incollection{cgal:y-smsimpl-15b +, author = "Ilker O. Yaz and S{\'e}bastien Loriot" +, title = "Triangulated Surface Mesh Segmentation" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgSurfaceSegmentationSummary" +, year = 2015 +} + +@incollection{cgal:c-tsms-12-15b +, author = "Fernando Cacciola" +, title = "Triangulated Surface Mesh Simplification" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgSurfaceMeshSimplificationSummary" +, year = 2015 +} + +@incollection{cgal:lsxy-tsmd-15b +, author = "S{\'e}bastien Loriot and Olga Sorkine-Hornung and Yin Xu and Ilker O. Yaz" +, title = "Triangulated Surface Mesh Deformation" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgSurfaceModelingSummary" +, year = 2015 +} + +@incollection{cgal:sal-pptsm2-15b +, author = "Laurent Saboret and Pierre Alliez and Bruno L{\'e}vy" +, title = "Planar Parameterization of Triangulated Surface Meshes" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgSurfaceParameterizationSummary" +, year = 2015 +} + +@incollection{cgal:klcdv-tsmsp-15b +, author = "Stephen Kiazyk and S{\'e}bastien Loriot and {\'E}ric Colin de Verdi{\`e}re" +, title = "Triangulated Surface Mesh Shortest Paths" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgSurfaceMeshShortestPathSummary" +, year = 2015 +} + +@incollection{cgal:glt-tsms-15b +, author = "Xiang Gao and S{\'e}bastien Loriot and Andrea Tagliasacchi" +, title = "Triangulated Surface Mesh Skeletonization" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgMeanCurvatureSkeleton3Summary" +, year = 2015 +} + +@incollection{cgal:cp-arutsm-15b +, author = "Marc Pouget and Fr{\'e}d{\'e}ric Cazals" +, title = "Approximation of Ridges and Umbilics on Triangulated Surface Meshes" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgRidges_3Summary" +, year = 2015 +} + +@incollection{cgal:pc-eldp-15b +, author = "Marc Pouget and Fr{\'e}d{\'e}ric Cazals" +, title = "Estimation of Local Differential Properties of Point-Sampled Surfaces" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgJet_fitting_3Summary" +, year = 2015 +} + +@incollection{cgal:ass-psp-15b +, author = "Pierre Alliez and Cl{\'e}ment Jamin and Quentin M{\'e}rigot and Jocelyn Meyron and Laurent Saboret and Nader Salman and Shihao Wu" +, title = "Point Set Processing" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgPointSetProcessingSummary" +, year = 2015 +} + +@incollection{cgal:ovja-pssd-15b +, author = "Sven Oesau and Yannick Verdie and Cl{\'e}ment Jamin and Pierre Alliez" +, title = "Point Set Shape Detection" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgPointSetShapeDetection3Summary" +, year = 2015 +} + +@incollection{cgal:m-ps-15b +, author = "Abdelkrim Mebarki" +, title = "{2D} Placement of Streamlines" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgPlacementOfStreamlines2Summary" +, year = 2015 +} + +@incollection{cgal:b-ss2-15b +, author = "Matthias B{\"a}sken" +, title = "{2D} Range and Neighbor Search" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgPointSet2Summary" +, year = 2015 +} + +@incollection{cgal:f-isl-15b +, author = "Andreas Fabri" +, title = "Interval Skip List" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgIntervalSkipListSummary" +, year = 2015 +} + +@incollection{cgal:tf-ssd-15b +, author = "Hans Tangelder and Andreas Fabri" +, title = "{dD} Spatial Searching" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgSpatialSearchingDSummary" +, year = 2015 +} + +@incollection{cgal:n-rstd-15b +, author = "Gabriele Neyer" +, title = "{dD} Range and Segment Trees" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgRangeSegmentTreesDSummary" +, year = 2015 +} + +@incollection{cgal:kmz-isiobd-15b +, author = "Lutz Kettner and Andreas Meyer and Afra Zomorodian" +, title = "Intersecting Sequences of {dD} Iso-oriented Boxes" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgBoxIntersectionDSummary" +, year = 2015 +} + +@incollection{cgal:atw-aabb-15b +, author = "Pierre Alliez and St{\'e}phane Tayeb and Camille Wormser" +, title = "{3D} Fast Intersection and Distance Computation" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgAABB_treeSummary" +, year = 2015 +} + +@incollection{cgal:dd-ss-15b +, author = "Christophe Delage and Olivier Devillers" +, title = "Spatial Sorting" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgSpatialSortingSummary" +, year = 2015 +} + +@incollection{cgal:fghhs-bv-15b +, author = "Kaspar Fischer and Bernd G{\"a}rtner and Thomas Herrmann and Michael Hoffmann and Sven Sch{\"o}nherr" +, title = "Bounding Volumes" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgBoundingVolumesSummary" +, year = 2015 +} + +@incollection{cgal:hp-ia-15b +, author = "Michael Hoffmann and Eli Packer" +, title = "Inscribed Areas" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgInscribedAreasSummary" +, year = 2015 +} + +@incollection{cgal:fghhs-od-15b +, author = "Kaspar Fischer and Bernd G{\"a}rtner and Thomas Herrmann and Michael Hoffmann and Sven Sch{\"o}nherr" +, title = "Optimal Distances" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgOptimalDistancesSummary" +, year = 2015 +} + +@incollection{cgal:ap-pcad-15b +, author = "Pierre Alliez and Sylvain Pion and Ankit Gupta" +, title = "Principal Component Analysis" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgPrincipalComponentAnalysisDSummary" +, year = 2015 +} + +@incollection{cgal:f-i-15b +, author = "Julia Fl{\"o}totto" +, title = "{2D} and Surface Function Interpolation" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgInterpolation2Summary" +, year = 2015 +} + +@incollection{cgal:abha-gbc-15b +, author = "Dmitry Anisimov and David Bommes and Kai Hormann and Pierre Alliez" +, title = "{2D} Generalized Barycentric Coordinates" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgBarycentric_coordinates_2Summary" +, year = 2015 +} + +@incollection{cgal:r-kds-15b +, author = "Daniel Russel" +, title = "Kinetic Data Structures" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgKdsSummary" +, year = 2015 +} + +@incollection{cgal:r-kdsf-15b +, author = "Daniel Russel" +, title = "Kinetic Framework" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgKdsFrameworkSummary" +, year = 2015 +} + +@incollection{cgal:hkpw-se-15b +, author = "Michael Hoffmann and Lutz Kettner and Sylvain Pion and Ron Wein" +, title = "STL Extensions for {CGAL}" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgStlExtensionSummary" +, year = 2015 +} + +@incollection{cgal:cfw-cbgl-15b +, author = "Andreas Fabri and Fernando Cacciola and Philipp Moeller and Ron Wein" +, title = "{CGAL} and the {Boost} Graph Library" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgBGLSummary" +, year = 2015 +} + +@incollection{cgal:fs-cbpm-15b +, author = "Andreas Fabri and Laurent Saboret" +, title = "{CGAL} and {Boost} Property Maps" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgProperty_mapSummary" +, year = 2015 +} + +@incollection{cgal:dksy-hc-15b +, author = "Olivier Devillers and Lutz Kettner and Sylvain Pion and Michael Seel and Mariette Yvinec" +, title = "Handles and Circulators" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgHandlesAndCirculatorsSummary" +, year = 2015 +} + +@incollection{cgal:dhhk-gog-15b +, author = "Pedro M. M. de Castro and Olivier Devillers and Susan Hert and Michael Hoffmann and Lutz Kettner and Sven Sch{\"o}nherr and Alexandru Tifrea" +, title = "Geometric Object Generators" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgGeneratorsSummary" +, year = 2015 +} + +@incollection{cgal:kps-pthum-15b +, author = "Lutz Kettner and Sylvain Pion and Michael Seel" +, title = "Profiling tools, Hash Map, Union-find, Modifiers" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgProfilingToolsSummary" +, year = 2015 +} + +@incollection{cgal:fgk-ios-12-15b +, author = "Andreas Fabri and Geert-Jan Giezeman and Lutz Kettner" +, title = "IO Streams" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgIOstreamsSummary" +, year = 2015 +} + +@incollection{cgal:fp-gv-15b +, author = "Andreas Fabri and Sylvain Pion" +, title = "Geomview" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgGeomviewSummary" +, year = 2015 +} + +@incollection{cgal:fr-cqgvf-15b +, author = "Andreas Fabri and Laurent Rineau" +, title = "{CGAL} and the {Qt} Graphics View Framework" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgGraphicsViewSummary" +, year = 2015 +} + +@incollection{cgal:lp-gi-15b +, author = "Olivier Devillers and S{\'e}bastien Loriot and Sylvain Pion" +, title = "{CGAL} Ipelets" +, publisher = "{CGAL Editorial Board}" +, edition = "{4.7}" +, booktitle = "{CGAL} User and Reference Manual" +, url = "http://doc.cgal.org/4.7/Manual/packages.html#PkgCGALIpeletsSummary" +, year = 2015 +} diff --git a/src/Alpha_complex/test/CMakeLists.txt b/src/Alpha_complex/test/CMakeLists.txt index d7c13da0..fa24e1b1 100644 --- a/src/Alpha_complex/test/CMakeLists.txt +++ b/src/Alpha_complex/test/CMakeLists.txt @@ -18,8 +18,6 @@ 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/GudhUI/alpha_complex_persistence.cpp b/src/GudhUI/alpha_complex_persistence.cpp deleted file mode 100644 index 4f85459a..00000000 --- a/src/GudhUI/alpha_complex_persistence.cpp +++ /dev/null @@ -1,78 +0,0 @@ -#include -#include - - -#include - -// to construct a Delaunay_triangulation from a OFF file -#include -#include -#include - -#include "utils/Bar_code_persistence.h" - -void usage(char * const progName) { - std::cerr << "Usage: " << progName << " filename.off " << // alpha_square_max_value[double] " << - "coeff_field_characteristic[integer > 0] min_persistence[double >= -1.0]" << std::endl; - std::cerr << " i.e.: " << progName << " ../../data/points/alphacomplexdoc.off 60.0 2 0.02" << std::endl; - exit(-1); // ----- >> -} - -int main(int argc, char **argv) { - if (argc != 4) { - std::cerr << "Error: Number of arguments (" << argc << ") is not correct" << std::endl; - usage(argv[0]); - } - - QApplication qtapp(argc, argv); - - std::string off_file_name(argv[1]); - // double alpha_square_max_value = atof(argv[2]); - double alpha_square_max_value = 1e20; - int coeff_field_characteristic = atoi(argv[2]); // argv[3] - double min_persistence = atof(argv[3]); // argv[4] - - // ---------------------------------------------------------------------------- - // Init of an alpha complex from an OFF file - // ---------------------------------------------------------------------------- - typedef CGAL::Epick_d< CGAL::Dynamic_dimension_tag > Kernel; - Gudhi::alphacomplex::Alpha_complex alpha_complex_from_file(off_file_name, alpha_square_max_value); - - // ---------------------------------------------------------------------------- - // Display information about the alpha complex - // ---------------------------------------------------------------------------- - std::cout << "Alpha complex is of dimension " << alpha_complex_from_file.dimension() << - " - " << alpha_complex_from_file.num_simplices() << " simplices - " << - alpha_complex_from_file.num_vertices() << " vertices." << std::endl; - - // Sort the simplices in the order of the filtration - alpha_complex_from_file.initialize_filtration(); - - std::cout << "Simplex_tree dim: " << alpha_complex_from_file.dimension() << std::endl; - // Compute the persistence diagram of the complex - Gudhi::persistent_cohomology::Persistent_cohomology< Gudhi::alphacomplex::Alpha_complex, - Gudhi::persistent_cohomology::Field_Zp > pcoh(alpha_complex_from_file); - - std::cout << "coeff_field_characteristic " << coeff_field_characteristic << - " - min_persistence " << min_persistence << std::endl; - - // initializes the coefficient field for homology - pcoh.init_coefficients(coeff_field_characteristic); - - pcoh.compute_persistent_cohomology(min_persistence); - - pcoh.output_diagram(); - - std::vector> persistence_vector; - pcoh.get_persistence(persistence_vector); - - Bar_code_persistence bc_persistence; - - for (auto persistence : persistence_vector) { - bc_persistence.insert(persistence.first, persistence.second); - } - - bc_persistence.show(); - - return qtapp.exec(); -} diff --git a/src/GudhUI/utils/Bar_code_persistence.h b/src/GudhUI/utils/Bar_code_persistence.h index a1a46ea8..a4cd8156 100644 --- a/src/GudhUI/utils/Bar_code_persistence.h +++ b/src/GudhUI/utils/Bar_code_persistence.h @@ -39,7 +39,7 @@ class Bar_code_persistence { max_death = death; } - void show() { + void show(const std::string& window_title) { // Create a view, put a scene in it QGraphicsView * view = new QGraphicsView(); QGraphicsScene * scene = new QGraphicsScene(); @@ -78,6 +78,7 @@ class Bar_code_persistence { QGraphicsTextItem* dimText = scene->addText(scale_value, QFont("Helvetica", 8)); dimText->setPos(scale - (3.0 * scale_value.size()), height + 9.0 * (modulo % 2)); } + view->setWindowTitle(window_title.c_str()); // Show the view view->show(); } diff --git a/src/GudhUI/utils/Persistence_compute.h b/src/GudhUI/utils/Persistence_compute.h index 0b9961d3..1f04cc6b 100644 --- a/src/GudhUI/utils/Persistence_compute.h +++ b/src/GudhUI/utils/Persistence_compute.h @@ -46,10 +46,6 @@ struct Persistence_params { * Show persistence into output stream */ template class Persistence_compute { - private: - SkBlComplex& complex_; - std::ostream& stream_; - public: typedef typename SkBlComplex::Vertex_handle Vertex_handle; typedef typename SkBlComplex::Edge_handle Edge_handle; @@ -61,9 +57,7 @@ template class Persistence_compute { * double threshold * int p for coefficient Z_p */ - Persistence_compute(SkBlComplex& complex, std::ostream& stream, const Persistence_params& params) : - // double threshold = 0.5,unsigned dim_max = 8): - complex_(complex), stream_(stream) { + Persistence_compute(SkBlComplex& complex, std::ostream& stream, const Persistence_params& params) { // for now everything is copied, todo boost adapt iterators to points of SkBlComplex instead of copying to an // initial vector typedef std::vector Point_t; @@ -87,10 +81,11 @@ template class Persistence_compute { pcoh.init_coefficients(params.p); // put params.min_pers pcoh.compute_persistent_cohomology(params.min_pers); - stream_ << "persistence: \n"; - stream_ << "p dimension birth death: \n"; + stream << "persistence: \n"; + stream << "p dimension birth death: \n"; - pcoh.output_diagram(stream_); + pcoh.output_diagram(stream); + } }; diff --git a/src/Persistent_cohomology/example/CMakeLists.txt b/src/Persistent_cohomology/example/CMakeLists.txt index eb4ee3e3..9e96adc0 100644 --- a/src/Persistent_cohomology/example/CMakeLists.txt +++ b/src/Persistent_cohomology/example/CMakeLists.txt @@ -22,63 +22,61 @@ add_executable(persistence_from_file persistence_from_file.cpp) target_link_libraries(persistence_from_file ${Boost_SYSTEM_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY}) add_test(persistence_from_file_3_2_0 ${CMAKE_CURRENT_BINARY_DIR}/persistence_from_file ${CMAKE_SOURCE_DIR}/data/points/bunny_5000.st -p 2 -m 0) add_test(persistence_from_file_3_3_100 ${CMAKE_CURRENT_BINARY_DIR}/persistence_from_file ${CMAKE_SOURCE_DIR}/data/points/bunny_5000.st -p 3 -m 100) - -if(GMPXX_FOUND AND GMP_FOUND) - message("GMPXX_LIBRARIES = ${GMPXX_LIBRARIES}") - message("GMP_LIBRARIES = ${GMP_LIBRARIES}") - - add_executable(rips_multifield_persistence rips_multifield_persistence.cpp ) - target_link_libraries(rips_multifield_persistence ${Boost_SYSTEM_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY} ${GMPXX_LIBRARIES} ${GMP_LIBRARIES}) - add_test(rips_multifield_persistence_2_71 ${CMAKE_CURRENT_BINARY_DIR}/rips_multifield_persistence ${CMAKE_SOURCE_DIR}/data/points/Kl.txt -r 0.25 -d 3 -p 2 -q 71 -m 100) - - add_executable ( performance_rips_persistence performance_rips_persistence.cpp ) - target_link_libraries(performance_rips_persistence ${Boost_SYSTEM_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY} ${GMPXX_LIBRARIES} ${GMP_LIBRARIES}) - - if(CGAL_FOUND) - add_executable(alpha_shapes_persistence alpha_shapes_persistence.cpp) - target_link_libraries(alpha_shapes_persistence ${Boost_SYSTEM_LIBRARY} ${GMPXX_LIBRARIES} ${GMP_LIBRARIES} ${CGAL_LIBRARY}) - add_test(alpha_shapes_persistence_2_0_5 ${CMAKE_CURRENT_BINARY_DIR}/alpha_shapes_persistence ${CMAKE_SOURCE_DIR}/data/points/bunny_5000 2 0.5) - #add_test(alpha_shapes_persistence_3_3_100 ${CMAKE_CURRENT_BINARY_DIR}/alpha_shapes_persistence ${CMAKE_SOURCE_DIR}/data/points/bunny_5000.st -p 3 -m 100) - - - - if (NOT CGAL_VERSION VERSION_LESS 4.7.0) - message(STATUS "CGAL version: ${CGAL_VERSION}.") - - include( ${CGAL_USE_FILE} ) - # In CMakeLists.txt, when include(${CGAL_USE_FILE}), CXX_FLAGS are overwritten. - # cf. http://doc.cgal.org/latest/Manual/installation.html#title40 - # A workaround is to add "-std=c++11" again. - # A fix would be to use https://cmake.org/cmake/help/v3.1/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.html - # or even better https://cmake.org/cmake/help/v3.1/variable/CMAKE_CXX_STANDARD.html - # but it implies to use cmake version 3.1 at least. - if(NOT MSVC) - include(CheckCXXCompilerFlag) - CHECK_CXX_COMPILER_FLAG(-std=c++11 COMPILER_SUPPORTS_CXX11) - if(COMPILER_SUPPORTS_CXX11) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") +if(GMPXX_FOUND AND GMP_FOUND) + message("GMPXX_LIBRARIES = ${GMPXX_LIBRARIES}") + message("GMP_LIBRARIES = ${GMP_LIBRARIES}") + + add_executable(rips_multifield_persistence rips_multifield_persistence.cpp ) + target_link_libraries(rips_multifield_persistence ${Boost_SYSTEM_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY} ${GMPXX_LIBRARIES} ${GMP_LIBRARIES}) + add_test(rips_multifield_persistence_2_71 ${CMAKE_CURRENT_BINARY_DIR}/rips_multifield_persistence ${CMAKE_SOURCE_DIR}/data/points/Kl.txt -r 0.25 -d 3 -p 2 -q 71 -m 100) + + add_executable ( performance_rips_persistence performance_rips_persistence.cpp ) + target_link_libraries(performance_rips_persistence ${Boost_SYSTEM_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY} ${GMPXX_LIBRARIES} ${GMP_LIBRARIES}) + + if(CGAL_FOUND) + add_executable(alpha_shapes_persistence alpha_shapes_persistence.cpp) + target_link_libraries(alpha_shapes_persistence ${Boost_SYSTEM_LIBRARY} ${GMPXX_LIBRARIES} ${GMP_LIBRARIES} ${CGAL_LIBRARY}) + add_test(alpha_shapes_persistence_2_0_5 ${CMAKE_CURRENT_BINARY_DIR}/alpha_shapes_persistence ${CMAKE_SOURCE_DIR}/data/points/bunny_5000 2 0.5) + #add_test(alpha_shapes_persistence_3_3_100 ${CMAKE_CURRENT_BINARY_DIR}/alpha_shapes_persistence ${CMAKE_SOURCE_DIR}/data/points/bunny_5000.st -p 3 -m 100) + + if (NOT CGAL_VERSION VERSION_LESS 4.7.0) + message(STATUS "CGAL version: ${CGAL_VERSION}.") + + include( ${CGAL_USE_FILE} ) + # In CMakeLists.txt, when include(${CGAL_USE_FILE}), CXX_FLAGS are overwritten. + # cf. http://doc.cgal.org/latest/Manual/installation.html#title40 + # A workaround is to add "-std=c++11" again. + # A fix would be to use https://cmake.org/cmake/help/v3.1/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.html + # or even better https://cmake.org/cmake/help/v3.1/variable/CMAKE_CXX_STANDARD.html + # but it implies to use cmake version 3.1 at least. + if(NOT MSVC) + include(CheckCXXCompilerFlag) + CHECK_CXX_COMPILER_FLAG(-std=c++11 COMPILER_SUPPORTS_CXX11) + if(COMPILER_SUPPORTS_CXX11) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + endif() endif() - endif() - # - End of workaround + # - End of workaround - find_package(Eigen3 3.1.0) - if (EIGEN3_FOUND) - message(STATUS "Eigen3 version: ${EIGEN3_VERSION}.") - include( ${EIGEN3_USE_FILE} ) + find_package(Eigen3 3.1.0) + if (EIGEN3_FOUND) + message(STATUS "Eigen3 version: ${EIGEN3_VERSION}.") + include( ${EIGEN3_USE_FILE} ) - add_executable (alphacomplexpersistence alpha_complex_persistence.cpp) - target_link_libraries(alphacomplexpersistence ${Boost_SYSTEM_LIBRARY} ${CGAL_LIBRARY}) + add_executable (alpha_complex_persistence alpha_complex_persistence.cpp) + target_link_libraries(alpha_complex_persistence ${Boost_SYSTEM_LIBRARY} ${CGAL_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY}) + else() + message(WARNING "Eigen3 not found. Version 3.1.0 is required for Alpha shapes feature.") + endif() else() - message(WARNING "Eigen3 not found. Version 3.1.0 is required for Alpha shapes feature.") - endif() + message(WARNING "CGAL version: ${CGAL_VERSION} is too old to compile Alpha shapes feature. Version 4.6.0 is required.") + endif () else() - message(WARNING "CGAL version: ${CGAL_VERSION} is too old to compile Alpha shapes feature. Version 4.6.0 is required.") - endif () - - - - endif() + # message(WARNING "CGAL not found.") + endif() +else() + # message(WARNING "GMP not found.") endif() diff --git a/src/Persistent_cohomology/example/alpha_complex_persistence.cpp b/src/Persistent_cohomology/example/alpha_complex_persistence.cpp index fbadf673..0dabdeac 100644 --- a/src/Persistent_cohomology/example/alpha_complex_persistence.cpp +++ b/src/Persistent_cohomology/example/alpha_complex_persistence.cpp @@ -1,34 +1,35 @@ #include #include +#include + // to construct a Delaunay_triangulation from a OFF file #include #include #include -void usage(char * const progName) { - std::cerr << "Usage: " << progName << " filename.off alpha_square_max_value[double] " << - "coeff_field_characteristic[integer > 0] min_persistence[double >= -1.0]" << std::endl; - std::cerr << " i.e.: " << progName << " ../../data/points/alphacomplexdoc.off 60.0 2 0.02" << std::endl; - exit(-1); // ----- >> -} +void program_options(int argc, char * argv[] + , std::string & off_file_points + , std::string & output_file_diag + , Filtration_value & alpha_square_max_value + , int & coeff_field_characteristic + , Filtration_value & min_persistence); int main(int argc, char **argv) { - if (argc != 5) { - std::cerr << "Error: Number of arguments (" << argc << ") is not correct" << std::endl; - usage(argv[0]); - } + std::string off_file_points; + std::string output_file_diag; + Filtration_value alpha_square_max_value; + int coeff_field_characteristic; + Filtration_value min_persistence; + + program_options(argc, argv, off_file_points, output_file_diag, alpha_square_max_value, coeff_field_characteristic, min_persistence); - std::string off_file_name(argv[1]); - double alpha_square_max_value = atof(argv[2]); - int coeff_field_characteristic = atoi(argv[3]); - double min_persistence = atof(argv[4]); // ---------------------------------------------------------------------------- // Init of an alpha complex from an OFF file // ---------------------------------------------------------------------------- typedef CGAL::Epick_d< CGAL::Dynamic_dimension_tag > Kernel; - Gudhi::alphacomplex::Alpha_complex alpha_complex_from_file(off_file_name, alpha_square_max_value); + Gudhi::alphacomplex::Alpha_complex alpha_complex_from_file(off_file_points, alpha_square_max_value); // ---------------------------------------------------------------------------- // Display information about the alpha complex @@ -49,7 +50,66 @@ int main(int argc, char **argv) { pcoh.compute_persistent_cohomology(min_persistence); - pcoh.output_diagram(); + // Output the diagram in filediag + if (output_file_diag.empty()) { + pcoh.output_diagram(); + } else { + std::cout << "Result in file: " << output_file_diag << std::endl; + std::ofstream out(output_file_diag); + pcoh.output_diagram(out); + out.close(); + } return 0; } + +void program_options(int argc, char * argv[] + , std::string & off_file_points + , std::string & output_file_diag + , Filtration_value & alpha_square_max_value + , int & coeff_field_characteristic + , Filtration_value & min_persistence) { + namespace po = boost::program_options; + po::options_description hidden("Hidden options"); + hidden.add_options() + ("input-file", po::value(&off_file_points), + "Name of file containing a point set. Format is one point per line: X1 ... Xd "); + + po::options_description visible("Allowed options", 100); + visible.add_options() + ("help,h", "produce help message") + ("output-file,o", po::value(&output_file_diag)->default_value(std::string()), + "Name of file in which the persistence diagram is written. Default print in std::cout") + ("max-alpha-square-value,r", po::value(&alpha_square_max_value)->default_value(std::numeric_limits::infinity()), + "Maximal alpha square value for the Alpha complex construction.") + ("field-charac,p", po::value(&coeff_field_characteristic)->default_value(11), + "Characteristic p of the coefficient field Z/pZ for computing homology.") + ("min-persistence,m", po::value(&min_persistence), + "Minimal lifetime of homology feature to be recorded. Default is 0. Enter a negative value to see zero length intervals"); + + po::positional_options_description pos; + pos.add("input-file", 1); + + po::options_description all; + all.add(visible).add(hidden); + + po::variables_map vm; + po::store(po::command_line_parser(argc, argv). + options(all).positional(pos).run(), vm); + po::notify(vm); + + if (vm.count("help") || !vm.count("input-file")) { + std::cout << std::endl; + std::cout << "Compute the persistent homology with coefficient field Z/pZ \n"; + std::cout << "of an Alpha complex defined on a set of input points.\n \n"; + std::cout << "The output diagram contains one bar per line, written with the convention: \n"; + std::cout << " p dim b d \n"; + std::cout << "where dim is the dimension of the homological feature,\n"; + std::cout << "b and d are respectively the birth and death of the feature and \n"; + std::cout << "p is the characteristic of the field Z/pZ used for homology coefficients." << std::endl << std::endl; + + std::cout << "Usage: " << argv[0] << " [options] input-file" << std::endl << std::endl; + std::cout << visible << std::endl; + std::abort(); + } +} diff --git a/src/Persistent_cohomology/example/rips_persistence.cpp b/src/Persistent_cohomology/example/rips_persistence.cpp index 9b1ef42f..fa0449a8 100644 --- a/src/Persistent_cohomology/example/rips_persistence.cpp +++ b/src/Persistent_cohomology/example/rips_persistence.cpp @@ -30,6 +30,7 @@ #include #include +#include // infinity using namespace Gudhi; using namespace Gudhi::persistent_cohomology; @@ -114,7 +115,7 @@ void program_options(int argc, char * argv[] ("help,h", "produce help message") ("output-file,o", po::value(&filediag)->default_value(std::string()), "Name of file in which the persistence diagram is written. Default print in std::cout") - ("max-edge-length,r", po::value(&threshold)->default_value(0), + ("max-edge-length,r", po::value(&threshold)->default_value(std::numeric_limits::infinity()), "Maximal length of an edge for the Rips complex construction.") ("cpx-dimension,d", po::value(&dim_max)->default_value(1), "Maximal dimension of the Rips complex we want to compute.") diff --git a/src/Simplex_tree/include/gudhi/Simplex_tree.h b/src/Simplex_tree/include/gudhi/Simplex_tree.h index 4b04e75a..d4f9aeae 100644 --- a/src/Simplex_tree/include/gudhi/Simplex_tree.h +++ b/src/Simplex_tree/include/gudhi/Simplex_tree.h @@ -1160,43 +1160,28 @@ std::cout << "prune_above_filtration - filtration=" << filtration << std::endl; 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; -} - + std::vector> simplex_list_to_removed; // 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); + // Do not erase while looping, because removing is shifting data in a flat_map + for (auto f_simplex = filtration_vect_.rbegin(); + (f_simplex != filtration_vect_.rend()) && ((*f_simplex)->second.filtration() > threshold_); + f_simplex++) { + std::vector simplex_to_remove; + for (auto vertex : simplex_vertex_range(*f_simplex)) + simplex_to_remove.insert(simplex_to_remove.begin(), vertex); + simplex_list_to_removed.push_back(simplex_to_remove); } -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); + for (auto simplex_to_remove : simplex_list_to_removed) { + Simplex_handle sh = find_simplex(simplex_to_remove); + if (sh != null_simplex()) + remove_maximal_simplex(sh); } - + // Re-initialize filtration_vect_ if dta were removed, because removing is shifting data in a flat_map + if (simplex_list_to_removed.size() > 0) + initialize_filtration(); } } } @@ -1205,6 +1190,7 @@ std::cout << "prune_above_filtration - resize" << new_size << std::endl; * @param[in] sh Simplex handle on the maximal simplex to remove. * \pre Please check the simplex has no coface before removing it. * \warning In debug mode, the exception std::invalid_argument is thrown if sh has children. + * \warning Be aware that removing is shifting data in a flat_map (initialize_filtration to be done). */ void remove_maximal_simplex(Simplex_handle sh) { // Guarantee the simplex has no children @@ -1213,49 +1199,18 @@ std::cout << "prune_above_filtration - resize" << new_size << std::endl; // Simplex is a leaf, it means the child is the Siblings owning the leaf Siblings* child = sh->second.children(); + 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 -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/test/simplex_tree_unit_test.cpp b/src/Simplex_tree/test/simplex_tree_unit_test.cpp index f6bd5411..0d73d347 100644 --- a/src/Simplex_tree/test/simplex_tree_unit_test.cpp +++ b/src/Simplex_tree/test/simplex_tree_unit_test.cpp @@ -351,7 +351,7 @@ BOOST_AUTO_TEST_CASE(simplex_tree_insertion) { // 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; + std::cout << "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)) { @@ -549,7 +549,7 @@ BOOST_AUTO_TEST_CASE(NSimplexAndSubfaces_tree_insertion) { // 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; + std::cout << "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)) { @@ -805,7 +805,7 @@ struct MyOptions : Simplex_tree_options_full_featured { }; typedef Simplex_tree miniST; -/*BOOST_AUTO_TEST_CASE(remove_maximal_simplex) { +BOOST_AUTO_TEST_CASE(remove_maximal_simplex) { std::cout << "********************************************************************" << std::endl; std::cout << "REMOVE MAXIMAL SIMPLEX" << std::endl; @@ -887,7 +887,7 @@ typedef Simplex_tree miniST; st.remove_maximal_simplex(st.find({7})); BOOST_CHECK(st == st_wo_seven); -}*/ +} BOOST_AUTO_TEST_CASE(prune_above_filtration) { std::cout << "********************************************************************" << std::endl; @@ -939,10 +939,10 @@ BOOST_AUTO_TEST_CASE(prune_above_filtration) { 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 + // Display the Simplex_tree 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; + std::cout << "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)) { @@ -955,35 +955,45 @@ BOOST_AUTO_TEST_CASE(prune_above_filtration) { // Set the st_pruned filtration for operator== st_pruned.set_filtration(2.5); st.prune_above_filtration(2.5); - /*BOOST_CHECK(st == st_pruned); + BOOST_CHECK(st == st_pruned); + + // Display the Simplex_tree + std::cout << "The complex pruned at 2.5 contains " << st.num_simplices() << " simplices" << std::endl; + std::cout << " - dimension " << st.dimension() << " - filtration " << st.filtration() << std::endl; + std::cout << "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; + } 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); + + // Display the Simplex_tree + std::cout << "The complex pruned at 0.0 contains " << st.num_simplices() << " simplices" << std::endl; + std::cout << " - dimension " << st.dimension() << " - filtration " << st.filtration() << std::endl; + std::cout << "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; + } + + 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/include/gudhi/distance_functions.h b/src/common/include/gudhi/distance_functions.h index e5c79ded..cd518581 100644 --- a/src/common/include/gudhi/distance_functions.h +++ b/src/common/include/gudhi/distance_functions.h @@ -23,6 +23,8 @@ #ifndef DISTANCE_FUNCTIONS_H_ #define DISTANCE_FUNCTIONS_H_ +#include // for std::sqrt + /* Compute the Euclidean distance between two Points given * by a range of coordinates. The points are assumed to have * the same dimension. */ @@ -35,7 +37,7 @@ double euclidean_distance(Point &p1, Point &p2) { double tmp = *it1 - *it2; dist += tmp*tmp; } - return sqrt(dist); + return std::sqrt(dist); } #endif // DISTANCE_FUNCTIONS_H_ diff --git a/src/common/include/gudhi/reader_utils.h b/src/common/include/gudhi/reader_utils.h index e05714c7..da2c2c36 100644 --- a/src/common/include/gudhi/reader_utils.h +++ b/src/common/include/gudhi/reader_utils.h @@ -58,7 +58,9 @@ inline void read_points(std::string file_name, std::vector< std::vector< double while (iss >> x) { point.push_back(x); } - points.push_back(point); + // Check for empty lines + if (!point.empty()) + points.push_back(point); } in_file.close(); } -- cgit v1.2.3