diff options
-rw-r--r-- | CMakeGUDHIVersion.txt | 2 | ||||
-rw-r--r-- | Dockerfile_for_circleci_image (renamed from Dockerfile_ubuntu) | 1 | ||||
-rw-r--r-- | Dockerfile_gudhi_installation | 65 | ||||
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | biblio/bibliography.bib | 2 | ||||
-rw-r--r-- | src/Cech_complex/doc/Intro_cech_complex.h | 2 | ||||
-rw-r--r-- | src/Doxyfile.in | 2 | ||||
-rw-r--r-- | src/Rips_complex/utilities/ripscomplex.md | 1 | ||||
-rw-r--r-- | src/Rips_complex/utilities/sparse_rips_persistence.cpp | 15 | ||||
-rw-r--r-- | src/cmake/modules/GUDHI_compilation_flags.cmake | 2 | ||||
-rw-r--r-- | src/common/doc/installation.h | 2 | ||||
-rw-r--r-- | src/common/include/gudhi/Unitary_tests_utils.h | 1 | ||||
-rw-r--r-- | src/python/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/python/doc/installation.rst | 4 | ||||
-rw-r--r-- | src/python/include/Alpha_complex_interface.h | 11 |
15 files changed, 98 insertions, 16 deletions
diff --git a/CMakeGUDHIVersion.txt b/CMakeGUDHIVersion.txt index f8927c15..eb2a0666 100644 --- a/CMakeGUDHIVersion.txt +++ b/CMakeGUDHIVersion.txt @@ -1,6 +1,6 @@ set (GUDHI_MAJOR_VERSION 3) set (GUDHI_MINOR_VERSION 0) -set (GUDHI_PATCH_VERSION 0.rc2) +set (GUDHI_PATCH_VERSION 0) set(GUDHI_VERSION ${GUDHI_MAJOR_VERSION}.${GUDHI_MINOR_VERSION}.${GUDHI_PATCH_VERSION}) message(STATUS "GUDHI version : ${GUDHI_VERSION}") diff --git a/Dockerfile_ubuntu b/Dockerfile_for_circleci_image index e149a33a..12f2dc94 100644 --- a/Dockerfile_ubuntu +++ b/Dockerfile_for_circleci_image @@ -51,6 +51,7 @@ RUN pip3 install \ matplotlib \ scipy \ Cython \ + POT \ sphinx \ sphinxcontrib-bibtex diff --git a/Dockerfile_gudhi_installation b/Dockerfile_gudhi_installation new file mode 100644 index 00000000..9fe20730 --- /dev/null +++ b/Dockerfile_gudhi_installation @@ -0,0 +1,65 @@ +FROM ubuntu:19.04 + +# Update and upgrade distribution +RUN apt-get update && \ + apt-get upgrade -y + +# Tools necessary for installing and configuring Ubuntu +RUN apt-get install -y \ + apt-utils \ + locales \ + tzdata + +# Timezone +RUN echo "Europe/Paris" | tee /etc/timezone && \ + ln -fs /usr/share/zoneinfo/Europe/Paris /etc/localtime && \ + dpkg-reconfigure -f noninteractive tzdata + +# Locale with UTF-8 support +RUN echo en_US.UTF-8 UTF-8 >> /etc/locale.gen && \ + locale-gen && \ + update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 +ENV LANG en_US.UTF-8 +ENV LANGUAGE en_US:en +ENV LC_ALL en_US.UTF-8 + +# Required for Gudhi compilation +RUN apt-get install -y make \ + g++ \ + cmake \ + graphviz \ + perl \ + texlive-bibtex-extra \ + biber \ + libboost-all-dev \ + libeigen3-dev \ + libgmp3-dev \ + libmpfr-dev \ + libtbb-dev \ + libcgal-dev \ + locales \ + python3 \ + python3-pip \ + python3-pytest \ + python3-tk \ + libfreetype6-dev \ + pkg-config \ + curl + +RUN pip3 install \ + numpy \ + matplotlib \ + scipy \ + Cython + +# apt clean up +RUN apt autoremove && rm -rf /var/lib/apt/lists/* + +RUN curl -LO "https://github.com/GUDHI/gudhi-devel/releases/download/tags%2Fgudhi-release-3.0.0/gudhi.3.0.0.tar.gz" \ +&& tar xf gudhi.3.0.0.tar.gz \ +&& cd gudhi.3.0.0 \ +&& mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release -DWITH_GUDHI_PYTHON=OFF -DPython_ADDITIONAL_VERSIONS=3 .. \ +&& make all test install \ +&& cmake -DWITH_GUDHI_PYTHON=ON . \ +&& cd python \ +&& python3 setup.py install
\ No newline at end of file @@ -2,6 +2,8 @@ [![Build Status](https://travis-ci.org/GUDHI/gudhi-devel.svg?branch=master)](https://travis-ci.org/GUDHI/gudhi-devel) [![CircleCI](https://circleci.com/gh/GUDHI/gudhi-devel/tree/master.svg?style=svg)](https://circleci.com/gh/GUDHI/gudhi-devel/tree/master) [![Build status](https://ci.appveyor.com/api/projects/status/976j2uut8xgalvx2/branch/master?svg=true)](https://ci.appveyor.com/project/GUDHI/gudhi-devel/branch/master) +[![Anaconda Cloud](https://anaconda.org/conda-forge/gudhi/badges/version.svg)](https://anaconda.org/conda-forge/gudhi) +[![Anaconda downloads](https://anaconda.org/conda-forge/gudhi/badges/downloads.svg)](https://anaconda.org/conda-forge/gudhi) ![GUDHI](src/common/doc/Gudhi_banner.png "Topological Data Analysis (TDA) and Higher Dimensional Geometry Understanding") diff --git a/biblio/bibliography.bib b/biblio/bibliography.bib index d1b2f558..a1b951e0 100644 --- a/biblio/bibliography.bib +++ b/biblio/bibliography.bib @@ -1076,7 +1076,7 @@ language={English} journal = {Computational Geometry: Theory and Applications}, volume = {58}, pages = {70--96}, - doi = "https://doi.org/10.1016/j.comgeo.2016.07.001", + doi = "10.1016/j.comgeo.2016.07.001", year = {2016} } diff --git a/src/Cech_complex/doc/Intro_cech_complex.h b/src/Cech_complex/doc/Intro_cech_complex.h index 90086de7..80c88dc6 100644 --- a/src/Cech_complex/doc/Intro_cech_complex.h +++ b/src/Cech_complex/doc/Intro_cech_complex.h @@ -24,7 +24,7 @@ namespace cech_complex { * \section cechdefinition Čech complex definition * * Čech complex - * <a target="_blank" href="https://en.wikipedia.org/wiki/%C4%8Cech_cohomology">(Wikipedia)</a> is a + * <a target="_blank" href="https://en.wikipedia.org/wiki/%C4%8Cech_complex">(Wikipedia)</a> is a * <a target="_blank" href="https://en.wikipedia.org/wiki/Simplicial_complex">simplicial complex</a> constructed * from a proximity graph. The set of all simplices is filtered by the radius of their minimal enclosing ball. * diff --git a/src/Doxyfile.in b/src/Doxyfile.in index 57775498..ec551882 100644 --- a/src/Doxyfile.in +++ b/src/Doxyfile.in @@ -765,7 +765,7 @@ INPUT_ENCODING = UTF-8 # *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, # *.qsf, *.as and *.js. -FILE_PATTERNS = +#FILE_PATTERNS = # The RECURSIVE tag can be used to specify whether or not subdirectories should # be searched for input files as well. diff --git a/src/Rips_complex/utilities/ripscomplex.md b/src/Rips_complex/utilities/ripscomplex.md index 03838085..61f31e3c 100644 --- a/src/Rips_complex/utilities/ripscomplex.md +++ b/src/Rips_complex/utilities/ripscomplex.md @@ -99,6 +99,7 @@ where `dim` is the dimension of the homological feature, `birth` and `death` are * `-h [ --help ]` Produce help message * `-o [ --output-file ]` Name of file in which the persistence diagram is written. Default print in standard output. +* `-r [ --max-edge-length ]` (default = inf) Maximal length of an edge for the Rips complex construction. * `-e [ --approximation ]` (default = .5) Epsilon, where the sparse Rips complex is a (1+epsilon)/(1-epsilon)-approximation of the Rips complex. * `-d [ --cpx-dimension ]` (default = INT_MAX) Maximal dimension of the Rips complex we want to compute. * `-p [ --field-charac ]` (default = 11) Characteristic p of the coefficient field Z/pZ for computing homology. diff --git a/src/Rips_complex/utilities/sparse_rips_persistence.cpp b/src/Rips_complex/utilities/sparse_rips_persistence.cpp index 1a86eafe..cefd8a67 100644 --- a/src/Rips_complex/utilities/sparse_rips_persistence.cpp +++ b/src/Rips_complex/utilities/sparse_rips_persistence.cpp @@ -28,21 +28,24 @@ using Persistent_cohomology = Gudhi::persistent_cohomology::Persistent_cohomolog using Point = std::vector<double>; using Points_off_reader = Gudhi::Points_off_reader<Point>; -void program_options(int argc, char* argv[], std::string& off_file_points, std::string& filediag, double& epsilon, +void program_options(int argc, char* argv[], std::string& off_file_points, std::string& filediag, + Filtration_value& threshold, double& epsilon, int& dim_max, int& p, Filtration_value& min_persistence); int main(int argc, char* argv[]) { std::string off_file_points; std::string filediag; + Filtration_value threshold; double epsilon; int dim_max; int p; Filtration_value min_persistence; - program_options(argc, argv, off_file_points, filediag, epsilon, dim_max, p, min_persistence); + program_options(argc, argv, off_file_points, filediag, threshold, epsilon, dim_max, p, min_persistence); Points_off_reader off_reader(off_file_points); - Sparse_rips sparse_rips(off_reader.get_point_cloud(), Gudhi::Euclidean_distance(), epsilon); + Sparse_rips sparse_rips(off_reader.get_point_cloud(), Gudhi::Euclidean_distance(), epsilon, + -std::numeric_limits<Filtration_value>::infinity(), threshold); // Construct the Rips complex in a Simplex Tree Simplex_tree simplex_tree; @@ -73,7 +76,8 @@ int main(int argc, char* argv[]) { return 0; } -void program_options(int argc, char* argv[], std::string& off_file_points, std::string& filediag, double& epsilon, +void program_options(int argc, char* argv[], std::string& off_file_points, std::string& filediag, + Filtration_value& threshold, double& epsilon, int& dim_max, int& p, Filtration_value& min_persistence) { namespace po = boost::program_options; po::options_description hidden("Hidden options"); @@ -84,6 +88,9 @@ void program_options(int argc, char* argv[], std::string& off_file_points, std:: visible.add_options()("help,h", "produce help message")( "output-file,o", po::value<std::string>(&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<Filtration_value>(&threshold)->default_value(std::numeric_limits<Filtration_value>::infinity()), + "Maximal length of an edge for the Rips complex construction.")( "approximation,e", po::value<double>(&epsilon)->default_value(.5), "Epsilon, where the sparse Rips complex is a (1+epsilon)-approximation of the Rips complex.")( "cpx-dimension,d", po::value<int>(&dim_max)->default_value(std::numeric_limits<int>::max()), diff --git a/src/cmake/modules/GUDHI_compilation_flags.cmake b/src/cmake/modules/GUDHI_compilation_flags.cmake index 86cd531b..6cd2614d 100644 --- a/src/cmake/modules/GUDHI_compilation_flags.cmake +++ b/src/cmake/modules/GUDHI_compilation_flags.cmake @@ -38,7 +38,7 @@ function(can_cgal_use_cxx11_thread_local) check_cxx_source_compiles("${CGAL_CAN_USE_CXX11_THREAD_LOCAL}" CGAL_CAN_USE_CXX11_THREAD_LOCAL_RESULT) endfunction() -set (CMAKE_CXX_STANDARD 11) +set (CMAKE_CXX_STANDARD 14) enable_testing() diff --git a/src/common/doc/installation.h b/src/common/doc/installation.h index 54f86573..2e64bef8 100644 --- a/src/common/doc/installation.h +++ b/src/common/doc/installation.h @@ -5,7 +5,7 @@ * Examples of GUDHI headers inclusion can be found in \ref utilities. * * \section compiling Compiling - * The library uses c++11 and requires <a target="_blank" href="http://www.boost.org/">Boost</a> ≥ 1.56.0 + * The library uses c++14 and requires <a target="_blank" href="http://www.boost.org/">Boost</a> ≥ 1.56.0 * and <a target="_blank" href="https://www.cmake.org/">CMake</a> ≥ 3.1. * It is a multi-platform library and compiles on Linux, Mac OSX and Visual Studio 2015. * diff --git a/src/common/include/gudhi/Unitary_tests_utils.h b/src/common/include/gudhi/Unitary_tests_utils.h index 4ad4dae8..7d039304 100644 --- a/src/common/include/gudhi/Unitary_tests_utils.h +++ b/src/common/include/gudhi/Unitary_tests_utils.h @@ -14,6 +14,7 @@ #include <iostream> #include <limits> // for std::numeric_limits<> +#include <cmath> // for std::fabs template<typename FloatingType > void GUDHI_TEST_FLOAT_EQUALITY_CHECK(FloatingType a, FloatingType b, diff --git a/src/python/CMakeLists.txt b/src/python/CMakeLists.txt index 07931d10..1b1684e1 100644 --- a/src/python/CMakeLists.txt +++ b/src/python/CMakeLists.txt @@ -77,7 +77,7 @@ if(PYTHONINTERP_FOUND) if(MSVC) set(GUDHI_PYTHON_EXTRA_COMPILE_ARGS "${GUDHI_PYTHON_EXTRA_COMPILE_ARGS}'/fp:strict', ") else(MSVC) - set(GUDHI_PYTHON_EXTRA_COMPILE_ARGS "${GUDHI_PYTHON_EXTRA_COMPILE_ARGS}'-std=c++11', ") + set(GUDHI_PYTHON_EXTRA_COMPILE_ARGS "${GUDHI_PYTHON_EXTRA_COMPILE_ARGS}'-std=c++14', ") endif(MSVC) if(CMAKE_COMPILER_IS_GNUCXX) set(GUDHI_PYTHON_EXTRA_COMPILE_ARGS "${GUDHI_PYTHON_EXTRA_COMPILE_ARGS}'-frounding-math', ") diff --git a/src/python/doc/installation.rst b/src/python/doc/installation.rst index 3711ca8e..7699a5bb 100644 --- a/src/python/doc/installation.rst +++ b/src/python/doc/installation.rst @@ -8,11 +8,11 @@ Installation Conda ***** The easiest way to install the Python version of GUDHI is using -`conda <https://gudhi.inria.fr/licensing/>`_. +`conda <https://gudhi.inria.fr/conda/>`_. Compiling ********* -The library uses c++11 and requires `Boost <https://www.boost.org/>`_ ≥ 1.56.0, +The library uses c++14 and requires `Boost <https://www.boost.org/>`_ ≥ 1.56.0, `CMake <https://www.cmake.org/>`_ ≥ 3.1 to generate makefiles, `NumPy <http://numpy.org>`_ and `Cython <https://www.cython.org/>`_ to compile the GUDHI Python module. diff --git a/src/python/include/Alpha_complex_interface.h b/src/python/include/Alpha_complex_interface.h index b3553d32..96353cc4 100644 --- a/src/python/include/Alpha_complex_interface.h +++ b/src/python/include/Alpha_complex_interface.h @@ -15,6 +15,8 @@ #include <gudhi/Alpha_complex.h> #include <CGAL/Epick_d.h> +#include <boost/range/adaptor/transformed.hpp> + #include "Simplex_tree_interface.h" #include <iostream> @@ -31,7 +33,10 @@ class Alpha_complex_interface { public: Alpha_complex_interface(const std::vector<std::vector<double>>& points) { - alpha_complex_ = new Alpha_complex<Dynamic_kernel>(points); + auto mkpt = [](std::vector<double> const& vec){ + return Point_d(vec.size(), vec.begin(), vec.end()); + }; + alpha_complex_ = new Alpha_complex<Dynamic_kernel>(boost::adaptors::transform(points, mkpt)); } Alpha_complex_interface(const std::string& off_file_name, bool from_file = true) { @@ -45,9 +50,9 @@ class Alpha_complex_interface { std::vector<double> get_point(int vh) { std::vector<double> vd; try { - Point_d ph = alpha_complex_->get_point(vh); + Point_d const& ph = alpha_complex_->get_point(vh); for (auto coord = ph.cartesian_begin(); coord < ph.cartesian_end(); coord++) - vd.push_back(*coord); + vd.push_back(CGAL::to_double(*coord)); } catch (std::out_of_range const&) { // std::out_of_range is thrown in case not found. Other exceptions must be re-thrown } |