summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Gudhi_stat/example/CMakeLists.txt16
-rwxr-xr-xsrc/Gudhi_stat/example/utilities/persistence_landscapes/average_landscapesbin99922 -> 99922 bytes
-rwxr-xr-xsrc/Gudhi_stat/example/utilities/persistence_landscapes/create_landscapesbin99645 -> 99645 bytes
-rwxr-xr-xsrc/Gudhi_stat/example/utilities/persistence_landscapes/plot_landscapesbin99584 -> 99584 bytes
-rw-r--r--src/Gudhi_stat/include/gudhi/common.h39
-rw-r--r--src/Persistent_cohomology/example/CMakeLists.txt4
-rw-r--r--src/Persistent_cohomology/example/alpha_complex_3d_persistence.cpp28
7 files changed, 52 insertions, 35 deletions
diff --git a/src/Gudhi_stat/example/CMakeLists.txt b/src/Gudhi_stat/example/CMakeLists.txt
index d963259c..5716ff31 100644
--- a/src/Gudhi_stat/example/CMakeLists.txt
+++ b/src/Gudhi_stat/example/CMakeLists.txt
@@ -116,20 +116,4 @@ add_executable ( utilities/persistence_vectors/plot_persistence_vectors utilitie
target_link_libraries(utilities/persistence_vectors/plot_persistence_vectors ${Boost_SYSTEM_LIBRARY})
-#PSSK
-#seems that this is not needed, since the only difference is the creation. The rest works the same as in the persitence heat maps. So, I have moved the creation of PSSK into the persitence heat maps folder, and use the methos from over there.
-#add_executable ( utilities/PSSK/average_pssk utilities/PSSK/average_pssk.cpp )
-#target_link_libraries(utilities/PSSK/average_pssk ${Boost_SYSTEM_LIBRARY})
-
-#add_executable ( utilities/PSSK/create_pssk utilities/PSSK/create_pssk.cpp )
-#target_link_libraries(utilities/PSSK/create_pssk ${Boost_SYSTEM_LIBRARY})
-
-#add_executable ( utilities/PSSK/plot_pssk utilities/PSSK/plot_pssk.cpp )
-#target_link_libraries(utilities/PSSK/plot_pssk ${Boost_SYSTEM_LIBRARY})
-
-#add_executable ( utilities/PSSK/compute_distance_of_pssk utilities/PSSK/compute_distance_of_pssk.cpp )
-#target_link_libraries(utilities/PSSK/compute_distance_of_pssk ${Boost_SYSTEM_LIBRARY})
-
-add_executable ( utilities/PSSK/compute_scalar_product_of_pssk utilities/PSSK/compute_scalar_product_of_pssk.cpp )
-target_link_libraries(utilities/PSSK/compute_scalar_product_of_pssk ${Boost_SYSTEM_LIBRARY})
diff --git a/src/Gudhi_stat/example/utilities/persistence_landscapes/average_landscapes b/src/Gudhi_stat/example/utilities/persistence_landscapes/average_landscapes
index b941b19a..b2a88191 100755
--- a/src/Gudhi_stat/example/utilities/persistence_landscapes/average_landscapes
+++ b/src/Gudhi_stat/example/utilities/persistence_landscapes/average_landscapes
Binary files differ
diff --git a/src/Gudhi_stat/example/utilities/persistence_landscapes/create_landscapes b/src/Gudhi_stat/example/utilities/persistence_landscapes/create_landscapes
index 3136aab1..6be64214 100755
--- a/src/Gudhi_stat/example/utilities/persistence_landscapes/create_landscapes
+++ b/src/Gudhi_stat/example/utilities/persistence_landscapes/create_landscapes
Binary files differ
diff --git a/src/Gudhi_stat/example/utilities/persistence_landscapes/plot_landscapes b/src/Gudhi_stat/example/utilities/persistence_landscapes/plot_landscapes
index 5e63470e..2352c96b 100755
--- a/src/Gudhi_stat/example/utilities/persistence_landscapes/plot_landscapes
+++ b/src/Gudhi_stat/example/utilities/persistence_landscapes/plot_landscapes
Binary files differ
diff --git a/src/Gudhi_stat/include/gudhi/common.h b/src/Gudhi_stat/include/gudhi/common.h
new file mode 100644
index 00000000..d573a92a
--- /dev/null
+++ b/src/Gudhi_stat/include/gudhi/common.h
@@ -0,0 +1,39 @@
+/* This file is part of the Gudhi Library. The Gudhi library
+ * (Geometric Understanding in Higher Dimensions) is a generic C++
+ * library for computational topology.
+ *
+ * Author(s): Pawel Dlotko
+ *
+ * Copyright (C) 2015 INRIA Sophia-Saclay (France)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+ //this file contain an implementation of some common procedures used in Gudhi_stat.
+
+ //double epsi = std::numeric_limits<double>::epsilon();
+double epsi = 0.000005;
+
+
+/**
+ * A procedure used to compare doubles. Typically gien two doubles A and B, comparing A == B is not good idea. In this case, we use the procedure almostEqual with the epsi defined at
+ * the top of the file. Setting up the epsi give the user a tolerance on what should be consider equal.
+**/
+inline bool almost_equal( double a , double b )
+{
+ if ( fabs(a-b) < epsi )
+ return true;
+ return false;
+}
diff --git a/src/Persistent_cohomology/example/CMakeLists.txt b/src/Persistent_cohomology/example/CMakeLists.txt
index b823d658..222606d6 100644
--- a/src/Persistent_cohomology/example/CMakeLists.txt
+++ b/src/Persistent_cohomology/example/CMakeLists.txt
@@ -74,8 +74,8 @@ endif(GMP_FOUND)
message(STATUS "Eigen3 version: ${EIGEN3_VERSION}.")
include( ${EIGEN3_USE_FILE} )
- add_executable (alpha_complex_persistence alpha_complex_persistence.cpp)
- target_link_libraries(alpha_complex_persistence ${Boost_SYSTEM_LIBRARY} ${CGAL_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY})
+ #add_executable (alpha_complex_persistence alpha_complex_persistence.cpp)
+ #target_link_libraries(alpha_complex_persistence ${Boost_SYSTEM_LIBRARY} ${CGAL_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY})
add_executable(periodic_alpha_complex_3d_persistence periodic_alpha_complex_3d_persistence.cpp)
target_link_libraries(periodic_alpha_complex_3d_persistence ${Boost_SYSTEM_LIBRARY} ${CGAL_LIBRARY})
diff --git a/src/Persistent_cohomology/example/alpha_complex_3d_persistence.cpp b/src/Persistent_cohomology/example/alpha_complex_3d_persistence.cpp
index 48fbb91a..20142ab2 100644
--- a/src/Persistent_cohomology/example/alpha_complex_3d_persistence.cpp
+++ b/src/Persistent_cohomology/example/alpha_complex_3d_persistence.cpp
@@ -22,11 +22,11 @@
#include <gudhi/Simplex_tree.h>
#include <gudhi/Persistent_cohomology.h>
-#include <gudhi/Points_3D_off_io.h>
#include <boost/variant.hpp>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
-#include <CGAL/Delaunay_triangulation_3.h>
+#include <CGAL/Regular_triangulation_3.h>
+#include <CGAL/Regular_triangulation_euclidean_traits_3.h>
#include <CGAL/Alpha_shape_3.h>
#include <CGAL/iterator.h>
@@ -41,10 +41,11 @@
// Alpha_shape_3 templates type definitions
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
-typedef CGAL::Alpha_shape_vertex_base_3<Kernel> Vb;
-typedef CGAL::Alpha_shape_cell_base_3<Kernel> Fb;
+typedef CGAL::Regular_triangulation_euclidean_traits_3<Kernel> Gt;
+typedef CGAL::Alpha_shape_vertex_base_3<Gt> Vb;
+typedef CGAL::Alpha_shape_cell_base_3<Gt> Fb;
typedef CGAL::Triangulation_data_structure_3<Vb, Fb> Tds;
-typedef CGAL::Delaunay_triangulation_3<Kernel, Tds> Triangulation_3;
+typedef CGAL::Regular_triangulation_3<Gt, Tds> Triangulation_3;
typedef CGAL::Alpha_shape_3<Triangulation_3> Alpha_shape_3;
// From file type definition
@@ -138,18 +139,11 @@ int main(int argc, char * const argv[]) {
usage(argv[0]);
}
- // Read points from file
- std::string offInputFile(argv[1]);
- // Read the OFF file (input file name given as parameter) and triangulate points
- Gudhi::Points_3D_off_reader<Point_3> off_reader(offInputFile);
- // Check the read operation was correct
- if (!off_reader.is_valid()) {
- std::cerr << "Unable to read file " << offInputFile << std::endl;
- usage(argv[0]);
- }
-
- // Retrieve the triangulation
- std::vector<Point_3> lp = off_reader.get_point_cloud();
+ std::vector<Gt::Weighted_point> lp;
+ lp.emplace_back(Point_3(0,0,0),0);
+ lp.emplace_back(Point_3(0,0,1),0);
+ lp.emplace_back(Point_3(0,1,0),.2);
+ lp.emplace_back(Point_3(1,0,0),0);
// alpha shape construction from points. CGAL has a strange behavior in REGULARIZED mode.
Alpha_shape_3 as(lp.begin(), lp.end(), 0, Alpha_shape_3::GENERAL);