summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGard Spreemann <gspreemann@gmail.com>2018-06-14 20:39:01 +0200
committerGard Spreemann <gspreemann@gmail.com>2018-06-14 20:39:01 +0200
commitc524232f734de875d69e2f190f01a6c976024368 (patch)
treed8bba27646c367cb2b7c718354dd036892bcd629
parent9899ae167f281d10b1684dfcd02c6838c5bf28df (diff)
GUDHI 2.2.0 as released by upstream in a tarball.upstream/2.2.0
-rw-r--r--CMakeGUDHIVersion.txt2
-rw-r--r--CMakeLists.txt40
-rw-r--r--Doxyfile5
-rw-r--r--GudhUI/CMakeLists.txt3
-rw-r--r--GudhUI/gui/MainWindow.cpp2
-rw-r--r--GudhUI/gui/MainWindow.h2
-rw-r--r--GudhUI/gui/Menu_edge_contraction.cpp2
-rw-r--r--GudhUI/gui/Menu_edge_contraction.h2
-rw-r--r--GudhUI/gui/Menu_k_nearest_neighbors.cpp2
-rw-r--r--GudhUI/gui/Menu_k_nearest_neighbors.h2
-rw-r--r--GudhUI/gui/Menu_persistence.cpp2
-rw-r--r--GudhUI/gui/Menu_persistence.h2
-rw-r--r--GudhUI/gui/Menu_uniform_neighbors.cpp2
-rw-r--r--GudhUI/gui/Menu_uniform_neighbors.h2
-rw-r--r--GudhUI/gui/gudhui.cpp4
-rw-r--r--GudhUI/model/Complex_typedefs.h2
-rw-r--r--GudhUI/model/Model.h4
-rw-r--r--GudhUI/utils/Bar_code_persistence.h23
-rw-r--r--GudhUI/utils/Critical_points.h4
-rw-r--r--GudhUI/utils/Edge_collapsor.h2
-rw-r--r--GudhUI/utils/Edge_contractor.h2
-rw-r--r--GudhUI/utils/Furthest_point_epsilon_net.h2
-rw-r--r--GudhUI/utils/Is_manifold.h2
-rw-r--r--GudhUI/utils/K_nearest_builder.h4
-rw-r--r--GudhUI/utils/Lloyd_builder.h2
-rw-r--r--GudhUI/utils/MClock.h2
-rw-r--r--GudhUI/utils/Persistence_compute.h2
-rw-r--r--GudhUI/utils/Rips_builder.h4
-rw-r--r--GudhUI/utils/UI_utils.h2
-rw-r--r--GudhUI/utils/Vertex_collapsor.h2
-rw-r--r--GudhUI/view/Color.h2
-rw-r--r--GudhUI/view/FirstCoordProjector.h2
-rw-r--r--GudhUI/view/Projector3D.h2
-rw-r--r--GudhUI/view/View_parameter.h2
-rw-r--r--GudhUI/view/Viewer.cpp2
-rw-r--r--GudhUI/view/Viewer.h2
-rw-r--r--GudhUI/view/Viewer_instructor.cpp2
-rw-r--r--GudhUI/view/Viewer_instructor.h2
-rw-r--r--biblio/bibliography.bib75
-rw-r--r--biblio/how_to_cite_gudhi.bib2
-rw-r--r--cmake/modules/GUDHI_compilation_flags.cmake72
-rw-r--r--cmake/modules/GUDHI_third_party_libraries.cmake22
-rw-r--r--cmake/modules/GUDHI_user_version_target.cmake6
-rw-r--r--concept/Alpha_complex/SimplicialComplexForAlpha.h2
-rw-r--r--concept/Bottleneck_distance/Persistence_diagram.h2
-rw-r--r--concept/Cech_complex/SimplicialComplexForCech.h66
-rw-r--r--concept/Persistence_representations/Real_valued_topological_data.h2
-rw-r--r--concept/Persistence_representations/Topological_data_with_averages.h2
-rw-r--r--concept/Persistence_representations/Topological_data_with_distances.h2
-rw-r--r--concept/Persistence_representations/Topological_data_with_scalar_product.h2
-rw-r--r--concept/Persistence_representations/Vectorized_topological_data.h2
-rw-r--r--concept/Persistent_cohomology/CoefficientField.h2
-rw-r--r--concept/Persistent_cohomology/FilteredComplex.h40
-rw-r--r--concept/Persistent_cohomology/PersistentHomology.h2
-rw-r--r--concept/Rips_complex/SimplicialComplexForRips.h2
-rw-r--r--concept/Simplex_tree/FiltrationValue.h2
-rw-r--r--concept/Simplex_tree/IndexingTag.h2
-rw-r--r--concept/Simplex_tree/SimplexKey.h2
-rw-r--r--concept/Simplex_tree/SimplexTreeOptions.h2
-rw-r--r--concept/Simplex_tree/VertexHandle.h2
-rw-r--r--concept/Skeleton_blocker/SkeletonBlockerDS.h2
-rw-r--r--concept/Skeleton_blocker/SkeletonBlockerGeometricDS.h2
-rw-r--r--concept/Witness_complex/SimplicialComplexForWitness.h2
-rw-r--r--cython/CMakeLists.txt41
-rw-r--r--cython/cython/alpha_complex.pyx4
-rw-r--r--cython/cython/bottleneck_distance.pyx4
-rw-r--r--cython/cython/cubical_complex.pyx29
-rw-r--r--cython/cython/euclidean_strong_witness_complex.pyx4
-rw-r--r--cython/cython/euclidean_witness_complex.pyx4
-rw-r--r--cython/cython/off_reader.pyx5
-rw-r--r--cython/cython/periodic_cubical_complex.pyx29
-rwxr-xr-xcython/cython/persistence_graphical_tools.py107
-rw-r--r--cython/cython/reader_utils.pyx4
-rw-r--r--cython/cython/rips_complex.pyx39
-rw-r--r--cython/cython/simplex_tree.pyx45
-rw-r--r--cython/cython/strong_witness_complex.pyx4
-rw-r--r--cython/cython/subsampling.pyx4
-rw-r--r--cython/cython/tangential_complex.pyx19
-rw-r--r--cython/cython/witness_complex.pyx4
-rw-r--r--cython/doc/_templates/layout.html122
-rw-r--r--cython/doc/alpha_complex_ref.rst4
-rw-r--r--cython/doc/alpha_complex_sum.inc (renamed from cython/doc/alpha_complex_sum.rst)0
-rw-r--r--cython/doc/alpha_complex_user.rst12
-rw-r--r--cython/doc/bottleneck_distance_sum.inc (renamed from cython/doc/bottleneck_distance_sum.rst)0
-rw-r--r--cython/doc/bottleneck_distance_user.rst6
-rw-r--r--cython/doc/citation.rst4
-rwxr-xr-xcython/doc/conf.py3
-rw-r--r--cython/doc/cubical_complex_ref.rst4
-rw-r--r--cython/doc/cubical_complex_sum.inc (renamed from cython/doc/cubical_complex_sum.rst)0
-rw-r--r--cython/doc/cubical_complex_user.rst7
-rw-r--r--cython/doc/euclidean_strong_witness_complex_ref.rst4
-rw-r--r--cython/doc/euclidean_witness_complex_ref.rst4
-rw-r--r--cython/doc/examples.rst4
-rw-r--r--cython/doc/fileformats.rst4
-rw-r--r--cython/doc/index.rst18
-rw-r--r--cython/doc/installation.rst15
-rw-r--r--cython/doc/periodic_cubical_complex_ref.rst4
-rw-r--r--cython/doc/persistence_graphical_tools_ref.rst5
-rw-r--r--cython/doc/persistence_graphical_tools_sum.inc (renamed from cython/doc/persistence_graphical_tools_sum.rst)0
-rw-r--r--cython/doc/persistence_graphical_tools_user.rst71
-rw-r--r--cython/doc/persistent_cohomology_sum.inc (renamed from cython/doc/persistent_cohomology_sum.rst)0
-rw-r--r--cython/doc/persistent_cohomology_user.rst4
-rwxr-xr-xcython/doc/pyplots/barcode_persistence.py7
-rwxr-xr-xcython/doc/pyplots/diagram_persistence.py8
-rwxr-xr-xcython/doc/pyplots/show_palette_values.py3
-rw-r--r--cython/doc/reader_utils_ref.rst4
-rw-r--r--cython/doc/rips_complex_ref.rst4
-rw-r--r--cython/doc/rips_complex_sum.inc (renamed from cython/doc/rips_complex_sum.rst)0
-rw-r--r--cython/doc/rips_complex_user.rst84
-rw-r--r--cython/doc/simplex_tree_ref.rst4
-rw-r--r--cython/doc/simplex_tree_sum.inc (renamed from cython/doc/simplex_tree_sum.rst)0
-rw-r--r--cython/doc/simplex_tree_user.rst6
-rw-r--r--cython/doc/strong_witness_complex_ref.rst4
-rw-r--r--cython/doc/tangential_complex_ref.rst4
-rw-r--r--cython/doc/tangential_complex_sum.inc (renamed from cython/doc/tangential_complex_sum.rst)0
-rw-r--r--cython/doc/tangential_complex_user.rst13
-rw-r--r--cython/doc/todos.rst4
-rw-r--r--cython/doc/witness_complex_ref.rst4
-rw-r--r--cython/doc/witness_complex_sum.inc (renamed from cython/doc/witness_complex_sum.rst)0
-rw-r--r--cython/doc/witness_complex_user.rst6
-rwxr-xr-xcython/example/alpha_complex_diagram_persistence_from_off_file_example.py8
-rwxr-xr-xcython/example/alpha_complex_from_points_example.py4
-rwxr-xr-xcython/example/alpha_rips_persistence_bottleneck_distance.py9
-rwxr-xr-xcython/example/bottleneck_basic_example.py6
-rwxr-xr-xcython/example/euclidean_strong_witness_complex_diagram_persistence_from_off_file_example.py8
-rwxr-xr-xcython/example/euclidean_witness_complex_diagram_persistence_from_off_file_example.py8
-rwxr-xr-xcython/example/gudhi_graphical_tools_example.py11
-rwxr-xr-xcython/example/periodic_cubical_complex_barcode_persistence_from_perseus_file_example.py4
-rwxr-xr-xcython/example/random_cubical_complex_persistence_example.py4
-rwxr-xr-xcython/example/rips_complex_diagram_persistence_from_correlation_matrix_file_example.py84
-rwxr-xr-xcython/example/rips_complex_diagram_persistence_from_distance_matrix_file_example.py15
-rwxr-xr-xcython/example/rips_complex_diagram_persistence_from_off_file_example.py11
-rwxr-xr-xcython/example/rips_complex_from_points_example.py4
-rwxr-xr-xcython/example/rips_persistence_diagram.py4
-rwxr-xr-xcython/example/simplex_tree_example.py4
-rwxr-xr-xcython/example/tangential_complex_plain_homology_from_off_file_example.py13
-rwxr-xr-xcython/example/witness_complex_from_nearest_landmark_table.py4
-rw-r--r--cython/gudhi.pyx.in4
-rw-r--r--cython/include/Alpha_complex_interface.h2
-rw-r--r--cython/include/Bottleneck_distance_interface.h2
-rw-r--r--cython/include/Cubical_complex_interface.h2
-rw-r--r--cython/include/Euclidean_strong_witness_complex_interface.h2
-rw-r--r--cython/include/Euclidean_witness_complex_interface.h2
-rw-r--r--cython/include/Off_reader_interface.h2
-rw-r--r--cython/include/Persistent_cohomology_interface.h28
-rw-r--r--cython/include/Reader_utils_interface.h2
-rw-r--r--cython/include/Rips_complex_interface.h19
-rw-r--r--cython/include/Simplex_tree_interface.h2
-rw-r--r--cython/include/Strong_witness_complex_interface.h2
-rw-r--r--cython/include/Subsampling_interface.h2
-rw-r--r--cython/include/Tangential_complex_interface.h15
-rw-r--r--cython/include/Witness_complex_interface.h2
-rw-r--r--cython/setup.py.in9
-rwxr-xr-xcython/test/test_alpha_complex.py4
-rwxr-xr-xcython/test/test_bottleneck_distance.py4
-rwxr-xr-xcython/test/test_cubical_complex.py15
-rwxr-xr-xcython/test/test_euclidean_witness_complex.py4
-rwxr-xr-xcython/test/test_reader_utils.py4
-rwxr-xr-xcython/test/test_rips_complex.py4
-rwxr-xr-xcython/test/test_simplex_tree.py48
-rwxr-xr-xcython/test/test_subsampling.py4
-rwxr-xr-xcython/test/test_tangential_complex.py6
-rwxr-xr-xcython/test/test_witness_complex.py4
-rw-r--r--data/correlation_matrix/lower_triangular_correlation_matrix.csv6
-rw-r--r--data/persistence_diagram/rips_on_tore3D_1307.pers2044
-rw-r--r--data/points/Kl.off4
-rw-r--r--doc/Alpha_complex/COPYRIGHT2
-rw-r--r--doc/Alpha_complex/Intro_alpha_complex.h90
-rw-r--r--doc/Bitmap_cubical_complex/COPYRIGHT2
-rw-r--r--doc/Bitmap_cubical_complex/Gudhi_Cubical_Complex_doc.h2
-rw-r--r--doc/Bottleneck_distance/COPYRIGHT2
-rw-r--r--doc/Bottleneck_distance/Intro_bottleneck_distance.h2
-rw-r--r--doc/Cech_complex/COPYRIGHT19
-rw-r--r--doc/Cech_complex/Intro_cech_complex.h114
-rw-r--r--doc/Cech_complex/cech_complex_representation.ipe330
-rw-r--r--doc/Cech_complex/cech_complex_representation.pngbin0 -> 39938 bytes
-rw-r--r--doc/Cech_complex/cech_one_skeleton.ipe314
-rw-r--r--doc/Cech_complex/cech_one_skeleton.pngbin0 -> 24662 bytes
-rw-r--r--doc/Contraction/COPYRIGHT2
-rw-r--r--doc/Nerve_GIC/COPYRIGHT2
-rw-r--r--doc/Nerve_GIC/Intro_graph_induced_complex.h2
-rw-r--r--doc/Persistence_representations/Persistence_representations_doc.h2
-rw-r--r--doc/Persistent_cohomology/COPYRIGHT2
-rw-r--r--doc/Persistent_cohomology/Intro_persistent_cohomology.h15
-rw-r--r--doc/Rips_complex/COPYRIGHT2
-rw-r--r--doc/Rips_complex/Intro_rips_complex.h121
-rw-r--r--doc/Simplex_tree/COPYRIGHT2
-rw-r--r--doc/Simplex_tree/Intro_simplex_tree.h2
-rw-r--r--doc/Skeleton_blocker/COPYRIGHT2
-rw-r--r--doc/Spatial_searching/Intro_spatial_searching.h2
-rw-r--r--doc/Subsampling/Intro_subsampling.h2
-rw-r--r--doc/Tangential_complex/COPYRIGHT2
-rw-r--r--doc/Tangential_complex/Intro_tangential_complex.h2
-rw-r--r--doc/Witness_complex/COPYRIGHT2
-rw-r--r--doc/common/file_formats.h2
-rw-r--r--doc/common/header.html111
-rw-r--r--doc/common/installation.h5
-rw-r--r--doc/common/main_page.h20
-rw-r--r--doc/common/offline_header.html41
-rw-r--r--example/Alpha_complex/CMakeLists.txt1
-rw-r--r--example/Bitmap_cubical_complex/CMakeLists.txt1
-rw-r--r--example/Bitmap_cubical_complex/Random_bitmap_cubical_complex.cpp2
-rw-r--r--example/Bottleneck_distance/CMakeLists.txt1
-rw-r--r--example/Bottleneck_distance/alpha_rips_persistence_bottleneck_distance.cpp2
-rw-r--r--example/Bottleneck_distance/bottleneck_basic_example.cpp2
-rw-r--r--example/Cech_complex/CMakeLists.txt16
-rw-r--r--example/Cech_complex/cech_complex_example_from_points.cpp54
-rw-r--r--example/Cech_complex/cech_complex_example_from_points_for_doc.txt31
-rw-r--r--example/Cech_complex/cech_complex_step_by_step.cpp166
-rw-r--r--example/Contraction/CMakeLists.txt1
-rw-r--r--example/Contraction/Garland_heckbert.cpp2
-rw-r--r--example/Contraction/Garland_heckbert/Error_quadric.h2
-rw-r--r--example/Contraction/Rips_contraction.cpp2
-rw-r--r--example/Nerve_GIC/CMakeLists.txt10
-rw-r--r--example/Nerve_GIC/CoordGIC.cpp5
-rw-r--r--example/Nerve_GIC/FuncGIC.cpp2
-rw-r--r--example/Persistence_representations/CMakeLists.txt9
-rw-r--r--example/Persistence_representations/persistence_heat_maps.cpp2
-rw-r--r--example/Persistence_representations/persistence_intervals.cpp2
-rw-r--r--example/Persistence_representations/persistence_landscape.cpp2
-rw-r--r--example/Persistence_representations/persistence_landscape_on_grid.cpp2
-rw-r--r--example/Persistence_representations/persistence_vectors.cpp2
-rw-r--r--example/Persistent_cohomology/CMakeLists.txt1
-rw-r--r--example/Persistent_cohomology/custom_persistence_sort.cpp2
-rw-r--r--example/Persistent_cohomology/persistence_from_file.cpp2
-rw-r--r--example/Persistent_cohomology/persistence_from_simple_simplex_tree.cpp2
-rw-r--r--example/Persistent_cohomology/plain_homology.cpp2
-rw-r--r--example/Persistent_cohomology/rips_multifield_persistence.cpp2
-rw-r--r--example/Persistent_cohomology/rips_persistence_step_by_step.cpp2
-rw-r--r--example/Persistent_cohomology/rips_persistence_via_boundary_matrix.cpp2
-rw-r--r--example/Rips_complex/CMakeLists.txt14
-rw-r--r--example/Rips_complex/example_one_skeleton_rips_from_correlation_matrix.cpp81
-rw-r--r--example/Rips_complex/example_sparse_rips.cpp30
-rw-r--r--example/Rips_complex/one_skeleton_rips_from_correlation_matrix_for_doc.txt17
-rw-r--r--example/Simplex_tree/CMakeLists.txt1
-rw-r--r--example/Simplex_tree/cech_complex_cgal_mini_sphere_3d.cpp4
-rw-r--r--example/Simplex_tree/example_alpha_shapes_3_simplex_tree_from_off_file.cpp2
-rw-r--r--example/Simplex_tree/graph_expansion_with_blocker.cpp46
-rw-r--r--example/Simplex_tree/mini_simplex_tree.cpp2
-rw-r--r--example/Simplex_tree/simple_simplex_tree.cpp2
-rw-r--r--example/Simplex_tree/simplex_tree_from_cliques_of_graph.cpp2
-rw-r--r--example/Skeleton_blocker/CMakeLists.txt1
-rw-r--r--example/Skeleton_blocker/Skeleton_blocker_from_simplices.cpp2
-rw-r--r--example/Skeleton_blocker/Skeleton_blocker_iteration.cpp2
-rw-r--r--example/Skeleton_blocker/Skeleton_blocker_link.cpp2
-rw-r--r--example/Spatial_searching/CMakeLists.txt1
-rw-r--r--example/Subsampling/CMakeLists.txt1
-rw-r--r--example/Tangential_complex/CMakeLists.txt1
-rw-r--r--example/Witness_complex/CMakeLists.txt1
-rw-r--r--example/Witness_complex/example_nearest_landmark_table.cpp22
-rw-r--r--example/Witness_complex/example_strong_witness_complex_off.cpp22
-rw-r--r--example/Witness_complex/example_witness_complex_sphere.cpp22
-rw-r--r--example/Witness_complex/generators.h8
-rw-r--r--example/common/CMakeLists.txt12
-rw-r--r--example/common/example_CGAL_3D_points_off_reader.cpp6
-rw-r--r--example/common/example_CGAL_points_off_reader.cpp6
-rw-r--r--example/common/example_vector_double_points_off_reader.cpp14
-rw-r--r--example/common/vectordoubleoffreader_result.txt (renamed from example/common/cgaloffreader_result.txt)0
-rw-r--r--include/gudhi/Active_witness/Active_witness.h2
-rw-r--r--include/gudhi/Active_witness/Active_witness_iterator.h2
-rw-r--r--include/gudhi/Alpha_complex.h6
-rw-r--r--include/gudhi/Bitmap_cubical_complex.h4
-rw-r--r--include/gudhi/Bitmap_cubical_complex/counter.h2
-rw-r--r--include/gudhi/Bitmap_cubical_complex_base.h6
-rw-r--r--include/gudhi/Bitmap_cubical_complex_periodic_boundary_conditions_base.h4
-rw-r--r--include/gudhi/Bottleneck.h10
-rw-r--r--include/gudhi/Cech_complex.h130
-rw-r--r--include/gudhi/Cech_complex_blocker.h91
-rw-r--r--include/gudhi/Clock.h2
-rw-r--r--include/gudhi/Contraction/Edge_profile.h2
-rw-r--r--include/gudhi/Contraction/policies/Contraction_visitor.h2
-rw-r--r--include/gudhi/Contraction/policies/Cost_policy.h2
-rw-r--r--include/gudhi/Contraction/policies/Dummy_valid_contraction.h2
-rw-r--r--include/gudhi/Contraction/policies/Edge_length_cost.h2
-rw-r--r--include/gudhi/Contraction/policies/First_vertex_placement.h2
-rw-r--r--include/gudhi/Contraction/policies/Link_condition_valid_contraction.h2
-rw-r--r--include/gudhi/Contraction/policies/Middle_placement.h2
-rw-r--r--include/gudhi/Contraction/policies/Placement_policy.h2
-rw-r--r--include/gudhi/Contraction/policies/Valid_contraction_policy.h2
-rw-r--r--include/gudhi/Debug_utils.h2
-rw-r--r--include/gudhi/Edge_contraction.h2
-rw-r--r--include/gudhi/Euclidean_strong_witness_complex.h2
-rw-r--r--include/gudhi/Euclidean_witness_complex.h2
-rw-r--r--include/gudhi/GIC.h333
-rw-r--r--include/gudhi/Graph_matching.h2
-rw-r--r--include/gudhi/Hasse_complex.h2
-rw-r--r--include/gudhi/Internal_point.h2
-rw-r--r--include/gudhi/Kd_tree_search.h2
-rw-r--r--include/gudhi/Miniball.COPYRIGHT4
-rw-r--r--include/gudhi/Miniball.README26
-rw-r--r--include/gudhi/Miniball.hpp523
-rw-r--r--include/gudhi/Neighbors_finder.h2
-rw-r--r--include/gudhi/Null_output_iterator.h2
-rw-r--r--include/gudhi/Off_reader.h31
-rw-r--r--include/gudhi/PSSK.h2
-rw-r--r--include/gudhi/Persistence_graph.h2
-rw-r--r--include/gudhi/Persistence_heat_maps.h2
-rw-r--r--include/gudhi/Persistence_intervals.h2
-rw-r--r--include/gudhi/Persistence_intervals_with_distances.h2
-rw-r--r--include/gudhi/Persistence_landscape.h61
-rw-r--r--include/gudhi/Persistence_landscape_on_grid.h2
-rw-r--r--include/gudhi/Persistence_vectors.h2
-rw-r--r--include/gudhi/Persistent_cohomology.h4
-rw-r--r--include/gudhi/Persistent_cohomology/Field_Zp.h2
-rw-r--r--include/gudhi/Persistent_cohomology/Multi_field.h2
-rw-r--r--include/gudhi/Persistent_cohomology/Persistent_cohomology_column.h2
-rw-r--r--include/gudhi/Point.h2
-rw-r--r--include/gudhi/Points_3D_off_io.h2
-rw-r--r--include/gudhi/Points_off_io.h6
-rw-r--r--include/gudhi/Rips_complex.h2
-rw-r--r--include/gudhi/Simple_object_pool.h2
-rw-r--r--include/gudhi/Simplex_tree.h13
-rw-r--r--include/gudhi/Simplex_tree/Simplex_tree_iterators.h12
-rw-r--r--include/gudhi/Simplex_tree/Simplex_tree_node_explicit_storage.h2
-rw-r--r--include/gudhi/Simplex_tree/Simplex_tree_siblings.h2
-rw-r--r--include/gudhi/Simplex_tree/indexing_tag.h2
-rw-r--r--include/gudhi/Skeleton_blocker.h2
-rw-r--r--include/gudhi/Skeleton_blocker/Skeleton_blocker_complex_visitor.h2
-rw-r--r--include/gudhi/Skeleton_blocker/Skeleton_blocker_link_superior.h2
-rw-r--r--include/gudhi/Skeleton_blocker/Skeleton_blocker_off_io.h2
-rw-r--r--include/gudhi/Skeleton_blocker/Skeleton_blocker_simple_geometric_traits.h2
-rw-r--r--include/gudhi/Skeleton_blocker/Skeleton_blocker_simple_traits.h2
-rw-r--r--include/gudhi/Skeleton_blocker/Skeleton_blocker_simplex.h2
-rw-r--r--include/gudhi/Skeleton_blocker/Skeleton_blocker_sub_complex.h2
-rw-r--r--include/gudhi/Skeleton_blocker/internal/Top_faces.h2
-rw-r--r--include/gudhi/Skeleton_blocker/internal/Trie.h2
-rw-r--r--include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_blockers_iterators.h2
-rw-r--r--include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_edges_iterators.h2
-rw-r--r--include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_iterators.h2
-rw-r--r--include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_simplices_iterators.h2
-rw-r--r--include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_triangles_iterators.h2
-rw-r--r--include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_vertices_iterators.h2
-rw-r--r--include/gudhi/Skeleton_blocker_complex.h2
-rw-r--r--include/gudhi/Skeleton_blocker_contractor.h2
-rw-r--r--include/gudhi/Skeleton_blocker_geometric_complex.h2
-rw-r--r--include/gudhi/Skeleton_blocker_link_complex.h2
-rw-r--r--include/gudhi/Skeleton_blocker_simplifiable_complex.h2
-rw-r--r--include/gudhi/Sparse_rips_complex.h175
-rw-r--r--include/gudhi/Strong_witness_complex.h2
-rw-r--r--include/gudhi/Tangential_complex.h7
-rw-r--r--include/gudhi/Tangential_complex/Simplicial_complex.h2
-rw-r--r--include/gudhi/Tangential_complex/config.h2
-rw-r--r--include/gudhi/Tangential_complex/utilities.h2
-rw-r--r--include/gudhi/Unitary_tests_utils.h2
-rw-r--r--include/gudhi/Witness_complex.h2
-rw-r--r--include/gudhi/Witness_complex/all_faces_in.h2
-rw-r--r--include/gudhi/allocator.h2
-rw-r--r--include/gudhi/choose_n_farthest_points.h2
-rw-r--r--include/gudhi/common_persistence_representations.h2
-rw-r--r--include/gudhi/console_color.h2
-rw-r--r--include/gudhi/distance_functions.h52
-rw-r--r--include/gudhi/graph_simplicial_complex.h8
-rw-r--r--include/gudhi/pick_n_random_points.h2
-rw-r--r--include/gudhi/random_point_generators.h5
-rw-r--r--include/gudhi/read_persistence_from_file.h8
-rw-r--r--include/gudhi/reader_utils.h2
-rw-r--r--include/gudhi/sparsify_point_set.h2
-rw-r--r--include/gudhi/writing_persistence_to_file.h117
-rw-r--r--include/gudhi_patches/Bottleneck_distance_CGAL_patches.txt3
-rw-r--r--include/gudhi_patches/CGAL/Convex_hull.h56
-rw-r--r--include/gudhi_patches/CGAL/Delaunay_triangulation.h933
-rw-r--r--include/gudhi_patches/CGAL/Epeck_d.h53
-rw-r--r--include/gudhi_patches/CGAL/Epick_d.h71
-rw-r--r--include/gudhi_patches/CGAL/IO/Triangulation_off_ostream.h320
-rw-r--r--include/gudhi_patches/CGAL/Kd_tree.h582
-rw-r--r--include/gudhi_patches/CGAL/Kd_tree_node.h586
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/Cartesian_LA_base.h177
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/Cartesian_LA_functors.h344
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/Cartesian_base.h40
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/Cartesian_change_FT.h117
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/Cartesian_complete.h33
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/Cartesian_filter_K.h79
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/Cartesian_filter_NT.h93
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/Cartesian_per_dimension.h33
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/Cartesian_static_filters.h95
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/Coaffine.h330
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/Define_kernel_types.h50
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/Dimension_base.h49
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/Filtered_predicate2.h137
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/KernelD_converter.h199
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/Kernel_2_interface.h104
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/Kernel_3_interface.h102
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/Kernel_d_interface.h298
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/Kernel_object_converter.h134
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/LA_eigen/LA.h175
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/LA_eigen/constructors.h162
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/Lazy_cartesian.h188
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/Types/Aff_transformation.h59
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/Types/Hyperplane.h159
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/Types/Iso_box.h88
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/Types/Line.h66
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/Types/Ray.h66
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/Types/Segment.h121
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/Types/Sphere.h132
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/Types/Weighted_point.h205
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/Vector/array.h165
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/Vector/avx4.h213
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/Vector/determinant_of_iterator_to_points_from_iterator_to_vectors.h76
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/Vector/determinant_of_iterator_to_points_from_points.h211
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/Vector/determinant_of_iterator_to_vectors_from_vectors.h201
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/Vector/determinant_of_points_from_vectors.h164
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/Vector/determinant_of_vectors_small_dim.h58
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/Vector/determinant_of_vectors_small_dim_internal.h164
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/Vector/mix.h46
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/Vector/sse2.h145
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/Vector/v2int.h181
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/Vector/vector.h167
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Cartesian_wrap.h305
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Hyperplane_d.h131
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Point_d.h284
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Ref_count_obj.h120
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Segment_d.h133
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Sphere_d.h130
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Vector_d.h266
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Weighted_point_d.h129
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/function_objects_cartesian.h1355
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/functor_properties.h40
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/functor_tags.h363
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/static_int.h61
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/store_kernel.h104
-rw-r--r--include/gudhi_patches/CGAL/NewKernel_d/utils.h306
-rw-r--r--include/gudhi_patches/CGAL/Orthogonal_incremental_neighbor_search.h620
-rw-r--r--include/gudhi_patches/CGAL/Regular_triangulation.h1169
-rw-r--r--include/gudhi_patches/CGAL/Regular_triangulation_traits_adapter.h288
-rw-r--r--include/gudhi_patches/CGAL/TDS_full_cell_default_storage_policy.h99
-rw-r--r--include/gudhi_patches/CGAL/TDS_full_cell_mirror_storage_policy.h71
-rw-r--r--include/gudhi_patches/CGAL/Triangulation.h1424
-rw-r--r--include/gudhi_patches/CGAL/Triangulation_data_structure.h1603
-rw-r--r--include/gudhi_patches/CGAL/Triangulation_ds_full_cell.h311
-rw-r--r--include/gudhi_patches/CGAL/Triangulation_ds_vertex.h154
-rw-r--r--include/gudhi_patches/CGAL/Triangulation_face.h111
-rw-r--r--include/gudhi_patches/CGAL/Triangulation_full_cell.h148
-rw-r--r--include/gudhi_patches/CGAL/Triangulation_vertex.h128
-rw-r--r--include/gudhi_patches/CGAL/argument_swaps.h88
-rw-r--r--include/gudhi_patches/CGAL/determinant_of_vectors.h117
-rw-r--r--include/gudhi_patches/CGAL/internal/Combination_enumerator.h148
-rw-r--r--include/gudhi_patches/CGAL/internal/Static_or_dynamic_array.h116
-rw-r--r--include/gudhi_patches/CGAL/internal/Triangulation/Dummy_TDS.h49
-rw-r--r--include/gudhi_patches/CGAL/internal/Triangulation/Triangulation_ds_iterators.h154
-rw-r--r--include/gudhi_patches/CGAL/internal/Triangulation/utilities.h154
-rw-r--r--include/gudhi_patches/CGAL/iterator_from_indices.h75
-rw-r--r--include/gudhi_patches/CGAL/transforming_iterator.h123
-rw-r--r--include/gudhi_patches/CGAL/transforming_pair_iterator.h127
-rw-r--r--include/gudhi_patches/CGAL/typeset.h117
-rw-r--r--include/gudhi_patches/Tangential_complex_CGAL_patches.txt82
-rw-r--r--utilities/Alpha_complex/CMakeLists.txt1
-rw-r--r--utilities/Alpha_complex/alpha_complex_3d_helper.h2
-rw-r--r--utilities/Alpha_complex/alpha_complex_3d_persistence.cpp4
-rw-r--r--utilities/Alpha_complex/alpha_complex_persistence.cpp22
-rw-r--r--utilities/Alpha_complex/alphacomplex.md13
-rw-r--r--utilities/Alpha_complex/exact_alpha_complex_3d_persistence.cpp4
-rw-r--r--utilities/Alpha_complex/periodic_alpha_complex_3d_persistence.cpp4
-rw-r--r--utilities/Alpha_complex/weighted_alpha_complex_3d_persistence.cpp4
-rw-r--r--utilities/Alpha_complex/weighted_periodic_alpha_complex_3d_persistence.cpp4
-rw-r--r--utilities/Bitmap_cubical_complex/CMakeLists.txt1
-rw-r--r--utilities/Bitmap_cubical_complex/cubical_complex_persistence.cpp2
-rw-r--r--utilities/Bitmap_cubical_complex/cubicalcomplex.md12
-rw-r--r--utilities/Bitmap_cubical_complex/periodic_cubical_complex_persistence.cpp2
-rw-r--r--utilities/Bottleneck_distance/CMakeLists.txt1
-rw-r--r--utilities/Bottleneck_distance/bottleneck_distance.cpp2
-rw-r--r--utilities/Bottleneck_distance/bottleneckdistance.md12
-rw-r--r--utilities/Cech_complex/CMakeLists.txt14
-rw-r--r--utilities/Cech_complex/cech_persistence.cpp136
-rw-r--r--utilities/Cech_complex/cechcomplex.md38
-rw-r--r--utilities/Nerve_GIC/CMakeLists.txt5
-rwxr-xr-xutilities/Nerve_GIC/KeplerMapperVisuFromTxtFile.py4
-rw-r--r--utilities/Nerve_GIC/Nerve.cpp2
-rw-r--r--utilities/Nerve_GIC/VoronoiGIC.cpp2
-rw-r--r--utilities/Nerve_GIC/covercomplex.md13
-rw-r--r--utilities/Persistence_representations/CMakeLists.txt6
-rw-r--r--utilities/Persistence_representations/persistence_heat_maps/CMakeLists.txt1
-rw-r--r--utilities/Persistence_representations/persistence_heat_maps/average_persistence_heat_maps.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_heat_maps/compute_distance_of_persistence_heat_maps.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_heat_maps/compute_scalar_product_of_persistence_heat_maps.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_heat_maps/create_p_h_m_weighted_by_arctan_of_their_persistence.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_heat_maps/create_p_h_m_weighted_by_distance_from_diagonal.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_heat_maps/create_p_h_m_weighted_by_squared_diag_distance.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_heat_maps/create_persistence_heat_maps.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_heat_maps/create_pssk.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_heat_maps/plot_persistence_heat_map.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_intervals/CMakeLists.txt7
-rw-r--r--utilities/Persistence_representations/persistence_intervals/compute_birth_death_range_in_persistence_diagram.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_intervals/compute_bottleneck_distance.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_intervals/compute_number_of_dominant_intervals.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_intervals/plot_histogram_of_intervals_lengths.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_intervals/plot_persistence_Betti_numbers.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_intervals/plot_persistence_intervals.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_landscapes/CMakeLists.txt1
-rw-r--r--utilities/Persistence_representations/persistence_landscapes/average_landscapes.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_landscapes/compute_distance_of_landscapes.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_landscapes/compute_scalar_product_of_landscapes.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_landscapes/create_landscapes.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_landscapes/plot_landscapes.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_landscapes_on_grid/CMakeLists.txt1
-rw-r--r--utilities/Persistence_representations/persistence_landscapes_on_grid/average_landscapes_on_grid.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_landscapes_on_grid/compute_distance_of_landscapes_on_grid.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_landscapes_on_grid/compute_scalar_product_of_landscapes_on_grid.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_landscapes_on_grid/create_landscapes_on_grid.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_landscapes_on_grid/plot_landscapes_on_grid.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_vectors/CMakeLists.txt1
-rw-r--r--utilities/Persistence_representations/persistence_vectors/average_persistence_vectors.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_vectors/compute_distance_of_persistence_vectors.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_vectors/compute_scalar_product_of_persistence_vectors.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_vectors/create_persistence_vectors.cpp2
-rw-r--r--utilities/Persistence_representations/persistence_vectors/plot_persistence_vectors.cpp2
-rw-r--r--utilities/Rips_complex/CMakeLists.txt15
-rw-r--r--utilities/Rips_complex/rips_correlation_matrix_persistence.cpp171
-rw-r--r--utilities/Rips_complex/rips_distance_matrix_persistence.cpp2
-rw-r--r--utilities/Rips_complex/rips_persistence.cpp2
-rw-r--r--utilities/Rips_complex/ripscomplex.md66
-rw-r--r--utilities/Rips_complex/sparse_rips_persistence.cpp133
-rw-r--r--utilities/Witness_complex/CMakeLists.txt1
-rw-r--r--utilities/Witness_complex/strong_witness_persistence.cpp2
-rw-r--r--utilities/Witness_complex/weak_witness_persistence.cpp2
-rw-r--r--utilities/Witness_complex/witnesscomplex.md13
-rw-r--r--utilities/common/CMakeLists.txt1
-rw-r--r--utilities/common/off_file_from_shape_generator.cpp2
-rw-r--r--utilities/common/pointsetgenerator.md14
518 files changed, 6916 insertions, 20701 deletions
diff --git a/CMakeGUDHIVersion.txt b/CMakeGUDHIVersion.txt
index 5e71f7eb..6811d7e1 100644
--- a/CMakeGUDHIVersion.txt
+++ b/CMakeGUDHIVersion.txt
@@ -1,5 +1,5 @@
set (GUDHI_MAJOR_VERSION 2)
-set (GUDHI_MINOR_VERSION 1)
+set (GUDHI_MINOR_VERSION 2)
set (GUDHI_PATCH_VERSION 0)
set(GUDHI_VERSION ${GUDHI_MAJOR_VERSION}.${GUDHI_MINOR_VERSION}.${GUDHI_PATCH_VERSION})
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 94587044..c60346d5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,12 +1,19 @@
-cmake_minimum_required(VERSION 2.6)
-project(GUDHI)
+cmake_minimum_required(VERSION 3.1)
-include("CMakeGUDHIVersion.txt")
+project(GUDHI)
-enable_testing()
+include(CMakeGUDHIVersion.txt)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules/")
+# This variable is used by Cython CMakeLists.txt and by GUDHI_third_party_libraries to know its path
+set(GUDHI_CYTHON_PATH "cython")
+
+# For third parties libraries management - To be done last as CGAL updates CMAKE_MODULE_PATH
+include(GUDHI_third_party_libraries NO_POLICY_SCOPE)
+
+include(GUDHI_compilation_flags)
+
# Add your new module in the list, order is not important
include(GUDHI_modules)
@@ -14,6 +21,7 @@ add_gudhi_module(common)
add_gudhi_module(Alpha_complex)
add_gudhi_module(Bitmap_cubical_complex)
add_gudhi_module(Bottleneck_distance)
+add_gudhi_module(Cech_complex)
add_gudhi_module(Contraction)
add_gudhi_module(Hasse_complex)
add_gudhi_module(Persistence_representations)
@@ -33,30 +41,6 @@ message("++ GUDHI_MODULES list is:\"${GUDHI_MODULES}\"")
set(GUDHI_USER_VERSION_DIR ${CMAKE_SOURCE_DIR})
include(GUDHI_doxygen_target)
-# This variable is used by Cython CMakeLists.txt to know its path
-set(GUDHI_CYTHON_PATH "cython")
-# For third parties libraries management - To be done last as CGAL updates CMAKE_MODULE_PATH
-include(GUDHI_third_party_libraries)
-
-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} -std=c++11 -Wall -pedantic")
-endif()
-
-if(CMAKE_BUILD_TYPE MATCHES Debug)
- message("++ Debug compilation flags are: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}")
-else()
- message("++ Release compilation flags are: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}")
-endif()
-
-if (DEBUG_TRACES)
- message(STATUS "DEBUG_TRACES are activated")
- # For programs to be more verbose
- add_definitions(-DDEBUG_TRACES)
-endif()
-
#---------------------------------------------------------------------------------------
# Gudhi compilation part
include_directories(include)
diff --git a/Doxyfile b/Doxyfile
index f1981e2e..020667e9 100644
--- a/Doxyfile
+++ b/Doxyfile
@@ -38,7 +38,7 @@ PROJECT_NAME = "GUDHI"
# could be handy for archiving the generated documentation or if some version
# control system is used.
-PROJECT_NUMBER = "2.1.0"
+PROJECT_NUMBER = "2.2.0"
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
@@ -843,7 +843,8 @@ EXAMPLE_RECURSIVE = NO
IMAGE_PATH = doc/Skeleton_blocker/ \
doc/Alpha_complex/ \
doc/common/ \
- doc/Contraction/ \
+ doc/Cech_complex/ \
+ doc/Contraction/ \
doc/Simplex_tree/ \
doc/Persistent_cohomology/ \
doc/Witness_complex/ \
diff --git a/GudhUI/CMakeLists.txt b/GudhUI/CMakeLists.txt
index 2503a03e..b357b8f7 100644
--- a/GudhUI/CMakeLists.txt
+++ b/GudhUI/CMakeLists.txt
@@ -1,4 +1,3 @@
-cmake_minimum_required(VERSION 2.8)
project(GudhUI)
# Need to find OpenGL first as find_package(Qt5) tries to #include"GL/gl.h" on some platforms
@@ -38,4 +37,4 @@ if (OPENGL_FOUND)
install(TARGETS GudhUI DESTINATION bin)
endif()
-endif(OPENGL_FOUND) \ No newline at end of file
+endif(OPENGL_FOUND)
diff --git a/GudhUI/gui/MainWindow.cpp b/GudhUI/gui/MainWindow.cpp
index 779ccd33..b11b80e9 100644
--- a/GudhUI/gui/MainWindow.cpp
+++ b/GudhUI/gui/MainWindow.cpp
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/GudhUI/gui/MainWindow.h b/GudhUI/gui/MainWindow.h
index 15664dcb..6076c2ee 100644
--- a/GudhUI/gui/MainWindow.h
+++ b/GudhUI/gui/MainWindow.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/GudhUI/gui/Menu_edge_contraction.cpp b/GudhUI/gui/Menu_edge_contraction.cpp
index a679b0bf..041bdf9e 100644
--- a/GudhUI/gui/Menu_edge_contraction.cpp
+++ b/GudhUI/gui/Menu_edge_contraction.cpp
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/GudhUI/gui/Menu_edge_contraction.h b/GudhUI/gui/Menu_edge_contraction.h
index 2d5640e8..0ef7b267 100644
--- a/GudhUI/gui/Menu_edge_contraction.h
+++ b/GudhUI/gui/Menu_edge_contraction.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/GudhUI/gui/Menu_k_nearest_neighbors.cpp b/GudhUI/gui/Menu_k_nearest_neighbors.cpp
index e24865f2..b1ad15c8 100644
--- a/GudhUI/gui/Menu_k_nearest_neighbors.cpp
+++ b/GudhUI/gui/Menu_k_nearest_neighbors.cpp
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/GudhUI/gui/Menu_k_nearest_neighbors.h b/GudhUI/gui/Menu_k_nearest_neighbors.h
index 77303b67..56b5b63d 100644
--- a/GudhUI/gui/Menu_k_nearest_neighbors.h
+++ b/GudhUI/gui/Menu_k_nearest_neighbors.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/GudhUI/gui/Menu_persistence.cpp b/GudhUI/gui/Menu_persistence.cpp
index 016c076b..ec990559 100644
--- a/GudhUI/gui/Menu_persistence.cpp
+++ b/GudhUI/gui/Menu_persistence.cpp
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/GudhUI/gui/Menu_persistence.h b/GudhUI/gui/Menu_persistence.h
index 1a2a2408..32f0c5ca 100644
--- a/GudhUI/gui/Menu_persistence.h
+++ b/GudhUI/gui/Menu_persistence.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/GudhUI/gui/Menu_uniform_neighbors.cpp b/GudhUI/gui/Menu_uniform_neighbors.cpp
index 20e4f98f..7f392b6c 100644
--- a/GudhUI/gui/Menu_uniform_neighbors.cpp
+++ b/GudhUI/gui/Menu_uniform_neighbors.cpp
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/GudhUI/gui/Menu_uniform_neighbors.h b/GudhUI/gui/Menu_uniform_neighbors.h
index 61316966..88a3823b 100644
--- a/GudhUI/gui/Menu_uniform_neighbors.h
+++ b/GudhUI/gui/Menu_uniform_neighbors.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/GudhUI/gui/gudhui.cpp b/GudhUI/gui/gudhui.cpp
index 276c4a5f..2a100fd5 100644
--- a/GudhUI/gui/gudhui.cpp
+++ b/GudhUI/gui/gudhui.cpp
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France)
+ * Copyright (C) 2014 Inria
*
* 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
@@ -28,7 +28,7 @@
int main(int argc, char** argv) {
QApplication application(argc, argv);
application.setOrganizationDomain("inria.fr");
- application.setOrganizationName("INRIA");
+ application.setOrganizationName("Inria");
application.setApplicationName("GudhUI");
MainWindow mw;
diff --git a/GudhUI/model/Complex_typedefs.h b/GudhUI/model/Complex_typedefs.h
index a4df2c94..347db1e3 100644
--- a/GudhUI/model/Complex_typedefs.h
+++ b/GudhUI/model/Complex_typedefs.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/GudhUI/model/Model.h b/GudhUI/model/Model.h
index fc284cc6..1d5cc087 100644
--- a/GudhUI/model/Model.h
+++ b/GudhUI/model/Model.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France)
+ * Copyright (C) 2014 Inria
*
* 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
@@ -74,7 +74,7 @@ class CGAL_geometric_flag_complex_wrapper {
// std::cout << "size:" << vertices.size() << std::endl;
for (std::size_t i = 0; i < vertices.size(); ++i)
for (std::size_t j = i + 1; j < vertices.size(); ++j)
- complex_.add_edge(Vertex_handle(vertices[i]), Vertex_handle(vertices[j]));
+ complex_.add_edge_without_blockers(Vertex_handle(vertices[i]), Vertex_handle(vertices[j]));
}
}
diff --git a/GudhUI/utils/Bar_code_persistence.h b/GudhUI/utils/Bar_code_persistence.h
index b527d684..49c87b3c 100644
--- a/GudhUI/utils/Bar_code_persistence.h
+++ b/GudhUI/utils/Bar_code_persistence.h
@@ -1,3 +1,26 @@
+/* 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): David Salinas
+ *
+ * Copyright (C) 2014 Inria
+ *
+ * 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/>.
+ *
+ */
+
#include <math.h> // isfinite
#include <QtGui/QApplication>
diff --git a/GudhUI/utils/Critical_points.h b/GudhUI/utils/Critical_points.h
index 2a18e079..fbd690f8 100644
--- a/GudhUI/utils/Critical_points.h
+++ b/GudhUI/utils/Critical_points.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France)
+ * Copyright (C) 2014 Inria
*
* 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
@@ -79,7 +79,7 @@ template<typename SkBlComplex> class Critical_points {
unsigned pos = 0;
for (Edge e : edges) {
std::cout << "edge " << pos++ << "/" << edges.size() << "\n";
- auto eh = filled_complex_.add_edge(e.first, e.second);
+ auto eh = filled_complex_.add_edge_without_blockers(e.first, e.second);
int is_contractible(is_link_reducible(eh));
switch (is_contractible) {
diff --git a/GudhUI/utils/Edge_collapsor.h b/GudhUI/utils/Edge_collapsor.h
index 151e9b01..b3cc7df7 100644
--- a/GudhUI/utils/Edge_collapsor.h
+++ b/GudhUI/utils/Edge_collapsor.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/GudhUI/utils/Edge_contractor.h b/GudhUI/utils/Edge_contractor.h
index 8a29ff4b..090baabe 100644
--- a/GudhUI/utils/Edge_contractor.h
+++ b/GudhUI/utils/Edge_contractor.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/GudhUI/utils/Furthest_point_epsilon_net.h b/GudhUI/utils/Furthest_point_epsilon_net.h
index 98346daa..dbb6661c 100644
--- a/GudhUI/utils/Furthest_point_epsilon_net.h
+++ b/GudhUI/utils/Furthest_point_epsilon_net.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/GudhUI/utils/Is_manifold.h b/GudhUI/utils/Is_manifold.h
index d0974463..732df607 100644
--- a/GudhUI/utils/Is_manifold.h
+++ b/GudhUI/utils/Is_manifold.h
@@ -7,7 +7,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/GudhUI/utils/K_nearest_builder.h b/GudhUI/utils/K_nearest_builder.h
index 7be0a4f4..14851d96 100644
--- a/GudhUI/utils/K_nearest_builder.h
+++ b/GudhUI/utils/K_nearest_builder.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France)
+ * Copyright (C) 2014 Inria
*
* 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
@@ -81,7 +81,7 @@ template<typename SkBlComplex> class K_nearest_builder {
for (auto it = ++search.begin(); it != search.end(); ++it) {
Vertex_handle q(std::get<1>(it->first));
if (p != q && complex_.contains_vertex(p) && complex_.contains_vertex(q))
- complex_.add_edge(p, q);
+ complex_.add_edge_without_blockers(p, q);
}
}
}
diff --git a/GudhUI/utils/Lloyd_builder.h b/GudhUI/utils/Lloyd_builder.h
index 18ec9fac..67595d33 100644
--- a/GudhUI/utils/Lloyd_builder.h
+++ b/GudhUI/utils/Lloyd_builder.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/GudhUI/utils/MClock.h b/GudhUI/utils/MClock.h
index e8d8918a..992f6fa5 100644
--- a/GudhUI/utils/MClock.h
+++ b/GudhUI/utils/MClock.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/GudhUI/utils/Persistence_compute.h b/GudhUI/utils/Persistence_compute.h
index 2dc03c8e..c8afded9 100644
--- a/GudhUI/utils/Persistence_compute.h
+++ b/GudhUI/utils/Persistence_compute.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/GudhUI/utils/Rips_builder.h b/GudhUI/utils/Rips_builder.h
index b22f4db6..ed62c1c0 100644
--- a/GudhUI/utils/Rips_builder.h
+++ b/GudhUI/utils/Rips_builder.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France)
+ * Copyright (C) 2014 Inria
*
* 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
@@ -60,7 +60,7 @@ template<typename SkBlComplex> class Rips_builder {
std::cout.flush();
for (auto q = p; ++q != vertices.end(); /**/)
if (squared_eucl_distance(complex_.point(*p), complex_.point(*q)) < 4 * alpha * alpha)
- complex_.add_edge(*p, *q);
+ complex_.add_edge_without_blockers(*p, *q);
}
std::cout << std::endl;
}
diff --git a/GudhUI/utils/UI_utils.h b/GudhUI/utils/UI_utils.h
index 9cc209d3..67a02869 100644
--- a/GudhUI/utils/UI_utils.h
+++ b/GudhUI/utils/UI_utils.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/GudhUI/utils/Vertex_collapsor.h b/GudhUI/utils/Vertex_collapsor.h
index 568dab2f..fca57f7d 100644
--- a/GudhUI/utils/Vertex_collapsor.h
+++ b/GudhUI/utils/Vertex_collapsor.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/GudhUI/view/Color.h b/GudhUI/view/Color.h
index ba0592e1..808dc2d8 100644
--- a/GudhUI/view/Color.h
+++ b/GudhUI/view/Color.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/GudhUI/view/FirstCoordProjector.h b/GudhUI/view/FirstCoordProjector.h
index 1333f5d3..3f8a6fd9 100644
--- a/GudhUI/view/FirstCoordProjector.h
+++ b/GudhUI/view/FirstCoordProjector.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/GudhUI/view/Projector3D.h b/GudhUI/view/Projector3D.h
index 2a756541..a1421f51 100644
--- a/GudhUI/view/Projector3D.h
+++ b/GudhUI/view/Projector3D.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/GudhUI/view/View_parameter.h b/GudhUI/view/View_parameter.h
index 9805abc2..578a0268 100644
--- a/GudhUI/view/View_parameter.h
+++ b/GudhUI/view/View_parameter.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/GudhUI/view/Viewer.cpp b/GudhUI/view/Viewer.cpp
index c6c2b345..42e35d6c 100644
--- a/GudhUI/view/Viewer.cpp
+++ b/GudhUI/view/Viewer.cpp
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/GudhUI/view/Viewer.h b/GudhUI/view/Viewer.h
index 797ddc53..414044ef 100644
--- a/GudhUI/view/Viewer.h
+++ b/GudhUI/view/Viewer.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/GudhUI/view/Viewer_instructor.cpp b/GudhUI/view/Viewer_instructor.cpp
index 1ddd4d8b..a9dc4525 100644
--- a/GudhUI/view/Viewer_instructor.cpp
+++ b/GudhUI/view/Viewer_instructor.cpp
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/GudhUI/view/Viewer_instructor.h b/GudhUI/view/Viewer_instructor.h
index 05c5c1fc..4b06acb8 100644
--- a/GudhUI/view/Viewer_instructor.h
+++ b/GudhUI/view/Viewer_instructor.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/biblio/bibliography.bib b/biblio/bibliography.bib
index b101cb76..16f43d6f 100644
--- a/biblio/bibliography.bib
+++ b/biblio/bibliography.bib
@@ -1,12 +1,12 @@
@inproceedings{gudhilibrary_ICMS14,
- author = {Cl\'ement Maria and Jean-Daniel Boissonnat and
+ author = {Cl\'ement Maria and Jean-Daniel Boissonnat and
Marc Glisse and Mariette Yvinec},
title = {The {G}udhi Library: Simplicial Complexes and Persistent Homology},
booktitle = {ICMS},
year = {2014},
}
-@article{Carriere17c,
+@article{Carriere17c,
author = {Carri\`ere, Mathieu and Michel, Bertrand and Oudot, Steve},
title = {{Statistical Analysis and Parameter Selection for Mapper}},
journal = {CoRR},
@@ -20,7 +20,7 @@
booktitle = {Proceedings of the Twenty-ninth Annual Symposium on Computational Geometry},
year = {2013},
pages = {107--116},
-}
+}
@article{Carriere16,
title={{Structure and Stability of the 1-Dimensional Mapper}},
@@ -70,7 +70,7 @@ language={English}
publisher = {ACM Press/Addison-Wesley Publishing Co.},
address = {New York, NY, USA},
keywords = {level of detail, mutiresolution modeling, non-manifold, pair contraction, surface simplification},
-}
+}
@inproceedings{Lindstrom,
@@ -85,7 +85,7 @@ language={English}
numpages = {8},
publisher = {IEEE Computer Society Press},
address = {Los Alamitos, CA, USA},
-}
+}
@article{boissonnatmariacamalgorithmica,
@@ -201,13 +201,13 @@ language={English},
bibsource = {DBLP, http://dblp.uni-trier.de}
}
@article{RS62,
- author={J. B. Rosser and L. Schoenfeld},
- title={Approximate Formulas for some Functions of Prime Numbers},
- journal= {ijm},
- volume= 6,
- year= 1962,
- pages={64-94},
- mrnumber={25 \#1139}
+ author={J. B. Rosser and L. Schoenfeld},
+ title={Approximate Formulas for some Functions of Prime Numbers},
+ journal= {ijm},
+ volume= 6,
+ year= 1962,
+ pages={64-94},
+ mrnumber={25 \#1139}
}
@article{DBLP:journals/siamcomp/Furer09,
author = {Martin F{\"u}rer},
@@ -410,7 +410,7 @@ url="http://dx.doi.org/10.1007/s00454-013-9557-2"
edition = {2},
publisher = {Cambridge University Press},
address = {New York, NY, USA},
-}
+}
@book{DBLP:books/aw/AhoHU74,
author = {Alfred V. Aho and
John E. Hopcroft and
@@ -508,7 +508,7 @@ proceedings{DBLP:conf/issac/1996,
pages = {501--509},
numpages = {9},
keywords = {clique complexes, data structure, edge contraction, flag complexes, high dimensions, homotopy equivalence, shape reconstruction, shape simplification, simplicial complexes, vietoris-rips complexes},
-}
+}
@@ -571,7 +571,7 @@ note = "http://gmplib.org/",
publisher = {ACM},
address = {New York, NY, USA},
keywords = {discrete and computational geometry, embedding theorem, persistent homology},
-}
+}
@article{Fredman:1984:SST:828.1884,
author = {Fredman, Michael L. and Koml\'{o}s, J\'{a}nos and Szemer{\'e}di, Endre},
title = {Storing a Sparse Table with {O}(1) Worst Case Access Time},
@@ -589,7 +589,7 @@ note = "http://gmplib.org/",
acmid = {1884},
publisher = {ACM},
address = {New York, NY, USA},
-}
+}
%------------------------------------------------------------------
@@ -739,7 +739,7 @@ inproceedings{DBLP:conf/soda/1997,
publisher = {Kluwer Academic Publishers},
address = {Hingham, MA, USA},
keywords = {Filtration, Klein bottle, Manifold, Natural images, Persistent homology, Topology},
-}
+}
article{DBLP:journals/ijcv/LeePM03,
author = {Ann B. Lee and
@@ -767,7 +767,7 @@ pages={234115},
year={2010},
abstract={Understanding energy landscapes is a major challenge in chemistry and biology. Although a wide variety of methods have been invented and applied to this problem, very little is understood about the actual mathematical structures underlying such landscapes. Perhaps the most general assumption is the idea that energy landscapes are low-dimensional manifolds embedded in high-dimensional Euclidean space. While this is a very mild assumption, we have discovered an example of an energy landscape which is nonmanifold, demonstrating previously unknown mathematical complexity. The example occurs in the energy landscape of cyclo-octane, which was found to have the structure of a reducible algebraic variety, composed of the union of a sphere and a Klein bottle, intersecting in two rings.}
}
-
+
book{hatcher2002algebraic,
title={Algebraic Topology},
@@ -803,7 +803,7 @@ book{hatcher2002algebraic,
isbn = {0070131511},
edition = {2nd},
publisher = {McGraw-Hill Higher Education},
-}
+}
@article{DBLP:journals/focm/CarlssonS10,
author = {Gunnar E. Carlsson and
@@ -1017,7 +1017,7 @@ language={English}
journal = {Journal of Symbolic Computation.},
year = {2016}
}
-
+
@ARTICLE{Fasy_Kim_Lecci_Maria_tda,
author = {B. Fasy and J. Kim and F. Lecci and C. Maria},
title = {Introduction to the R package TDA.},
@@ -1064,11 +1064,42 @@ language={English}
}
@ARTICLE{Carriere_Oudot_Ovsjanikov_top_signatures_3d,
- author = {M. Carrière and S. Oudot and M. Ovsjanikov},
+ author = {M. Carri\`ere and S. Oudot and M. Ovsjanikov},
title = {Stable Topological Signatures for Points on 3D Shapes.},
journal = {Proc. Sympos. on Geometry Processing},
year = {2015}
}
-
+@article{buchet16efficient,
+ title = {Efficient and Robust Persistent Homology for Measures},
+ author = {Micka\"{e}l Buchet and Fr\'{e}d\'{e}ric Chazal and Steve Y. Oudot and Donald Sheehy},
+ booktitle = {Computational Geometry: Theory and Applications},
+ volume = {58},
+ pages = {70--96},
+ year = {2016}
+}
+
+@inproceedings{cavanna15geometric,
+ author = {Nicholas J. Cavanna and Mahmoodreza Jahanseir and Donald R. Sheehy},
+ booktitle = {Proceedings of the Canadian Conference on Computational Geometry},
+ title = {A Geometric Perspective on Sparse Filtrations},
+ year = {2015}
+}
+
+@inproceedings{cavanna15visualizing,
+ author = {Nicholas J. Cavanna and Mahmoodreza Jahanseir and Donald R. Sheehy},
+ booktitle = {Proceedings of the 31st International Symposium on Computational Geometry},
+ title = {Visualizing Sparse Filtrations},
+ year = {2015},
+ doi = {10.4230/LIPIcs.SOCG.2015.23}
+}
+@article{sheehy13linear,
+ title = {Linear-Size Approximations to the {V}ietoris-{R}ips Filtration},
+ author = {Donald R. Sheehy},
+ journal = {Discrete \& Computational Geometry},
+ volume = {49},
+ number = {4},
+ pages = {778--796},
+ year = {2013}
+}
diff --git a/biblio/how_to_cite_gudhi.bib b/biblio/how_to_cite_gudhi.bib
index 5994124a..942f8d7e 100644
--- a/biblio/how_to_cite_gudhi.bib
+++ b/biblio/how_to_cite_gudhi.bib
@@ -97,7 +97,7 @@
}
@incollection{gudhi:RipsComplex
-, author = "Cl\'ement Maria, Pawel Dlotko, Vincent Rouvreau"
+, author = "Cl\'ement Maria, Pawel Dlotko, Vincent Rouvreau, Marc Glisse"
, title = "Rips complex"
, publisher = "{GUDHI Editorial Board}"
, booktitle = "{GUDHI} User and Reference Manual"
diff --git a/cmake/modules/GUDHI_compilation_flags.cmake b/cmake/modules/GUDHI_compilation_flags.cmake
new file mode 100644
index 00000000..a01d6e13
--- /dev/null
+++ b/cmake/modules/GUDHI_compilation_flags.cmake
@@ -0,0 +1,72 @@
+# This files manage compilation flags required by GUDHI
+
+include(TestCXXAcceptsFlag)
+include(CheckCXXSourceCompiles)
+
+# add a compiler flag only if it is accepted
+macro(add_cxx_compiler_flag _flag)
+ string(REPLACE "-" "_" _flag_var ${_flag})
+ check_cxx_accepts_flag("${_flag}" CXX_COMPILER_${_flag_var}_OK)
+ if(CXX_COMPILER_${_flag_var}_OK)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_flag}")
+ endif()
+endmacro()
+
+function(can_cgal_use_cxx11_thread_local)
+ # This is because of https://github.com/CGAL/cgal/blob/master/Installation/include/CGAL/tss.h
+ # CGAL is using boost thread if thread_local is not ready (requires XCode 8 for Mac).
+ # The test in https://github.com/CGAL/cgal/blob/master/Installation/include/CGAL/config.h
+ # #if __has_feature(cxx_thread_local) || \
+ # ( (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 && __cplusplus >= 201103L ) || \
+ # ( _MSC_VER >= 1900 )
+ # #define CGAL_CAN_USE_CXX11_THREAD_LOCAL
+ # #endif
+ set(CGAL_CAN_USE_CXX11_THREAD_LOCAL "
+ int main() {
+ #ifndef __has_feature
+ #define __has_feature(x) 0 // Compatibility with non-clang compilers.
+ #endif
+ #if __has_feature(cxx_thread_local) || \
+ ( (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 && __cplusplus >= 201103L ) || \
+ ( _MSC_VER >= 1900 )
+ bool has_feature_thread_local = true;
+ #else
+ // Explicit error of compilation for CMake test purpose - has_feature_thread_local is not defined
+ #endif
+ bool result = has_feature_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)
+
+enable_testing()
+
+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")
+endif()
+
+add_cxx_compiler_flag("-Wall")
+
+if (DEBUG_TRACES)
+ # For programs to be more verbose
+ message(STATUS "DEBUG_TRACES are activated")
+ add_definitions(-DDEBUG_TRACES)
+endif()
+
+set(GUDHI_CAN_USE_CXX11_THREAD_LOCAL "
+ int main() {
+ thread_local int result = 0;
+ return result;
+ } ")
+check_cxx_source_compiles("${GUDHI_CAN_USE_CXX11_THREAD_LOCAL}" GUDHI_CAN_USE_CXX11_THREAD_LOCAL_RESULT)
+if (GUDHI_CAN_USE_CXX11_THREAD_LOCAL_RESULT)
+ add_definitions(-DGUDHI_CAN_USE_CXX11_THREAD_LOCAL)
+endif()
+
+if(CMAKE_BUILD_TYPE MATCHES Debug)
+ message("++ Debug compilation flags are: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}")
+else()
+ message("++ Release compilation flags are: ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}")
+endif()
diff --git a/cmake/modules/GUDHI_third_party_libraries.cmake b/cmake/modules/GUDHI_third_party_libraries.cmake
index 419c2581..7433f2f3 100644
--- a/cmake/modules/GUDHI_third_party_libraries.cmake
+++ b/cmake/modules/GUDHI_third_party_libraries.cmake
@@ -54,23 +54,27 @@ if(CGAL_FOUND)
endforeach(CGAL_INCLUDE_DIR ${CGAL_INCLUDE_DIRS})
endif(NOT CGAL_VERSION VERSION_GREATER 4.9.0)
- if (NOT CGAL_VERSION VERSION_GREATER 4.11.0)
+ if (CGAL_VERSION VERSION_LESS 4.11.0)
# For dev version
include_directories(BEFORE "src/common/include/gudhi_patches")
# For user version
include_directories(BEFORE "include/gudhi_patches")
- endif (NOT CGAL_VERSION VERSION_GREATER 4.11.0)
+ endif ()
endif()
endif()
+option(WITH_GUDHI_USE_TBB "Build with Intel TBB parallelization" ON)
+
# Find TBB package for parallel sort - not mandatory, just optional.
-set(TBB_FIND_QUIETLY ON)
-find_package(TBB)
-if (TBB_FOUND)
- include(${TBB_USE_FILE})
- message("TBB found in ${TBB_LIBRARY_DIRS}")
- add_definitions(-DGUDHI_USE_TBB)
-endif()
+if(WITH_GUDHI_USE_TBB)
+ set(TBB_FIND_QUIETLY ON)
+ find_package(TBB)
+ if (TBB_FOUND)
+ include(${TBB_USE_FILE})
+ message("TBB found in ${TBB_LIBRARY_DIRS}")
+ add_definitions(-DGUDHI_USE_TBB)
+ endif()
+endif(WITH_GUDHI_USE_TBB)
set(CGAL_WITH_EIGEN3_VERSION 0.0.0)
find_package(Eigen3 3.1.0)
diff --git a/cmake/modules/GUDHI_user_version_target.cmake b/cmake/modules/GUDHI_user_version_target.cmake
index 4abc2574..1205966a 100644
--- a/cmake/modules/GUDHI_user_version_target.cmake
+++ b/cmake/modules/GUDHI_user_version_target.cmake
@@ -48,10 +48,10 @@ if (NOT CMAKE_VERSION VERSION_LESS 2.8.11)
copy_directory ${CMAKE_SOURCE_DIR}/src/GudhUI ${GUDHI_USER_VERSION_DIR}/GudhUI)
set(GUDHI_DIRECTORIES "doc;example;concept;utilities")
- if (NOT CGAL_VERSION VERSION_GREATER 4.11.0)
- set(GUDHI_INCLUDE_DIRECTORIES "include/gudhi;include/gudhi_patches")
+ if (CGAL_VERSION VERSION_LESS 4.11.0)
+ set(GUDHI_INCLUDE_DIRECTORIES "include/gudhi;include/Miniball;include/gudhi_patches")
else ()
- set(GUDHI_INCLUDE_DIRECTORIES "include/gudhi")
+ set(GUDHI_INCLUDE_DIRECTORIES "include/gudhi;include/Miniball")
endif ()
foreach(GUDHI_MODULE ${GUDHI_MODULES_FULL_LIST})
diff --git a/concept/Alpha_complex/SimplicialComplexForAlpha.h b/concept/Alpha_complex/SimplicialComplexForAlpha.h
index 2b8bff94..a51df127 100644
--- a/concept/Alpha_complex/SimplicialComplexForAlpha.h
+++ b/concept/Alpha_complex/SimplicialComplexForAlpha.h
@@ -4,7 +4,7 @@
*
* Author(s): Vincent Rouvreau
*
- * Copyright (C) 2016 INRIA
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/concept/Bottleneck_distance/Persistence_diagram.h b/concept/Bottleneck_distance/Persistence_diagram.h
index b157f22a..d016faf4 100644
--- a/concept/Bottleneck_distance/Persistence_diagram.h
+++ b/concept/Bottleneck_distance/Persistence_diagram.h
@@ -4,7 +4,7 @@
*
* Author: François Godi
*
- * Copyright (C) 2015 INRIA
+ * Copyright (C) 2015 Inria
*
* 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
diff --git a/concept/Cech_complex/SimplicialComplexForCech.h b/concept/Cech_complex/SimplicialComplexForCech.h
new file mode 100644
index 00000000..89231eec
--- /dev/null
+++ b/concept/Cech_complex/SimplicialComplexForCech.h
@@ -0,0 +1,66 @@
+/* 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): Vincent Rouvreau
+ *
+ * Copyright (C) 2018 Inria
+ *
+ * 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/>.
+ */
+
+#ifndef CONCEPT_CECH_COMPLEX_SIMPLICIAL_COMPLEX_FOR_CECH_H_
+#define CONCEPT_CECH_COMPLEX_SIMPLICIAL_COMPLEX_FOR_CECH_H_
+
+namespace Gudhi {
+
+namespace cech_complex {
+
+/** \brief The concept SimplicialComplexForCech describes the requirements for a type to implement a simplicial
+ * complex, that can be created from a `Cech_complex`.
+ */
+struct SimplicialComplexForCech {
+ /** Handle to specify a simplex. */
+ typedef unspecified Simplex_handle;
+ /** Handle to specify a vertex. Must be a non-negative integer. */
+ typedef unspecified Vertex_handle;
+ /** Handle to specify the simplex filtration value. */
+ typedef unspecified Filtration_value;
+
+ /** Assigns the 'simplex' with the given 'filtration' value. */
+ int assign_filtration(Simplex_handle simplex, Filtration_value filtration);
+
+ /** \brief Returns a range over vertices of a given
+ * simplex. */
+ Simplex_vertex_range simplex_vertex_range(Simplex_handle const & simplex);
+
+ /** \brief Inserts a given `Gudhi::ProximityGraph` in the simplicial complex. */
+ template<class ProximityGraph>
+ void insert_graph(const ProximityGraph& proximity_graph);
+
+ /** \brief Expands the simplicial complex containing only its one skeleton until a given maximal dimension.
+ * expansion can be blocked by the blocker oracle. */
+ template< typename Blocker >
+ void expansion_with_blockers(int max_dim, Blocker block_simplex);
+
+ /** Returns the number of vertices in the simplicial complex. */
+ std::size_t num_vertices();
+
+};
+
+} // namespace alpha_complex
+
+} // namespace Gudhi
+
+#endif // CONCEPT_ALPHA_COMPLEX_SIMPLICIAL_COMPLEX_FOR_ALPHA_H_
diff --git a/concept/Persistence_representations/Real_valued_topological_data.h b/concept/Persistence_representations/Real_valued_topological_data.h
index 1d3595ad..22ef6d72 100644
--- a/concept/Persistence_representations/Real_valued_topological_data.h
+++ b/concept/Persistence_representations/Real_valued_topological_data.h
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/concept/Persistence_representations/Topological_data_with_averages.h b/concept/Persistence_representations/Topological_data_with_averages.h
index 9ebd105f..aa64467f 100644
--- a/concept/Persistence_representations/Topological_data_with_averages.h
+++ b/concept/Persistence_representations/Topological_data_with_averages.h
@@ -5,7 +5,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/concept/Persistence_representations/Topological_data_with_distances.h b/concept/Persistence_representations/Topological_data_with_distances.h
index a6a62307..c8eb2b34 100644
--- a/concept/Persistence_representations/Topological_data_with_distances.h
+++ b/concept/Persistence_representations/Topological_data_with_distances.h
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/concept/Persistence_representations/Topological_data_with_scalar_product.h b/concept/Persistence_representations/Topological_data_with_scalar_product.h
index 2e506ca9..0f08b8c6 100644
--- a/concept/Persistence_representations/Topological_data_with_scalar_product.h
+++ b/concept/Persistence_representations/Topological_data_with_scalar_product.h
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/concept/Persistence_representations/Vectorized_topological_data.h b/concept/Persistence_representations/Vectorized_topological_data.h
index b6b5b109..365105d6 100644
--- a/concept/Persistence_representations/Vectorized_topological_data.h
+++ b/concept/Persistence_representations/Vectorized_topological_data.h
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/concept/Persistent_cohomology/CoefficientField.h b/concept/Persistent_cohomology/CoefficientField.h
index 953b06c2..9d066cca 100644
--- a/concept/Persistent_cohomology/CoefficientField.h
+++ b/concept/Persistent_cohomology/CoefficientField.h
@@ -4,7 +4,7 @@
*
* Author(s): Clément Maria
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Méditerranée (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/concept/Persistent_cohomology/FilteredComplex.h b/concept/Persistent_cohomology/FilteredComplex.h
index c19698df..62b9002f 100644
--- a/concept/Persistent_cohomology/FilteredComplex.h
+++ b/concept/Persistent_cohomology/FilteredComplex.h
@@ -4,7 +4,7 @@
*
* Author(s): Clément Maria
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Méditerranée (France)
+ * Copyright (C) 2014 Inria
*
* 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
@@ -29,10 +29,6 @@ struct FilteredComplex
{
/** Handle to specify a simplex. */
typedef unspecified Simplex_handle;
-/** \brief Key associated to each simplex.
- *
- * Must be a signed integer type. */
- typedef unspecified Simplex_key;
/** \brief Type for the value of the filtration function.
*
* Must be comparable with <. */
@@ -58,20 +54,10 @@ struct FilteredComplex
* filtration function on the complex. */
Filtration_value filtration(Simplex_handle sh);
-/** \brief Returns a key that is different from the keys associated
- * to the simplices. */
- Simplex_key null_key ();
-/** \brief Returns the key associated to a simplex.
- *
- * This is never called on null_simplex(). */
- Simplex_key key ( Simplex_handle sh );
/** \brief Returns the simplex that has index idx in the filtration.
*
- * This is never called on null_key(). */
- Simplex_handle simplex ( Simplex_key idx );
-/** \brief Assign a key to a simplex. */
- void assign_key(Simplex_handle sh, Simplex_key key);
-
+ * This is only called on valid indices. */
+ Simplex_handle simplex ( size_t idx );
/** \brief Iterator on the simplices belonging to the
* boundary of a simplex.
*
@@ -115,6 +101,26 @@ typedef unspecified Filtration_simplex_range;
* .begin() and .end() return type Filtration_simplex_iterator.*/
Filtration_simplex_range filtration_simplex_range();
+/** \name Map interface
+ * Conceptually a `std::unordered_map<Simplex_handle,std::size_t>`.
+ * @{ */
+/** \brief Data stored for each simplex.
+ *
+ * Must be an integer type. */
+ typedef unspecified Simplex_key;
+/** \brief Returns a constant dummy number that is either negative,
+ * or at least as large as `num_simplices()`. Suggested value: -1. */
+ Simplex_key null_key ();
+/** \brief Returns the number stored for a simplex by `assign_key`.
+ *
+ * This is never called on null_simplex(). */
+ Simplex_key key ( Simplex_handle sh );
+/** \brief Store a number for a simplex, which can later be retrieved with `key(sh)`.
+ *
+ * This is never called on null_simplex(). */
+ void assign_key(Simplex_handle sh, Simplex_key n);
+/** @} */
+
/* \brief Iterator over the simplices of the complex,
* in an arbitrary order.
diff --git a/concept/Persistent_cohomology/PersistentHomology.h b/concept/Persistent_cohomology/PersistentHomology.h
index 111723a5..f9a78763 100644
--- a/concept/Persistent_cohomology/PersistentHomology.h
+++ b/concept/Persistent_cohomology/PersistentHomology.h
@@ -4,7 +4,7 @@
*
* Author(s): Clément Maria
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Méditerranée (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/concept/Rips_complex/SimplicialComplexForRips.h b/concept/Rips_complex/SimplicialComplexForRips.h
index 7dab0615..3c5acecf 100644
--- a/concept/Rips_complex/SimplicialComplexForRips.h
+++ b/concept/Rips_complex/SimplicialComplexForRips.h
@@ -4,7 +4,7 @@
*
* Author(s): Vincent Rouvreau
*
- * Copyright (C) 2016 INRIA
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/concept/Simplex_tree/FiltrationValue.h b/concept/Simplex_tree/FiltrationValue.h
index 79ca06cc..f4dcf985 100644
--- a/concept/Simplex_tree/FiltrationValue.h
+++ b/concept/Simplex_tree/FiltrationValue.h
@@ -4,7 +4,7 @@
*
* Author(s): Clément Maria
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Méditerranée (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/concept/Simplex_tree/IndexingTag.h b/concept/Simplex_tree/IndexingTag.h
index 1dcdd756..37e7e294 100644
--- a/concept/Simplex_tree/IndexingTag.h
+++ b/concept/Simplex_tree/IndexingTag.h
@@ -4,7 +4,7 @@
*
* Author(s): Clément Maria
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Méditerranée (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/concept/Simplex_tree/SimplexKey.h b/concept/Simplex_tree/SimplexKey.h
index 9fbed401..c03f7da1 100644
--- a/concept/Simplex_tree/SimplexKey.h
+++ b/concept/Simplex_tree/SimplexKey.h
@@ -4,7 +4,7 @@
*
* Author(s): Clément Maria
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Méditerranée (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/concept/Simplex_tree/SimplexTreeOptions.h b/concept/Simplex_tree/SimplexTreeOptions.h
index 89acdc18..6638da26 100644
--- a/concept/Simplex_tree/SimplexTreeOptions.h
+++ b/concept/Simplex_tree/SimplexTreeOptions.h
@@ -4,7 +4,7 @@
*
* Author(s): Marc Glisse
*
- * Copyright (C) 2015 INRIA Saclay - Ile-de-France (France)
+ * Copyright (C) 2015 Inria
*
* 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
diff --git a/concept/Simplex_tree/VertexHandle.h b/concept/Simplex_tree/VertexHandle.h
index 3efbba61..9d0642c3 100644
--- a/concept/Simplex_tree/VertexHandle.h
+++ b/concept/Simplex_tree/VertexHandle.h
@@ -4,7 +4,7 @@
*
* Author(s): Clément Maria
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Méditerranée (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/concept/Skeleton_blocker/SkeletonBlockerDS.h b/concept/Skeleton_blocker/SkeletonBlockerDS.h
index d82425a0..fd806ff1 100644
--- a/concept/Skeleton_blocker/SkeletonBlockerDS.h
+++ b/concept/Skeleton_blocker/SkeletonBlockerDS.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/concept/Skeleton_blocker/SkeletonBlockerGeometricDS.h b/concept/Skeleton_blocker/SkeletonBlockerGeometricDS.h
index 477464c4..d8521343 100644
--- a/concept/Skeleton_blocker/SkeletonBlockerGeometricDS.h
+++ b/concept/Skeleton_blocker/SkeletonBlockerGeometricDS.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/concept/Witness_complex/SimplicialComplexForWitness.h b/concept/Witness_complex/SimplicialComplexForWitness.h
index d78cc83f..8b85f4e4 100644
--- a/concept/Witness_complex/SimplicialComplexForWitness.h
+++ b/concept/Witness_complex/SimplicialComplexForWitness.h
@@ -4,7 +4,7 @@
*
* Author(s): Siargey Kachanovich
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Méditerranée (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/cython/CMakeLists.txt b/cython/CMakeLists.txt
index afca9d60..17d440ee 100644
--- a/cython/CMakeLists.txt
+++ b/cython/CMakeLists.txt
@@ -1,4 +1,3 @@
-cmake_minimum_required(VERSION 2.8)
project(Cython)
function( add_gudhi_cython_lib THE_LIB )
@@ -32,35 +31,6 @@ if(CYTHON_FOUND)
set(GUDHI_CYTHON_EXTRA_COMPILE_ARGS "${GUDHI_CYTHON_EXTRA_COMPILE_ARGS}'-DBOOST_ALL_NO_LIB', ")
set(GUDHI_CYTHON_EXTRA_COMPILE_ARGS "${GUDHI_CYTHON_EXTRA_COMPILE_ARGS}'-DBOOST_SYSTEM_NO_DEPRECATED', ")
- # This is because of https://github.com/CGAL/cgal/blob/master/Installation/include/CGAL/tss.h
- # CGAL is using boost thread if thread_local is not ready (requires XCode 8 for Mac).
- # The test in https://github.com/CGAL/cgal/blob/master/Installation/include/CGAL/config.h
- # #if __has_feature(cxx_thread_local) || \
- # ( (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 && __cplusplus >= 201103L ) || \
- # ( _MSC_VER >= 1900 )
- # #define CGAL_CAN_USE_CXX11_THREAD_LOCAL
- # #endif
- set(CGAL_CAN_USE_CXX11_THREAD_LOCAL "
- int main() {
- #ifndef __has_feature
- #define __has_feature(x) 0 // Compatibility with non-clang compilers.
- #endif
- #if __has_feature(cxx_thread_local) || \
- ( (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 && __cplusplus >= 201103L ) || \
- ( _MSC_VER >= 1900 )
- bool has_feature_thread_local = true;
- #else
- // Explicit error of compilation for CMake test purpose - has_feature_thread_local is not defined
- #endif
- bool result = has_feature_thread_local;
- } ")
- check_cxx_source_compiles("${CGAL_CAN_USE_CXX11_THREAD_LOCAL}" CGAL_CAN_USE_CXX11_THREAD_LOCAL_RESULT)
-
- if (NOT CGAL_CAN_USE_CXX11_THREAD_LOCAL_RESULT)
- add_gudhi_cython_lib(${Boost_THREAD_LIBRARY})
- set(GUDHI_CYTHON_LIBRARY_DIRS "${GUDHI_CYTHON_LIBRARY_DIRS}'${Boost_LIBRARY_DIRS}', ")
- endif()
-
# Gudhi and CGAL compilation option
if(MSVC)
set(GUDHI_CYTHON_EXTRA_COMPILE_ARGS "${GUDHI_CYTHON_EXTRA_COMPILE_ARGS}'/fp:strict', ")
@@ -99,11 +69,16 @@ if(CYTHON_FOUND)
endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.6.0)
if(CGAL_FOUND)
+ can_cgal_use_cxx11_thread_local()
+ if (NOT CGAL_CAN_USE_CXX11_THREAD_LOCAL_RESULT)
+ add_gudhi_cython_lib(${Boost_THREAD_LIBRARY})
+ set(GUDHI_CYTHON_LIBRARY_DIRS "${GUDHI_CYTHON_LIBRARY_DIRS}'${Boost_LIBRARY_DIRS}', ")
+ endif()
# Add CGAL compilation args
if(CGAL_HEADER_ONLY)
set(GUDHI_CYTHON_EXTRA_COMPILE_ARGS "${GUDHI_CYTHON_EXTRA_COMPILE_ARGS}'-DCGAL_HEADER_ONLY', ")
else(CGAL_HEADER_ONLY)
- add_gudhi_cython_lib(${CGAL_LIBRARIES})
+ add_gudhi_cython_lib(${CGAL_LIBRARY})
set(GUDHI_CYTHON_LIBRARY_DIRS "${GUDHI_CYTHON_LIBRARY_DIRS}'${CGAL_LIBRARIES_DIR}', ")
# If CGAL is not header only, CGAL library may link with boost system,
add_gudhi_cython_lib(${Boost_SYSTEM_LIBRARY})
@@ -135,7 +110,7 @@ if(CYTHON_FOUND)
endforeach()
set(GUDHI_CYTHON_INCLUDE_DIRS "${GUDHI_CYTHON_INCLUDE_DIRS}'${CMAKE_SOURCE_DIR}/${GUDHI_CYTHON_PATH}/include', ")
- if (TBB_FOUND)
+ if (TBB_FOUND AND WITH_GUDHI_USE_TBB)
set(GUDHI_CYTHON_EXTRA_COMPILE_ARGS "${GUDHI_CYTHON_EXTRA_COMPILE_ARGS}'-DGUDHI_USE_TBB', ")
add_gudhi_cython_lib(${TBB_RELEASE_LIBRARY})
add_gudhi_cython_lib(${TBB_MALLOC_RELEASE_LIBRARY})
@@ -181,7 +156,7 @@ if(CYTHON_FOUND)
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} -E env "PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}"
${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/example/tangential_complex_plain_homology_from_off_file_example.py"
- --no-diagram -f ${CMAKE_SOURCE_DIR}/data/points/tore3D_300.off)
+ --no-diagram -i 2 -f ${CMAKE_SOURCE_DIR}/data/points/tore3D_300.off)
add_gudhi_py_test(test_tangential_complex)
diff --git a/cython/cython/alpha_complex.pyx b/cython/cython/alpha_complex.pyx
index a0e8f9b7..4f772e31 100644
--- a/cython/cython/alpha_complex.pyx
+++ b/cython/cython/alpha_complex.pyx
@@ -11,7 +11,7 @@ import os
Author(s): Vincent Rouvreau
- Copyright (C) 2016 INRIA
+ Copyright (C) 2016 Inria
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
@@ -28,7 +28,7 @@ import os
"""
__author__ = "Vincent Rouvreau"
-__copyright__ = "Copyright (C) 2016 INRIA"
+__copyright__ = "Copyright (C) 2016 Inria"
__license__ = "GPL v3"
cdef extern from "Alpha_complex_interface.h" namespace "Gudhi":
diff --git a/cython/cython/bottleneck_distance.pyx b/cython/cython/bottleneck_distance.pyx
index 9fb377ff..76ef81f4 100644
--- a/cython/cython/bottleneck_distance.pyx
+++ b/cython/cython/bottleneck_distance.pyx
@@ -9,7 +9,7 @@ import os
Author(s): Vincent Rouvreau
- Copyright (C) 2016 INRIA
+ Copyright (C) 2016 Inria
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
@@ -26,7 +26,7 @@ import os
"""
__author__ = "Vincent Rouvreau"
-__copyright__ = "Copyright (C) 2016 INRIA"
+__copyright__ = "Copyright (C) 2016 Inria"
__license__ = "GPL v3"
cdef extern from "Bottleneck_distance_interface.h" namespace "Gudhi::persistence_diagram":
diff --git a/cython/cython/cubical_complex.pyx b/cython/cython/cubical_complex.pyx
index ffc85130..e94cd539 100644
--- a/cython/cython/cubical_complex.pyx
+++ b/cython/cython/cubical_complex.pyx
@@ -11,7 +11,7 @@ import os
Author(s): Vincent Rouvreau
- Copyright (C) 2016 INRIA
+ Copyright (C) 2016 Inria
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
@@ -28,7 +28,7 @@ import os
"""
__author__ = "Vincent Rouvreau"
-__copyright__ = "Copyright (C) 2016 INRIA"
+__copyright__ = "Copyright (C) 2016 Inria"
__license__ = "GPL v3"
cdef extern from "Cubical_complex_interface.h" namespace "Gudhi":
@@ -104,22 +104,21 @@ cdef class CubicalComplex:
return self.pcohptr != NULL
def num_simplices(self):
- """This function returns the number of simplices of the simplicial
- complex.
+ """This function returns the number of all cubes in the complex.
- :returns: int -- the simplicial complex number of simplices.
+ :returns: int -- the number of all cubes in the complex.
"""
return self.thisptr.num_simplices()
def dimension(self):
- """This function returns the dimension of the simplicial complex.
+ """This function returns the dimension of the complex.
- :returns: int -- the simplicial complex dimension.
+ :returns: int -- the complex dimension.
"""
return self.thisptr.dimension()
def persistence(self, homology_coeff_field=11, min_persistence=0):
- """This function returns the persistence of the simplicial complex.
+ """This function returns the persistence of the complex.
:param homology_coeff_field: The homology coefficient field. Must be a
prime number
@@ -130,7 +129,7 @@ cdef class CubicalComplex:
Sets min_persistence to -1.0 to see all values.
:type min_persistence: float.
:returns: list of pairs(dimension, pair(birth, death)) -- the
- persistence of the simplicial complex.
+ persistence of the complex.
"""
if self.pcohptr != NULL:
del self.pcohptr
@@ -142,12 +141,15 @@ cdef class CubicalComplex:
return persistence_result
def betti_numbers(self):
- """This function returns the Betti numbers of the simplicial complex.
+ """This function returns the Betti numbers of the complex.
:returns: list of int -- The Betti numbers ([B0, B1, ..., Bn]).
:note: betti_numbers function requires persistence function to be
launched first.
+
+ :note: betti_numbers function always returns [1, 0, 0, ...] as infinity
+ filtration cubes are not removed from the complex.
"""
cdef vector[int] bn_result
if self.pcohptr != NULL:
@@ -155,8 +157,7 @@ cdef class CubicalComplex:
return bn_result
def persistent_betti_numbers(self, from_value, to_value):
- """This function returns the persistent Betti numbers of the
- simplicial complex.
+ """This function returns the persistent Betti numbers of the complex.
:param from_value: The persistence birth limit to be added in the
numbers (persistent birth <= from_value).
@@ -177,8 +178,8 @@ cdef class CubicalComplex:
return pbn_result
def persistence_intervals_in_dimension(self, dimension):
- """This function returns the persistence intervals of the simplicial
- complex in a specific dimension.
+ """This function returns the persistence intervals of the complex in a
+ specific dimension.
:param dimension: The specific dimension.
:type from_value: int.
diff --git a/cython/cython/euclidean_strong_witness_complex.pyx b/cython/cython/euclidean_strong_witness_complex.pyx
index c1523892..62b7cf71 100644
--- a/cython/cython/euclidean_strong_witness_complex.pyx
+++ b/cython/cython/euclidean_strong_witness_complex.pyx
@@ -8,7 +8,7 @@ from libcpp.utility cimport pair
Author(s): Vincent Rouvreau
- Copyright (C) 2016 INRIA
+ Copyright (C) 2016 Inria
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
@@ -25,7 +25,7 @@ from libcpp.utility cimport pair
"""
__author__ = "Vincent Rouvreau"
-__copyright__ = "Copyright (C) 2016 INRIA"
+__copyright__ = "Copyright (C) 2016 Inria"
__license__ = "GPL v3"
cdef extern from "Euclidean_strong_witness_complex_interface.h" namespace "Gudhi":
diff --git a/cython/cython/euclidean_witness_complex.pyx b/cython/cython/euclidean_witness_complex.pyx
index 7c443b6b..c10ca73d 100644
--- a/cython/cython/euclidean_witness_complex.pyx
+++ b/cython/cython/euclidean_witness_complex.pyx
@@ -8,7 +8,7 @@ from libcpp.utility cimport pair
Author(s): Vincent Rouvreau
- Copyright (C) 2016 INRIA
+ Copyright (C) 2016 Inria
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
@@ -25,7 +25,7 @@ from libcpp.utility cimport pair
"""
__author__ = "Vincent Rouvreau"
-__copyright__ = "Copyright (C) 2016 INRIA"
+__copyright__ = "Copyright (C) 2016 Inria"
__license__ = "GPL v3"
cdef extern from "Euclidean_witness_complex_interface.h" namespace "Gudhi":
diff --git a/cython/cython/off_reader.pyx b/cython/cython/off_reader.pyx
index b6e107ef..b939013f 100644
--- a/cython/cython/off_reader.pyx
+++ b/cython/cython/off_reader.pyx
@@ -9,7 +9,7 @@ import os
Author(s): Vincent Rouvreau
- Copyright (C) 2016 INRIA
+ Copyright (C) 2016 Inria
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
@@ -26,7 +26,7 @@ import os
"""
__author__ = "Vincent Rouvreau"
-__copyright__ = "Copyright (C) 2016 INRIA"
+__copyright__ = "Copyright (C) 2016 Inria"
__license__ = "GPL v3"
cdef extern from "Off_reader_interface.h" namespace "Gudhi":
@@ -46,4 +46,5 @@ def read_off(off_file=''):
return read_points_from_OFF_file(str.encode(off_file))
else:
print("file " + off_file + " not found.")
+ return []
diff --git a/cython/cython/periodic_cubical_complex.pyx b/cython/cython/periodic_cubical_complex.pyx
index 3025f125..e626950b 100644
--- a/cython/cython/periodic_cubical_complex.pyx
+++ b/cython/cython/periodic_cubical_complex.pyx
@@ -11,7 +11,7 @@ import os
Author(s): Vincent Rouvreau
- Copyright (C) 2016 INRIA
+ Copyright (C) 2016 Inria
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
@@ -28,7 +28,7 @@ import os
"""
__author__ = "Vincent Rouvreau"
-__copyright__ = "Copyright (C) 2016 INRIA"
+__copyright__ = "Copyright (C) 2016 Inria"
__license__ = "GPL v3"
cdef extern from "Cubical_complex_interface.h" namespace "Gudhi":
@@ -106,22 +106,21 @@ cdef class PeriodicCubicalComplex:
return self.pcohptr != NULL
def num_simplices(self):
- """This function returns the number of simplices of the simplicial
- complex.
+ """This function returns the number of all cubes in the complex.
- :returns: int -- the simplicial complex number of simplices.
+ :returns: int -- the number of all cubes in the complex.
"""
return self.thisptr.num_simplices()
def dimension(self):
- """This function returns the dimension of the simplicial complex.
+ """This function returns the dimension of the complex.
- :returns: int -- the simplicial complex dimension.
+ :returns: int -- the complex dimension.
"""
return self.thisptr.dimension()
def persistence(self, homology_coeff_field=11, min_persistence=0):
- """This function returns the persistence of the simplicial complex.
+ """This function returns the persistence of the complex.
:param homology_coeff_field: The homology coefficient field. Must be a
prime number
@@ -132,7 +131,7 @@ cdef class PeriodicCubicalComplex:
Sets min_persistence to -1.0 to see all values.
:type min_persistence: float.
:returns: list of pairs(dimension, pair(birth, death)) -- the
- persistence of the simplicial complex.
+ persistence of the complex.
"""
if self.pcohptr != NULL:
del self.pcohptr
@@ -144,12 +143,15 @@ cdef class PeriodicCubicalComplex:
return persistence_result
def betti_numbers(self):
- """This function returns the Betti numbers of the simplicial complex.
+ """This function returns the Betti numbers of the complex.
:returns: list of int -- The Betti numbers ([B0, B1, ..., Bn]).
:note: betti_numbers function requires persistence function to be
launched first.
+
+ :note: betti_numbers function always returns [1, 0, 0, ...] as infinity
+ filtration cubes are not removed from the complex.
"""
cdef vector[int] bn_result
if self.pcohptr != NULL:
@@ -157,8 +159,7 @@ cdef class PeriodicCubicalComplex:
return bn_result
def persistent_betti_numbers(self, from_value, to_value):
- """This function returns the persistent Betti numbers of the
- simplicial complex.
+ """This function returns the persistent Betti numbers of the complex.
:param from_value: The persistence birth limit to be added in the
numbers (persistent birth <= from_value).
@@ -179,8 +180,8 @@ cdef class PeriodicCubicalComplex:
return pbn_result
def persistence_intervals_in_dimension(self, dimension):
- """This function returns the persistence intervals of the simplicial
- complex in a specific dimension.
+ """This function returns the persistence intervals of the complex in a
+ specific dimension.
:param dimension: The specific dimension.
:type from_value: int.
diff --git a/cython/cython/persistence_graphical_tools.py b/cython/cython/persistence_graphical_tools.py
index fb837e29..216ab8d6 100755
--- a/cython/cython/persistence_graphical_tools.py
+++ b/cython/cython/persistence_graphical_tools.py
@@ -1,4 +1,5 @@
import matplotlib.pyplot as plt
+import matplotlib.patches as mpatches
import numpy as np
import os
@@ -8,7 +9,7 @@ import os
Author(s): Vincent Rouvreau, Bertrand Michel
- Copyright (C) 2016 INRIA
+ Copyright (C) 2016 Inria
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
@@ -25,16 +26,16 @@ import os
"""
__author__ = "Vincent Rouvreau, Bertrand Michel"
-__copyright__ = "Copyright (C) 2016 INRIA"
+__copyright__ = "Copyright (C) 2016 Inria"
__license__ = "GPL v3"
-def __min_birth_max_death(persistence, band_boot=0.):
+def __min_birth_max_death(persistence, band=0.):
"""This function returns (min_birth, max_death) from the persistence.
:param persistence: The persistence to plot.
:type persistence: list of tuples(dimension, tuple(birth, death)).
- :param band_boot: bootstrap band
- :type band_boot: float.
+ :param band: band
+ :type band: float.
:returns: (float, float) -- (min_birth, max_death).
"""
# Look for minimum birth date and maximum death date for plot optimisation
@@ -48,8 +49,8 @@ def __min_birth_max_death(persistence, band_boot=0.):
max_death = float(interval[1][0])
if float(interval[1][0]) < min_birth:
min_birth = float(interval[1][0])
- if band_boot > 0.:
- max_death += band_boot
+ if band > 0.:
+ max_death += band
return (min_birth, max_death)
"""
@@ -59,37 +60,27 @@ palette = ['#ff0000', '#00ff00', '#0000ff', '#00ffff', '#ff00ff', '#ffff00',
'#000000', '#880000', '#008800', '#000088', '#888800', '#880088',
'#008888']
-def show_palette_values(alpha=0.6):
- """This function shows palette color values in function of the dimension.
+def plot_persistence_barcode(persistence=[], persistence_file='', alpha=0.6,
+ max_barcodes=1000, inf_delta=0.1, legend=False):
+ """This function plots the persistence bar code from persistence values list
+ or from a :doc:`persistence file <fileformats>`.
- :param alpha: alpha value in [0.0, 1.0] for horizontal bars (default is 0.6).
- :type alpha: float.
- :returns: plot the dimension palette values.
- """
- colors = []
- for color in palette:
- colors.append(color)
-
- y_pos = np.arange(len(palette))
-
- plt.barh(y_pos, y_pos + 1, align='center', alpha=alpha, color=colors)
- plt.ylabel('Dimension')
- plt.title('Dimension palette values')
- return plt
-
-def plot_persistence_barcode(persistence=[], persistence_file='', alpha=0.6, max_barcodes=0):
- """This function plots the persistence bar code.
-
- :param persistence: The persistence to plot.
+ :param persistence: Persistence values list.
:type persistence: list of tuples(dimension, tuple(birth, death)).
- :param persistence_file: A persistence file style name (reset persistence if both are set).
+ :param persistence_file: A :doc:`persistence file <fileformats>` style name
+ (reset persistence if both are set).
:type persistence_file: string
- :param alpha: alpha value in [0.0, 1.0] for horizontal bars (default is 0.6).
+ :param alpha: barcode transparency value (0.0 transparent through 1.0 opaque - default is 0.6).
:type alpha: float.
- :param max_barcodes: number of maximal barcodes to be displayed
+ :param max_barcodes: number of maximal barcodes to be displayed.
+ Set it to 0 to see all, Default value is 1000.
(persistence will be sorted by life time if max_barcodes is set)
:type max_barcodes: int.
- :returns: plot -- An horizontal bar plot of persistence.
+ :param inf_delta: Infinity is placed at ((max_death - min_birth) x inf_delta).
+ A reasonable value is between 0.05 and 0.5 - default is 0.1.
+ :type inf_delta: float.
+ :returns: A matplotlib object containing horizontal bar plot of persistence
+ (launch `show()` method on it to display it).
"""
if persistence_file is not '':
if os.path.isfile(persistence_file):
@@ -107,9 +98,11 @@ def plot_persistence_barcode(persistence=[], persistence_file='', alpha=0.6, max
# Sort by life time, then takes only the max_plots elements
persistence = sorted(persistence, key=lambda life_time: life_time[1][1]-life_time[1][0], reverse=True)[:max_barcodes]
+ persistence = sorted(persistence, key=lambda birth: birth[1][0])
+
(min_birth, max_death) = __min_birth_max_death(persistence)
ind = 0
- delta = ((max_death - min_birth) / 10.0)
+ delta = ((max_death - min_birth) * inf_delta)
# Replace infinity values with max_death + delta for bar code to be more
# readable
infinity = max_death + delta
@@ -120,33 +113,49 @@ def plot_persistence_barcode(persistence=[], persistence_file='', alpha=0.6, max
# Finite death case
plt.barh(ind, (interval[1][1] - interval[1][0]), height=0.8,
left = interval[1][0], alpha=alpha,
- color = palette[interval[0]])
+ color = palette[interval[0]],
+ linewidth=0)
else:
# Infinite death case for diagram to be nicer
plt.barh(ind, (infinity - interval[1][0]), height=0.8,
left = interval[1][0], alpha=alpha,
- color = palette[interval[0]])
+ color = palette[interval[0]],
+ linewidth=0)
ind = ind + 1
+ if legend:
+ dimensions = list(set(item[0] for item in persistence))
+ plt.legend(handles=[mpatches.Patch(color=palette[dim],
+ label=str(dim)) for dim in dimensions],
+ loc='lower right')
plt.title('Persistence barcode')
# Ends plot on infinity value and starts a little bit before min_birth
plt.axis([axis_start, infinity, 0, ind])
return plt
-def plot_persistence_diagram(persistence=[], persistence_file='', alpha=0.6, band_boot=0., max_plots=0):
- """This function plots the persistence diagram with an optional confidence band.
+def plot_persistence_diagram(persistence=[], persistence_file='', alpha=0.6,
+ band=0., max_plots=1000, inf_delta=0.1, legend=False):
+ """This function plots the persistence diagram from persistence values list
+ or from a :doc:`persistence file <fileformats>`.
- :param persistence: The persistence to plot.
+ :param persistence: Persistence values list.
:type persistence: list of tuples(dimension, tuple(birth, death)).
- :param persistence_file: A persistence file style name (reset persistence if both are set).
+ :param persistence_file: A :doc:`persistence file <fileformats>` style name
+ (reset persistence if both are set).
:type persistence_file: string
- :param alpha: alpha value in [0.0, 1.0] for points and horizontal infinity line (default is 0.6).
+ :param alpha: plot transparency value (0.0 transparent through 1.0 opaque - default is 0.6).
:type alpha: float.
- :param band_boot: bootstrap band (not displayed if :math:`\leq` 0.)
- :type band_boot: float.
+ :param band: band (not displayed if :math:`\leq` 0. - default is 0.)
+ :type band: float.
:param max_plots: number of maximal plots to be displayed
+ Set it to 0 to see all, Default value is 1000.
+ (persistence will be sorted by life time if max_plots is set)
:type max_plots: int.
- :returns: plot -- A diagram plot of persistence.
+ :param inf_delta: Infinity is placed at ((max_death - min_birth) x inf_delta).
+ A reasonable value is between 0.05 and 0.5 - default is 0.1.
+ :type inf_delta: float.
+ :returns: A matplotlib object containing diagram plot of persistence
+ (launch `show()` method on it to display it).
"""
if persistence_file is not '':
if os.path.isfile(persistence_file):
@@ -164,9 +173,9 @@ def plot_persistence_diagram(persistence=[], persistence_file='', alpha=0.6, ban
# Sort by life time, then takes only the max_plots elements
persistence = sorted(persistence, key=lambda life_time: life_time[1][1]-life_time[1][0], reverse=True)[:max_plots]
- (min_birth, max_death) = __min_birth_max_death(persistence, band_boot)
+ (min_birth, max_death) = __min_birth_max_death(persistence, band)
ind = 0
- delta = ((max_death - min_birth) / 10.0)
+ delta = ((max_death - min_birth) * inf_delta)
# Replace infinity values with max_death + delta for diagram to be more
# readable
infinity = max_death + delta
@@ -179,8 +188,8 @@ def plot_persistence_diagram(persistence=[], persistence_file='', alpha=0.6, ban
plt.plot(x, [infinity] * len(x), linewidth=1.0, color='k', alpha=alpha)
plt.text(axis_start, infinity, r'$\infty$', color='k', alpha=alpha)
# bootstrap band
- if band_boot > 0.:
- plt.fill_between(x, x, x+band_boot, alpha=alpha, facecolor='red')
+ if band > 0.:
+ plt.fill_between(x, x, x+band, alpha=alpha, facecolor='red')
# Draw points in loop
for interval in reversed(persistence):
@@ -194,6 +203,10 @@ def plot_persistence_diagram(persistence=[], persistence_file='', alpha=0.6, ban
color = palette[interval[0]])
ind = ind + 1
+ if legend:
+ dimensions = list(set(item[0] for item in persistence))
+ plt.legend(handles=[mpatches.Patch(color=palette[dim], label=str(dim)) for dim in dimensions])
+
plt.title('Persistence diagram')
plt.xlabel('Birth')
plt.ylabel('Death')
diff --git a/cython/cython/reader_utils.pyx b/cython/cython/reader_utils.pyx
index 3a17c5a0..e4572db0 100644
--- a/cython/cython/reader_utils.pyx
+++ b/cython/cython/reader_utils.pyx
@@ -11,7 +11,7 @@ import os
Author(s): Vincent Rouvreau
- Copyright (C) 2017 INRIA
+ Copyright (C) 2017 Inria
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
@@ -28,7 +28,7 @@ import os
"""
__author__ = "Vincent Rouvreau"
-__copyright__ = "Copyright (C) 2017 INRIA"
+__copyright__ = "Copyright (C) 2017 Inria"
__license__ = "GPL v3"
cdef extern from "Reader_utils_interface.h" namespace "Gudhi":
diff --git a/cython/cython/rips_complex.pyx b/cython/cython/rips_complex.pyx
index ad9b0a4d..59c16bff 100644
--- a/cython/cython/rips_complex.pyx
+++ b/cython/cython/rips_complex.pyx
@@ -11,7 +11,7 @@ import os
Author(s): Vincent Rouvreau
- Copyright (C) 2016 INRIA
+ Copyright (C) 2016 Inria
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
@@ -28,14 +28,12 @@ import os
"""
__author__ = "Vincent Rouvreau"
-__copyright__ = "Copyright (C) 2016 INRIA"
+__copyright__ = "Copyright (C) 2016 Inria"
__license__ = "GPL v3"
cdef extern from "Rips_complex_interface.h" namespace "Gudhi":
cdef cppclass Rips_complex_interface "Gudhi::rips_complex::Rips_complex_interface":
Rips_complex_interface(vector[vector[double]] values, double threshold, bool euclidean)
- # bool from_file is a workaround for cython to find the correct signature
- Rips_complex_interface(string file_name, double threshold, bool euclidean, bool from_file)
void create_simplex_tree(Simplex_tree_interface_full_featured* simplex_tree, int dim_max)
# RipsComplex python interface
@@ -49,7 +47,7 @@ cdef class RipsComplex:
cdef Rips_complex_interface * thisptr
# Fake constructor that does nothing but documenting the constructor
- def __init__(self, points=None, off_file='', distance_matrix=None, csv_file='', max_edge_length=float('inf')):
+ def __init__(self, points=None, distance_matrix=None, max_edge_length=float('inf')):
"""RipsComplex constructor.
:param max_edge_length: Rips value.
@@ -60,41 +58,14 @@ cdef class RipsComplex:
Or
- :param off_file: An OFF file style name.
- :type off_file: string
-
- Or
-
:param distance_matrix: A distance matrix (full square or lower
triangular).
:type points: list of list of double
-
- Or
-
- :param csv_file: A csv file style name containing a full square or a
- lower triangular distance matrix.
- :type csv_file: string
"""
# The real cython constructor
- def __cinit__(self, points=None, off_file='', distance_matrix=None, csv_file='', max_edge_length=float('inf')):
- if off_file is not '':
- if os.path.isfile(off_file):
- self.thisptr = new Rips_complex_interface(str.encode(off_file),
- max_edge_length,
- True,
- True)
- else:
- print("file " + off_file + " not found.")
- elif csv_file is not '':
- if os.path.isfile(csv_file):
- self.thisptr = new Rips_complex_interface(str.encode(csv_file),
- max_edge_length,
- False,
- True)
- else:
- print("file " + csv_file + " not found.")
- elif distance_matrix is not None:
+ def __cinit__(self, points=None, distance_matrix=None, max_edge_length=float('inf')):
+ if distance_matrix is not None:
self.thisptr = new Rips_complex_interface(distance_matrix, max_edge_length, False)
else:
if points is None:
diff --git a/cython/cython/simplex_tree.pyx b/cython/cython/simplex_tree.pyx
index 0cb575d2..e302486b 100644
--- a/cython/cython/simplex_tree.pyx
+++ b/cython/cython/simplex_tree.pyx
@@ -10,7 +10,7 @@ from libcpp.string cimport string
Author(s): Vincent Rouvreau
- Copyright (C) 2016 INRIA
+ Copyright (C) 2016 Inria
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
@@ -27,7 +27,7 @@ from libcpp.string cimport string
"""
__author__ = "Vincent Rouvreau"
-__copyright__ = "Copyright (C) 2016 INRIA"
+__copyright__ = "Copyright (C) 2016 Inria"
__license__ = "GPL v3"
cdef extern from "Simplex_tree_interface.h" namespace "Gudhi":
@@ -55,6 +55,7 @@ cdef extern from "Simplex_tree_interface.h" namespace "Gudhi":
void expansion(int max_dim)
void remove_maximal_simplex(vector[int] simplex)
bool prune_above_filtration(double filtration)
+ bool make_filtration_non_decreasing()
cdef extern from "Persistent_cohomology_interface.h" namespace "Gudhi":
cdef cppclass Simplex_tree_persistence_interface "Gudhi::Persistent_cohomology_interface<Gudhi::Simplex_tree<Gudhi::Simplex_tree_options_full_featured>>":
@@ -64,6 +65,7 @@ cdef extern from "Persistent_cohomology_interface.h" namespace "Gudhi":
vector[int] persistent_betti_numbers(double from_value, double to_value)
vector[pair[double,double]] intervals_in_dimension(int dimension)
void write_output_diagram(string diagram_file_name)
+ vector[pair[vector[int], vector[int]]] persistence_pairs()
# SimplexTree python interface
cdef class SimplexTree:
@@ -399,6 +401,26 @@ cdef class SimplexTree:
"""
self.thisptr.expansion(max_dim)
+ def make_filtration_non_decreasing(self):
+ """This function ensures that each simplex has a higher filtration
+ value than its faces by increasing the filtration values.
+
+ :returns: The filtration modification information.
+ :rtype: bint
+
+
+ .. note::
+
+ Some simplex tree functions require the filtration to be valid.
+ make_filtration_non_decreasing function is not launching
+ :func:`initialize_filtration()<gudhi.SimplexTree.initialize_filtration>`
+ but returns the filtration modification
+ information. If the complex has changed , please call
+ :func:`initialize_filtration()<gudhi.SimplexTree.initialize_filtration>`
+ to recompute it.
+ """
+ return self.thisptr.make_filtration_non_decreasing()
+
def persistence(self, homology_coeff_field=11, min_persistence=0, persistence_dim_max = False):
"""This function returns the persistence of the simplicial complex.
@@ -486,6 +508,25 @@ cdef class SimplexTree:
" to be launched first.")
return intervals_result
+ def persistence_pairs(self):
+ """This function returns the persistence pairs of the simplicial
+ complex.
+
+ :returns: The persistence intervals.
+ :rtype: list of pair of list of int
+
+ :note: intervals_in_dim function requires
+ :func:`persistence()<gudhi.SimplexTree.persistence>`
+ function to be launched first.
+ """
+ cdef vector[pair[vector[int],vector[int]]] persistence_pairs_result
+ if self.pcohptr != NULL:
+ persistence_pairs_result = self.pcohptr.persistence_pairs()
+ else:
+ print("persistence_pairs function requires persistence function"
+ " to be launched first.")
+ return persistence_pairs_result
+
def write_persistence_diagram(self, persistence_file=''):
"""This function writes the persistence intervals of the simplicial
complex in a user given file name.
diff --git a/cython/cython/strong_witness_complex.pyx b/cython/cython/strong_witness_complex.pyx
index 770b46f5..74c5cb05 100644
--- a/cython/cython/strong_witness_complex.pyx
+++ b/cython/cython/strong_witness_complex.pyx
@@ -8,7 +8,7 @@ from libcpp.utility cimport pair
Author(s): Vincent Rouvreau
- Copyright (C) 2016 INRIA
+ Copyright (C) 2016 Inria
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
@@ -25,7 +25,7 @@ from libcpp.utility cimport pair
"""
__author__ = "Vincent Rouvreau"
-__copyright__ = "Copyright (C) 2016 INRIA"
+__copyright__ = "Copyright (C) 2016 Inria"
__license__ = "GPL v3"
cdef extern from "Strong_witness_complex_interface.h" namespace "Gudhi":
diff --git a/cython/cython/subsampling.pyx b/cython/cython/subsampling.pyx
index 894a4fbe..ac09b7a3 100644
--- a/cython/cython/subsampling.pyx
+++ b/cython/cython/subsampling.pyx
@@ -10,7 +10,7 @@ import os
Author(s): Vincent Rouvreau
- Copyright (C) 2016 INRIA
+ Copyright (C) 2016 Inria
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
@@ -27,7 +27,7 @@ import os
"""
__author__ = "Vincent Rouvreau"
-__copyright__ = "Copyright (C) 2016 INRIA"
+__copyright__ = "Copyright (C) 2016 Inria"
__license__ = "GPL v3"
cdef extern from "Subsampling_interface.h" namespace "Gudhi::subsampling":
diff --git a/cython/cython/tangential_complex.pyx b/cython/cython/tangential_complex.pyx
index d55bb050..4bb07076 100644
--- a/cython/cython/tangential_complex.pyx
+++ b/cython/cython/tangential_complex.pyx
@@ -11,7 +11,7 @@ import os
Author(s): Vincent Rouvreau
- Copyright (C) 2016 INRIA
+ Copyright (C) 2016 Inria
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
@@ -28,14 +28,14 @@ import os
"""
__author__ = "Vincent Rouvreau"
-__copyright__ = "Copyright (C) 2016 INRIA"
+__copyright__ = "Copyright (C) 2016 Inria"
__license__ = "GPL v3"
cdef extern from "Tangential_complex_interface.h" namespace "Gudhi":
cdef cppclass Tangential_complex_interface "Gudhi::tangential_complex::Tangential_complex_interface":
- Tangential_complex_interface(vector[vector[double]] points)
+ Tangential_complex_interface(int intrisic_dim, vector[vector[double]] points)
# bool from_file is a workaround for cython to find the correct signature
- Tangential_complex_interface(string off_file, bool from_file)
+ Tangential_complex_interface(int intrisic_dim, string off_file, bool from_file)
vector[double] get_point(unsigned vertex)
unsigned number_of_vertices()
unsigned number_of_simplices()
@@ -54,9 +54,12 @@ cdef class TangentialComplex:
cdef Tangential_complex_interface * thisptr
# Fake constructor that does nothing but documenting the constructor
- def __init__(self, points=None, off_file=''):
+ def __init__(self, intrisic_dim, points=None, off_file=''):
"""TangentialComplex constructor.
+ :param intrisic_dim: Intrinsic dimension of the manifold.
+ :type intrisic_dim: integer
+
:param points: A list of points in d-Dimension.
:type points: list of list of double
@@ -67,17 +70,17 @@ cdef class TangentialComplex:
"""
# The real cython constructor
- def __cinit__(self, points=None, off_file=''):
+ def __cinit__(self, intrisic_dim, points=None, off_file=''):
if off_file is not '':
if os.path.isfile(off_file):
- self.thisptr = new Tangential_complex_interface(str.encode(off_file), True)
+ self.thisptr = new Tangential_complex_interface(intrisic_dim, str.encode(off_file), True)
else:
print("file " + off_file + " not found.")
else:
if points is None:
# Empty tangential construction
points=[]
- self.thisptr = new Tangential_complex_interface(points)
+ self.thisptr = new Tangential_complex_interface(intrisic_dim, points)
def __dealloc__(self):
diff --git a/cython/cython/witness_complex.pyx b/cython/cython/witness_complex.pyx
index 96d122bb..8591465a 100644
--- a/cython/cython/witness_complex.pyx
+++ b/cython/cython/witness_complex.pyx
@@ -8,7 +8,7 @@ from libcpp.utility cimport pair
Author(s): Vincent Rouvreau
- Copyright (C) 2016 INRIA
+ Copyright (C) 2016 Inria
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
@@ -25,7 +25,7 @@ from libcpp.utility cimport pair
"""
__author__ = "Vincent Rouvreau"
-__copyright__ = "Copyright (C) 2016 INRIA"
+__copyright__ = "Copyright (C) 2016 Inria"
__license__ = "GPL v3"
cdef extern from "Witness_complex_interface.h" namespace "Gudhi":
diff --git a/cython/doc/_templates/layout.html b/cython/doc/_templates/layout.html
index 8e4eba40..1161ed8e 100644
--- a/cython/doc/_templates/layout.html
+++ b/cython/doc/_templates/layout.html
@@ -56,6 +56,12 @@
</a></p>
{%- endif %}
{%- endblock %}
+ <h2><a href="index.html">GUDHI</a></h2>
+ <h2><a href="fileformats.html">File formats</a></h2>
+ <h2><a href="installation.html">GUDHI installation</a></h2>
+ <h2><a href="citation.html">Acknowledging the GUDHI library</a></h2>
+ <h2><a href="genindex.html">Index</a></h2>
+ <h2><a href="examples.html">Examples</a></h2>
{%- if sidebars != None %}
{#- new style sidebar: explicitly include/exclude templates #}
{%- for sidebartemplate in sidebars %}
@@ -64,13 +70,6 @@
{%- else %}
{#- old style sidebars: using blocks -- should be deprecated #}
{%- block sidebartoc %}
-<h2><a href="index.html">GUDHI</a></h2>
-<h2><a href="fileformats.html">File formats</a></h2>
-<h2><a href="installation.html">GUDHI installation</a></h2>
-<h2><a href="citation.html">Acknowledging the GUDHI library</a></h2>
-<h2><a href="genindex.html">Index</a></h2>
-<h2><a href="examples.html">Examples</a></h2>
-
{%- include "localtoc.html" %}
{%- endblock %}
{%- block sidebarrel %}
@@ -166,60 +165,61 @@
<body role="document">
<!-- GUDHI website header BEGIN -->
<div id="navigation" class="sticky">
- <nav class="top-bar" role="navigation" data-topbar>
- <ul class="title-area">
- <li class="name">
- <h1 class="show-for-small-only"><a href="http://gudhi.gforge.inria.fr" class="icon-tree"> GUDHI C++ library</a></h1>
- </li>
- <!-- Remove the class "menu-icon" to get rid of menu icon. Take out "Menu" to just have icon alone -->
- <li class="toggle-topbar menu-icon"><a href="#"><span>Navigation</span></a></li>
- </ul>
- <section class="top-bar-section">
- <ul class="right">
- <li class="divider"></li>
- <li><a href="http://gudhi.gforge.inria.fr/contact/">Contact</a></li>
- </ul>
- <ul class="left">
- <li><a href="http://gudhi.gforge.inria.fr/"> <img src="http://gudhi.gforge.inria.fr/assets/img/home.png" alt="&nbsp;&nbsp;GUDHI">&nbsp;&nbsp;GUDHI </a></li>
- <li class="divider"></li>
- <li class="has-dropdown">
- <a href="#">Project</a>
- <ul class="dropdown">
- <li><a href="http://gudhi.gforge.inria.fr/people/">People</a></li>
- <li><a href="http://gudhi.gforge.inria.fr/keepintouch/">Keep in touch</a></li>
- <li><a href="http://gudhi.gforge.inria.fr/partners/">Partners and Funding</a></li>
- <li><a href="http://gudhi.gforge.inria.fr/relatedprojects/">Related projects</a></li>
- <li><a href="http://gudhi.gforge.inria.fr/theyaretalkingaboutus/">They are talking about us</a></li>
- </ul>
- </li>
- <li class="divider"></li>
- <li class="has-dropdown">
- <a href="#">Download</a>
- <ul class="dropdown">
- <li><a href="http://gudhi.gforge.inria.fr/licensing/">Licensing</a></li>
- <li><a href="https://gforge.inria.fr/frs/?group_id=3865" target="_blank">Get the sources</a></li>
- <li><a href="https://gforge.inria.fr/frs/download.php/file/37113/GUDHI_2.0.0_OSX_UTILS.beta.tar.gz" target="_blank">Utils for Mac OSx</a></li>
- <li><a href="https://gforge.inria.fr/frs/download.php/file/37112/GUDHI_2.0.0_WIN64_UTILS.beta.zip" target="_blank">Utils for Win x64</a></li>
- </ul>
- </li>
- <li class="divider"></li>
- <li class="has-dropdown">
- <a href="#">Documentation</a>
- <ul class="dropdown">
- <li><a href="http://gudhi.gforge.inria.fr/doc/latest/">C++ documentation</a></li>
- <li><a href="http://gudhi.gforge.inria.fr/doc/latest/installation.html">C++ installation manual</a></li>
- <li><a href="http://gudhi.gforge.inria.fr/python/latest/">Python documentation</a></li>
- <li><a href="http://gudhi.gforge.inria.fr/python/latest/installation.html">Python installation manual</a></li>
- <li><a href="http://gudhi.gforge.inria.fr/utils/">Utilities</a></li>
- <li><a href="http://bertrand.michel.perso.math.cnrs.fr/Enseignements/TDA-Gudhi-Python.html" target="_blank">Tutorial</a></li>
- </ul>
- </li>
- <li class="divider"></li>
- <li><a href="http://gudhi.gforge.inria.fr/interfaces/">Interfaces</a></li>
- <li class="divider"></li>
- </ul>
- </section>
- </nav>
+ <nav class="top-bar" role="navigation" data-topbar>
+ <ul class="title-area">
+ <li class="name">
+ <h1 class="show-for-small-only"><a href="" class="icon-tree"> GUDHI C++ library</a></h1>
+ </li>
+ <!-- Remove the class "menu-icon" to get rid of menu icon. Take out "Menu" to just have icon alone -->
+ <li class="toggle-topbar menu-icon"><a href="#"><span>Navigation</span></a></li>
+ </ul>
+ <section class="top-bar-section">
+ <ul class="right">
+ <li class="divider"></li>
+ <li><a href="/contact/">Contact</a></li>
+ </ul>
+ <ul class="left">
+ <li><a href="/"> <img src="/assets/img/home.png" alt="&nbsp;&nbsp;GUDHI">&nbsp;&nbsp;GUDHI </a></li>
+ <li class="divider"></li>
+ <li class="has-dropdown">
+ <a href="#">Project</a>
+ <ul class="dropdown">
+ <li><a href="/people/">People</a></li>
+ <li><a href="/keepintouch/">Keep in touch</a></li>
+ <li><a href="/partners/">Partners and Funding</a></li>
+ <li><a href="/relatedprojects/">Related projects</a></li>
+ <li><a href="/theyaretalkingaboutus/">They are talking about us</a></li>
+ </ul>
+ </li>
+ <li class="divider"></li>
+ <li class="has-dropdown">
+ <a href="#">Download</a>
+ <ul class="dropdown">
+ <li><a href="/licensing/">Licensing</a></li>
+ <li><a href="https://gforge.inria.fr/frs/download.php/latestzip/5253/library-latest.zip" target="_blank">Get the latest sources</a></li>
+ <li><a href="https://gforge.inria.fr/frs/download.php/latestzip/5280/utils_osx-latest.zip" target="_blank">Utils for Mac OSx</a></li>
+ <li><a href="https://gforge.inria.fr/frs/download.php/latestzip/5279/utils_win64-latest.zip" target="_blank">Utils for Win x64</a></li>
+ </ul>
+ </li>
+ <li class="divider"></li>
+ <li class="has-dropdown">
+ <a href="#">Documentation</a>
+ <ul class="dropdown">
+ <li><a href="/doc/latest/">C++ documentation</a></li>
+ <li><a href="/doc/latest/installation.html">C++ installation manual</a></li>
+ <li><a href="/python/latest/">Python documentation</a></li>
+ <li><a href="/python/latest/installation.html">Python installation manual</a></li>
+ <li><a href="/utils/">Utilities</a></li>
+ <li><a href="/tutorials/">Tutorials</a></li>
+ <li><a href="/dockerfile/">Dockerfile</a></li>
+ </ul>
+ </li>
+ <li class="divider"></li>
+ <li><a href="/interfaces/">Interfaces</a></li>
+ <li class="divider"></li>
+ </ul>
+ </section>
+ </nav>
</div><!-- /#navigation -->
<!-- GUDHI website header BEGIN -->
diff --git a/cython/doc/alpha_complex_ref.rst b/cython/doc/alpha_complex_ref.rst
index 6a122b09..7da79543 100644
--- a/cython/doc/alpha_complex_ref.rst
+++ b/cython/doc/alpha_complex_ref.rst
@@ -1,3 +1,7 @@
+:orphan:
+
+.. To get rid of WARNING: document isn't included in any toctree
+
==============================
Alpha complex reference manual
==============================
diff --git a/cython/doc/alpha_complex_sum.rst b/cython/doc/alpha_complex_sum.inc
index 1680a712..1680a712 100644
--- a/cython/doc/alpha_complex_sum.rst
+++ b/cython/doc/alpha_complex_sum.inc
diff --git a/cython/doc/alpha_complex_user.rst b/cython/doc/alpha_complex_user.rst
index db7edd6f..d1e9c7cd 100644
--- a/cython/doc/alpha_complex_user.rst
+++ b/cython/doc/alpha_complex_user.rst
@@ -1,11 +1,15 @@
+:orphan:
+
+.. To get rid of WARNING: document isn't included in any toctree
+
Alpha complex user manual
=========================
Definition
----------
-.. include:: alpha_complex_sum.rst
+.. include:: alpha_complex_sum.inc
-Alpha_complex is constructing a :doc:`Simplex_tree <simplex_tree_sum>` using
+Alpha_complex is constructing a :doc:`Simplex_tree <simplex_tree_ref>` using
`Delaunay Triangulation <http://doc.cgal.org/latest/Triangulation/index.html#Chapter_Triangulations>`_
:cite:`cgal:hdj-t-15b` from `CGAL <http://www.cgal.org/>`_ (the Computational Geometry Algorithms Library
:cite:`cgal:eb-15b`).
@@ -99,9 +103,9 @@ Filtration value computation algorithm
**end for**
**end for**
**end for**
-
+
make_filtration_non_decreasing()
-
+
prune_above_filtration()
Dimension 2
diff --git a/cython/doc/bottleneck_distance_sum.rst b/cython/doc/bottleneck_distance_sum.inc
index 030fad9e..030fad9e 100644
--- a/cython/doc/bottleneck_distance_sum.rst
+++ b/cython/doc/bottleneck_distance_sum.inc
diff --git a/cython/doc/bottleneck_distance_user.rst b/cython/doc/bottleneck_distance_user.rst
index 7692dce2..605db022 100644
--- a/cython/doc/bottleneck_distance_user.rst
+++ b/cython/doc/bottleneck_distance_user.rst
@@ -1,9 +1,13 @@
+:orphan:
+
+.. To get rid of WARNING: document isn't included in any toctree
+
Bottleneck distance user manual
===============================
Definition
----------
-.. include:: bottleneck_distance_sum.rst
+.. include:: bottleneck_distance_sum.inc
Function
--------
diff --git a/cython/doc/citation.rst b/cython/doc/citation.rst
index f4fdf83b..117eb9dd 100644
--- a/cython/doc/citation.rst
+++ b/cython/doc/citation.rst
@@ -1,3 +1,7 @@
+:orphan:
+
+.. To get rid of WARNING: document isn't included in any toctree
+
Acknowledging the GUDHI library
###############################
diff --git a/cython/doc/conf.py b/cython/doc/conf.py
index a13c9751..4a54d4fd 100755
--- a/cython/doc/conf.py
+++ b/cython/doc/conf.py
@@ -85,7 +85,7 @@ version = gudhi.__version__
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
-exclude_patterns = ['_build']
+exclude_patterns = ['_build', '*.inc']
# The reST default role (used for this markup: `text`) to use for all
# documents.
@@ -125,6 +125,7 @@ html_theme_options = {
"sidebarbgcolor": "#A1ADCD",
"sidebartextcolor": "black",
"sidebarlinkcolor": "#334D5C",
+ "body_max_width": "1200px",
}
# Add any paths that contain custom themes here, relative to this directory.
diff --git a/cython/doc/cubical_complex_ref.rst b/cython/doc/cubical_complex_ref.rst
index 84aa4223..1fe9d5fb 100644
--- a/cython/doc/cubical_complex_ref.rst
+++ b/cython/doc/cubical_complex_ref.rst
@@ -1,3 +1,7 @@
+:orphan:
+
+.. To get rid of WARNING: document isn't included in any toctree
+
Cubical complex reference manual
################################
diff --git a/cython/doc/cubical_complex_sum.rst b/cython/doc/cubical_complex_sum.inc
index 280ad0e0..280ad0e0 100644
--- a/cython/doc/cubical_complex_sum.rst
+++ b/cython/doc/cubical_complex_sum.inc
diff --git a/cython/doc/cubical_complex_user.rst b/cython/doc/cubical_complex_user.rst
index 34598f02..320bd79b 100644
--- a/cython/doc/cubical_complex_user.rst
+++ b/cython/doc/cubical_complex_user.rst
@@ -1,3 +1,7 @@
+:orphan:
+
+.. To get rid of WARNING: document isn't included in any toctree
+
Cubical complex user manual
===========================
Definition
@@ -144,6 +148,7 @@ the program output is:
.. testoutput::
Periodic cubical complex is of dimension 2 - 42 simplices.
+
Examples.
---------
@@ -152,6 +157,6 @@ End user programs are available in cython/example/ folder.
Bibliography
============
-.. bibliography:: ../../bibliography.bib
+.. bibliography:: ../../biblio/bibliography.bib
:filter: docnames
:style: unsrt
diff --git a/cython/doc/euclidean_strong_witness_complex_ref.rst b/cython/doc/euclidean_strong_witness_complex_ref.rst
index bebf0f9a..1a602cd5 100644
--- a/cython/doc/euclidean_strong_witness_complex_ref.rst
+++ b/cython/doc/euclidean_strong_witness_complex_ref.rst
@@ -1,3 +1,7 @@
+:orphan:
+
+.. To get rid of WARNING: document isn't included in any toctree
+
=================================================
Euclidean strong witness complex reference manual
=================================================
diff --git a/cython/doc/euclidean_witness_complex_ref.rst b/cython/doc/euclidean_witness_complex_ref.rst
index 29b8806f..28daf965 100644
--- a/cython/doc/euclidean_witness_complex_ref.rst
+++ b/cython/doc/euclidean_witness_complex_ref.rst
@@ -1,3 +1,7 @@
+:orphan:
+
+.. To get rid of WARNING: document isn't included in any toctree
+
==========================================
Euclidean witness complex reference manual
==========================================
diff --git a/cython/doc/examples.rst b/cython/doc/examples.rst
index 1e596e18..d42f5a92 100644
--- a/cython/doc/examples.rst
+++ b/cython/doc/examples.rst
@@ -1,3 +1,7 @@
+:orphan:
+
+.. To get rid of WARNING: document isn't included in any toctree
+
Examples
########
diff --git a/cython/doc/fileformats.rst b/cython/doc/fileformats.rst
index 4f0b6f6d..ff20f26e 100644
--- a/cython/doc/fileformats.rst
+++ b/cython/doc/fileformats.rst
@@ -1,3 +1,7 @@
+:orphan:
+
+.. To get rid of WARNING: document isn't included in any toctree
+
File formats
############
diff --git a/cython/doc/index.rst b/cython/doc/index.rst
index 3945d72a..4e444fb0 100644
--- a/cython/doc/index.rst
+++ b/cython/doc/index.rst
@@ -34,32 +34,32 @@ Data structures
Alpha complex
=============
-.. include:: alpha_complex_sum.rst
+.. include:: alpha_complex_sum.inc
Cubical complex
===============
-.. include:: cubical_complex_sum.rst
+.. include:: cubical_complex_sum.inc
Rips complex
============
-.. include:: rips_complex_sum.rst
+.. include:: rips_complex_sum.inc
Simplex tree
============
-.. include:: simplex_tree_sum.rst
+.. include:: simplex_tree_sum.inc
Tangential complex
==================
-.. include:: tangential_complex_sum.rst
+.. include:: tangential_complex_sum.inc
Witness complex
===============
-.. include:: witness_complex_sum.rst
+.. include:: witness_complex_sum.inc
Toolbox
@@ -68,17 +68,17 @@ Toolbox
Bottleneck distance
===================
-.. include:: bottleneck_distance_sum.rst
+.. include:: bottleneck_distance_sum.inc
Persistence cohomology
======================
-.. include:: persistent_cohomology_sum.rst
+.. include:: persistent_cohomology_sum.inc
Persistence graphical tools
===========================
-.. include:: persistence_graphical_tools_sum.rst
+.. include:: persistence_graphical_tools_sum.inc
Bibliography
************
diff --git a/cython/doc/installation.rst b/cython/doc/installation.rst
index c182f176..43ff85c5 100644
--- a/cython/doc/installation.rst
+++ b/cython/doc/installation.rst
@@ -1,12 +1,16 @@
+:orphan:
+
+.. To get rid of WARNING: document isn't included in any toctree
+
Installation
############
Compiling
*********
-
-The library uses c++11 and requires `Boost <http://www.boost.org/>`_ with
-version 1.48.0 or more recent. It is a multi-platform library and compiles on
-Linux, Mac OSX and Visual Studio 2015.
+The library uses c++11 and requires `Boost <https://www.boost.org/>`_ ≥ 1.48.0
+and `CMake <https://www.cmake.org/>`_ ≥ 3.1.
+It is a multi-platform library and compiles on Linux, Mac OSX and Visual
+Studio 2015.
It also requires cmake to generate makefiles, and cython to compile the
library.
@@ -43,6 +47,9 @@ following command in a terminal:
export PYTHONPATH='$PYTHONPATH:/path-to-gudhi/build/cython'
ctest -R py_test
+If tests fail, please try to :code:`import gudhi` and check the errors.
+The problem can come from a third-party library bad link or installation.
+
Documentation
=============
diff --git a/cython/doc/periodic_cubical_complex_ref.rst b/cython/doc/periodic_cubical_complex_ref.rst
index c6190a1b..4b831647 100644
--- a/cython/doc/periodic_cubical_complex_ref.rst
+++ b/cython/doc/periodic_cubical_complex_ref.rst
@@ -1,3 +1,7 @@
+:orphan:
+
+.. To get rid of WARNING: document isn't included in any toctree
+
Periodic cubical complex reference manual
#########################################
diff --git a/cython/doc/persistence_graphical_tools_ref.rst b/cython/doc/persistence_graphical_tools_ref.rst
index 27c2f68a..a2c6bcef 100644
--- a/cython/doc/persistence_graphical_tools_ref.rst
+++ b/cython/doc/persistence_graphical_tools_ref.rst
@@ -1,8 +1,11 @@
+:orphan:
+
+.. To get rid of WARNING: document isn't included in any toctree
+
============================================
Persistence graphical tools reference manual
============================================
.. autofunction:: gudhi.__min_birth_max_death
-.. autofunction:: gudhi.show_palette_values
.. autofunction:: gudhi.plot_persistence_barcode
.. autofunction:: gudhi.plot_persistence_diagram
diff --git a/cython/doc/persistence_graphical_tools_sum.rst b/cython/doc/persistence_graphical_tools_sum.inc
index d602daa7..d602daa7 100644
--- a/cython/doc/persistence_graphical_tools_sum.rst
+++ b/cython/doc/persistence_graphical_tools_sum.inc
diff --git a/cython/doc/persistence_graphical_tools_user.rst b/cython/doc/persistence_graphical_tools_user.rst
index 9033331f..292915eb 100644
--- a/cython/doc/persistence_graphical_tools_user.rst
+++ b/cython/doc/persistence_graphical_tools_user.rst
@@ -1,49 +1,26 @@
+:orphan:
+
+.. To get rid of WARNING: document isn't included in any toctree
+
Persistence graphical tools user manual
=======================================
Definition
----------
-.. include:: persistence_graphical_tools_sum.rst
-
-
-Show palette values
--------------------
-
-This function is useful to show the color palette values of dimension:
-
+.. include:: persistence_graphical_tools_sum.inc
-.. testcode::
-
- import gudhi
- plt = gudhi.show_palette_values(alpha=1.0)
- plt.show()
-
-.. plot::
-
- import gudhi
- plt = gudhi.show_palette_values(alpha=1.0)
- plt.show()
Show persistence as a barcode
-----------------------------
This function can display the persistence result as a barcode:
-.. testcode::
-
- import gudhi
-
- periodic_cc = gudhi.PeriodicCubicalComplex(perseus_file=gudhi.__root_source_dir__ + \
- '/data/bitmap/3d_torus.txt')
- diag = periodic_cc.persistence()
- plt = gudhi.plot_persistence_barcode(diag)
- plt.show()
-
.. plot::
+ :include-source:
import gudhi
- periodic_cc = gudhi.PeriodicCubicalComplex(perseus_file=gudhi.__root_source_dir__ + \
- '/data/bitmap/3d_torus.txt')
+ perseus_file = gudhi.__root_source_dir__ + '/data/bitmap/3d_torus.txt'
+ periodic_cc = gudhi.PeriodicCubicalComplex(perseus_file=perseus_file)
diag = periodic_cc.persistence()
print("diag = ", diag)
plt = gudhi.plot_persistence_barcode(diag)
@@ -54,24 +31,32 @@ Show persistence as a diagram
This function can display the persistence result as a diagram:
-.. testcode::
+.. plot::
+ :include-source:
import gudhi
-
- rips_complex = gudhi.RipsComplex(off_file=gudhi.__root_source_dir__ + \
- '/data/points/tore3D_1307.off', max_edge_length=0.2)
- simplex_tree = rips_complex.create_simplex_tree(max_dimension=3)
- diag = simplex_tree.persistence()
- plt = gudhi.plot_persistence_diagram(diag, band_boot=0.13)
+
+ # rips_on_tore3D_1307.pers obtained from write_persistence_diagram method
+ persistence_file=gudhi.__root_source_dir__ + \
+ '/data/persistence_diagram/rips_on_tore3D_1307.pers'
+ plt = gudhi.plot_persistence_diagram(persistence_file=persistence_file,
+ legend=True)
plt.show()
+If you want more information on a specific dimension, for instance:
+
.. plot::
+ :include-source:
import gudhi
- rips_complex = gudhi.RipsComplex(off_file=gudhi.__root_source_dir__ + \
- '/data/points/tore3D_1307.off', max_edge_length=0.2)
- simplex_tree = rips_complex.create_simplex_tree(max_dimension=3)
- diag = simplex_tree.persistence()
- plt = gudhi.plot_persistence_diagram(diag, band_boot=0.13)
+ persistence_file=gudhi.__root_source_dir__ + \
+ '/data/persistence_diagram/rips_on_tore3D_1307.pers'
+ diag = \
+ gudhi.read_persistence_intervals_grouped_by_dimension(persistence_file=\
+ persistence_file)
+ dim = 1
+ # Display all points with some transparency
+ plt = gudhi.plot_persistence_diagram([(dim,interval) for interval in diag[dim]],
+ max_plots=0, alpha=0.1)
plt.show()
diff --git a/cython/doc/persistent_cohomology_sum.rst b/cython/doc/persistent_cohomology_sum.inc
index a26df1dc..a26df1dc 100644
--- a/cython/doc/persistent_cohomology_sum.rst
+++ b/cython/doc/persistent_cohomology_sum.inc
diff --git a/cython/doc/persistent_cohomology_user.rst b/cython/doc/persistent_cohomology_user.rst
index bf90c163..ce7fc685 100644
--- a/cython/doc/persistent_cohomology_user.rst
+++ b/cython/doc/persistent_cohomology_user.rst
@@ -1,3 +1,7 @@
+:orphan:
+
+.. To get rid of WARNING: document isn't included in any toctree
+
Persistent cohomology user manual
=================================
Definition
diff --git a/cython/doc/pyplots/barcode_persistence.py b/cython/doc/pyplots/barcode_persistence.py
deleted file mode 100755
index de33d506..00000000
--- a/cython/doc/pyplots/barcode_persistence.py
+++ /dev/null
@@ -1,7 +0,0 @@
-import gudhi
-
-periodic_cc = gudhi.PeriodicCubicalComplex(perseus_file=gudhi.__root_source_dir__ + \
- '/data/bitmap/3d_torus.txt')
-diag = periodic_cc.persistence()
-plt = gudhi.plot_persistence_barcode(diag)
-plt.show()
diff --git a/cython/doc/pyplots/diagram_persistence.py b/cython/doc/pyplots/diagram_persistence.py
deleted file mode 100755
index c2fbf801..00000000
--- a/cython/doc/pyplots/diagram_persistence.py
+++ /dev/null
@@ -1,8 +0,0 @@
-import gudhi
-
-rips_complex = gudhi.RipsComplex(off_file=gudhi.__root_source_dir__ + \
- '/data/points/tore3D_1307.off', max_edge_length=0.2)
-simplex_tree = rips_complex.create_simplex_tree(max_dimension=3)
-diag = simplex_tree.persistence()
-plt = gudhi.plot_persistence_diagram(diag, band_boot=0.13)
-plt.show()
diff --git a/cython/doc/pyplots/show_palette_values.py b/cython/doc/pyplots/show_palette_values.py
deleted file mode 100755
index fdf9645f..00000000
--- a/cython/doc/pyplots/show_palette_values.py
+++ /dev/null
@@ -1,3 +0,0 @@
-import gudhi
-plt = gudhi.show_palette_values(alpha=1.0)
-plt.show()
diff --git a/cython/doc/reader_utils_ref.rst b/cython/doc/reader_utils_ref.rst
index 9c1ea6fc..f3ecebad 100644
--- a/cython/doc/reader_utils_ref.rst
+++ b/cython/doc/reader_utils_ref.rst
@@ -1,3 +1,7 @@
+:orphan:
+
+.. To get rid of WARNING: document isn't included in any toctree
+
=============================
Reader utils reference manual
=============================
diff --git a/cython/doc/rips_complex_ref.rst b/cython/doc/rips_complex_ref.rst
index b17dc4e0..22b5616c 100644
--- a/cython/doc/rips_complex_ref.rst
+++ b/cython/doc/rips_complex_ref.rst
@@ -1,3 +1,7 @@
+:orphan:
+
+.. To get rid of WARNING: document isn't included in any toctree
+
=============================
Rips complex reference manual
=============================
diff --git a/cython/doc/rips_complex_sum.rst b/cython/doc/rips_complex_sum.inc
index 5616bfa9..5616bfa9 100644
--- a/cython/doc/rips_complex_sum.rst
+++ b/cython/doc/rips_complex_sum.inc
diff --git a/cython/doc/rips_complex_user.rst b/cython/doc/rips_complex_user.rst
index 96ba9944..a8c06cf9 100644
--- a/cython/doc/rips_complex_user.rst
+++ b/cython/doc/rips_complex_user.rst
@@ -1,3 +1,7 @@
+:orphan:
+
+.. To get rid of WARNING: document isn't included in any toctree
+
Rips complex user manual
=========================
Definition
@@ -101,8 +105,8 @@ Finally, it is asked to display information about the Rips complex.
.. testcode::
import gudhi
- rips_complex = gudhi.RipsComplex(off_file=gudhi.__root_source_dir__ + \
- '/data/points/alphacomplexdoc.off', max_edge_length=12.0)
+ point_cloud = gudhi.read_off(off_file=gudhi.__root_source_dir__ + '/data/points/alphacomplexdoc.off')
+ rips_complex = gudhi.RipsComplex(points=point_cloud, max_edge_length=12.0)
simplex_tree = rips_complex.create_simplex_tree(max_dimension=1)
result_str = 'Rips complex is of dimension ' + repr(simplex_tree.dimension()) + ' - ' + \
repr(simplex_tree.num_simplices()) + ' simplices - ' + \
@@ -197,7 +201,7 @@ Example from csv file
^^^^^^^^^^^^^^^^^^^^^
This example builds the :doc:`Rips_complex <rips_complex_ref>` from the given
-points in an OFF file, and max_edge_length value.
+distance matrix in a csv file, and max_edge_length value.
Then it creates a :doc:`Simplex_tree <simplex_tree_ref>` with it.
Finally, it is asked to display information about the Rips complex.
@@ -206,8 +210,9 @@ Finally, it is asked to display information about the Rips complex.
.. testcode::
import gudhi
- rips_complex = gudhi.RipsComplex(csv_file=gudhi.__root_source_dir__ + \
- '/data/distance_matrix/full_square_distance_matrix.csv', max_edge_length=12.0)
+ distance_matrix = gudhi.read_lower_triangular_matrix_from_csv_file(csv_file=gudhi.__root_source_dir__ + \
+ '/data/distance_matrix/full_square_distance_matrix.csv')
+ rips_complex = gudhi.RipsComplex(distance_matrix=distance_matrix, max_edge_length=12.0)
simplex_tree = rips_complex.create_simplex_tree(max_dimension=1)
result_str = 'Rips complex is of dimension ' + repr(simplex_tree.dimension()) + ' - ' + \
repr(simplex_tree.num_simplices()) + ' simplices - ' + \
@@ -240,3 +245,72 @@ the program output is:
[0, 3] -> 9.43
[4, 6] -> 9.49
[3, 6] -> 11.00
+
+Correlation matrix
+------------------
+
+Example from a correlation matrix
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Analogously to the case of distance matrix, Rips complexes can be also constructed based on correlation matrix.
+Given a correlation matrix M, comportment-wise 1-M is a distance matrix.
+This example builds the one skeleton graph from the given corelation matrix and threshold value.
+Then it creates a :doc:`Simplex_tree <simplex_tree_ref>` with it.
+
+Finally, it is asked to display information about the simplicial complex.
+
+.. testcode::
+
+ import gudhi
+ import numpy as np
+
+ # User defined correlation matrix is:
+ # |1 0.06 0.23 0.01 0.89|
+ # |0.06 1 0.74 0.01 0.61|
+ # |0.23 0.74 1 0.72 0.03|
+ # |0.01 0.01 0.72 1 0.7 |
+ # |0.89 0.61 0.03 0.7 1 |
+ correlation_matrix=np.array([[1., 0.06, 0.23, 0.01, 0.89],
+ [0.06, 1., 0.74, 0.01, 0.61],
+ [0.23, 0.74, 1., 0.72, 0.03],
+ [0.01, 0.01, 0.72, 1., 0.7],
+ [0.89, 0.61, 0.03, 0.7, 1.]], float)
+
+ distance_matrix = np.ones((correlation_matrix.shape),float) - correlation_matrix
+ rips_complex = gudhi.RipsComplex(distance_matrix=distance_matrix, max_edge_length=1.0)
+
+ simplex_tree = rips_complex.create_simplex_tree(max_dimension=1)
+ result_str = 'Rips complex is of dimension ' + repr(simplex_tree.dimension()) + ' - ' + \
+ repr(simplex_tree.num_simplices()) + ' simplices - ' + \
+ repr(simplex_tree.num_vertices()) + ' vertices.'
+ print(result_str)
+ fmt = '%s -> %.2f'
+ for filtered_value in simplex_tree.get_filtration():
+ print(fmt % tuple(filtered_value))
+
+When launching (Rips maximal distance between 2 points is 12.0, is expanded
+until dimension 1 - one skeleton graph in other words), the output is:
+
+.. testoutput::
+
+ Rips complex is of dimension 1 - 15 simplices - 5 vertices.
+ [0] -> 0.00
+ [1] -> 0.00
+ [2] -> 0.00
+ [3] -> 0.00
+ [4] -> 0.00
+ [0, 4] -> 0.11
+ [1, 2] -> 0.26
+ [2, 3] -> 0.28
+ [3, 4] -> 0.30
+ [1, 4] -> 0.39
+ [0, 2] -> 0.77
+ [0, 1] -> 0.94
+ [2, 4] -> 0.97
+ [0, 3] -> 0.99
+ [1, 3] -> 0.99
+
+.. note::
+ As persistence diagrams points will be under the diagonal,
+ bottleneck distance and persistence graphical tool will not work properly,
+ this is a known issue.
diff --git a/cython/doc/simplex_tree_ref.rst b/cython/doc/simplex_tree_ref.rst
index 6d196843..9eb8c199 100644
--- a/cython/doc/simplex_tree_ref.rst
+++ b/cython/doc/simplex_tree_ref.rst
@@ -1,3 +1,7 @@
+:orphan:
+
+.. To get rid of WARNING: document isn't included in any toctree
+
=============================
Simplex tree reference manual
=============================
diff --git a/cython/doc/simplex_tree_sum.rst b/cython/doc/simplex_tree_sum.inc
index fb0e54c1..fb0e54c1 100644
--- a/cython/doc/simplex_tree_sum.rst
+++ b/cython/doc/simplex_tree_sum.inc
diff --git a/cython/doc/simplex_tree_user.rst b/cython/doc/simplex_tree_user.rst
index 4b1dde19..aebeb29f 100644
--- a/cython/doc/simplex_tree_user.rst
+++ b/cython/doc/simplex_tree_user.rst
@@ -1,9 +1,13 @@
+:orphan:
+
+.. To get rid of WARNING: document isn't included in any toctree
+
Simplex tree user manual
========================
Definition
----------
-.. include:: simplex_tree_sum.rst
+.. include:: simplex_tree_sum.inc
A simplicial complex :math:`\mathbf{K}` on a set of vertices :math:`V = \{1, \cdots ,|V|\}` is a collection of
simplices :math:`\{\sigma\}`, :math:`\sigma \subseteq V` such that
diff --git a/cython/doc/strong_witness_complex_ref.rst b/cython/doc/strong_witness_complex_ref.rst
index 4ed4fe46..d624d711 100644
--- a/cython/doc/strong_witness_complex_ref.rst
+++ b/cython/doc/strong_witness_complex_ref.rst
@@ -1,3 +1,7 @@
+:orphan:
+
+.. To get rid of WARNING: document isn't included in any toctree
+
=======================================
Strong witness complex reference manual
=======================================
diff --git a/cython/doc/tangential_complex_ref.rst b/cython/doc/tangential_complex_ref.rst
index 35589475..cdfda082 100644
--- a/cython/doc/tangential_complex_ref.rst
+++ b/cython/doc/tangential_complex_ref.rst
@@ -1,3 +1,7 @@
+:orphan:
+
+.. To get rid of WARNING: document isn't included in any toctree
+
===================================
Tangential complex reference manual
===================================
diff --git a/cython/doc/tangential_complex_sum.rst b/cython/doc/tangential_complex_sum.inc
index 72b4d7ba..72b4d7ba 100644
--- a/cython/doc/tangential_complex_sum.rst
+++ b/cython/doc/tangential_complex_sum.inc
diff --git a/cython/doc/tangential_complex_user.rst b/cython/doc/tangential_complex_user.rst
index efa6d7ce..5ce69e86 100644
--- a/cython/doc/tangential_complex_user.rst
+++ b/cython/doc/tangential_complex_user.rst
@@ -1,6 +1,10 @@
+:orphan:
+
+.. To get rid of WARNING: document isn't included in any toctree
+
Tangential complex user manual
==============================
-.. include:: tangential_complex_sum.rst
+.. include:: tangential_complex_sum.inc
Definition
----------
@@ -122,8 +126,8 @@ This example builds the Tangential complex of point set read in an OFF file.
.. testcode::
import gudhi
- tc = gudhi.TangentialComplex(off_file=gudhi.__root_source_dir__ + \
- '/data/points/alphacomplexdoc.off')
+ tc = gudhi.TangentialComplex(intrisic_dim = 1,
+ off_file=gudhi.__root_source_dir__ + '/data/points/alphacomplexdoc.off')
result_str = 'Tangential contains ' + repr(tc.num_simplices()) + \
' simplices - ' + repr(tc.num_vertices()) + ' vertices.'
print(result_str)
@@ -169,7 +173,8 @@ simplices.
.. testcode::
import gudhi
- tc = gudhi.TangentialComplex(points=[[0.0, 0.0], [1.0, 0.0], [0.0, 1.0], [1.0, 1.0]])
+ tc = gudhi.TangentialComplex(intrisic_dim = 1,
+ points=[[0.0, 0.0], [1.0, 0.0], [0.0, 1.0], [1.0, 1.0]])
result_str = 'Tangential contains ' + repr(tc.num_vertices()) + ' vertices.'
print(result_str)
diff --git a/cython/doc/todos.rst b/cython/doc/todos.rst
index 78972a4c..ca274ced 100644
--- a/cython/doc/todos.rst
+++ b/cython/doc/todos.rst
@@ -1,3 +1,7 @@
+:orphan:
+
+.. To get rid of WARNING: document isn't included in any toctree
+
==========
To be done
==========
diff --git a/cython/doc/witness_complex_ref.rst b/cython/doc/witness_complex_ref.rst
index c78760cb..9987d3fd 100644
--- a/cython/doc/witness_complex_ref.rst
+++ b/cython/doc/witness_complex_ref.rst
@@ -1,3 +1,7 @@
+:orphan:
+
+.. To get rid of WARNING: document isn't included in any toctree
+
================================
Witness complex reference manual
================================
diff --git a/cython/doc/witness_complex_sum.rst b/cython/doc/witness_complex_sum.inc
index a8a126a0..a8a126a0 100644
--- a/cython/doc/witness_complex_sum.rst
+++ b/cython/doc/witness_complex_sum.inc
diff --git a/cython/doc/witness_complex_user.rst b/cython/doc/witness_complex_user.rst
index 99be5185..40e94134 100644
--- a/cython/doc/witness_complex_user.rst
+++ b/cython/doc/witness_complex_user.rst
@@ -1,7 +1,11 @@
+:orphan:
+
+.. To get rid of WARNING: document isn't included in any toctree
+
Witness complex user manual
===========================
-.. include:: witness_complex_sum.rst
+.. include:: witness_complex_sum.inc
Definitions
-----------
diff --git a/cython/example/alpha_complex_diagram_persistence_from_off_file_example.py b/cython/example/alpha_complex_diagram_persistence_from_off_file_example.py
index b4487be4..4abe22d4 100755
--- a/cython/example/alpha_complex_diagram_persistence_from_off_file_example.py
+++ b/cython/example/alpha_complex_diagram_persistence_from_off_file_example.py
@@ -9,7 +9,7 @@ import argparse
Author(s): Vincent Rouvreau
- Copyright (C) 2016 INRIA
+ Copyright (C) 2016 Inria
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
@@ -26,7 +26,7 @@ import argparse
"""
__author__ = "Vincent Rouvreau"
-__copyright__ = "Copyright (C) 2016 INRIA"
+__copyright__ = "Copyright (C) 2016 Inria"
__license__ = "GPL v3"
parser = argparse.ArgumentParser(description='AlphaComplex creation from '
@@ -38,7 +38,7 @@ parser = argparse.ArgumentParser(description='AlphaComplex creation from '
'points from the given OFF file.')
parser.add_argument("-f", "--file", type=str, required=True)
parser.add_argument("-a", "--max_alpha_square", type=float, default=0.5)
-parser.add_argument("-b", "--band_boot", type=float, default=0.)
+parser.add_argument("-b", "--band", type=float, default=0.)
parser.add_argument('--no-diagram', default=False, action='store_true' , help='Flag for not to display the diagrams')
args = parser.parse_args()
@@ -64,7 +64,7 @@ with open(args.file, 'r') as f:
print(simplex_tree.betti_numbers())
if args.no_diagram == False:
- pplot = gudhi.plot_persistence_diagram(diag, band_boot=args.band_boot)
+ pplot = gudhi.plot_persistence_diagram(diag, band=args.band)
pplot.show()
else:
print(args.file, "is not a valid OFF file")
diff --git a/cython/example/alpha_complex_from_points_example.py b/cython/example/alpha_complex_from_points_example.py
index 7d6278ce..ad73c744 100755
--- a/cython/example/alpha_complex_from_points_example.py
+++ b/cython/example/alpha_complex_from_points_example.py
@@ -8,7 +8,7 @@ from gudhi import AlphaComplex, SimplexTree
Author(s): Vincent Rouvreau
- Copyright (C) 2016 INRIA
+ Copyright (C) 2016 Inria
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
@@ -25,7 +25,7 @@ from gudhi import AlphaComplex, SimplexTree
"""
__author__ = "Vincent Rouvreau"
-__copyright__ = "Copyright (C) 2016 INRIA"
+__copyright__ = "Copyright (C) 2016 Inria"
__license__ = "GPL v3"
print("#####################################################################")
diff --git a/cython/example/alpha_rips_persistence_bottleneck_distance.py b/cython/example/alpha_rips_persistence_bottleneck_distance.py
index ab5fc1e9..b51fa7a8 100755
--- a/cython/example/alpha_rips_persistence_bottleneck_distance.py
+++ b/cython/example/alpha_rips_persistence_bottleneck_distance.py
@@ -10,7 +10,7 @@ import math
Author(s): Vincent Rouvreau
- Copyright (C) 2016 INRIA
+ Copyright (C) 2016 Inria
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
@@ -27,7 +27,7 @@ import math
"""
__author__ = "Vincent Rouvreau"
-__copyright__ = "Copyright (C) 2016 INRIA"
+__copyright__ = "Copyright (C) 2016 Inria"
__license__ = "GPL v3"
parser = argparse.ArgumentParser(description='AlphaComplex and RipsComplex '
@@ -45,13 +45,14 @@ args = parser.parse_args()
with open(args.file, 'r') as f:
first_line = f.readline()
if (first_line == 'OFF\n') or (first_line == 'nOFF\n'):
+ point_cloud = gudhi.read_off(off_file=args.file)
print("#####################################################################")
print("RipsComplex creation from points read in a OFF file")
message = "RipsComplex with max_edge_length=" + repr(args.threshold)
print(message)
- rips_complex = gudhi.RipsComplex(off_file=args.file,
+ rips_complex = gudhi.RipsComplex(points=point_cloud,
max_edge_length=args.threshold)
rips_stree = rips_complex.create_simplex_tree(max_dimension=args.max_dimension)
@@ -67,7 +68,7 @@ with open(args.file, 'r') as f:
message = "AlphaComplex with max_edge_length=" + repr(args.threshold)
print(message)
- alpha_complex = gudhi.AlphaComplex(off_file=args.file)
+ alpha_complex = gudhi.AlphaComplex(points=point_cloud)
alpha_stree = alpha_complex.create_simplex_tree(max_alpha_square=(args.threshold * args.threshold))
message = "Number of simplices=" + repr(alpha_stree.num_simplices())
diff --git a/cython/example/bottleneck_basic_example.py b/cython/example/bottleneck_basic_example.py
index 31cecb29..287956e7 100755
--- a/cython/example/bottleneck_basic_example.py
+++ b/cython/example/bottleneck_basic_example.py
@@ -8,7 +8,7 @@ import gudhi
Author(s): Francois Godi, Vincent Rouvreau
- Copyright (C) 2016 INRIA
+ Copyright (C) 2016 Inria
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
@@ -25,11 +25,9 @@ import gudhi
"""
__author__ = "Francois Godi, Vincent Rouvreau"
-__copyright__ = "Copyright (C) 2016 INRIA"
+__copyright__ = "Copyright (C) 2016 Inria"
__license__ = "GPL v3"
-import gudhi
-
diag1 = [[2.7, 3.7],[9.6, 14.],[34.2, 34.974], [3.,float('Inf')]]
diag2 = [[2.8, 4.45],[9.5, 14.1],[3.2,float('Inf')]]
diff --git a/cython/example/euclidean_strong_witness_complex_diagram_persistence_from_off_file_example.py b/cython/example/euclidean_strong_witness_complex_diagram_persistence_from_off_file_example.py
index e3f362dc..3b29781f 100755
--- a/cython/example/euclidean_strong_witness_complex_diagram_persistence_from_off_file_example.py
+++ b/cython/example/euclidean_strong_witness_complex_diagram_persistence_from_off_file_example.py
@@ -9,7 +9,7 @@ import argparse
Author(s): Vincent Rouvreau
- Copyright (C) 2016 INRIA
+ Copyright (C) 2016 Inria
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
@@ -26,7 +26,7 @@ import argparse
"""
__author__ = "Vincent Rouvreau"
-__copyright__ = "Copyright (C) 2016 INRIA"
+__copyright__ = "Copyright (C) 2016 Inria"
__license__ = "GPL v3"
parser = argparse.ArgumentParser(description='EuclideanStrongWitnessComplex creation from '
@@ -40,7 +40,7 @@ parser.add_argument("-f", "--file", type=str, required=True)
parser.add_argument("-a", "--max_alpha_square", type=float, required=True)
parser.add_argument("-n", "--number_of_landmarks", type=int, required=True)
parser.add_argument("-d", "--limit_dimension", type=int, required=True)
-parser.add_argument("-b", "--band_boot", type=float, default=0.)
+parser.add_argument("-b", "--band", type=float, default=0.)
parser.add_argument('--no-diagram', default=False, action='store_true' , help='Flag for not to display the diagrams')
args = parser.parse_args()
@@ -71,7 +71,7 @@ with open(args.file, 'r') as f:
print(simplex_tree.betti_numbers())
if args.no_diagram == False:
- pplot = gudhi.plot_persistence_diagram(diag, band_boot=args.band_boot)
+ pplot = gudhi.plot_persistence_diagram(diag, band=args.band)
pplot.show()
else:
print(args.file, "is not a valid OFF file")
diff --git a/cython/example/euclidean_witness_complex_diagram_persistence_from_off_file_example.py b/cython/example/euclidean_witness_complex_diagram_persistence_from_off_file_example.py
index c236d992..db34962d 100755
--- a/cython/example/euclidean_witness_complex_diagram_persistence_from_off_file_example.py
+++ b/cython/example/euclidean_witness_complex_diagram_persistence_from_off_file_example.py
@@ -9,7 +9,7 @@ import argparse
Author(s): Vincent Rouvreau
- Copyright (C) 2016 INRIA
+ Copyright (C) 2016 Inria
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
@@ -26,7 +26,7 @@ import argparse
"""
__author__ = "Vincent Rouvreau"
-__copyright__ = "Copyright (C) 2016 INRIA"
+__copyright__ = "Copyright (C) 2016 Inria"
__license__ = "GPL v3"
parser = argparse.ArgumentParser(description='EuclideanWitnessComplex creation from '
@@ -40,7 +40,7 @@ parser.add_argument("-f", "--file", type=str, required=True)
parser.add_argument("-a", "--max_alpha_square", type=float, required=True)
parser.add_argument("-n", "--number_of_landmarks", type=int, required=True)
parser.add_argument("-d", "--limit_dimension", type=int, required=True)
-parser.add_argument("-b", "--band_boot", type=float, default=0.)
+parser.add_argument("-b", "--band", type=float, default=0.)
parser.add_argument('--no-diagram', default=False, action='store_true' , help='Flag for not to display the diagrams')
args = parser.parse_args()
@@ -71,7 +71,7 @@ with open(args.file, 'r') as f:
print(simplex_tree.betti_numbers())
if args.no_diagram == False:
- pplot = gudhi.plot_persistence_diagram(diag, band_boot=args.band_boot)
+ pplot = gudhi.plot_persistence_diagram(diag, band=args.band)
pplot.show()
else:
print(args.file, "is not a valid OFF file")
diff --git a/cython/example/gudhi_graphical_tools_example.py b/cython/example/gudhi_graphical_tools_example.py
index ed87806b..ac3d146c 100755
--- a/cython/example/gudhi_graphical_tools_example.py
+++ b/cython/example/gudhi_graphical_tools_example.py
@@ -8,7 +8,7 @@ import gudhi
Author(s): Vincent Rouvreau
- Copyright (C) 2016 INRIA
+ Copyright (C) 2016 Inria
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
@@ -25,15 +25,10 @@ import gudhi
"""
__author__ = "Vincent Rouvreau"
-__copyright__ = "Copyright (C) 2016 INRIA"
+__copyright__ = "Copyright (C) 2016 Inria"
__license__ = "GPL v3"
print("#####################################################################")
-print("Show palette colors values for dimension")
-
-gudhi.show_palette_values()
-
-print("#####################################################################")
print("Show barcode persistence example")
persistence = [(2, (1.0, float('inf'))), (1, (1.4142135623730951, float('inf'))),
@@ -50,5 +45,5 @@ pplot.show()
print("#####################################################################")
print("Show diagram persistence example with a confidence band")
-pplot = gudhi.plot_persistence_diagram(persistence, band_boot=0.2)
+pplot = gudhi.plot_persistence_diagram(persistence, band=0.2)
pplot.show()
diff --git a/cython/example/periodic_cubical_complex_barcode_persistence_from_perseus_file_example.py b/cython/example/periodic_cubical_complex_barcode_persistence_from_perseus_file_example.py
index 00334121..5f968bf1 100755
--- a/cython/example/periodic_cubical_complex_barcode_persistence_from_perseus_file_example.py
+++ b/cython/example/periodic_cubical_complex_barcode_persistence_from_perseus_file_example.py
@@ -9,7 +9,7 @@ import argparse
Author(s): Vincent Rouvreau
- Copyright (C) 2016 INRIA
+ Copyright (C) 2016 Inria
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
@@ -26,7 +26,7 @@ import argparse
"""
__author__ = "Vincent Rouvreau"
-__copyright__ = "Copyright (C) 2016 INRIA"
+__copyright__ = "Copyright (C) 2016 Inria"
__license__ = "GPL v3"
def is_file_perseus(file):
diff --git a/cython/example/random_cubical_complex_persistence_example.py b/cython/example/random_cubical_complex_persistence_example.py
index c832d6bf..80ff2452 100755
--- a/cython/example/random_cubical_complex_persistence_example.py
+++ b/cython/example/random_cubical_complex_persistence_example.py
@@ -13,7 +13,7 @@ import operator
Author(s): Vincent Rouvreau
- Copyright (C) 2016 INRIA
+ Copyright (C) 2016 Inria
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
@@ -30,7 +30,7 @@ import operator
"""
__author__ = "Vincent Rouvreau"
-__copyright__ = "Copyright (C) 2016 INRIA"
+__copyright__ = "Copyright (C) 2016 Inria"
__license__ = "GPL v3"
parser = argparse.ArgumentParser(description='Random cubical complex.',
diff --git a/cython/example/rips_complex_diagram_persistence_from_correlation_matrix_file_example.py b/cython/example/rips_complex_diagram_persistence_from_correlation_matrix_file_example.py
new file mode 100755
index 00000000..0c9dfc43
--- /dev/null
+++ b/cython/example/rips_complex_diagram_persistence_from_correlation_matrix_file_example.py
@@ -0,0 +1,84 @@
+#!/usr/bin/env python
+
+import gudhi
+import sys
+import argparse
+
+"""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): Vincent Rouvreau
+
+ Copyright (C) 2017 Inria
+
+ 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/>.
+"""
+
+__author__ = "Vincent Rouvreau"
+__copyright__ = "Copyright (C) 2017 Inria"
+__license__ = "GPL v3"
+
+parser = argparse.ArgumentParser(description='RipsComplex creation from '
+ 'a correlation matrix read in a csv file.',
+ epilog='Example: '
+ 'example/rips_complex_diagram_persistence_from_correlation_matrix_file_example.py '
+ '-f ../data/correlation_matrix/lower_triangular_correlation_matrix.csv -e 12.0 -d 3'
+ '- Constructs a Rips complex with the '
+ 'correlation matrix from the given csv file.')
+parser.add_argument("-f", "--file", type=str, required=True)
+parser.add_argument("-c", "--min_edge_correlation", type=float, default=0.5)
+parser.add_argument("-d", "--max_dimension", type=int, default=1)
+parser.add_argument("-b", "--band", type=float, default=0.)
+parser.add_argument('--no-diagram', default=False, action='store_true' , help='Flag for not to display the diagrams')
+
+args = parser.parse_args()
+
+if not (-1. < args.min_edge_correlation < 1.):
+ print("Wrong value of the treshold corelation (should be between -1 and 1).")
+ sys.exit(1)
+
+print("#####################################################################")
+print("Caution: as persistence diagrams points will be under the diagonal,")
+print("bottleneck distance and persistence graphical tool will not work")
+print("properly, this is a known issue.")
+
+print("#####################################################################")
+print("RipsComplex creation from correlation matrix read in a csv file")
+
+message = "RipsComplex with min_edge_correlation=" + repr(args.min_edge_correlation)
+print(message)
+
+correlation_matrix = gudhi.read_lower_triangular_matrix_from_csv_file(csv_file=args.file)
+# Given a correlation matrix M, we compute component-wise M'[i,j] = 1-M[i,j] to get a distance matrix:
+distance_matrix = [[1.-correlation_matrix[i][j] for j in range(len(correlation_matrix[i]))] for i in range(len(correlation_matrix))]
+
+rips_complex = gudhi.RipsComplex(distance_matrix=distance_matrix,
+ max_edge_length=1.-args.min_edge_correlation)
+simplex_tree = rips_complex.create_simplex_tree(max_dimension=args.max_dimension)
+
+message = "Number of simplices=" + repr(simplex_tree.num_simplices())
+print(message)
+
+diag = simplex_tree.persistence()
+
+print("betti_numbers()=")
+print(simplex_tree.betti_numbers())
+
+# invert the persistence diagram
+invert_diag = [(diag[pers][0],(1.-diag[pers][1][0], 1.-diag[pers][1][1])) for pers in range(len(diag))]
+
+if args.no_diagram == False:
+ pplot = gudhi.plot_persistence_diagram(invert_diag, band=args.band)
+ pplot.show()
diff --git a/cython/example/rips_complex_diagram_persistence_from_distance_matrix_file_example.py b/cython/example/rips_complex_diagram_persistence_from_distance_matrix_file_example.py
index 3baebd17..4d2ed577 100755
--- a/cython/example/rips_complex_diagram_persistence_from_distance_matrix_file_example.py
+++ b/cython/example/rips_complex_diagram_persistence_from_distance_matrix_file_example.py
@@ -9,7 +9,7 @@ import argparse
Author(s): Vincent Rouvreau
- Copyright (C) 2016 INRIA
+ Copyright (C) 2016 Inria
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
@@ -26,20 +26,20 @@ import argparse
"""
__author__ = "Vincent Rouvreau"
-__copyright__ = "Copyright (C) 2016 INRIA"
+__copyright__ = "Copyright (C) 2016 Inria"
__license__ = "GPL v3"
parser = argparse.ArgumentParser(description='RipsComplex creation from '
- 'a distance matrix read in a OFF file.',
+ 'a distance matrix read in a csv file.',
epilog='Example: '
'example/rips_complex_diagram_persistence_from_distance_matrix_file_example.py '
'-f ../data/distance_matrix/lower_triangular_distance_matrix.csv -e 12.0 -d 3'
'- Constructs a Rips complex with the '
- 'points from the given OFF file.')
+ 'distance matrix from the given csv file.')
parser.add_argument("-f", "--file", type=str, required=True)
parser.add_argument("-e", "--max_edge_length", type=float, default=0.5)
parser.add_argument("-d", "--max_dimension", type=int, default=1)
-parser.add_argument("-b", "--band_boot", type=float, default=0.)
+parser.add_argument("-b", "--band", type=float, default=0.)
parser.add_argument('--no-diagram', default=False, action='store_true' , help='Flag for not to display the diagrams')
args = parser.parse_args()
@@ -50,7 +50,8 @@ print("RipsComplex creation from distance matrix read in a csv file")
message = "RipsComplex with max_edge_length=" + repr(args.max_edge_length)
print(message)
-rips_complex = gudhi.RipsComplex(csv_file=args.file, max_edge_length=args.max_edge_length)
+distance_matrix = gudhi.read_lower_triangular_matrix_from_csv_file(csv_file=args.file)
+rips_complex = gudhi.RipsComplex(distance_matrix=distance_matrix, max_edge_length=args.max_edge_length)
simplex_tree = rips_complex.create_simplex_tree(max_dimension=args.max_dimension)
message = "Number of simplices=" + repr(simplex_tree.num_simplices())
@@ -62,5 +63,5 @@ print("betti_numbers()=")
print(simplex_tree.betti_numbers())
if args.no_diagram == False:
- pplot = gudhi.plot_persistence_diagram(diag, band_boot=args.band_boot)
+ pplot = gudhi.plot_persistence_diagram(diag, band=args.band)
pplot.show()
diff --git a/cython/example/rips_complex_diagram_persistence_from_off_file_example.py b/cython/example/rips_complex_diagram_persistence_from_off_file_example.py
index 5951eedf..d15d5eb0 100755
--- a/cython/example/rips_complex_diagram_persistence_from_off_file_example.py
+++ b/cython/example/rips_complex_diagram_persistence_from_off_file_example.py
@@ -9,7 +9,7 @@ import argparse
Author(s): Vincent Rouvreau
- Copyright (C) 2016 INRIA
+ Copyright (C) 2016 Inria
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
@@ -26,7 +26,7 @@ import argparse
"""
__author__ = "Vincent Rouvreau"
-__copyright__ = "Copyright (C) 2016 INRIA"
+__copyright__ = "Copyright (C) 2016 Inria"
__license__ = "GPL v3"
parser = argparse.ArgumentParser(description='RipsComplex creation from '
@@ -39,7 +39,7 @@ parser = argparse.ArgumentParser(description='RipsComplex creation from '
parser.add_argument("-f", "--file", type=str, required=True)
parser.add_argument("-e", "--max_edge_length", type=float, default=0.5)
parser.add_argument("-d", "--max_dimension", type=int, default=1)
-parser.add_argument("-b", "--band_boot", type=float, default=0.)
+parser.add_argument("-b", "--band", type=float, default=0.)
parser.add_argument('--no-diagram', default=False, action='store_true' , help='Flag for not to display the diagrams')
args = parser.parse_args()
@@ -53,7 +53,8 @@ with open(args.file, 'r') as f:
message = "RipsComplex with max_edge_length=" + repr(args.max_edge_length)
print(message)
- rips_complex = gudhi.RipsComplex(off_file=args.file, max_edge_length=args.max_edge_length)
+ point_cloud = gudhi.read_off(off_file=args.file)
+ rips_complex = gudhi.RipsComplex(points=point_cloud, max_edge_length=args.max_edge_length)
simplex_tree = rips_complex.create_simplex_tree(max_dimension=args.max_dimension)
message = "Number of simplices=" + repr(simplex_tree.num_simplices())
@@ -65,7 +66,7 @@ with open(args.file, 'r') as f:
print(simplex_tree.betti_numbers())
if args.no_diagram == False:
- pplot = gudhi.plot_persistence_diagram(diag, band_boot=args.band_boot)
+ pplot = gudhi.plot_persistence_diagram(diag, band=args.band)
pplot.show()
else:
print(args.file, "is not a valid OFF file")
diff --git a/cython/example/rips_complex_from_points_example.py b/cython/example/rips_complex_from_points_example.py
index 5d411b1a..ffa9d91f 100755
--- a/cython/example/rips_complex_from_points_example.py
+++ b/cython/example/rips_complex_from_points_example.py
@@ -8,7 +8,7 @@ import gudhi
Author(s): Vincent Rouvreau
- Copyright (C) 2016 INRIA
+ Copyright (C) 2016 Inria
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
@@ -25,7 +25,7 @@ import gudhi
"""
__author__ = "Vincent Rouvreau"
-__copyright__ = "Copyright (C) 2016 INRIA"
+__copyright__ = "Copyright (C) 2016 Inria"
__license__ = "GPL v3"
print("#####################################################################")
diff --git a/cython/example/rips_persistence_diagram.py b/cython/example/rips_persistence_diagram.py
index 9bfea41c..7a6a9f46 100755
--- a/cython/example/rips_persistence_diagram.py
+++ b/cython/example/rips_persistence_diagram.py
@@ -8,7 +8,7 @@ import gudhi
Author(s): Marc Glisse
- Copyright (C) 2016 INRIA
+ Copyright (C) 2016 Inria
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
@@ -25,7 +25,7 @@ import gudhi
"""
__author__ = "Marc Glisse"
-__copyright__ = "Copyright (C) 2016 INRIA"
+__copyright__ = "Copyright (C) 2016 Inria"
__license__ = "GPL v3"
print("#####################################################################")
diff --git a/cython/example/simplex_tree_example.py b/cython/example/simplex_tree_example.py
index 51a60e73..28679015 100755
--- a/cython/example/simplex_tree_example.py
+++ b/cython/example/simplex_tree_example.py
@@ -8,7 +8,7 @@ import gudhi
Author(s): Vincent Rouvreau
- Copyright (C) 2016 INRIA
+ Copyright (C) 2016 Inria
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
@@ -25,7 +25,7 @@ import gudhi
"""
__author__ = "Vincent Rouvreau"
-__copyright__ = "Copyright (C) 2016 INRIA"
+__copyright__ = "Copyright (C) 2016 Inria"
__license__ = "GPL v3"
print("#####################################################################")
diff --git a/cython/example/tangential_complex_plain_homology_from_off_file_example.py b/cython/example/tangential_complex_plain_homology_from_off_file_example.py
index 6145e7f2..0f8f5e80 100755
--- a/cython/example/tangential_complex_plain_homology_from_off_file_example.py
+++ b/cython/example/tangential_complex_plain_homology_from_off_file_example.py
@@ -9,7 +9,7 @@ import argparse
Author(s): Vincent Rouvreau
- Copyright (C) 2016 INRIA
+ Copyright (C) 2016 Inria
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
@@ -26,18 +26,19 @@ import argparse
"""
__author__ = "Vincent Rouvreau"
-__copyright__ = "Copyright (C) 2016 INRIA"
+__copyright__ = "Copyright (C) 2016 Inria"
__license__ = "GPL v3"
parser = argparse.ArgumentParser(description='TangentialComplex creation from '
'points read in a OFF file.',
epilog='Example: '
'example/tangential_complex_plain_homology_from_off_file_example.py '
- '-f ../data/points/tore3D_300.off'
+ '-f ../data/points/tore3D_300.off -i 3'
'- Constructs a tangential complex with the '
'points from the given OFF file')
parser.add_argument("-f", "--file", type=str, required=True)
-parser.add_argument("-b", "--band_boot", type=float, default=0.)
+parser.add_argument("-i", "--intrisic_dim", type=int, required=True)
+parser.add_argument("-b", "--band", type=float, default=0.)
parser.add_argument('--no-diagram', default=False, action='store_true' , help='Flag for not to display the diagrams')
args = parser.parse_args()
@@ -48,7 +49,7 @@ with open(args.file, 'r') as f:
print("#####################################################################")
print("TangentialComplex creation from points read in a OFF file")
- tc = gudhi.TangentialComplex(off_file=args.file)
+ tc = gudhi.TangentialComplex(intrisic_dim = args.intrisic_dim, off_file=args.file)
st = tc.create_simplex_tree()
message = "Number of simplices=" + repr(st.num_simplices())
@@ -60,7 +61,7 @@ with open(args.file, 'r') as f:
print(st.betti_numbers())
if args.no_diagram == False:
- pplot = gudhi.plot_persistence_diagram(diag, band_boot=args.band_boot)
+ pplot = gudhi.plot_persistence_diagram(diag, band=args.band)
pplot.show()
else:
print(args.file, "is not a valid OFF file")
diff --git a/cython/example/witness_complex_from_nearest_landmark_table.py b/cython/example/witness_complex_from_nearest_landmark_table.py
index 92ed970b..e6b295ee 100755
--- a/cython/example/witness_complex_from_nearest_landmark_table.py
+++ b/cython/example/witness_complex_from_nearest_landmark_table.py
@@ -8,7 +8,7 @@ from gudhi import StrongWitnessComplex, SimplexTree
Author(s): Vincent Rouvreau
- Copyright (C) 2016 INRIA
+ Copyright (C) 2016 Inria
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
@@ -25,7 +25,7 @@ from gudhi import StrongWitnessComplex, SimplexTree
"""
__author__ = "Vincent Rouvreau"
-__copyright__ = "Copyright (C) 2016 INRIA"
+__copyright__ = "Copyright (C) 2016 Inria"
__license__ = "GPL v3"
print("#####################################################################")
diff --git a/cython/gudhi.pyx.in b/cython/gudhi.pyx.in
index a8dd9f80..b94f2251 100644
--- a/cython/gudhi.pyx.in
+++ b/cython/gudhi.pyx.in
@@ -4,7 +4,7 @@
Author(s): Vincent Rouvreau
- Copyright (C) 2016 INRIA
+ Copyright (C) 2016 Inria
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
@@ -21,7 +21,7 @@
"""
__author__ = "Vincent Rouvreau"
-__copyright__ = "Copyright (C) 2016 INRIA"
+__copyright__ = "Copyright (C) 2016 Inria"
__license__ = "GPL v3"
__version__ = "@GUDHI_VERSION@"
# This variable is used by doctest to find files
diff --git a/cython/include/Alpha_complex_interface.h b/cython/include/Alpha_complex_interface.h
index d47db71f..8cf527fc 100644
--- a/cython/include/Alpha_complex_interface.h
+++ b/cython/include/Alpha_complex_interface.h
@@ -4,7 +4,7 @@
*
* Author(s): Vincent Rouvreau
*
- * Copyright (C) 2016 INRIA
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/cython/include/Bottleneck_distance_interface.h b/cython/include/Bottleneck_distance_interface.h
index d5fbf6ea..5ad9d77d 100644
--- a/cython/include/Bottleneck_distance_interface.h
+++ b/cython/include/Bottleneck_distance_interface.h
@@ -4,7 +4,7 @@
*
* Author(s): Vincent Rouvreau
*
- * Copyright (C) 2016 INRIA
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/cython/include/Cubical_complex_interface.h b/cython/include/Cubical_complex_interface.h
index fad92c2c..85b717b3 100644
--- a/cython/include/Cubical_complex_interface.h
+++ b/cython/include/Cubical_complex_interface.h
@@ -4,7 +4,7 @@
*
* Author(s): Vincent Rouvreau
*
- * Copyright (C) 2016 INRIA
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/cython/include/Euclidean_strong_witness_complex_interface.h b/cython/include/Euclidean_strong_witness_complex_interface.h
index b9dd8177..d86355d6 100644
--- a/cython/include/Euclidean_strong_witness_complex_interface.h
+++ b/cython/include/Euclidean_strong_witness_complex_interface.h
@@ -4,7 +4,7 @@
*
* Author(s): Vincent Rouvreau
*
- * Copyright (C) 2016 INRIA
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/cython/include/Euclidean_witness_complex_interface.h b/cython/include/Euclidean_witness_complex_interface.h
index 2a09b3b5..dc303533 100644
--- a/cython/include/Euclidean_witness_complex_interface.h
+++ b/cython/include/Euclidean_witness_complex_interface.h
@@ -4,7 +4,7 @@
*
* Author(s): Vincent Rouvreau
*
- * Copyright (C) 2016 INRIA
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/cython/include/Off_reader_interface.h b/cython/include/Off_reader_interface.h
index 0ca55500..f6b14f38 100644
--- a/cython/include/Off_reader_interface.h
+++ b/cython/include/Off_reader_interface.h
@@ -4,7 +4,7 @@
*
* Author(s): Vincent Rouvreau
*
- * Copyright (C) 2016 INRIA
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/cython/include/Persistent_cohomology_interface.h b/cython/include/Persistent_cohomology_interface.h
index 55028fd0..8cf71a4e 100644
--- a/cython/include/Persistent_cohomology_interface.h
+++ b/cython/include/Persistent_cohomology_interface.h
@@ -4,7 +4,7 @@
*
* Author(s): Vincent Rouvreau
*
- * Copyright (C) 2016 INRIA
+ * Copyright (C) 2016 Inria
*
* 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
@@ -85,6 +85,32 @@ persistent_cohomology::Persistent_cohomology<FilteredComplex, persistent_cohomol
return persistence;
}
+ std::vector<std::pair<std::vector<int>, std::vector<int>>> persistence_pairs() {
+ auto pairs = persistent_cohomology::Persistent_cohomology<FilteredComplex,
+ persistent_cohomology::Field_Zp>::get_persistent_pairs();
+
+ std::vector<std::pair<std::vector<int>, std::vector<int>>> persistence_pairs;
+ persistence_pairs.reserve(pairs.size());
+ for (auto pair : pairs) {
+ std::vector<int> birth;
+ if (get<0>(pair) != stptr_->null_simplex()) {
+ for (auto vertex : stptr_->simplex_vertex_range(get<0>(pair))) {
+ birth.push_back(vertex);
+ }
+ }
+
+ std::vector<int> death;
+ if (get<1>(pair) != stptr_->null_simplex()) {
+ for (auto vertex : stptr_->simplex_vertex_range(get<1>(pair))) {
+ death.push_back(vertex);
+ }
+ }
+
+ persistence_pairs.push_back(std::make_pair(birth, death));
+ }
+ return persistence_pairs;
+ }
+
private:
// A copy
FilteredComplex* stptr_;
diff --git a/cython/include/Reader_utils_interface.h b/cython/include/Reader_utils_interface.h
index 8ec34f61..5f7527d9 100644
--- a/cython/include/Reader_utils_interface.h
+++ b/cython/include/Reader_utils_interface.h
@@ -4,7 +4,7 @@
*
* Author(s): Vincent Rouvreau
*
- * Copyright (C) 2017 INRIA
+ * Copyright (C) 2017 Inria
*
* 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
diff --git a/cython/include/Rips_complex_interface.h b/cython/include/Rips_complex_interface.h
index 02985727..8b6c9c35 100644
--- a/cython/include/Rips_complex_interface.h
+++ b/cython/include/Rips_complex_interface.h
@@ -4,7 +4,7 @@
*
* Author(s): Vincent Rouvreau
*
- * Copyright (C) 2016 INRIA
+ * Copyright (C) 2016 Inria
*
* 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
@@ -25,9 +25,7 @@
#include <gudhi/Simplex_tree.h>
#include <gudhi/Rips_complex.h>
-#include <gudhi/Points_off_io.h>
#include <gudhi/distance_functions.h>
-#include <gudhi/reader_utils.h>
#include "Simplex_tree_interface.h"
@@ -56,21 +54,6 @@ class Rips_complex_interface {
}
}
- Rips_complex_interface(const std::string& file_name, double threshold, bool euclidean, bool from_file = true) {
- if (euclidean) {
- // Rips construction where file_name is an OFF file
- Gudhi::Points_off_reader<Point_d> off_reader(file_name);
- rips_complex_ = new Rips_complex<Simplex_tree_interface<>::Filtration_value>(off_reader.get_point_cloud(),
- threshold,
- Gudhi::Euclidean_distance());
- } else {
- // Rips construction where values is a distance matrix
- Distance_matrix distances =
- Gudhi::read_lower_triangular_matrix_from_csv_file<Simplex_tree_interface<>::Filtration_value>(file_name);
- rips_complex_ = new Rips_complex<Simplex_tree_interface<>::Filtration_value>(distances, threshold);
- }
- }
-
~Rips_complex_interface() {
delete rips_complex_;
}
diff --git a/cython/include/Simplex_tree_interface.h b/cython/include/Simplex_tree_interface.h
index 54a4f824..3481eeff 100644
--- a/cython/include/Simplex_tree_interface.h
+++ b/cython/include/Simplex_tree_interface.h
@@ -4,7 +4,7 @@
*
* Author(s): Vincent Rouvreau
*
- * Copyright (C) 2016 INRIA
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/cython/include/Strong_witness_complex_interface.h b/cython/include/Strong_witness_complex_interface.h
index d05eaac5..3c72c916 100644
--- a/cython/include/Strong_witness_complex_interface.h
+++ b/cython/include/Strong_witness_complex_interface.h
@@ -4,7 +4,7 @@
*
* Author(s): Vincent Rouvreau
*
- * Copyright (C) 2016 INRIA
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/cython/include/Subsampling_interface.h b/cython/include/Subsampling_interface.h
index b0f4a50a..f990da0c 100644
--- a/cython/include/Subsampling_interface.h
+++ b/cython/include/Subsampling_interface.h
@@ -4,7 +4,7 @@
*
* Author(s): Vincent Rouvreau
*
- * Copyright (C) 2016 INRIA
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/cython/include/Tangential_complex_interface.h b/cython/include/Tangential_complex_interface.h
index 0c3a510e..71418886 100644
--- a/cython/include/Tangential_complex_interface.h
+++ b/cython/include/Tangential_complex_interface.h
@@ -4,7 +4,7 @@
*
* Author(s): Vincent Rouvreau
*
- * Copyright (C) 2016 INRIA
+ * Copyright (C) 2016 Inria
*
* 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
@@ -45,24 +45,19 @@ class Tangential_complex_interface {
using TC = Tangential_complex<Dynamic_kernel, CGAL::Dynamic_dimension_tag, CGAL::Parallel_tag>;
public:
- Tangential_complex_interface(const std::vector<std::vector<double>>& points) {
+ Tangential_complex_interface(int intrisic_dim, const std::vector<std::vector<double>>& points) {
Dynamic_kernel k;
- unsigned intrisic_dim = 0;
- if (points.size() > 0)
- intrisic_dim = points[0].size() - 1;
tangential_complex_ = new TC(points, intrisic_dim, k);
tangential_complex_->compute_tangential_complex();
num_inconsistencies_ = tangential_complex_->number_of_inconsistent_simplices();
}
- Tangential_complex_interface(const std::string& off_file_name, bool from_file = true) {
- Gudhi::Points_off_reader<Point_d> off_reader(off_file_name);
+ Tangential_complex_interface(int intrisic_dim, const std::string& off_file_name, bool from_file = true) {
Dynamic_kernel k;
- unsigned intrisic_dim = 0;
+
+ Gudhi::Points_off_reader<Point_d> off_reader(off_file_name);
std::vector<Point_d> points = off_reader.get_point_cloud();
- if (points.size() > 0)
- intrisic_dim = points[0].size() - 1;
tangential_complex_ = new TC(points, intrisic_dim, k);
tangential_complex_->compute_tangential_complex();
diff --git a/cython/include/Witness_complex_interface.h b/cython/include/Witness_complex_interface.h
index 6501cc35..01b372e7 100644
--- a/cython/include/Witness_complex_interface.h
+++ b/cython/include/Witness_complex_interface.h
@@ -4,7 +4,7 @@
*
* Author(s): Vincent Rouvreau
*
- * Copyright (C) 2016 INRIA
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/cython/setup.py.in b/cython/setup.py.in
index c767e93d..ee381a1b 100644
--- a/cython/setup.py.in
+++ b/cython/setup.py.in
@@ -7,7 +7,7 @@ from Cython.Build import cythonize
Author(s): Vincent Rouvreau
- Copyright (C) 2016 INRIA
+ Copyright (C) 2016 Inria
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
@@ -24,7 +24,7 @@ from Cython.Build import cythonize
"""
__author__ = "GUDHI Editorial Board"
-__copyright__ = "Copyright (C) 2016 INRIA"
+__copyright__ = "Copyright (C) 2016 Inria"
__license__ = "GPL v3"
gudhi = Extension(
@@ -46,4 +46,9 @@ setup(
version='@GUDHI_VERSION@',
url='http://gudhi.gforge.inria.fr/',
ext_modules = cythonize(gudhi),
+ install_requires = [
+ "matplotlib",
+ "numpy",
+ "cython",
+ ],
)
diff --git a/cython/test/test_alpha_complex.py b/cython/test/test_alpha_complex.py
index 2c76d9d7..e97f2530 100755
--- a/cython/test/test_alpha_complex.py
+++ b/cython/test/test_alpha_complex.py
@@ -6,7 +6,7 @@ from gudhi import AlphaComplex, SimplexTree
Author(s): Vincent Rouvreau
- Copyright (C) 2016 INRIA
+ Copyright (C) 2016 Inria
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
@@ -23,7 +23,7 @@ from gudhi import AlphaComplex, SimplexTree
"""
__author__ = "Vincent Rouvreau"
-__copyright__ = "Copyright (C) 2016 INRIA"
+__copyright__ = "Copyright (C) 2016 Inria"
__license__ = "GPL v3"
diff --git a/cython/test/test_bottleneck_distance.py b/cython/test/test_bottleneck_distance.py
index 3d982d34..4eb5848f 100755
--- a/cython/test/test_bottleneck_distance.py
+++ b/cython/test/test_bottleneck_distance.py
@@ -6,7 +6,7 @@ import gudhi
Author(s): Vincent Rouvreau
- Copyright (C) 2016 INRIA
+ Copyright (C) 2016 Inria
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
@@ -23,7 +23,7 @@ import gudhi
"""
__author__ = "Vincent Rouvreau"
-__copyright__ = "Copyright (C) 2016 INRIA"
+__copyright__ = "Copyright (C) 2016 Inria"
__license__ = "GPL v3"
diff --git a/cython/test/test_cubical_complex.py b/cython/test/test_cubical_complex.py
index 0e81554d..92e591e9 100755
--- a/cython/test/test_cubical_complex.py
+++ b/cython/test/test_cubical_complex.py
@@ -6,7 +6,7 @@ from gudhi import CubicalComplex
Author(s): Vincent Rouvreau
- Copyright (C) 2016 INRIA
+ Copyright (C) 2016 Inria
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
@@ -23,7 +23,7 @@ from gudhi import CubicalComplex
"""
__author__ = "Vincent Rouvreau"
-__copyright__ = "Copyright (C) 2016 INRIA"
+__copyright__ = "Copyright (C) 2016 Inria"
__license__ = "GPL v3"
@@ -72,6 +72,17 @@ def test_dimension_simple_constructor():
assert cub.betti_numbers() == [1, 0, 0]
assert cub.persistent_betti_numbers(0, 1000) == [0, 0, 0]
+def test_user_case_simple_constructor():
+ cub = CubicalComplex(dimensions=[3, 3],
+ top_dimensional_cells = [float('inf'), 0.,0.,0.,1.,0.,0.,0.,0.])
+ assert cub.__is_defined() == True
+ assert cub.__is_persistence_defined() == False
+ assert cub.persistence() == [(1, (0.0, 1.0)), (0, (0.0, float('inf')))]
+ assert cub.__is_persistence_defined() == True
+ other_cub = CubicalComplex(dimensions=[3, 3],
+ top_dimensional_cells = [1000., 0.,0.,0.,1.,0.,0.,0.,0.])
+ assert other_cub.persistence() == [(1, (0.0, 1.0)), (0, (0.0, float('inf')))]
+
def test_dimension_file_constructor():
# Create test file
test_file = open('CubicalOneSphere.txt', 'w')
diff --git a/cython/test/test_euclidean_witness_complex.py b/cython/test/test_euclidean_witness_complex.py
index 737f1ef4..2f77210a 100755
--- a/cython/test/test_euclidean_witness_complex.py
+++ b/cython/test/test_euclidean_witness_complex.py
@@ -6,7 +6,7 @@ import gudhi
Author(s): Vincent Rouvreau
- Copyright (C) 2016 INRIA
+ Copyright (C) 2016 Inria
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
@@ -23,7 +23,7 @@ import gudhi
"""
__author__ = "Vincent Rouvreau"
-__copyright__ = "Copyright (C) 2016 INRIA"
+__copyright__ = "Copyright (C) 2016 Inria"
__license__ = "GPL v3"
diff --git a/cython/test/test_reader_utils.py b/cython/test/test_reader_utils.py
index 25591fb3..b240c84f 100755
--- a/cython/test/test_reader_utils.py
+++ b/cython/test/test_reader_utils.py
@@ -6,7 +6,7 @@ import gudhi
Author(s): Vincent Rouvreau
- Copyright (C) 2017 INRIA
+ Copyright (C) 2017 Inria
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
@@ -23,7 +23,7 @@ import gudhi
"""
__author__ = "Vincent Rouvreau"
-__copyright__ = "Copyright (C) 2017 INRIA"
+__copyright__ = "Copyright (C) 2017 Inria"
__license__ = "GPL v3"
diff --git a/cython/test/test_rips_complex.py b/cython/test/test_rips_complex.py
index c7d2ead4..c37b5400 100755
--- a/cython/test/test_rips_complex.py
+++ b/cython/test/test_rips_complex.py
@@ -7,7 +7,7 @@ from math import sqrt
Author(s): Vincent Rouvreau
- Copyright (C) 2016 INRIA
+ Copyright (C) 2016 Inria
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
@@ -24,7 +24,7 @@ from math import sqrt
"""
__author__ = "Vincent Rouvreau"
-__copyright__ = "Copyright (C) 2016 INRIA"
+__copyright__ = "Copyright (C) 2016 Inria"
__license__ = "GPL v3"
diff --git a/cython/test/test_simplex_tree.py b/cython/test/test_simplex_tree.py
index 6dec5d94..cb701c9a 100755
--- a/cython/test/test_simplex_tree.py
+++ b/cython/test/test_simplex_tree.py
@@ -6,7 +6,7 @@ from gudhi import SimplexTree
Author(s): Vincent Rouvreau
- Copyright (C) 2016 INRIA
+ Copyright (C) 2016 Inria
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
@@ -23,7 +23,7 @@ from gudhi import SimplexTree
"""
__author__ = "Vincent Rouvreau"
-__copyright__ = "Copyright (C) 2016 INRIA"
+__copyright__ = "Copyright (C) 2016 Inria"
__license__ = "GPL v3"
@@ -161,3 +161,47 @@ def test_automatic_dimension():
assert st.upper_bound_dimension() == 2
assert st.dimension() == 1
assert st.upper_bound_dimension() == 1
+
+def test_make_filtration_non_decreasing():
+ st = SimplexTree()
+ assert st.__is_defined() == True
+ assert st.__is_persistence_defined() == False
+
+ # Inserted simplex:
+ # 1
+ # o
+ # /X\
+ # o---o---o---o
+ # 2 0 3\X/4
+ # o
+ # 5
+ assert st.insert([2, 1, 0], filtration=2.0) == True
+ assert st.insert([3, 0], filtration=2.0) == True
+ assert st.insert([3, 4, 5], filtration=2.0) == True
+
+ assert st.make_filtration_non_decreasing() == False
+
+ # Because of non decreasing property of simplex tree, { 0 } , { 1 } and
+ # { 0, 1 } are going to be set from value 2.0 to 1.0
+ st.insert([0, 1, 6, 7], filtration=1.0);
+
+ assert st.make_filtration_non_decreasing() == False
+
+ # Modify specific values to test make_filtration_non_decreasing
+ st.assign_filtration([0,1,6,7], 0.8);
+ st.assign_filtration([0,1,6], 0.9);
+ st.assign_filtration([0,6], 0.6);
+ st.assign_filtration([3,4,5], 1.2);
+ st.assign_filtration([3,4], 1.1);
+ st.assign_filtration([4,5], 1.99);
+
+ assert st.make_filtration_non_decreasing() == True
+
+ assert st.filtration([0,1,6,7]) == 1.
+ assert st.filtration([0,1,6]) == 1.
+ assert st.filtration([0,1]) == 1.
+ assert st.filtration([0]) == 1.
+ assert st.filtration([1]) == 1.
+ assert st.filtration([3,4,5]) == 2.
+ assert st.filtration([3,4]) == 2.
+ assert st.filtration([4,5]) == 2.
diff --git a/cython/test/test_subsampling.py b/cython/test/test_subsampling.py
index 2caf4ddb..96906a6f 100755
--- a/cython/test/test_subsampling.py
+++ b/cython/test/test_subsampling.py
@@ -6,7 +6,7 @@ import gudhi
Author(s): Vincent Rouvreau
- Copyright (C) 2016 INRIA
+ Copyright (C) 2016 Inria
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
@@ -23,7 +23,7 @@ import gudhi
"""
__author__ = "Vincent Rouvreau"
-__copyright__ = "Copyright (C) 2016 INRIA"
+__copyright__ = "Copyright (C) 2016 Inria"
__license__ = "GPL v3"
diff --git a/cython/test/test_tangential_complex.py b/cython/test/test_tangential_complex.py
index 8aa4023c..5385a0d3 100755
--- a/cython/test/test_tangential_complex.py
+++ b/cython/test/test_tangential_complex.py
@@ -6,7 +6,7 @@ from gudhi import TangentialComplex, SimplexTree
Author(s): Vincent Rouvreau
- Copyright (C) 2016 INRIA
+ Copyright (C) 2016 Inria
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
@@ -23,13 +23,13 @@ from gudhi import TangentialComplex, SimplexTree
"""
__author__ = "Vincent Rouvreau"
-__copyright__ = "Copyright (C) 2016 INRIA"
+__copyright__ = "Copyright (C) 2016 Inria"
__license__ = "GPL v3"
def test_tangential():
point_list = [[0.0, 0.0], [1.0, 0.0], [0.0, 1.0], [1.0, 1.0]]
- tc = TangentialComplex(points=point_list)
+ tc = TangentialComplex(intrisic_dim = 1, points=point_list)
assert tc.__is_defined() == True
assert tc.num_vertices() == 4
diff --git a/cython/test/test_witness_complex.py b/cython/test/test_witness_complex.py
index 7d1fb6be..bcbc521b 100755
--- a/cython/test/test_witness_complex.py
+++ b/cython/test/test_witness_complex.py
@@ -6,7 +6,7 @@ from gudhi import WitnessComplex, StrongWitnessComplex, SimplexTree
Author(s): Vincent Rouvreau
- Copyright (C) 2016 INRIA
+ Copyright (C) 2016 Inria
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
@@ -23,7 +23,7 @@ from gudhi import WitnessComplex, StrongWitnessComplex, SimplexTree
"""
__author__ = "Vincent Rouvreau"
-__copyright__ = "Copyright (C) 2016 INRIA"
+__copyright__ = "Copyright (C) 2016 Inria"
__license__ = "GPL v3"
diff --git a/data/correlation_matrix/lower_triangular_correlation_matrix.csv b/data/correlation_matrix/lower_triangular_correlation_matrix.csv
new file mode 100644
index 00000000..99ad0b5d
--- /dev/null
+++ b/data/correlation_matrix/lower_triangular_correlation_matrix.csv
@@ -0,0 +1,6 @@
+
+0.4090538938
+0.2182708406;0.5664245836
+0.9109757412;0.5234453492;0.4239008464
+0.2426856242;0.7178816327;0.4748826202;0.8254894051
+0.0908790566;0.9369574252;0.9760741671;0.5256838992;0.0653515265
diff --git a/data/persistence_diagram/rips_on_tore3D_1307.pers b/data/persistence_diagram/rips_on_tore3D_1307.pers
new file mode 100644
index 00000000..f1bd600b
--- /dev/null
+++ b/data/persistence_diagram/rips_on_tore3D_1307.pers
@@ -0,0 +1,2044 @@
+2 0.138335 inf
+1 0.104347 inf
+1 0.0983494 inf
+0 0 inf
+0 0 0.122545
+0 0 0.121171
+0 0 0.120964
+0 0 0.12057
+0 0 0.12047
+0 0 0.120414
+0 0 0.119758
+0 0 0.119091
+0 0 0.118893
+0 0 0.118874
+0 0 0.118398
+0 0 0.118204
+0 0 0.118102
+0 0 0.118095
+0 0 0.117908
+0 0 0.117806
+0 0 0.117768
+0 0 0.117751
+0 0 0.117407
+0 0 0.117253
+0 0 0.116946
+0 0 0.116892
+0 0 0.116706
+0 0 0.116528
+0 0 0.116232
+0 0 0.115975
+0 0 0.115683
+0 0 0.115646
+0 0 0.115363
+0 0 0.115251
+0 0 0.115146
+0 0 0.115117
+0 0 0.115023
+0 0 0.114815
+0 0 0.114723
+0 0 0.1147
+0 0 0.114614
+0 0 0.114402
+0 0 0.114275
+0 0 0.114223
+0 0 0.113893
+0 0 0.113764
+0 0 0.113647
+0 0 0.113442
+0 0 0.113398
+0 0 0.113164
+0 0 0.113063
+0 0 0.113049
+0 0 0.112954
+0 0 0.112901
+0 0 0.112891
+0 0 0.112885
+0 0 0.112865
+0 0 0.112826
+0 0 0.112796
+0 0 0.112766
+0 0 0.112608
+0 0 0.112307
+0 0 0.112264
+0 0 0.112184
+0 0 0.112147
+0 0 0.112082
+0 0 0.111801
+0 0 0.111735
+0 0 0.111625
+0 0 0.111604
+0 0 0.111575
+0 0 0.111377
+0 0 0.111343
+0 0 0.111156
+0 0 0.111117
+0 0 0.11106
+0 0 0.111002
+0 0 0.110975
+0 0 0.110881
+0 0 0.11069
+0 0 0.110493
+0 0 0.110475
+0 0 0.110435
+0 0 0.110311
+0 0 0.110289
+0 0 0.110272
+0 0 0.110233
+0 0 0.110208
+0 0 0.110205
+0 0 0.110137
+0 0 0.110108
+0 0 0.109917
+0 0 0.109875
+0 0 0.109867
+0 0 0.109799
+0 0 0.109791
+0 0 0.109754
+0 0 0.109736
+0 0 0.109555
+0 0 0.109497
+0 0 0.109492
+0 0 0.109298
+0 0 0.109242
+0 0 0.109079
+0 0 0.10898
+0 0 0.108948
+0 0 0.108943
+0 0 0.108932
+0 0 0.10893
+0 0 0.108922
+0 0 0.108825
+0 0 0.108627
+0 0 0.10856
+0 0 0.108534
+0 0 0.108511
+0 0 0.108472
+0 0 0.108444
+0 0 0.10836
+0 0 0.108346
+0 0 0.108339
+0 0 0.108289
+0 0 0.108224
+0 0 0.108176
+0 0 0.108162
+0 0 0.108154
+0 0 0.108103
+0 0 0.10808
+0 0 0.108051
+0 0 0.10802
+0 0 0.107985
+0 0 0.107938
+0 0 0.107932
+0 0 0.107859
+0 0 0.107802
+0 0 0.107766
+0 0 0.107761
+0 0 0.107733
+0 0 0.107731
+0 0 0.107725
+0 0 0.107557
+0 0 0.107536
+0 0 0.107535
+0 0 0.107516
+0 0 0.107477
+0 0 0.107471
+0 0 0.107469
+0 0 0.107445
+0 0 0.10744
+0 0 0.107419
+0 0 0.107336
+0 0 0.107313
+0 0 0.107297
+0 0 0.107267
+0 0 0.10717
+0 0 0.107131
+0 0 0.107067
+0 0 0.107039
+0 0 0.10689
+0 0 0.106828
+0 0 0.106744
+0 0 0.10666
+0 0 0.106639
+0 0 0.106637
+0 0 0.106593
+0 0 0.106535
+0 0 0.106455
+0 0 0.106438
+0 0 0.106428
+0 0 0.106402
+0 0 0.106382
+0 0 0.106273
+0 0 0.106187
+0 0 0.106182
+0 0 0.105991
+0 0 0.105911
+0 0 0.105803
+0 0 0.105792
+0 0 0.105763
+0 0 0.105749
+0 0 0.105725
+0 0 0.105672
+0 0 0.105622
+0 0 0.105605
+0 0 0.105558
+0 0 0.105484
+0 0 0.105439
+0 0 0.105415
+0 0 0.105389
+0 0 0.105369
+0 0 0.105346
+0 0 0.105339
+0 0 0.1053
+0 0 0.105274
+0 0 0.105206
+0 0 0.105187
+0 0 0.105133
+0 0 0.105093
+0 0 0.105088
+0 0 0.105083
+0 0 0.10505
+0 0 0.105021
+0 0 0.105015
+0 0 0.104978
+0 0 0.10494
+0 0 0.104898
+0 0 0.104883
+0 0 0.104836
+0 0 0.104832
+0 0 0.104746
+0 0 0.104722
+0 0 0.104718
+0 0 0.104692
+0 0 0.10468
+0 0 0.104641
+0 0 0.104638
+0 0 0.104527
+0 0 0.104507
+0 0 0.104477
+0 0 0.10447
+0 0 0.104422
+0 0 0.104414
+0 0 0.104411
+0 0 0.10434
+0 0 0.104314
+0 0 0.104286
+0 0 0.104274
+0 0 0.10427
+0 0 0.104222
+0 0 0.104206
+0 0 0.104201
+0 0 0.104185
+0 0 0.10416
+0 0 0.10415
+0 0 0.104114
+0 0 0.104113
+0 0 0.104099
+0 0 0.103988
+0 0 0.103974
+0 0 0.103946
+0 0 0.103925
+0 0 0.103897
+0 0 0.103852
+0 0 0.103724
+0 0 0.103667
+0 0 0.103651
+0 0 0.103641
+0 0 0.103637
+0 0 0.103574
+0 0 0.103557
+0 0 0.103536
+0 0 0.103516
+0 0 0.103469
+0 0 0.103456
+0 0 0.10344
+0 0 0.103427
+0 0 0.103421
+0 0 0.103376
+0 0 0.103358
+0 0 0.103266
+0 0 0.103263
+0 0 0.103249
+0 0 0.103192
+0 0 0.103156
+0 0 0.103092
+0 0 0.103081
+0 0 0.103058
+0 0 0.102872
+0 0 0.102835
+0 0 0.102805
+0 0 0.102768
+0 0 0.102758
+0 0 0.102752
+0 0 0.102741
+0 0 0.102739
+0 0 0.102715
+0 0 0.102696
+0 0 0.10265
+0 0 0.102553
+0 0 0.102486
+0 0 0.102486
+0 0 0.102467
+0 0 0.102441
+0 0 0.102363
+0 0 0.102346
+0 0 0.102298
+0 0 0.102266
+0 0 0.102253
+0 0 0.102217
+0 0 0.102193
+0 0 0.102191
+0 0 0.10216
+0 0 0.102117
+0 0 0.102031
+0 0 0.102007
+0 0 0.101945
+0 0 0.101907
+0 0 0.101896
+0 0 0.101855
+0 0 0.101847
+0 0 0.101843
+0 0 0.101833
+0 0 0.101822
+0 0 0.101821
+0 0 0.101809
+0 0 0.101699
+0 0 0.10155
+0 0 0.101538
+0 0 0.101493
+0 0 0.101468
+0 0 0.101447
+0 0 0.101403
+0 0 0.101392
+0 0 0.101377
+0 0 0.101373
+0 0 0.101355
+0 0 0.101341
+0 0 0.101286
+0 0 0.10122
+0 0 0.101184
+0 0 0.101126
+0 0 0.101084
+0 0 0.101084
+0 0 0.101072
+0 0 0.100981
+0 0 0.100929
+0 0 0.100921
+0 0 0.100844
+0 0 0.100805
+0 0 0.100797
+0 0 0.100772
+0 0 0.100749
+0 0 0.100749
+0 0 0.100679
+0 0 0.10064
+0 0 0.100635
+0 0 0.100613
+0 0 0.100599
+0 0 0.10052
+0 0 0.100512
+0 0 0.100462
+0 0 0.100399
+0 0 0.100346
+0 0 0.100324
+0 0 0.100276
+0 0 0.100269
+0 0 0.10026
+0 0 0.100249
+0 0 0.100173
+0 0 0.100143
+0 0 0.100132
+0 0 0.100016
+0 0 0.100004
+0 0 0.0999805
+0 0 0.0999609
+0 0 0.0999313
+0 0 0.0999304
+0 0 0.0998899
+0 0 0.099884
+0 0 0.0998646
+0 0 0.0998279
+0 0 0.0997317
+0 0 0.0997064
+0 0 0.0996974
+0 0 0.0996745
+0 0 0.0996681
+0 0 0.0996236
+0 0 0.0995811
+0 0 0.099502
+0 0 0.0994573
+0 0 0.0993738
+0 0 0.0993579
+0 0 0.0993118
+0 0 0.0993115
+0 0 0.099307
+0 0 0.099301
+0 0 0.0992841
+0 0 0.0992493
+0 0 0.0992196
+0 0 0.0992118
+0 0 0.0992002
+0 0 0.0991901
+0 0 0.0991748
+0 0 0.0991699
+0 0 0.0991355
+0 0 0.099127
+0 0 0.0991122
+0 0 0.0991061
+0 0 0.0991026
+0 0 0.0990777
+0 0 0.0990577
+0 0 0.0990106
+0 0 0.0989608
+0 0 0.0989511
+0 0 0.0989433
+0 0 0.0989068
+0 0 0.0989061
+0 0 0.0989017
+0 0 0.0988136
+0 0 0.0987844
+0 0 0.0987155
+0 0 0.0987137
+0 0 0.0987027
+0 0 0.0986656
+0 0 0.0986589
+0 0 0.0985188
+0 0 0.0985127
+0 0 0.0984978
+0 0 0.0984845
+0 0 0.0984384
+0 0 0.0984361
+0 0 0.0984105
+0 0 0.0983949
+0 0 0.0983794
+0 0 0.0983099
+0 0 0.0983022
+0 0 0.0982802
+0 0 0.098261
+0 0 0.0982605
+0 0 0.0982498
+0 0 0.0982427
+0 0 0.0982118
+0 0 0.0981918
+0 0 0.0981537
+0 0 0.0981249
+0 0 0.0981003
+0 0 0.0980403
+0 0 0.0980052
+0 0 0.0979611
+0 0 0.0979211
+0 0 0.0979103
+0 0 0.0978291
+0 0 0.0977825
+0 0 0.0977791
+0 0 0.0977691
+0 0 0.0977678
+0 0 0.0977566
+0 0 0.0977458
+0 0 0.0977308
+0 0 0.0976979
+0 0 0.0976947
+0 0 0.0976571
+0 0 0.0976316
+0 0 0.097628
+0 0 0.0976173
+0 0 0.097617
+0 0 0.0976144
+0 0 0.097594
+0 0 0.0975906
+0 0 0.0975423
+0 0 0.0975044
+0 0 0.0974811
+0 0 0.0974776
+0 0 0.09746
+0 0 0.0974517
+0 0 0.0974161
+0 0 0.097411
+0 0 0.0974102
+0 0 0.0973811
+0 0 0.0973704
+0 0 0.097361
+0 0 0.0973594
+0 0 0.0973475
+0 0 0.097347
+0 0 0.0973354
+0 0 0.0972601
+0 0 0.0972476
+0 0 0.0972407
+0 0 0.097222
+0 0 0.0971562
+0 0 0.097079
+0 0 0.0970225
+0 0 0.0970099
+0 0 0.0969931
+0 0 0.0969318
+0 0 0.0968345
+0 0 0.096738
+0 0 0.0967069
+0 0 0.0966177
+0 0 0.0966121
+0 0 0.0966075
+0 0 0.0965669
+0 0 0.0965524
+0 0 0.0965467
+0 0 0.0965306
+0 0 0.0964752
+0 0 0.0964273
+0 0 0.0964214
+0 0 0.0964044
+0 0 0.0963393
+0 0 0.0962953
+0 0 0.0962618
+0 0 0.0962443
+0 0 0.0962396
+0 0 0.0962072
+0 0 0.0961728
+0 0 0.0961412
+0 0 0.0960799
+0 0 0.0960719
+0 0 0.0960553
+0 0 0.0959975
+0 0 0.0959885
+0 0 0.0959874
+0 0 0.0959671
+0 0 0.0959571
+0 0 0.0959249
+0 0 0.0958821
+0 0 0.0958582
+0 0 0.0958079
+0 0 0.095807
+0 0 0.0957505
+0 0 0.0957349
+0 0 0.095686
+0 0 0.0956663
+0 0 0.0956426
+0 0 0.0955825
+0 0 0.095551
+0 0 0.095509
+0 0 0.0954092
+0 0 0.0954003
+0 0 0.0953929
+0 0 0.0953089
+0 0 0.0953083
+0 0 0.0952959
+0 0 0.0952952
+0 0 0.0952427
+0 0 0.0951664
+0 0 0.0951311
+0 0 0.0951128
+0 0 0.0950144
+0 0 0.0949971
+0 0 0.0949351
+0 0 0.0948798
+0 0 0.0948727
+0 0 0.0947763
+0 0 0.0947681
+0 0 0.0947623
+0 0 0.0947217
+0 0 0.0946984
+0 0 0.0946978
+0 0 0.0946832
+0 0 0.0946395
+0 0 0.0946177
+0 0 0.0945759
+0 0 0.0945205
+0 0 0.0944995
+0 0 0.0944882
+0 0 0.0944571
+0 0 0.0944524
+0 0 0.0944435
+0 0 0.0944357
+0 0 0.0943982
+0 0 0.0943872
+0 0 0.094384
+0 0 0.0943324
+0 0 0.0942979
+0 0 0.094255
+0 0 0.0942476
+0 0 0.0942305
+0 0 0.0941642
+0 0 0.094092
+0 0 0.0940547
+0 0 0.0940288
+0 0 0.0939997
+0 0 0.09392
+0 0 0.0938552
+0 0 0.0937687
+0 0 0.0936632
+0 0 0.0936529
+0 0 0.0936278
+0 0 0.0936091
+0 0 0.093571
+0 0 0.0935084
+0 0 0.0935022
+0 0 0.0934953
+0 0 0.0934922
+0 0 0.0934884
+0 0 0.0933871
+0 0 0.093311
+0 0 0.0932948
+0 0 0.0932911
+0 0 0.0932711
+0 0 0.0932653
+0 0 0.0932573
+0 0 0.0932562
+0 0 0.0932506
+0 0 0.0932066
+0 0 0.0932042
+0 0 0.0931597
+0 0 0.0931377
+0 0 0.0931191
+0 0 0.0930766
+0 0 0.0930576
+0 0 0.0930453
+0 0 0.0930159
+0 0 0.0928905
+0 0 0.0928695
+0 0 0.0928598
+0 0 0.0928533
+0 0 0.0928206
+0 0 0.0926988
+0 0 0.0926135
+0 0 0.0925997
+0 0 0.0925371
+0 0 0.0924703
+0 0 0.0924285
+0 0 0.0924272
+0 0 0.0924161
+0 0 0.0924104
+0 0 0.0922615
+0 0 0.0922589
+0 0 0.0922246
+0 0 0.0922069
+0 0 0.0921781
+0 0 0.0921505
+0 0 0.0921288
+0 0 0.0921087
+0 0 0.092054
+0 0 0.0920027
+0 0 0.091992
+0 0 0.0919474
+0 0 0.0919331
+0 0 0.0918839
+0 0 0.0918463
+0 0 0.091819
+0 0 0.0918129
+0 0 0.0917888
+0 0 0.0917854
+0 0 0.0917808
+0 0 0.0917657
+0 0 0.0917037
+0 0 0.0916728
+0 0 0.09166
+0 0 0.0916551
+0 0 0.0916386
+0 0 0.0915873
+0 0 0.091561
+0 0 0.0915438
+0 0 0.0915334
+0 0 0.0914912
+0 0 0.09148
+0 0 0.0914736
+0 0 0.0914634
+0 0 0.0913736
+0 0 0.0913735
+0 0 0.0913423
+0 0 0.0912014
+0 0 0.0912006
+0 0 0.0911837
+0 0 0.0911558
+0 0 0.0911005
+0 0 0.0910993
+0 0 0.0910305
+0 0 0.0910083
+0 0 0.0910021
+0 0 0.0909993
+0 0 0.0909587
+0 0 0.0909123
+0 0 0.0909078
+0 0 0.0908981
+0 0 0.0908775
+0 0 0.0908673
+0 0 0.0907541
+0 0 0.0907067
+0 0 0.0906992
+0 0 0.090662
+0 0 0.0905038
+0 0 0.0904268
+0 0 0.0904089
+0 0 0.0903719
+0 0 0.0903532
+0 0 0.0902778
+0 0 0.090237
+0 0 0.0902248
+0 0 0.0901963
+0 0 0.090193
+0 0 0.090185
+0 0 0.0901586
+0 0 0.0901274
+0 0 0.0900876
+0 0 0.0900408
+0 0 0.0900098
+0 0 0.0900073
+0 0 0.0899733
+0 0 0.0899145
+0 0 0.0898825
+0 0 0.0898324
+0 0 0.0898248
+0 0 0.089792
+0 0 0.0897916
+0 0 0.089778
+0 0 0.0897022
+0 0 0.0896718
+0 0 0.0896671
+0 0 0.0895692
+0 0 0.0895243
+0 0 0.0895045
+0 0 0.0894882
+0 0 0.0894629
+0 0 0.0893629
+0 0 0.0893336
+0 0 0.0893309
+0 0 0.0893193
+0 0 0.0892099
+0 0 0.089175
+0 0 0.0891563
+0 0 0.0891518
+0 0 0.0890728
+0 0 0.0890717
+0 0 0.0890423
+0 0 0.0890158
+0 0 0.0890093
+0 0 0.0890021
+0 0 0.0889876
+0 0 0.0889287
+0 0 0.0889174
+0 0 0.0888924
+0 0 0.0888761
+0 0 0.0888682
+0 0 0.0887979
+0 0 0.0887824
+0 0 0.0887418
+0 0 0.0887001
+0 0 0.0886274
+0 0 0.0886194
+0 0 0.0886061
+0 0 0.0885183
+0 0 0.0885029
+0 0 0.0884997
+0 0 0.0884676
+0 0 0.0884379
+0 0 0.0884268
+0 0 0.0884101
+0 0 0.0883594
+0 0 0.0883318
+0 0 0.0883027
+0 0 0.0882989
+0 0 0.0882955
+0 0 0.088251
+0 0 0.0882503
+0 0 0.0881693
+0 0 0.0881399
+0 0 0.0881344
+0 0 0.088097
+0 0 0.0880887
+0 0 0.0880663
+0 0 0.0880612
+0 0 0.0880102
+0 0 0.0879131
+0 0 0.0878652
+0 0 0.08786
+0 0 0.087834
+0 0 0.0878146
+0 0 0.087757
+0 0 0.0877406
+0 0 0.0876805
+0 0 0.0876786
+0 0 0.0876403
+0 0 0.087596
+0 0 0.0875844
+0 0 0.0875718
+0 0 0.0875645
+0 0 0.087518
+0 0 0.0874942
+0 0 0.0874353
+0 0 0.0874336
+0 0 0.0873725
+0 0 0.087351
+0 0 0.087348
+0 0 0.0872871
+0 0 0.0872623
+0 0 0.0872584
+0 0 0.0872349
+0 0 0.0871851
+0 0 0.0871834
+0 0 0.0870855
+0 0 0.0870338
+0 0 0.0870283
+0 0 0.0869914
+0 0 0.0869755
+0 0 0.0869607
+0 0 0.0869219
+0 0 0.0869096
+0 0 0.0868956
+0 0 0.0868514
+0 0 0.0868374
+0 0 0.0868301
+0 0 0.0867937
+0 0 0.0867655
+0 0 0.0867603
+0 0 0.0867516
+0 0 0.0867123
+0 0 0.0866914
+0 0 0.0866306
+0 0 0.0866296
+0 0 0.0866279
+0 0 0.0866149
+0 0 0.0866046
+0 0 0.086589
+0 0 0.0865754
+0 0 0.0865427
+0 0 0.0865283
+0 0 0.0865053
+0 0 0.0864874
+0 0 0.0864538
+0 0 0.0864228
+0 0 0.0864194
+0 0 0.0863696
+0 0 0.0862914
+0 0 0.0862708
+0 0 0.0862707
+0 0 0.0862618
+0 0 0.0862079
+0 0 0.0861181
+0 0 0.0861139
+0 0 0.0860775
+0 0 0.0859588
+0 0 0.0858682
+0 0 0.0858302
+0 0 0.0858208
+0 0 0.085786
+0 0 0.0857713
+0 0 0.0857462
+0 0 0.0857051
+0 0 0.0855555
+0 0 0.0855326
+0 0 0.0854601
+0 0 0.0854086
+0 0 0.0853601
+0 0 0.0853515
+0 0 0.0853294
+0 0 0.0852582
+0 0 0.085249
+0 0 0.0851983
+0 0 0.0851962
+0 0 0.0851742
+0 0 0.0851614
+0 0 0.0851573
+0 0 0.0851292
+0 0 0.0850985
+0 0 0.0850658
+0 0 0.0850454
+0 0 0.0849863
+0 0 0.0849704
+0 0 0.0849174
+0 0 0.0849149
+0 0 0.084807
+0 0 0.0847976
+0 0 0.0847651
+0 0 0.0847603
+0 0 0.0847507
+0 0 0.084721
+0 0 0.0847015
+0 0 0.0846691
+0 0 0.0846272
+0 0 0.0846259
+0 0 0.084625
+0 0 0.0845387
+0 0 0.0845105
+0 0 0.0844777
+0 0 0.0844517
+0 0 0.0844504
+0 0 0.0844359
+0 0 0.0844267
+0 0 0.0843912
+0 0 0.0843866
+0 0 0.0843828
+0 0 0.0843443
+0 0 0.0843409
+0 0 0.0843398
+0 0 0.0843247
+0 0 0.0842665
+0 0 0.0842532
+0 0 0.0842054
+0 0 0.0841559
+0 0 0.0841412
+0 0 0.08408
+0 0 0.0840751
+0 0 0.0839919
+0 0 0.0839865
+0 0 0.0839348
+0 0 0.083926
+0 0 0.0839201
+0 0 0.0838728
+0 0 0.0838659
+0 0 0.083832
+0 0 0.0838253
+0 0 0.0838225
+0 0 0.08381
+0 0 0.0837678
+0 0 0.0837502
+0 0 0.0836721
+0 0 0.0834546
+0 0 0.083452
+0 0 0.0834329
+0 0 0.0834192
+0 0 0.0834107
+0 0 0.0833158
+0 0 0.0832953
+0 0 0.0832912
+0 0 0.0832852
+0 0 0.0832816
+0 0 0.0831875
+0 0 0.0831751
+0 0 0.0831381
+0 0 0.08313
+0 0 0.0830867
+0 0 0.0830303
+0 0 0.0830191
+0 0 0.0829953
+0 0 0.0829902
+0 0 0.082963
+0 0 0.0829545
+0 0 0.0829356
+0 0 0.0829183
+0 0 0.0829129
+0 0 0.082855
+0 0 0.0828445
+0 0 0.0828289
+0 0 0.0827917
+0 0 0.0827618
+0 0 0.0827603
+0 0 0.0826968
+0 0 0.0826829
+0 0 0.0826788
+0 0 0.0825669
+0 0 0.0825437
+0 0 0.0825384
+0 0 0.0825341
+0 0 0.0824971
+0 0 0.0824907
+0 0 0.0824755
+0 0 0.0824587
+0 0 0.0824499
+0 0 0.0823912
+0 0 0.0823653
+0 0 0.082329
+0 0 0.0822893
+0 0 0.0822666
+0 0 0.0822373
+0 0 0.0822316
+0 0 0.0822187
+0 0 0.0820697
+0 0 0.082068
+0 0 0.0820532
+0 0 0.0820261
+0 0 0.0820089
+0 0 0.0819164
+0 0 0.0818598
+0 0 0.0818388
+0 0 0.0818334
+0 0 0.0817903
+0 0 0.0817481
+0 0 0.0816978
+0 0 0.0816822
+0 0 0.0816791
+0 0 0.0816385
+0 0 0.0816314
+0 0 0.0816145
+0 0 0.0816071
+0 0 0.0816029
+0 0 0.0815479
+0 0 0.0815381
+0 0 0.0815247
+0 0 0.0815176
+0 0 0.0815082
+0 0 0.0814955
+0 0 0.081407
+0 0 0.0813536
+0 0 0.0812334
+0 0 0.0811714
+0 0 0.0811689
+0 0 0.0811418
+0 0 0.0811346
+0 0 0.0811328
+0 0 0.0811056
+0 0 0.0811001
+0 0 0.0810472
+0 0 0.0810287
+0 0 0.0810215
+0 0 0.0809856
+0 0 0.0809801
+0 0 0.0809611
+0 0 0.0808721
+0 0 0.0808622
+0 0 0.0808618
+0 0 0.0808543
+0 0 0.0807894
+0 0 0.0807893
+0 0 0.0807705
+0 0 0.080715
+0 0 0.0806896
+0 0 0.0805033
+0 0 0.0804637
+0 0 0.0803715
+0 0 0.0803676
+0 0 0.0803405
+0 0 0.08034
+0 0 0.0803392
+0 0 0.0803318
+0 0 0.0803184
+0 0 0.080315
+0 0 0.0803084
+0 0 0.0802989
+0 0 0.0802988
+0 0 0.080297
+0 0 0.0802781
+0 0 0.0802677
+0 0 0.0802418
+0 0 0.0802358
+0 0 0.0802204
+0 0 0.080121
+0 0 0.0800679
+0 0 0.0800673
+0 0 0.0800411
+0 0 0.0800223
+0 0 0.0799564
+0 0 0.0799555
+0 0 0.0799524
+0 0 0.0799261
+0 0 0.0799149
+0 0 0.0798384
+0 0 0.0798239
+0 0 0.0798187
+0 0 0.079787
+0 0 0.0796839
+0 0 0.0796206
+0 0 0.0795918
+0 0 0.0795738
+0 0 0.0795622
+0 0 0.0795417
+0 0 0.0795402
+0 0 0.07953
+0 0 0.07946
+0 0 0.0794184
+0 0 0.0793805
+0 0 0.0793321
+0 0 0.0791912
+0 0 0.0791848
+0 0 0.0791774
+0 0 0.0790722
+0 0 0.0790089
+0 0 0.0789809
+0 0 0.0789498
+0 0 0.0789257
+0 0 0.0788734
+0 0 0.0788599
+0 0 0.0787641
+0 0 0.0787246
+0 0 0.0785622
+0 0 0.0785047
+0 0 0.078495
+0 0 0.0784875
+0 0 0.0784244
+0 0 0.0784187
+0 0 0.0783668
+0 0 0.0783633
+0 0 0.0782278
+0 0 0.0781832
+0 0 0.0781777
+0 0 0.0781513
+0 0 0.0781258
+0 0 0.0780305
+0 0 0.0780201
+0 0 0.0780181
+0 0 0.0780073
+0 0 0.077985
+0 0 0.0779695
+0 0 0.077938
+0 0 0.0778787
+0 0 0.0778179
+0 0 0.0777929
+0 0 0.0777845
+0 0 0.0777642
+0 0 0.0776513
+0 0 0.0776244
+0 0 0.0776135
+0 0 0.0775219
+0 0 0.0774934
+0 0 0.0774764
+0 0 0.0774541
+0 0 0.0774391
+0 0 0.0774203
+0 0 0.0773458
+0 0 0.0773391
+0 0 0.0773344
+0 0 0.0773236
+0 0 0.0773215
+0 0 0.0771755
+0 0 0.0771752
+0 0 0.0771671
+0 0 0.0770662
+0 0 0.0770659
+0 0 0.0769936
+0 0 0.076986
+0 0 0.0768987
+0 0 0.0768589
+0 0 0.0768001
+0 0 0.0767999
+0 0 0.0767277
+0 0 0.07672
+0 0 0.0767033
+0 0 0.0766285
+0 0 0.0766201
+0 0 0.0765619
+0 0 0.07653
+0 0 0.0764597
+0 0 0.0764593
+0 0 0.0762673
+0 0 0.0761308
+0 0 0.0760972
+0 0 0.0760373
+0 0 0.0760352
+0 0 0.0760226
+0 0 0.0759521
+0 0 0.0758866
+0 0 0.0758453
+0 0 0.075843
+0 0 0.0757932
+0 0 0.0757831
+0 0 0.0755611
+0 0 0.0755108
+0 0 0.075429
+0 0 0.0754205
+0 0 0.0753804
+0 0 0.0753703
+0 0 0.0753166
+0 0 0.075056
+0 0 0.0750491
+0 0 0.075046
+0 0 0.0749483
+0 0 0.0749391
+0 0 0.074843
+0 0 0.0748208
+0 0 0.0748122
+0 0 0.0747848
+0 0 0.0747133
+0 0 0.0746998
+0 0 0.074675
+0 0 0.0746619
+0 0 0.0746273
+0 0 0.0746011
+0 0 0.0745912
+0 0 0.0744812
+0 0 0.0744204
+0 0 0.0743043
+0 0 0.0742461
+0 0 0.074126
+0 0 0.0740759
+0 0 0.0740404
+0 0 0.0740253
+0 0 0.0739941
+0 0 0.0739699
+0 0 0.0738437
+0 0 0.0737842
+0 0 0.0737689
+0 0 0.073745
+0 0 0.0737311
+0 0 0.0735169
+0 0 0.0734621
+0 0 0.0733397
+0 0 0.073219
+0 0 0.0732121
+0 0 0.0731369
+0 0 0.0730708
+0 0 0.072856
+0 0 0.0728459
+0 0 0.0728339
+0 0 0.0727474
+0 0 0.0727014
+0 0 0.0725563
+0 0 0.0725443
+0 0 0.0724734
+0 0 0.0724154
+0 0 0.0721943
+0 0 0.0720927
+0 0 0.071931
+0 0 0.0719287
+0 0 0.0717993
+0 0 0.0717989
+0 0 0.0716285
+0 0 0.0715618
+0 0 0.0714544
+0 0 0.0713816
+0 0 0.0713583
+0 0 0.0713392
+0 0 0.0712466
+0 0 0.0712151
+0 0 0.071201
+0 0 0.0710418
+0 0 0.0709326
+0 0 0.0708223
+0 0 0.0707306
+0 0 0.0706176
+0 0 0.0703058
+0 0 0.0702881
+0 0 0.0702202
+0 0 0.0701399
+0 0 0.0695755
+0 0 0.0695132
+0 0 0.0694435
+0 0 0.069298
+0 0 0.0692617
+0 0 0.069201
+0 0 0.0691416
+0 0 0.0691246
+0 0 0.0691224
+0 0 0.0689761
+0 0 0.0687513
+0 0 0.068751
+0 0 0.0684475
+0 0 0.0681675
+0 0 0.0680444
+0 0 0.067827
+0 0 0.0677432
+0 0 0.0676582
+0 0 0.0676575
+0 0 0.0674522
+0 0 0.0674039
+0 0 0.0673475
+0 0 0.067117
+0 0 0.0668301
+0 0 0.0667495
+0 0 0.0666906
+0 0 0.066585
+0 0 0.0665527
+0 0 0.0665475
+0 0 0.0663859
+0 0 0.0663762
+0 0 0.0659211
+0 0 0.065897
+0 0 0.0658765
+0 0 0.0658305
+0 0 0.065485
+0 0 0.0654654
+0 0 0.0654504
+0 0 0.0653854
+0 0 0.06519
+0 0 0.0651654
+0 0 0.0651053
+0 0 0.0651005
+0 0 0.0649342
+0 0 0.0647983
+0 0 0.0645611
+0 0 0.064503
+0 0 0.0643878
+0 0 0.0641541
+0 0 0.0640333
+0 0 0.0639737
+0 0 0.0637212
+0 0 0.0635186
+0 0 0.063326
+0 0 0.0632864
+0 0 0.0632523
+0 0 0.0631945
+0 0 0.0630431
+0 0 0.0630282
+0 0 0.0628496
+0 0 0.0628005
+0 0 0.0627994
+0 0 0.0624745
+0 0 0.062401
+0 0 0.0623043
+0 0 0.0622939
+0 0 0.0620624
+0 0 0.0619763
+0 0 0.0619092
+0 0 0.0617949
+0 0 0.0616653
+0 0 0.0613634
+0 0 0.0611641
+0 0 0.0611428
+0 0 0.0610917
+0 0 0.0609721
+0 0 0.0609721
+0 0 0.060968
+0 0 0.0608642
+0 0 0.0608431
+0 0 0.0607373
+0 0 0.0603037
+0 0 0.0602398
+0 0 0.060237
+0 0 0.0601804
+0 0 0.0596339
+0 0 0.0595326
+0 0 0.0590727
+0 0 0.0589673
+0 0 0.0588864
+0 0 0.058629
+0 0 0.0586267
+0 0 0.0586052
+0 0 0.058033
+0 0 0.0578023
+0 0 0.0577624
+0 0 0.0576869
+0 0 0.0576773
+0 0 0.0576394
+0 0 0.057415
+0 0 0.057225
+0 0 0.0567939
+0 0 0.0567896
+0 0 0.0564245
+0 0 0.0563586
+0 0 0.0561217
+0 0 0.0560577
+0 0 0.0559755
+0 0 0.0557566
+0 0 0.0556232
+0 0 0.055521
+0 0 0.0550926
+0 0 0.0543985
+1 0.0997444 0.137724
+1 0.0963675 0.134298
+1 0.0997164 0.136077
+1 0.0993225 0.134439
+1 0.100243 0.135175
+1 0.102608 0.137141
+1 0.0988401 0.132691
+1 0.103142 0.136828
+1 0.100554 0.134097
+1 0.099464 0.13294
+1 0.0868897 0.119904
+1 0.0986767 0.131216
+1 0.102063 0.134272
+1 0.101951 0.133649
+1 0.104507 0.136174
+1 0.104789 0.136318
+1 0.100679 0.131807
+1 0.0979544 0.128526
+1 0.0992865 0.12979
+1 0.10505 0.135444
+1 0.106493 0.13644
+1 0.104331 0.13427
+1 0.0887233 0.116997
+1 0.100333 0.128453
+1 0.103249 0.130847
+1 0.0928315 0.12026
+1 0.103681 0.131101
+1 0.102419 0.129772
+1 0.107467 0.134504
+1 0.106298 0.13332
+1 0.0863482 0.113056
+1 0.0876685 0.114328
+1 0.102973 0.129426
+1 0.105968 0.132336
+1 0.101557 0.127648
+1 0.103991 0.129943
+1 0.0896578 0.115598
+1 0.102713 0.128567
+1 0.0943757 0.119823
+1 0.107541 0.132986
+1 0.0940415 0.119416
+1 0.106706 0.131892
+1 0.102134 0.127276
+1 0.08196 0.107085
+1 0.0971671 0.122111
+1 0.105478 0.130109
+1 0.0868236 0.111189
+1 0.0946673 0.118694
+1 0.101082 0.125066
+1 0.104529 0.128397
+1 0.113264 0.137008
+1 0.093598 0.117279
+1 0.102309 0.125859
+1 0.11137 0.134915
+1 0.109647 0.133169
+1 0.0961717 0.119526
+1 0.0914649 0.11455
+1 0.104092 0.126992
+1 0.110014 0.13285
+1 0.0969412 0.119714
+1 0.096505 0.119274
+1 0.107733 0.130472
+1 0.105091 0.127774
+1 0.107621 0.130186
+1 0.101354 0.12387
+1 0.0972194 0.119734
+1 0.111868 0.134382
+1 0.103895 0.126399
+1 0.105818 0.128237
+1 0.093991 0.11639
+1 0.106408 0.128753
+1 0.103344 0.125641
+1 0.0985647 0.120776
+1 0.107818 0.130023
+1 0.105326 0.127497
+1 0.108424 0.130451
+1 0.104609 0.126592
+1 0.105401 0.127105
+1 0.108989 0.130636
+1 0.109277 0.130788
+1 0.109884 0.131386
+1 0.096265 0.117692
+1 0.0973152 0.118724
+1 0.0978033 0.11914
+1 0.105971 0.127172
+1 0.105206 0.126174
+1 0.103094 0.123862
+1 0.0930364 0.1137
+1 0.0912215 0.111759
+1 0.105776 0.126283
+1 0.109117 0.129577
+1 0.11185 0.132307
+1 0.103348 0.123757
+1 0.112671 0.132855
+1 0.0873389 0.10751
+1 0.113148 0.133301
+1 0.107831 0.127932
+1 0.0942185 0.114302
+1 0.105423 0.125481
+1 0.100447 0.120461
+1 0.11413 0.134098
+1 0.103867 0.123829
+1 0.109305 0.129215
+1 0.111781 0.131688
+1 0.115776 0.135588
+1 0.0866676 0.106473
+1 0.0820686 0.101833
+1 0.109769 0.129516
+1 0.109777 0.129457
+1 0.0969575 0.116617
+1 0.111919 0.131476
+1 0.0974989 0.117008
+1 0.112238 0.131725
+1 0.0996257 0.119081
+1 0.101161 0.120602
+1 0.0894888 0.108793
+1 0.105021 0.124292
+1 0.110994 0.13024
+1 0.11702 0.136226
+1 0.108008 0.127172
+1 0.109482 0.128451
+1 0.108245 0.127174
+1 0.0942135 0.11312
+1 0.0992471 0.118131
+1 0.106623 0.125504
+1 0.0871873 0.106063
+1 0.108132 0.126863
+1 0.0987099 0.117422
+1 0.105374 0.124068
+1 0.114406 0.133036
+1 0.0914967 0.109997
+1 0.106521 0.1249
+1 0.0955759 0.113921
+1 0.111101 0.129415
+1 0.105122 0.122988
+1 0.091267 0.10908
+1 0.110432 0.127976
+1 0.088384 0.105787
+1 0.112786 0.130153
+1 0.106171 0.123531
+1 0.11442 0.13177
+1 0.109894 0.127229
+1 0.0937333 0.111036
+1 0.106992 0.124248
+1 0.0969028 0.114151
+1 0.116183 0.133233
+1 0.111736 0.128771
+1 0.0993216 0.116354
+1 0.0918067 0.108784
+1 0.104158 0.121134
+1 0.121028 0.137945
+1 0.119786 0.13669
+1 0.101491 0.118338
+1 0.0900619 0.106861
+1 0.105091 0.121844
+1 0.110906 0.12756
+1 0.0942669 0.110777
+1 0.0936016 0.110107
+1 0.103974 0.120299
+1 0.0903266 0.106619
+1 0.109739 0.126022
+1 0.101771 0.117974
+1 0.113957 0.130135
+1 0.104949 0.121106
+1 0.113859 0.129981
+1 0.107266 0.123375
+1 0.106434 0.122441
+1 0.0825495 0.0985038
+1 0.0928646 0.108775
+1 0.10811 0.124013
+1 0.115498 0.131352
+1 0.0857711 0.101566
+1 0.109411 0.12513
+1 0.0992369 0.114868
+1 0.104979 0.120588
+1 0.0928687 0.108436
+1 0.115035 0.130513
+1 0.10634 0.121795
+1 0.0972824 0.112736
+1 0.10508 0.120494
+1 0.0983725 0.11376
+1 0.101863 0.117236
+1 0.108938 0.124301
+1 0.107762 0.123121
+1 0.107407 0.122532
+1 0.102095 0.11715
+1 0.0926056 0.107647
+1 0.102122 0.117157
+1 0.111668 0.126692
+1 0.118187 0.133023
+1 0.091849 0.106675
+1 0.0955763 0.110398
+1 0.0897714 0.104589
+1 0.10026 0.115026
+1 0.117548 0.132301
+1 0.102181 0.116898
+1 0.1039 0.118592
+1 0.111494 0.126118
+1 0.117851 0.132466
+1 0.102311 0.116874
+1 0.104558 0.11907
+1 0.0826206 0.0971206
+1 0.0983518 0.112851
+1 0.108266 0.122713
+1 0.117257 0.13169
+1 0.112625 0.127054
+1 0.102561 0.116956
+1 0.105435 0.119828
+1 0.105814 0.120097
+1 0.110893 0.125174
+1 0.106181 0.120423
+1 0.10824 0.122466
+1 0.0998914 0.114008
+1 0.111463 0.125547
+1 0.106653 0.120712
+1 0.114143 0.128187
+1 0.0987227 0.112686
+1 0.10959 0.123535
+1 0.0866352 0.100557
+1 0.112146 0.126068
+1 0.088279 0.102
+1 0.110376 0.124047
+1 0.101789 0.115338
+1 0.106953 0.120376
+1 0.102707 0.116075
+1 0.0993793 0.112687
+1 0.108878 0.122123
+1 0.120961 0.134152
+1 0.10885 0.122037
+1 0.10738 0.12056
+1 0.101432 0.114597
+1 0.112405 0.125556
+1 0.106813 0.119921
+1 0.112285 0.12529
+1 0.11012 0.123063
+1 0.107717 0.120611
+1 0.0897068 0.102559
+1 0.0987529 0.111589
+1 0.0884634 0.101236
+1 0.0911157 0.103871
+1 0.11179 0.124441
+1 0.119124 0.131689
+1 0.114039 0.126565
+1 0.099306 0.111821
+1 0.109672 0.122139
+1 0.0967874 0.109252
+1 0.110451 0.122915
+1 0.10042 0.112872
+1 0.109867 0.122175
+1 0.11559 0.127875
+1 0.0924112 0.104671
+1 0.109943 0.122122
+1 0.0834784 0.0956025
+1 0.094677 0.106789
+1 0.0944022 0.106494
+1 0.104009 0.116052
+1 0.115406 0.127413
+1 0.0997344 0.111634
+1 0.0834597 0.0953123
+1 0.100265 0.112109
+1 0.108783 0.120624
+1 0.102596 0.114393
+1 0.105933 0.117699
+1 0.0955911 0.10734
+1 0.0915704 0.103284
+1 0.106757 0.11847
+1 0.108034 0.119659
+1 0.107063 0.118624
+1 0.102709 0.114217
+1 0.114347 0.125851
+1 0.101592 0.113064
+1 0.10639 0.117794
+1 0.109961 0.12135
+1 0.106373 0.117724
+1 0.111847 0.123153
+1 0.109539 0.120825
+1 0.0937078 0.104977
+1 0.106527 0.117767
+1 0.115889 0.127068
+1 0.108483 0.119661
+1 0.113189 0.124325
+1 0.106832 0.11787
+1 0.0875251 0.0984842
+1 0.115665 0.126551
+1 0.0929162 0.103716
+1 0.103776 0.114372
+1 0.0975538 0.108061
+1 0.107443 0.117928
+1 0.108814 0.119261
+1 0.103151 0.11358
+1 0.0967477 0.107154
+1 0.104979 0.115384
+1 0.101284 0.111574
+1 0.104981 0.115252
+1 0.0866825 0.0968263
+1 0.112361 0.122466
+1 0.108466 0.118492
+1 0.0975612 0.107561
+1 0.104563 0.114561
+1 0.0854395 0.095418
+1 0.0931692 0.10309
+1 0.107751 0.117652
+1 0.109986 0.119829
+1 0.107501 0.117327
+1 0.104998 0.114782
+1 0.107751 0.117509
+1 0.10754 0.117241
+1 0.111665 0.121357
+1 0.111614 0.121288
+1 0.0872065 0.0968618
+1 0.115761 0.125399
+1 0.10581 0.115426
+1 0.0991297 0.108708
+1 0.104736 0.114301
+1 0.103519 0.112982
+1 0.118659 0.12812
+1 0.107261 0.116706
+1 0.110161 0.119539
+1 0.108064 0.11741
+1 0.107143 0.116483
+1 0.108131 0.117452
+1 0.116427 0.125679
+1 0.0961462 0.105394
+1 0.112569 0.121769
+1 0.0927918 0.101983
+1 0.109636 0.118819
+1 0.0955058 0.104585
+1 0.114088 0.12316
+1 0.111901 0.120969
+1 0.121982 0.131005
+1 0.110988 0.119947
+1 0.0783357 0.0872192
+1 0.120473 0.129355
+1 0.0921671 0.101035
+1 0.119236 0.128003
+1 0.099794 0.108554
+1 0.111357 0.120079
+1 0.11281 0.121516
+1 0.109016 0.117706
+1 0.0931245 0.101783
+1 0.0878912 0.0964983
+1 0.102065 0.110672
+1 0.114585 0.123166
+1 0.110329 0.118883
+1 0.113325 0.121811
+1 0.101143 0.109586
+1 0.119504 0.127904
+1 0.0955487 0.103878
+1 0.0911453 0.0994428
+1 0.120339 0.128623
+1 0.12142 0.129703
+1 0.086379 0.0945977
+1 0.121228 0.129444
+1 0.103027 0.111225
+1 0.113614 0.1218
+1 0.108909 0.116988
+1 0.110248 0.118274
+1 0.0849678 0.0929893
+1 0.113829 0.121818
+1 0.0936312 0.101612
+1 0.102472 0.110429
+1 0.0868612 0.0948107
+1 0.114083 0.121935
+1 0.107052 0.114866
+1 0.105241 0.113053
+1 0.107277 0.114788
+1 0.115088 0.122587
+1 0.0829082 0.0903731
+1 0.10558 0.113044
+1 0.11145 0.118882
+1 0.110181 0.117593
+1 0.114964 0.122358
+1 0.0853302 0.0927109
+1 0.108171 0.115549
+1 0.106645 0.114018
+1 0.103232 0.110597
+1 0.106894 0.114255
+1 0.10519 0.11254
+1 0.127885 0.135225
+1 0.103913 0.111224
+1 0.10035 0.107651
+1 0.110201 0.1175
+1 0.0962617 0.103558
+1 0.108197 0.115486
+1 0.111458 0.11871
+1 0.098521 0.105772
+1 0.122219 0.129425
+1 0.0893661 0.0965408
+1 0.107871 0.115033
+1 0.104818 0.11198
+1 0.114927 0.122087
+1 0.120229 0.127389
+1 0.123751 0.130863
+1 0.0867811 0.0938895
+1 0.108725 0.115806
+1 0.111298 0.118332
+1 0.116132 0.123053
+1 0.102178 0.109074
+1 0.114549 0.121432
+1 0.110523 0.117281
+1 0.117735 0.124481
+1 0.0884368 0.0950995
+1 0.107416 0.114045
+1 0.106531 0.113154
+1 0.103014 0.109636
+1 0.10813 0.114736
+1 0.11639 0.122984
+1 0.109105 0.115698
+1 0.093397 0.0999793
+1 0.115742 0.122324
+1 0.118376 0.124898
+1 0.101104 0.107606
+1 0.115044 0.121535
+1 0.113476 0.119883
+1 0.105748 0.112141
+1 0.109104 0.115492
+1 0.125917 0.132265
+1 0.111914 0.118232
+1 0.125883 0.132169
+1 0.121077 0.127362
+1 0.115773 0.122013
+1 0.104313 0.110543
+1 0.118365 0.124566
+1 0.102092 0.108248
+1 0.120337 0.126478
+1 0.114541 0.120675
+1 0.0992553 0.105374
+1 0.105628 0.111687
+1 0.0850423 0.0910966
+1 0.103692 0.109734
+1 0.120771 0.126797
+1 0.119856 0.125882
+1 0.102024 0.108023
+1 0.119626 0.125622
+1 0.104521 0.110516
+1 0.0915391 0.0974011
+1 0.114983 0.12084
+1 0.110716 0.11656
+1 0.106244 0.112004
+1 0.107854 0.1136
+1 0.0903226 0.0960447
+1 0.120372 0.126087
+1 0.10324 0.108948
+1 0.122694 0.128337
+1 0.1117 0.117306
+1 0.119211 0.124804
+1 0.110743 0.116312
+1 0.117496 0.123039
+1 0.113227 0.118763
+1 0.108715 0.114232
+1 0.107506 0.113022
+1 0.116576 0.122077
+1 0.112014 0.11751
+1 0.121067 0.126503
+1 0.10271 0.10807
+1 0.117238 0.122588
+1 0.112664 0.117961
+1 0.110963 0.116251
+1 0.121302 0.126577
+1 0.112077 0.117336
+1 0.095596 0.100812
+1 0.111411 0.116605
+1 0.0902511 0.0954238
+1 0.114381 0.119466
+1 0.0998193 0.104886
+1 0.0918736 0.0969192
+1 0.0884121 0.0934282
+1 0.110972 0.115973
+1 0.108334 0.113302
+1 0.102994 0.107957
+1 0.122498 0.127409
+1 0.113511 0.118395
+1 0.0906824 0.0955612
+1 0.0908176 0.0956598
+1 0.104894 0.109707
+1 0.116777 0.12158
+1 0.108034 0.112829
+1 0.119415 0.12418
+1 0.119605 0.124356
+1 0.11511 0.119826
+1 0.10408 0.108782
+1 0.0893248 0.0940033
+1 0.109139 0.113811
+1 0.0869492 0.0916174
+1 0.11488 0.119522
+1 0.108902 0.113507
+1 0.102023 0.106573
+1 0.106527 0.111071
+1 0.1117 0.116244
+1 0.108254 0.11277
+1 0.111407 0.115914
+1 0.0906087 0.0950758
+1 0.106504 0.11095
+1 0.123911 0.128263
+1 0.10015 0.10448
+1 0.100373 0.104665
+1 0.104751 0.109037
+1 0.114767 0.119022
+1 0.11427 0.118524
+1 0.0873467 0.091541
+1 0.120737 0.124923
+1 0.101735 0.105869
+1 0.117308 0.121437
+1 0.0949366 0.0990612
+1 0.110445 0.114566
+1 0.111496 0.115581
+1 0.107981 0.112018
+1 0.0836944 0.0877279
+1 0.0869282 0.0909341
+1 0.126548 0.13054
+1 0.119075 0.123055
+1 0.116128 0.120086
+1 0.101842 0.10579
+1 0.113183 0.117117
+1 0.118439 0.122358
+1 0.103742 0.107651
+1 0.115295 0.119183
+1 0.103151 0.107026
+1 0.102092 0.105948
+1 0.108527 0.112373
+1 0.0988934 0.102714
+1 0.105175 0.108975
+1 0.0900176 0.0937998
+1 0.124104 0.127877
+1 0.108098 0.111867
+1 0.0927389 0.0964599
+1 0.0950363 0.09874
+1 0.103675 0.107361
+1 0.106655 0.110301
+1 0.109679 0.113325
+1 0.115272 0.118888
+1 0.115989 0.119557
+1 0.121905 0.125397
+1 0.10312 0.106565
+1 0.108113 0.111554
+1 0.121869 0.125284
+1 0.102783 0.106188
+1 0.103888 0.107291
+1 0.115296 0.118678
+1 0.10563 0.108996
+1 0.106472 0.109814
+1 0.11275 0.116076
+1 0.0845606 0.0878851
+1 0.119448 0.122766
+1 0.104633 0.107941
+1 0.109935 0.113234
+1 0.112474 0.115747
+1 0.091723 0.0949822
+1 0.0844931 0.0877142
+1 0.103435 0.106632
+1 0.0991778 0.102339
+1 0.0920068 0.0951646
+1 0.112581 0.115727
+1 0.100722 0.10379
+1 0.0926894 0.0957161
+1 0.0988585 0.101883
+1 0.112133 0.115093
+1 0.100392 0.103342
+1 0.121192 0.124101
+1 0.127297 0.130205
+1 0.124283 0.127125
+1 0.118629 0.121461
+1 0.120033 0.122863
+1 0.106227 0.109042
+1 0.0877192 0.0905291
+1 0.121117 0.123921
+1 0.1073 0.110085
+1 0.102226 0.104966
+1 0.0913487 0.094036
+1 0.121988 0.124653
+1 0.111379 0.114023
+1 0.118327 0.120956
+1 0.127402 0.129993
+1 0.0865545 0.0891376
+1 0.109444 0.112021
+1 0.116611 0.119173
+1 0.0898924 0.092445
+1 0.104545 0.107074
+1 0.106897 0.109384
+1 0.121135 0.123621
+1 0.108985 0.111453
+1 0.118284 0.120727
+1 0.106249 0.108667
+1 0.12219 0.1246
+1 0.122067 0.124462
+1 0.124465 0.126835
+1 0.112932 0.1153
+1 0.11878 0.121147
+1 0.118673 0.121016
+1 0.125604 0.127906
+1 0.102935 0.105231
+1 0.095249 0.0975133
+1 0.120558 0.122822
+1 0.0989733 0.101209
+1 0.107301 0.10953
+1 0.0928034 0.0950099
+1 0.114216 0.11637
+1 0.118923 0.121075
+1 0.0865676 0.0887081
+1 0.111848 0.113959
+1 0.104268 0.106377
+1 0.120826 0.1229
+1 0.105936 0.108007
+1 0.118976 0.121027
+1 0.110054 0.112099
+1 0.123635 0.125677
+1 0.112406 0.114439
+1 0.11012 0.112134
+1 0.0884612 0.0904603
+1 0.111737 0.113728
+1 0.113357 0.115347
+1 0.108096 0.110081
+1 0.108259 0.110219
+1 0.128584 0.130535
+1 0.10709 0.109027
+1 0.100268 0.102179
+1 0.122237 0.124142
+1 0.100079 0.101982
+1 0.0967714 0.0986662
+1 0.113603 0.115487
+1 0.0912266 0.0930879
+1 0.117149 0.119006
+1 0.110169 0.112011
+1 0.109301 0.111132
+1 0.118604 0.120405
+1 0.117961 0.11976
+1 0.104397 0.106158
+1 0.118609 0.120336
+1 0.0832201 0.0849465
+1 0.0797153 0.0814197
+1 0.0990505 0.100753
+1 0.10596 0.107658
+1 0.0998188 0.101476
+1 0.105913 0.10757
+1 0.113531 0.115182
+1 0.0967926 0.098443
+1 0.0940843 0.0957039
+1 0.114661 0.116274
+1 0.087046 0.0886275
+1 0.0916777 0.0932535
+1 0.123024 0.124591
+1 0.0875995 0.089149
+1 0.110778 0.112327
+1 0.116115 0.117637
+1 0.128015 0.129522
+1 0.11174 0.113234
+1 0.0897331 0.0912275
+1 0.0941751 0.0956475
+1 0.108018 0.109483
+1 0.0974017 0.0988631
+1 0.0933664 0.0947723
+1 0.111466 0.11286
+1 0.11841 0.11978
+1 0.114989 0.116311
+1 0.120067 0.121385
+1 0.113528 0.114839
+1 0.104843 0.106117
+1 0.111298 0.112507
+1 0.0987946 0.100003
+1 0.116609 0.117793
+1 0.0907966 0.0919788
+1 0.116691 0.117873
+1 0.105971 0.107138
+1 0.108219 0.109383
+1 0.107818 0.108969
+1 0.110756 0.111896
+1 0.107855 0.108977
+1 0.111159 0.112271
+1 0.106634 0.107745
+1 0.104271 0.105379
+1 0.114413 0.115445
+1 0.114315 0.115337
+1 0.0967034 0.0977021
+1 0.113498 0.114496
+1 0.105644 0.106638
+1 0.123591 0.124579
+1 0.108805 0.109775
+1 0.108044 0.109001
+1 0.123861 0.124794
+1 0.110087 0.111007
+1 0.0955589 0.0964736
+1 0.102733 0.103612
+1 0.104046 0.104922
+1 0.0924699 0.0933413
+1 0.115285 0.116112
+1 0.0954201 0.09623
+1 0.0855219 0.0863159
+1 0.0967526 0.0975336
+1 0.105675 0.106446
+1 0.0900959 0.0908643
+1 0.105807 0.10657
+1 0.118205 0.118962
+1 0.117617 0.118373
+1 0.114137 0.114887
+1 0.114842 0.115581
+1 0.10114 0.101879
+1 0.103445 0.104161
+1 0.0991235 0.0998339
+1 0.0972796 0.0979348
+1 0.102682 0.103332
+1 0.0938035 0.0944286
+1 0.111262 0.11188
+1 0.111618 0.112153
+1 0.0997941 0.100297
+1 0.120843 0.121314
+1 0.114265 0.114734
+1 0.10137 0.101832
+1 0.108491 0.108953
+1 0.0991029 0.099559
+1 0.102937 0.10339
+1 0.118778 0.119221
+1 0.107189 0.107626
+1 0.101957 0.102357
+1 0.0924087 0.0928051
+1 0.101168 0.101555
+1 0.109878 0.110253
+1 0.101449 0.101791
+1 0.0965111 0.0968328
+1 0.0997832 0.100102
+1 0.116346 0.11663
+1 0.125517 0.125757
+1 0.125432 0.125671
+1 0.111594 0.111803
+1 0.10228 0.102465
+1 0.110192 0.110371
+1 0.0993469 0.0995118
+1 0.104171 0.104324
+1 0.0807541 0.0808958
+1 0.10346 0.103585
+1 0.127331 0.127396
+1 0.0945151 0.0945558
+1 0.104771 0.104801
+1 0.103878 0.103908
+1 0.11169 0.111695
diff --git a/data/points/Kl.off b/data/points/Kl.off
index 911bcd23..8930a321 100644
--- a/data/points/Kl.off
+++ b/data/points/Kl.off
@@ -1,5 +1,5 @@
-OFF
-10000 0 0
+nOFF
+5 10000 0 0
0.5 0 0 0 1
0.562791 0 0.125333 0 0.998027
0.625333 0 0.24869 0 0.992115
diff --git a/doc/Alpha_complex/COPYRIGHT b/doc/Alpha_complex/COPYRIGHT
index dbad2380..5f1d97cc 100644
--- a/doc/Alpha_complex/COPYRIGHT
+++ b/doc/Alpha_complex/COPYRIGHT
@@ -4,7 +4,7 @@ computational topology.
Author(s): Vincent Rouvreau
-Copyright (C) 2015 INRIA
+Copyright (C) 2015 Inria
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
diff --git a/doc/Alpha_complex/Intro_alpha_complex.h b/doc/Alpha_complex/Intro_alpha_complex.h
index a08663ca..7a375c9f 100644
--- a/doc/Alpha_complex/Intro_alpha_complex.h
+++ b/doc/Alpha_complex/Intro_alpha_complex.h
@@ -4,7 +4,7 @@
*
* Author(s): Vincent Rouvreau
*
- * Copyright (C) 2015 INRIA
+ * Copyright (C) 2015 Inria
*
* 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
@@ -57,9 +57,13 @@ namespace alpha_complex {
* href="http://doc.cgal.org/latest/Kernel_d/index.html#Chapter_dD_Geometry_Kernel">dD Geometry Kernel</a>
* \cite cgal:s-gkd-15b from CGAL as template parameter.
*
- * \remark When the simplicial complex is constructed with an infinite value of alpha, the complex is a Delaunay
+ * \remark
+ * - When the simplicial complex is constructed with an infinite value of alpha, the complex is a Delaunay
* complex.
- *
+ * - For people only interested in the topology of the \ref alpha_complex (for instance persistence),
+ * \ref alpha_complex is equivalent to the \ref cech_complex and much smaller if you do not bound the radii.
+ * \ref cech_complex can still make sense in higher dimension precisely because you can bound the radii.
+ *
* \section pointsexample Example from points
*
* This example builds the Delaunay triangulation from the given points in a 2D static kernel, and creates a
@@ -89,63 +93,29 @@ namespace alpha_complex {
* \image html "alpha_complex_doc.png" "Simplicial complex structure construction example"
*
* \subsection filtrationcomputation Filtration value computation algorithm
- *
- *
- *
- * <ul>
- * <li style="list-style-type: none;">\f$ \textbf{for } i : dimension \rightarrow 0 \textbf{ do} \f$
- * <ul>
- * <li style="list-style-type: none;">\f$\textbf{for all } \sigma of dimension i \f$
- * <ul>
- * <li style="list-style-type: none;">\f$\textbf{if } filtration( \sigma ) is NaN \textbf{ then} \f$
- * <ul>
- * <li style="list-style-type: none;">\f$ filtration( \sigma ) = \alpha^2( \sigma ) \f$
- * </li>
- * </ul>
- * </li>
- * <li style="list-style-type: none;">\f$\textbf{end if}\f$
- * </li>
- * <li style="list-style-type: none;">\f$\textbf{for all } \tau face of \sigma \textbf{ do} \f$
- * &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// propagate alpha filtration value
- * <ul>
- * <li style="list-style-type: none;">\f$\textbf{if } filtration( \tau ) is not NaN \textbf{ then} \f$
- * <ul>
- * <li style="list-style-type: none;">\f$ filtration( \tau ) = min ( filtration( \tau ), filtration( \sigma ) ) \f$
- * </li>
- * </ul>
- * </li>
- * <li style="list-style-type: none;">\f$\textbf{else}\f$
- * <ul>
- * <li style="list-style-type: none;">\f$\textbf{if } \tau is not Gabriel for \sigma \textbf{ then} \f$
- * <ul>
- * <li style="list-style-type: none;">\f$ filtration( \tau ) = filtration( \sigma ) \f$
- * </li>
- * </ul>
- * </li>
- * <li style="list-style-type: none;">\f$\textbf{end if}\f$
- * </li>
- * </ul>
- * </li>
- * <li style="list-style-type: none;">\f$\textbf{end if}\f$
- * </li>
- * </ul>
- * </li>
- * <li style="list-style-type: none;">\f$\textbf{end for}\f$
- * </li>
- * </ul>
- * </li>
- * <li style="list-style-type: none;">\f$\textbf{end for}\f$
- * </li>
- * </ul>
- * </li>
- * <li style="list-style-type: none;">\f$\textbf{end for}\f$
- * </li>
- * <li style="list-style-type: none;">\f$make\_filtration\_non\_decreasing()\f$
- * </li>
- * <li style="list-style-type: none;">\f$prune\_above\_filtration()\f$
- * </li>
- * </ul>
- *
+ * <br>
+ * \f$
+ * \textbf{for } \text{i : dimension } \rightarrow 0 \textbf{ do}\\
+ * \quad \textbf{for all } \sigma \text{ of dimension i}\\
+ * \quad\quad \textbf{if } \text{filtration(} \sigma ) \text{ is NaN} \textbf{ then}\\
+ * \quad\quad\quad \text{filtration(} \sigma ) = \alpha^2( \sigma )\\
+ * \quad\quad \textbf{end if}\\
+ * \quad\quad \textbf{for all } \tau \text{ face of } \sigma \textbf{ do}\quad\quad
+ * \textit{// propagate alpha filtration value}\\
+ * \quad\quad\quad \textbf{if } \text{filtration(} \tau ) \text{ is not NaN} \textbf{ then}\\
+ * \quad\quad\quad\quad \text{filtration(} \tau \text{) = min( filtration(} \tau \text{), filtration(} \sigma
+ * \text{) )}\\
+ * \quad\quad\quad \textbf{else}\\
+ * \quad\quad\quad\quad \textbf{if } \textbf{if } \tau \text{ is not Gabriel for } \sigma \textbf{ then}\\
+ * \quad\quad\quad\quad\quad \text{filtration(} \tau \text{) = filtration(} \sigma \text{)}\\
+ * \quad\quad\quad\quad \textbf{end if}\\
+ * \quad\quad\quad \textbf{end if}\\
+ * \quad\quad \textbf{end for}\\
+ * \quad \textbf{end for}\\
+ * \textbf{end for}\\
+ * \text{make_filtration_non_decreasing()}\\
+ * \text{prune_above_filtration()}\\
+ * \f$
*
* \subsubsection dimension2 Dimension 2
*
diff --git a/doc/Bitmap_cubical_complex/COPYRIGHT b/doc/Bitmap_cubical_complex/COPYRIGHT
index bcd46b23..2b14dcb9 100644
--- a/doc/Bitmap_cubical_complex/COPYRIGHT
+++ b/doc/Bitmap_cubical_complex/COPYRIGHT
@@ -4,7 +4,7 @@ computational topology.
Author(s): Pawel Dlotko
-Copyright (C) 2015 INRIA
+Copyright (C) 2015 Inria
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
diff --git a/doc/Bitmap_cubical_complex/Gudhi_Cubical_Complex_doc.h b/doc/Bitmap_cubical_complex/Gudhi_Cubical_Complex_doc.h
index a5d7b60f..d1836ef0 100644
--- a/doc/Bitmap_cubical_complex/Gudhi_Cubical_Complex_doc.h
+++ b/doc/Bitmap_cubical_complex/Gudhi_Cubical_Complex_doc.h
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2015 INRIA Sophia-Saclay (France)
+ * Copyright (C) 2015 Inria
*
* 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
diff --git a/doc/Bottleneck_distance/COPYRIGHT b/doc/Bottleneck_distance/COPYRIGHT
index 179740a6..1c2016b1 100644
--- a/doc/Bottleneck_distance/COPYRIGHT
+++ b/doc/Bottleneck_distance/COPYRIGHT
@@ -4,7 +4,7 @@ computational topology.
Author(s): François Godi
-Copyright (C) 2015 INRIA
+Copyright (C) 2015 Inria
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
diff --git a/doc/Bottleneck_distance/Intro_bottleneck_distance.h b/doc/Bottleneck_distance/Intro_bottleneck_distance.h
index 3998fe8d..f8fce96c 100644
--- a/doc/Bottleneck_distance/Intro_bottleneck_distance.h
+++ b/doc/Bottleneck_distance/Intro_bottleneck_distance.h
@@ -4,7 +4,7 @@
*
* Author: François Godi
*
- * Copyright (C) 2015 INRIA
+ * Copyright (C) 2015 Inria
*
* 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
diff --git a/doc/Cech_complex/COPYRIGHT b/doc/Cech_complex/COPYRIGHT
new file mode 100644
index 00000000..5f1d97cc
--- /dev/null
+++ b/doc/Cech_complex/COPYRIGHT
@@ -0,0 +1,19 @@
+The files of this directory are part of the Gudhi Library. The Gudhi library
+(Geometric Understanding in Higher Dimensions) is a generic C++ library for
+computational topology.
+
+Author(s): Vincent Rouvreau
+
+Copyright (C) 2015 Inria
+
+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/>.
diff --git a/doc/Cech_complex/Intro_cech_complex.h b/doc/Cech_complex/Intro_cech_complex.h
new file mode 100644
index 00000000..4483bcb9
--- /dev/null
+++ b/doc/Cech_complex/Intro_cech_complex.h
@@ -0,0 +1,114 @@
+/* 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): Vincent Rouvreau
+ *
+ * Copyright (C) 2018 Inria
+ *
+ * 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/>.
+ */
+
+#ifndef DOC_CECH_COMPLEX_INTRO_CECH_COMPLEX_H_
+#define DOC_CECH_COMPLEX_INTRO_CECH_COMPLEX_H_
+
+namespace Gudhi {
+
+namespace cech_complex {
+
+/** \defgroup cech_complex Čech complex
+ *
+ * \author Vincent Rouvreau
+ *
+ * @{
+ *
+ * \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/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.
+ *
+ * The input shall be a point cloud in an Euclidean space.
+ *
+ * \remark For people only interested in the topology of the \ref cech_complex (for instance persistence),
+ * \ref alpha_complex is equivalent to the \ref cech_complex and much smaller if you do not bound the radii.
+ * \ref cech_complex can still make sense in higher dimension precisely because you can bound the radii.
+ *
+ * \subsection cechalgorithm Algorithm
+ *
+ * Cech_complex first builds a proximity graph from a point cloud.
+ * The filtration value of each edge of the `Gudhi::Proximity_graph` is computed from
+ * `Gudhi::Minimal_enclosing_ball_radius` function.
+ *
+ * All edges that have a filtration value strictly greater than a user given maximal radius value, \f$max\_radius\f$,
+ * are not inserted into the complex.
+ *
+ * Vertex name correspond to the index of the point in the given range (aka. the point cloud).
+ *
+ * \image html "cech_one_skeleton.png" "Čech complex proximity graph representation"
+ *
+ * When creating a simplicial complex from this proximity graph, Cech_complex inserts the proximity graph into the
+ * simplicial complex data structure, and then expands the simplicial complex when required.
+ *
+ * On this example, as edges \f$(x,y)\f$, \f$(y,z)\f$ and \f$(z,y)\f$ are in the complex, the minimal ball radius
+ * containing the points \f$(x,y,z)\f$ is computed.
+ *
+ * \f$(x,y,z)\f$ is inserted to the simplicial complex with the filtration value set with
+ * \f$mini\_ball\_radius(x,y,z))\f$ iff \f$mini\_ball\_radius(x,y,z)) \leq max\_radius\f$.
+ *
+ * And so on for higher dimensions.
+ *
+ * \image html "cech_complex_representation.png" "Čech complex expansion"
+ *
+ * The minimal ball radius computation is insured by
+ * <a target="_blank" href="https://people.inf.ethz.ch/gaertner/subdir/software/miniball.html">
+ * the miniball software (V3.0)</a> - Smallest Enclosing Balls of Points - and distributed with GUDHI.
+ * Please refer to
+ * <a target="_blank" href="https://people.inf.ethz.ch/gaertner/subdir/texts/own_work/esa99_final.pdf">
+ * the miniball software design description</a> for more information about this computation.
+ *
+ * This radius computation is the reason why the Cech_complex is taking much more time to be computed than the
+ * \ref rips_complex but it offers more topological guarantees.
+ *
+ * If the Cech_complex interfaces are not detailed enough for your need, please refer to
+ * <a href="_cech_complex_2cech_complex_step_by_step_8cpp-example.html">
+ * cech_complex_step_by_step.cpp</a> example, where the graph construction over the Simplex_tree is more detailed.
+ *
+ * \subsection cechpointscloudexample Example from a point cloud
+ *
+ * This example builds the proximity graph from the given points, and maximal radius values.
+ * Then it creates a `Simplex_tree` with it.
+ *
+ * Then, it is asked to display information about the simplicial complex.
+ *
+ * \include Cech_complex/cech_complex_example_from_points.cpp
+ *
+ * When launching (maximal enclosing ball radius is 1., is expanded until dimension 2):
+ *
+ * \code $> ./Cech_complex_example_from_points
+ * \endcode
+ *
+ * the program output is:
+ *
+ * \include Cech_complex/cech_complex_example_from_points_for_doc.txt
+ *
+ */
+/** @} */ // end defgroup cech_complex
+
+} // namespace cech_complex
+
+} // namespace Gudhi
+
+#endif // DOC_CECH_COMPLEX_INTRO_CECH_COMPLEX_H_
diff --git a/doc/Cech_complex/cech_complex_representation.ipe b/doc/Cech_complex/cech_complex_representation.ipe
new file mode 100644
index 00000000..377745a3
--- /dev/null
+++ b/doc/Cech_complex/cech_complex_representation.ipe
@@ -0,0 +1,330 @@
+<?xml version="1.0"?>
+<!DOCTYPE ipe SYSTEM "ipe.dtd">
+<ipe version="70107" creator="Ipe 7.1.10">
+<info created="D:20150603143945" modified="D:20180305162524"/>
+<ipestyle name="basic">
+<symbol name="arrow/arc(spx)">
+<path stroke="sym-stroke" fill="sym-stroke" pen="sym-pen">
+0 0 m
+-1 0.333 l
+-1 -0.333 l
+h
+</path>
+</symbol>
+<symbol name="arrow/farc(spx)">
+<path stroke="sym-stroke" fill="white" pen="sym-pen">
+0 0 m
+-1 0.333 l
+-1 -0.333 l
+h
+</path>
+</symbol>
+<symbol name="mark/circle(sx)" transformations="translations">
+<path fill="sym-stroke">
+0.6 0 0 0.6 0 0 e
+0.4 0 0 0.4 0 0 e
+</path>
+</symbol>
+<symbol name="mark/disk(sx)" transformations="translations">
+<path fill="sym-stroke">
+0.6 0 0 0.6 0 0 e
+</path>
+</symbol>
+<symbol name="mark/fdisk(sfx)" transformations="translations">
+<group>
+<path fill="sym-fill">
+0.5 0 0 0.5 0 0 e
+</path>
+<path fill="sym-stroke" fillrule="eofill">
+0.6 0 0 0.6 0 0 e
+0.4 0 0 0.4 0 0 e
+</path>
+</group>
+</symbol>
+<symbol name="mark/box(sx)" transformations="translations">
+<path fill="sym-stroke" fillrule="eofill">
+-0.6 -0.6 m
+0.6 -0.6 l
+0.6 0.6 l
+-0.6 0.6 l
+h
+-0.4 -0.4 m
+0.4 -0.4 l
+0.4 0.4 l
+-0.4 0.4 l
+h
+</path>
+</symbol>
+<symbol name="mark/square(sx)" transformations="translations">
+<path fill="sym-stroke">
+-0.6 -0.6 m
+0.6 -0.6 l
+0.6 0.6 l
+-0.6 0.6 l
+h
+</path>
+</symbol>
+<symbol name="mark/fsquare(sfx)" transformations="translations">
+<group>
+<path fill="sym-fill">
+-0.5 -0.5 m
+0.5 -0.5 l
+0.5 0.5 l
+-0.5 0.5 l
+h
+</path>
+<path fill="sym-stroke" fillrule="eofill">
+-0.6 -0.6 m
+0.6 -0.6 l
+0.6 0.6 l
+-0.6 0.6 l
+h
+-0.4 -0.4 m
+0.4 -0.4 l
+0.4 0.4 l
+-0.4 0.4 l
+h
+</path>
+</group>
+</symbol>
+<symbol name="mark/cross(sx)" transformations="translations">
+<group>
+<path fill="sym-stroke">
+-0.43 -0.57 m
+0.57 0.43 l
+0.43 0.57 l
+-0.57 -0.43 l
+h
+</path>
+<path fill="sym-stroke">
+-0.43 0.57 m
+0.57 -0.43 l
+0.43 -0.57 l
+-0.57 0.43 l
+h
+</path>
+</group>
+</symbol>
+<symbol name="arrow/fnormal(spx)">
+<path stroke="sym-stroke" fill="white" pen="sym-pen">
+0 0 m
+-1 0.333 l
+-1 -0.333 l
+h
+</path>
+</symbol>
+<symbol name="arrow/pointed(spx)">
+<path stroke="sym-stroke" fill="sym-stroke" pen="sym-pen">
+0 0 m
+-1 0.333 l
+-0.8 0 l
+-1 -0.333 l
+h
+</path>
+</symbol>
+<symbol name="arrow/fpointed(spx)">
+<path stroke="sym-stroke" fill="white" pen="sym-pen">
+0 0 m
+-1 0.333 l
+-0.8 0 l
+-1 -0.333 l
+h
+</path>
+</symbol>
+<symbol name="arrow/linear(spx)">
+<path stroke="sym-stroke" pen="sym-pen">
+-1 0.333 m
+0 0 l
+-1 -0.333 l
+</path>
+</symbol>
+<symbol name="arrow/fdouble(spx)">
+<path stroke="sym-stroke" fill="white" pen="sym-pen">
+0 0 m
+-1 0.333 l
+-1 -0.333 l
+h
+-1 0 m
+-2 0.333 l
+-2 -0.333 l
+h
+</path>
+</symbol>
+<symbol name="arrow/double(spx)">
+<path stroke="sym-stroke" fill="sym-stroke" pen="sym-pen">
+0 0 m
+-1 0.333 l
+-1 -0.333 l
+h
+-1 0 m
+-2 0.333 l
+-2 -0.333 l
+h
+</path>
+</symbol>
+<pen name="heavier" value="0.8"/>
+<pen name="fat" value="1.2"/>
+<pen name="ultrafat" value="2"/>
+<symbolsize name="large" value="5"/>
+<symbolsize name="small" value="2"/>
+<symbolsize name="tiny" value="1.1"/>
+<arrowsize name="large" value="10"/>
+<arrowsize name="small" value="5"/>
+<arrowsize name="tiny" value="3"/>
+<color name="red" value="1 0 0"/>
+<color name="green" value="0 1 0"/>
+<color name="blue" value="0 0 1"/>
+<color name="yellow" value="1 1 0"/>
+<color name="orange" value="1 0.647 0"/>
+<color name="gold" value="1 0.843 0"/>
+<color name="purple" value="0.627 0.125 0.941"/>
+<color name="gray" value="0.745"/>
+<color name="brown" value="0.647 0.165 0.165"/>
+<color name="navy" value="0 0 0.502"/>
+<color name="pink" value="1 0.753 0.796"/>
+<color name="seagreen" value="0.18 0.545 0.341"/>
+<color name="turquoise" value="0.251 0.878 0.816"/>
+<color name="violet" value="0.933 0.51 0.933"/>
+<color name="darkblue" value="0 0 0.545"/>
+<color name="darkcyan" value="0 0.545 0.545"/>
+<color name="darkgray" value="0.663"/>
+<color name="darkgreen" value="0 0.392 0"/>
+<color name="darkmagenta" value="0.545 0 0.545"/>
+<color name="darkorange" value="1 0.549 0"/>
+<color name="darkred" value="0.545 0 0"/>
+<color name="lightblue" value="0.678 0.847 0.902"/>
+<color name="lightcyan" value="0.878 1 1"/>
+<color name="lightgray" value="0.827"/>
+<color name="lightgreen" value="0.565 0.933 0.565"/>
+<color name="lightyellow" value="1 1 0.878"/>
+<dashstyle name="dashed" value="[4] 0"/>
+<dashstyle name="dotted" value="[1 3] 0"/>
+<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="footnote" value="\footnotesize"/>
+<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}"/>
+<gridsize name="4 pts" value="4"/>
+<gridsize name="8 pts (~3 mm)" value="8"/>
+<gridsize name="16 pts (~6 mm)" value="16"/>
+<gridsize name="32 pts (~12 mm)" value="32"/>
+<gridsize name="10 pts (~3.5 mm)" value="10"/>
+<gridsize name="20 pts (~7 mm)" value="20"/>
+<gridsize name="14 pts (~5 mm)" value="14"/>
+<gridsize name="28 pts (~10 mm)" value="28"/>
+<gridsize name="56 pts (~20 mm)" value="56"/>
+<anglesize name="90 deg" value="90"/>
+<anglesize name="60 deg" value="60"/>
+<anglesize name="45 deg" value="45"/>
+<anglesize name="30 deg" value="30"/>
+<anglesize name="22.5 deg" value="22.5"/>
+<tiling name="falling" angle="-60" step="4" width="1"/>
+<tiling name="rising" angle="30" step="4" width="1"/>
+</ipestyle>
+<page>
+<layer name="alpha"/>
+<view layers="alpha" active="alpha"/>
+<path layer="alpha" stroke="black" fill="darkcyan">
+48 640 m
+80 672 l
+48 672 l
+h
+</path>
+<text matrix="1 0 0 1 -222.178 174.178" transformations="translations" pos="380 530" stroke="seagreen" type="label" width="70.886" height="8.307" depth="2.32" valign="baseline" size="large">Cech complex</text>
+<text matrix="1 0 0 1 -212.333 10.6762" 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 -314.178 58.1775" 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 -194.178 -13.8225" 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 -226.178 18.1775" 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 -218.178 -21.8225" 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 -89.478 -87.9762" 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 -302.178 -13.8225" transformations="translations" pos="375.332 689.453" stroke="black" type="label" width="4.981" height="6.42" depth="0" valign="baseline">6</text>
+<use name="mark/circle(sx)" pos="80 544" size="normal" stroke="black"/>
+<use name="mark/circle(sx)" pos="48 576" size="normal" stroke="black"/>
+<use name="mark/circle(sx)" pos="112 576" size="normal" stroke="black"/>
+<use name="mark/fdisk(sfx)" pos="48 672" size="normal" stroke="black" fill="white"/>
+<use name="mark/circle(sx)" pos="48 640" size="normal" stroke="black"/>
+<use name="mark/circle(sx)" pos="48 672" size="normal" stroke="black"/>
+<use name="mark/circle(sx)" pos="80 672" size="normal" stroke="black"/>
+<use name="mark/circle(sx)" pos="144 672" size="normal" stroke="black"/>
+<use name="mark/circle(sx)" pos="144 608" size="normal" stroke="black"/>
+<use name="mark/circle(sx)" pos="200 640" size="normal" stroke="black"/>
+<use matrix="1 0 0 1 -100 -96" name="mark/circle(sx)" pos="304 672" size="normal" stroke="darkgray"/>
+<use matrix="1 0 0 1 -100 -96" name="mark/circle(sx)" pos="336 672" size="normal" stroke="darkgray"/>
+<path matrix="1 0 0 1 -100 -96" stroke="darkgray">
+32 0 0 32 304 672 e
+</path>
+<path matrix="1 0 0 1 -100 -96" stroke="darkgray" pen="fat">
+304 672 m
+336 672 l
+</path>
+<text matrix="1 0 0 1 -214.178 50.178" transformations="translations" pos="380 530" stroke="darkgray" type="label" width="80.052" height="8.302" depth="0" valign="baseline" size="large">Maximal radius</text>
+<text matrix="1 0 0 1 -226.178 -13.8225" transformations="translations" pos="375.332 689.453" stroke="black" type="label" width="4.981" height="6.42" depth="0" valign="baseline">7</text>
+<text matrix="1 0 0 1 -258.178 30.1775" transformations="translations" pos="375.332 689.453" stroke="black" type="label" width="4.981" height="6.42" depth="0" valign="baseline">8</text>
+<text matrix="1 0 0 1 -334.178 -13.8225" transformations="translations" pos="375.332 689.453" stroke="black" type="label" width="4.981" height="6.42" depth="0" valign="baseline">9</text>
+<path stroke="black">
+112 576 m
+144 608 l
+</path>
+<path stroke="black">
+144 672 m
+144 608 l
+200 640 l
+h
+</path>
+<path stroke="black" fill="darkcyan">
+48 576 m
+112 576 l
+80 544 l
+h
+</path>
+<use name="mark/fdisk(sfx)" pos="112 728" size="normal" stroke="black"/>
+<path stroke="black">
+80 672 m
+144 672 l
+112 728 l
+h
+</path>
+<use name="mark/fdisk(sfx)" pos="112 728" size="normal" stroke="black" fill="white"/>
+<use name="mark/fdisk(sfx)" pos="80 672" size="normal" stroke="black" fill="white"/>
+<use name="mark/fdisk(sfx)" pos="144 672" size="normal" stroke="black" fill="white"/>
+<path stroke="black" fill="darkcyan">
+48 576 m
+48 640 l
+32 608 l
+h
+</path>
+<use name="mark/fdisk(sfx)" pos="200 640" size="normal" stroke="black" fill="white"/>
+<use name="mark/fdisk(sfx)" pos="144 608" size="normal" stroke="black" fill="white"/>
+<use name="mark/fdisk(sfx)" pos="112 576" size="normal" stroke="black" fill="white"/>
+<use name="mark/fdisk(sfx)" pos="80 544" size="normal" stroke="black" fill="white"/>
+<use name="mark/fdisk(sfx)" pos="48 576" size="normal" stroke="black" fill="white"/>
+<use name="mark/fdisk(sfx)" pos="48 640" size="normal" stroke="black" fill="white"/>
+<path stroke="darkcyan">
+32 0 0 32 80 576 e
+</path>
+<path stroke="darkcyan">
+22.6274 0 0 22.6274 64 656 e
+</path>
+<path stroke="darkorange">
+37.1429 0 0 37.1429 112 690.857 e
+</path>
+<path stroke="darkorange">
+37.1429 0 0 37.1429 162.857 640 e
+</path>
+<use name="mark/fdisk(sfx)" pos="32 608" size="normal" stroke="black"/>
+<text matrix="1 0 0 1 -334.178 94.1775" transformations="translations" pos="352.708 510.349" stroke="black" type="label" width="9.963" height="6.42" depth="0" valign="baseline">10</text>
+<path stroke="darkcyan">
+32 0 0 32 48 608 e
+</path>
+<use name="mark/fdisk(sfx)" pos="204 576" size="normal" stroke="darkgray" fill="white"/>
+<use name="mark/fdisk(sfx)" pos="236 576" size="normal" stroke="darkgray" fill="white"/>
+</page>
+</ipe>
diff --git a/doc/Cech_complex/cech_complex_representation.png b/doc/Cech_complex/cech_complex_representation.png
new file mode 100644
index 00000000..d0eb85a5
--- /dev/null
+++ b/doc/Cech_complex/cech_complex_representation.png
Binary files differ
diff --git a/doc/Cech_complex/cech_one_skeleton.ipe b/doc/Cech_complex/cech_one_skeleton.ipe
new file mode 100644
index 00000000..ed66e132
--- /dev/null
+++ b/doc/Cech_complex/cech_one_skeleton.ipe
@@ -0,0 +1,314 @@
+<?xml version="1.0"?>
+<!DOCTYPE ipe SYSTEM "ipe.dtd">
+<ipe version="70107" creator="Ipe 7.1.10">
+<info created="D:20150603143945" modified="D:20180305162558"/>
+<ipestyle name="basic">
+<symbol name="arrow/arc(spx)">
+<path stroke="sym-stroke" fill="sym-stroke" pen="sym-pen">
+0 0 m
+-1 0.333 l
+-1 -0.333 l
+h
+</path>
+</symbol>
+<symbol name="arrow/farc(spx)">
+<path stroke="sym-stroke" fill="white" pen="sym-pen">
+0 0 m
+-1 0.333 l
+-1 -0.333 l
+h
+</path>
+</symbol>
+<symbol name="mark/circle(sx)" transformations="translations">
+<path fill="sym-stroke">
+0.6 0 0 0.6 0 0 e
+0.4 0 0 0.4 0 0 e
+</path>
+</symbol>
+<symbol name="mark/disk(sx)" transformations="translations">
+<path fill="sym-stroke">
+0.6 0 0 0.6 0 0 e
+</path>
+</symbol>
+<symbol name="mark/fdisk(sfx)" transformations="translations">
+<group>
+<path fill="sym-fill">
+0.5 0 0 0.5 0 0 e
+</path>
+<path fill="sym-stroke" fillrule="eofill">
+0.6 0 0 0.6 0 0 e
+0.4 0 0 0.4 0 0 e
+</path>
+</group>
+</symbol>
+<symbol name="mark/box(sx)" transformations="translations">
+<path fill="sym-stroke" fillrule="eofill">
+-0.6 -0.6 m
+0.6 -0.6 l
+0.6 0.6 l
+-0.6 0.6 l
+h
+-0.4 -0.4 m
+0.4 -0.4 l
+0.4 0.4 l
+-0.4 0.4 l
+h
+</path>
+</symbol>
+<symbol name="mark/square(sx)" transformations="translations">
+<path fill="sym-stroke">
+-0.6 -0.6 m
+0.6 -0.6 l
+0.6 0.6 l
+-0.6 0.6 l
+h
+</path>
+</symbol>
+<symbol name="mark/fsquare(sfx)" transformations="translations">
+<group>
+<path fill="sym-fill">
+-0.5 -0.5 m
+0.5 -0.5 l
+0.5 0.5 l
+-0.5 0.5 l
+h
+</path>
+<path fill="sym-stroke" fillrule="eofill">
+-0.6 -0.6 m
+0.6 -0.6 l
+0.6 0.6 l
+-0.6 0.6 l
+h
+-0.4 -0.4 m
+0.4 -0.4 l
+0.4 0.4 l
+-0.4 0.4 l
+h
+</path>
+</group>
+</symbol>
+<symbol name="mark/cross(sx)" transformations="translations">
+<group>
+<path fill="sym-stroke">
+-0.43 -0.57 m
+0.57 0.43 l
+0.43 0.57 l
+-0.57 -0.43 l
+h
+</path>
+<path fill="sym-stroke">
+-0.43 0.57 m
+0.57 -0.43 l
+0.43 -0.57 l
+-0.57 0.43 l
+h
+</path>
+</group>
+</symbol>
+<symbol name="arrow/fnormal(spx)">
+<path stroke="sym-stroke" fill="white" pen="sym-pen">
+0 0 m
+-1 0.333 l
+-1 -0.333 l
+h
+</path>
+</symbol>
+<symbol name="arrow/pointed(spx)">
+<path stroke="sym-stroke" fill="sym-stroke" pen="sym-pen">
+0 0 m
+-1 0.333 l
+-0.8 0 l
+-1 -0.333 l
+h
+</path>
+</symbol>
+<symbol name="arrow/fpointed(spx)">
+<path stroke="sym-stroke" fill="white" pen="sym-pen">
+0 0 m
+-1 0.333 l
+-0.8 0 l
+-1 -0.333 l
+h
+</path>
+</symbol>
+<symbol name="arrow/linear(spx)">
+<path stroke="sym-stroke" pen="sym-pen">
+-1 0.333 m
+0 0 l
+-1 -0.333 l
+</path>
+</symbol>
+<symbol name="arrow/fdouble(spx)">
+<path stroke="sym-stroke" fill="white" pen="sym-pen">
+0 0 m
+-1 0.333 l
+-1 -0.333 l
+h
+-1 0 m
+-2 0.333 l
+-2 -0.333 l
+h
+</path>
+</symbol>
+<symbol name="arrow/double(spx)">
+<path stroke="sym-stroke" fill="sym-stroke" pen="sym-pen">
+0 0 m
+-1 0.333 l
+-1 -0.333 l
+h
+-1 0 m
+-2 0.333 l
+-2 -0.333 l
+h
+</path>
+</symbol>
+<pen name="heavier" value="0.8"/>
+<pen name="fat" value="1.2"/>
+<pen name="ultrafat" value="2"/>
+<symbolsize name="large" value="5"/>
+<symbolsize name="small" value="2"/>
+<symbolsize name="tiny" value="1.1"/>
+<arrowsize name="large" value="10"/>
+<arrowsize name="small" value="5"/>
+<arrowsize name="tiny" value="3"/>
+<color name="red" value="1 0 0"/>
+<color name="green" value="0 1 0"/>
+<color name="blue" value="0 0 1"/>
+<color name="yellow" value="1 1 0"/>
+<color name="orange" value="1 0.647 0"/>
+<color name="gold" value="1 0.843 0"/>
+<color name="purple" value="0.627 0.125 0.941"/>
+<color name="gray" value="0.745"/>
+<color name="brown" value="0.647 0.165 0.165"/>
+<color name="navy" value="0 0 0.502"/>
+<color name="pink" value="1 0.753 0.796"/>
+<color name="seagreen" value="0.18 0.545 0.341"/>
+<color name="turquoise" value="0.251 0.878 0.816"/>
+<color name="violet" value="0.933 0.51 0.933"/>
+<color name="darkblue" value="0 0 0.545"/>
+<color name="darkcyan" value="0 0.545 0.545"/>
+<color name="darkgray" value="0.663"/>
+<color name="darkgreen" value="0 0.392 0"/>
+<color name="darkmagenta" value="0.545 0 0.545"/>
+<color name="darkorange" value="1 0.549 0"/>
+<color name="darkred" value="0.545 0 0"/>
+<color name="lightblue" value="0.678 0.847 0.902"/>
+<color name="lightcyan" value="0.878 1 1"/>
+<color name="lightgray" value="0.827"/>
+<color name="lightgreen" value="0.565 0.933 0.565"/>
+<color name="lightyellow" value="1 1 0.878"/>
+<dashstyle name="dashed" value="[4] 0"/>
+<dashstyle name="dotted" value="[1 3] 0"/>
+<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="footnote" value="\footnotesize"/>
+<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}"/>
+<gridsize name="4 pts" value="4"/>
+<gridsize name="8 pts (~3 mm)" value="8"/>
+<gridsize name="16 pts (~6 mm)" value="16"/>
+<gridsize name="32 pts (~12 mm)" value="32"/>
+<gridsize name="10 pts (~3.5 mm)" value="10"/>
+<gridsize name="20 pts (~7 mm)" value="20"/>
+<gridsize name="14 pts (~5 mm)" value="14"/>
+<gridsize name="28 pts (~10 mm)" value="28"/>
+<gridsize name="56 pts (~20 mm)" value="56"/>
+<anglesize name="90 deg" value="90"/>
+<anglesize name="60 deg" value="60"/>
+<anglesize name="45 deg" value="45"/>
+<anglesize name="30 deg" value="30"/>
+<anglesize name="22.5 deg" value="22.5"/>
+<tiling name="falling" angle="-60" step="4" width="1"/>
+<tiling name="rising" angle="30" step="4" width="1"/>
+</ipestyle>
+<page>
+<layer name="alpha"/>
+<view layers="alpha" active="alpha"/>
+<text layer="alpha" matrix="1 0 0 1 -222.178 174.178" transformations="translations" pos="380 530" stroke="seagreen" type="label" width="84.053" height="8.307" depth="2.32" valign="baseline" size="large">Proximity graph</text>
+<text matrix="1 0 0 1 -212.333 10.6762" 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 -314.178 58.1775" transformations="translations" pos="352.708 510.349" stroke="black" type="label" width="4.981" height="6.42" depth="0" valign="baseline">1</text>
+<path matrix="1 0 0 1 -100 -96" stroke="darkgray" pen="fat">
+304 672 m
+336 672 l
+</path>
+<text matrix="1 0 0 1 -194.178 -13.8225" 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 -226.178 18.1775" 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 -218.178 -21.8225" 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 -89.478 -87.9762" 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 -302.178 -13.8225" transformations="translations" pos="375.332 689.453" stroke="black" type="label" width="4.981" height="6.42" depth="0" valign="baseline">6</text>
+<use name="mark/circle(sx)" pos="80 544" size="normal" stroke="black"/>
+<use name="mark/circle(sx)" pos="48 576" size="normal" stroke="black"/>
+<use name="mark/circle(sx)" pos="112 576" size="normal" stroke="black"/>
+<use name="mark/circle(sx)" pos="48 640" size="normal" stroke="black"/>
+<use name="mark/circle(sx)" pos="48 672" size="normal" stroke="black"/>
+<use name="mark/circle(sx)" pos="80 672" size="normal" stroke="black"/>
+<use name="mark/circle(sx)" pos="144 672" size="normal" stroke="black"/>
+<use name="mark/circle(sx)" pos="144 608" size="normal" stroke="black"/>
+<use name="mark/circle(sx)" pos="200 640" size="normal" stroke="black"/>
+<use matrix="1 0 0 1 -100 -96" name="mark/circle(sx)" pos="336 672" size="normal" stroke="darkgray"/>
+<path matrix="1 0 0 1 -100 -96" stroke="darkgray">
+32 0 0 32 304 672 e
+</path>
+<text matrix="1 0 0 1 -214.178 50.178" transformations="translations" pos="380 530" stroke="darkgray" type="label" width="80.052" height="8.302" depth="0" valign="baseline" size="large">Maximal radius</text>
+<text matrix="1 0 0 1 -226.178 -13.8225" transformations="translations" pos="375.332 689.453" stroke="black" type="label" width="4.981" height="6.42" depth="0" valign="baseline">7</text>
+<text matrix="1 0 0 1 -258.178 30.1775" transformations="translations" pos="375.332 689.453" stroke="black" type="label" width="4.981" height="6.42" depth="0" valign="baseline">8</text>
+<text matrix="1 0 0 1 -334.178 -13.8225" transformations="translations" pos="375.332 689.453" stroke="black" type="label" width="4.981" height="6.42" depth="0" valign="baseline">9</text>
+<path stroke="black">
+112 576 m
+144 608 l
+</path>
+<path stroke="black">
+144 672 m
+144 608 l
+200 640 l
+h
+</path>
+<path stroke="black">
+48 640 m
+80 672 l
+48 672 l
+h
+</path>
+<path stroke="black">
+48 576 m
+112 576 l
+80 544 l
+h
+</path>
+<use name="mark/fdisk(sfx)" pos="112 728" size="normal" stroke="black"/>
+<path stroke="black">
+80 672 m
+144 672 l
+112 728 l
+h
+</path>
+<use name="mark/fdisk(sfx)" pos="112 728" size="normal" stroke="black" fill="white"/>
+<path stroke="black">
+48 576 m
+48 640 l
+32 608 l
+h
+</path>
+<use name="mark/fdisk(sfx)" pos="80 672" size="normal" stroke="black" fill="white"/>
+<use name="mark/fdisk(sfx)" pos="144 672" size="normal" stroke="black" fill="white"/>
+<use name="mark/fdisk(sfx)" pos="200 640" size="normal" stroke="black" fill="white"/>
+<use name="mark/fdisk(sfx)" pos="144 608" size="normal" stroke="black" fill="white"/>
+<use name="mark/fdisk(sfx)" pos="112 576" size="normal" stroke="black" fill="white"/>
+<use name="mark/fdisk(sfx)" pos="80 544" size="normal" stroke="black" fill="white"/>
+<use name="mark/fdisk(sfx)" pos="48 576" size="normal" stroke="black" fill="white"/>
+<use name="mark/fdisk(sfx)" pos="48 640" size="normal" stroke="black" fill="white"/>
+<use name="mark/fdisk(sfx)" pos="48 672" size="normal" stroke="black" fill="white"/>
+<use name="mark/fdisk(sfx)" pos="32 608" size="normal" stroke="black" fill="white"/>
+<text matrix="1 0 0 1 -334.178 94.1775" transformations="translations" pos="352.708 510.349" stroke="black" type="label" width="9.963" height="6.42" depth="0" valign="baseline">10</text>
+<use name="mark/fdisk(sfx)" pos="204 576" size="normal" stroke="darkgray" fill="white"/>
+<use name="mark/fdisk(sfx)" pos="236 576" size="normal" stroke="darkgray" fill="white"/>
+</page>
+</ipe>
diff --git a/doc/Cech_complex/cech_one_skeleton.png b/doc/Cech_complex/cech_one_skeleton.png
new file mode 100644
index 00000000..cc636616
--- /dev/null
+++ b/doc/Cech_complex/cech_one_skeleton.png
Binary files differ
diff --git a/doc/Contraction/COPYRIGHT b/doc/Contraction/COPYRIGHT
index 1de850d7..5b606ac2 100644
--- a/doc/Contraction/COPYRIGHT
+++ b/doc/Contraction/COPYRIGHT
@@ -3,7 +3,7 @@ The files of this directory are part of the Gudhi Library. The Gudhi library
computational topology.
Author(s): David Salinas
-Copyright (C) 2015 INRIA
+Copyright (C) 2015 Inria
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
diff --git a/doc/Nerve_GIC/COPYRIGHT b/doc/Nerve_GIC/COPYRIGHT
index 0c36a526..6b33053e 100644
--- a/doc/Nerve_GIC/COPYRIGHT
+++ b/doc/Nerve_GIC/COPYRIGHT
@@ -4,7 +4,7 @@ computational topology.
Author(s): Mathieu Carrière
-Copyright (C) 2017 INRIA
+Copyright (C) 2017 Inria
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
diff --git a/doc/Nerve_GIC/Intro_graph_induced_complex.h b/doc/Nerve_GIC/Intro_graph_induced_complex.h
index 2b648425..bc8aecc3 100644
--- a/doc/Nerve_GIC/Intro_graph_induced_complex.h
+++ b/doc/Nerve_GIC/Intro_graph_induced_complex.h
@@ -4,7 +4,7 @@
*
* Author(s): Mathieu Carriere
*
- * Copyright (C) 2017 INRIA
+ * Copyright (C) 2017 Inria
*
* 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
diff --git a/doc/Persistence_representations/Persistence_representations_doc.h b/doc/Persistence_representations/Persistence_representations_doc.h
index 38bd3a21..4d850a02 100644
--- a/doc/Persistence_representations/Persistence_representations_doc.h
+++ b/doc/Persistence_representations/Persistence_representations_doc.h
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA Sophia-Saclay (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/doc/Persistent_cohomology/COPYRIGHT b/doc/Persistent_cohomology/COPYRIGHT
index 34345bef..6cde9520 100644
--- a/doc/Persistent_cohomology/COPYRIGHT
+++ b/doc/Persistent_cohomology/COPYRIGHT
@@ -4,7 +4,7 @@ computational topology.
Author(s): Clément Maria
-Copyright (C) 2015 INRIA
+Copyright (C) 2015 Inria
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
diff --git a/doc/Persistent_cohomology/Intro_persistent_cohomology.h b/doc/Persistent_cohomology/Intro_persistent_cohomology.h
index 4dbe82c7..5fb9d4d2 100644
--- a/doc/Persistent_cohomology/Intro_persistent_cohomology.h
+++ b/doc/Persistent_cohomology/Intro_persistent_cohomology.h
@@ -4,7 +4,7 @@
*
* Author(s): Clément Maria
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Méditerranée (France)
+ * Copyright (C) 2014 Inria
*
* 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
@@ -162,6 +162,19 @@ persistence diagram with a family of field coefficients.
Rips_complex/rips_distance_matrix_persistence.cpp</a> computes the Rips complex of a distance matrix and
outputs its persistence diagram.
+The file should contain square or lower triangular distance matrix with semicolons as separators.
+The code do not check if it is dealing with a distance matrix. It is the user responsibility to provide a valid input.
+Please refer to data/distance_matrix/lower_triangular_distance_matrix.csv for an example of a file.
+
+\li <a href="_rips_complex_2rips_correlation_matrix_persistence_8cpp-example.html">
+Rips_complex/rips_correlation_matrix_persistence.cpp</a>
+computes the Rips complex of a correlation matrix and outputs its persistence diagram.
+
+Note that no check is performed if the matrix given as the input is a correlation matrix.
+It is the user responsibility to ensure that this is the case. The input is to be given either as a square or a lower
+triangular matrix.
+Please refer to data/correlation_matrix/lower_triangular_correlation_matrix.csv for an example of a file.
+
\li <a href="_alpha_complex_2alpha_complex_3d_persistence_8cpp-example.html">
Alpha_complex/alpha_complex_3d_persistence.cpp</a> computes the persistent homology with
\f$\mathbb{Z}/2\mathbb{Z}\f$ coefficients of the alpha complex on points sampling from an OFF file.
diff --git a/doc/Rips_complex/COPYRIGHT b/doc/Rips_complex/COPYRIGHT
index 594b7d03..2c31a0d6 100644
--- a/doc/Rips_complex/COPYRIGHT
+++ b/doc/Rips_complex/COPYRIGHT
@@ -4,7 +4,7 @@ computational topology.
Author(s): Clément Maria, Pawel Dlotko, Vincent Rouvreau
-Copyright (C) 2015 INRIA
+Copyright (C) 2015 Inria
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
diff --git a/doc/Rips_complex/Intro_rips_complex.h b/doc/Rips_complex/Intro_rips_complex.h
index 8c517516..712d3b6e 100644
--- a/doc/Rips_complex/Intro_rips_complex.h
+++ b/doc/Rips_complex/Intro_rips_complex.h
@@ -4,7 +4,7 @@
*
* Author(s): Clément Maria, Pawel Dlotko, Vincent Rouvreau
*
- * Copyright (C) 2016 INRIA
+ * Copyright (C) 2016 Inria
*
* 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
@@ -29,28 +29,41 @@ namespace rips_complex {
/** \defgroup rips_complex Rips complex
*
- * \author Clément Maria, Pawel Dlotko, Vincent Rouvreau
+ * \author Clément Maria, Pawel Dlotko, Vincent Rouvreau, Marc Glisse
*
* @{
*
* \section ripsdefinition Rips complex definition
*
- * Rips_complex
- * <a target="_blank" href="https://en.wikipedia.org/wiki/Vietoris%E2%80%93Rips_complex">(Wikipedia)</a> is a
- * one skeleton graph that allows to construct a
- * <a target="_blank" href="https://en.wikipedia.org/wiki/Simplicial_complex">simplicial complex</a>
- * from it.
- * The input can be a point cloud with a given distance function, or a distance matrix.
- *
- * The filtration value of each edge is computed from a user-given distance function, or directly from the distance
- * matrix.
+ * The Vietoris-Rips complex
+ * <a target="_blank" href="https://en.wikipedia.org/wiki/Vietoris%E2%80%93Rips_complex">(Wikipedia)</a>
+ * is an abstract simplicial complex
+ * defined on a finite metric space, where each simplex corresponds to a subset
+ * of point whose diameter is smaller that some given threshold.
+ * Varying the threshold, we can also see the Rips complex as a filtration of
+ * the \f$(n-1)-\f$dimensional simplex, where the filtration value of each
+ * simplex is the diameter of the corresponding subset of points.
+ *
+ * This filtered complex is most often used as an approximation of the
+ * Čech complex. After rescaling (Rips using the length of the edges and Čech
+ * the half-length), they share the same 1-skeleton and are multiplicatively
+ * 2-interleaved or better. While it is slightly bigger, it is also much
+ * easier to compute.
+ *
+ * The number of simplices in the full Rips complex is exponential in the
+ * number of vertices, it is thus usually restricted, by excluding all the
+ * simplices with filtration value larger than some threshold, and keeping only
+ * the dim_max-skeleton.
+ *
+ * In order to build this complex, the algorithm first builds the graph.
+ * The filtration value of each edge is computed from a user-given distance
+ * function, or directly read from the distance matrix.
+ * In a second step, this graph is inserted in a simplicial complex, which then
+ * gets expanded to a flag complex.
*
- * All edges that have a filtration value strictly greater than a given threshold value are not inserted into
- * the complex.
+ * The input can be given as a range of points and a distance function, or as a
+ * distance matrix.
*
- * When creating a simplicial complex from this one skeleton graph, Rips inserts the one skeleton graph into the data
- * structure, and then expands the simplicial complex when required.
- *
* Vertex name correspond to the index of the point in the given range (aka. the point cloud).
*
* \image html "rips_complex_representation.png" "Rips-complex one skeleton graph representation"
@@ -61,7 +74,36 @@ namespace rips_complex {
*
* If the Rips_complex interfaces are not detailed enough for your need, please refer to
* <a href="_persistent_cohomology_2rips_persistence_step_by_step_8cpp-example.html">
- * rips_persistence_step_by_step.cpp</a> example, where the graph construction over the Simplex_tree is more detailed.
+ * rips_persistence_step_by_step.cpp</a> example, where the constructions of the graph and
+ * the Simplex_tree are more detailed.
+ *
+ * \section sparserips Sparse Rips complex
+ *
+ * Even truncated in filtration value and dimension, the Rips complex remains
+ * quite large. However, it is possible to approximate it by a much smaller
+ * filtered simplicial complex (linear size, with constants that depend on
+ * &epsilon; and the doubling dimension of the space) that is
+ * \f$(1+O(\epsilon))-\f$interleaved with it (in particular, their persistence
+ * diagrams are at log-bottleneck distance at most \f$O(\epsilon)\f$).
+ *
+ * The sparse Rips filtration was introduced by Don Sheehy
+ * \cite sheehy13linear. We are using the version described in
+ * \cite buchet16efficient (except that we multiply all filtration values
+ * by 2, to match the usual Rips complex), which proves a
+ * \f$\frac{1+\epsilon}{1-\epsilon}\f$-interleaving, although in practice the
+ * error is usually smaller.
+ * A more intuitive presentation of the idea is available in
+ * \cite cavanna15geometric, and in a video \cite cavanna15visualizing.
+ *
+ * The interface of `Sparse_rips_complex` is similar to the one for the usual
+ * `Rips_complex`, except that one has to specify the approximation factor, and
+ * there is no option to limit the maximum filtration value (the way the
+ * approximation is done means that larger filtration values are much cheaper
+ * to handle than low filtration values, so the gain would be too small).
+ *
+ * Theoretical guarantees are only available for \f$\epsilon<1\f$. The
+ * construction accepts larger values of &epsilon;, and the size of the complex
+ * keeps decreasing, but there is no guarantee on the quality of the result.
*
* \section ripspointsdistance Point cloud and distance function
*
@@ -104,6 +146,24 @@ namespace rips_complex {
*
* \include Rips_complex/full_skeleton_rips_for_doc.txt
*
+ *
+ * \subsection sparseripspointscloudexample Example of a sparse Rips from a point cloud
+ *
+ * This example builds the full sparse Rips of a set of 2D Euclidean points, then prints some minimal
+ * information about the complex.
+ *
+ * \include Rips_complex/example_sparse_rips.cpp
+ *
+ * When launching:
+ *
+ * \code $> ./Rips_complex_example_sparse
+ * \endcode
+ *
+ * the program output may be (the exact output varies from one run to the next):
+ *
+ * \code Sparse Rips complex is of dimension 2 - 19 simplices - 7 vertices.
+ * \endcode
+ *
*
*
* \section ripsdistancematrix Distance matrix
@@ -146,6 +206,33 @@ namespace rips_complex {
*
* \include Rips_complex/full_skeleton_rips_for_doc.txt
*
+ *
+ * \section ripscorrelationematrix Correlation matrix
+ *
+ * Analogously to the case of distance matrix, Rips complexes can be also constructed based on correlation matrix.
+ * Given a correlation matrix M, comportment-wise 1-M is a distance matrix.
+ * This example builds the one skeleton graph from the given corelation matrix and threshold value.
+ * Then it creates a `Simplex_tree` with it.
+ *
+ * Then, it is asked to display information about the simplicial complex.
+ *
+ * \include Rips_complex/example_one_skeleton_rips_from_correlation_matrix.cpp
+ *
+ * When launching:
+ *
+ * \code $> ./example_one_skeleton_from_correlation_matrix
+ * \endcode
+ *
+ * the program output is:
+ *
+ * \include Rips_complex/one_skeleton_rips_from_correlation_matrix_for_doc.txt
+ *
+ * All the other constructions discussed for Rips complex for distance matrix can be also performed for Rips complexes
+ * construction from correlation matrices.
+ *
+ * @warning As persistence diagrams points will be under the diagonal, bottleneck distance and persistence graphical
+ * tool will not work properly, this is a known issue.
+ *
*/
/** @} */ // end defgroup rips_complex
diff --git a/doc/Simplex_tree/COPYRIGHT b/doc/Simplex_tree/COPYRIGHT
index 34345bef..6cde9520 100644
--- a/doc/Simplex_tree/COPYRIGHT
+++ b/doc/Simplex_tree/COPYRIGHT
@@ -4,7 +4,7 @@ computational topology.
Author(s): Clément Maria
-Copyright (C) 2015 INRIA
+Copyright (C) 2015 Inria
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
diff --git a/doc/Simplex_tree/Intro_simplex_tree.h b/doc/Simplex_tree/Intro_simplex_tree.h
index 6b80d1c9..db399489 100644
--- a/doc/Simplex_tree/Intro_simplex_tree.h
+++ b/doc/Simplex_tree/Intro_simplex_tree.h
@@ -4,7 +4,7 @@
*
* Author(s): Clément Maria
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Méditerranée (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/doc/Skeleton_blocker/COPYRIGHT b/doc/Skeleton_blocker/COPYRIGHT
index 1de850d7..5b606ac2 100644
--- a/doc/Skeleton_blocker/COPYRIGHT
+++ b/doc/Skeleton_blocker/COPYRIGHT
@@ -3,7 +3,7 @@ The files of this directory are part of the Gudhi Library. The Gudhi library
computational topology.
Author(s): David Salinas
-Copyright (C) 2015 INRIA
+Copyright (C) 2015 Inria
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
diff --git a/doc/Spatial_searching/Intro_spatial_searching.h b/doc/Spatial_searching/Intro_spatial_searching.h
index 52ed65e4..f387ab2f 100644
--- a/doc/Spatial_searching/Intro_spatial_searching.h
+++ b/doc/Spatial_searching/Intro_spatial_searching.h
@@ -4,7 +4,7 @@
*
* Author(s): Clement Jamin
*
- * Copyright (C) 2016 INRIA
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/doc/Subsampling/Intro_subsampling.h b/doc/Subsampling/Intro_subsampling.h
index ab9cdc37..d88f6bf6 100644
--- a/doc/Subsampling/Intro_subsampling.h
+++ b/doc/Subsampling/Intro_subsampling.h
@@ -4,7 +4,7 @@
*
* Author(s): Clement Jamin
*
- * Copyright (C) 2016 INRIA
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/doc/Tangential_complex/COPYRIGHT b/doc/Tangential_complex/COPYRIGHT
index c4df0f64..f9f92471 100644
--- a/doc/Tangential_complex/COPYRIGHT
+++ b/doc/Tangential_complex/COPYRIGHT
@@ -4,7 +4,7 @@ computational topology.
Author(s): Clement Jamin
-Copyright (C) 2015 INRIA
+Copyright (C) 2015 Inria
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
diff --git a/doc/Tangential_complex/Intro_tangential_complex.h b/doc/Tangential_complex/Intro_tangential_complex.h
index 00e00c52..f4fc8ac7 100644
--- a/doc/Tangential_complex/Intro_tangential_complex.h
+++ b/doc/Tangential_complex/Intro_tangential_complex.h
@@ -4,7 +4,7 @@
*
* Author(s): Clement Jamin
*
- * Copyright (C) 2016 INRIA
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/doc/Witness_complex/COPYRIGHT b/doc/Witness_complex/COPYRIGHT
index 7d032c87..25a700cf 100644
--- a/doc/Witness_complex/COPYRIGHT
+++ b/doc/Witness_complex/COPYRIGHT
@@ -4,7 +4,7 @@ computational topology.
Author(s): Siargey Kachanovich
-Copyright (C) 2015 INRIA
+Copyright (C) 2015 Inria
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
diff --git a/doc/common/file_formats.h b/doc/common/file_formats.h
index c60ed15a..523153b8 100644
--- a/doc/common/file_formats.h
+++ b/doc/common/file_formats.h
@@ -4,7 +4,7 @@
*
* Author(s): Clément Jamin
*
-* Copyright (C) 2017 INRIA
+* Copyright (C) 2017 Inria
*
* 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
diff --git a/doc/common/header.html b/doc/common/header.html
index 9c514381..f8b13ec4 100644
--- a/doc/common/header.html
+++ b/doc/common/header.html
@@ -9,7 +9,7 @@
<!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME-->
<!--BEGIN !PROJECT_NAME--><title>$title</title><!--END !PROJECT_NAME-->
<!-- GUDHI website css for header BEGIN -->
-<link rel="stylesheet" type="text/css" href="http://pages.saclay.inria.fr/vincent.rouvreau/gudhi/gudhi-doc-2.0.0/assets/css/styles_feeling_responsive.css" />
+<link rel="stylesheet" type="text/css" href="http://gudhi.gforge.inria.fr/assets/css/styles_feeling_responsive.css" />
<!-- GUDHI website css for header END -->
<link href="$relpath^tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="$relpath^jquery.js"></script>
@@ -24,60 +24,61 @@ $extrastylesheet
<!-- GUDHI website header BEGIN -->
<div id="navigation" class="sticky">
- <nav class="top-bar" role="navigation" data-topbar>
- <ul class="title-area">
- <li class="name">
- <h1 class="show-for-small-only"><a href="http://gudhi.gforge.inria.fr" class="icon-tree"> GUDHI C++ library</a></h1>
- </li>
- <!-- Remove the class "menu-icon" to get rid of menu icon. Take out "Menu" to just have icon alone -->
- <li class="toggle-topbar menu-icon"><a href="#"><span>Navigation</span></a></li>
- </ul>
- <section class="top-bar-section">
- <ul class="right">
- <li class="divider"></li>
- <li><a href="http://gudhi.gforge.inria.fr/contact/">Contact</a></li>
- </ul>
- <ul class="left">
- <li><a href="http://gudhi.gforge.inria.fr/"> <img src="http://gudhi.gforge.inria.fr/assets/img/home.png" alt="&nbsp;&nbsp;GUDHI">&nbsp;&nbsp;GUDHI </a></li>
- <li class="divider"></li>
- <li class="has-dropdown">
- <a href="#">Project</a>
- <ul class="dropdown">
- <li><a href="http://gudhi.gforge.inria.fr/people/">People</a></li>
- <li><a href="http://gudhi.gforge.inria.fr/keepintouch/">Keep in touch</a></li>
- <li><a href="http://gudhi.gforge.inria.fr/partners/">Partners and Funding</a></li>
- <li><a href="http://gudhi.gforge.inria.fr/relatedprojects/">Related projects</a></li>
- <li><a href="http://gudhi.gforge.inria.fr/theyaretalkingaboutus/">They are talking about us</a></li>
- </ul>
- </li>
- <li class="divider"></li>
- <li class="has-dropdown">
- <a href="#">Download</a>
- <ul class="dropdown">
- <li><a href="http://gudhi.gforge.inria.fr/licensing/">Licensing</a></li>
- <li><a href="https://gforge.inria.fr/frs/?group_id=3865" target="_blank">Get the sources</a></li>
- <li><a href="https://gforge.inria.fr/frs/download.php/file/37113/GUDHI_2.0.0_OSX_UTILS.beta.tar.gz" target="_blank">Utils for Mac OSx</a></li>
- <li><a href="https://gforge.inria.fr/frs/download.php/file/37112/GUDHI_2.0.0_WIN64_UTILS.beta.zip" target="_blank">Utils for Win x64</a></li>
- </ul>
- </li>
- <li class="divider"></li>
- <li class="has-dropdown">
- <a href="#">Documentation</a>
- <ul class="dropdown">
- <li><a href="http://gudhi.gforge.inria.fr/doc/latest/">C++ documentation</a></li>
- <li><a href="http://gudhi.gforge.inria.fr/doc/latest/installation.html">C++ installation manual</a></li>
- <li><a href="http://gudhi.gforge.inria.fr/python/latest/">Python documentation</a></li>
- <li><a href="http://gudhi.gforge.inria.fr/python/latest/installation.html">Python installation manual</a></li>
- <li><a href="http://gudhi.gforge.inria.fr/utils/">Utilities</a></li>
- <li><a href="http://bertrand.michel.perso.math.cnrs.fr/Enseignements/TDA-Gudhi-Python.html" target="_blank">Tutorial</a></li>
- </ul>
- </li>
- <li class="divider"></li>
- <li><a href="http://gudhi.gforge.inria.fr/interfaces/">Interfaces</a></li>
- <li class="divider"></li>
- </ul>
- </section>
- </nav>
+ <nav class="top-bar" role="navigation" data-topbar>
+ <ul class="title-area">
+ <li class="name">
+ <h1 class="show-for-small-only"><a href="" class="icon-tree"> GUDHI C++ library</a></h1>
+ </li>
+ <!-- Remove the class "menu-icon" to get rid of menu icon. Take out "Menu" to just have icon alone -->
+ <li class="toggle-topbar menu-icon"><a href="#"><span>Navigation</span></a></li>
+ </ul>
+ <section class="top-bar-section">
+ <ul class="right">
+ <li class="divider"></li>
+ <li><a href="/contact/">Contact</a></li>
+ </ul>
+ <ul class="left">
+ <li><a href="/"> <img src="/assets/img/home.png" alt="&nbsp;&nbsp;GUDHI">&nbsp;&nbsp;GUDHI </a></li>
+ <li class="divider"></li>
+ <li class="has-dropdown">
+ <a href="#">Project</a>
+ <ul class="dropdown">
+ <li><a href="/people/">People</a></li>
+ <li><a href="/keepintouch/">Keep in touch</a></li>
+ <li><a href="/partners/">Partners and Funding</a></li>
+ <li><a href="/relatedprojects/">Related projects</a></li>
+ <li><a href="/theyaretalkingaboutus/">They are talking about us</a></li>
+ </ul>
+ </li>
+ <li class="divider"></li>
+ <li class="has-dropdown">
+ <a href="#">Download</a>
+ <ul class="dropdown">
+ <li><a href="/licensing/">Licensing</a></li>
+ <li><a href="https://gforge.inria.fr/frs/download.php/latestzip/5253/library-latest.zip" target="_blank">Get the latest sources</a></li>
+ <li><a href="https://gforge.inria.fr/frs/download.php/latestzip/5280/utils_osx-latest.zip" target="_blank">Utils for Mac OSx</a></li>
+ <li><a href="https://gforge.inria.fr/frs/download.php/latestzip/5279/utils_win64-latest.zip" target="_blank">Utils for Win x64</a></li>
+ </ul>
+ </li>
+ <li class="divider"></li>
+ <li class="has-dropdown">
+ <a href="#">Documentation</a>
+ <ul class="dropdown">
+ <li><a href="/doc/latest/">C++ documentation</a></li>
+ <li><a href="/doc/latest/installation.html">C++ installation manual</a></li>
+ <li><a href="/python/latest/">Python documentation</a></li>
+ <li><a href="/python/latest/installation.html">Python installation manual</a></li>
+ <li><a href="/utils/">Utilities</a></li>
+ <li><a href="/tutorials/">Tutorials</a></li>
+ <li><a href="/dockerfile/">Dockerfile</a></li>
+ </ul>
+ </li>
+ <li class="divider"></li>
+ <li><a href="/interfaces/">Interfaces</a></li>
+ <li class="divider"></li>
+ </ul>
+ </section>
+ </nav>
</div><!-- /#navigation -->
<!-- GUDHI website header BEGIN -->
diff --git a/doc/common/installation.h b/doc/common/installation.h
index 25675cc5..12407c18 100644
--- a/doc/common/installation.h
+++ b/doc/common/installation.h
@@ -5,8 +5,9 @@
* Examples of GUDHI headers inclusion can be found in \ref demos.
*
* \section compiling Compiling
- * The library uses c++11 and requires <a target="_blank" href="http://www.boost.org/">Boost</a> with version 1.48.0 or
- * more recent. It is a multi-platform library and compiles on Linux, Mac OSX and Visual Studio 2015.
+ * The library uses c++11 and requires <a target="_blank" href="http://www.boost.org/">Boost</a> &ge; 1.48.0
+ * and <a target="_blank" href="https://www.cmake.org/">CMake</a> &ge; 3.1.
+ * It is a multi-platform library and compiles on Linux, Mac OSX and Visual Studio 2015.
*
* \subsection demos Demos and examples
* To build the demos and examples, run the following commands in a terminal:
diff --git a/doc/common/main_page.h b/doc/common/main_page.h
index b3e9ea03..db1e80ce 100644
--- a/doc/common/main_page.h
+++ b/doc/common/main_page.h
@@ -42,6 +42,22 @@
</td>
</tr>
</table>
+ \subsection CechComplexDataStructure Čech complex
+ \image html "cech_complex_representation.png" "Čech complex representation"
+<table border="0">
+ <tr>
+ <td width="25%">
+ <b>Author:</b> Vincent Rouvreau<br>
+ <b>Introduced in:</b> GUDHI 2.2.0<br>
+ <b>Copyright:</b> GPL v3<br>
+ </td>
+ <td width="75%">
+ The Čech complex is a simplicial complex constructed from a proximity graph.<br>
+ The set of all simplices is filtered by the radius of their minimal enclosing ball.<br>
+ <b>User manual:</b> \ref cech_complex - <b>Reference manual:</b> Gudhi::cech_complex::Cech_complex
+ </td>
+ </tr>
+</table>
\subsection CubicalComplexDataStructure Cubical complex
\image html "Cubical_complex_representation.png" "Cubical complex representation"
<table border="0">
@@ -57,12 +73,13 @@
<b>User manual:</b> \ref cubical_complex - <b>Reference manual:</b> Gudhi::cubical_complex::Bitmap_cubical_complex
</td>
</tr>
+</table>
\subsection RipsComplexDataStructure Rips complex
\image html "rips_complex_representation.png" "Rips complex representation"
<table border="0">
<tr>
<td width="25%">
- <b>Author:</b> Cl&eacute;ment Maria, Pawel Dlotko, Vincent Rouvreau<br>
+ <b>Author:</b> Cl&eacute;ment Maria, Pawel Dlotko, Vincent Rouvreau, Marc Glisse<br>
<b>Introduced in:</b> GUDHI 2.0.0<br>
<b>Copyright:</b> GPL v3<br>
</td>
@@ -75,7 +92,6 @@
</td>
</tr>
</table>
-</table>
\subsection SimplexTreeDataStructure Simplex tree
\image html "Simplex_tree_representation.png" "Simplex tree representation"
<table border="0">
diff --git a/doc/common/offline_header.html b/doc/common/offline_header.html
new file mode 100644
index 00000000..6a02a895
--- /dev/null
+++ b/doc/common/offline_header.html
@@ -0,0 +1,41 @@
+<!-- HTML header for doxygen 1.8.6-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!-- GUDHI website : class="no-js" lang="en" is necessary -->
+<html xmlns="http://www.w3.org/1999/xhtml" class="no-js" lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
+<meta http-equiv="X-UA-Compatible" content="IE=9"/>
+<meta name="generator" content="Doxygen $doxygenversion"/>
+<!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME-->
+<!--BEGIN !PROJECT_NAME--><title>$title</title><!--END !PROJECT_NAME-->
+<!-- GUDHI website css for header END -->
+<link href="$relpath^tabs.css" rel="stylesheet" type="text/css"/>
+<script type="text/javascript" src="$relpath^jquery.js"></script>
+<script type="text/javascript" src="$relpath^dynsections.js"></script>
+$treeview
+$search
+$mathjax
+<link href="$relpath^$stylesheet" rel="stylesheet" type="text/css" />
+$extrastylesheet
+</head>
+<body>
+
+
+<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
+
+<!--BEGIN TITLEAREA-->
+<div id="titlearea">
+<table cellspacing="0" cellpadding="0">
+ <tbody>
+ <tr style="height: 30px;">
+ <!--BEGIN DISABLE_INDEX-->
+ <!--BEGIN SEARCHENGINE-->
+ <td>$searchbox</td>
+ <!--END SEARCHENGINE-->
+ <!--END DISABLE_INDEX-->
+ </tr>
+ </tbody>
+</table>
+</div>
+<!--END TITLEAREA-->
+<!-- end header part -->
diff --git a/example/Alpha_complex/CMakeLists.txt b/example/Alpha_complex/CMakeLists.txt
index 5bf553e9..2fc62452 100644
--- a/example/Alpha_complex/CMakeLists.txt
+++ b/example/Alpha_complex/CMakeLists.txt
@@ -1,4 +1,3 @@
-cmake_minimum_required(VERSION 2.6)
project(Alpha_complex_examples)
# need CGAL 4.7
diff --git a/example/Bitmap_cubical_complex/CMakeLists.txt b/example/Bitmap_cubical_complex/CMakeLists.txt
index 99304aa4..dc659f2d 100644
--- a/example/Bitmap_cubical_complex/CMakeLists.txt
+++ b/example/Bitmap_cubical_complex/CMakeLists.txt
@@ -1,4 +1,3 @@
-cmake_minimum_required(VERSION 2.6)
project(Bitmap_cubical_complex_examples)
add_executable ( Random_bitmap_cubical_complex Random_bitmap_cubical_complex.cpp )
diff --git a/example/Bitmap_cubical_complex/Random_bitmap_cubical_complex.cpp b/example/Bitmap_cubical_complex/Random_bitmap_cubical_complex.cpp
index f70558f2..6eb24040 100644
--- a/example/Bitmap_cubical_complex/Random_bitmap_cubical_complex.cpp
+++ b/example/Bitmap_cubical_complex/Random_bitmap_cubical_complex.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2015 INRIA Saclay (France)
+ * Copyright (C) 2015 Inria
*
* 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
diff --git a/example/Bottleneck_distance/CMakeLists.txt b/example/Bottleneck_distance/CMakeLists.txt
index 6095d6eb..c6f10127 100644
--- a/example/Bottleneck_distance/CMakeLists.txt
+++ b/example/Bottleneck_distance/CMakeLists.txt
@@ -1,4 +1,3 @@
-cmake_minimum_required(VERSION 2.6)
project(Bottleneck_distance_examples)
if (NOT CGAL_VERSION VERSION_LESS 4.8.1)
diff --git a/example/Bottleneck_distance/alpha_rips_persistence_bottleneck_distance.cpp b/example/Bottleneck_distance/alpha_rips_persistence_bottleneck_distance.cpp
index fd164b22..1e27887c 100644
--- a/example/Bottleneck_distance/alpha_rips_persistence_bottleneck_distance.cpp
+++ b/example/Bottleneck_distance/alpha_rips_persistence_bottleneck_distance.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Vincent Rouvreau
*
- * Copyright (C) 2017 INRIA
+ * Copyright (C) 2017 Inria
*
* 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
diff --git a/example/Bottleneck_distance/bottleneck_basic_example.cpp b/example/Bottleneck_distance/bottleneck_basic_example.cpp
index d0ca4e20..3df7d12d 100644
--- a/example/Bottleneck_distance/bottleneck_basic_example.cpp
+++ b/example/Bottleneck_distance/bottleneck_basic_example.cpp
@@ -4,7 +4,7 @@
*
* Authors: Francois Godi, small modifications by Pawel Dlotko
*
- * Copyright (C) 2015 INRIA
+ * Copyright (C) 2015 Inria
*
* 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
diff --git a/example/Cech_complex/CMakeLists.txt b/example/Cech_complex/CMakeLists.txt
new file mode 100644
index 00000000..ab391215
--- /dev/null
+++ b/example/Cech_complex/CMakeLists.txt
@@ -0,0 +1,16 @@
+cmake_minimum_required(VERSION 2.6)
+project(Cech_complex_examples)
+
+add_executable ( Cech_complex_example_step_by_step cech_complex_step_by_step.cpp )
+target_link_libraries(Cech_complex_example_step_by_step ${Boost_PROGRAM_OPTIONS_LIBRARY})
+if (TBB_FOUND)
+ target_link_libraries(Cech_complex_example_step_by_step ${TBB_LIBRARIES})
+endif()
+add_test(NAME Cech_complex_utility_from_rips_on_tore_3D COMMAND $<TARGET_FILE:Cech_complex_example_step_by_step>
+ "${CMAKE_SOURCE_DIR}/data/points/tore3D_300.off" "-r" "0.25" "-d" "3")
+
+add_executable ( Cech_complex_example_from_points cech_complex_example_from_points.cpp)
+if (TBB_FOUND)
+ target_link_libraries(Cech_complex_example_from_points ${TBB_LIBRARIES})
+endif()
+add_test(NAME Cech_complex_example_from_points COMMAND $<TARGET_FILE:Cech_complex_example_from_points>)
diff --git a/example/Cech_complex/cech_complex_example_from_points.cpp b/example/Cech_complex/cech_complex_example_from_points.cpp
new file mode 100644
index 00000000..3cc5a4df
--- /dev/null
+++ b/example/Cech_complex/cech_complex_example_from_points.cpp
@@ -0,0 +1,54 @@
+#include <gudhi/Cech_complex.h>
+#include <gudhi/Simplex_tree.h>
+
+#include <iostream>
+#include <string>
+#include <vector>
+#include <array>
+
+int main() {
+ // Type definitions
+ using Point_cloud = std::vector<std::array<double, 2>>;
+ using Simplex_tree = Gudhi::Simplex_tree<Gudhi::Simplex_tree_options_fast_persistence>;
+ using Filtration_value = Simplex_tree::Filtration_value;
+ using Cech_complex = Gudhi::cech_complex::Cech_complex<Simplex_tree, Point_cloud>;
+
+ Point_cloud points;
+ points.push_back({1., 0.}); // 0
+ points.push_back({0., 1.}); // 1
+ points.push_back({2., 1.}); // 2
+ points.push_back({3., 2.}); // 3
+ points.push_back({0., 3.}); // 4
+ points.push_back({3. + std::sqrt(3.), 3.}); // 5
+ points.push_back({1., 4.}); // 6
+ points.push_back({3., 4.}); // 7
+ points.push_back({2., 4. + std::sqrt(3.)}); // 8
+ points.push_back({0., 4.}); // 9
+ points.push_back({-0.5, 2.}); // 10
+
+ // ----------------------------------------------------------------------------
+ // Init of a Cech complex from points
+ // ----------------------------------------------------------------------------
+ Filtration_value max_radius = 1.;
+ Cech_complex cech_complex_from_points(points, max_radius);
+
+ Simplex_tree stree;
+ cech_complex_from_points.create_complex(stree, 2);
+ // ----------------------------------------------------------------------------
+ // Display information about the one skeleton Cech complex
+ // ----------------------------------------------------------------------------
+ std::cout << "Cech complex is of dimension " << stree.dimension() << " - " << stree.num_simplices() << " simplices - "
+ << stree.num_vertices() << " vertices." << std::endl;
+
+ std::cout << "Iterator on Cech complex simplices in the filtration order, with [filtration value]:" << std::endl;
+ for (auto f_simplex : stree.filtration_simplex_range()) {
+ std::cout << " ( ";
+ for (auto vertex : stree.simplex_vertex_range(f_simplex)) {
+ std::cout << vertex << " ";
+ }
+ std::cout << ") -> "
+ << "[" << stree.filtration(f_simplex) << "] ";
+ std::cout << std::endl;
+ }
+ return 0;
+}
diff --git a/example/Cech_complex/cech_complex_example_from_points_for_doc.txt b/example/Cech_complex/cech_complex_example_from_points_for_doc.txt
new file mode 100644
index 00000000..be0afc76
--- /dev/null
+++ b/example/Cech_complex/cech_complex_example_from_points_for_doc.txt
@@ -0,0 +1,31 @@
+Iterator on Cech complex simplices in the filtration order, with [filtration value]:
+ ( 0 ) -> [0]
+ ( 1 ) -> [0]
+ ( 2 ) -> [0]
+ ( 3 ) -> [0]
+ ( 4 ) -> [0]
+ ( 5 ) -> [0]
+ ( 6 ) -> [0]
+ ( 7 ) -> [0]
+ ( 8 ) -> [0]
+ ( 9 ) -> [0]
+ ( 10 ) -> [0]
+ ( 9 4 ) -> [0.5]
+ ( 9 6 ) -> [0.5]
+ ( 10 1 ) -> [0.559017]
+ ( 10 4 ) -> [0.559017]
+ ( 1 0 ) -> [0.707107]
+ ( 2 0 ) -> [0.707107]
+ ( 3 2 ) -> [0.707107]
+ ( 6 4 ) -> [0.707107]
+ ( 9 6 4 ) -> [0.707107]
+ ( 2 1 ) -> [1]
+ ( 2 1 0 ) -> [1]
+ ( 4 1 ) -> [1]
+ ( 5 3 ) -> [1]
+ ( 7 3 ) -> [1]
+ ( 7 5 ) -> [1]
+ ( 7 6 ) -> [1]
+ ( 8 6 ) -> [1]
+ ( 8 7 ) -> [1]
+ ( 10 4 1 ) -> [1]
diff --git a/example/Cech_complex/cech_complex_step_by_step.cpp b/example/Cech_complex/cech_complex_step_by_step.cpp
new file mode 100644
index 00000000..d2dc8b65
--- /dev/null
+++ b/example/Cech_complex/cech_complex_step_by_step.cpp
@@ -0,0 +1,166 @@
+/* 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): Vincent Rouvreau
+ *
+ * Copyright (C) 2018 Inria
+ *
+ * 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/>.
+ */
+
+#include <gudhi/graph_simplicial_complex.h>
+#include <gudhi/distance_functions.h>
+#include <gudhi/Simplex_tree.h>
+#include <gudhi/Points_off_io.h>
+
+#include <gudhi/Miniball.hpp>
+
+#include <boost/program_options.hpp>
+
+#include <string>
+#include <vector>
+#include <limits> // infinity
+#include <utility> // for pair
+#include <map>
+
+// ----------------------------------------------------------------------------
+// rips_persistence_step_by_step is an example of each step that is required to
+// build a Rips over a Simplex_tree. Please refer to rips_persistence to see
+// how to do the same thing with the Rips_complex wrapper for less detailed
+// steps.
+// ----------------------------------------------------------------------------
+
+// Types definition
+using Simplex_tree = Gudhi::Simplex_tree<>;
+using Simplex_handle = Simplex_tree::Simplex_handle;
+using Filtration_value = Simplex_tree::Filtration_value;
+using Point = std::vector<double>;
+using Points_off_reader = Gudhi::Points_off_reader<Point>;
+using Proximity_graph = Gudhi::Proximity_graph<Simplex_tree>;
+
+class Cech_blocker {
+ private:
+ using Point_cloud = std::vector<Point>;
+ using Point_iterator = Point_cloud::const_iterator;
+ using Coordinate_iterator = Point::const_iterator;
+ using Min_sphere = Gudhi::Miniball::Miniball<Gudhi::Miniball::CoordAccessor<Point_iterator, Coordinate_iterator>>;
+
+ public:
+ bool operator()(Simplex_handle sh) {
+ std::vector<Point> points;
+ for (auto vertex : simplex_tree_.simplex_vertex_range(sh)) {
+ points.push_back(point_cloud_[vertex]);
+#ifdef DEBUG_TRACES
+ std::cout << "#(" << vertex << ")#";
+#endif // DEBUG_TRACES
+ }
+ Filtration_value radius = Gudhi::Minimal_enclosing_ball_radius()(points);
+#ifdef DEBUG_TRACES
+ std::cout << "radius = " << radius << " - " << (radius > max_radius_) << std::endl;
+#endif // DEBUG_TRACES
+ simplex_tree_.assign_filtration(sh, radius);
+ return (radius > max_radius_);
+ }
+ Cech_blocker(Simplex_tree& simplex_tree, Filtration_value max_radius, const std::vector<Point>& point_cloud)
+ : simplex_tree_(simplex_tree), max_radius_(max_radius), point_cloud_(point_cloud) {
+ dimension_ = point_cloud_[0].size();
+ }
+
+ private:
+ Simplex_tree simplex_tree_;
+ Filtration_value max_radius_;
+ std::vector<Point> point_cloud_;
+ int dimension_;
+};
+
+void program_options(int argc, char* argv[], std::string& off_file_points, Filtration_value& max_radius, int& dim_max);
+
+int main(int argc, char* argv[]) {
+ std::string off_file_points;
+ Filtration_value max_radius;
+ int dim_max;
+
+ program_options(argc, argv, off_file_points, max_radius, dim_max);
+
+ // Extract the points from the file filepoints
+ Points_off_reader off_reader(off_file_points);
+
+ // Compute the proximity graph of the points
+ Proximity_graph prox_graph = Gudhi::compute_proximity_graph<Simplex_tree>(off_reader.get_point_cloud(), max_radius,
+ Gudhi::Minimal_enclosing_ball_radius());
+
+ // Construct the Rips complex in a Simplex Tree
+ Simplex_tree st;
+ // insert the proximity graph in the simplex tree
+ st.insert_graph(prox_graph);
+ // expand the graph until dimension dim_max
+ st.expansion_with_blockers(dim_max, Cech_blocker(st, max_radius, off_reader.get_point_cloud()));
+
+ std::cout << "The complex contains " << st.num_simplices() << " simplices \n";
+ std::cout << " and has dimension " << st.dimension() << " \n";
+
+ // Sort the simplices in the order of the filtration
+ st.initialize_filtration();
+
+#if DEBUG_TRACES
+ std::cout << "********************************************************************\n";
+ std::cout << "* The complex contains " << st.num_simplices() << " simplices - dimension=" << st.dimension() << "\n";
+ std::cout << "* Iterator on Simplices in the filtration, with [filtration value]:\n";
+ 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 << static_cast<int>(vertex) << " ";
+ }
+ std::cout << std::endl;
+ }
+#endif // DEBUG_TRACES
+
+ return 0;
+}
+
+void program_options(int argc, char* argv[], std::string& off_file_points, Filtration_value& max_radius, int& dim_max) {
+ namespace po = boost::program_options;
+ po::options_description hidden("Hidden options");
+ hidden.add_options()("input-file", po::value<std::string>(&off_file_points),
+ "Name of an OFF file containing a point set.\n");
+
+ po::options_description visible("Allowed options", 100);
+ visible.add_options()("help,h", "produce help message")(
+ "max-radius,r",
+ po::value<Filtration_value>(&max_radius)->default_value(std::numeric_limits<Filtration_value>::infinity()),
+ "Maximal length of an edge for the Rips complex construction.")(
+ "cpx-dimension,d", po::value<int>(&dim_max)->default_value(1),
+ "Maximal dimension of the Rips complex we want to compute.");
+
+ 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 << "Construct a Cech complex defined on a set of input points.\n \n";
+
+ std::cout << "Usage: " << argv[0] << " [options] input-file" << std::endl << std::endl;
+ std::cout << visible << std::endl;
+ std::abort();
+ }
+}
diff --git a/example/Contraction/CMakeLists.txt b/example/Contraction/CMakeLists.txt
index a92d1685..582b7ab8 100644
--- a/example/Contraction/CMakeLists.txt
+++ b/example/Contraction/CMakeLists.txt
@@ -1,4 +1,3 @@
-cmake_minimum_required(VERSION 2.6)
project(Contraction_examples)
add_executable(RipsContraction Rips_contraction.cpp)
diff --git a/example/Contraction/Garland_heckbert.cpp b/example/Contraction/Garland_heckbert.cpp
index 2b0dc973..08dd932e 100644
--- a/example/Contraction/Garland_heckbert.cpp
+++ b/example/Contraction/Garland_heckbert.cpp
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-M�diterran�e (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/example/Contraction/Garland_heckbert/Error_quadric.h b/example/Contraction/Garland_heckbert/Error_quadric.h
index e7dafaa0..8bd9b545 100644
--- a/example/Contraction/Garland_heckbert/Error_quadric.h
+++ b/example/Contraction/Garland_heckbert/Error_quadric.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-M�diterran�e (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/example/Contraction/Rips_contraction.cpp b/example/Contraction/Rips_contraction.cpp
index 501b0e87..7f9b150a 100644
--- a/example/Contraction/Rips_contraction.cpp
+++ b/example/Contraction/Rips_contraction.cpp
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/example/Nerve_GIC/CMakeLists.txt b/example/Nerve_GIC/CMakeLists.txt
index f2626927..fdecf86e 100644
--- a/example/Nerve_GIC/CMakeLists.txt
+++ b/example/Nerve_GIC/CMakeLists.txt
@@ -1,4 +1,3 @@
-cmake_minimum_required(VERSION 2.6)
project(Nerve_GIC_examples)
if (NOT CGAL_VERSION VERSION_LESS 4.8.1)
@@ -17,10 +16,13 @@ if (NOT CGAL_VERSION VERSION_LESS 4.8.1)
file(COPY "${CMAKE_SOURCE_DIR}/data/points/COIL_database/lucky_cat_PCA1" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
add_test(NAME Nerve_GIC_example_CoordGIC COMMAND $<TARGET_FILE:CoordGIC>
- "tore3D_1307.off" "0")
+ "${CMAKE_CURRENT_BINARY_DIR}/tore3D_1307.off" "0")
add_test(NAME Nerve_GIC_example_FuncGIC COMMAND $<TARGET_FILE:FuncGIC>
- "lucky_cat.off"
- "lucky_cat_PCA1")
+ "${CMAKE_CURRENT_BINARY_DIR}/lucky_cat.off"
+ "${CMAKE_CURRENT_BINARY_DIR}/lucky_cat_PCA1")
+
+ install(TARGETS CoordGIC DESTINATION bin)
+ install(TARGETS FuncGIC DESTINATION bin)
endif (NOT CGAL_VERSION VERSION_LESS 4.8.1)
diff --git a/example/Nerve_GIC/CoordGIC.cpp b/example/Nerve_GIC/CoordGIC.cpp
index c92cf235..73edae18 100644
--- a/example/Nerve_GIC/CoordGIC.cpp
+++ b/example/Nerve_GIC/CoordGIC.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Mathieu Carrière
*
- * Copyright (C) 2017 INRIA
+ * Copyright (C) 2017 Inria
*
* 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
@@ -66,6 +66,9 @@ int main(int argc, char **argv) {
GIC.find_simplices();
+ GIC.compute_distribution(10);
+ GIC.compute_p_value();
+
GIC.plot_DOT();
Gudhi::Simplex_tree<> stree;
diff --git a/example/Nerve_GIC/FuncGIC.cpp b/example/Nerve_GIC/FuncGIC.cpp
index cb0f0d63..1f5de999 100644
--- a/example/Nerve_GIC/FuncGIC.cpp
+++ b/example/Nerve_GIC/FuncGIC.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Mathieu Carrière
*
- * Copyright (C) 2017 INRIA
+ * Copyright (C) 2017 Inria
*
* 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
diff --git a/example/Persistence_representations/CMakeLists.txt b/example/Persistence_representations/CMakeLists.txt
index eb3258f8..33558df3 100644
--- a/example/Persistence_representations/CMakeLists.txt
+++ b/example/Persistence_representations/CMakeLists.txt
@@ -1,27 +1,28 @@
-cmake_minimum_required(VERSION 2.6)
project(Persistence_representations_example)
add_executable ( Persistence_representations_example_landscape_on_grid persistence_landscape_on_grid.cpp )
add_test(NAME Persistence_representations_example_landscape_on_grid
COMMAND $<TARGET_FILE:Persistence_representations_example_landscape_on_grid>)
+install(TARGETS Persistence_representations_example_landscape_on_grid DESTINATION bin)
add_executable ( Persistence_representations_example_landscape persistence_landscape.cpp )
add_test(NAME Persistence_representations_example_landscape
COMMAND $<TARGET_FILE:Persistence_representations_example_landscape>)
+install(TARGETS Persistence_representations_example_landscape DESTINATION bin)
add_executable ( Persistence_representations_example_intervals persistence_intervals.cpp )
add_test(NAME Persistence_representations_example_intervals
COMMAND $<TARGET_FILE:Persistence_representations_example_intervals>
"${CMAKE_SOURCE_DIR}/data/persistence_diagram/first.pers")
+install(TARGETS Persistence_representations_example_intervals DESTINATION bin)
add_executable ( Persistence_representations_example_vectors persistence_vectors.cpp )
add_test(NAME Persistence_representations_example_vectors
COMMAND $<TARGET_FILE:Persistence_representations_example_vectors>)
+install(TARGETS Persistence_representations_example_vectors DESTINATION bin)
add_executable ( Persistence_representations_example_heat_maps persistence_heat_maps.cpp )
add_test(NAME Persistence_representations_example_heat_maps
COMMAND $<TARGET_FILE:Persistence_representations_example_heat_maps>)
-
-
-
+install(TARGETS Persistence_representations_example_heat_maps DESTINATION bin)
diff --git a/example/Persistence_representations/persistence_heat_maps.cpp b/example/Persistence_representations/persistence_heat_maps.cpp
index 2a472ac6..323b57e9 100644
--- a/example/Persistence_representations/persistence_heat_maps.cpp
+++ b/example/Persistence_representations/persistence_heat_maps.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/example/Persistence_representations/persistence_intervals.cpp b/example/Persistence_representations/persistence_intervals.cpp
index c1ceb458..b5dcf25c 100644
--- a/example/Persistence_representations/persistence_intervals.cpp
+++ b/example/Persistence_representations/persistence_intervals.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/example/Persistence_representations/persistence_landscape.cpp b/example/Persistence_representations/persistence_landscape.cpp
index 400a9ae1..27542cf7 100644
--- a/example/Persistence_representations/persistence_landscape.cpp
+++ b/example/Persistence_representations/persistence_landscape.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/example/Persistence_representations/persistence_landscape_on_grid.cpp b/example/Persistence_representations/persistence_landscape_on_grid.cpp
index b201b397..0f471a67 100644
--- a/example/Persistence_representations/persistence_landscape_on_grid.cpp
+++ b/example/Persistence_representations/persistence_landscape_on_grid.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/example/Persistence_representations/persistence_vectors.cpp b/example/Persistence_representations/persistence_vectors.cpp
index 834ae644..072e530d 100644
--- a/example/Persistence_representations/persistence_vectors.cpp
+++ b/example/Persistence_representations/persistence_vectors.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/example/Persistent_cohomology/CMakeLists.txt b/example/Persistent_cohomology/CMakeLists.txt
index 18e2913b..0f731519 100644
--- a/example/Persistent_cohomology/CMakeLists.txt
+++ b/example/Persistent_cohomology/CMakeLists.txt
@@ -1,4 +1,3 @@
-cmake_minimum_required(VERSION 2.6)
project(Persistent_cohomology_examples)
add_executable(plain_homology plain_homology.cpp)
diff --git a/example/Persistent_cohomology/custom_persistence_sort.cpp b/example/Persistent_cohomology/custom_persistence_sort.cpp
index 64f2a4dc..35366144 100644
--- a/example/Persistent_cohomology/custom_persistence_sort.cpp
+++ b/example/Persistent_cohomology/custom_persistence_sort.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Vincent Rouvreau
*
- * Copyright (C) 2014 INRIA Saclay (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/example/Persistent_cohomology/persistence_from_file.cpp b/example/Persistent_cohomology/persistence_from_file.cpp
index eafa3fd5..c40434a4 100644
--- a/example/Persistent_cohomology/persistence_from_file.cpp
+++ b/example/Persistent_cohomology/persistence_from_file.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Vincent Rouvreau
*
- * Copyright (C) 2014 INRIA Saclay (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/example/Persistent_cohomology/persistence_from_simple_simplex_tree.cpp b/example/Persistent_cohomology/persistence_from_simple_simplex_tree.cpp
index 8ef479d4..ffccfd86 100644
--- a/example/Persistent_cohomology/persistence_from_simple_simplex_tree.cpp
+++ b/example/Persistent_cohomology/persistence_from_simple_simplex_tree.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Vincent Rouvreau
*
- * Copyright (C) 2014 INRIA
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/example/Persistent_cohomology/plain_homology.cpp b/example/Persistent_cohomology/plain_homology.cpp
index a5ae09c8..a2256060 100644
--- a/example/Persistent_cohomology/plain_homology.cpp
+++ b/example/Persistent_cohomology/plain_homology.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Marc Glisse
*
- * Copyright (C) 2015 INRIA Saclay - Ile-de-France (France)
+ * Copyright (C) 2015 Inria
*
* 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
diff --git a/example/Persistent_cohomology/rips_multifield_persistence.cpp b/example/Persistent_cohomology/rips_multifield_persistence.cpp
index dae36ed2..626ec2ef 100644
--- a/example/Persistent_cohomology/rips_multifield_persistence.cpp
+++ b/example/Persistent_cohomology/rips_multifield_persistence.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Clément Maria
*
- * Copyright (C) 2014 INRIA
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/example/Persistent_cohomology/rips_persistence_step_by_step.cpp b/example/Persistent_cohomology/rips_persistence_step_by_step.cpp
index c1de0ef8..7c81fcfb 100644
--- a/example/Persistent_cohomology/rips_persistence_step_by_step.cpp
+++ b/example/Persistent_cohomology/rips_persistence_step_by_step.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Clément Maria
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Méditerranée (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/example/Persistent_cohomology/rips_persistence_via_boundary_matrix.cpp b/example/Persistent_cohomology/rips_persistence_via_boundary_matrix.cpp
index 9618f278..c7607dce 100644
--- a/example/Persistent_cohomology/rips_persistence_via_boundary_matrix.cpp
+++ b/example/Persistent_cohomology/rips_persistence_via_boundary_matrix.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Clément Maria, Marc Glisse
*
- * Copyright (C) 2014 INRIA
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/example/Rips_complex/CMakeLists.txt b/example/Rips_complex/CMakeLists.txt
index 2940f164..e7772bdb 100644
--- a/example/Rips_complex/CMakeLists.txt
+++ b/example/Rips_complex/CMakeLists.txt
@@ -1,4 +1,3 @@
-cmake_minimum_required(VERSION 2.6)
project(Rips_complex_examples)
# Point cloud
@@ -11,17 +10,29 @@ add_executable ( Rips_complex_example_one_skeleton_from_distance_matrix example_
add_executable ( Rips_complex_example_from_csv_distance_matrix example_rips_complex_from_csv_distance_matrix_file.cpp )
+# Sparse rips from points
+add_executable ( Rips_complex_example_sparse example_sparse_rips.cpp )
+
+# Correlation matrix
+add_executable ( Rips_complex_example_one_skeleton_rips_from_correlation_matrix example_one_skeleton_rips_from_correlation_matrix.cpp )
+
if (TBB_FOUND)
target_link_libraries(Rips_complex_example_from_off ${TBB_LIBRARIES})
target_link_libraries(Rips_complex_example_one_skeleton_from_points ${TBB_LIBRARIES})
target_link_libraries(Rips_complex_example_one_skeleton_from_distance_matrix ${TBB_LIBRARIES})
target_link_libraries(Rips_complex_example_from_csv_distance_matrix ${TBB_LIBRARIES})
+ target_link_libraries(Rips_complex_example_sparse ${TBB_LIBRARIES})
+ target_link_libraries(Rips_complex_example_one_skeleton_rips_from_correlation_matrix ${TBB_LIBRARIES})
endif()
add_test(NAME Rips_complex_example_one_skeleton_from_points
COMMAND $<TARGET_FILE:Rips_complex_example_one_skeleton_from_points>)
add_test(NAME Rips_complex_example_one_skeleton_from_distance_matrix
COMMAND $<TARGET_FILE:Rips_complex_example_one_skeleton_from_distance_matrix>)
+add_test(NAME Rips_complex_example_sparse
+ COMMAND $<TARGET_FILE:Rips_complex_example_sparse>)
+add_test(NAME Rips_complex_example_one_skeleton_rips_from_correlation_matrix
+ COMMAND $<TARGET_FILE:Rips_complex_example_one_skeleton_rips_from_correlation_matrix>)
add_test(NAME Rips_complex_example_from_off_doc_12_1 COMMAND $<TARGET_FILE:Rips_complex_example_from_off>
"${CMAKE_SOURCE_DIR}/data/points/alphacomplexdoc.off" "12.0" "1" "${CMAKE_CURRENT_BINARY_DIR}/ripsoffreader_result_12_1.txt")
@@ -57,3 +68,4 @@ install(TARGETS Rips_complex_example_from_off DESTINATION bin)
install(TARGETS Rips_complex_example_one_skeleton_from_points DESTINATION bin)
install(TARGETS Rips_complex_example_one_skeleton_from_distance_matrix DESTINATION bin)
install(TARGETS Rips_complex_example_from_csv_distance_matrix DESTINATION bin)
+install(TARGETS Rips_complex_example_one_skeleton_rips_from_correlation_matrix DESTINATION bin)
diff --git a/example/Rips_complex/example_one_skeleton_rips_from_correlation_matrix.cpp b/example/Rips_complex/example_one_skeleton_rips_from_correlation_matrix.cpp
new file mode 100644
index 00000000..05bacb9f
--- /dev/null
+++ b/example/Rips_complex/example_one_skeleton_rips_from_correlation_matrix.cpp
@@ -0,0 +1,81 @@
+#include <gudhi/Rips_complex.h>
+#include <gudhi/Simplex_tree.h>
+#include <gudhi/distance_functions.h>
+
+#include <iostream>
+#include <string>
+#include <vector>
+#include <limits> // for std::numeric_limits
+
+int main() {
+ // Type definitions
+ using Simplex_tree = Gudhi::Simplex_tree<>;
+ using Filtration_value = Simplex_tree::Filtration_value;
+ using Rips_complex = Gudhi::rips_complex::Rips_complex<Filtration_value>;
+ using Distance_matrix = std::vector<std::vector<Filtration_value>>;
+
+ // User defined correlation matrix is:
+ // |1 0.06 0.23 0.01 0.89|
+ // |0.06 1 0.74 0.01 0.61|
+ // |0.23 0.74 1 0.72 0.03|
+ // |0.01 0.01 0.72 1 0.7 |
+ // |0.89 0.61 0.03 0.7 1 |
+
+ Distance_matrix correlations;
+ correlations.push_back({});
+ correlations.push_back({0.06});
+ correlations.push_back({0.23, 0.74});
+ correlations.push_back({0.01, 0.01, 0.72});
+ correlations.push_back({0.89, 0.61, 0.03, 0.7});
+
+ // ----------------------------------------------------------------------------
+ // Convert correlation matrix to a distance matrix:
+ // ----------------------------------------------------------------------------
+ double threshold = 0;
+ for (size_t i = 0; i != correlations.size(); ++i) {
+ for (size_t j = 0; j != correlations[i].size(); ++j) {
+ // Here we check if our data comes from corelation matrix.
+ if ((correlations[i][j] < -1) || (correlations[i][j] > 1)) {
+ std::cerr << "The input matrix is not a correlation matrix. The program will now terminate.\n";
+ throw "The input matrix is not a correlation matrix. The program will now terminate.\n";
+ }
+ correlations[i][j] = 1 - correlations[i][j];
+ // Here we make sure that we will get the treshold value equal to maximal
+ // distance in the matrix.
+ if (correlations[i][j] > threshold) threshold = correlations[i][j];
+ }
+ }
+
+ //-----------------------------------------------------------------------------
+ // Now the correlation matrix is a distance matrix and can be processed further.
+ //-----------------------------------------------------------------------------
+ Distance_matrix distances = correlations;
+
+ Rips_complex rips_complex_from_points(distances, threshold);
+
+ Simplex_tree stree;
+ rips_complex_from_points.create_complex(stree, 1);
+ // ----------------------------------------------------------------------------
+ // Display information about the one skeleton Rips complex. Note that
+ // the filtration displayed here comes from the distance matrix computed
+ // above, which is 1 - initial correlation matrix. Only this way, we obtain
+ // a complex with filtration. If a correlation matrix is used instead, we would
+ // have a reverse filtration (i.e. filtration of boundary of each simplex S
+ // is greater or equal to the filtration of S).
+ // ----------------------------------------------------------------------------
+ std::cout << "Rips complex is of dimension " << stree.dimension() << " - " << stree.num_simplices() << " simplices - "
+ << stree.num_vertices() << " vertices." << std::endl;
+
+ std::cout << "Iterator on Rips complex simplices in the filtration order, with [filtration value]:" << std::endl;
+ for (auto f_simplex : stree.filtration_simplex_range()) {
+ std::cout << " ( ";
+ for (auto vertex : stree.simplex_vertex_range(f_simplex)) {
+ std::cout << vertex << " ";
+ }
+ std::cout << ") -> "
+ << "[" << stree.filtration(f_simplex) << "] ";
+ std::cout << std::endl;
+ }
+
+ return 0;
+}
diff --git a/example/Rips_complex/example_sparse_rips.cpp b/example/Rips_complex/example_sparse_rips.cpp
new file mode 100644
index 00000000..1c95b48c
--- /dev/null
+++ b/example/Rips_complex/example_sparse_rips.cpp
@@ -0,0 +1,30 @@
+#include <gudhi/Sparse_rips_complex.h>
+#include <gudhi/Simplex_tree.h>
+#include <gudhi/distance_functions.h>
+
+#include <iostream>
+#include <vector>
+
+int main() {
+ using Point = std::vector<double>;
+ using Simplex_tree = Gudhi::Simplex_tree<Gudhi::Simplex_tree_options_fast_persistence>;
+ using Filtration_value = Simplex_tree::Filtration_value;
+ using Sparse_rips = Gudhi::rips_complex::Sparse_rips_complex<Filtration_value>;
+
+ Point points[] = {{1.0, 1.0}, {7.0, 0.0}, {4.0, 6.0}, {9.0, 6.0}, {0.0, 14.0}, {2.0, 19.0}, {9.0, 17.0}};
+
+ // ----------------------------------------------------------------------------
+ // Init from Euclidean points
+ // ----------------------------------------------------------------------------
+ double epsilon = 2; // very rough, no guarantees
+ Sparse_rips sparse_rips(points, Gudhi::Euclidean_distance(), epsilon);
+
+ Simplex_tree stree;
+ sparse_rips.create_complex(stree, 10);
+
+ // ----------------------------------------------------------------------------
+ // Display information about the complex
+ // ----------------------------------------------------------------------------
+ std::cout << "Sparse Rips complex is of dimension " << stree.dimension() << " - " << stree.num_simplices()
+ << " simplices - " << stree.num_vertices() << " vertices." << std::endl;
+}
diff --git a/example/Rips_complex/one_skeleton_rips_from_correlation_matrix_for_doc.txt b/example/Rips_complex/one_skeleton_rips_from_correlation_matrix_for_doc.txt
new file mode 100644
index 00000000..640d7083
--- /dev/null
+++ b/example/Rips_complex/one_skeleton_rips_from_correlation_matrix_for_doc.txt
@@ -0,0 +1,17 @@
+Rips complex is of dimension 1 - 15 simplices - 5 vertices.
+Iterator on Rips complex simplices in the filtration order, with [filtration value]:
+ ( 0 ) -> [0]
+ ( 1 ) -> [0]
+ ( 2 ) -> [0]
+ ( 3 ) -> [0]
+ ( 4 ) -> [0]
+ ( 4 0 ) -> [0.11]
+ ( 2 1 ) -> [0.26]
+ ( 3 2 ) -> [0.28]
+ ( 4 3 ) -> [0.3]
+ ( 4 1 ) -> [0.39]
+ ( 2 0 ) -> [0.77]
+ ( 1 0 ) -> [0.94]
+ ( 4 2 ) -> [0.97]
+ ( 3 0 ) -> [0.99]
+ ( 3 1 ) -> [0.99]
diff --git a/example/Simplex_tree/CMakeLists.txt b/example/Simplex_tree/CMakeLists.txt
index b33b2d05..857e8518 100644
--- a/example/Simplex_tree/CMakeLists.txt
+++ b/example/Simplex_tree/CMakeLists.txt
@@ -1,4 +1,3 @@
-cmake_minimum_required(VERSION 2.6)
project(Simplex_tree_examples)
add_executable ( Simplex_tree_example_from_cliques_of_graph simplex_tree_from_cliques_of_graph.cpp )
diff --git a/example/Simplex_tree/cech_complex_cgal_mini_sphere_3d.cpp b/example/Simplex_tree/cech_complex_cgal_mini_sphere_3d.cpp
index 9bd51106..08ed74bb 100644
--- a/example/Simplex_tree/cech_complex_cgal_mini_sphere_3d.cpp
+++ b/example/Simplex_tree/cech_complex_cgal_mini_sphere_3d.cpp
@@ -2,9 +2,9 @@
* (Geometric Understanding in Higher Dimensions) is a generic C++
* library for computational topology.
*
- * Author(s): Clément Maria
+ * Author(s): Vincent Rouvreau
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Méditerranée (France)
+ * Copyright (C) 2017 Inria
*
* 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
diff --git a/example/Simplex_tree/example_alpha_shapes_3_simplex_tree_from_off_file.cpp b/example/Simplex_tree/example_alpha_shapes_3_simplex_tree_from_off_file.cpp
index d8289ba9..290a9d9b 100644
--- a/example/Simplex_tree/example_alpha_shapes_3_simplex_tree_from_off_file.cpp
+++ b/example/Simplex_tree/example_alpha_shapes_3_simplex_tree_from_off_file.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Vincent Rouvreau
*
- * Copyright (C) 2014 INRIA Saclay (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/example/Simplex_tree/graph_expansion_with_blocker.cpp b/example/Simplex_tree/graph_expansion_with_blocker.cpp
index 0d458cbd..f39de31f 100644
--- a/example/Simplex_tree/graph_expansion_with_blocker.cpp
+++ b/example/Simplex_tree/graph_expansion_with_blocker.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Vincent Rouvreau
*
- * Copyright (C) 2014
+ * Copyright (C) 2014 Inria
*
* 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
@@ -29,33 +29,33 @@ using Simplex_handle = Simplex_tree::Simplex_handle;
int main(int argc, char* const argv[]) {
// Construct the Simplex Tree with a 1-skeleton graph example
- Simplex_tree simplexTree;
+ Simplex_tree stree;
- simplexTree.insert_simplex({0, 1}, 0.);
- simplexTree.insert_simplex({0, 2}, 1.);
- simplexTree.insert_simplex({0, 3}, 2.);
- simplexTree.insert_simplex({1, 2}, 3.);
- simplexTree.insert_simplex({1, 3}, 4.);
- simplexTree.insert_simplex({2, 3}, 5.);
- simplexTree.insert_simplex({2, 4}, 6.);
- simplexTree.insert_simplex({3, 6}, 7.);
- simplexTree.insert_simplex({4, 5}, 8.);
- simplexTree.insert_simplex({4, 6}, 9.);
- simplexTree.insert_simplex({5, 6}, 10.);
- simplexTree.insert_simplex({6}, 10.);
+ stree.insert_simplex({0, 1}, 0.);
+ stree.insert_simplex({0, 2}, 1.);
+ stree.insert_simplex({0, 3}, 2.);
+ stree.insert_simplex({1, 2}, 3.);
+ stree.insert_simplex({1, 3}, 4.);
+ stree.insert_simplex({2, 3}, 5.);
+ stree.insert_simplex({2, 4}, 6.);
+ stree.insert_simplex({3, 6}, 7.);
+ stree.insert_simplex({4, 5}, 8.);
+ stree.insert_simplex({4, 6}, 9.);
+ stree.insert_simplex({5, 6}, 10.);
+ stree.insert_simplex({6}, 10.);
- simplexTree.expansion_with_blockers(3, [&](Simplex_handle sh) {
+ stree.expansion_with_blockers(3, [&](Simplex_handle sh) {
bool result = false;
std::cout << "Blocker on [";
// User can loop on the vertices from the given simplex_handle i.e.
- for (auto vertex : simplexTree.simplex_vertex_range(sh)) {
+ for (auto vertex : stree.simplex_vertex_range(sh)) {
// We block the expansion, if the vertex '6' is in the given list of vertices
if (vertex == 6) result = true;
std::cout << vertex << ", ";
}
- std::cout << "] ( " << simplexTree.filtration(sh);
+ std::cout << "] ( " << stree.filtration(sh);
// User can re-assign a new filtration value directly in the blocker (default is the maximal value of boudaries)
- simplexTree.assign_filtration(sh, simplexTree.filtration(sh) + 1.);
+ stree.assign_filtration(sh, stree.filtration(sh) + 1.);
std::cout << " + 1. ) = " << result << std::endl;
@@ -63,13 +63,13 @@ int main(int argc, char* const argv[]) {
});
std::cout << "********************************************************************\n";
- std::cout << "* The complex contains " << simplexTree.num_simplices() << " simplices";
- std::cout << " - dimension " << simplexTree.dimension() << "\n";
+ std::cout << "* The complex contains " << stree.num_simplices() << " simplices";
+ std::cout << " - dimension " << stree.dimension() << "\n";
std::cout << "* Iterator on Simplices in the filtration, with [filtration value]:\n";
- for (auto f_simplex : simplexTree.filtration_simplex_range()) {
+ for (auto f_simplex : stree.filtration_simplex_range()) {
std::cout << " "
- << "[" << simplexTree.filtration(f_simplex) << "] ";
- for (auto vertex : simplexTree.simplex_vertex_range(f_simplex)) std::cout << "(" << vertex << ")";
+ << "[" << stree.filtration(f_simplex) << "] ";
+ for (auto vertex : stree.simplex_vertex_range(f_simplex)) std::cout << "(" << vertex << ")";
std::cout << std::endl;
}
diff --git a/example/Simplex_tree/mini_simplex_tree.cpp b/example/Simplex_tree/mini_simplex_tree.cpp
index 19e45361..e7c7177f 100644
--- a/example/Simplex_tree/mini_simplex_tree.cpp
+++ b/example/Simplex_tree/mini_simplex_tree.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Marc Glisse
*
- * Copyright (C) 2015 INRIA Saclay - Ile-de-France (France)
+ * Copyright (C) 2015 Inria
*
* 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
diff --git a/example/Simplex_tree/simple_simplex_tree.cpp b/example/Simplex_tree/simple_simplex_tree.cpp
index 828977c2..d71b5608 100644
--- a/example/Simplex_tree/simple_simplex_tree.cpp
+++ b/example/Simplex_tree/simple_simplex_tree.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Vincent Rouvreau
*
- * Copyright (C) 2014
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/example/Simplex_tree/simplex_tree_from_cliques_of_graph.cpp b/example/Simplex_tree/simplex_tree_from_cliques_of_graph.cpp
index d1b8b2de..6d70f3d1 100644
--- a/example/Simplex_tree/simplex_tree_from_cliques_of_graph.cpp
+++ b/example/Simplex_tree/simplex_tree_from_cliques_of_graph.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Clément Maria
*
- * Copyright (C) 2014 INRIA
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/example/Skeleton_blocker/CMakeLists.txt b/example/Skeleton_blocker/CMakeLists.txt
index de70f089..0e5d2f11 100644
--- a/example/Skeleton_blocker/CMakeLists.txt
+++ b/example/Skeleton_blocker/CMakeLists.txt
@@ -1,4 +1,3 @@
-cmake_minimum_required(VERSION 2.6)
project(Skeleton_blocker_examples)
add_executable(Skeleton_blocker_example_from_simplices Skeleton_blocker_from_simplices.cpp)
diff --git a/example/Skeleton_blocker/Skeleton_blocker_from_simplices.cpp b/example/Skeleton_blocker/Skeleton_blocker_from_simplices.cpp
index 076c6a53..f288e39c 100644
--- a/example/Skeleton_blocker/Skeleton_blocker_from_simplices.cpp
+++ b/example/Skeleton_blocker/Skeleton_blocker_from_simplices.cpp
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/example/Skeleton_blocker/Skeleton_blocker_iteration.cpp b/example/Skeleton_blocker/Skeleton_blocker_iteration.cpp
index 08ff0264..4d008450 100644
--- a/example/Skeleton_blocker/Skeleton_blocker_iteration.cpp
+++ b/example/Skeleton_blocker/Skeleton_blocker_iteration.cpp
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/example/Skeleton_blocker/Skeleton_blocker_link.cpp b/example/Skeleton_blocker/Skeleton_blocker_link.cpp
index 58322038..2ec72128 100644
--- a/example/Skeleton_blocker/Skeleton_blocker_link.cpp
+++ b/example/Skeleton_blocker/Skeleton_blocker_link.cpp
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/example/Spatial_searching/CMakeLists.txt b/example/Spatial_searching/CMakeLists.txt
index 4cf3d863..0f799987 100644
--- a/example/Spatial_searching/CMakeLists.txt
+++ b/example/Spatial_searching/CMakeLists.txt
@@ -1,4 +1,3 @@
-cmake_minimum_required(VERSION 2.6)
project(Spatial_searching_examples)
if(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1)
diff --git a/example/Subsampling/CMakeLists.txt b/example/Subsampling/CMakeLists.txt
index 34400b1e..f26d107f 100644
--- a/example/Subsampling/CMakeLists.txt
+++ b/example/Subsampling/CMakeLists.txt
@@ -1,4 +1,3 @@
-cmake_minimum_required(VERSION 2.6)
project(Subsampling_examples)
if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1)
diff --git a/example/Tangential_complex/CMakeLists.txt b/example/Tangential_complex/CMakeLists.txt
index 16d1339d..af0dac51 100644
--- a/example/Tangential_complex/CMakeLists.txt
+++ b/example/Tangential_complex/CMakeLists.txt
@@ -1,4 +1,3 @@
-cmake_minimum_required(VERSION 2.6)
project(Tangential_complex_examples)
if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1)
diff --git a/example/Witness_complex/CMakeLists.txt b/example/Witness_complex/CMakeLists.txt
index a8231392..3d838c0d 100644
--- a/example/Witness_complex/CMakeLists.txt
+++ b/example/Witness_complex/CMakeLists.txt
@@ -1,4 +1,3 @@
-cmake_minimum_required(VERSION 2.6)
project(Witness_complex_examples)
add_executable ( Witness_complex_example_nearest_landmark_table example_nearest_landmark_table.cpp )
diff --git a/example/Witness_complex/example_nearest_landmark_table.cpp b/example/Witness_complex/example_nearest_landmark_table.cpp
index b8594212..acaf7c54 100644
--- a/example/Witness_complex/example_nearest_landmark_table.cpp
+++ b/example/Witness_complex/example_nearest_landmark_table.cpp
@@ -1,25 +1,3 @@
-/* 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): Siargey Kachanovich
- *
- * Copyright (C) 2016 INRIA (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/>.
- */
-
#define BOOST_PARAMETER_MAX_ARITY 12
#include <gudhi/Simplex_tree.h>
diff --git a/example/Witness_complex/example_strong_witness_complex_off.cpp b/example/Witness_complex/example_strong_witness_complex_off.cpp
index 346bef6d..19f73836 100644
--- a/example/Witness_complex/example_strong_witness_complex_off.cpp
+++ b/example/Witness_complex/example_strong_witness_complex_off.cpp
@@ -1,25 +1,3 @@
-/* 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): Siargey Kachanovich
- *
- * Copyright (C) 2016 INRIA (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/>.
- */
-
#include <gudhi/Simplex_tree.h>
#include <gudhi/Euclidean_strong_witness_complex.h>
#include <gudhi/pick_n_random_points.h>
diff --git a/example/Witness_complex/example_witness_complex_sphere.cpp b/example/Witness_complex/example_witness_complex_sphere.cpp
index a6e9b11a..9e3c972d 100644
--- a/example/Witness_complex/example_witness_complex_sphere.cpp
+++ b/example/Witness_complex/example_witness_complex_sphere.cpp
@@ -1,25 +1,3 @@
-/* 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): Siargey Kachanovich
- *
- * Copyright (C) 2016 INRIA (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/>.
- */
-
#define BOOST_PARAMETER_MAX_ARITY 12
#include <gudhi/Simplex_tree.h>
diff --git a/example/Witness_complex/generators.h b/example/Witness_complex/generators.h
index 7df43db5..4b755daa 100644
--- a/example/Witness_complex/generators.h
+++ b/example/Witness_complex/generators.h
@@ -4,7 +4,7 @@
*
* Author(s): Siargey Kachanovich
*
- * Copyright (C) 2015 INRIA Sophia Antipolis-Méditerranée (France)
+ * Copyright (C) 2015 Inria
*
* 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
@@ -20,8 +20,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef EXAMPLE_WITNESS_COMPLEX_GENERATORS_H_
-#define EXAMPLE_WITNESS_COMPLEX_GENERATORS_H_
+#ifndef GENERATORS_H_
+#define GENERATORS_H_
#include <CGAL/Epick_d.h>
#include <CGAL/point_generators_d.h>
@@ -163,4 +163,4 @@ void generate_points_torus(Point_Vector& W, int nbP, int dim) {
}
}
-#endif // EXAMPLE_WITNESS_COMPLEX_GENERATORS_H_
+#endif // GENERATORS_H_
diff --git a/example/common/CMakeLists.txt b/example/common/CMakeLists.txt
index afe865d4..04015cdc 100644
--- a/example/common/CMakeLists.txt
+++ b/example/common/CMakeLists.txt
@@ -1,13 +1,21 @@
-cmake_minimum_required(VERSION 2.6)
project(Common_examples)
add_executable ( vector_double_off_reader example_vector_double_points_off_reader.cpp )
target_link_libraries(vector_double_off_reader ${CGAL_LIBRARY})
+file(COPY "${CMAKE_SOURCE_DIR}/data/points/alphacomplexdoc.off" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
add_test(NAME Common_example_vector_double_off_reader COMMAND $<TARGET_FILE:vector_double_off_reader>
- "${CMAKE_SOURCE_DIR}/data/points/SO3_10000.off")
+ "alphacomplexdoc.off")
install(TARGETS vector_double_off_reader DESTINATION bin)
+if (DIFF_PATH)
+ # Do not forget to copy test results files in current binary dir
+ file(COPY "vectordoubleoffreader_result.txt" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
+
+ add_test(Common_example_vector_double_off_reader_diff_files ${DIFF_PATH}
+ ${CMAKE_CURRENT_BINARY_DIR}/vectordoubleoffreader_result.txt ${CMAKE_CURRENT_BINARY_DIR}/alphacomplexdoc.off.txt)
+endif()
+
if(CGAL_FOUND)
add_executable ( cgal_3D_off_reader example_CGAL_3D_points_off_reader.cpp )
target_link_libraries(cgal_3D_off_reader ${CGAL_LIBRARY})
diff --git a/example/common/example_CGAL_3D_points_off_reader.cpp b/example/common/example_CGAL_3D_points_off_reader.cpp
index 665b7a29..4658d8d5 100644
--- a/example/common/example_CGAL_3D_points_off_reader.cpp
+++ b/example/common/example_CGAL_3D_points_off_reader.cpp
@@ -20,12 +20,12 @@ int main(int argc, char **argv) {
usage(argv[0]);
}
- std::string offInputFile(argv[1]);
+ std::string off_input_file(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);
+ Gudhi::Points_3D_off_reader<Point_3> off_reader(off_input_file);
// Check the read operation was correct
if (!off_reader.is_valid()) {
- std::cerr << "Unable to read file " << offInputFile << std::endl;
+ std::cerr << "Unable to read file " << off_input_file << std::endl;
usage(argv[0]);
}
diff --git a/example/common/example_CGAL_points_off_reader.cpp b/example/common/example_CGAL_points_off_reader.cpp
index 8c6a6b54..f45683a5 100644
--- a/example/common/example_CGAL_points_off_reader.cpp
+++ b/example/common/example_CGAL_points_off_reader.cpp
@@ -22,12 +22,12 @@ int main(int argc, char **argv) {
usage(argv[0]);
}
- std::string offInputFile(argv[1]);
+ std::string off_input_file(argv[1]);
// Read the OFF file (input file name given as parameter) and triangulate points
- Gudhi::Points_off_reader<Point_d> off_reader(offInputFile);
+ Gudhi::Points_off_reader<Point_d> off_reader(off_input_file);
// Check the read operation was correct
if (!off_reader.is_valid()) {
- std::cerr << "Unable to read file " << offInputFile << std::endl;
+ std::cerr << "Unable to read file " << off_input_file << std::endl;
usage(argv[0]);
}
diff --git a/example/common/example_vector_double_points_off_reader.cpp b/example/common/example_vector_double_points_off_reader.cpp
index 8aecb26e..5093da85 100644
--- a/example/common/example_vector_double_points_off_reader.cpp
+++ b/example/common/example_vector_double_points_off_reader.cpp
@@ -17,25 +17,27 @@ int main(int argc, char **argv) {
usage(argv[0]);
}
- std::string offInputFile(argv[1]);
+ std::string off_input_file(argv[1]);
// Read the OFF file (input file name given as parameter) and triangulate points
- Gudhi::Points_off_reader<Point_d> off_reader(offInputFile);
+ Gudhi::Points_off_reader<Point_d> off_reader(off_input_file);
// Check the read operation was correct
if (!off_reader.is_valid()) {
- std::cerr << "Unable to read file " << offInputFile << std::endl;
+ std::cerr << "Unable to read file " << off_input_file << std::endl;
usage(argv[0]);
}
// Retrieve the triangulation
std::vector<Point_d> point_cloud = off_reader.get_point_cloud();
+ std::ofstream output_file(off_input_file + ".txt");
int n {0};
for (auto point : point_cloud) {
- std::cout << "Point[" << n << "] = ";
+ output_file << "Point[" << n << "] = ";
for (std::size_t i {0}; i < point.size(); i++)
- std::cout << point[i] << " ";
- std::cout << "\n";
+ output_file << point[i] << " ";
+ output_file << "\n";
++n;
}
+ output_file.close();
return 0;
}
diff --git a/example/common/cgaloffreader_result.txt b/example/common/vectordoubleoffreader_result.txt
index 1deb8dbd..1deb8dbd 100644
--- a/example/common/cgaloffreader_result.txt
+++ b/example/common/vectordoubleoffreader_result.txt
diff --git a/include/gudhi/Active_witness/Active_witness.h b/include/gudhi/Active_witness/Active_witness.h
index d41a6811..8cb8662b 100644
--- a/include/gudhi/Active_witness/Active_witness.h
+++ b/include/gudhi/Active_witness/Active_witness.h
@@ -4,7 +4,7 @@
*
* Author(s): Siargey Kachanovich
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/include/gudhi/Active_witness/Active_witness_iterator.h b/include/gudhi/Active_witness/Active_witness_iterator.h
index 0a05173a..10d2ec52 100644
--- a/include/gudhi/Active_witness/Active_witness_iterator.h
+++ b/include/gudhi/Active_witness/Active_witness_iterator.h
@@ -4,7 +4,7 @@
*
* Author(s): Siargey Kachanovich
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/include/gudhi/Alpha_complex.h b/include/gudhi/Alpha_complex.h
index 63c6675c..4c07eddb 100644
--- a/include/gudhi/Alpha_complex.h
+++ b/include/gudhi/Alpha_complex.h
@@ -4,7 +4,7 @@
*
* Author(s): Vincent Rouvreau
*
- * Copyright (C) 2015 INRIA
+ * Copyright (C) 2015 Inria
*
* 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
@@ -34,6 +34,7 @@
#include <CGAL/Epick_d.h>
#include <CGAL/Spatial_sort_traits_adapter_d.h>
#include <CGAL/property_map.h> // for CGAL::Identity_property_map
+#include <CGAL/NT_converter.h>
#include <iostream>
#include <vector>
@@ -323,8 +324,9 @@ class Alpha_complex {
if (f_simplex_dim > 0) {
// squared_radius function initialization
Squared_Radius squared_radius = kernel_.compute_squared_radius_d_object();
+ CGAL::NT_converter<typename Geom_traits::FT, Filtration_value> cv;
- alpha_complex_filtration = squared_radius(pointVector.begin(), pointVector.end());
+ alpha_complex_filtration = cv(squared_radius(pointVector.begin(), pointVector.end()));
}
complex.assign_filtration(f_simplex, alpha_complex_filtration);
#ifdef DEBUG_TRACES
diff --git a/include/gudhi/Bitmap_cubical_complex.h b/include/gudhi/Bitmap_cubical_complex.h
index 969daba6..cc19b8b5 100644
--- a/include/gudhi/Bitmap_cubical_complex.h
+++ b/include/gudhi/Bitmap_cubical_complex.h
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2015 INRIA Sophia-Saclay (France)
+ * Copyright (C) 2015 Inria
*
* 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
@@ -383,7 +383,7 @@ class Bitmap_cubical_complex : public T {
std::vector<std::size_t> bdry = this->get_boundary_of_a_cell(sh);
if (globalDbg) {
std::cerr << "std::pair<Simplex_handle, Simplex_handle> endpoints( Simplex_handle sh )\n";
- std::cerr << "bdry.size() : " << bdry.size() << std::endl;
+ std::cerr << "bdry.size() : " << bdry.size() << "\n";
}
// this method returns two first elements from the boundary of sh.
if (bdry.size() < 2)
diff --git a/include/gudhi/Bitmap_cubical_complex/counter.h b/include/gudhi/Bitmap_cubical_complex/counter.h
index 705b68a0..f82d4cc3 100644
--- a/include/gudhi/Bitmap_cubical_complex/counter.h
+++ b/include/gudhi/Bitmap_cubical_complex/counter.h
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2015 INRIA Sophia-Saclay (France)
+ * Copyright (C) 2015 Inria
*
* 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
diff --git a/include/gudhi/Bitmap_cubical_complex_base.h b/include/gudhi/Bitmap_cubical_complex_base.h
index bf257be1..9b74e267 100644
--- a/include/gudhi/Bitmap_cubical_complex_base.h
+++ b/include/gudhi/Bitmap_cubical_complex_base.h
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2015 INRIA Sophia-Saclay (France)
+ * Copyright (C) 2015 Inria
*
* 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
@@ -492,7 +492,7 @@ class Bitmap_cubical_complex_base {
this->multipliers.push_back(multiplier);
multiplier *= 2 * sizes[i] + 1;
}
- this->data = std::vector<T>(multiplier, std::numeric_limits<T>::max());
+ this->data = std::vector<T>(multiplier, std::numeric_limits<T>::infinity());
this->total_number_of_cells = multiplier;
}
@@ -562,7 +562,7 @@ void Bitmap_cubical_complex_base<T>::put_data_to_bins(T diameter_of_bin) {
template <typename T>
std::pair<T, T> Bitmap_cubical_complex_base<T>::min_max_filtration() {
- std::pair<T, T> min_max(std::numeric_limits<T>::max(), std::numeric_limits<T>::min());
+ std::pair<T, T> min_max(std::numeric_limits<T>::infinity(), -std::numeric_limits<T>::infinity());
for (std::size_t i = 0; i != this->data.size(); ++i) {
if (this->data[i] < min_max.first) min_max.first = this->data[i];
if (this->data[i] > min_max.second) min_max.second = this->data[i];
diff --git a/include/gudhi/Bitmap_cubical_complex_periodic_boundary_conditions_base.h b/include/gudhi/Bitmap_cubical_complex_periodic_boundary_conditions_base.h
index 4a0d1c74..8c35f590 100644
--- a/include/gudhi/Bitmap_cubical_complex_periodic_boundary_conditions_base.h
+++ b/include/gudhi/Bitmap_cubical_complex_periodic_boundary_conditions_base.h
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2015 INRIA Sophia-Saclay (France)
+ * Copyright (C) 2015 Inria
*
* 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
@@ -177,7 +177,7 @@ class Bitmap_cubical_complex_periodic_boundary_conditions_base : public Bitmap_c
}
}
// std::reverse( this->sizes.begin() , this->sizes.end() );
- this->data = std::vector<T>(multiplier, std::numeric_limits<T>::max());
+ this->data = std::vector<T>(multiplier, std::numeric_limits<T>::infinity());
this->total_number_of_cells = multiplier;
}
Bitmap_cubical_complex_periodic_boundary_conditions_base(const std::vector<unsigned>& sizes);
diff --git a/include/gudhi/Bottleneck.h b/include/gudhi/Bottleneck.h
index 7aee07bb..b0fc3949 100644
--- a/include/gudhi/Bottleneck.h
+++ b/include/gudhi/Bottleneck.h
@@ -4,7 +4,7 @@
*
* Author: Francois Godi
*
- * Copyright (C) 2015 INRIA
+ * Copyright (C) 2015 Inria
*
* 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
@@ -30,6 +30,7 @@
#include <limits> // for numeric_limits
#include <cmath>
+#include <cfloat> // FLT_EVAL_METHOD
namespace Gudhi {
@@ -43,6 +44,13 @@ double bottleneck_distance_approx(Persistence_graph& g, double e) {
Graph_matching biggest_unperfect(g);
while (b_upper_bound - b_lower_bound > 2 * e) {
double step = b_lower_bound + (b_upper_bound - b_lower_bound) / alpha;
+#if !defined FLT_EVAL_METHOD || FLT_EVAL_METHOD < 0 || FLT_EVAL_METHOD > 1
+ // On platforms where double computation is done with excess precision,
+ // we force it to its true precision so the following test is reliable.
+ volatile double drop_excess_precision = step;
+ step = drop_excess_precision;
+ // Alternative: step = CGAL::IA_force_to_double(step);
+#endif
if (step <= b_lower_bound || step >= b_upper_bound) // Avoid precision problem
break;
m.set_r(step);
diff --git a/include/gudhi/Cech_complex.h b/include/gudhi/Cech_complex.h
new file mode 100644
index 00000000..f9b8a269
--- /dev/null
+++ b/include/gudhi/Cech_complex.h
@@ -0,0 +1,130 @@
+/* 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): Vincent Rouvreau
+ *
+ * Copyright (C) 2018 Inria
+ *
+ * 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/>.
+ */
+
+#ifndef CECH_COMPLEX_H_
+#define CECH_COMPLEX_H_
+
+#include <gudhi/distance_functions.h> // for Gudhi::Minimal_enclosing_ball_radius
+#include <gudhi/graph_simplicial_complex.h> // for Gudhi::Proximity_graph
+#include <gudhi/Debug_utils.h> // for GUDHI_CHECK
+#include <gudhi/Cech_complex_blocker.h> // for Gudhi::cech_complex::Cech_blocker
+
+#include <iostream>
+#include <stdexcept> // for exception management
+#include <vector>
+
+namespace Gudhi {
+
+namespace cech_complex {
+
+/**
+ * \class Cech_complex
+ * \brief Cech complex data structure.
+ *
+ * \ingroup cech_complex
+ *
+ * \details
+ * The data structure is a proximity graph, containing edges when the edge length is less or equal
+ * to a given max_radius. Edge length is computed from `Gudhi::Minimal_enclosing_ball_radius` distance function.
+ *
+ * \tparam SimplicialComplexForProximityGraph furnishes `Vertex_handle` and `Filtration_value` type definition required
+ * by `Gudhi::Proximity_graph`.
+ *
+ * \tparam ForwardPointRange must be a range for which `std::begin()` and `std::end()` methods return input
+ * iterators on a point. `std::begin()` and `std::end()` methods are also required for a point.
+ */
+template <typename SimplicialComplexForProximityGraph, typename ForwardPointRange>
+class Cech_complex {
+ private:
+ // Required by compute_proximity_graph
+ using Vertex_handle = typename SimplicialComplexForProximityGraph::Vertex_handle;
+ using Filtration_value = typename SimplicialComplexForProximityGraph::Filtration_value;
+ using Proximity_graph = Gudhi::Proximity_graph<SimplicialComplexForProximityGraph>;
+
+ // Retrieve Coordinate type from ForwardPointRange
+ using Point_from_range_iterator = typename boost::range_const_iterator<ForwardPointRange>::type;
+ using Point_from_range = typename std::iterator_traits<Point_from_range_iterator>::value_type;
+ using Coordinate_iterator = typename boost::range_const_iterator<Point_from_range>::type;
+ using Coordinate = typename std::iterator_traits<Coordinate_iterator>::value_type;
+
+ public:
+ // Point and Point_cloud type definition
+ using Point = std::vector<Coordinate>;
+ using Point_cloud = std::vector<Point>;
+
+ public:
+ /** \brief Cech_complex constructor from a list of points.
+ *
+ * @param[in] points Range of points.
+ * @param[in] max_radius Maximal radius value.
+ *
+ * \tparam ForwardPointRange must be a range of Point. Point must be a range of <b>copyable</b> Cartesian coordinates.
+ *
+ */
+ Cech_complex(const ForwardPointRange& points, Filtration_value max_radius) : max_radius_(max_radius) {
+ // Point cloud deep copy
+ point_cloud_.reserve(boost::size(points));
+ for (auto&& point : points) point_cloud_.emplace_back(std::begin(point), std::end(point));
+
+ cech_skeleton_graph_ = Gudhi::compute_proximity_graph<SimplicialComplexForProximityGraph>(
+ point_cloud_, max_radius_, Gudhi::Minimal_enclosing_ball_radius());
+ }
+
+ /** \brief Initializes the simplicial complex from the proximity graph and expands it until a given maximal
+ * dimension, using the Cech blocker oracle.
+ *
+ * @param[in] complex SimplicialComplexForCech to be created.
+ * @param[in] dim_max graph expansion until this given maximal dimension.
+ * @exception std::invalid_argument In debug mode, if `complex.num_vertices()` does not return 0.
+ *
+ */
+ template <typename SimplicialComplexForCechComplex>
+ void create_complex(SimplicialComplexForCechComplex& complex, int dim_max) {
+ GUDHI_CHECK(complex.num_vertices() == 0,
+ std::invalid_argument("Cech_complex::create_complex - simplicial complex is not empty"));
+
+ // insert the proximity graph in the simplicial complex
+ complex.insert_graph(cech_skeleton_graph_);
+ // expand the graph until dimension dim_max
+ complex.expansion_with_blockers(dim_max,
+ Cech_blocker<SimplicialComplexForCechComplex, Cech_complex>(&complex, this));
+ }
+
+ /** @return max_radius value given at construction. */
+ Filtration_value max_radius() const { return max_radius_; }
+
+ /** @param[in] vertex Point position in the range.
+ * @return The point.
+ */
+ const Point& get_point(Vertex_handle vertex) const { return point_cloud_[vertex]; }
+
+ private:
+ Proximity_graph cech_skeleton_graph_;
+ Filtration_value max_radius_;
+ Point_cloud point_cloud_;
+};
+
+} // namespace cech_complex
+
+} // namespace Gudhi
+
+#endif // CECH_COMPLEX_H_
diff --git a/include/gudhi/Cech_complex_blocker.h b/include/gudhi/Cech_complex_blocker.h
new file mode 100644
index 00000000..b0d347b1
--- /dev/null
+++ b/include/gudhi/Cech_complex_blocker.h
@@ -0,0 +1,91 @@
+/* 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): Vincent Rouvreau
+ *
+ * Copyright (C) 2018 Inria
+ *
+ * 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/>.
+ */
+
+#ifndef CECH_COMPLEX_BLOCKER_H_
+#define CECH_COMPLEX_BLOCKER_H_
+
+#include <gudhi/distance_functions.h> // for Gudhi::Minimal_enclosing_ball_radius
+
+#include <iostream>
+#include <vector>
+#include <cmath> // for std::sqrt
+
+namespace Gudhi {
+
+namespace cech_complex {
+
+/** \internal
+ * \class Cech_blocker
+ * \brief Čech complex blocker.
+ *
+ * \ingroup cech_complex
+ *
+ * \details
+ * Čech blocker is an oracle constructed from a Cech_complex and a simplicial complex.
+ *
+ * \tparam SimplicialComplexForProximityGraph furnishes `Simplex_handle` and `Filtration_value` type definition,
+ * `simplex_vertex_range(Simplex_handle sh)`and `assign_filtration(Simplex_handle sh, Filtration_value filt)` methods.
+ *
+ * \tparam Chech_complex is required by the blocker.
+ */
+template <typename SimplicialComplexForCech, typename Cech_complex>
+class Cech_blocker {
+ private:
+ using Point_cloud = typename Cech_complex::Point_cloud;
+
+ using Simplex_handle = typename SimplicialComplexForCech::Simplex_handle;
+ using Filtration_value = typename SimplicialComplexForCech::Filtration_value;
+
+ public:
+ /** \internal \brief Čech complex blocker operator() - the oracle - assigns the filtration value from the simplex
+ * radius and returns if the simplex expansion must be blocked.
+ * \param[in] sh The Simplex_handle.
+ * \return true if the simplex radius is greater than the Cech_complex max_radius*/
+ bool operator()(Simplex_handle sh) {
+ Point_cloud points;
+ for (auto vertex : sc_ptr_->simplex_vertex_range(sh)) {
+ points.push_back(cc_ptr_->get_point(vertex));
+#ifdef DEBUG_TRACES
+ std::cout << "#(" << vertex << ")#";
+#endif // DEBUG_TRACES
+ }
+ Filtration_value radius = Gudhi::Minimal_enclosing_ball_radius()(points);
+#ifdef DEBUG_TRACES
+ if (radius > cc_ptr_->max_radius()) std::cout << "radius > max_radius => expansion is blocked\n";
+#endif // DEBUG_TRACES
+ sc_ptr_->assign_filtration(sh, radius);
+ return (radius > cc_ptr_->max_radius());
+ }
+
+ /** \internal \brief Čech complex blocker constructor. */
+ Cech_blocker(SimplicialComplexForCech* sc_ptr, Cech_complex* cc_ptr) : sc_ptr_(sc_ptr), cc_ptr_(cc_ptr) {}
+
+ private:
+ SimplicialComplexForCech* sc_ptr_;
+ Cech_complex* cc_ptr_;
+};
+
+} // namespace cech_complex
+
+} // namespace Gudhi
+
+#endif // CECH_COMPLEX_BLOCKER_H_
diff --git a/include/gudhi/Clock.h b/include/gudhi/Clock.h
index b83de2f5..cdf18cb2 100644
--- a/include/gudhi/Clock.h
+++ b/include/gudhi/Clock.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/include/gudhi/Contraction/Edge_profile.h b/include/gudhi/Contraction/Edge_profile.h
index e4910b27..30b1b80a 100644
--- a/include/gudhi/Contraction/Edge_profile.h
+++ b/include/gudhi/Contraction/Edge_profile.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/include/gudhi/Contraction/policies/Contraction_visitor.h b/include/gudhi/Contraction/policies/Contraction_visitor.h
index 7ee05aad..fa02308b 100644
--- a/include/gudhi/Contraction/policies/Contraction_visitor.h
+++ b/include/gudhi/Contraction/policies/Contraction_visitor.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/include/gudhi/Contraction/policies/Cost_policy.h b/include/gudhi/Contraction/policies/Cost_policy.h
index f4d343ec..04ce36b6 100644
--- a/include/gudhi/Contraction/policies/Cost_policy.h
+++ b/include/gudhi/Contraction/policies/Cost_policy.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/include/gudhi/Contraction/policies/Dummy_valid_contraction.h b/include/gudhi/Contraction/policies/Dummy_valid_contraction.h
index 5d329496..a5567454 100644
--- a/include/gudhi/Contraction/policies/Dummy_valid_contraction.h
+++ b/include/gudhi/Contraction/policies/Dummy_valid_contraction.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/include/gudhi/Contraction/policies/Edge_length_cost.h b/include/gudhi/Contraction/policies/Edge_length_cost.h
index dac2d448..1b7a825b 100644
--- a/include/gudhi/Contraction/policies/Edge_length_cost.h
+++ b/include/gudhi/Contraction/policies/Edge_length_cost.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/include/gudhi/Contraction/policies/First_vertex_placement.h b/include/gudhi/Contraction/policies/First_vertex_placement.h
index 1f68db0d..0b9f8775 100644
--- a/include/gudhi/Contraction/policies/First_vertex_placement.h
+++ b/include/gudhi/Contraction/policies/First_vertex_placement.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/include/gudhi/Contraction/policies/Link_condition_valid_contraction.h b/include/gudhi/Contraction/policies/Link_condition_valid_contraction.h
index 250bba27..8c869830 100644
--- a/include/gudhi/Contraction/policies/Link_condition_valid_contraction.h
+++ b/include/gudhi/Contraction/policies/Link_condition_valid_contraction.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/include/gudhi/Contraction/policies/Middle_placement.h b/include/gudhi/Contraction/policies/Middle_placement.h
index 4b59f1b5..0ba23a35 100644
--- a/include/gudhi/Contraction/policies/Middle_placement.h
+++ b/include/gudhi/Contraction/policies/Middle_placement.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/include/gudhi/Contraction/policies/Placement_policy.h b/include/gudhi/Contraction/policies/Placement_policy.h
index 34ffa49f..19509fad 100644
--- a/include/gudhi/Contraction/policies/Placement_policy.h
+++ b/include/gudhi/Contraction/policies/Placement_policy.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/include/gudhi/Contraction/policies/Valid_contraction_policy.h b/include/gudhi/Contraction/policies/Valid_contraction_policy.h
index 78d61173..8a91f0b5 100644
--- a/include/gudhi/Contraction/policies/Valid_contraction_policy.h
+++ b/include/gudhi/Contraction/policies/Valid_contraction_policy.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/include/gudhi/Debug_utils.h b/include/gudhi/Debug_utils.h
index 90d3cf47..3f5cb04f 100644
--- a/include/gudhi/Debug_utils.h
+++ b/include/gudhi/Debug_utils.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/include/gudhi/Edge_contraction.h b/include/gudhi/Edge_contraction.h
index cf9a2c27..fcd06996 100644
--- a/include/gudhi/Edge_contraction.h
+++ b/include/gudhi/Edge_contraction.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/include/gudhi/Euclidean_strong_witness_complex.h b/include/gudhi/Euclidean_strong_witness_complex.h
index 4f3cef4f..ea97cd3f 100644
--- a/include/gudhi/Euclidean_strong_witness_complex.h
+++ b/include/gudhi/Euclidean_strong_witness_complex.h
@@ -4,7 +4,7 @@
*
* Author(s): Siargey Kachanovich
*
- * Copyright (C) 2015 INRIA (France)
+ * Copyright (C) 2015 Inria
*
* 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
diff --git a/include/gudhi/Euclidean_witness_complex.h b/include/gudhi/Euclidean_witness_complex.h
index ff8bb139..1dacefa5 100644
--- a/include/gudhi/Euclidean_witness_complex.h
+++ b/include/gudhi/Euclidean_witness_complex.h
@@ -4,7 +4,7 @@
*
* Author(s): Siargey Kachanovich
*
- * Copyright (C) 2015 INRIA (France)
+ * Copyright (C) 2015 Inria
*
* 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
diff --git a/include/gudhi/GIC.h b/include/gudhi/GIC.h
index 40ff7a4a..7aa95210 100644
--- a/include/gudhi/GIC.h
+++ b/include/gudhi/GIC.h
@@ -4,7 +4,7 @@
*
* Author: Mathieu Carriere
*
- * Copyright (C) 2017 INRIA
+ * Copyright (C) 2017 Inria
*
* 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
@@ -23,6 +23,11 @@
#ifndef GIC_H_
#define GIC_H_
+#ifdef GUDHI_USE_TBB
+#include <tbb/parallel_for.h>
+#include <tbb/mutex.h>
+#endif
+
#include <gudhi/Debug_utils.h>
#include <gudhi/graph_simplicial_complex.h>
#include <gudhi/reader_utils.h>
@@ -99,9 +104,8 @@ class Cover_complex {
int data_dimension; // dimension of input data.
int n; // number of points.
- std::map<int, double> func; // function used to compute the output simplicial complex.
- std::map<int, double>
- func_color; // function used to compute the colors of the nodes of the output simplicial complex.
+ std::vector<double> func; // function used to compute the output simplicial complex.
+ std::vector<double> func_color; // function used to compute the colors of the nodes of the output simplicial complex.
bool functional_cover = false; // whether we use a cover with preimages of a function or not.
Graph one_skeleton_OFF; // one-skeleton given by the input OFF file (if it exists).
@@ -114,8 +118,8 @@ class Cover_complex {
Persistence_diagram PD;
std::vector<double> distribution;
- std::map<int, std::vector<int> >
- cover; // function associating to each data point its vectors of cover elements to which it belongs.
+ std::vector<std::vector<int> >
+ cover; // function associating to each data point the vector of cover elements to which it belongs.
std::map<int, std::vector<int> >
cover_back; // inverse of cover, in order to get the data points associated to a specific cover element.
std::map<int, double> cover_std; // standard function (induced by func) used to compute the extended persistence
@@ -138,28 +142,26 @@ class Cover_complex {
std::string point_cloud_name;
std::string color_name;
- // Point comparator
- struct Less {
- Less(std::map<int, double> func) { Fct = func; }
- std::map<int, double> Fct;
- bool operator()(int a, int b) {
- if (Fct[a] == Fct[b])
- return a < b;
- else
- return Fct[a] < Fct[b];
- }
- };
-
// Remove all edges of a graph.
void remove_edges(Graph& G) {
boost::graph_traits<Graph>::edge_iterator ei, ei_end;
for (boost::tie(ei, ei_end) = boost::edges(G); ei != ei_end; ++ei) boost::remove_edge(*ei, G);
}
+ // Thread local is not available on XCode version < V.8
+ // If not available, random engine is a class member.
+#ifndef GUDHI_CAN_USE_CXX11_THREAD_LOCAL
+ std::default_random_engine re;
+#endif // GUDHI_CAN_USE_CXX11_THREAD_LOCAL
+
// Find random number in [0,1].
double GetUniform() {
+ // Thread local is not available on XCode version < V.8
+ // If available, random engine is defined for each thread.
+#ifdef GUDHI_CAN_USE_CXX11_THREAD_LOCAL
thread_local std::default_random_engine re;
- thread_local std::uniform_real_distribution<double> Dist(0, 1);
+#endif // GUDHI_CAN_USE_CXX11_THREAD_LOCAL
+ std::uniform_real_distribution<double> Dist(0, 1);
return Dist(re);
}
@@ -276,6 +278,7 @@ class Cover_complex {
point_cloud.emplace_back(point.begin(), point.begin() + data_dimension);
boost::add_vertex(one_skeleton_OFF);
vertices.push_back(boost::add_vertex(one_skeleton));
+ cover.emplace_back();
i++;
}
}
@@ -422,7 +425,6 @@ class Cover_complex {
double set_graph_from_automatic_rips(Distance distance, int N = 100) {
int m = floor(n / std::exp((1 + rate_power) * std::log(std::log(n) / std::log(rate_constant))));
m = std::min(m, n - 1);
- std::vector<int> samples(m);
double delta = 0;
if (verbose) std::cout << n << " points in R^" << data_dimension << std::endl;
@@ -430,17 +432,36 @@ class Cover_complex {
if (distances.size() == 0) compute_pairwise_distances(distance);
- // #pragma omp parallel for
- for (int i = 0; i < N; i++) {
- SampleWithoutReplacement(n, m, samples);
- double hausdorff_dist = 0;
- for (int j = 0; j < n; j++) {
- double mj = distances[j][samples[0]];
- for (int k = 1; k < m; k++) mj = std::min(mj, distances[j][samples[k]]);
- hausdorff_dist = std::max(hausdorff_dist, mj);
+ // This cannot be parallelized if thread_local is not defined
+ // thread_local is not defined for XCode < v.8
+ #if defined(GUDHI_USE_TBB) && defined(GUDHI_CAN_USE_CXX11_THREAD_LOCAL)
+ tbb::mutex deltamutex;
+ tbb::parallel_for(0, N, [&](int i){
+ std::vector<int> samples(m);
+ SampleWithoutReplacement(n, m, samples);
+ double hausdorff_dist = 0;
+ for (int j = 0; j < n; j++) {
+ double mj = distances[j][samples[0]];
+ for (int k = 1; k < m; k++) mj = std::min(mj, distances[j][samples[k]]);
+ hausdorff_dist = std::max(hausdorff_dist, mj);
+ }
+ deltamutex.lock();
+ delta += hausdorff_dist / N;
+ deltamutex.unlock();
+ });
+ #else
+ for (int i = 0; i < N; i++) {
+ std::vector<int> samples(m);
+ SampleWithoutReplacement(n, m, samples);
+ double hausdorff_dist = 0;
+ for (int j = 0; j < n; j++) {
+ double mj = distances[j][samples[0]];
+ for (int k = 1; k < m; k++) mj = std::min(mj, distances[j][samples[k]]);
+ hausdorff_dist = std::max(hausdorff_dist, mj);
+ }
+ delta += hausdorff_dist / N;
}
- delta += hausdorff_dist / N;
- }
+ #endif
if (verbose) std::cout << "delta = " << delta << std::endl;
set_graph_from_rips(delta, distance);
@@ -465,7 +486,7 @@ class Cover_complex {
while (std::getline(input, line)) {
std::stringstream stream(line);
stream >> f;
- func.emplace(i, f);
+ func.push_back(f);
i++;
}
functional_cover = true;
@@ -479,7 +500,7 @@ class Cover_complex {
*
*/
void set_function_from_coordinate(int k) {
- for (int i = 0; i < n; i++) func.emplace(i, point_cloud[i][k]);
+ for (int i = 0; i < n; i++) func.push_back(point_cloud[i][k]);
functional_cover = true;
cover_name = "coordinate " + std::to_string(k);
}
@@ -492,7 +513,7 @@ class Cover_complex {
*/
template <class InputRange>
void set_function_from_range(InputRange const& function) {
- for (int i = 0; i < n; i++) func.emplace(i, function[i]);
+ for (int i = 0; i < n; i++) func.push_back(function[i]);
functional_cover = true;
}
@@ -654,7 +675,7 @@ class Cover_complex {
// Sort points according to function values
std::vector<int> points(n);
for (int i = 0; i < n; i++) points[i] = i;
- std::sort(points.begin(), points.end(), Less(this->func));
+ std::sort(points.begin(), points.end(), [=](const int & p1, const int & p2){return (this->func[p1] < this->func[p2]);});
int id = 0;
int pos = 0;
@@ -710,37 +731,74 @@ class Cover_complex {
funcstd[i] = 0.5 * (u + v);
}
- if (verbose) std::cout << "Computing connected components..." << std::endl;
- // #pragma omp parallel for
- for (int i = 0; i < res; i++) {
- // Compute connected components
- Graph G = one_skeleton.create_subgraph();
- int num = preimages[i].size();
- std::vector<int> component(num);
- for (int j = 0; j < num; j++) boost::add_vertex(index[vertices[preimages[i][j]]], G);
- boost::connected_components(G, &component[0]);
- int max = 0;
-
- // For each point in preimage
- for (int j = 0; j < num; j++) {
- // Update number of components in preimage
- if (component[j] > max) max = component[j];
-
- // Identify component with Cantor polynomial N^2 -> N
- int identifier = (std::pow(i + component[j], 2) + 3 * i + component[j]) / 2;
-
- // Update covers
- cover[preimages[i][j]].push_back(identifier);
- cover_back[identifier].push_back(preimages[i][j]);
- cover_fct[identifier] = i;
- cover_std[identifier] = funcstd[i];
- cover_color[identifier].second += func_color[preimages[i][j]];
- cover_color[identifier].first += 1;
- }
+ #ifdef GUDHI_USE_TBB
+ if (verbose) std::cout << "Computing connected components (parallelized)..." << std::endl;
+ tbb::mutex covermutex, idmutex;
+ tbb::parallel_for(0, res, [&](int i){
+ // Compute connected components
+ Graph G = one_skeleton.create_subgraph();
+ int num = preimages[i].size();
+ std::vector<int> component(num);
+ for (int j = 0; j < num; j++) boost::add_vertex(index[vertices[preimages[i][j]]], G);
+ boost::connected_components(G, &component[0]);
+ int max = 0;
+
+ // For each point in preimage
+ for (int j = 0; j < num; j++) {
+ // Update number of components in preimage
+ if (component[j] > max) max = component[j];
+
+ // Identify component with Cantor polynomial N^2 -> N
+ int identifier = ((i + component[j])*(i + component[j]) + 3 * i + component[j]) / 2;
+
+ // Update covers
+ covermutex.lock();
+ cover[preimages[i][j]].push_back(identifier);
+ cover_back[identifier].push_back(preimages[i][j]);
+ cover_fct[identifier] = i;
+ cover_std[identifier] = funcstd[i];
+ cover_color[identifier].second += func_color[preimages[i][j]];
+ cover_color[identifier].first += 1;
+ covermutex.unlock();
+ }
- // Maximal dimension is total number of connected components
- id += max + 1;
- }
+ // Maximal dimension is total number of connected components
+ idmutex.lock();
+ id += max + 1;
+ idmutex.unlock();
+ });
+ #else
+ if (verbose) std::cout << "Computing connected components..." << std::endl;
+ for (int i = 0; i < res; i++) {
+ // Compute connected components
+ Graph G = one_skeleton.create_subgraph();
+ int num = preimages[i].size();
+ std::vector<int> component(num);
+ for (int j = 0; j < num; j++) boost::add_vertex(index[vertices[preimages[i][j]]], G);
+ boost::connected_components(G, &component[0]);
+ int max = 0;
+
+ // For each point in preimage
+ for (int j = 0; j < num; j++) {
+ // Update number of components in preimage
+ if (component[j] > max) max = component[j];
+
+ // Identify component with Cantor polynomial N^2 -> N
+ int identifier = (std::pow(i + component[j], 2) + 3 * i + component[j]) / 2;
+
+ // Update covers
+ cover[preimages[i][j]].push_back(identifier);
+ cover_back[identifier].push_back(preimages[i][j]);
+ cover_fct[identifier] = i;
+ cover_std[identifier] = funcstd[i];
+ cover_color[identifier].second += func_color[preimages[i][j]];
+ cover_color[identifier].first += 1;
+ }
+
+ // Maximal dimension is total number of connected components
+ id += max + 1;
+ }
+ #endif
maximal_dim = id - 1;
for (std::map<int, std::pair<int, double> >::iterator iit = cover_color.begin(); iit != cover_color.end(); iit++)
@@ -803,24 +861,46 @@ class Cover_complex {
for (int j = 0; j < n; j++) mindist[j] = std::numeric_limits<double>::max();
// Compute the geodesic distances to subsamples with Dijkstra
- // #pragma omp parallel for
- for (int i = 0; i < m; i++) {
- if (verbose) std::cout << "Computing geodesic distances to seed " << i << "..." << std::endl;
- int seed = voronoi_subsamples[i];
- std::vector<double> dmap(n);
- boost::dijkstra_shortest_paths(
- one_skeleton, vertices[seed],
- boost::weight_map(weight).distance_map(boost::make_iterator_property_map(dmap.begin(), index)));
-
- for (int j = 0; j < n; j++)
- if (mindist[j] > dmap[j]) {
- mindist[j] = dmap[j];
- if (cover[j].size() == 0)
- cover[j].push_back(i);
- else
- cover[j][0] = i;
- }
- }
+ #ifdef GUDHI_USE_TBB
+ if (verbose) std::cout << "Computing geodesic distances (parallelized)..." << std::endl;
+ tbb::mutex coverMutex; tbb::mutex mindistMutex;
+ tbb::parallel_for(0, m, [&](int i){
+ int seed = voronoi_subsamples[i];
+ std::vector<double> dmap(n);
+ boost::dijkstra_shortest_paths(
+ one_skeleton, vertices[seed],
+ boost::weight_map(weight).distance_map(boost::make_iterator_property_map(dmap.begin(), index)));
+
+ coverMutex.lock(); mindistMutex.lock();
+ for (int j = 0; j < n; j++)
+ if (mindist[j] > dmap[j]) {
+ mindist[j] = dmap[j];
+ if (cover[j].size() == 0)
+ cover[j].push_back(i);
+ else
+ cover[j][0] = i;
+ }
+ coverMutex.unlock(); mindistMutex.unlock();
+ });
+ #else
+ for (int i = 0; i < m; i++) {
+ if (verbose) std::cout << "Computing geodesic distances to seed " << i << "..." << std::endl;
+ int seed = voronoi_subsamples[i];
+ std::vector<double> dmap(n);
+ boost::dijkstra_shortest_paths(
+ one_skeleton, vertices[seed],
+ boost::weight_map(weight).distance_map(boost::make_iterator_property_map(dmap.begin(), index)));
+
+ for (int j = 0; j < n; j++)
+ if (mindist[j] > dmap[j]) {
+ mindist[j] = dmap[j];
+ if (cover[j].size() == 0)
+ cover[j].push_back(i);
+ else
+ cover[j][0] = i;
+ }
+ }
+ #endif
for (int i = 0; i < n; i++) {
cover_back[cover[i][0]].push_back(i);
@@ -860,7 +940,7 @@ class Cover_complex {
while (std::getline(input, line)) {
std::stringstream stream(line);
stream >> f;
- func_color.emplace(i, f);
+ func_color.push_back(f);
i++;
}
color_name = color_file_name;
@@ -873,7 +953,7 @@ class Cover_complex {
*
*/
void set_color_from_coordinate(int k = 0) {
- for (int i = 0; i < n; i++) func_color[i] = point_cloud[i][k];
+ for (int i = 0; i < n; i++) func_color.push_back(point_cloud[i][k]);
color_name = "coordinate ";
color_name.append(std::to_string(k));
}
@@ -885,7 +965,7 @@ class Cover_complex {
*
*/
void set_color_from_vector(std::vector<double> color) {
- for (unsigned int i = 0; i < color.size(); i++) func_color[i] = color[i];
+ for (unsigned int i = 0; i < color.size(); i++) func_color.push_back(color[i]);
}
public: // Create a .dot file that can be compiled with neato to produce a .pdf file.
@@ -1039,45 +1119,29 @@ class Cover_complex {
minf = std::min(minf, it->second);
}
+ // Build filtration
for (auto const& simplex : simplices) {
- // Add a simplex and a cone on it
- std::vector<int> splx = simplex;
- splx.push_back(-2);
- st.insert_simplex_and_subfaces(splx);
+ std::vector<int> splx = simplex; splx.push_back(-2);
+ st.insert_simplex_and_subfaces(splx, -3);
}
- // Build filtration
- for (auto simplex : st.complex_simplex_range()) {
- double filta = std::numeric_limits<double>::lowest();
- double filts = filta;
- bool ascending = true;
- for (auto vertex : st.simplex_vertex_range(simplex)) {
- if (vertex == -2) {
- ascending = false;
- continue;
- }
- filta = std::max(-2 + (cover_std[vertex] - minf) / (maxf - minf), filta);
- filts = std::max(2 - (cover_std[vertex] - minf) / (maxf - minf), filts);
- }
- if (ascending)
- st.assign_filtration(simplex, filta);
- else
- st.assign_filtration(simplex, filts);
+ for (std::map<int, double>::iterator it = cover_std.begin(); it != cover_std.end(); it++) {
+ int vertex = it->first; float val = it->second;
+ int vert[] = {vertex}; int edge[] = {vertex, -2};
+ st.assign_filtration(st.find(vert), -2 + (val - minf)/(maxf - minf));
+ st.assign_filtration(st.find(edge), 2 - (val - minf)/(maxf - minf));
}
- int magic[] = {-2};
- st.assign_filtration(st.find(magic), -3);
+ st.make_filtration_non_decreasing();
// Compute PD
- st.initialize_filtration();
- Gudhi::persistent_cohomology::Persistent_cohomology<Simplex_tree, Gudhi::persistent_cohomology::Field_Zp> pcoh(st);
- pcoh.init_coefficients(2);
+ Gudhi::persistent_cohomology::Persistent_cohomology<Simplex_tree, Gudhi::persistent_cohomology::Field_Zp> pcoh(st); pcoh.init_coefficients(2);
pcoh.compute_persistent_cohomology();
// Output PD
int max_dim = st.dimension();
for (int i = 0; i < max_dim; i++) {
std::vector<std::pair<double, double> > bars = pcoh.intervals_in_dimension(i);
- int num_bars = bars.size();
+ int num_bars = bars.size(); if(i == 0) num_bars -= 1;
if(verbose) std::cout << num_bars << " interval(s) in dimension " << i << ":" << std::endl;
for (int j = 0; j < num_bars; j++) {
double birth = bars[j].first;
@@ -1103,22 +1167,25 @@ class Cover_complex {
* @param[in] N number of bootstrap iterations.
*
*/
- template <typename SimplicialComplex>
- void compute_distribution(int N = 100) {
- if (distribution.size() >= N) {
+ void compute_distribution(unsigned int N = 100) {
+ unsigned int sz = distribution.size();
+ if (sz >= N) {
std::cout << "Already done!" << std::endl;
} else {
- for (int i = 0; i < N - distribution.size(); i++) {
- Cover_complex Cboot;
- Cboot.n = this->n;
+ for (unsigned int i = 0; i < N - sz; i++) {
+ if (verbose) std::cout << "Computing " << i << "th bootstrap, bottleneck distance = ";
+
+ Cover_complex Cboot; Cboot.n = this->n; Cboot.data_dimension = this->data_dimension; Cboot.type = this->type; Cboot.functional_cover = true;
+
std::vector<int> boot(this->n);
for (int j = 0; j < this->n; j++) {
double u = GetUniform();
- int id = std::floor(u * (this->n));
- boot[j] = id;
- Cboot.point_cloud[j] = this->point_cloud[id];
- Cboot.func.emplace(j, this->func[id]);
+ int id = std::floor(u * (this->n)); boot[j] = id;
+ Cboot.point_cloud.push_back(this->point_cloud[id]); Cboot.cover.emplace_back(); Cboot.func.push_back(this->func[id]);
+ boost::add_vertex(Cboot.one_skeleton_OFF); Cboot.vertices.push_back(boost::add_vertex(Cboot.one_skeleton));
}
+ Cboot.set_color_from_vector(Cboot.func);
+
for (int j = 0; j < n; j++) {
std::vector<double> dist(n);
for (int k = 0; k < n; k++) dist[k] = distances[boot[j]][boot[k]];
@@ -1131,8 +1198,9 @@ class Cover_complex {
Cboot.set_cover_from_function();
Cboot.find_simplices();
Cboot.compute_PD();
-
- distribution.push_back(Gudhi::persistence_diagram::bottleneck_distance(this->PD, Cboot.PD));
+ double db = Gudhi::persistence_diagram::bottleneck_distance(this->PD, Cboot.PD);
+ if (verbose) std::cout << db << std::endl;
+ distribution.push_back(db);
}
std::sort(distribution.begin(), distribution.end());
@@ -1146,7 +1214,7 @@ class Cover_complex {
*
*/
double compute_distance_from_confidence_level(double alpha) {
- int N = distribution.size();
+ unsigned int N = distribution.size();
return distribution[std::floor(alpha * N)];
}
@@ -1157,9 +1225,11 @@ class Cover_complex {
*
*/
double compute_confidence_level_from_distance(double d) {
- int N = distribution.size();
- for (int i = 0; i < N; i++)
- if (distribution[i] > d) return i * 1.0 / N;
+ unsigned int N = distribution.size();
+ double level = 1;
+ for (unsigned int i = 0; i < N; i++)
+ if (distribution[i] > d){ level = i * 1.0 / N; break; }
+ return level;
}
public:
@@ -1171,7 +1241,9 @@ class Cover_complex {
double distancemin = -std::numeric_limits<double>::lowest();
int N = PD.size();
for (int i = 0; i < N; i++) distancemin = std::min(distancemin, 0.5 * (PD[i].second - PD[i].first));
- return 1 - compute_confidence_level_from_distance(distancemin);
+ double p_value = 1 - compute_confidence_level_from_distance(distancemin);
+ if (verbose) std::cout << "p value = " << p_value << std::endl;
+ return p_value;
}
// *******************************************************************************************************************
@@ -1206,8 +1278,7 @@ class Cover_complex {
}
if (type == "Nerve") {
- for(auto& simplex : cover)
- simplices.push_back(simplex.second);
+ for(int i = 0; i < n; i++) simplices.push_back(cover[i]);
std::sort(simplices.begin(), simplices.end());
std::vector<std::vector<int> >::iterator it = std::unique(simplices.begin(), simplices.end());
simplices.resize(std::distance(simplices.begin(), it));
diff --git a/include/gudhi/Graph_matching.h b/include/gudhi/Graph_matching.h
index f51e22e9..313e7d9c 100644
--- a/include/gudhi/Graph_matching.h
+++ b/include/gudhi/Graph_matching.h
@@ -4,7 +4,7 @@
*
* Author: Francois Godi
*
- * Copyright (C) 2015 INRIA
+ * Copyright (C) 2015 Inria
*
* 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
diff --git a/include/gudhi/Hasse_complex.h b/include/gudhi/Hasse_complex.h
index e67f7609..efcaea55 100644
--- a/include/gudhi/Hasse_complex.h
+++ b/include/gudhi/Hasse_complex.h
@@ -4,7 +4,7 @@
*
* Author(s): Clément Maria
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Méditerranée (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/include/gudhi/Internal_point.h b/include/gudhi/Internal_point.h
index 0b2d26fe..7f350f64 100644
--- a/include/gudhi/Internal_point.h
+++ b/include/gudhi/Internal_point.h
@@ -4,7 +4,7 @@
*
* Author: Francois Godi
*
- * Copyright (C) 2015 INRIA
+ * Copyright (C) 2015 Inria
*
* 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
diff --git a/include/gudhi/Kd_tree_search.h b/include/gudhi/Kd_tree_search.h
index 96bbeb36..ad1054e5 100644
--- a/include/gudhi/Kd_tree_search.h
+++ b/include/gudhi/Kd_tree_search.h
@@ -4,7 +4,7 @@
*
* Author(s): Clement Jamin
*
- * Copyright (C) 2016 INRIA
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/include/gudhi/Miniball.COPYRIGHT b/include/gudhi/Miniball.COPYRIGHT
new file mode 100644
index 00000000..dbe4c553
--- /dev/null
+++ b/include/gudhi/Miniball.COPYRIGHT
@@ -0,0 +1,4 @@
+The miniball software is available under the GNU General Public License (GPLv3 - https://www.gnu.org/copyleft/gpl.html).
+If your intended use is not compliant with this license, please buy a commercial license (EUR 500 - https://people.inf.ethz.ch/gaertner/subdir/software/miniball/license.html).
+You need a license if the software that you develop using Miniball V3.0 is not open source.
+
diff --git a/include/gudhi/Miniball.README b/include/gudhi/Miniball.README
new file mode 100644
index 00000000..033d8953
--- /dev/null
+++ b/include/gudhi/Miniball.README
@@ -0,0 +1,26 @@
+https://people.inf.ethz.ch/gaertner/subdir/software/miniball.html
+
+Smallest Enclosing Balls of Points - Fast and Robust in C++.
+(high-quality software for smallest enclosing balls of balls is available in the computational geometry algorithms library CGAL)
+
+
+This is the miniball software (V3.0) for computing smallest enclosing balls of points in arbitrary dimensions. It consists of a C++ header file Miniball.hpp (around 500 lines of code) and two example programs miniball_example.cpp and miniball_example_containers.cpp that demonstrate the usage. The first example stores the coordinates of the input points in a two-dimensional array, the second example uses a list of vectors to show how generic containers can be used.
+
+Credits: Aditya Gupta and Alexandros Konstantinakis-Karmis have significantly contributed to this version of the software.
+
+Changes - https://people.inf.ethz.ch/gaertner/subdir/software/miniball/changes.txt - from previous versions.
+
+The theory - https://people.inf.ethz.ch/gaertner/subdir/texts/own_work/esa99_final.pdf - behind the miniball software (Proc. 7th Annual European Symposium on Algorithms (ESA), Lecture Notes in Computer Science 1643, Springer-Verlag, pp.325-338, 1999).
+
+Main Features:
+
+ Very fast in low dimensions. 1 million points in 5-space are processed within 0.05 seconds on any recent machine.
+
+ High numerical stability. Almost all input degeneracies (cospherical points, multiple points, points very close together) are routinely handled.
+
+ Easily integrates into your code. You can freely choose the coordinate type of your points and the container to store the points. If you still need to adapt the code, the header is small and readable and contains documentation for all major methods.
+
+
+Changes done for the GUDHI version of MiniBall:
+ - Add include guard
+ - Move Miniball namespace inside a new Gudhi namespace
diff --git a/include/gudhi/Miniball.hpp b/include/gudhi/Miniball.hpp
new file mode 100644
index 00000000..ce6cbb5b
--- /dev/null
+++ b/include/gudhi/Miniball.hpp
@@ -0,0 +1,523 @@
+// Copright (C) 1999-2013, Bernd Gaertner
+// $Rev: 3581 $
+//
+// 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/>.
+//
+// Contact:
+// --------
+// Bernd Gaertner
+// Institute of Theoretical Computer Science
+// ETH Zuerich
+// CAB G31.1
+// CH-8092 Zuerich, Switzerland
+// http://www.inf.ethz.ch/personal/gaertner
+
+#ifndef MINIBALL_HPP_
+#define MINIBALL_HPP_
+
+#include <cassert>
+#include <algorithm>
+#include <list>
+#include <ctime>
+#include <limits>
+
+namespace Gudhi {
+
+namespace Miniball {
+
+ // Global Functions
+ // ================
+ template <typename NT>
+ inline NT mb_sqr (NT r) {return r*r;}
+
+ // Functors
+ // ========
+
+ // functor to map a point iterator to the corresponding coordinate iterator;
+ // generic version for points whose coordinate containers have begin()
+ template < typename Pit_, typename Cit_ >
+ struct CoordAccessor {
+ typedef Pit_ Pit;
+ typedef Cit_ Cit;
+ inline Cit operator() (Pit it) const { return (*it).begin(); }
+ };
+
+ // partial specialization for points whose coordinate containers are arrays
+ template < typename Pit_, typename Cit_ >
+ struct CoordAccessor<Pit_, Cit_*> {
+ typedef Pit_ Pit;
+ typedef Cit_* Cit;
+ inline Cit operator() (Pit it) const { return *it; }
+ };
+
+ // Class Declaration
+ // =================
+
+ template <typename CoordAccessor>
+ class Miniball {
+ private:
+ // types
+ // The iterator type to go through the input points
+ typedef typename CoordAccessor::Pit Pit;
+ // The iterator type to go through the coordinates of a single point.
+ typedef typename CoordAccessor::Cit Cit;
+ // The coordinate type
+ typedef typename std::iterator_traits<Cit>::value_type NT;
+ // The iterator to go through the support points
+ typedef typename std::list<Pit>::iterator Sit;
+
+ // data members...
+ const int d; // dimension
+ Pit points_begin;
+ Pit points_end;
+ CoordAccessor coord_accessor;
+ double time;
+ const NT nt0; // NT(0)
+
+ //...for the algorithms
+ std::list<Pit> L;
+ Sit support_end;
+ int fsize; // number of forced points
+ int ssize; // number of support points
+
+ // ...for the ball updates
+ NT* current_c;
+ NT current_sqr_r;
+ NT** c;
+ NT* sqr_r;
+
+ // helper arrays
+ NT* q0;
+ NT* z;
+ NT* f;
+ NT** v;
+ NT** a;
+
+ public:
+ // The iterator type to go through the support points
+ typedef typename std::list<Pit>::const_iterator SupportPointIterator;
+
+ // PRE: [begin, end) is a nonempty range
+ // POST: computes the smallest enclosing ball of the points in the range
+ // [begin, end); the functor a maps a point iterator to an iterator
+ // through the d coordinates of the point
+ Miniball (int d_, Pit begin, Pit end, CoordAccessor ca = CoordAccessor());
+
+ // POST: returns a pointer to the first element of an array that holds
+ // the d coordinates of the center of the computed ball
+ const NT* center () const;
+
+ // POST: returns the squared radius of the computed ball
+ NT squared_radius () const;
+
+ // POST: returns the number of support points of the computed ball;
+ // the support points form a minimal set with the same smallest
+ // enclosing ball as the input set; in particular, the support
+ // points are on the boundary of the computed ball, and their
+ // number is at most d+1
+ int nr_support_points () const;
+
+ // POST: returns an iterator to the first support point
+ SupportPointIterator support_points_begin () const;
+
+ // POST: returns a past-the-end iterator for the range of support points
+ SupportPointIterator support_points_end () const;
+
+ // POST: returns the maximum excess of any input point w.r.t. the computed
+ // ball, divided by the squared radius of the computed ball. The
+ // excess of a point is the difference between its squared distance
+ // from the center and the squared radius; Ideally, the return value
+ // is 0. subopt is set to the absolute value of the most negative
+ // coefficient in the affine combination of the support points that
+ // yields the center. Ideally, this is a convex combination, and there
+ // is no negative coefficient in which case subopt is set to 0.
+ NT relative_error (NT& subopt) const;
+
+ // POST: return true if the relative error is at most tol, and the
+ // suboptimality is 0; the default tolerance is 10 times the
+ // coordinate type's machine epsilon
+ bool is_valid (NT tol = NT(10) * std::numeric_limits<NT>::epsilon()) const;
+
+ // POST: returns the time in seconds taken by the constructor call for
+ // computing the smallest enclosing ball
+ double get_time() const;
+
+ // POST: deletes dynamically allocated arrays
+ ~Miniball();
+
+ private:
+ void mtf_mb (Sit n);
+ void mtf_move_to_front (Sit j);
+ void pivot_mb (Pit n);
+ void pivot_move_to_front (Pit j);
+ NT excess (Pit pit) const;
+ void pop ();
+ bool push (Pit pit);
+ NT suboptimality () const;
+ void create_arrays();
+ void delete_arrays();
+ };
+
+ // Class Definition
+ // ================
+ template <typename CoordAccessor>
+ Miniball<CoordAccessor>::Miniball (int d_, Pit begin, Pit end,
+ CoordAccessor ca)
+ : d (d_),
+ points_begin (begin),
+ points_end (end),
+ coord_accessor (ca),
+ time (clock()),
+ nt0 (NT(0)),
+ L(),
+ support_end (L.begin()),
+ fsize(0),
+ ssize(0),
+ current_c (NULL),
+ current_sqr_r (NT(-1)),
+ c (NULL),
+ sqr_r (NULL),
+ q0 (NULL),
+ z (NULL),
+ f (NULL),
+ v (NULL),
+ a (NULL)
+ {
+ assert (points_begin != points_end);
+ create_arrays();
+
+ // set initial center
+ for (int j=0; j<d; ++j) c[0][j] = nt0;
+ current_c = c[0];
+
+ // compute miniball
+ pivot_mb (points_end);
+
+ // update time
+ time = (clock() - time) / CLOCKS_PER_SEC;
+ }
+
+ template <typename CoordAccessor>
+ Miniball<CoordAccessor>::~Miniball()
+ {
+ delete_arrays();
+ }
+
+ template <typename CoordAccessor>
+ void Miniball<CoordAccessor>::create_arrays()
+ {
+ c = new NT*[d+1];
+ v = new NT*[d+1];
+ a = new NT*[d+1];
+ for (int i=0; i<d+1; ++i) {
+ c[i] = new NT[d];
+ v[i] = new NT[d];
+ a[i] = new NT[d];
+ }
+ sqr_r = new NT[d+1];
+ q0 = new NT[d];
+ z = new NT[d+1];
+ f = new NT[d+1];
+ }
+
+ template <typename CoordAccessor>
+ void Miniball<CoordAccessor>::delete_arrays()
+ {
+ delete[] f;
+ delete[] z;
+ delete[] q0;
+ delete[] sqr_r;
+ for (int i=0; i<d+1; ++i) {
+ delete[] a[i];
+ delete[] v[i];
+ delete[] c[i];
+ }
+ delete[] a;
+ delete[] v;
+ delete[] c;
+ }
+
+ template <typename CoordAccessor>
+ const typename Miniball<CoordAccessor>::NT*
+ Miniball<CoordAccessor>::center () const
+ {
+ return current_c;
+ }
+
+ template <typename CoordAccessor>
+ typename Miniball<CoordAccessor>::NT
+ Miniball<CoordAccessor>::squared_radius () const
+ {
+ return current_sqr_r;
+ }
+
+ template <typename CoordAccessor>
+ int Miniball<CoordAccessor>::nr_support_points () const
+ {
+ assert (ssize < d+2);
+ return ssize;
+ }
+
+ template <typename CoordAccessor>
+ typename Miniball<CoordAccessor>::SupportPointIterator
+ Miniball<CoordAccessor>::support_points_begin () const
+ {
+ return L.begin();
+ }
+
+ template <typename CoordAccessor>
+ typename Miniball<CoordAccessor>::SupportPointIterator
+ Miniball<CoordAccessor>::support_points_end () const
+ {
+ return support_end;
+ }
+
+ template <typename CoordAccessor>
+ typename Miniball<CoordAccessor>::NT
+ Miniball<CoordAccessor>::relative_error (NT& subopt) const
+ {
+ NT e, max_e = nt0;
+ // compute maximum absolute excess of support points
+ for (SupportPointIterator it = support_points_begin();
+ it != support_points_end(); ++it) {
+ e = excess (*it);
+ if (e < nt0) e = -e;
+ if (e > max_e) {
+ max_e = e;
+ }
+ }
+ // compute maximum excess of any point
+ for (Pit i = points_begin; i != points_end; ++i)
+ if ((e = excess (i)) > max_e)
+ max_e = e;
+
+ subopt = suboptimality();
+ assert (current_sqr_r > nt0 || max_e == nt0);
+ return (current_sqr_r == nt0 ? nt0 : max_e / current_sqr_r);
+ }
+
+ template <typename CoordAccessor>
+ bool Miniball<CoordAccessor>::is_valid (NT tol) const
+ {
+ NT suboptimality;
+ return ( (relative_error (suboptimality) <= tol) && (suboptimality == 0) );
+ }
+
+ template <typename CoordAccessor>
+ double Miniball<CoordAccessor>::get_time() const
+ {
+ return time;
+ }
+
+ template <typename CoordAccessor>
+ void Miniball<CoordAccessor>::mtf_mb (Sit n)
+ {
+ // Algorithm 1: mtf_mb (L_{n-1}, B), where L_{n-1} = [L.begin, n)
+ // B: the set of forced points, defining the current ball
+ // S: the superset of support points computed by the algorithm
+ // --------------------------------------------------------------
+ // from B. Gaertner, Fast and Robust Smallest Enclosing Balls, ESA 1999,
+ // http://www.inf.ethz.ch/personal/gaertner/texts/own_work/esa99_final.pdf
+
+ // PRE: B = S
+ assert (fsize == ssize);
+
+ support_end = L.begin();
+ if ((fsize) == d+1) return;
+
+ // incremental construction
+ for (Sit i = L.begin(); i != n;)
+ {
+ // INV: (support_end - L.begin() == |S|-|B|)
+ assert (std::distance (L.begin(), support_end) == ssize - fsize);
+
+ Sit j = i++;
+ if (excess(*j) > nt0)
+ if (push(*j)) { // B := B + p_i
+ mtf_mb (j); // mtf_mb (L_{i-1}, B + p_i)
+ pop(); // B := B - p_i
+ mtf_move_to_front(j);
+ }
+ }
+ // POST: the range [L.begin(), support_end) stores the set S\B
+ }
+
+ template <typename CoordAccessor>
+ void Miniball<CoordAccessor>::mtf_move_to_front (Sit j)
+ {
+ if (support_end == j)
+ support_end++;
+ L.splice (L.begin(), L, j);
+ }
+
+ template <typename CoordAccessor>
+ void Miniball<CoordAccessor>::pivot_mb (Pit n)
+ {
+ // Algorithm 2: pivot_mb (L_{n-1}), where L_{n-1} = [L.begin, n)
+ // --------------------------------------------------------------
+ // from B. Gaertner, Fast and Robust Smallest Enclosing Balls, ESA 1999,
+ // http://www.inf.ethz.ch/personal/gaertner/texts/own_work/esa99_final.pdf
+ NT old_sqr_r;
+ const NT* c;
+ Pit pivot, k;
+ NT e, max_e, sqr_r;
+ Cit p;
+ do {
+ old_sqr_r = current_sqr_r;
+ sqr_r = current_sqr_r;
+
+ pivot = points_begin;
+ max_e = nt0;
+ for (k = points_begin; k != n; ++k) {
+ p = coord_accessor(k);
+ e = -sqr_r;
+ c = current_c;
+ for (int j=0; j<d; ++j)
+ e += mb_sqr<NT>(*p++-*c++);
+ if (e > max_e) {
+ max_e = e;
+ pivot = k;
+ }
+ }
+
+ if (max_e > nt0) {
+ // check if the pivot is already contained in the support set
+ if (std::find(L.begin(), support_end, pivot) == support_end) {
+ assert (fsize == 0);
+ if (push (pivot)) {
+ mtf_mb(support_end);
+ pop();
+ pivot_move_to_front(pivot);
+ }
+ }
+ }
+ } while (old_sqr_r < current_sqr_r);
+ }
+
+ template <typename CoordAccessor>
+ void Miniball<CoordAccessor>::pivot_move_to_front (Pit j)
+ {
+ L.push_front(j);
+ if (std::distance(L.begin(), support_end) == d+2)
+ support_end--;
+ }
+
+ template <typename CoordAccessor>
+ inline typename Miniball<CoordAccessor>::NT
+ Miniball<CoordAccessor>::excess (Pit pit) const
+ {
+ Cit p = coord_accessor(pit);
+ NT e = -current_sqr_r;
+ NT* c = current_c;
+ for (int k=0; k<d; ++k){
+ e += mb_sqr<NT>(*p++-*c++);
+ }
+ return e;
+ }
+
+ template <typename CoordAccessor>
+ void Miniball<CoordAccessor>::pop ()
+ {
+ --fsize;
+ }
+
+ template <typename CoordAccessor>
+ bool Miniball<CoordAccessor>::push (Pit pit)
+ {
+ int i, j;
+ NT eps = mb_sqr<NT>(std::numeric_limits<NT>::epsilon());
+
+ Cit cit = coord_accessor(pit);
+ Cit p = cit;
+
+ if (fsize==0) {
+ for (i=0; i<d; ++i)
+ q0[i] = *p++;
+ for (i=0; i<d; ++i)
+ c[0][i] = q0[i];
+ sqr_r[0] = nt0;
+ }
+ else {
+ // set v_fsize to Q_fsize
+ for (i=0; i<d; ++i)
+ //v[fsize][i] = p[i]-q0[i];
+ v[fsize][i] = *p++-q0[i];
+
+ // compute the a_{fsize,i}, i< fsize
+ for (i=1; i<fsize; ++i) {
+ a[fsize][i] = nt0;
+ for (j=0; j<d; ++j)
+ a[fsize][i] += v[i][j] * v[fsize][j];
+ a[fsize][i]*=(2/z[i]);
+ }
+
+ // update v_fsize to Q_fsize-\bar{Q}_fsize
+ for (i=1; i<fsize; ++i) {
+ for (j=0; j<d; ++j)
+ v[fsize][j] -= a[fsize][i]*v[i][j];
+ }
+
+ // compute z_fsize
+ z[fsize]=nt0;
+ for (j=0; j<d; ++j)
+ z[fsize] += mb_sqr<NT>(v[fsize][j]);
+ z[fsize]*=2;
+
+ // reject push if z_fsize too small
+ if (z[fsize]<eps*current_sqr_r) {
+ return false;
+ }
+
+ // update c, sqr_r
+ p=cit;
+ NT e = -sqr_r[fsize-1];
+ for (i=0; i<d; ++i)
+ e += mb_sqr<NT>(*p++-c[fsize-1][i]);
+ f[fsize]=e/z[fsize];
+
+ for (i=0; i<d; ++i)
+ c[fsize][i] = c[fsize-1][i]+f[fsize]*v[fsize][i];
+ sqr_r[fsize] = sqr_r[fsize-1] + e*f[fsize]/2;
+ }
+ current_c = c[fsize];
+ current_sqr_r = sqr_r[fsize];
+ ssize = ++fsize;
+ return true;
+ }
+
+ template <typename CoordAccessor>
+ typename Miniball<CoordAccessor>::NT
+ Miniball<CoordAccessor>::suboptimality () const
+ {
+ NT* l = new NT[d+1];
+ NT min_l = nt0;
+ l[0] = NT(1);
+ for (int i=ssize-1; i>0; --i) {
+ l[i] = f[i];
+ for (int k=ssize-1; k>i; --k)
+ l[i]-=a[k][i]*l[k];
+ if (l[i] < min_l) min_l = l[i];
+ l[0] -= l[i];
+ }
+ if (l[0] < min_l) min_l = l[0];
+ delete[] l;
+ if (min_l < nt0)
+ return -min_l;
+ return nt0;
+ }
+} // namespace Miniball
+
+} // namespace Gudhi
+
+#endif // MINIBALL_HPP_
diff --git a/include/gudhi/Neighbors_finder.h b/include/gudhi/Neighbors_finder.h
index 87c7cee5..36a63ea0 100644
--- a/include/gudhi/Neighbors_finder.h
+++ b/include/gudhi/Neighbors_finder.h
@@ -4,7 +4,7 @@
*
* Author: Francois Godi
*
- * Copyright (C) 2015 INRIA
+ * Copyright (C) 2015 Inria
*
* 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
diff --git a/include/gudhi/Null_output_iterator.h b/include/gudhi/Null_output_iterator.h
index 42e6e449..c700af5f 100644
--- a/include/gudhi/Null_output_iterator.h
+++ b/include/gudhi/Null_output_iterator.h
@@ -4,7 +4,7 @@
*
* Author(s): Marc Glisse
*
- * Copyright (C) 2017 INRIA
+ * Copyright (C) 2017 Inria
*
* 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
diff --git a/include/gudhi/Off_reader.h b/include/gudhi/Off_reader.h
index 4fcd2af2..05a1e145 100644
--- a/include/gudhi/Off_reader.h
+++ b/include/gudhi/Off_reader.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France)
+ * Copyright (C) 2014 Inria
*
* 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
@@ -105,25 +105,26 @@ class Off_reader {
bool is_off_file = (line.find("OFF") != std::string::npos);
bool is_noff_file = (line.find("nOFF") != std::string::npos);
+
+
if (!is_off_file && !is_noff_file) {
std::cerr << line << std::endl;
std::cerr << "missing off header\n";
return false;
}
+ if (is_noff_file) {
+ // Should be on a separate line, but we accept it on the same line as the number of vertices
+ stream_ >> off_info_.dim;
+ } else {
+ off_info_.dim = 3;
+ }
+
if (!goto_next_uncomment_line(line)) return false;
std::istringstream iss(line);
- if ((is_off_file) && (!is_noff_file)) {
- off_info_.dim = 3;
- if (!(iss >> off_info_.num_vertices >> off_info_.num_faces >> off_info_.num_edges)) {
- std::cerr << "incorrect number of vertices/faces/edges\n";
- return false;
- }
- } else {
- if (!(iss >> off_info_.dim >> off_info_.num_vertices >> off_info_.num_faces >> off_info_.num_edges)) {
+ if (!(iss >> off_info_.num_vertices >> off_info_.num_faces >> off_info_.num_edges)) {
std::cerr << "incorrect number of vertices/faces/edges\n";
return false;
- }
}
off_visitor.init(off_info_.dim, off_info_.num_vertices, off_info_.num_faces, off_info_.num_edges);
@@ -131,10 +132,12 @@ class Off_reader {
}
bool goto_next_uncomment_line(std::string& uncomment_line) {
- uncomment_line.clear();
- do
- std::getline(stream_, uncomment_line); while (uncomment_line[0] == '%');
- return (uncomment_line.size() > 0 && uncomment_line[0] != '%');
+ do {
+ // skip whitespace, including empty lines
+ if (!std::ifstream::sentry(stream_)) return false;
+ std::getline(stream_, uncomment_line);
+ } while (uncomment_line[0] == '#');
+ return static_cast<bool>(stream_);
}
template<typename OffVisitor>
diff --git a/include/gudhi/PSSK.h b/include/gudhi/PSSK.h
index 630f5623..e1174455 100644
--- a/include/gudhi/PSSK.h
+++ b/include/gudhi/PSSK.h
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/include/gudhi/Persistence_graph.h b/include/gudhi/Persistence_graph.h
index 622b0691..cb163623 100644
--- a/include/gudhi/Persistence_graph.h
+++ b/include/gudhi/Persistence_graph.h
@@ -4,7 +4,7 @@
*
* Author: Francois Godi
*
- * Copyright (C) 2015 INRIA
+ * Copyright (C) 2015 Inria
*
* 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
diff --git a/include/gudhi/Persistence_heat_maps.h b/include/gudhi/Persistence_heat_maps.h
index a80c3c40..35e51e63 100644
--- a/include/gudhi/Persistence_heat_maps.h
+++ b/include/gudhi/Persistence_heat_maps.h
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/include/gudhi/Persistence_intervals.h b/include/gudhi/Persistence_intervals.h
index 3d04d8b7..76eac7d7 100644
--- a/include/gudhi/Persistence_intervals.h
+++ b/include/gudhi/Persistence_intervals.h
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/include/gudhi/Persistence_intervals_with_distances.h b/include/gudhi/Persistence_intervals_with_distances.h
index 79908883..f48d1a3b 100644
--- a/include/gudhi/Persistence_intervals_with_distances.h
+++ b/include/gudhi/Persistence_intervals_with_distances.h
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/include/gudhi/Persistence_landscape.h b/include/gudhi/Persistence_landscape.h
index c5aa7867..9cab0166 100644
--- a/include/gudhi/Persistence_landscape.h
+++ b/include/gudhi/Persistence_landscape.h
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
@@ -734,7 +734,7 @@ double Persistence_landscape::compute_integral_of_landscape(double p) const {
double Persistence_landscape::compute_value_at_a_given_point(unsigned level, double x) const {
bool compute_value_at_a_given_pointDbg = false;
// in such a case lambda_level = 0.
- if (level > this->land.size()) return 0;
+ if (level >= this->land.size()) return 0;
// we know that the points in this->land[level] are ordered according to x coordinate. Therefore, we can find the
// point by using bisection:
@@ -1235,40 +1235,43 @@ double compute_inner_product(const Persistence_landscape& l1, const Persistence_
std::cerr << "Computing inner product for a level : " << level << std::endl;
getchar();
}
- if (l1.land[level].size() * l2.land[level].size() == 0) continue;
+ auto&& l1_land_level = l1.land[level];
+ auto&& l2_land_level = l2.land[level];
+
+ if (l1_land_level.size() * l2_land_level.size() == 0) continue;
// endpoints of the interval on which we will compute the inner product of two locally linear functions:
double x1 = -std::numeric_limits<int>::max();
double x2;
- if (l1.land[level][1].first < l2.land[level][1].first) {
- x2 = l1.land[level][1].first;
+ if (l1_land_level[1].first < l2_land_level[1].first) {
+ x2 = l1_land_level[1].first;
} else {
- x2 = l2.land[level][1].first;
+ x2 = l2_land_level[1].first;
}
// iterators for the landscapes l1 and l2
size_t l1It = 0;
size_t l2It = 0;
- while ((l1It < l1.land[level].size() - 1) && (l2It < l2.land[level].size() - 1)) {
+ while ((l1It < l1_land_level.size() - 1) && (l2It < l2_land_level.size() - 1)) {
// compute the value of a inner product on a interval [x1,x2]
double a, b, c, d;
- if (l1.land[level][l1It + 1].first != l1.land[level][l1It].first) {
- a = (l1.land[level][l1It + 1].second - l1.land[level][l1It].second) /
- (l1.land[level][l1It + 1].first - l1.land[level][l1It].first);
+ if (l1_land_level[l1It + 1].first != l1_land_level[l1It].first) {
+ a = (l1_land_level[l1It + 1].second - l1_land_level[l1It].second) /
+ (l1_land_level[l1It + 1].first - l1_land_level[l1It].first);
} else {
a = 0;
}
- b = l1.land[level][l1It].second - a * l1.land[level][l1It].first;
- if (l2.land[level][l2It + 1].first != l2.land[level][l2It].first) {
- c = (l2.land[level][l2It + 1].second - l2.land[level][l2It].second) /
- (l2.land[level][l2It + 1].first - l2.land[level][l2It].first);
+ b = l1_land_level[l1It].second - a * l1_land_level[l1It].first;
+ if (l2_land_level[l2It + 1].first != l2_land_level[l2It].first) {
+ c = (l2_land_level[l2It + 1].second - l2_land_level[l2It].second) /
+ (l2_land_level[l2It + 1].first - l2_land_level[l2It].first);
} else {
c = 0;
}
- d = l2.land[level][l2It].second - c * l2.land[level][l2It].first;
+ d = l2_land_level[l2It].second - c * l2_land_level[l2It].first;
double contributionFromThisPart = (a * c * x2 * x2 * x2 / 3 + (a * d + b * c) * x2 * x2 / 2 + b * d * x2) -
(a * c * x1 * x1 * x1 / 3 + (a * d + b * c) * x1 * x1 / 2 + b * d * x1);
@@ -1276,10 +1279,10 @@ double compute_inner_product(const Persistence_landscape& l1, const Persistence_
result += contributionFromThisPart;
if (dbg) {
- std::cerr << "[l1.land[level][l1It].first,l1.land[level][l1It+1].first] : " << l1.land[level][l1It].first
- << " , " << l1.land[level][l1It + 1].first << std::endl;
- std::cerr << "[l2.land[level][l2It].first,l2.land[level][l2It+1].first] : " << l2.land[level][l2It].first
- << " , " << l2.land[level][l2It + 1].first << std::endl;
+ std::cerr << "[l1_land_level[l1It].first,l1_land_level[l1It+1].first] : " << l1_land_level[l1It].first
+ << " , " << l1_land_level[l1It + 1].first << std::endl;
+ std::cerr << "[l2_land_level[l2It].first,l2_land_level[l2It+1].first] : " << l2_land_level[l2It].first
+ << " , " << l2_land_level[l2It + 1].first << std::endl;
std::cerr << "a : " << a << ", b : " << b << " , c: " << c << ", d : " << d << std::endl;
std::cerr << "x1 : " << x1 << " , x2 : " << x2 << std::endl;
std::cerr << "contributionFromThisPart : " << contributionFromThisPart << std::endl;
@@ -1288,14 +1291,14 @@ double compute_inner_product(const Persistence_landscape& l1, const Persistence_
}
// we have two intervals in which functions are constant:
- // [l1.land[level][l1It].first , l1.land[level][l1It+1].first]
+ // [l1_land_level[l1It].first , l1_land_level[l1It+1].first]
// and
- // [l2.land[level][l2It].first , l2.land[level][l2It+1].first]
+ // [l2_land_level[l2It].first , l2_land_level[l2It+1].first]
// We also have an interval [x1,x2]. Since the intervals in the landscapes cover the whole R, then it is clear
// that x2
- // is either l1.land[level][l1It+1].first of l2.land[level][l2It+1].first or both. Lets test it.
- if (x2 == l1.land[level][l1It + 1].first) {
- if (x2 == l2.land[level][l2It + 1].first) {
+ // is either l1_land_level[l1It+1].first of l2_land_level[l2It+1].first or both. Lets test it.
+ if (x2 == l1_land_level[l1It + 1].first) {
+ if (x2 == l2_land_level[l2It + 1].first) {
// in this case, we increment both:
++l2It;
if (dbg) {
@@ -1314,12 +1317,16 @@ double compute_inner_product(const Persistence_landscape& l1, const Persistence_
std::cerr << "Incrementing second \n";
}
}
+
+ if ( l1It + 1 >= l1_land_level.size() )break;
+ if ( l2It + 1 >= l2_land_level.size() )break;
+
// Now, we shift x1 and x2:
x1 = x2;
- if (l1.land[level][l1It + 1].first < l2.land[level][l2It + 1].first) {
- x2 = l1.land[level][l1It + 1].first;
+ if (l1_land_level[l1It + 1].first < l2_land_level[l2It + 1].first) {
+ x2 = l1_land_level[l1It + 1].first;
} else {
- x2 = l2.land[level][l2It + 1].first;
+ x2 = l2_land_level[l2It + 1].first;
}
}
}
diff --git a/include/gudhi/Persistence_landscape_on_grid.h b/include/gudhi/Persistence_landscape_on_grid.h
index 84fd22ed..fd8a181c 100644
--- a/include/gudhi/Persistence_landscape_on_grid.h
+++ b/include/gudhi/Persistence_landscape_on_grid.h
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/include/gudhi/Persistence_vectors.h b/include/gudhi/Persistence_vectors.h
index 63577e46..9c04be1d 100644
--- a/include/gudhi/Persistence_vectors.h
+++ b/include/gudhi/Persistence_vectors.h
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/include/gudhi/Persistent_cohomology.h b/include/gudhi/Persistent_cohomology.h
index e0a147b3..c68b5c0b 100644
--- a/include/gudhi/Persistent_cohomology.h
+++ b/include/gudhi/Persistent_cohomology.h
@@ -4,7 +4,7 @@
*
* Author(s): Clément Maria
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Méditerranée (France)
+ * Copyright (C) 2014 Inria
*
* 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
@@ -285,7 +285,7 @@ class Persistent_cohomology {
}
}
cpx_->assign_key(sigma, cpx_->null_key());
- } else { // If ku == kv, same connected component: create a 1-cocycle class.
+ } else if (dim_max_ > 1) { // If ku == kv, same connected component: create a 1-cocycle class.
create_cocycle(sigma, coeff_field_.multiplicative_identity(), coeff_field_.characteristic());
}
}
diff --git a/include/gudhi/Persistent_cohomology/Field_Zp.h b/include/gudhi/Persistent_cohomology/Field_Zp.h
index 6db16e69..e98b4bb4 100644
--- a/include/gudhi/Persistent_cohomology/Field_Zp.h
+++ b/include/gudhi/Persistent_cohomology/Field_Zp.h
@@ -4,7 +4,7 @@
*
* Author(s): Clément Maria
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Méditerranée (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/include/gudhi/Persistent_cohomology/Multi_field.h b/include/gudhi/Persistent_cohomology/Multi_field.h
index 38bc08d1..2bae8654 100644
--- a/include/gudhi/Persistent_cohomology/Multi_field.h
+++ b/include/gudhi/Persistent_cohomology/Multi_field.h
@@ -4,7 +4,7 @@
*
* Author(s): Clément Maria
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Méditerranée (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/include/gudhi/Persistent_cohomology/Persistent_cohomology_column.h b/include/gudhi/Persistent_cohomology/Persistent_cohomology_column.h
index 5deb2d88..de6c0750 100644
--- a/include/gudhi/Persistent_cohomology/Persistent_cohomology_column.h
+++ b/include/gudhi/Persistent_cohomology/Persistent_cohomology_column.h
@@ -4,7 +4,7 @@
*
* Author(s): Clément Maria
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Méditerranée (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/include/gudhi/Point.h b/include/gudhi/Point.h
index 0479e71e..345a8465 100644
--- a/include/gudhi/Point.h
+++ b/include/gudhi/Point.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/include/gudhi/Points_3D_off_io.h b/include/gudhi/Points_3D_off_io.h
index b0d24998..704f73a7 100644
--- a/include/gudhi/Points_3D_off_io.h
+++ b/include/gudhi/Points_3D_off_io.h
@@ -4,7 +4,7 @@
*
* Author(s): Vincent Rouvreau
*
- * Copyright (C) 2015 INRIA Saclay (France)
+ * Copyright (C) 2015 Inria
*
* 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
diff --git a/include/gudhi/Points_off_io.h b/include/gudhi/Points_off_io.h
index 29af8a8a..38029658 100644
--- a/include/gudhi/Points_off_io.h
+++ b/include/gudhi/Points_off_io.h
@@ -4,7 +4,7 @@
*
* Author(s): Vincent Rouvreau
*
- * Copyright (C) 2015 INRIA Saclay (France)
+ * Copyright (C) 2015 Inria
*
* 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
@@ -126,9 +126,9 @@ class Points_off_visitor_reader {
* \code $> ./vector_double_off_reader ../../data/points/alphacomplexdoc.off
* \endcode
*
- * the program output is:
+ * the program outputs a file ../../data/points/alphacomplexdoc.off.txt:
*
- * \include common/cgaloffreader_result.txt
+ * \include common/vectordoubleoffreader_result.txt
*/
template<typename Point_d>
class Points_off_reader {
diff --git a/include/gudhi/Rips_complex.h b/include/gudhi/Rips_complex.h
index 1e4b76a7..f0fe57f4 100644
--- a/include/gudhi/Rips_complex.h
+++ b/include/gudhi/Rips_complex.h
@@ -4,7 +4,7 @@
*
* Author(s): Clément Maria, Pawel Dlotko, Vincent Rouvreau
*
- * Copyright (C) 2016 INRIA
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/include/gudhi/Simple_object_pool.h b/include/gudhi/Simple_object_pool.h
index fb9c8e23..47283521 100644
--- a/include/gudhi/Simple_object_pool.h
+++ b/include/gudhi/Simple_object_pool.h
@@ -4,7 +4,7 @@
*
* Author(s): Marc Glisse
*
- * Copyright (C) 2015 INRIA Saclay - Ile de France
+ * Copyright (C) 2015 Inria
*
* 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
diff --git a/include/gudhi/Simplex_tree.h b/include/gudhi/Simplex_tree.h
index 7456cb1f..ee96d5a2 100644
--- a/include/gudhi/Simplex_tree.h
+++ b/include/gudhi/Simplex_tree.h
@@ -4,7 +4,7 @@
*
* Author(s): Clément Maria
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Méditerranée (France)
+ * Copyright (C) 2014 Inria
*
* 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
@@ -689,7 +689,11 @@ class Simplex_tree {
return { null_simplex(), true }; // ----->>
// Copy before sorting
- thread_local std::vector<Vertex_handle> copy;
+ // Thread local is not available on XCode version < V.8 - It will slow down computation
+#ifdef GUDHI_CAN_USE_CXX11_THREAD_LOCAL
+ thread_local
+#endif // GUDHI_CAN_USE_CXX11_THREAD_LOCAL
+ std::vector<Vertex_handle> copy;
copy.clear();
copy.insert(copy.end(), first, last);
std::sort(std::begin(copy), std::end(copy));
@@ -1238,9 +1242,8 @@ class Simplex_tree {
}
public:
- /** \brief Browse the simplex tree to ensure the filtration is not decreasing.
- * The simplex tree is browsed starting from the root until the leaf, and the filtration values are set with their
- * parent value (increased), in case the values are decreasing.
+ /** \brief This function ensures that each simplex has a higher filtration value than its faces by increasing the
+ * filtration values.
* @return The filtration modification information.
* \post Some simplex tree functions require the filtration to be valid. `make_filtration_non_decreasing()`
* function is not launching `initialize_filtration()` but returns the filtration modification information. If the
diff --git a/include/gudhi/Simplex_tree/Simplex_tree_iterators.h b/include/gudhi/Simplex_tree/Simplex_tree_iterators.h
index ab7346d4..02c8bb64 100644
--- a/include/gudhi/Simplex_tree/Simplex_tree_iterators.h
+++ b/include/gudhi/Simplex_tree/Simplex_tree_iterators.h
@@ -4,7 +4,7 @@
*
* Author(s): Clément Maria
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Méditerranée (France)
+ * Copyright (C) 2014 Inria
*
* 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
@@ -101,7 +101,9 @@ class Simplex_tree_boundary_simplex_iterator : public boost::iterator_facade<
// any end() iterator
explicit Simplex_tree_boundary_simplex_iterator(SimplexTree * st)
- : sib_(nullptr),
+ : last_(st->null_vertex()),
+ next_(st->null_vertex()),
+ sib_(nullptr),
sh_(st->null_simplex()),
st_(st) {
}
@@ -109,7 +111,9 @@ class Simplex_tree_boundary_simplex_iterator : public boost::iterator_facade<
template<class SimplexHandle>
Simplex_tree_boundary_simplex_iterator(SimplexTree * st, SimplexHandle sh)
: last_(sh->first),
+ next_(st->null_vertex()),
sib_(nullptr),
+ sh_(st->null_simplex()),
st_(st) {
// Only check once at the beginning instead of for every increment, as this is expensive.
if (SimplexTree::Options::contiguous_vertices)
@@ -123,9 +127,7 @@ class Simplex_tree_boundary_simplex_iterator : public boost::iterator_facade<
sh_ = sib_->members_.begin()+next_;
else
sh_ = sib_->find(next_);
- } else {
- sh_ = st->null_simplex();
- } // vertex: == end()
+ }
}
private:
diff --git a/include/gudhi/Simplex_tree/Simplex_tree_node_explicit_storage.h b/include/gudhi/Simplex_tree/Simplex_tree_node_explicit_storage.h
index 25d4888a..3a75ec72 100644
--- a/include/gudhi/Simplex_tree/Simplex_tree_node_explicit_storage.h
+++ b/include/gudhi/Simplex_tree/Simplex_tree_node_explicit_storage.h
@@ -4,7 +4,7 @@
*
* Author(s): Clément Maria
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Méditerranée (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/include/gudhi/Simplex_tree/Simplex_tree_siblings.h b/include/gudhi/Simplex_tree/Simplex_tree_siblings.h
index 1eca7f6f..ab2ca707 100644
--- a/include/gudhi/Simplex_tree/Simplex_tree_siblings.h
+++ b/include/gudhi/Simplex_tree/Simplex_tree_siblings.h
@@ -4,7 +4,7 @@
*
* Author(s): Clément Maria
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Méditerranée (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/include/gudhi/Simplex_tree/indexing_tag.h b/include/gudhi/Simplex_tree/indexing_tag.h
index 0adeb46d..ec4461f3 100644
--- a/include/gudhi/Simplex_tree/indexing_tag.h
+++ b/include/gudhi/Simplex_tree/indexing_tag.h
@@ -4,7 +4,7 @@
*
* Author(s): Clément Maria
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Méditerranée (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/include/gudhi/Skeleton_blocker.h b/include/gudhi/Skeleton_blocker.h
index aca2aa57..e8b6fde8 100644
--- a/include/gudhi/Skeleton_blocker.h
+++ b/include/gudhi/Skeleton_blocker.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/include/gudhi/Skeleton_blocker/Skeleton_blocker_complex_visitor.h b/include/gudhi/Skeleton_blocker/Skeleton_blocker_complex_visitor.h
index ba3636bc..6c6a8638 100644
--- a/include/gudhi/Skeleton_blocker/Skeleton_blocker_complex_visitor.h
+++ b/include/gudhi/Skeleton_blocker/Skeleton_blocker_complex_visitor.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/include/gudhi/Skeleton_blocker/Skeleton_blocker_link_superior.h b/include/gudhi/Skeleton_blocker/Skeleton_blocker_link_superior.h
index d4b60613..feab7b3f 100644
--- a/include/gudhi/Skeleton_blocker/Skeleton_blocker_link_superior.h
+++ b/include/gudhi/Skeleton_blocker/Skeleton_blocker_link_superior.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/include/gudhi/Skeleton_blocker/Skeleton_blocker_off_io.h b/include/gudhi/Skeleton_blocker/Skeleton_blocker_off_io.h
index 747e60f1..56009daf 100644
--- a/include/gudhi/Skeleton_blocker/Skeleton_blocker_off_io.h
+++ b/include/gudhi/Skeleton_blocker/Skeleton_blocker_off_io.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/include/gudhi/Skeleton_blocker/Skeleton_blocker_simple_geometric_traits.h b/include/gudhi/Skeleton_blocker/Skeleton_blocker_simple_geometric_traits.h
index 275376e6..22c1668e 100644
--- a/include/gudhi/Skeleton_blocker/Skeleton_blocker_simple_geometric_traits.h
+++ b/include/gudhi/Skeleton_blocker/Skeleton_blocker_simple_geometric_traits.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/include/gudhi/Skeleton_blocker/Skeleton_blocker_simple_traits.h b/include/gudhi/Skeleton_blocker/Skeleton_blocker_simple_traits.h
index 3835cf77..144f1fd0 100644
--- a/include/gudhi/Skeleton_blocker/Skeleton_blocker_simple_traits.h
+++ b/include/gudhi/Skeleton_blocker/Skeleton_blocker_simple_traits.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/include/gudhi/Skeleton_blocker/Skeleton_blocker_simplex.h b/include/gudhi/Skeleton_blocker/Skeleton_blocker_simplex.h
index aa6f2215..d7193157 100644
--- a/include/gudhi/Skeleton_blocker/Skeleton_blocker_simplex.h
+++ b/include/gudhi/Skeleton_blocker/Skeleton_blocker_simplex.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/include/gudhi/Skeleton_blocker/Skeleton_blocker_sub_complex.h b/include/gudhi/Skeleton_blocker/Skeleton_blocker_sub_complex.h
index fadf6619..dbfb4042 100644
--- a/include/gudhi/Skeleton_blocker/Skeleton_blocker_sub_complex.h
+++ b/include/gudhi/Skeleton_blocker/Skeleton_blocker_sub_complex.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/include/gudhi/Skeleton_blocker/internal/Top_faces.h b/include/gudhi/Skeleton_blocker/internal/Top_faces.h
index 2b681752..f80ca4fe 100644
--- a/include/gudhi/Skeleton_blocker/internal/Top_faces.h
+++ b/include/gudhi/Skeleton_blocker/internal/Top_faces.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/include/gudhi/Skeleton_blocker/internal/Trie.h b/include/gudhi/Skeleton_blocker/internal/Trie.h
index 2c9602fa..7a5d38eb 100644
--- a/include/gudhi/Skeleton_blocker/internal/Trie.h
+++ b/include/gudhi/Skeleton_blocker/internal/Trie.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_blockers_iterators.h b/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_blockers_iterators.h
index d2fff960..95c5f7ef 100644
--- a/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_blockers_iterators.h
+++ b/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_blockers_iterators.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_edges_iterators.h b/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_edges_iterators.h
index b90dcf34..5c725aae 100644
--- a/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_edges_iterators.h
+++ b/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_edges_iterators.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_iterators.h b/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_iterators.h
index 1351614f..8054e64f 100644
--- a/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_iterators.h
+++ b/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_iterators.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_simplices_iterators.h b/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_simplices_iterators.h
index 2acdb555..e2024652 100644
--- a/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_simplices_iterators.h
+++ b/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_simplices_iterators.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_triangles_iterators.h b/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_triangles_iterators.h
index 736941dd..a834fe1d 100644
--- a/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_triangles_iterators.h
+++ b/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_triangles_iterators.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_vertices_iterators.h b/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_vertices_iterators.h
index 9e9ae961..3a638ae6 100644
--- a/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_vertices_iterators.h
+++ b/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_vertices_iterators.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/include/gudhi/Skeleton_blocker_complex.h b/include/gudhi/Skeleton_blocker_complex.h
index 4f052ba5..addd8104 100644
--- a/include/gudhi/Skeleton_blocker_complex.h
+++ b/include/gudhi/Skeleton_blocker_complex.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/include/gudhi/Skeleton_blocker_contractor.h b/include/gudhi/Skeleton_blocker_contractor.h
index df884c93..13086161 100644
--- a/include/gudhi/Skeleton_blocker_contractor.h
+++ b/include/gudhi/Skeleton_blocker_contractor.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA Sophia Antipolis-Mediterranee (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/include/gudhi/Skeleton_blocker_geometric_complex.h b/include/gudhi/Skeleton_blocker_geometric_complex.h
index 95331b7a..39b88ceb 100644
--- a/include/gudhi/Skeleton_blocker_geometric_complex.h
+++ b/include/gudhi/Skeleton_blocker_geometric_complex.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/include/gudhi/Skeleton_blocker_link_complex.h b/include/gudhi/Skeleton_blocker_link_complex.h
index 4db075b0..428d4e9b 100644
--- a/include/gudhi/Skeleton_blocker_link_complex.h
+++ b/include/gudhi/Skeleton_blocker_link_complex.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/include/gudhi/Skeleton_blocker_simplifiable_complex.h b/include/gudhi/Skeleton_blocker_simplifiable_complex.h
index 544e02e8..d5adb39d 100644
--- a/include/gudhi/Skeleton_blocker_simplifiable_complex.h
+++ b/include/gudhi/Skeleton_blocker_simplifiable_complex.h
@@ -4,7 +4,7 @@
*
* Author(s): David Salinas
*
- * Copyright (C) 2014 INRIA
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/include/gudhi/Sparse_rips_complex.h b/include/gudhi/Sparse_rips_complex.h
new file mode 100644
index 00000000..4dcc08ed
--- /dev/null
+++ b/include/gudhi/Sparse_rips_complex.h
@@ -0,0 +1,175 @@
+/* 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): Marc Glisse
+ *
+ * Copyright (C) 2018 Inria
+ *
+ * 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/>.
+ */
+
+#ifndef SPARSE_RIPS_COMPLEX_H_
+#define SPARSE_RIPS_COMPLEX_H_
+
+#include <gudhi/Debug_utils.h>
+#include <gudhi/graph_simplicial_complex.h>
+#include <gudhi/choose_n_farthest_points.h>
+
+#include <boost/graph/adjacency_list.hpp>
+#include <boost/range/metafunctions.hpp>
+
+#include <vector>
+
+namespace Gudhi {
+
+namespace rips_complex {
+
+// The whole interface is copied on Rips_complex. A redesign should be discussed with all complex creation classes in
+// mind.
+
+/**
+ * \class Sparse_rips_complex
+ * \brief Sparse Rips complex data structure.
+ *
+ * \ingroup rips_complex
+ *
+ * \details
+ * This class is used to construct a sparse \f$(1+O(\epsilon))\f$-approximation of `Rips_complex`, i.e. a filtered
+ * simplicial complex that is multiplicatively \f$(1+O(\epsilon))\f$-interleaved with the Rips filtration.
+ *
+ * \tparam Filtration_value is the type used to store the filtration values of the simplicial complex.
+ */
+template <typename Filtration_value>
+class Sparse_rips_complex {
+ private:
+ // TODO(MG): use a different graph where we know we can safely insert in parallel.
+ typedef typename boost::adjacency_list<boost::vecS, boost::vecS, boost::undirectedS,
+ boost::property<vertex_filtration_t, Filtration_value>,
+ boost::property<edge_filtration_t, Filtration_value>>
+ Graph;
+
+ typedef int Vertex_handle;
+
+ public:
+ /** \brief Sparse_rips_complex constructor from a list of points.
+ *
+ * @param[in] points Range of points.
+ * @param[in] distance Distance function that returns a `Filtration_value` from 2 given points.
+ * @param[in] epsilon Approximation parameter. epsilon must be positive.
+ *
+ */
+ template <typename RandomAccessPointRange, typename Distance>
+ Sparse_rips_complex(const RandomAccessPointRange& points, Distance distance, double epsilon) {
+ GUDHI_CHECK(epsilon > 0, "epsilon must be positive");
+ std::vector<Vertex_handle> sorted_points;
+ std::vector<Filtration_value> params;
+ auto dist_fun = [&](Vertex_handle i, Vertex_handle j) { return distance(points[i], points[j]); };
+ Ker<decltype(dist_fun)> kernel(dist_fun);
+ subsampling::choose_n_farthest_points(kernel, boost::irange<Vertex_handle>(0, boost::size(points)), -1, -1,
+ std::back_inserter(sorted_points), std::back_inserter(params));
+ compute_sparse_graph(sorted_points, params, dist_fun, epsilon);
+ }
+
+ /** \brief Sparse_rips_complex constructor from a distance matrix.
+ *
+ * @param[in] distance_matrix Range of range of distances.
+ * `distance_matrix[i][j]` returns the distance between points \f$i\f$ and
+ * \f$j\f$ as long as \f$ 0 \leqslant i < j \leqslant
+ * distance\_matrix.size().\f$
+ * @param[in] epsilon Approximation parameter. epsilon must be positive.
+ */
+ template <typename DistanceMatrix>
+ Sparse_rips_complex(const DistanceMatrix& distance_matrix, double epsilon)
+ : Sparse_rips_complex(boost::irange<Vertex_handle>(0, boost::size(distance_matrix)),
+ [&](Vertex_handle i, Vertex_handle j) { return distance_matrix[j][i]; }, epsilon) {}
+
+ /** \brief Fills the simplicial complex with the sparse Rips graph and
+ * expands it with all the cliques, stopping at a given maximal dimension.
+ *
+ * \tparam SimplicialComplexForRips must meet `SimplicialComplexForRips` concept.
+ *
+ * @param[in] complex the complex to fill
+ * @param[in] dim_max maximal dimension of the simplicial complex.
+ * @exception std::invalid_argument In debug mode, if `complex.num_vertices()` does not return 0.
+ *
+ */
+ template <typename SimplicialComplexForRips>
+ void create_complex(SimplicialComplexForRips& complex, int dim_max) {
+ GUDHI_CHECK(complex.num_vertices() == 0,
+ std::invalid_argument("Sparse_rips_complex::create_complex - simplicial complex is not empty"));
+
+ complex.insert_graph(graph_);
+ complex.expansion(dim_max);
+ }
+
+ private:
+ // choose_n_farthest_points wants the distance function in this form...
+ template <class Distance>
+ struct Ker {
+ typedef std::size_t Point_d; // index into point range
+ Ker(Distance& d) : dist(d) {}
+ // Despite the name, this is not squared...
+ typedef Distance Squared_distance_d;
+ Squared_distance_d& squared_distance_d_object() const { return dist; }
+ Distance& dist;
+ };
+
+ // PointRange must be random access.
+ template <typename PointRange, typename ParamRange, typename Distance>
+ void compute_sparse_graph(const PointRange& points, const ParamRange& params, Distance& dist, double epsilon) {
+ const int n = boost::size(points);
+ graph_.~Graph();
+ new (&graph_) Graph(n);
+ // for(auto v : vertices(g)) // doesn't work :-(
+ typename boost::graph_traits<Graph>::vertex_iterator v_i, v_e;
+ for (std::tie(v_i, v_e) = vertices(graph_); v_i != v_e; ++v_i) {
+ auto v = *v_i;
+ // This whole loop might not be necessary, leave it until someone investigates if it is safe to remove.
+ put(vertex_filtration_t(), graph_, v, 0);
+ }
+
+ // TODO(MG):
+ // - make it parallel
+ // - only test near-enough neighbors
+ for (int i = 0; i < n; ++i)
+ for (int j = i + 1; j < n; ++j) {
+ auto&& pi = points[i];
+ auto&& pj = points[j];
+ auto d = dist(pi, pj);
+ auto li = params[i];
+ auto lj = params[j];
+ GUDHI_CHECK(lj <= li, "Bad furthest point sorting");
+ Filtration_value alpha;
+
+ // The paper has d/2 and d-lj/e to match the Cech, but we use doubles to match the Rips
+ if (d * epsilon <= 2 * lj)
+ alpha = d;
+ else if (d * epsilon <= li + lj && (epsilon >= 1 || d * epsilon <= lj * (1 + 1 / (1 - epsilon))))
+ alpha = (d - lj / epsilon) * 2;
+ else
+ continue;
+
+ add_edge(pi, pj, alpha, graph_);
+ }
+ }
+
+ Graph graph_;
+};
+
+} // namespace rips_complex
+
+} // namespace Gudhi
+
+#endif // SPARSE_RIPS_COMPLEX_H_
diff --git a/include/gudhi/Strong_witness_complex.h b/include/gudhi/Strong_witness_complex.h
index b3d00b11..fd6b3f38 100644
--- a/include/gudhi/Strong_witness_complex.h
+++ b/include/gudhi/Strong_witness_complex.h
@@ -4,7 +4,7 @@
*
* Author(s): Siargey Kachanovich
*
- * Copyright (C) 2015 INRIA (France)
+ * Copyright (C) 2015 Inria
*
* 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
diff --git a/include/gudhi/Tangential_complex.h b/include/gudhi/Tangential_complex.h
index 6f061922..9d8fdcd3 100644
--- a/include/gudhi/Tangential_complex.h
+++ b/include/gudhi/Tangential_complex.h
@@ -4,7 +4,7 @@
*
* Author(s): Clement Jamin
*
- * Copyright (C) 2016 INRIA
+ * Copyright (C) 2016 Inria
*
* 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
@@ -1100,7 +1100,10 @@ class Tangential_complex {
// of the sphere "star sphere" centered at "center_vertex"
// and which contains all the
// circumspheres of the star of "center_vertex"
- boost::optional<FT> squared_star_sphere_radius_plus_margin;
+ boost::optional<FT> squared_star_sphere_radius_plus_margin = boost::make_optional(false, FT());
+ // This is the strange way boost is recommending to get rid of "may be used uninitialized in this function".
+ // Former code was :
+ // boost::optional<FT> squared_star_sphere_radius_plus_margin;
// Insert points until we find a point which is outside "star sphere"
for (auto nn_it = ins_range.begin();
diff --git a/include/gudhi/Tangential_complex/Simplicial_complex.h b/include/gudhi/Tangential_complex/Simplicial_complex.h
index 65c74ca5..f79186b0 100644
--- a/include/gudhi/Tangential_complex/Simplicial_complex.h
+++ b/include/gudhi/Tangential_complex/Simplicial_complex.h
@@ -4,7 +4,7 @@
*
* Author(s): Clement Jamin
*
- * Copyright (C) 2016 INRIA
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/include/gudhi/Tangential_complex/config.h b/include/gudhi/Tangential_complex/config.h
index ffefcd6b..e1af1ea6 100644
--- a/include/gudhi/Tangential_complex/config.h
+++ b/include/gudhi/Tangential_complex/config.h
@@ -4,7 +4,7 @@
*
* Author(s): Clement Jamin
*
- * Copyright (C) 2016 INRIA
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/include/gudhi/Tangential_complex/utilities.h b/include/gudhi/Tangential_complex/utilities.h
index b2d6d674..2dd46118 100644
--- a/include/gudhi/Tangential_complex/utilities.h
+++ b/include/gudhi/Tangential_complex/utilities.h
@@ -4,7 +4,7 @@
*
* Author(s): Clement Jamin
*
- * Copyright (C) 2016 INRIA
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/include/gudhi/Unitary_tests_utils.h b/include/gudhi/Unitary_tests_utils.h
index 8394a062..e07c8d42 100644
--- a/include/gudhi/Unitary_tests_utils.h
+++ b/include/gudhi/Unitary_tests_utils.h
@@ -4,7 +4,7 @@
*
* Author(s): Vincent Rouvreau
*
- * Copyright (C) 2017 INRIA
+ * Copyright (C) 2017 Inria
*
* 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
diff --git a/include/gudhi/Witness_complex.h b/include/gudhi/Witness_complex.h
index 53c38520..67885258 100644
--- a/include/gudhi/Witness_complex.h
+++ b/include/gudhi/Witness_complex.h
@@ -4,7 +4,7 @@
*
* Author(s): Siargey Kachanovich
*
- * Copyright (C) 2015 INRIA (France)
+ * Copyright (C) 2015 Inria
*
* 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
diff --git a/include/gudhi/Witness_complex/all_faces_in.h b/include/gudhi/Witness_complex/all_faces_in.h
index b68d75a1..c7b732b9 100644
--- a/include/gudhi/Witness_complex/all_faces_in.h
+++ b/include/gudhi/Witness_complex/all_faces_in.h
@@ -4,7 +4,7 @@
*
* Author(s): Siargey Kachanovich
*
- * Copyright (C) 2015 INRIA (France)
+ * Copyright (C) 2015 Inria
*
* 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
diff --git a/include/gudhi/allocator.h b/include/gudhi/allocator.h
index 4ede14e4..3de16a49 100644
--- a/include/gudhi/allocator.h
+++ b/include/gudhi/allocator.h
@@ -4,7 +4,7 @@
*
* Author(s): Marc Glisse
*
- * Copyright (C) 2015 INRIA Saclay - Ile de France
+ * Copyright (C) 2015 Inria
*
* 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
diff --git a/include/gudhi/choose_n_farthest_points.h b/include/gudhi/choose_n_farthest_points.h
index 8390b4c9..ab1c4c73 100644
--- a/include/gudhi/choose_n_farthest_points.h
+++ b/include/gudhi/choose_n_farthest_points.h
@@ -4,7 +4,7 @@
*
* Author(s): Siargey Kachanovich
*
- * Copyright (C) 2016 INRIA
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/include/gudhi/common_persistence_representations.h b/include/gudhi/common_persistence_representations.h
index 44e125a7..3d03f1f6 100644
--- a/include/gudhi/common_persistence_representations.h
+++ b/include/gudhi/common_persistence_representations.h
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/include/gudhi/console_color.h b/include/gudhi/console_color.h
index c4671da3..a493e0d0 100644
--- a/include/gudhi/console_color.h
+++ b/include/gudhi/console_color.h
@@ -4,7 +4,7 @@
*
* Author(s): Clement Jamin
*
- * Copyright (C) 2016 INRIA Sophia-Antipolis (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/include/gudhi/distance_functions.h b/include/gudhi/distance_functions.h
index 3a5d1fd5..5ef12f2e 100644
--- a/include/gudhi/distance_functions.h
+++ b/include/gudhi/distance_functions.h
@@ -4,7 +4,7 @@
*
* Author(s): Clément Maria
*
- * Copyright (C) 2014 INRIA
+ * Copyright (C) 2014 Inria
*
* 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
@@ -25,7 +25,10 @@
#include <gudhi/Debug_utils.h>
+#include <gudhi/Miniball.hpp>
+
#include <boost/range/metafunctions.hpp>
+#include <boost/range/size.hpp>
#include <cmath> // for std::sqrt
#include <type_traits> // for std::decay
@@ -68,6 +71,53 @@ class Euclidean_distance {
}
};
+/** @brief Compute the radius of the minimal enclosing ball between Points given by a range of coordinates.
+ * The points are assumed to have the same dimension. */
+class Minimal_enclosing_ball_radius {
+ public:
+ /** \brief Minimal_enclosing_ball_radius from two points.
+ *
+ * @param[in] point_1 First point.
+ * @param[in] point_2 second point.
+ * @return The minimal enclosing ball radius for the two points (aka. Euclidean distance / 2.).
+ *
+ * \tparam Point must be a range of Cartesian coordinates.
+ *
+ */
+ template< typename Point >
+ typename std::iterator_traits<typename boost::range_iterator<Point>::type>::value_type
+ operator()(const Point& point_1, const Point& point_2) const {
+ return Euclidean_distance()(point_1, point_2) / 2.;
+ }
+ /** \brief Minimal_enclosing_ball_radius from a point cloud.
+ *
+ * @param[in] point_cloud The points.
+ * @return The minimal enclosing ball radius for the points.
+ *
+ * \tparam Point_cloud must be a range of points with Cartesian coordinates.
+ * Point_cloud is a range over a range of Coordinate.
+ *
+ */
+ template< typename Point_cloud,
+ typename Point_iterator = typename boost::range_const_iterator<Point_cloud>::type,
+ typename Point = typename std::iterator_traits<Point_iterator>::value_type,
+ typename Coordinate_iterator = typename boost::range_const_iterator<Point>::type,
+ typename Coordinate = typename std::iterator_traits<Coordinate_iterator>::value_type>
+ Coordinate
+ operator()(const Point_cloud& point_cloud) const {
+ using Min_sphere = Miniball::Miniball<Miniball::CoordAccessor<Point_iterator, Coordinate_iterator>>;
+
+ Min_sphere ms(boost::size(*point_cloud.begin()), point_cloud.begin(), point_cloud.end());
+#ifdef DEBUG_TRACES
+ std::cout << "Minimal_enclosing_ball_radius = " << std::sqrt(ms.squared_radius()) << " | nb points = "
+ << boost::size(point_cloud) << " | dimension = "
+ << boost::size(*point_cloud.begin()) << std::endl;
+#endif // DEBUG_TRACES
+
+ return std::sqrt(ms.squared_radius());
+ }
+};
+
} // namespace Gudhi
#endif // DISTANCE_FUNCTIONS_H_
diff --git a/include/gudhi/graph_simplicial_complex.h b/include/gudhi/graph_simplicial_complex.h
index d84421b2..49fe56cc 100644
--- a/include/gudhi/graph_simplicial_complex.h
+++ b/include/gudhi/graph_simplicial_complex.h
@@ -4,7 +4,7 @@
*
* Author(s): Clément Maria
*
- * Copyright (C) 2014 INRIA
+ * Copyright (C) 2014 Inria
*
* 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
@@ -42,6 +42,12 @@ struct vertex_filtration_t {
typedef boost::vertex_property_tag kind;
};
+/** \brief Proximity_graph contains the vertices and edges with their filtration values in order to store the result
+ * of `Gudhi::compute_proximity_graph` function.
+ *
+ * \tparam SimplicialComplexForProximityGraph furnishes `Filtration_value` type definition.
+ *
+ */
template <typename SimplicialComplexForProximityGraph>
using Proximity_graph = typename boost::adjacency_list < boost::vecS, boost::vecS, boost::undirectedS
, boost::property < vertex_filtration_t, typename SimplicialComplexForProximityGraph::Filtration_value >
diff --git a/include/gudhi/pick_n_random_points.h b/include/gudhi/pick_n_random_points.h
index 8c90b6bf..64821e5d 100644
--- a/include/gudhi/pick_n_random_points.h
+++ b/include/gudhi/pick_n_random_points.h
@@ -4,7 +4,7 @@
*
* Author(s): Siargey Kachanovich
*
- * Copyright (C) 2016 INRIA
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/include/gudhi/random_point_generators.h b/include/gudhi/random_point_generators.h
index 9df77760..f8107c8b 100644
--- a/include/gudhi/random_point_generators.h
+++ b/include/gudhi/random_point_generators.h
@@ -4,7 +4,7 @@
*
* Author(s): Clement Jamin
*
- * Copyright (C) 2016 INRIA
+ * Copyright (C) 2016 Inria
*
* 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
@@ -190,7 +190,8 @@ template <typename Kernel, typename OutputIterator>
static void generate_uniform_points_on_torus_d(const Kernel &k, int dim, std::size_t num_slices,
OutputIterator out,
double radius_noise_percentage = 0.,
- std::vector<typename Kernel::FT> current_point = std::vector<typename Kernel::FT>()) {
+ std::vector<typename Kernel::FT> current_point =
+ std::vector<typename Kernel::FT>()) {
CGAL::Random rng;
int point_size = static_cast<int>(current_point.size());
if (point_size == 2 * dim) {
diff --git a/include/gudhi/read_persistence_from_file.h b/include/gudhi/read_persistence_from_file.h
index 83b89d0e..4a2b9d68 100644
--- a/include/gudhi/read_persistence_from_file.h
+++ b/include/gudhi/read_persistence_from_file.h
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
@@ -57,7 +57,7 @@ std::vector<std::pair<double, double> > read_persistence_intervals_in_one_dimens
std::string line;
std::vector<std::pair<double, double> > barcode_initial =
- read_persistence_intervals_in_dimension(filename, (int)dimension);
+ read_persistence_intervals_in_dimension(filename, static_cast<int>(dimension));
std::vector<std::pair<double, double> > final_barcode;
final_barcode.reserve(barcode_initial.size());
@@ -92,8 +92,8 @@ std::vector<std::pair<double, double> > read_persistence_intervals_in_one_dimens
if ((barcode_initial[i].second == std::numeric_limits<double>::infinity()) &&
(what_to_substitute_for_infinite_bar != -1)) {
- if (barcode_initial[i].first < what_to_substitute_for_infinite_bar) // if only birth < death.
- {
+ if (barcode_initial[i].first < what_to_substitute_for_infinite_bar) {
+ // if only birth < death.
final_barcode.push_back(
std::pair<double, double>(barcode_initial[i].first, what_to_substitute_for_infinite_bar));
}
diff --git a/include/gudhi/reader_utils.h b/include/gudhi/reader_utils.h
index 90be4fc7..26eeb76d 100644
--- a/include/gudhi/reader_utils.h
+++ b/include/gudhi/reader_utils.h
@@ -4,7 +4,7 @@
*
* Author(s): Clement Maria, Pawel Dlotko, Clement Jamin
*
- * Copyright (C) 2014 INRIA
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/include/gudhi/sparsify_point_set.h b/include/gudhi/sparsify_point_set.h
index 7d3b97fb..db10e0b1 100644
--- a/include/gudhi/sparsify_point_set.h
+++ b/include/gudhi/sparsify_point_set.h
@@ -4,7 +4,7 @@
*
* Author(s): Clement Jamin
*
- * Copyright (C) 2016 INRIA
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/include/gudhi/writing_persistence_to_file.h b/include/gudhi/writing_persistence_to_file.h
new file mode 100644
index 00000000..34448576
--- /dev/null
+++ b/include/gudhi/writing_persistence_to_file.h
@@ -0,0 +1,117 @@
+/* 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) 2017 Swansea University, UK
+ *
+ * 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/>.
+ */
+
+#ifndef WRITING_PERSISTENCE_TO_FILE_H_
+#define WRITING_PERSISTENCE_TO_FILE_H_
+
+#include <iostream>
+#include <string>
+#include <limits>
+
+namespace Gudhi {
+
+/**
+* This is a class to store persistence intervals. Its main purpose is to
+* exchange data in between different packages and provide unified way
+* of writing a collection of persistence intervals to file.
+**/
+template <typename Filtration_type, typename Coefficient_field>
+class Persistence_interval_common {
+ public:
+ /**
+ * Constructor taking as an input birth and death of the pair.
+ **/
+ Persistence_interval_common(Filtration_type birth, Filtration_type death)
+ : birth_(birth),
+ death_(death),
+ dimension_(std::numeric_limits<unsigned>::max()),
+ arith_element_(std::numeric_limits<Coefficient_field>::max()) {}
+
+ /**
+ * Constructor taking as an input birth, death and dimension of the pair.
+ **/
+ Persistence_interval_common(Filtration_type birth, Filtration_type death, unsigned dim)
+ : birth_(birth), death_(death), dimension_(dim), arith_element_(std::numeric_limits<Coefficient_field>::max()) {}
+
+ /**
+* Constructor taking as an input birth, death, dimension of the pair as well
+* as the number p such that this interval is present over Z_p field.
+**/
+ Persistence_interval_common(Filtration_type birth, Filtration_type death, unsigned dim, Coefficient_field field)
+ : birth_(birth), death_(death), dimension_(dim), arith_element_(field) {}
+
+ /**
+ * Operator to compare two persistence pairs. During the comparision all the
+ * fields: birth, death, dimensiona and arith_element_ are taken into account
+ * and they all have to be equal for two pairs to be equal.
+ **/
+ bool operator==(const Persistence_interval_common& i2) const {
+ return ((this->birth_ == i2.birth_) && (this->death_ == i2.death_) && (this->dimension_ == i2.dimension_) &&
+ (this->arith_element_ == i2.arith_element_));
+ }
+
+ /**
+ * Check if two persistence paris are not equal.
+ **/
+ bool operator!=(const Persistence_interval_common& i2) const { return (!((*this) == i2)); }
+
+ /**
+ * Operator to compare objects of a type Persistence_interval_common.
+ * One intervals is smaller than the other if it has lower persistence.
+ * Note that this operator do not take Arith_element into account when doing comparisions.
+ **/
+ bool operator<(const Persistence_interval_common& i2) const {
+ return fabs(this->death_ - this->birth_) < fabs(i2.death_ - i2.birth_);
+ }
+
+ friend std::ostream& operator<<(std::ostream& out, const Persistence_interval_common& it) {
+ if (it.arith_element_ != std::numeric_limits<Coefficient_field>::max()) {
+ out << it.arith_element_ << " ";
+ }
+ if (it.dimension_ != std::numeric_limits<unsigned>::max()) {
+ out << it.dimension_ << " ";
+ }
+ out << it.birth_ << " " << it.death_ << " ";
+ return out;
+ }
+
+ private:
+ Filtration_type birth_;
+ Filtration_type death_;
+ unsigned dimension_;
+ Coefficient_field arith_element_;
+};
+
+/**
+ * This function write a vector<Persistence_interval_common> to a stream
+**/
+template <typename Persistence_interval_range>
+void write_persistence_intervals_to_stream(const Persistence_interval_range& intervals,
+ std::ostream& out = std::cout) {
+ for (auto interval : intervals) {
+ out << interval << "\n";
+ }
+}
+
+} // namespace Gudhi
+
+#endif // WRITING_PERSISTENCE_TO_FILE_H_
diff --git a/include/gudhi_patches/Bottleneck_distance_CGAL_patches.txt b/include/gudhi_patches/Bottleneck_distance_CGAL_patches.txt
deleted file mode 100644
index a588d113..00000000
--- a/include/gudhi_patches/Bottleneck_distance_CGAL_patches.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-CGAL/Kd_tree.h
-CGAL/Kd_tree_node.h
-CGAL/Orthogonal_incremental_neighbor_search.h
diff --git a/include/gudhi_patches/CGAL/Convex_hull.h b/include/gudhi_patches/CGAL/Convex_hull.h
deleted file mode 100644
index a8f91bf8..00000000
--- a/include/gudhi_patches/CGAL/Convex_hull.h
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright (c) 2009-2014 INRIA Sophia-Antipolis (France).
-// All rights reserved.
-//
-// This file is part of CGAL (www.cgal.org).
-// 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.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Samuel Hornus
-
-/* RANDOM DESIGN IDEAS:
-- Use a policy tag to choose for incremental with inserts only or
- incremental with removals and inserts.
- In the first case: use Triangulation for storage.
- In the second case: use Delaunay !
- In this second case, we must keeps the points that are inserted in the hull,
- as they may become part of the boundary later on, when some points are removed.
-- Constructor with range argument uses quickhull.
-*/
-
-#ifndef CGAL_CONVEX_HULL_H
-#define CGAL_CONVEX_HULL_H
-
-namespace CGAL {
-
-template < class CHTraits, class TDS_ = Default >
-class Convex_hull
-{
- typedef typename Maximal_dimension<typename CHTraits::Point_d>::type
- Maximal_dimension_;
- typedef typename Default::Get<TDS_, Triangulation_data_structure
- < Maximal_dimension_,
- Triangulation_vertex<CHTraits>,
- Triangulation_full_cell<CHTraits> >
- >::type TDS;
- typedef Convex_hull<CHTraits, TDS_> Self;
-
- typedef typename CHTraits::Coaffine_orientation_d
- Coaffine_orientation_d;
- typedef typename CHTraits::Orientation_d Orientation_d;
-
-public:
-};
-
-} //namespace CGAL
-
-#endif // CGAL_CONVEX_HULL_H
diff --git a/include/gudhi_patches/CGAL/Delaunay_triangulation.h b/include/gudhi_patches/CGAL/Delaunay_triangulation.h
deleted file mode 100644
index 071cd184..00000000
--- a/include/gudhi_patches/CGAL/Delaunay_triangulation.h
+++ /dev/null
@@ -1,933 +0,0 @@
-// Copyright (c) 2009-2014 INRIA Sophia-Antipolis (France).
-// All rights reserved.
-//
-// This file is part of CGAL (www.cgal.org).
-// 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.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Samuel Hornus
-
-#ifndef CGAL_DELAUNAY_COMPLEX_H
-#define CGAL_DELAUNAY_COMPLEX_H
-
-#include <CGAL/tss.h>
-#include <CGAL/Triangulation.h>
-#include <CGAL/Dimension.h>
-#include <CGAL/Default.h>
-
-#include <boost/iterator/transform_iterator.hpp>
-
-#include <algorithm>
-
-namespace CGAL {
-
-template< typename DCTraits, typename _TDS = Default >
-class Delaunay_triangulation
-: public Triangulation<DCTraits,
- typename Default::Get<_TDS, Triangulation_data_structure<
- typename DCTraits::Dimension,
- Triangulation_vertex<DCTraits>,
- Triangulation_full_cell<DCTraits> >
- >::type >
-{
- typedef typename DCTraits::Dimension Maximal_dimension_;
- typedef typename Default::Get<_TDS, Triangulation_data_structure<
- Maximal_dimension_,
- Triangulation_vertex<DCTraits>,
- Triangulation_full_cell<DCTraits> >
- >::type TDS;
- typedef Triangulation<DCTraits, TDS> Base;
- typedef Delaunay_triangulation<DCTraits, _TDS> Self;
-
- typedef typename DCTraits::Side_of_oriented_sphere_d
- Side_of_oriented_sphere_d;
- typedef typename DCTraits::Orientation_d Orientation_d;
-
-public: // PUBLIC NESTED TYPES
-
- typedef DCTraits Geom_traits;
- typedef typename Base::Triangulation_ds Triangulation_ds;
-
- typedef typename Base::Vertex Vertex;
- typedef typename Base::Full_cell Full_cell;
- typedef typename Base::Facet Facet;
- typedef typename Base::Face Face;
-
- typedef typename Base::Maximal_dimension Maximal_dimension;
- typedef typename DCTraits::Point_d Point;
- typedef typename DCTraits::Point_d Point_d;
-
- typedef typename Base::Vertex_handle Vertex_handle;
- typedef typename Base::Vertex_iterator Vertex_iterator;
- typedef typename Base::Vertex_const_handle Vertex_const_handle;
- typedef typename Base::Vertex_const_iterator Vertex_const_iterator;
-
- typedef typename Base::Full_cell_handle Full_cell_handle;
- typedef typename Base::Full_cell_iterator Full_cell_iterator;
- typedef typename Base::Full_cell_const_handle Full_cell_const_handle;
- typedef typename Base::Full_cell_const_iterator Full_cell_const_iterator;
- typedef typename Base::Finite_full_cell_const_iterator
- Finite_full_cell_const_iterator;
-
- typedef typename Base::size_type size_type;
- typedef typename Base::difference_type difference_type;
-
- typedef typename Base::Locate_type Locate_type;
-
- //Tag to distinguish triangulations with weighted_points
- typedef Tag_false Weighted_tag;
-
-protected: // DATA MEMBERS
-
-
-public:
-
- using typename Base::Rotor;
- using Base::maximal_dimension;
- using Base::are_incident_full_cells_valid;
- using Base::coaffine_orientation_predicate;
- using Base::reset_flat_orientation;
- using Base::current_dimension;
- //using Base::star;
- //using Base::incident_full_cells;
- using Base::geom_traits;
- using Base::index_of_covertex;
- //using Base::index_of_second_covertex;
- using Base::infinite_vertex;
- using Base::rotate_rotor;
- using Base::insert_in_hole;
- using Base::insert_outside_convex_hull_1;
- using Base::is_infinite;
- using Base::locate;
- using Base::points_begin;
- using Base::set_neighbors;
- using Base::new_full_cell;
- using Base::number_of_vertices;
- using Base::orientation;
- using Base::tds;
- using Base::reorient_full_cells;
- using Base::full_cell;
- using Base::full_cells_begin;
- using Base::full_cells_end;
- using Base::finite_full_cells_begin;
- using Base::finite_full_cells_end;
- using Base::vertices_begin;
- using Base::vertices_end;
- // using Base::
-
-private:
- //*** Side_of_oriented_subsphere_d ***
- typedef typename Base::Flat_orientation_d Flat_orientation_d;
- typedef typename Base::Construct_flat_orientation_d Construct_flat_orientation_d;
- typedef typename DCTraits::In_flat_side_of_oriented_sphere_d In_flat_side_of_oriented_sphere_d;
- // Wrapper
- struct Side_of_oriented_subsphere_d
- {
- boost::optional<Flat_orientation_d>* fop;
- Construct_flat_orientation_d cfo;
- In_flat_side_of_oriented_sphere_d ifsoos;
-
- Side_of_oriented_subsphere_d(
- boost::optional<Flat_orientation_d>& x,
- Construct_flat_orientation_d const&y,
- In_flat_side_of_oriented_sphere_d const&z)
- : fop(&x), cfo(y), ifsoos(z) {}
-
- template<class Iter>
- CGAL::Orientation operator()(Iter a, Iter b, const Point & p)const
- {
- if(!*fop)
- *fop=cfo(a,b);
- return ifsoos(fop->get(),a,b,p);
- }
- };
-public:
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - CREATION / CONSTRUCTORS
-
- Delaunay_triangulation(int dim, const Geom_traits &k = Geom_traits())
- : Base(dim, k)
- {
- }
-
- // With this constructor,
- // the user can specify a Flat_orientation_d object to be used for
- // orienting simplices of a specific dimension
- // (= preset_flat_orientation_.first)
- // It it used by the dark triangulations created by DT::remove
- Delaunay_triangulation(
- int dim,
- const std::pair<int, const Flat_orientation_d *> &preset_flat_orientation,
- const Geom_traits &k = Geom_traits())
- : Base(dim, preset_flat_orientation, k)
- {
- }
-
- ~Delaunay_triangulation() {}
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ACCESS
-
- // Not Documented
- Side_of_oriented_subsphere_d side_of_oriented_subsphere_predicate() const
- {
- return Side_of_oriented_subsphere_d (
- flat_orientation_,
- geom_traits().construct_flat_orientation_d_object(),
- geom_traits().in_flat_side_of_oriented_sphere_d_object()
- );
- }
-
-
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - REMOVALS
-
- Full_cell_handle remove(Vertex_handle);
- Full_cell_handle remove(const Point & p, Full_cell_handle hint = Full_cell_handle())
- {
- Locate_type lt;
- Face f(maximal_dimension());
- Facet ft;
- Full_cell_handle s = locate(p, lt, f, ft, hint);
- if( Base::ON_VERTEX == lt )
- {
- return remove(s->vertex(f.index(0)));
- }
- return Full_cell_handle();
- }
-
- template< typename ForwardIterator >
- void remove(ForwardIterator start, ForwardIterator end)
- {
- while( start != end )
- remove(*start++);
- }
-
- // Not documented
- void remove_decrease_dimension(Vertex_handle);
-
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - INSERTIONS
-
- template< typename ForwardIterator >
- size_type insert(ForwardIterator start, ForwardIterator end)
- {
- size_type n = number_of_vertices();
- std::vector<Point> points(start, end);
- spatial_sort(points.begin(), points.end(), geom_traits());
- Full_cell_handle hint;
- for( typename std::vector<Point>::const_iterator p = points.begin(); p != points.end(); ++p )
- {
- hint = insert(*p, hint)->full_cell();
- }
- return number_of_vertices() - n;
- }
- Vertex_handle insert(const Point &, Locate_type, const Face &, const Facet &, Full_cell_handle);
- Vertex_handle insert(const Point & p, Full_cell_handle start = Full_cell_handle())
- {
- Locate_type lt;
- Face f(maximal_dimension());
- Facet ft;
- Full_cell_handle s = locate(p, lt, f, ft, start);
- return insert(p, lt, f, ft, s);
- }
- Vertex_handle insert(const Point & p, Vertex_handle hint)
- {
- CGAL_assertion( Vertex_handle() != hint );
- return insert(p, hint->full_cell());
- }
- Vertex_handle insert_outside_affine_hull(const Point &);
- Vertex_handle insert_in_conflicting_cell(const Point &, Full_cell_handle);
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - GATHERING CONFLICTING SIMPLICES
-
- bool is_in_conflict(const Point &, Full_cell_const_handle) const;
- template< class OrientationPredicate >
- Oriented_side perturbed_side_of_positive_sphere(const Point &,
- Full_cell_const_handle, const OrientationPredicate &) const;
-
- template< typename OutputIterator >
- Facet compute_conflict_zone(const Point &, Full_cell_handle, OutputIterator) const;
-
- template < typename OrientationPredicate, typename SideOfOrientedSpherePredicate >
- class Conflict_predicate
- {
- const Self & dc_;
- const Point & p_;
- OrientationPredicate ori_;
- SideOfOrientedSpherePredicate side_of_s_;
- int cur_dim_;
- public:
- Conflict_predicate(
- const Self & dc,
- const Point & p,
- const OrientationPredicate & ori,
- const SideOfOrientedSpherePredicate & side)
- : dc_(dc), p_(p), ori_(ori), side_of_s_(side), cur_dim_(dc.current_dimension()) {}
-
- inline
- bool operator()(Full_cell_const_handle s) const
- {
- bool ok;
- if( ! dc_.is_infinite(s) )
- {
- Oriented_side side = side_of_s_(dc_.points_begin(s), dc_.points_begin(s) + cur_dim_ + 1, p_);
- if( ON_POSITIVE_SIDE == side )
- ok = true;
- else if( ON_NEGATIVE_SIDE == side )
- ok = false;
- else
- ok = ON_POSITIVE_SIDE == dc_.perturbed_side_of_positive_sphere<OrientationPredicate>(p_, s, ori_);
- }
- else
- {
- typedef typename Full_cell::Vertex_handle_const_iterator VHCI;
- typedef Substitute_point_in_vertex_iterator<VHCI> F;
- F spivi(dc_.infinite_vertex(), &p_);
-
- Orientation o = ori_(
- boost::make_transform_iterator(s->vertices_begin(), spivi),
- boost::make_transform_iterator(s->vertices_begin() + cur_dim_ + 1,
- spivi));
-
- if( POSITIVE == o )
- ok = true;
- else if( o == NEGATIVE )
- ok = false;
- else
- ok = (*this)(s->neighbor( s->index( dc_.infinite_vertex() ) ));
- }
- return ok;
- }
- };
-
- template < typename ConflictPredicate >
- class Conflict_traversal_predicate
- {
- const Self & dc_;
- const ConflictPredicate & pred_;
- public:
- Conflict_traversal_predicate(const Self & dc, const ConflictPredicate & pred)
- : dc_(dc), pred_(pred)
- {}
- inline
- bool operator()(const Facet & f) const
- {
- return pred_(dc_.full_cell(f)->neighbor(dc_.index_of_covertex(f)));
- }
- };
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - VALIDITY
-
- bool is_valid(bool verbose = false, int level = 0) const;
-
-private:
- // Some internal types to shorten notation
- typedef typename Base::Coaffine_orientation_d Coaffine_orientation_d;
- using Base::flat_orientation_;
- typedef Conflict_predicate<Coaffine_orientation_d, Side_of_oriented_subsphere_d>
- Conflict_pred_in_subspace;
- typedef Conflict_predicate<Orientation_d, Side_of_oriented_sphere_d>
- Conflict_pred_in_fullspace;
- typedef Conflict_traversal_predicate<Conflict_pred_in_subspace>
- Conflict_traversal_pred_in_subspace;
- typedef Conflict_traversal_predicate<Conflict_pred_in_fullspace>
- Conflict_traversal_pred_in_fullspace;
-};
-
-// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
-// FUNCTIONS THAT ARE MEMBER METHODS:
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - REMOVALS
-
-template< typename DCTraits, typename TDS >
-typename Delaunay_triangulation<DCTraits, TDS>::Full_cell_handle
-Delaunay_triangulation<DCTraits, TDS>
-::remove( Vertex_handle v )
-{
- CGAL_precondition( ! is_infinite(v) );
- CGAL_expensive_precondition( is_vertex(v) );
-
- // THE CASE cur_dim == 0
- if( 0 == current_dimension() )
- {
- remove_decrease_dimension(v);
- return Full_cell_handle();
- }
- else if( 1 == current_dimension() )
- { // THE CASE cur_dim == 1
- if( 2 == number_of_vertices() )
- {
- remove_decrease_dimension(v);
- return Full_cell_handle();
- }
- Full_cell_handle left = v->full_cell();
- if( 0 == left->index(v) )
- left = left->neighbor(1);
- CGAL_assertion( 1 == left->index(v) );
- Full_cell_handle right = left->neighbor(0);
-
- tds().associate_vertex_with_full_cell(left, 1, right->vertex(1));
- set_neighbors(left, 0, right->neighbor(0), right->mirror_index(0));
-
- tds().delete_vertex(v);
- tds().delete_full_cell(right);
- return left;
- }
-
- // THE CASE cur_dim >= 2
- // Gather the finite vertices sharing an edge with |v|
- typedef typename Base::template Full_cell_set<Full_cell_handle> Simplices;
- Simplices simps;
- std::back_insert_iterator<Simplices> out(simps);
- tds().incident_full_cells(v, out);
- typedef std::set<Vertex_handle> Vertex_set;
- Vertex_set verts;
- Vertex_handle vh;
- for( typename Simplices::iterator it = simps.begin(); it != simps.end(); ++it )
- for( int i = 0; i <= current_dimension(); ++i )
- {
- vh = (*it)->vertex(i);
- if( is_infinite(vh) )
- continue;
- if( vh == v )
- continue;
- verts.insert(vh);
- }
-
- // After gathering finite neighboring vertices, create their Dark Delaunay triangulation
- typedef Triangulation_vertex<Geom_traits, Vertex_handle> Dark_vertex_base;
- typedef Triangulation_full_cell<Geom_traits,
- internal::Triangulation::Dark_full_cell_data<Self> > Dark_full_cell_base;
- typedef Triangulation_data_structure<Maximal_dimension, Dark_vertex_base, Dark_full_cell_base> Dark_tds;
- typedef Delaunay_triangulation<DCTraits, Dark_tds> Dark_triangulation;
- typedef typename Dark_triangulation::Face Dark_face;
- typedef typename Dark_triangulation::Facet Dark_facet;
- typedef typename Dark_triangulation::Vertex_handle Dark_v_handle;
- typedef typename Dark_triangulation::Full_cell_handle Dark_s_handle;
-
- // If flat_orientation_ is defined, we give it the Dark triangulation
- // so that the orientation it uses for "current_dimension()"-simplices is
- // coherent with the global triangulation
- Dark_triangulation dark_side(
- maximal_dimension(),
- flat_orientation_ ?
- std::pair<int, const Flat_orientation_d *>(current_dimension(), flat_orientation_.get_ptr())
- : std::pair<int, const Flat_orientation_d *>((std::numeric_limits<int>::max)(), (Flat_orientation_d*) NULL) );
-
- Dark_s_handle dark_s;
- Dark_v_handle dark_v;
- typedef std::map<Vertex_handle, Dark_v_handle> Vertex_map;
- Vertex_map light_to_dark;
- typename Vertex_set::iterator vit = verts.begin();
- while( vit != verts.end() )
- {
- dark_v = dark_side.insert((*vit)->point(), dark_s);
- dark_s = dark_v->full_cell();
- dark_v->data() = *vit;
- light_to_dark[*vit] = dark_v;
- ++vit;
- }
-
- if( dark_side.current_dimension() != current_dimension() )
- {
- CGAL_assertion( dark_side.current_dimension() + 1 == current_dimension() );
- // Here, the finite neighbors of |v| span a affine subspace of
- // dimension one less than the current dimension. Two cases are possible:
- if( (size_type)(verts.size() + 1) == number_of_vertices() )
- {
- remove_decrease_dimension(v);
- return Full_cell_handle();
- }
- else
- { // |v| is strictly outside the convex hull of the rest of the points. This is an
- // easy case: first, modify the finite full_cells, then, delete the infinite ones.
- // We don't even need the Dark triangulation.
- Simplices infinite_simps;
- {
- Simplices finite_simps;
- for( typename Simplices::iterator it = simps.begin(); it != simps.end(); ++it )
- if( is_infinite(*it) )
- infinite_simps.push_back(*it);
- else
- finite_simps.push_back(*it);
- simps.swap(finite_simps);
- } // now, simps only contains finite simplices
- // First, modify the finite full_cells:
- for( typename Simplices::iterator it = simps.begin(); it != simps.end(); ++it )
- {
- int v_idx = (*it)->index(v);
- tds().associate_vertex_with_full_cell(*it, v_idx, infinite_vertex());
- }
- // Make the handles to infinite full cells searchable
- infinite_simps.make_searchable();
- // Then, modify the neighboring relation
- for( typename Simplices::iterator it = simps.begin(); it != simps.end(); ++it )
- {
- for( int i = 0; i <= current_dimension(); ++i )
- {
- if (is_infinite((*it)->vertex(i)))
- continue;
- (*it)->vertex(i)->set_full_cell(*it);
- Full_cell_handle n = (*it)->neighbor(i);
- // Was |n| a finite full cell prior to removing |v| ?
- if( ! infinite_simps.contains(n) )
- continue;
- int n_idx = n->index(v);
- set_neighbors(*it, i, n->neighbor(n_idx), n->neighbor(n_idx)->index(n));
- }
- }
- Full_cell_handle ret_s;
- // Then, we delete the infinite full_cells
- for( typename Simplices::iterator it = infinite_simps.begin(); it != infinite_simps.end(); ++it )
- tds().delete_full_cell(*it);
- tds().delete_vertex(v);
- return simps.front();
- }
- }
- else // From here on, dark_side.current_dimension() == current_dimension()
- {
- dark_side.infinite_vertex()->data() = infinite_vertex();
- light_to_dark[infinite_vertex()] = dark_side.infinite_vertex();
- }
-
- // Now, compute the conflict zone of v->point() in
- // the dark side. This is precisely the set of full_cells
- // that we have to glue back into the light side.
- Dark_face dark_f(dark_side.maximal_dimension());
- Dark_facet dark_ft;
- typename Dark_triangulation::Locate_type lt;
- dark_s = dark_side.locate(v->point(), lt, dark_f, dark_ft);
- CGAL_assertion( lt != Dark_triangulation::ON_VERTEX
- && lt != Dark_triangulation::OUTSIDE_AFFINE_HULL );
-
- // |ret_s| is the full_cell that we return
- Dark_s_handle dark_ret_s = dark_s;
- Full_cell_handle ret_s;
-
- typedef typename Base::template Full_cell_set<Dark_s_handle> Dark_full_cells;
- Dark_full_cells conflict_zone;
- std::back_insert_iterator<Dark_full_cells> dark_out(conflict_zone);
-
- dark_ft = dark_side.compute_conflict_zone(v->point(), dark_s, dark_out);
- // Make the dark simplices in the conflict zone searchable
- conflict_zone.make_searchable();
-
- // THE FOLLOWING SHOULD MAYBE GO IN TDS.
- // Here is the plan:
- // 1. Pick any Facet from boundary of the light zone
- // 2. Find corresponding Facet on boundary of dark zone
- // 3. stitch.
-
- // 1. Build a facet on the boudary of the light zone:
- Full_cell_handle light_s = *simps.begin();
- Facet light_ft(light_s, light_s->index(v));
-
- // 2. Find corresponding Dark_facet on boundary of the dark zone
- Dark_full_cells dark_incident_s;
- for( int i = 0; i <= current_dimension(); ++i )
- {
- if( index_of_covertex(light_ft) == i )
- continue;
- Dark_v_handle dark_v = light_to_dark[full_cell(light_ft)->vertex(i)];
- dark_incident_s.clear();
- dark_out = std::back_inserter(dark_incident_s);
- dark_side.tds().incident_full_cells(dark_v, dark_out);
- for( typename Dark_full_cells::iterator it = dark_incident_s.begin(); it != dark_incident_s.end(); ++it )
- {
- (*it)->data().count_ += 1;
- }
- }
-
- for( typename Dark_full_cells::iterator it = dark_incident_s.begin(); it != dark_incident_s.end(); ++it )
- {
- if( current_dimension() != (*it)->data().count_ )
- continue;
- if( ! conflict_zone.contains(*it) )
- continue;
- // We found a full_cell incident to the dark facet corresponding to the light facet |light_ft|
- int ft_idx = 0;
- while( light_s->has_vertex( (*it)->vertex(ft_idx)->data() ) )
- ++ft_idx;
- dark_ft = Dark_facet(*it, ft_idx);
- break;
- }
- // Pre-3. Now, we are ready to traverse both boundary and do the stiching.
-
- // But first, we create the new full_cells in the light triangulation,
- // with as much adjacency information as possible.
-
- // Create new full_cells with vertices
- for( typename Dark_full_cells::iterator it = conflict_zone.begin(); it != conflict_zone.end(); ++it )
- {
- Full_cell_handle new_s = new_full_cell();
- (*it)->data().light_copy_ = new_s;
- for( int i = 0; i <= current_dimension(); ++i )
- tds().associate_vertex_with_full_cell(new_s, i, (*it)->vertex(i)->data());
- if( dark_ret_s == *it )
- ret_s = new_s;
- }
-
- // Setup adjacencies inside the hole
- for( typename Dark_full_cells::iterator it = conflict_zone.begin(); it != conflict_zone.end(); ++it )
- {
- Full_cell_handle new_s = (*it)->data().light_copy_;
- for( int i = 0; i <= current_dimension(); ++i )
- if( conflict_zone.contains((*it)->neighbor(i)) )
- tds().set_neighbors(new_s, i, (*it)->neighbor(i)->data().light_copy_, (*it)->mirror_index(i));
- }
-
- // 3. Stitch
- simps.make_searchable();
- typedef std::queue<std::pair<Facet, Dark_facet> > Queue;
- Queue q;
- q.push(std::make_pair(light_ft, dark_ft));
- dark_s = dark_side.full_cell(dark_ft);
- int dark_i = dark_side.index_of_covertex(dark_ft);
- // mark dark_ft as visited:
- // TODO try by marking with Dark_v_handle (vertex)
- dark_s->neighbor(dark_i)->set_neighbor(dark_s->mirror_index(dark_i), Dark_s_handle());
- while( ! q.empty() )
- {
- std::pair<Facet, Dark_facet> p = q.front();
- q.pop();
- light_ft = p.first;
- dark_ft = p.second;
- light_s = full_cell(light_ft);
- int light_i = index_of_covertex(light_ft);
- dark_s = dark_side.full_cell(dark_ft);
- int dark_i = dark_side.index_of_covertex(dark_ft);
- Full_cell_handle light_n = light_s->neighbor(light_i);
- set_neighbors(dark_s->data().light_copy_, dark_i, light_n, light_s->mirror_index(light_i));
- for( int di = 0; di <= current_dimension(); ++di )
- {
- if( di == dark_i )
- continue;
- int li = light_s->index(dark_s->vertex(di)->data());
- Rotor light_r(light_s, li, light_i);
- typename Dark_triangulation::Rotor dark_r(dark_s, di, dark_i);
-
- while (simps.contains(cpp11::get<0>(light_r)->neighbor(cpp11::get<1>(light_r))))
- light_r = rotate_rotor(light_r);
-
- while (conflict_zone.contains(cpp11::get<0>(dark_r)->neighbor(cpp11::get<1>(dark_r))))
- dark_r = dark_side.rotate_rotor(dark_r);
-
- Dark_s_handle dark_ns = cpp11::get<0>(dark_r);
- int dark_ni = cpp11::get<1>(dark_r);
- Full_cell_handle light_ns = cpp11::get<0>(light_r);
- int light_ni = cpp11::get<1>(light_r);
- // mark dark_r as visited:
- // TODO try by marking with Dark_v_handle (vertex)
- Dark_s_handle outside = dark_ns->neighbor(dark_ni);
- Dark_v_handle mirror = dark_ns->mirror_vertex(dark_ni, current_dimension());
- int dn = outside->index(mirror);
- if( Dark_s_handle() == outside->neighbor(dn) )
- continue;
- outside->set_neighbor(dn, Dark_s_handle());
- q.push(std::make_pair(Facet(light_ns, light_ni), Dark_facet(dark_ns, dark_ni)));
- }
- }
- tds().delete_full_cells(simps.begin(), simps.end());
- tds().delete_vertex(v);
- return ret_s;
-}
-
-template< typename DCTraits, typename TDS >
-void
-Delaunay_triangulation<DCTraits, TDS>
-::remove_decrease_dimension(Vertex_handle v)
-{
- CGAL_precondition( current_dimension() >= 0 );
- tds().remove_decrease_dimension(v, infinite_vertex());
- // reset the predicates:
- reset_flat_orientation();
- if( 1 <= current_dimension() )
- {
- Full_cell_handle inf_v_cell = infinite_vertex()->full_cell();
- int inf_v_index = inf_v_cell->index(infinite_vertex());
- Full_cell_handle s = inf_v_cell->neighbor(inf_v_index);
- Orientation o = orientation(s);
- CGAL_assertion( ZERO != o );
- if( NEGATIVE == o )
- reorient_full_cells();
- }
-}
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - INSERTIONS
-
-template< typename DCTraits, typename TDS >
-typename Delaunay_triangulation<DCTraits, TDS>::Vertex_handle
-Delaunay_triangulation<DCTraits, TDS>
-::insert(const Point & p, Locate_type lt, const Face & f, const Facet &, Full_cell_handle s)
-{
- switch( lt )
- {
- case Base::OUTSIDE_AFFINE_HULL:
- return insert_outside_affine_hull(p);
- break;
- case Base::ON_VERTEX:
- {
- Vertex_handle v = s->vertex(f.index(0));
- v->set_point(p);
- return v;
- break;
- }
- default:
- if( 1 == current_dimension() )
- {
- if( Base::OUTSIDE_CONVEX_HULL == lt )
- {
- return insert_outside_convex_hull_1(p, s);
- }
- Vertex_handle v = tds().insert_in_full_cell(s);
- v->set_point(p);
- return v;
- }
- else
- return insert_in_conflicting_cell(p, s);
- break;
- }
-}
-
-/*
-[Undocumented function]
-
-Inserts the point `p` in the Delaunay triangulation. Returns a handle to the
-(possibly newly created) vertex at that position.
-\pre The point `p`
-must lie outside the affine hull of the Delaunay triangulation. This implies that
-`dt`.`current_dimension()` must be less than `dt`.`maximal_dimension()`.
-*/
-template< typename DCTraits, typename TDS >
-typename Delaunay_triangulation<DCTraits, TDS>::Vertex_handle
-Delaunay_triangulation<DCTraits, TDS>
-::insert_outside_affine_hull(const Point & p)
-{
- // we don't use Base::insert_outside_affine_hull(...) because here, we
- // also need to reset the side_of_oriented_subsphere functor.
- CGAL_precondition( current_dimension() < maximal_dimension() );
- Vertex_handle v = tds().insert_increase_dimension(infinite_vertex());
- // reset the predicates:
- reset_flat_orientation();
- v->set_point(p);
- if( current_dimension() >= 1 )
- {
- Full_cell_handle inf_v_cell = infinite_vertex()->full_cell();
- int inf_v_index = inf_v_cell->index(infinite_vertex());
- Full_cell_handle s = inf_v_cell->neighbor(inf_v_index);
- Orientation o = orientation(s);
- CGAL_assertion( ZERO != o );
- if( NEGATIVE == o )
- reorient_full_cells();
-
- // We just inserted the second finite point and the right infinite
- // cell is like : (inf_v, v), but we want it to be (v, inf_v) to be
- // consistent with the rest of the cells
- if (current_dimension() == 1)
- {
- // Is "inf_v_cell" the right infinite cell?
- // Then inf_v_index should be 1
- if (inf_v_cell->neighbor(inf_v_index)->index(inf_v_cell) == 0
- && inf_v_index == 0)
- {
- inf_v_cell->swap_vertices(
- current_dimension() - 1, current_dimension());
- }
- // Otherwise, let's find the right infinite cell
- else
- {
- inf_v_cell = inf_v_cell->neighbor((inf_v_index + 1) % 2);
- inf_v_index = inf_v_cell->index(infinite_vertex());
- // Is "inf_v_cell" the right infinite cell?
- // Then inf_v_index should be 1
- if (inf_v_cell->neighbor(inf_v_index)->index(inf_v_cell) == 0
- && inf_v_index == 0)
- {
- inf_v_cell->swap_vertices(
- current_dimension() - 1, current_dimension());
- }
- }
- }
- }
- return v;
-}
-
-/*!
-[Undocumented function]
-
-Inserts the point `p` in the Delaunay triangulation. Returns a handle to the
-(possibly newly created) vertex at that position.
-\pre The point `p` must be in conflict with the full cell `c`.
-*/
-template< typename DCTraits, typename TDS >
-typename Delaunay_triangulation<DCTraits, TDS>::Vertex_handle
-Delaunay_triangulation<DCTraits, TDS>
-::insert_in_conflicting_cell(const Point & p, Full_cell_handle s)
-{
- CGAL_precondition(is_in_conflict(p, s));
-
- // for storing conflicting full_cells.
- typedef std::vector<Full_cell_handle> Full_cell_h_vector;
- CGAL_STATIC_THREAD_LOCAL_VARIABLE(Full_cell_h_vector,cs,0);
- cs.clear();
-
- std::back_insert_iterator<Full_cell_h_vector> out(cs);
- Facet ft = compute_conflict_zone(p, s, out);
- return insert_in_hole(p, cs.begin(), cs.end(), ft);
-}
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - GATHERING CONFLICTING SIMPLICES
-
-// NOT DOCUMENTED
-template< typename DCTraits, typename TDS >
-template< typename OrientationPred >
-Oriented_side
-Delaunay_triangulation<DCTraits, TDS>
-::perturbed_side_of_positive_sphere(const Point & p, Full_cell_const_handle s,
- const OrientationPred & ori) const
-{
- CGAL_precondition_msg( ! is_infinite(s), "full cell must be finite");
- CGAL_expensive_precondition( POSITIVE == orientation(s) );
- typedef std::vector<const Point *> Points;
- Points points(current_dimension() + 2);
- int i(0);
- for( ; i <= current_dimension(); ++i )
- points[i] = &(s->vertex(i)->point());
- points[i] = &p;
- std::sort(points.begin(), points.end(),
- internal::Triangulation::Compare_points_for_perturbation<Self>(*this));
- typename Points::const_reverse_iterator cut_pt = points.rbegin();
- Points test_points;
- while( cut_pt != points.rend() )
- {
- if( &p == *cut_pt )
- // because the full_cell "s" is assumed to be positively oriented
- return ON_NEGATIVE_SIDE; // we consider |p| to lie outside the sphere
- test_points.clear();
- typename Base::Point_const_iterator spit = points_begin(s);
- int adjust_sign = -1;
- for( i = 0; i < current_dimension(); ++i )
- {
- if( &(*spit) == *cut_pt )
- {
- ++spit;
- adjust_sign = (((current_dimension() + i) % 2) == 0) ? -1 : +1;
- }
- test_points.push_back(&(*spit));
- ++spit;
- }
- test_points.push_back(&p);
-
- typedef typename CGAL::Iterator_project<typename Points::iterator,
- internal::Triangulation::Point_from_pointer<Self>,
- const Point &, const Point *> Point_pointer_iterator;
-
- Orientation ori_value = ori(
- Point_pointer_iterator(test_points.begin()),
- Point_pointer_iterator(test_points.end()));
-
- if( ZERO != ori_value )
- return Oriented_side( - adjust_sign * ori_value );
-
- ++cut_pt;
- }
- CGAL_assertion(false); // we should never reach here
- return ON_NEGATIVE_SIDE;
-}
-
-template< typename DCTraits, typename TDS >
-bool
-Delaunay_triangulation<DCTraits, TDS>
-::is_in_conflict(const Point & p, Full_cell_const_handle s) const
-{
- CGAL_precondition( 2 <= current_dimension() );
- if( current_dimension() < maximal_dimension() )
- {
- Conflict_pred_in_subspace c(*this, p, coaffine_orientation_predicate(), side_of_oriented_subsphere_predicate());
- return c(s);
- }
- else
- {
- Orientation_d ori = geom_traits().orientation_d_object();
- Side_of_oriented_sphere_d side = geom_traits().side_of_oriented_sphere_d_object();
- Conflict_pred_in_fullspace c(*this, p, ori, side);
- return c(s);
- }
-}
-
-template< typename DCTraits, typename TDS >
-template< typename OutputIterator >
-typename Delaunay_triangulation<DCTraits, TDS>::Facet
-Delaunay_triangulation<DCTraits, TDS>
-::compute_conflict_zone(const Point & p, Full_cell_handle s, OutputIterator out) const
-{
- CGAL_precondition( 2 <= current_dimension() );
- if( current_dimension() < maximal_dimension() )
- {
- Conflict_pred_in_subspace c(*this, p, coaffine_orientation_predicate(), side_of_oriented_subsphere_predicate());
- Conflict_traversal_pred_in_subspace tp(*this, c);
- return tds().gather_full_cells(s, tp, out);
- }
- else
- {
- Orientation_d ori = geom_traits().orientation_d_object();
- Side_of_oriented_sphere_d side = geom_traits().side_of_oriented_sphere_d_object();
- Conflict_pred_in_fullspace c(*this, p, ori, side);
- Conflict_traversal_pred_in_fullspace tp(*this, c);
- return tds().gather_full_cells(s, tp, out);
- }
-}
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - VALIDITY
-
-template< typename DCTraits, typename TDS >
-bool
-Delaunay_triangulation<DCTraits, TDS>
-::is_valid(bool verbose, int level) const
-{
- if (!Base::is_valid(verbose, level))
- return false;
-
- int dim = current_dimension();
- if (dim == maximal_dimension())
- {
- for (Finite_full_cell_const_iterator cit = this->finite_full_cells_begin() ;
- cit != this->finite_full_cells_end() ; ++cit )
- {
- Full_cell_const_handle ch = cit.base();
- for(int i = 0; i < dim+1 ; ++i )
- {
- // If the i-th neighbor is not an infinite cell
- Vertex_handle opposite_vh =
- ch->neighbor(i)->vertex(ch->neighbor(i)->index(ch));
- if (!is_infinite(opposite_vh))
- {
- Side_of_oriented_sphere_d side =
- geom_traits().side_of_oriented_sphere_d_object();
- if (side(Point_const_iterator(ch->vertices_begin()),
- Point_const_iterator(ch->vertices_end()),
- opposite_vh->point()) == ON_BOUNDED_SIDE)
- {
- if (verbose)
- CGAL_warning_msg(false, "Non-empty sphere");
- return false;
- }
- }
- }
- }
- }
- return true;
-}
-
-
-} //namespace CGAL
-
-#endif // CGAL_DELAUNAY_COMPLEX_H
diff --git a/include/gudhi_patches/CGAL/Epeck_d.h b/include/gudhi_patches/CGAL/Epeck_d.h
deleted file mode 100644
index 52bce84c..00000000
--- a/include/gudhi_patches/CGAL/Epeck_d.h
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_EPECK_D_H
-#define CGAL_EPECK_D_H
-#include <CGAL/NewKernel_d/Cartesian_base.h>
-#include <CGAL/NewKernel_d/Wrapper/Cartesian_wrap.h>
-#include <CGAL/NewKernel_d/Kernel_d_interface.h>
-#include <CGAL/internal/Exact_type_selector.h>
-
-
-namespace CGAL {
-#define CGAL_BASE \
- Cartesian_base_d<internal::Exact_field_selector<double>::Type, Dim>
-template<class Dim>
-struct Epeck_d_help1
-: CGAL_BASE
-{
- CGAL_CONSTEXPR Epeck_d_help1(){}
- CGAL_CONSTEXPR Epeck_d_help1(int d):CGAL_BASE(d){}
-};
-#undef CGAL_BASE
-#define CGAL_BASE \
- Kernel_d_interface< \
- Cartesian_wrap< \
- Epeck_d_help1<Dim>, \
- Epeck_d<Dim> > >
-template<class Dim>
-struct Epeck_d
-: CGAL_BASE
-{
- CGAL_CONSTEXPR Epeck_d(){}
- CGAL_CONSTEXPR Epeck_d(int d):CGAL_BASE(d){}
-};
-#undef CGAL_BASE
-}
-#endif
diff --git a/include/gudhi_patches/CGAL/Epick_d.h b/include/gudhi_patches/CGAL/Epick_d.h
deleted file mode 100644
index 64438539..00000000
--- a/include/gudhi_patches/CGAL/Epick_d.h
+++ /dev/null
@@ -1,71 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_EPICK_D_H
-#define CGAL_EPICK_D_H
-#include <CGAL/NewKernel_d/Cartesian_base.h>
-#include <CGAL/NewKernel_d/Cartesian_static_filters.h>
-#include <CGAL/NewKernel_d/Cartesian_filter_K.h>
-#include <CGAL/NewKernel_d/Wrapper/Cartesian_wrap.h>
-#include <CGAL/NewKernel_d/Kernel_d_interface.h>
-#include <CGAL/internal/Exact_type_selector.h>
-#include <CGAL/Interval_nt.h>
-#include <CGAL/NewKernel_d/Types/Weighted_point.h>
-
-
-namespace CGAL {
-#define CGAL_BASE \
- Cartesian_filter_K< \
- Cartesian_base_d<double, Dim>, \
- Cartesian_base_d<Interval_nt_advanced, Dim>, \
- Cartesian_base_d<internal::Exact_field_selector<double>::Type, Dim> \
- >
-template<class Dim>
-struct Epick_d_help1
-: CGAL_BASE
-{
- CGAL_CONSTEXPR Epick_d_help1(){}
- CGAL_CONSTEXPR Epick_d_help1(int d):CGAL_BASE(d){}
-};
-#undef CGAL_BASE
-#define CGAL_BASE \
- Cartesian_static_filters<Dim,Epick_d_help1<Dim>,Epick_d_help2<Dim> >
-template<class Dim>
-struct Epick_d_help2
-: CGAL_BASE
-{
- CGAL_CONSTEXPR Epick_d_help2(){}
- CGAL_CONSTEXPR Epick_d_help2(int d):CGAL_BASE(d){}
-};
-#undef CGAL_BASE
-#define CGAL_BASE \
- Kernel_d_interface< \
- Cartesian_wrap< \
- Epick_d_help2<Dim>, \
- Epick_d<Dim> > >
-template<class Dim>
-struct Epick_d
-: CGAL_BASE
-{
- CGAL_CONSTEXPR Epick_d(){}
- CGAL_CONSTEXPR Epick_d(int d):CGAL_BASE(d){}
-};
-#undef CGAL_BASE
-}
-#endif
diff --git a/include/gudhi_patches/CGAL/IO/Triangulation_off_ostream.h b/include/gudhi_patches/CGAL/IO/Triangulation_off_ostream.h
deleted file mode 100644
index 701f0820..00000000
--- a/include/gudhi_patches/CGAL/IO/Triangulation_off_ostream.h
+++ /dev/null
@@ -1,320 +0,0 @@
-// Copyright (c) 2014 INRIA Sophia-Antipolis (France).
-// All rights reserved.
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL: $
-// $Id: $
-//
-// Author(s) : Clement Jamin
-
-
-#ifndef CGAL_TRIANGULATION_IO_H
-#define CGAL_TRIANGULATION_IO_H
-
-#include <CGAL/Epick_d.h>
-#include <CGAL/Triangulation.h>
-#include <sstream>
-#include <iostream>
-
-namespace CGAL {
-
-namespace Triangulation_IO
-{
-// TODO: test if the stream is binary or text?
-template<typename Traits, typename P>
-int
-output_point(std::ostream & os, const Traits &traits, const P & p)
-{
- typedef typename Traits::Compute_coordinate_d Ccd;
- const Ccd ccd = traits.compute_coordinate_d_object();
- const int dim = traits.point_dimension_d_object()(p);
- if (dim > 0)
- {
- os << ccd(p, 0);
- for (int i = 1 ; i < dim ; ++i)
- os << " " << CGAL::to_double(ccd(p, i));
- }
- return dim;
-}
-
-// TODO: test if the stream is binary or text?
-template<typename Traits, typename P>
-int
-output_weighted_point(std::ostream & os, const Traits &traits, const P & p,
- bool output_weight = true)
-{
- typedef typename Traits::Compute_coordinate_d Ccd;
- typename Traits::Construct_point_d cp =
- traits.construct_point_d_object();
- typename Traits::Compute_weight_d pt_weight = traits.compute_weight_d_object();
- const Ccd ccd = traits.compute_coordinate_d_object();
- const int dim = traits.point_dimension_d_object()(p);
- if (dim > 0)
- {
- output_point(os, traits, p);
- if (output_weight)
- os << " " << pt_weight(p);
- }
- return dim;
-}
-
-// TODO: test if the stream is binary or text?
-template<typename Traits, typename FCH>
-void
-output_full_cell(std::ostream & os, const Traits &traits, const FCH & fch,
- bool output_weights = false)
-{
- typename FCH::value_type::Vertex_handle_iterator vit = fch->vertices_begin();
- for( ; vit != fch->vertices_end(); ++vit )
- {
- int dim;
- if (output_weights)
- dim = output_weighted_point(os, traits, (*vit)->point());
- else
- dim = output_point(os, traits, (*vit)->point());
- if (dim > 0)
- os << std::endl;
- }
-}
-
-// TODO: test if the stream is binary or text?
-/*template<typename Traits, typename P>
-void
-input_point(std::istream & is, const Traits &traits, P & p)
-{
- typedef typename Traits::FT FT;
- std::vector<FT> coords;
-
- std::string line;
- for(;;)
- {
- if (!std::getline(is, line))
- return is;
- if (line != "")
- break;
- }
- std::stringstream line_sstr(line);
- FT temp;
- while (line_sstr >> temp)
- coords.push_back(temp);
-
- p = traits.construct_point_d_object()(coords.begin(), coords.end());
-}*/
-
-} // namespace Triangulation_IO
-
-///////////////////////////////////////////////////////////////
-// TODO: replace these operator>> by an "input_point" function
-///////////////////////////////////////////////////////////////
-
-// TODO: test if the stream is binary or text?
-template<typename K>
-std::istream &
-operator>>(std::istream &is, typename Wrap::Point_d<K> & p)
-{
- typedef typename Wrap::Point_d<K> P;
- typedef typename K::FT FT;
- std::vector<FT> coords;
-
- std::string line;
- for(;;)
- {
- if (!std::getline(is, line))
- return is;
- if (line != "")
- break;
- }
- std::stringstream line_sstr(line);
- FT temp;
- while (line_sstr >> temp)
- coords.push_back(temp);
-
- p = P(coords.begin(), coords.end());
- return is;
-}
-
-// TODO: test if the stream is binary or text?
-template<typename K>
-std::istream &
-operator>>(std::istream &is, typename Wrap::Weighted_point_d<K> & wp)
-{
- typedef typename Wrap::Point_d<K> P;
- typedef typename Wrap::Weighted_point_d<K> WP;
- typedef typename K::FT FT;
-
- std::string line;
- for(;;)
- {
- if (!std::getline(is, line))
- return is;
- if (line != "")
- break;
- }
- std::stringstream line_sstr(line);
- FT temp;
- std::vector<FT> coords;
- while (line_sstr >> temp)
- coords.push_back(temp);
-
- typename std::vector<FT>::iterator last = coords.end() - 1;
- P p = P(coords.begin(), last);
- wp = WP(p, *last);
-
- return is;
-}
-
-// TODO: test if the stream is binary or text?
-template<typename K>
-std::istream &
-operator>>(std::istream &is, typename Wrap::Vector_d<K> & v)
-{
- typedef typename Wrap::Vector_d<K> V;
- typedef typename K::FT FT;
- std::vector<FT> coords;
-
- std::string line;
- for (;;)
- {
- if (!std::getline(is, line))
- return is;
- if (line != "")
- break;
- }
- std::stringstream line_sstr(line);
- FT temp;
- while (line_sstr >> temp)
- coords.push_back(temp);
-
- v = V(coords.begin(), coords.end());
- return is;
-}
-
-template < class GT, class TDS >
-std::ostream &
-export_triangulation_to_off(std::ostream & os,
- const Triangulation<GT,TDS> & tr,
- bool in_3D_export_surface_only = false)
-{
- typedef Triangulation<GT,TDS> Tr;
- typedef typename Tr::Vertex_const_handle Vertex_handle;
- typedef typename Tr::Finite_vertex_const_iterator Finite_vertex_iterator;
- typedef typename Tr::Finite_full_cell_const_iterator Finite_full_cell_iterator;
- typedef typename Tr::Full_cell_const_iterator Full_cell_iterator;
- typedef typename Tr::Full_cell Full_cell;
- typedef typename Full_cell::Vertex_handle_const_iterator Full_cell_vertex_iterator;
-
- if (tr.maximal_dimension() < 2 || tr.maximal_dimension() > 3)
- {
- std::cerr << "Warning: export_tds_to_off => dimension should be 2 or 3.";
- os << "Warning: export_tds_to_off => dimension should be 2 or 3.";
- return os;
- }
-
- size_t n = tr.number_of_vertices();
-
- std::stringstream output;
-
- // write the vertices
- std::map<Vertex_handle, int> index_of_vertex;
- int i = 0;
- for(Finite_vertex_iterator it = tr.finite_vertices_begin();
- it != tr.finite_vertices_end(); ++it, ++i)
- {
- Triangulation_IO::output_point(output, tr.geom_traits(), it->point());
- if (tr.maximal_dimension() == 2)
- output << " 0";
- output << std::endl;
- index_of_vertex[it.base()] = i;
- }
- CGAL_assertion( i == n );
-
- size_t number_of_triangles = 0;
- if (tr.maximal_dimension() == 2)
- {
- for (Finite_full_cell_iterator fch = tr.finite_full_cells_begin() ;
- fch != tr.finite_full_cells_end() ; ++fch)
- {
- output << "3 ";
- for (Full_cell_vertex_iterator vit = fch->vertices_begin() ;
- vit != fch->vertices_end() ; ++vit)
- {
- output << index_of_vertex[*vit] << " ";
- }
- output << std::endl;
- ++number_of_triangles;
- }
- }
- else if (tr.maximal_dimension() == 3)
- {
- if (in_3D_export_surface_only)
- {
- // Parse boundary facets
- for (Full_cell_iterator fch = tr.full_cells_begin() ;
- fch != tr.full_cells_end() ; ++fch)
- {
- if (tr.is_infinite(fch))
- {
- output << "3 ";
- for (Full_cell_vertex_iterator vit = fch->vertices_begin() ;
- vit != fch->vertices_end() ; ++vit)
- {
- if (!tr.is_infinite(*vit))
- output << index_of_vertex[*vit] << " ";
- }
- output << std::endl;
- ++number_of_triangles;
- }
- }
- }
- else
- {
- // Parse finite cells
- for (Finite_full_cell_iterator fch = tr.finite_full_cells_begin() ;
- fch != tr.finite_full_cells_end() ; ++fch)
- {
- output << "3 "
- << index_of_vertex[fch->vertex(0)] << " "
- << index_of_vertex[fch->vertex(1)] << " "
- << index_of_vertex[fch->vertex(2)]
- << std::endl;
- output << "3 "
- << index_of_vertex[fch->vertex(0)] << " "
- << index_of_vertex[fch->vertex(2)] << " "
- << index_of_vertex[fch->vertex(3)]
- << std::endl;
- output << "3 "
- << index_of_vertex[fch->vertex(1)] << " "
- << index_of_vertex[fch->vertex(2)] << " "
- << index_of_vertex[fch->vertex(3)]
- << std::endl;
- output << "3 "
- << index_of_vertex[fch->vertex(0)] << " "
- << index_of_vertex[fch->vertex(1)] << " "
- << index_of_vertex[fch->vertex(3)]
- << std::endl;
- number_of_triangles += 4;
- }
- }
- }
-
- os << "OFF \n"
- << n << " "
- << number_of_triangles << " 0\n"
- << output.str();
-
- return os;
-}
-
-} //namespace CGAL
-
-#endif // CGAL_TRIANGULATION_IO_H
diff --git a/include/gudhi_patches/CGAL/Kd_tree.h b/include/gudhi_patches/CGAL/Kd_tree.h
deleted file mode 100644
index f085b0da..00000000
--- a/include/gudhi_patches/CGAL/Kd_tree.h
+++ /dev/null
@@ -1,582 +0,0 @@
-// Copyright (c) 2002,2011,2014 Utrecht University (The Netherlands), Max-Planck-Institute Saarbruecken (Germany).
-// All rights reserved.
-//
-// This file is part of CGAL (www.cgal.org).
-// 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.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Hans Tangelder (<hanst@cs.uu.nl>),
-// : Waqar Khan <wkhan@mpi-inf.mpg.de>
-
-#ifndef CGAL_KD_TREE_H
-#define CGAL_KD_TREE_H
-
-#include "Kd_tree_node.h"
-
-#include <CGAL/basic.h>
-#include <CGAL/assertions.h>
-#include <vector>
-
-#include <CGAL/algorithm.h>
-#include <CGAL/internal/Get_dimension_tag.h>
-#include <CGAL/Search_traits.h>
-
-
-#include <deque>
-#include <boost/container/deque.hpp>
-#include <boost/optional.hpp>
-
-#ifdef CGAL_HAS_THREADS
-#include <CGAL/mutex.h>
-#endif
-
-namespace CGAL {
-
-//template <class SearchTraits, class Splitter_=Median_of_rectangle<SearchTraits>, class UseExtendedNode = Tag_true >
-template <class SearchTraits, class Splitter_=Sliding_midpoint<SearchTraits>, class UseExtendedNode = Tag_true >
-class Kd_tree {
-
-public:
- typedef SearchTraits Traits;
- typedef Splitter_ Splitter;
- typedef typename SearchTraits::Point_d Point_d;
- typedef typename Splitter::Container Point_container;
-
- typedef typename SearchTraits::FT FT;
- typedef Kd_tree_node<SearchTraits, Splitter, UseExtendedNode > Node;
- typedef Kd_tree_leaf_node<SearchTraits, Splitter, UseExtendedNode > Leaf_node;
- typedef Kd_tree_internal_node<SearchTraits, Splitter, UseExtendedNode > Internal_node;
- typedef Kd_tree<SearchTraits, Splitter> Tree;
- typedef Kd_tree<SearchTraits, Splitter,UseExtendedNode> Self;
-
- typedef Node* Node_handle;
- typedef const Node* Node_const_handle;
- typedef Leaf_node* Leaf_node_handle;
- typedef const Leaf_node* Leaf_node_const_handle;
- typedef Internal_node* Internal_node_handle;
- typedef const Internal_node* Internal_node_const_handle;
- typedef typename std::vector<const Point_d*>::const_iterator Point_d_iterator;
- typedef typename std::vector<const Point_d*>::const_iterator Point_d_const_iterator;
- typedef typename Splitter::Separator Separator;
- typedef typename std::vector<Point_d>::const_iterator iterator;
- typedef typename std::vector<Point_d>::const_iterator const_iterator;
-
- typedef typename std::vector<Point_d>::size_type size_type;
-
- typedef typename internal::Get_dimension_tag<SearchTraits>::Dimension D;
-
-private:
- SearchTraits traits_;
- Splitter split;
-
-
- // wokaround for https://svn.boost.org/trac/boost/ticket/9332
-#if (_MSC_VER == 1800) && (BOOST_VERSION == 105500)
- std::deque<Internal_node> internal_nodes;
- std::deque<Leaf_node> leaf_nodes;
-#else
- boost::container::deque<Internal_node> internal_nodes;
- boost::container::deque<Leaf_node> leaf_nodes;
-#endif
-
- Node_handle tree_root;
-
- Kd_tree_rectangle<FT,D>* bbox;
- std::vector<Point_d> pts;
-
- // Instead of storing the points in arrays in the Kd_tree_node
- // we put all the data in a vector in the Kd_tree.
- // and we only store an iterator range in the Kd_tree_node.
- //
- std::vector<const Point_d*> data;
-
-
- #ifdef CGAL_HAS_THREADS
- mutable CGAL_MUTEX building_mutex;//mutex used to protect const calls inducing build()
- #endif
- bool built_;
- bool removed_;
-
- // protected copy constructor
- Kd_tree(const Tree& tree)
- : traits_(tree.traits_),built_(tree.built_)
- {};
-
-
- // Instead of the recursive construction of the tree in the class Kd_tree_node
- // we do this in the tree class. The advantage is that we then can optimize
- // the allocation of the nodes.
-
- // The leaf node
- Node_handle
- create_leaf_node(Point_container& c)
- {
- Leaf_node node(true , static_cast<unsigned int>(c.size()));
- std::ptrdiff_t tmp = c.begin() - data.begin();
- node.data = pts.begin() + tmp;
-
- leaf_nodes.push_back(node);
- Leaf_node_handle nh = &leaf_nodes.back();
-
-
- return nh;
- }
-
-
- // The internal node
-
- Node_handle
- create_internal_node(Point_container& c, const Tag_true&)
- {
- return create_internal_node_use_extension(c);
- }
-
- Node_handle
- create_internal_node(Point_container& c, const Tag_false&)
- {
- return create_internal_node(c);
- }
-
-
-
- // TODO: Similiar to the leaf_init function above, a part of the code should be
- // moved to a the class Kd_tree_node.
- // It is not proper yet, but the goal was to see if there is
- // a potential performance gain through the Compact_container
- Node_handle
- create_internal_node_use_extension(Point_container& c)
- {
- Internal_node node(false);
- internal_nodes.push_back(node);
- Internal_node_handle nh = &internal_nodes.back();
-
- Separator sep;
- Point_container c_low(c.dimension(),traits_);
- split(sep, c, c_low);
- nh->set_separator(sep);
-
- int cd = nh->cutting_dimension();
- if(!c_low.empty()){
- nh->lower_low_val = c_low.tight_bounding_box().min_coord(cd);
- nh->lower_high_val = c_low.tight_bounding_box().max_coord(cd);
- }
- else{
- nh->lower_low_val = nh->cutting_value();
- nh->lower_high_val = nh->cutting_value();
- }
- if(!c.empty()){
- nh->upper_low_val = c.tight_bounding_box().min_coord(cd);
- nh->upper_high_val = c.tight_bounding_box().max_coord(cd);
- }
- else{
- nh->upper_low_val = nh->cutting_value();
- nh->upper_high_val = nh->cutting_value();
- }
-
- CGAL_assertion(nh->cutting_value() >= nh->lower_low_val);
- CGAL_assertion(nh->cutting_value() <= nh->upper_high_val);
-
- if (c_low.size() > split.bucket_size()){
- nh->lower_ch = create_internal_node_use_extension(c_low);
- }else{
- nh->lower_ch = create_leaf_node(c_low);
- }
- if (c.size() > split.bucket_size()){
- nh->upper_ch = create_internal_node_use_extension(c);
- }else{
- nh->upper_ch = create_leaf_node(c);
- }
-
-
-
-
- return nh;
- }
-
-
- // Note also that I duplicated the code to get rid if the if's for
- // the boolean use_extension which was constant over the construction
- Node_handle
- create_internal_node(Point_container& c)
- {
- Internal_node node(false);
- internal_nodes.push_back(node);
- Internal_node_handle nh = &internal_nodes.back();
- Separator sep;
-
- Point_container c_low(c.dimension(),traits_);
- split(sep, c, c_low);
- nh->set_separator(sep);
-
- if (c_low.size() > split.bucket_size()){
- nh->lower_ch = create_internal_node(c_low);
- }else{
- nh->lower_ch = create_leaf_node(c_low);
- }
- if (c.size() > split.bucket_size()){
- nh->upper_ch = create_internal_node(c);
- }else{
- nh->upper_ch = create_leaf_node(c);
- }
-
-
-
- return nh;
- }
-
-
-
-public:
-
- Kd_tree(Splitter s = Splitter(),const SearchTraits traits=SearchTraits())
- : traits_(traits),split(s), built_(false), removed_(false)
- {}
-
- template <class InputIterator>
- Kd_tree(InputIterator first, InputIterator beyond,
- Splitter s = Splitter(),const SearchTraits traits=SearchTraits())
- : traits_(traits),split(s), built_(false), removed_(false)
- {
- pts.insert(pts.end(), first, beyond);
- }
-
- bool empty() const {
- return pts.empty();
- }
-
- void
- build()
- {
- // This function is not ready to be called when a tree already exists, one
- // must call invalidate_built() first.
- CGAL_assertion(!is_built());
- CGAL_assertion(!removed_);
- const Point_d& p = *pts.begin();
- typename SearchTraits::Construct_cartesian_const_iterator_d ccci=traits_.construct_cartesian_const_iterator_d_object();
- int dim = static_cast<int>(std::distance(ccci(p), ccci(p,0)));
-
- data.reserve(pts.size());
- for(unsigned int i = 0; i < pts.size(); i++){
- data.push_back(&pts[i]);
- }
- Point_container c(dim, data.begin(), data.end(),traits_);
- bbox = new Kd_tree_rectangle<FT,D>(c.bounding_box());
- if (c.size() <= split.bucket_size()){
- tree_root = create_leaf_node(c);
- }else {
- tree_root = create_internal_node(c, UseExtendedNode());
- }
-
- //Reorder vector for spatial locality
- std::vector<Point_d> ptstmp;
- ptstmp.resize(pts.size());
- for (std::size_t i = 0; i < pts.size(); ++i){
- ptstmp[i] = *data[i];
- }
- for(std::size_t i = 0; i < leaf_nodes.size(); ++i){
- std::ptrdiff_t tmp = leaf_nodes[i].begin() - pts.begin();
- leaf_nodes[i].data = ptstmp.begin() + tmp;
- }
- pts.swap(ptstmp);
-
- data.clear();
-
- built_ = true;
- }
-
-private:
- //any call to this function is for the moment not threadsafe
- void const_build() const {
- #ifdef CGAL_HAS_THREADS
- //this ensure that build() will be called once
- CGAL_SCOPED_LOCK(building_mutex);
- if(!is_built())
- #endif
- const_cast<Self*>(this)->build(); //THIS IS NOT THREADSAFE
- }
-public:
-
- bool is_built() const
- {
- return built_;
- }
-
- void invalidate_built()
- {
- if(removed_){
- // Walk the tree to collect the remaining points.
- // Writing directly to pts would likely work, but better be safe.
- std::vector<Point_d> ptstmp;
- //ptstmp.resize(root()->num_items());
- root()->tree_items(std::back_inserter(ptstmp));
- pts.swap(ptstmp);
- removed_=false;
- CGAL_assertion(is_built()); // the rest of the cleanup must happen
- }
- if(is_built()){
- internal_nodes.clear();
- leaf_nodes.clear();
- data.clear();
- delete bbox;
- built_ = false;
- }
- }
-
- void clear()
- {
- invalidate_built();
- pts.clear();
- removed_ = false;
- }
-
- void
- insert(const Point_d& p)
- {
- invalidate_built();
- pts.push_back(p);
- }
-
- template <class InputIterator>
- void
- insert(InputIterator first, InputIterator beyond)
- {
- invalidate_built();
- pts.insert(pts.end(),first, beyond);
- }
-
-private:
- struct Equal_by_coordinates {
- SearchTraits const* traits;
- Point_d const* pp;
- bool operator()(Point_d const&q) const {
- typename SearchTraits::Construct_cartesian_const_iterator_d ccci=traits->construct_cartesian_const_iterator_d_object();
- return std::equal(ccci(*pp), ccci(*pp,0), ccci(q));
- }
- };
- Equal_by_coordinates equal_by_coordinates(Point_d const&p){
- Equal_by_coordinates ret = { &traits(), &p };
- return ret;
- }
-
-public:
- void
- remove(const Point_d& p)
- {
- remove(p, equal_by_coordinates(p));
- }
-
- template<class Equal>
- void
- remove(const Point_d& p, Equal const& equal_to_p)
- {
-#if 0
- // This code could have quadratic runtime.
- if (!is_built()) {
- std::vector<Point_d>::iterator pi = std::find(pts.begin(), pts.end(), p);
- // Precondition: the point must be there.
- CGAL_assertion (pi != pts.end());
- pts.erase(pi);
- return;
- }
-#endif
- bool success = remove_(p, 0, false, 0, false, root(), equal_to_p);
- CGAL_assertion(success);
-
- // Do not set the flag is the tree has been cleared.
- if(is_built())
- removed_ |= success;
- }
-private:
- template<class Equal>
- bool remove_(const Point_d& p,
- Internal_node_handle grandparent, bool parent_islower,
- Internal_node_handle parent, bool islower,
- Node_handle node, Equal const& equal_to_p) {
- // Recurse to locate the point
- if (!node->is_leaf()) {
- Internal_node_handle newparent = static_cast<Internal_node_handle>(node);
- // FIXME: This should be if(x<y) remove low; else remove up;
- if (traits().construct_cartesian_const_iterator_d_object()(p)[newparent->cutting_dimension()] <= newparent->cutting_value()) {
- if (remove_(p, parent, islower, newparent, true, newparent->lower(), equal_to_p))
- return true;
- }
- //if (traits().construct_cartesian_const_iterator_d_object()(p)[newparent->cutting_dimension()] >= newparent->cutting_value())
- return remove_(p, parent, islower, newparent, false, newparent->upper(), equal_to_p);
-
- CGAL_assertion(false); // Point was not found
- }
-
- // Actual removal
- Leaf_node_handle lnode = static_cast<Leaf_node_handle>(node);
- if (lnode->size() > 1) {
- iterator pi = std::find_if(lnode->begin(), lnode->end(), equal_to_p);
- // FIXME: we should ensure this never happens
- if (pi == lnode->end()) return false;
- iterator lasti = lnode->end() - 1;
- if (pi != lasti) {
- // Hack to get a non-const iterator
- std::iter_swap(pts.begin()+(pi-pts.begin()), pts.begin()+(lasti-pts.begin()));
- }
- lnode->drop_last_point();
- } else if (!equal_to_p(*lnode->begin())) {
- // FIXME: we should ensure this never happens
- return false;
- } else if (grandparent) {
- Node_handle brother = islower ? parent->upper() : parent->lower();
- if (parent_islower)
- grandparent->set_lower(brother);
- else
- grandparent->set_upper(brother);
- } else if (parent) {
- tree_root = islower ? parent->upper() : parent->lower();
- } else {
- clear();
- }
- return true;
- }
-
-public:
- //For efficiency; reserve the size of the points vectors in advance (if the number of points is already known).
- void reserve(size_t size)
- {
- pts.reserve(size);
- }
-
- //Get the capacity of the underlying points vector.
- size_t capacity()
- {
- return pts.capacity();
- }
-
-
- template <class OutputIterator, class FuzzyQueryItem>
- OutputIterator
- search(OutputIterator it, const FuzzyQueryItem& q) const
- {
- if(! pts.empty()){
-
- if(! is_built()){
- const_build();
- }
- Kd_tree_rectangle<FT,D> b(*bbox);
- return tree_root->search(it,q,b);
- }
- return it;
- }
-
-
- template <class FuzzyQueryItem>
- boost::optional<Point_d>
- search_any_point(const FuzzyQueryItem& q) const
- {
- if(! pts.empty()){
-
- if(! is_built()){
- const_build();
- }
- Kd_tree_rectangle<FT,D> b(*bbox);
- return tree_root->search_any_point(q,b);
- }
- return boost::none;
- }
-
-
- ~Kd_tree() {
- if(is_built()){
- delete bbox;
- }
- }
-
-
- const SearchTraits&
- traits() const
- {
- return traits_;
- }
-
- Node_const_handle
- root() const
- {
- if(! is_built()){
- const_build();
- }
- return tree_root;
- }
-
- Node_handle
- root()
- {
- if(! is_built()){
- build();
- }
- return tree_root;
- }
-
- void
- print() const
- {
- if(! is_built()){
- const_build();
- }
- root()->print();
- }
-
- const Kd_tree_rectangle<FT,D>&
- bounding_box() const
- {
- if(! is_built()){
- const_build();
- }
- return *bbox;
- }
-
- const_iterator
- begin() const
- {
- return pts.begin();
- }
-
- const_iterator
- end() const
- {
- return pts.end();
- }
-
- size_type
- size() const
- {
- return pts.size();
- }
-
- // Print statistics of the tree.
- std::ostream&
- statistics(std::ostream& s) const
- {
- if(! is_built()){
- const_build();
- }
- s << "Tree statistics:" << std::endl;
- s << "Number of items stored: "
- << root()->num_items() << std::endl;
- s << "Number of nodes: "
- << root()->num_nodes() << std::endl;
- s << " Tree depth: " << root()->depth() << std::endl;
- return s;
- }
-
-
-};
-
-} // namespace CGAL
-
-#endif // CGAL_KD_TREE_H
diff --git a/include/gudhi_patches/CGAL/Kd_tree_node.h b/include/gudhi_patches/CGAL/Kd_tree_node.h
deleted file mode 100644
index 909ee260..00000000
--- a/include/gudhi_patches/CGAL/Kd_tree_node.h
+++ /dev/null
@@ -1,586 +0,0 @@
-// Copyright (c) 2002,2011 Utrecht University (The Netherlands).
-// All rights reserved.
-//
-// This file is part of CGAL (www.cgal.org).
-// 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.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-//
-// Authors : Hans Tangelder (<hanst@cs.uu.nl>)
-
-#ifndef CGAL_KD_TREE_NODE_H
-#define CGAL_KD_TREE_NODE_H
-
-#include "CGAL/Splitters.h"
-
-#include <CGAL/Compact_container.h>
-#include <boost/cstdint.hpp>
-
-namespace CGAL {
-
- template <class SearchTraits, class Splitter, class UseExtendedNode>
- class Kd_tree;
-
- template < class TreeTraits, class Splitter, class UseExtendedNode >
- class Kd_tree_node {
-
- friend class Kd_tree<TreeTraits,Splitter,UseExtendedNode>;
-
- typedef typename Kd_tree<TreeTraits,Splitter,UseExtendedNode>::Node_handle Node_handle;
- typedef typename Kd_tree<TreeTraits,Splitter,UseExtendedNode>::Node_const_handle Node_const_handle;
- typedef typename Kd_tree<TreeTraits,Splitter,UseExtendedNode>::Internal_node_handle Internal_node_handle;
- typedef typename Kd_tree<TreeTraits,Splitter,UseExtendedNode>::Internal_node_const_handle Internal_node_const_handle;
- typedef typename Kd_tree<TreeTraits,Splitter,UseExtendedNode>::Leaf_node_handle Leaf_node_handle;
- typedef typename Kd_tree<TreeTraits,Splitter,UseExtendedNode>::Leaf_node_const_handle Leaf_node_const_handle;
- typedef typename TreeTraits::Point_d Point_d;
-
- typedef typename TreeTraits::FT FT;
- typedef typename Kd_tree<TreeTraits,Splitter,UseExtendedNode>::Separator Separator;
- typedef typename Kd_tree<TreeTraits,Splitter,UseExtendedNode>::Point_d_iterator Point_d_iterator;
- typedef typename Kd_tree<TreeTraits,Splitter,UseExtendedNode>::iterator iterator;
- typedef typename Kd_tree<TreeTraits,Splitter,UseExtendedNode>::D D;
-
- bool leaf;
-
- public :
- Kd_tree_node(bool leaf_)
- :leaf(leaf_){}
-
- bool is_leaf() const{
- return leaf;
- }
-
- std::size_t
- num_items() const
- {
- if (is_leaf()){
- Leaf_node_const_handle node =
- static_cast<Leaf_node_const_handle>(this);
- return node->size();
- }
- else {
- Internal_node_const_handle node =
- static_cast<Internal_node_const_handle>(this);
- return node->lower()->num_items() + node->upper()->num_items();
- }
- }
-
- std::size_t
- num_nodes() const
- {
- if (is_leaf()) return 1;
- else {
- Internal_node_const_handle node =
- static_cast<Internal_node_const_handle>(this);
- return node->lower()->num_nodes() + node->upper()->num_nodes();
- }
- }
-
- int
- depth(const int current_max_depth) const
- {
- if (is_leaf()){
- return current_max_depth;
- }
- else {
- Internal_node_const_handle node =
- static_cast<Internal_node_const_handle>(this);
- return
- (std::max)( node->lower()->depth(current_max_depth + 1),
- node->upper()->depth(current_max_depth + 1));
- }
- }
-
- int
- depth() const
- {
- return depth(1);
- }
-
- template <class OutputIterator>
- OutputIterator
- tree_items(OutputIterator it) const {
- if (is_leaf()) {
- Leaf_node_const_handle node =
- static_cast<Leaf_node_const_handle>(this);
- if (node->size()>0)
- for (iterator i=node->begin(); i != node->end(); i++)
- {*it=*i; ++it;}
- }
- else {
- Internal_node_const_handle node =
- static_cast<Internal_node_const_handle>(this);
- it=node->lower()->tree_items(it);
- it=node->upper()->tree_items(it);
- }
- return it;
- }
-
-
- boost::optional<Point_d>
- any_tree_item() const {
- boost::optional<Point_d> result = boost::none;
- if (is_leaf()) {
- Leaf_node_const_handle node =
- static_cast<Leaf_node_const_handle>(this);
- if (node->size()>0){
- return boost::make_optional(*(node->begin()));
- }
- }
- else {
- Internal_node_const_handle node =
- static_cast<Internal_node_const_handle>(this);
- result = node->lower()->any_tree_item();
- if(! result){
- result = node->upper()->any_tree_item();
- }
- }
- return result;
- }
-
-
- void
- indent(int d) const
- {
- for(int i = 0; i < d; i++){
- std::cout << " ";
- }
- }
-
-
- void
- print(int d = 0) const
- {
- if (is_leaf()) {
- Leaf_node_const_handle node =
- static_cast<Leaf_node_const_handle>(this);
- indent(d);
- std::cout << "leaf" << std::endl;
- if (node->size()>0)
- for (iterator i=node->begin(); i != node->end(); i++)
- {indent(d);std::cout << *i << std::endl;}
- }
- else {
- Internal_node_const_handle node =
- static_cast<Internal_node_const_handle>(this);
- indent(d);
- std::cout << "lower tree" << std::endl;
- node->lower()->print(d+1);
- indent(d);
- std::cout << "separator: dim = " << node->cutting_dimension() << " val = " << node->cutting_value() << std::endl;
- indent(d);
- std::cout << "upper tree" << std::endl;
- node->upper()->print(d+1);
- }
- }
-
-
- template <class OutputIterator, class FuzzyQueryItem>
- OutputIterator
- search(OutputIterator it, const FuzzyQueryItem& q,
- Kd_tree_rectangle<FT,D>& b) const
- {
- if (is_leaf()) {
- Leaf_node_const_handle node =
- static_cast<Leaf_node_const_handle>(this);
- if (node->size()>0)
- for (iterator i=node->begin(); i != node->end(); i++)
- if (q.contains(*i))
- {*it++=*i;}
- }
- else {
- Internal_node_const_handle node =
- static_cast<Internal_node_const_handle>(this);
- // after splitting b denotes the lower part of b
- Kd_tree_rectangle<FT,D> b_upper(b);
- b.split(b_upper, node->cutting_dimension(),
- node->cutting_value());
-
- if (q.outer_range_contains(b))
- it=node->lower()->tree_items(it);
- else
- if (q.inner_range_intersects(b))
- it=node->lower()->search(it,q,b);
- if (q.outer_range_contains(b_upper))
- it=node->upper()->tree_items(it);
- else
- if (q.inner_range_intersects(b_upper))
- it=node->upper()->search(it,q,b_upper);
- };
- return it;
- }
-
-
- template <class FuzzyQueryItem>
- boost::optional<Point_d>
- search_any_point(const FuzzyQueryItem& q,
- Kd_tree_rectangle<FT,D>& b) const
- {
- boost::optional<Point_d> result = boost::none;
- if (is_leaf()) {
- Leaf_node_const_handle node =
- static_cast<Leaf_node_const_handle>(this);
- if (node->size()>0)
- for (iterator i=node->begin(); i != node->end(); i++)
- if (q.contains(*i))
- { result = *i; break; }
- }
- else {
- Internal_node_const_handle node =
- static_cast<Internal_node_const_handle>(this);
- // after splitting b denotes the lower part of b
- Kd_tree_rectangle<FT,D> b_upper(b);
- b.split(b_upper, node->cutting_dimension(),
- node->cutting_value());
-
- if (q.outer_range_contains(b)){
- result = node->lower()->any_tree_item();
- }else{
- if (q.inner_range_intersects(b)){
- result = node->lower()->search_any_point(q,b);
- }
- }
- if(result){
- return result;
- }
- if (q.outer_range_contains(b_upper)){
- result = node->upper()->any_tree_item();
- }else{
- if (q.inner_range_intersects(b_upper))
- result = node->upper()->search_any_point(q,b_upper);
- }
- }
- return result;
- }
-
- };
-
-
- template < class TreeTraits, class Splitter, class UseExtendedNode >
- class Kd_tree_leaf_node : public Kd_tree_node< TreeTraits, Splitter, UseExtendedNode >{
-
- friend class Kd_tree<TreeTraits,Splitter,UseExtendedNode>;
-
- typedef typename Kd_tree<TreeTraits,Splitter,UseExtendedNode>::iterator iterator;
- typedef Kd_tree_node< TreeTraits, Splitter, UseExtendedNode> Base;
- typedef typename TreeTraits::Point_d Point_d;
-
- private:
-
- // private variables for leaf nodes
- boost::int32_t n; // denotes number of items in a leaf node
- iterator data; // iterator to data in leaf node
-
-
- public:
-
- // default constructor
- Kd_tree_leaf_node()
- {}
-
- Kd_tree_leaf_node(bool leaf_ )
- : Base(leaf_)
- {}
-
- Kd_tree_leaf_node(bool leaf_,unsigned int n_ )
- : Base(leaf_), n(n_)
- {}
-
- // members for all nodes
-
- // members for leaf nodes only
- inline
- unsigned int
- size() const
- {
- return n;
- }
-
- inline
- iterator
- begin() const
- {
- return data;
- }
-
- inline
- iterator
- end() const
- {
- return data + n;
- }
-
- inline
- void
- drop_last_point()
- {
- --n;
- }
-
- }; //leaf node
-
-
-
- template < class TreeTraits, class Splitter, class UseExtendedNode>
- class Kd_tree_internal_node : public Kd_tree_node< TreeTraits, Splitter, UseExtendedNode >{
-
- friend class Kd_tree<TreeTraits,Splitter,UseExtendedNode>;
-
- typedef Kd_tree_node< TreeTraits, Splitter, UseExtendedNode> Base;
- typedef typename Kd_tree<TreeTraits,Splitter,UseExtendedNode>::Node_handle Node_handle;
- typedef typename Kd_tree<TreeTraits,Splitter,UseExtendedNode>::Node_const_handle Node_const_handle;
-
- typedef typename TreeTraits::FT FT;
- typedef typename Kd_tree<TreeTraits,Splitter,UseExtendedNode>::Separator Separator;
-
- private:
-
- // private variables for internal nodes
- boost::int32_t cut_dim;
- FT cut_val;
- Node_handle lower_ch, upper_ch;
-
-
- // private variables for extended internal nodes
- FT upper_low_val;
- FT upper_high_val;
- FT lower_low_val;
- FT lower_high_val;
-
-
- public:
-
- // default constructor
- Kd_tree_internal_node()
- {}
-
- Kd_tree_internal_node(bool leaf_)
- : Base(leaf_)
- {}
-
-
- // members for internal node and extended internal node
-
- inline
- Node_const_handle
- lower() const
- {
- return lower_ch;
- }
-
- inline
- Node_const_handle
- upper() const
- {
- return upper_ch;
- }
-
- inline
- Node_handle
- lower()
- {
- return lower_ch;
- }
-
- inline
- Node_handle
- upper()
- {
- return upper_ch;
- }
-
- inline
- void
- set_lower(Node_handle nh)
- {
- lower_ch = nh;
- }
-
- inline
- void
- set_upper(Node_handle nh)
- {
- upper_ch = nh;
- }
-
- // inline Separator& separator() {return sep; }
- // use instead
- inline
- void set_separator(Separator& sep){
- cut_dim = sep.cutting_dimension();
- cut_val = sep.cutting_value();
- }
-
- inline
- FT
- cutting_value() const
- {
- return cut_val;
- }
-
- inline
- int
- cutting_dimension() const
- {
- return cut_dim;
- }
-
- // members for extended internal node only
- inline
- FT
- upper_low_value() const
- {
- return upper_low_val;
- }
-
- inline
- FT
- upper_high_value() const
- {
- return upper_high_val;
- }
-
- inline
- FT
- lower_low_value() const
- {
- return lower_low_val;
- }
-
- inline
- FT
- lower_high_value() const
- {
- return lower_high_val;
- }
-
- /*Separator&
- separator()
- {
- return Separator(cutting_dimension,cutting_value);
- }*/
-
-
- };//internal node
-
- template < class TreeTraits, class Splitter>
- class Kd_tree_internal_node<TreeTraits,Splitter,Tag_false> : public Kd_tree_node< TreeTraits, Splitter, Tag_false >{
-
- friend class Kd_tree<TreeTraits,Splitter,Tag_false>;
-
- typedef Kd_tree_node< TreeTraits, Splitter, Tag_false> Base;
- typedef typename Kd_tree<TreeTraits,Splitter,Tag_false>::Node_handle Node_handle;
- typedef typename Kd_tree<TreeTraits,Splitter,Tag_false>::Node_const_handle Node_const_handle;
-
- typedef typename TreeTraits::FT FT;
- typedef typename Kd_tree<TreeTraits,Splitter,Tag_false>::Separator Separator;
-
- private:
-
- // private variables for internal nodes
- boost::uint8_t cut_dim;
- FT cut_val;
-
- Node_handle lower_ch, upper_ch;
-
- public:
-
- // default constructor
- Kd_tree_internal_node()
- {}
-
- Kd_tree_internal_node(bool leaf_)
- : Base(leaf_)
- {}
-
-
- // members for internal node and extended internal node
-
- inline
- Node_const_handle
- lower() const
- {
- return lower_ch;
- }
-
- inline
- Node_const_handle
- upper() const
- {
- return upper_ch;
- }
-
- inline
- Node_handle
- lower()
- {
- return lower_ch;
- }
-
- inline
- Node_handle
- upper()
- {
- return upper_ch;
- }
-
- inline
- void
- set_lower(Node_handle nh)
- {
- lower_ch = nh;
- }
-
- inline
- void
- set_upper(Node_handle nh)
- {
- upper_ch = nh;
- }
-
- // inline Separator& separator() {return sep; }
- // use instead
-
- inline
- void set_separator(Separator& sep){
- cut_dim = sep.cutting_dimension();
- cut_val = sep.cutting_value();
- }
-
- inline
- FT
- cutting_value() const
- {
- return cut_val;
- }
-
- inline
- int
- cutting_dimension() const
- {
- return cut_dim;
- }
-
- /* Separator&
- separator()
- {
- return Separator(cutting_dimension,cutting_value);
- }*/
-
-
- };//internal node
-
-
-
-} // namespace CGAL
-#endif // CGAL_KDTREE_NODE_H
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_LA_base.h b/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_LA_base.h
deleted file mode 100644
index c13a9801..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_LA_base.h
+++ /dev/null
@@ -1,177 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_KERNEL_D_CARTESIAN_LA_BASE_H
-#define CGAL_KERNEL_D_CARTESIAN_LA_BASE_H
-
-#include <CGAL/basic.h>
-#include <CGAL/Origin.h>
-#include <boost/type_traits/integral_constant.hpp>
-#include <CGAL/representation_tags.h>
-#include <CGAL/NewKernel_d/functor_tags.h>
-#include <CGAL/Uncertain.h>
-#include <CGAL/typeset.h>
-#include <CGAL/NewKernel_d/Dimension_base.h>
-#include <CGAL/NewKernel_d/Cartesian_LA_functors.h>
-#include <CGAL/NewKernel_d/Vector/array.h>
-#include <CGAL/NewKernel_d/Vector/vector.h>
-#include <CGAL/NewKernel_d/Vector/mix.h>
-#ifdef CGAL_EIGEN3_ENABLED
-#include <CGAL/NewKernel_d/LA_eigen/LA.h>
-#else
-#error Eigen3 is required
-#endif
-
-namespace CGAL {
-
-template < typename FT_, typename Dim_,
-#if 1
- typename Vec_=Mix_vector<Array_vector<FT_, Dim_>,
- Vector_vector<FT_, Dim_>,
- FT_, Dim_>,
-#elif 0
- typename Vec_=Array_vector<FT_, Dim_>,
-#elif 0
- typename Vec_=Vector_vector<FT_, Dim_>,
-#else
- // Dangerous because of alignment. Ok on x86_64 without AVX.
- typename Vec_=LA_eigen<FT_, Dim_>,
-#endif
- typename LA_=LA_eigen<FT_,Dim_> >
- /* Default LA to Vec or to LA_eigen? */
-struct Cartesian_LA_base_d : public Dimension_base<Dim_>
-{
- typedef Cartesian_LA_base_d<FT_,Dim_> Self;
- typedef Cartesian_tag Rep_tag;
- typedef Cartesian_tag Kernel_tag;
- typedef Dim_ Default_ambient_dimension;
- typedef Dim_ Max_ambient_dimension;
- typedef Dim_ Dimension;
- typedef LA_ LA;
- template <class> struct Ambient_dimension { typedef Dim_ type; };
-
- typedef Vec_ LA_vector;
- typedef typename LA_vector::Vector Point;
- typedef typename LA_vector::Vector Vector;
- typedef typename LA_vector::Vector Vector_;
- typedef typename LA_vector::Construct_vector Constructor;
- typedef typename LA_vector::Vector_const_iterator Point_cartesian_const_iterator;
- typedef typename LA_vector::Vector_const_iterator Vector_cartesian_const_iterator;
-
- template<class, class=void> struct Type {};
- template<class D> struct Type< Point_tag, D> { typedef Vector_ type; };
- template<class D> struct Type<Vector_tag, D> { typedef Vector_ type; };
- template<class D> struct Type< FT_tag, D> { typedef FT_ type; };
- template<class D> struct Type< RT_tag, D> { typedef FT_ type; };
-
- typedef typeset<Point_tag>
- ::add<Vector_tag>::type
- // FIXME: These have nothing to do here.
- ::add<Segment_tag>::type
- ::add<Hyperplane_tag>::type
- ::add<Sphere_tag>::type
- ::add<Weighted_point_tag>::type
- Object_list;
-
- typedef typeset< Point_cartesian_const_iterator_tag>::type
- ::add<Vector_cartesian_const_iterator_tag>::type
- Iterator_list;
-
- template<class, class=void, class=boost::integral_constant<int,0> > struct Functor {
- typedef Null_functor type;
- };
- template<class D> struct Functor<Construct_ttag<Vector_tag>,D> {
- typedef CartesianDVectorBase::Construct_LA_vector<Self,Null_vector> type;
- };
- template<class D> struct Functor<Construct_ttag<Point_tag>,D> {
- typedef CartesianDVectorBase::Construct_LA_vector<Self,Origin> type;
- };
- template<class D> struct Functor<Construct_ttag<Point_cartesian_const_iterator_tag>,D> {
- typedef CartesianDVectorBase::Construct_cartesian_const_iterator<Self> type;
- };
- template<class D> struct Functor<Construct_ttag<Vector_cartesian_const_iterator_tag>,D> {
- typedef CartesianDVectorBase::Construct_cartesian_const_iterator<Self> type;
- };
- template<class D> struct Functor<Sum_of_vectors_tag,D,
- boost::integral_constant<int,!LA_vector::template Property<Has_vector_plus_minus_tag>::value> > {
- typedef CartesianDVectorBase::Sum_of_vectors<Self> type;
- };
- template<class D> struct Functor<Difference_of_vectors_tag,D,
- boost::integral_constant<int,!LA_vector::template Property<Has_vector_plus_minus_tag>::value> > {
- typedef CartesianDVectorBase::Difference_of_vectors<Self> type;
- };
- template<class D> struct Functor<Opposite_vector_tag,D,
- boost::integral_constant<int,!LA_vector::template Property<Has_vector_plus_minus_tag>::value> > {
- typedef CartesianDVectorBase::Opposite_vector<Self> type;
- };
- template<class D> struct Functor<Midpoint_tag,D,
- boost::integral_constant<int,
- !LA_vector::template Property<Has_vector_plus_minus_tag>::value
- || !LA_vector::template Property<Has_vector_scalar_ops_tag>::value> > {
- typedef CartesianDVectorBase::Midpoint<Self> type;
- };
- template<class D> struct Functor<Compute_point_cartesian_coordinate_tag,D> {
- typedef CartesianDVectorBase::Compute_cartesian_coordinate<Self> type;
- };
- template<class D> struct Functor<Compute_vector_cartesian_coordinate_tag,D> {
- typedef CartesianDVectorBase::Compute_cartesian_coordinate<Self> type;
- };
- template<class D> struct Functor<Point_dimension_tag,D> {
- typedef CartesianDVectorBase::PV_dimension<Self> type;
- };
- template<class D> struct Functor<Vector_dimension_tag,D> {
- typedef CartesianDVectorBase::PV_dimension<Self> type;
- };
- template<class D> struct Functor<Orientation_of_vectors_tag,D,
- boost::integral_constant<int,!LA_vector::template Property<Has_determinant_of_iterator_to_vectors_tag>::value> > {
- typedef CartesianDVectorBase::Orientation_of_vectors<Self> type;
- };
- template<class D> struct Functor<Orientation_of_points_tag,D,
- boost::integral_constant<int,!LA_vector::template Property<Has_determinant_of_iterator_to_points_tag>::value> > {
- typedef CartesianDVectorBase::Orientation_of_points<Self> type;
- };
- template<class D> struct Functor<Scalar_product_tag,D,
- boost::integral_constant<int,!LA_vector::template Property<Has_dot_product_tag>::value> > {
- typedef CartesianDVectorBase::Scalar_product<Self> type;
- };
- template<class D> struct Functor<Squared_distance_to_origin_tag,D,
- boost::integral_constant<int,!LA_vector::template Property<Stores_squared_norm_tag>::value> > {
- typedef CartesianDVectorBase::Squared_distance_to_origin_stored<Self> type;
- };
- // Use integral_constant<int,2> in case of failure, to distinguish from the previous one.
- template<class D> struct Functor<Squared_distance_to_origin_tag,D,
- boost::integral_constant<int,
- (LA_vector::template Property<Stores_squared_norm_tag>::value
- || !LA_vector::template Property<Has_dot_product_tag>::value)*2> > {
- typedef CartesianDVectorBase::Squared_distance_to_origin_via_dotprod<Self> type;
- };
- template<class D> struct Functor<Point_to_vector_tag,D> {
- typedef CartesianDVectorBase::Identity_functor<Self> type;
- };
- template<class D> struct Functor<Vector_to_point_tag,D> {
- typedef CartesianDVectorBase::Identity_functor<Self> type;
- };
-
- CGAL_CONSTEXPR Cartesian_LA_base_d(){}
- CGAL_CONSTEXPR Cartesian_LA_base_d(int d):Dimension_base<Dim_>(d){}
-};
-
-} //namespace CGAL
-
-#endif // CGAL_KERNEL_D_CARTESIAN_LA_BASE_H
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_LA_functors.h b/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_LA_functors.h
deleted file mode 100644
index 871c463a..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_LA_functors.h
+++ /dev/null
@@ -1,344 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_CARTESIAN_LA_FUNCTORS_H
-#define CGAL_CARTESIAN_LA_FUNCTORS_H
-
-#include <CGAL/NewKernel_d/utils.h>
-#include <CGAL/is_iterator.h>
-#include <CGAL/argument_swaps.h>
-#include <CGAL/Kernel/Return_base_tag.h>
-#include <CGAL/transforming_iterator.h>
-#include <CGAL/NewKernel_d/store_kernel.h>
-#include <CGAL/Dimension.h>
-
-namespace CGAL {
-namespace CartesianDVectorBase {
-#ifndef CGAL_CXX11
-namespace internal {
-template<class R_,class Dim_> struct Construct_LA_vector_ {
- struct Never_use {};
- void operator()(Never_use)const;
-};
-#define CGAL_CODE(Z,N,_) template<class R> struct Construct_LA_vector_<R,Dimension_tag<N> > { \
- typedef typename R::Constructor Constructor; \
- typedef typename Get_type<R, RT_tag>::type RT; \
- typedef typename R::Vector_ result_type; \
- result_type operator() \
- (BOOST_PP_ENUM_PARAMS(N,RT const& t)) const { \
- return typename Constructor::Values()(BOOST_PP_ENUM_PARAMS(N,t)); \
- } \
- result_type operator() \
- (BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(N),RT const& t)) const { \
- return typename Constructor::Values_divide()(t##N,BOOST_PP_ENUM_PARAMS(N,t)); \
- } \
- };
-BOOST_PP_REPEAT_FROM_TO(2, 11, CGAL_CODE, _ )
-#undef CGAL_CODE
-}
-#endif
-
-template<class R_,class Zero_> struct Construct_LA_vector
-: private Store_kernel<R_>
-#ifndef CGAL_CXX11
-, public internal::Construct_LA_vector_<R_,typename R_::Default_ambient_dimension>
-#endif
-{
- //CGAL_FUNCTOR_INIT_IGNORE(Construct_LA_vector)
- CGAL_FUNCTOR_INIT_STORE(Construct_LA_vector)
- typedef R_ R;
- typedef typename R::Constructor Constructor;
- typedef typename Get_type<R, RT_tag>::type RT;
- typedef typename Get_type<R, FT_tag>::type FT;
- typedef typename R::Vector_ result_type;
- typedef typename R_::Default_ambient_dimension Dimension;
- result_type operator()(int d)const{
- CGAL_assertion(check_dimension_eq(d,this->kernel().dimension()));
- return typename Constructor::Dimension()(d);
- }
- result_type operator()()const{
- return typename Constructor::Dimension()((std::max)(0,this->kernel().dimension()));
- }
- result_type operator()(int d, Zero_ const&)const{
- CGAL_assertion(check_dimension_eq(d,this->kernel().dimension()));
- return typename Constructor::Dimension()(d);
- }
- result_type operator()(Zero_ const&)const{
- // Makes no sense for an unknown dimension.
- return typename Constructor::Dimension()(this->kernel().dimension());
- }
- result_type operator()(result_type const& v)const{
- return v;
- }
-#ifdef CGAL_CXX11
- result_type operator()(result_type&& v)const{
- return std::move(v);
- }
-#endif
-#ifdef CGAL_CXX11
- template<class...U>
- typename std::enable_if<Constructible_from_each<RT,U...>::value &&
- boost::is_same<Dimension_tag<sizeof...(U)>, Dimension>::value,
- result_type>::type
- operator()(U&&...u)const{
- return typename Constructor::Values()(std::forward<U>(u)...);
- }
- //template<class...U,class=typename std::enable_if<Constructible_from_each<RT,U...>::value>::type,class=typename std::enable_if<(sizeof...(U)==static_dim+1)>::type,class=void>
- template<class...U>
- typename std::enable_if<Constructible_from_each<RT,U...>::value &&
- boost::is_same<Dimension_tag<sizeof...(U)-1>, Dimension>::value,
- result_type>::type
- operator()(U&&...u)const{
- return Apply_to_last_then_rest()(typename Constructor::Values_divide(),std::forward<U>(u)...);
- }
-#else
- using internal::Construct_LA_vector_<R_,typename R::Default_ambient_dimension>::operator();
-#endif
- template<class Iter> inline
- typename boost::enable_if<is_iterator_type<Iter,std::forward_iterator_tag>,result_type>::type operator()
- (Iter f,Iter g,Cartesian_tag t)const
- {
- return this->operator()((int)std::distance(f,g),f,g,t);
- }
- template<class Iter> inline
- typename boost::enable_if<is_iterator_type<Iter,std::forward_iterator_tag>,result_type>::type operator()
- (int d,Iter f,Iter g,Cartesian_tag)const
- {
- CGAL_assertion(d==std::distance(f,g));
- CGAL_assertion(check_dimension_eq(d,this->kernel().dimension()));
- return typename Constructor::Iterator()(d,f,g);
- }
- template<class Iter> inline
- typename boost::enable_if<is_iterator_type<Iter,std::bidirectional_iterator_tag>,result_type>::type operator()
- (Iter f,Iter g,Homogeneous_tag)const
- {
- --g;
- return this->operator()((int)std::distance(f,g),f,g,*g);
- }
- template<class Iter> inline
- typename boost::enable_if<is_iterator_type<Iter,std::bidirectional_iterator_tag>,result_type>::type operator()
- (int d,Iter f,Iter g,Homogeneous_tag)const
- {
- --g;
- return this->operator()(d,f,g,*g);
- }
- template<class Iter> inline
- typename boost::enable_if<is_iterator_type<Iter,std::forward_iterator_tag>,result_type>::type operator()
- (Iter f,Iter g)const
- {
- // Shouldn't it try comparing dist(f,g) to the dimension if it is known?
- return this->operator()(f,g,typename R::Rep_tag());
- }
- template<class Iter> inline
- typename boost::enable_if<is_iterator_type<Iter,std::forward_iterator_tag>,result_type>::type operator()
- (int d,Iter f,Iter g)const
- {
- return this->operator()(d,f,g,typename R::Rep_tag());
- }
-
- // Last homogeneous coordinate given separately
- template<class Iter,class NT> inline
- typename boost::enable_if<is_iterator_type<Iter,std::forward_iterator_tag>,result_type>::type operator()
- (int d,Iter f,Iter g,NT const&l)const
- {
- CGAL_assertion(d==std::distance(f,g));
- CGAL_assertion(check_dimension_eq(d,this->kernel().dimension()));
- // RT? better be safe for now
- return typename Constructor::Iterator()(d,CGAL::make_transforming_iterator(f,Divide<FT,NT>(l)),CGAL::make_transforming_iterator(g,Divide<FT,NT>(l)));
- }
- template<class Iter,class NT> inline
- typename boost::enable_if<is_iterator_type<Iter,std::forward_iterator_tag>,result_type>::type operator()
- (Iter f,Iter g,NT const&l)const
- {
- return this->operator()((int)std::distance(f,g),f,g,l);
- }
-};
-
-template<class R_> struct Compute_cartesian_coordinate {
- CGAL_FUNCTOR_INIT_IGNORE(Compute_cartesian_coordinate)
- typedef R_ R;
- typedef typename Get_type<R, RT_tag>::type RT;
- typedef typename R::Vector_ first_argument_type;
- typedef int second_argument_type;
- typedef Tag_true Is_exact;
-#ifdef CGAL_CXX11
- typedef decltype(std::declval<const first_argument_type>()[0]) result_type;
-#else
- typedef RT const& result_type;
- // RT const& doesn't work with some LA (Eigen2 for instance) so we
- // should use plain RT or find a way to detect this.
-#endif
-
- result_type operator()(first_argument_type const& v,int i)const{
- return v[i];
- }
-};
-
-template<class R_> struct Construct_cartesian_const_iterator {
- CGAL_FUNCTOR_INIT_IGNORE(Construct_cartesian_const_iterator)
- typedef R_ R;
- typedef typename R::Vector_ argument_type;
- typedef typename R::LA_vector S_;
- typedef typename R::Point_cartesian_const_iterator result_type;
- // same as Vector
- typedef Tag_true Is_exact;
-
- result_type operator()(argument_type const& v,Begin_tag)const{
- return S_::vector_begin(v);
- }
- result_type operator()(argument_type const& v,End_tag)const{
- return S_::vector_end(v);
- }
-};
-
-template<class R_> struct Midpoint {
- CGAL_FUNCTOR_INIT_IGNORE(Midpoint)
- typedef R_ R;
- typedef typename Get_type<R, Point_tag>::type first_argument_type;
- typedef typename Get_type<R, Point_tag>::type second_argument_type;
- typedef typename Get_type<R, Point_tag>::type result_type;
-
- result_type operator()(result_type const& a, result_type const& b)const{
- return (a+b)/2;
- }
-};
-
-template<class R_> struct Sum_of_vectors {
- CGAL_FUNCTOR_INIT_IGNORE(Sum_of_vectors)
- typedef R_ R;
- typedef typename Get_type<R, Vector_tag>::type first_argument_type;
- typedef typename Get_type<R, Vector_tag>::type second_argument_type;
- typedef typename Get_type<R, Vector_tag>::type result_type;
-
- result_type operator()(result_type const& a, result_type const& b)const{
- return a+b;
- }
-};
-
-template<class R_> struct Difference_of_vectors {
- CGAL_FUNCTOR_INIT_IGNORE(Difference_of_vectors)
- typedef R_ R;
- typedef typename Get_type<R, Vector_tag>::type first_argument_type;
- typedef typename Get_type<R, Vector_tag>::type second_argument_type;
- typedef typename Get_type<R, Vector_tag>::type result_type;
-
- result_type operator()(result_type const& a, result_type const& b)const{
- return a-b;
- }
-};
-
-template<class R_> struct Opposite_vector {
- CGAL_FUNCTOR_INIT_IGNORE(Opposite_vector)
- typedef R_ R;
- typedef typename Get_type<R, Vector_tag>::type result_type;
- typedef typename Get_type<R, Vector_tag>::type argument_type;
-
- result_type operator()(result_type const& v)const{
- return -v;
- }
-};
-
-template<class R_> struct Scalar_product {
- CGAL_FUNCTOR_INIT_IGNORE(Scalar_product)
- typedef R_ R;
- typedef typename R::LA_vector LA;
- typedef typename Get_type<R, RT_tag>::type result_type;
- typedef typename Get_type<R, Vector_tag>::type first_argument_type;
- typedef typename Get_type<R, Vector_tag>::type second_argument_type;
-
- result_type operator()(first_argument_type const& a, second_argument_type const& b)const{
- return LA::dot_product(a,b);
- }
-};
-
-template<class R_> struct Squared_distance_to_origin_stored {
- CGAL_FUNCTOR_INIT_IGNORE(Squared_distance_to_origin_stored)
- typedef R_ R;
- typedef typename R::LA_vector LA;
- typedef typename Get_type<R, RT_tag>::type result_type;
- typedef typename Get_type<R, Point_tag>::type argument_type;
-
- result_type operator()(argument_type const& a)const{
- return LA::squared_norm(a);
- }
-};
-
-template<class R_> struct Squared_distance_to_origin_via_dotprod {
- CGAL_FUNCTOR_INIT_IGNORE(Squared_distance_to_origin_via_dotprod)
- typedef R_ R;
- typedef typename R::LA_vector LA;
- typedef typename Get_type<R, RT_tag>::type result_type;
- typedef typename Get_type<R, Point_tag>::type argument_type;
-
- result_type operator()(argument_type const& a)const{
- return LA::dot_product(a,a);
- }
-};
-
-template<class R_> struct Orientation_of_vectors {
- CGAL_FUNCTOR_INIT_IGNORE(Orientation_of_vectors)
- typedef R_ R;
- typedef typename R::Vector_cartesian_const_iterator first_argument_type;
- typedef typename R::Vector_cartesian_const_iterator second_argument_type;
- typedef typename Get_type<R, Orientation_tag>::type result_type;
- typedef typename R::LA_vector LA;
-
- template<class Iter>
- result_type operator()(Iter const& f, Iter const& e) const {
- return LA::determinant_of_iterators_to_vectors(f,e);
- }
-};
-
-template<class R_> struct Orientation_of_points {
- CGAL_FUNCTOR_INIT_IGNORE(Orientation_of_points)
- typedef R_ R;
- typedef typename R::Point_cartesian_const_iterator first_argument_type;
- typedef typename R::Point_cartesian_const_iterator second_argument_type;
- typedef typename Get_type<R, Orientation_tag>::type result_type;
- typedef typename R::LA_vector LA;
-
- template<class Iter>
- result_type operator()(Iter const& f, Iter const& e) const {
- return LA::determinant_of_iterators_to_points(f,e);
- }
-};
-
-template<class R_> struct PV_dimension {
- CGAL_FUNCTOR_INIT_IGNORE(PV_dimension)
- typedef R_ R;
- typedef typename R::Vector_ argument_type;
- typedef int result_type;
- typedef typename R::LA_vector LA;
- typedef Tag_true Is_exact;
-
- template<class T>
- result_type operator()(T const& v) const {
- return LA::size_of_vector(v);
- }
-};
-
-template<class R_> struct Identity_functor {
- CGAL_FUNCTOR_INIT_IGNORE(Identity_functor)
- template<class T>
- T const& operator()(T const&t) const { return t; }
-};
-
-}
-} // namespace CGAL
-#endif // CGAL_CARTESIAN_LA_FUNCTORS_H
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_base.h b/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_base.h
deleted file mode 100644
index 641bf8ae..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_base.h
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_KERNEL_D_CARTESIAN_BASE_H
-#define CGAL_KERNEL_D_CARTESIAN_BASE_H
-
-#include <CGAL/basic.h>
-#include <CGAL/NewKernel_d/Cartesian_complete.h>
-#include <CGAL/NewKernel_d/Cartesian_LA_base.h>
-
-namespace CGAL {
-#define CGAL_BASE \
- Cartesian_LA_base_d< FT_, Dim_ >
-template < typename FT_, typename Dim_, typename Derived_=Default>
-struct Cartesian_base_d : public CGAL_BASE
-{
- CGAL_CONSTEXPR Cartesian_base_d(){}
- CGAL_CONSTEXPR Cartesian_base_d(int d):CGAL_BASE(d){}
-};
-#undef CGAL_BASE
-
-} //namespace CGAL
-
-#endif // CGAL_KERNEL_D_CARTESIAN_BASE_H
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_change_FT.h b/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_change_FT.h
deleted file mode 100644
index e09c72d0..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_change_FT.h
+++ /dev/null
@@ -1,117 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_KERNEL_D_CARTESIAN_CHANGE_FT_H
-#define CGAL_KERNEL_D_CARTESIAN_CHANGE_FT_H
-
-#include <CGAL/basic.h>
-#include <CGAL/NT_converter.h>
-#include <CGAL/transforming_iterator.h>
-#include <CGAL/NewKernel_d/Cartesian_complete.h>
-
-namespace CGAL {
-
-template < typename Base_, typename FT_, typename LA_=CGAL::LA_eigen<FT_,typename Base_::Default_ambient_dimension> >
-struct Cartesian_change_FT_base : public
- Base_
-{
- CGAL_CONSTEXPR Cartesian_change_FT_base(){}
- CGAL_CONSTEXPR Cartesian_change_FT_base(int d):Base_(d){}
-
- typedef Cartesian_change_FT_base Self;
- typedef Base_ Kernel_base;
- typedef LA_ LA;
-
- template <class T, class D=void> struct Type : Inherit_type<Base_, T> {};
- template <class D> struct Type <FT_tag, D> { typedef FT_ type; };
- template <class D> struct Type <RT_tag, D> { typedef FT_ type; };
-
- typedef NT_converter<typename Get_type<Kernel_base, FT_tag>::type,FT_> FT_converter;
- typedef transforming_iterator<FT_converter,typename Kernel_base::Point_cartesian_const_iterator> Point_cartesian_const_iterator;
- typedef transforming_iterator<FT_converter,typename Kernel_base::Vector_cartesian_const_iterator> Vector_cartesian_const_iterator;
- //FIXME: use Iterator_list!
- /*
- template<class T,bool=CGAL_BOOSTD is_same<typename iterator_tag_traits<T>::value_tag,FT_tag>::value>
- struct Iterator : Get_type<Kernel_base,T> {};
- template<class T> struct Iterator<T,true> {
- typedef transforming_iterator<FT_converter,typename Get_type<Kernel_base,T>::type> type;
- };
- */
-
- template<class Tag_,class Type_>
- struct Construct_cartesian_const_iterator_ {
- typedef typename Get_functor<Kernel_base, Tag_>::type Functor_base;
- Construct_cartesian_const_iterator_(){}
- Construct_cartesian_const_iterator_(Self const&r):f(r){}
- Functor_base f;
- typedef Type_ result_type;
- template<class T>
- result_type operator()(T const& v, Begin_tag)const{
- return make_transforming_iterator(f(v,Begin_tag()),FT_converter());
- }
- template<class T>
- result_type operator()(T const& v, End_tag)const{
- return make_transforming_iterator(f(v,End_tag()),FT_converter());
- }
- };
- typedef Construct_cartesian_const_iterator_<Construct_ttag<Point_cartesian_const_iterator_tag>,Point_cartesian_const_iterator> Construct_point_cartesian_const_iterator;
- typedef Construct_cartesian_const_iterator_<Construct_ttag<Vector_cartesian_const_iterator_tag>,Vector_cartesian_const_iterator> Construct_vector_cartesian_const_iterator;
-
- template<class Tag_>
- struct Compute_cartesian_coordinate {
- typedef typename Get_functor<Kernel_base, Tag_>::type Functor_base;
- Compute_cartesian_coordinate(){}
- Compute_cartesian_coordinate(Self const&r):f(r){}
- Functor_base f;
- typedef FT_ result_type;
- template<class Obj_>
- result_type operator()(Obj_ const& v,int i)const{
- return FT_converter()(f(v,i));
- }
- };
-
- template<class T,class U=void,class=typename Get_functor_category<Cartesian_change_FT_base,T>::type> struct Functor :
- Inherit_functor<Kernel_base,T,U> { };
- template<class T,class U> struct Functor<T,U,Compute_tag> { };
- template<class T,class U> struct Functor<T,U,Predicate_tag> { };
- template<class D> struct Functor<Compute_point_cartesian_coordinate_tag,D,Compute_tag> {
- typedef Compute_cartesian_coordinate<Compute_point_cartesian_coordinate_tag> type;
- };
- template<class D> struct Functor<Compute_vector_cartesian_coordinate_tag,D,Compute_tag> {
- typedef Compute_cartesian_coordinate<Compute_vector_cartesian_coordinate_tag> type;
- };
- template<class D> struct Functor<Construct_ttag<Point_cartesian_const_iterator_tag>,D,Construct_iterator_tag> {
- typedef Construct_point_cartesian_const_iterator type;
- };
- template<class D> struct Functor<Construct_ttag<Vector_cartesian_const_iterator_tag>,D,Construct_iterator_tag> {
- typedef Construct_vector_cartesian_const_iterator type;
- };
-};
-
-template < typename Base_, typename FT_>
-struct Cartesian_change_FT : public
- Cartesian_change_FT_base<Base_,FT_>
-{
- CGAL_CONSTEXPR Cartesian_change_FT(){}
- CGAL_CONSTEXPR Cartesian_change_FT(int d):Cartesian_change_FT_base<Base_,FT_>(d){}
-};
-
-} //namespace CGAL
-
-#endif // CGAL_KERNEL_D_CARTESIAN_CHANGE_FT_H
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_complete.h b/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_complete.h
deleted file mode 100644
index ef8921db..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_complete.h
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_KERNEL_D_CARTESIAN_COMPLETE_H
-#define CGAL_KERNEL_D_CARTESIAN_COMPLETE_H
-
-#include <CGAL/NewKernel_d/function_objects_cartesian.h>
-#include <CGAL/NewKernel_d/Cartesian_per_dimension.h>
-#include <CGAL/NewKernel_d/Types/Segment.h>
-#include <CGAL/NewKernel_d/Types/Sphere.h>
-#include <CGAL/NewKernel_d/Types/Hyperplane.h>
-#include <CGAL/NewKernel_d/Types/Aff_transformation.h>
-#include <CGAL/NewKernel_d/Types/Line.h>
-#include <CGAL/NewKernel_d/Types/Ray.h>
-#include <CGAL/NewKernel_d/Types/Iso_box.h>
-
-#endif // CGAL_KERNEL_D_CARTESIAN_COMPLETE_H
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_filter_K.h b/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_filter_K.h
deleted file mode 100644
index 179e97bf..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_filter_K.h
+++ /dev/null
@@ -1,79 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_KERNEL_D_CARTESIAN_FILTER_K_H
-#define CGAL_KERNEL_D_CARTESIAN_FILTER_K_H
-
-#include <CGAL/basic.h>
-#include <CGAL/NewKernel_d/KernelD_converter.h>
-#include <CGAL/NewKernel_d/Filtered_predicate2.h>
-#include <boost/mpl/if.hpp>
-#include <boost/mpl/and.hpp>
-
-namespace CGAL {
-
-template < typename Base_, typename AK_, typename EK_ >
-struct Cartesian_filter_K : public Base_,
- private Store_kernel<AK_>, private Store_kernel2<EK_>
-{
- CGAL_CONSTEXPR Cartesian_filter_K(){}
- CGAL_CONSTEXPR Cartesian_filter_K(int d):Base_(d){}
- //FIXME: or do we want an instance of AK and EK belonging to this kernel,
- //instead of a reference to external ones?
- CGAL_CONSTEXPR Cartesian_filter_K(AK_ const&a,EK_ const&b):Base_(),Store_kernel<AK_>(a),Store_kernel2<EK_>(b){}
- CGAL_CONSTEXPR Cartesian_filter_K(int d,AK_ const&a,EK_ const&b):Base_(d),Store_kernel<AK_>(a),Store_kernel2<EK_>(b){}
- typedef Base_ Kernel_base;
- typedef AK_ AK;
- typedef EK_ EK;
- typedef typename Store_kernel<AK_>::reference_type AK_rt;
- AK_rt approximate_kernel()const{return this->kernel();}
- typedef typename Store_kernel2<EK_>::reference2_type EK_rt;
- EK_rt exact_kernel()const{return this->kernel2();}
-
- // MSVC is too dumb to perform the empty base optimization.
- typedef boost::mpl::and_<
- internal::Do_not_store_kernel<Kernel_base>,
- internal::Do_not_store_kernel<AK>,
- internal::Do_not_store_kernel<EK> > Do_not_store_kernel;
-
- //TODO: C2A/C2E could be able to convert *this into this->kernel() or this->kernel2().
- typedef KernelD_converter<Kernel_base,AK> C2A;
- typedef KernelD_converter<Kernel_base,EK> C2E;
-
- // fix the types
- // TODO: only fix some types, based on some criterion?
- template<class T> struct Type : Get_type<Kernel_base,T> {};
-
- template<class T,class D=void,class=typename Get_functor_category<Cartesian_filter_K,T>::type> struct Functor :
- Inherit_functor<Kernel_base,T,D> {};
- template<class T,class D> struct Functor<T,D,Predicate_tag> {
- typedef typename Get_functor<AK, T>::type AP;
- typedef typename Get_functor<EK, T>::type EP;
- typedef Filtered_predicate2<EP,AP,C2E,C2A> type;
- };
-// TODO:
-// template<class T> struct Functor<T,No_filter_tag,Predicate_tag> :
-// Kernel_base::template Functor<T,No_filter_tag> {};
-// TODO:
-// detect when Less_cartesian_coordinate doesn't need filtering
-};
-
-} //namespace CGAL
-
-#endif // CGAL_KERNEL_D_CARTESIAN_FILTER_K_H
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_filter_NT.h b/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_filter_NT.h
deleted file mode 100644
index c390a55c..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_filter_NT.h
+++ /dev/null
@@ -1,93 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_KERNEL_D_CARTESIAN_FILTER_NT_H
-#define CGAL_KERNEL_D_CARTESIAN_FILTER_NT_H
-
-#include <CGAL/basic.h>
-#include <CGAL/NewKernel_d/Cartesian_change_FT.h>
-#include <CGAL/internal/Exact_type_selector.h>
-
-namespace CGAL {
-
-template < typename Base_ >
-struct Cartesian_filter_NT : public Base_
-{
- CGAL_CONSTEXPR Cartesian_filter_NT(){}
- CGAL_CONSTEXPR Cartesian_filter_NT(int d):Base_(d){}
- typedef Base_ Kernel_base;
- typedef Cartesian_change_FT<Kernel_base,Interval_nt_advanced> K1;
- typedef typename internal::Exact_field_selector<typename Get_type<Kernel_base, FT_tag>::type>::Type Exact_nt;
- typedef Cartesian_change_FT<Kernel_base,Exact_nt> K2;
-
- template<class T,class D=void,class=typename Get_functor_category<Cartesian_filter_NT,T>::type> struct Functor :
- Inherit_functor<Kernel_base,T,D> {};
- template<class T,class D> struct Functor<T,D,Predicate_tag> {
- struct type {
- //TODO: use compression (derive from a compressed_pair?)
- typedef typename Get_functor<K1, T>::type P1; P1 p1;
- typedef typename Get_functor<K2, T>::type P2; P2 p2;
- typedef typename P2::result_type result_type;
- type(){}
- type(Cartesian_filter_NT const&k):p1(reinterpret_cast<K1 const&>(k)),p2(reinterpret_cast<K2 const&>(k)){}
- //FIXME: if predicate's constructor takes a kernel as argument, how do we translate that? reinterpret_cast is really ugly and possibly unsafe.
-
-#ifdef CGAL_CXX11
- template<class...U> result_type operator()(U&&...u)const{
- {
- Protect_FPU_rounding<true> p;
- try {
- typename P1::result_type res=p1(u...); // don't forward as u may be reused
- if(is_certain(res)) return get_certain(res);
- } catch (Uncertain_conversion_exception) {}
- }
- return p2(std::forward<U>(u)...);
- }
-#else
- result_type operator()()const{ // does it make sense to have 0 argument?
- {
- Protect_FPU_rounding<true> p;
- try {
- typename P1::result_type res=p1();
- if(is_certain(res)) return get_certain(res);
- } catch (Uncertain_conversion_exception) {}
- }
- return p2();
- }
-#define CGAL_CODE(Z,N,_) template<BOOST_PP_ENUM_PARAMS(N,class T)> result_type operator()(BOOST_PP_ENUM_BINARY_PARAMS(N,T,const&t))const{ \
- { \
- Protect_FPU_rounding<true> p; \
- try { \
- typename P1::result_type res=p1(BOOST_PP_ENUM_PARAMS(N,t)); \
- if(is_certain(res)) return get_certain(res); \
- } catch (Uncertain_conversion_exception) {} \
- } \
- return p2(BOOST_PP_ENUM_PARAMS(N,t)); \
- }
- BOOST_PP_REPEAT_FROM_TO(1,11,CGAL_CODE,_)
-#undef CGAL_CODE
-
-#endif
- };
- };
-};
-
-} //namespace CGAL
-
-#endif // CGAL_KERNEL_D_CARTESIAN_FILTER_NT_H
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_per_dimension.h b/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_per_dimension.h
deleted file mode 100644
index 179f7319..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_per_dimension.h
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_KD_CARTESIAN_PER_DIM_H
-#define CGAL_KD_CARTESIAN_PER_DIM_H
-#include <CGAL/NewKernel_d/functor_tags.h>
-#include <CGAL/Dimension.h>
-#include <CGAL/predicates/sign_of_determinant.h>
-
-// Should probably disappear.
-
-namespace CGAL {
-template <class Dim_, class R_, class Derived_>
-struct Cartesian_per_dimension : public R_ {};
-}
-
-#endif
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_static_filters.h b/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_static_filters.h
deleted file mode 100644
index 693e962a..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_static_filters.h
+++ /dev/null
@@ -1,95 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_KD_CARTESIAN_STATIC_FILTERS_H
-#define CGAL_KD_CARTESIAN_STATIC_FILTERS_H
-#include <CGAL/NewKernel_d/functor_tags.h>
-#include <CGAL/Dimension.h>
-#include <CGAL/internal/Static_filters/tools.h> // bug, should be included by the next one
-#include <CGAL/internal/Static_filters/Orientation_2.h>
-#include <boost/mpl/if.hpp>
-
-namespace CGAL {
-namespace SFA { // static filter adapter
-// Note that this would be quite a bit simpler without stateful kernels
-template <class Base_,class R_> struct Orientation_of_points_2 : private Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Orientation_of_points_2)
- typedef typename Get_type<R_, Point_tag>::type Point;
- typedef typename Get_type<R_, Orientation_tag>::type result_type;
- typedef typename Get_type<R_, FT_tag>::type FT;
- typedef typename Get_functor<R_, Compute_point_cartesian_coordinate_tag>::type CC;
- typedef typename Get_functor<Base_, Orientation_of_points_tag>::type Orientation_base;
- // TODO: Move this out for easy reuse
- struct Adapter {
- struct Point_2 {
- R_ const&r; CC const&c; Point const& p;
- Point_2(R_ const&r_, CC const&c_, Point const&p_):r(r_),c(c_),p(p_){}
- // use result_of instead?
- typename CC::result_type x()const{return c(p,0);}
- typename CC::result_type y()const{return c(p,1);}
- };
- struct Vector_2 {};
- struct Circle_2 {};
- struct Orientation_2 {
- typedef typename Orientation_of_points_2::result_type result_type;
- result_type operator()(Point_2 const&A, Point_2 const&B, Point_2 const&C)const{
- Point const* t[3]={&A.p,&B.p,&C.p};
- return Orientation_base(A.r)(make_transforming_iterator<Dereference_functor>(t+0),make_transforming_iterator<Dereference_functor>(t+3));
- }
- };
- };
- template<class Iter> result_type operator()(Iter f, Iter CGAL_assertion_code(e))const{
- CC c(this->kernel());
- Point const& A=*f;
- Point const& B=*++f;
- Point const& C=*++f;
- CGAL_assertion(++f==e);
- typedef typename Adapter::Point_2 P;
- return typename internal::Static_filters_predicates::Orientation_2<Adapter>()(P(this->kernel(),c,A),P(this->kernel(),c,B),P(this->kernel(),c,C));
- }
-};
-}
-
-template <class Dim_ /* should be implicit */, class R_, class Derived_=Default>
-struct Cartesian_static_filters : public R_ {
- CGAL_CONSTEXPR Cartesian_static_filters(){}
- CGAL_CONSTEXPR Cartesian_static_filters(int d):R_(d){}
-};
-
-template <class R_, class Derived_>
-struct Cartesian_static_filters<Dimension_tag<2>, R_, Derived_> : public R_ {
- CGAL_CONSTEXPR Cartesian_static_filters(){}
- CGAL_CONSTEXPR Cartesian_static_filters(int d):R_(d){}
- typedef Cartesian_static_filters<Dimension_tag<2>, R_, Derived_> Self;
- typedef typename Default::Get<Derived_,Self>::type Derived;
- template <class T, class=void> struct Functor : Inherit_functor<R_, T> {};
- template <class D> struct Functor <Orientation_of_points_tag,D> {
- typedef
- //typename boost::mpl::if_ <
- //boost::is_same<D,No_filter_tag>,
- //typename Get_functor<R_, Orientation_of_points_tag>::type,
- SFA::Orientation_of_points_2<R_,Derived>
- // >::type
- type;
- };
-};
-
-}
-
-#endif
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/Coaffine.h b/include/gudhi_patches/CGAL/NewKernel_d/Coaffine.h
deleted file mode 100644
index 43015d24..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/Coaffine.h
+++ /dev/null
@@ -1,330 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_KD_COAFFINE_H
-#define CGAL_KD_COAFFINE_H
-#include <vector>
-#include <algorithm>
-#include <iterator>
-#include <CGAL/Dimension.h>
-#include <CGAL/NewKernel_d/functor_tags.h>
-
-namespace CGAL {
-namespace CartesianDKernelFunctors {
-struct Flat_orientation {
- std::vector<int> proj;
- std::vector<int> rest;
- bool reverse;
-};
-
-// For debugging purposes
-inline std::ostream& operator<< (std::ostream& o, Flat_orientation const& f) {
- o << "Proj: ";
- for(std::vector<int>::const_iterator i=f.proj.begin();
- i!=f.proj.end(); ++i)
- o << *i << ' ';
- o << "\nRest: ";
- for(std::vector<int>::const_iterator i=f.rest.begin();
- i!=f.rest.end(); ++i)
- o << *i << ' ';
- o << "\nInv: " << f.reverse;
- return o << '\n';
-}
-
-namespace internal {
-namespace coaffine {
-template<class Mat>
-inline void debug_matrix(std::ostream& o, Mat const&mat) {
- for(int i=0;i<mat.rows();++i){
- for(int j=0;j<mat.cols();++j){
- o<<mat(i,j)<<' ';
- }
- o<<'\n';
- }
-}
-}
-}
-
-template<class R_> struct Construct_flat_orientation : private Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Construct_flat_orientation)
- typedef R_ R;
- typedef typename Get_type<R, FT_tag>::type FT;
- typedef typename Get_type<R, Point_tag>::type Point;
- typedef typename Increment_dimension<typename R::Max_ambient_dimension>::type Dplusone;
- typedef typename R::LA::template Rebind_dimension<Dynamic_dimension_tag,Dplusone>::Other LA;
- typedef typename LA::Square_matrix Matrix;
- typedef typename Get_functor<R, Compute_point_cartesian_coordinate_tag>::type CCC;
- typedef typename Get_functor<R, Point_dimension_tag>::type PD;
- typedef Flat_orientation result_type;
-
- // This implementation is going to suck. Maybe we should push the
- // functionality into LA. And we should check (in debug mode) that
- // the points are affinely independent.
- template<class Iter>
- result_type operator()(Iter f, Iter e)const{
- Iter f_save = f;
- PD pd (this->kernel());
- CCC ccc (this->kernel());
- int dim = pd(*f);
- Matrix coord (dim+1, dim+1); // use distance(f,e)? This matrix doesn't need to be square.
- int col = 0;
- Flat_orientation o;
- std::vector<int>& proj=o.proj;
- std::vector<int>& rest=o.rest; rest.reserve(dim+1);
- for(int i=0; i<dim+1; ++i) rest.push_back(i);
- for( ; f != e ; ++col, ++f ) {
- //std::cerr << "(*f)[0]=" << (*f)[0] << std::endl;
- Point const&p=*f;
- // use a coordinate iterator instead?
- for(int i=0; i<dim; ++i) coord(col, i) = ccc(p, i);
- coord(col,dim)=1;
- int d = (int)proj.size()+1;
- Matrix m (d, d);
- // Fill the matrix with what we already have
- for(int i=0; i<d; ++i)
- for(int j=0; j<d-1; ++j)
- m(i,j) = coord(i, proj[j]);
- // Try to complete with any other coordinate
- // TODO: iterate on rest by the end, or use a (forward_)list.
- for(std::vector<int>::iterator it=rest.begin();;++it) {
- CGAL_assertion(it!=rest.end());
- for(int i=0; i<d; ++i) m(i,d-1) = coord(i, *it);
- if(LA::sign_of_determinant(m)!=0) {
- proj.push_back(*it);
- rest.erase(it);
- break;
- }
- }
- }
- std::sort(proj.begin(),proj.end());
- typename Get_functor<R, In_flat_orientation_tag>::type ifo(this->kernel());
- o.reverse = false;
- o.reverse = ifo(o, f_save, e) != CGAL::POSITIVE;
- return o;
- }
-};
-
-template<class R_> struct Contained_in_affine_hull : private Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Contained_in_affine_hull)
- typedef R_ R;
- typedef typename Get_type<R, FT_tag>::type FT;
- typedef typename Get_type<R, Point_tag>::type Point;
- typedef typename Get_type<R, Bool_tag>::type result_type;
- typedef typename Get_functor<R, Compute_point_cartesian_coordinate_tag>::type CCC;
- typedef typename Get_functor<R, Point_dimension_tag>::type PD;
- //typedef typename Increment_dimension<typename R::Default_ambient_dimension>::type D1;
- //typedef typename Increment_dimension<typename R::Max_ambient_dimension>::type D2;
- //typedef typename R::LA::template Rebind_dimension<D1,D2>::Other LA;
- typedef typename Increment_dimension<typename R::Max_ambient_dimension>::type Dplusone;
- typedef typename R::LA::template Rebind_dimension<Dynamic_dimension_tag,Dplusone>::Other LA;
- typedef typename LA::Square_matrix Matrix;
-
- // mostly copied from Construct_flat_orientation. TODO: dedup this code or use LA.
- template<class Iter>
- result_type operator()(Iter f, Iter e, Point const&x) const {
- // FIXME: are the points in (f,e) required to be affinely independent?
- PD pd (this->kernel());
- CCC ccc (this->kernel());
- int dim=pd(*f);
- Matrix coord (dim+1, dim+1); // use distance
- int col = 0;
- std::vector<int> proj;
- std::vector<int> rest; rest.reserve(dim+1);
- for(int i=0; i<dim+1; ++i) rest.push_back(i);
- for( ; f != e ; ++col, ++f ) {
- Point const&p=*f;
- for(int i=0; i<dim; ++i) coord(col, i) = ccc(p, i);
- coord(col,dim)=1;
- int d = (int)proj.size()+1;
- Matrix m (d, d);
- for(int i=0; i<d; ++i)
- for(int j=0; j<d-1; ++j)
- m(i,j) = coord(i, proj[j]);
- for(std::vector<int>::iterator it=rest.begin();it!=rest.end();++it) {
- for(int i=0; i<d; ++i) m(i,d-1) = coord(i, *it);
- if(LA::sign_of_determinant(m)!=0) {
- proj.push_back(*it);
- rest.erase(it);
- break;
- }
- }
- }
- for(int i=0; i<dim; ++i) coord(col, i) = ccc(x, i);
- coord(col,dim)=1;
- int d = (int)proj.size()+1;
- Matrix m (d, d);
- for(int i=0; i<d; ++i)
- for(int j=0; j<d-1; ++j)
- m(i,j) = coord(i, proj[j]);
- for(std::vector<int>::iterator it=rest.begin();it!=rest.end();++it) {
- for(int i=0; i<d; ++i) m(i,d-1) = coord(i, *it);
- if(LA::sign_of_determinant(m)!=0) return false;
- }
- return true;
- }
-};
-
-template<class R_> struct In_flat_orientation : private Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(In_flat_orientation)
- typedef R_ R;
- typedef typename Get_type<R, FT_tag>::type FT;
- typedef typename Get_type<R, Point_tag>::type Point;
- typedef typename Get_type<R, Orientation_tag>::type result_type;
- typedef typename Increment_dimension<typename R::Default_ambient_dimension>::type D1;
- typedef typename Increment_dimension<typename R::Max_ambient_dimension>::type D2;
- typedef typename R::LA::template Rebind_dimension<D1,D2>::Other LA;
- typedef typename LA::Square_matrix Matrix;
-
- template<class Iter>
- result_type operator()(Flat_orientation const&o, Iter f, Iter e) const {
- // TODO: work in the projection instead of the ambient space.
- typename Get_functor<R, Compute_point_cartesian_coordinate_tag>::type c(this->kernel());
- typename Get_functor<R, Point_dimension_tag>::type pd(this->kernel());
- int d=pd(*f);
- Matrix m(d+1,d+1);
- int i=0;
- for(;f!=e;++f,++i) {
- Point const& p=*f;
- m(i,0)=1;
- for(int j=0;j<d;++j){
- m(i,j+1)=c(p,j);
- }
- }
- for(std::vector<int>::const_iterator it = o.rest.begin(); it != o.rest.end() /* i<d+1 */; ++i, ++it) {
- m(i,0)=1;
- for(int j=0;j<d;++j){
- m(i,j+1)=0; // unneeded if the matrix is initialized to 0
- }
- if(*it != d) m(i,1+*it)=1;
- }
-
- result_type ret = LA::sign_of_determinant(CGAL_MOVE(m));
- if(o.reverse) ret=-ret;
- return ret;
- }
-};
-
-template<class R_> struct In_flat_side_of_oriented_sphere : private Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(In_flat_side_of_oriented_sphere)
- typedef R_ R;
- typedef typename Get_type<R, FT_tag>::type FT;
- typedef typename Get_type<R, Point_tag>::type Point;
- typedef typename Get_type<R, Orientation_tag>::type result_type;
- typedef typename Increment_dimension<typename R::Default_ambient_dimension,2>::type D1;
- typedef typename Increment_dimension<typename R::Max_ambient_dimension,2>::type D2;
- typedef typename R::LA::template Rebind_dimension<D1,D2>::Other LA;
- typedef typename LA::Square_matrix Matrix;
-
- template<class Iter>
- result_type operator()(Flat_orientation const&o, Iter f, Iter e, Point const&x) const {
- // TODO: can't work in the projection, but we should at least remove the row of 1s.
- typename Get_functor<R, Compute_point_cartesian_coordinate_tag>::type c(this->kernel());
- typename Get_functor<R, Point_dimension_tag>::type pd(this->kernel());
- int d=pd(*f);
- Matrix m(d+2,d+2);
- int i=0;
- for(;f!=e;++f,++i) {
- Point const& p=*f;
- m(i,0)=1;
- m(i,d+1)=0;
- for(int j=0;j<d;++j){
- m(i,j+1)=c(p,j);
- m(i,d+1)+=CGAL_NTS square(m(i,j+1));
- }
- }
- for(std::vector<int>::const_iterator it = o.rest.begin(); it != o.rest.end() /* i<d+1 */; ++i, ++it) {
- m(i,0)=1;
- for(int j=0;j<d;++j){
- m(i,j+1)=0; // unneeded if the matrix is initialized to 0
- }
- if(*it != d) m(i,d+1)=m(i,1+*it)=1;
- else m(i,d+1)=0;
- }
- m(d+1,0)=1;
- m(d+1,d+1)=0;
- for(int j=0;j<d;++j){
- m(d+1,j+1)=c(x,j);
- m(d+1,d+1)+=CGAL_NTS square(m(d+1,j+1));
- }
-
- result_type ret = -LA::sign_of_determinant(CGAL_MOVE(m));
- if(o.reverse) ret=-ret;
- return ret;
- }
-};
-
-template<class R_> struct In_flat_power_side_of_power_sphere_raw : private Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(In_flat_power_side_of_power_sphere_raw)
- typedef R_ R;
- typedef typename Get_type<R, FT_tag>::type FT;
- typedef typename Get_type<R, Point_tag>::type Point;
- typedef typename Get_type<R, Orientation_tag>::type result_type;
- typedef typename Increment_dimension<typename R::Default_ambient_dimension,2>::type D1;
- typedef typename Increment_dimension<typename R::Max_ambient_dimension,2>::type D2;
- typedef typename R::LA::template Rebind_dimension<D1,D2>::Other LA;
- typedef typename LA::Square_matrix Matrix;
-
- template<class Iter, class IterW, class Wt>
- result_type operator()(Flat_orientation const&o, Iter f, Iter e, IterW fw, Point const&x, Wt const&w) const {
- // TODO: can't work in the projection, but we should at least remove the row of 1s.
- typename Get_functor<R, Compute_point_cartesian_coordinate_tag>::type c(this->kernel());
- typename Get_functor<R, Point_dimension_tag>::type pd(this->kernel());
- int d=pd(*f);
- Matrix m(d+2,d+2);
- int i=0;
- for(;f!=e;++f,++fw,++i) {
- Point const& p=*f;
- m(i,0)=1;
- m(i,d+1)=-*fw;
- for(int j=0;j<d;++j){
- m(i,j+1)=c(p,j);
- m(i,d+1)+=CGAL_NTS square(m(i,j+1));
- }
- }
- for(std::vector<int>::const_iterator it = o.rest.begin(); it != o.rest.end() /* i<d+1 */; ++i, ++it) {
- m(i,0)=1;
- for(int j=0;j<d;++j){
- m(i,j+1)=0; // unneeded if the matrix is initialized to 0
- }
- if(*it != d) m(i,d+1)=m(i,1+*it)=1;
- else m(i,d+1)=0;
- }
- m(d+1,0)=1;
- m(d+1,d+1)=-w;
- for(int j=0;j<d;++j){
- m(d+1,j+1)=c(x,j);
- m(d+1,d+1)+=CGAL_NTS square(m(d+1,j+1));
- }
-
- result_type ret = -LA::sign_of_determinant(CGAL_MOVE(m));
- if(o.reverse) ret=-ret;
- return ret;
- }
-};
-
-
-}
-CGAL_KD_DEFAULT_TYPE(Flat_orientation_tag,(CGAL::CartesianDKernelFunctors::Flat_orientation),(),());
-CGAL_KD_DEFAULT_FUNCTOR(In_flat_orientation_tag,(CartesianDKernelFunctors::In_flat_orientation<K>),(Point_tag),(Compute_point_cartesian_coordinate_tag,Point_dimension_tag));
-CGAL_KD_DEFAULT_FUNCTOR(In_flat_side_of_oriented_sphere_tag,(CartesianDKernelFunctors::In_flat_side_of_oriented_sphere<K>),(Point_tag),(Compute_point_cartesian_coordinate_tag,Point_dimension_tag));
-CGAL_KD_DEFAULT_FUNCTOR(In_flat_power_side_of_power_sphere_raw_tag,(CartesianDKernelFunctors::In_flat_power_side_of_power_sphere_raw<K>),(Point_tag),(Compute_point_cartesian_coordinate_tag,Point_dimension_tag));
-CGAL_KD_DEFAULT_FUNCTOR(Construct_flat_orientation_tag,(CartesianDKernelFunctors::Construct_flat_orientation<K>),(Point_tag),(Compute_point_cartesian_coordinate_tag,Point_dimension_tag,In_flat_orientation_tag));
-CGAL_KD_DEFAULT_FUNCTOR(Contained_in_affine_hull_tag,(CartesianDKernelFunctors::Contained_in_affine_hull<K>),(Point_tag),(Compute_point_cartesian_coordinate_tag,Point_dimension_tag));
-}
-#endif
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/Define_kernel_types.h b/include/gudhi_patches/CGAL/NewKernel_d/Define_kernel_types.h
deleted file mode 100644
index 6a40515b..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/Define_kernel_types.h
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_DEFINE_KERNEL_TYPES_H
-#define CGAL_DEFINE_KERNEL_TYPES_H
-#include <CGAL/config.h>
-#include <CGAL/NewKernel_d/functor_tags.h>
-#include <CGAL/typeset.h>
-#ifdef CGAL_CXX11
-#include <type_traits>
-#else
-#include <boost/type_traits.hpp>
-#endif
-
-namespace CGAL {
- namespace internal {
- template<class K,class Tag_,bool=iterator_tag_traits<Tag_>::is_iterator>
- struct Type_or_iter : K::template Type<Tag_> {};
- template<class K,class Tag_>
- struct Type_or_iter<K, Tag_, true> : K::template Iterator<Tag_> {};
- }
- template<class K, class Base=K, class List=typename typeset_union<typename K::Object_list,typename K::Iterator_list>::type> struct Define_kernel_types;
- template<class K, class Base>
- struct Define_kernel_types <K, Base, typeset<> > : Base {};
- template<class K>
- struct Define_kernel_types <K, void, typeset<> > {};
- template<class K, class Base, class List>
- struct Define_kernel_types :
- Typedef_tag_type<typename List::head,
- typename internal::Type_or_iter<K,typename List::head>::type,
- Define_kernel_types<K, Base, typename List::tail>
- > {};
-}
-#endif
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/Dimension_base.h b/include/gudhi_patches/CGAL/NewKernel_d/Dimension_base.h
deleted file mode 100644
index be875e63..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/Dimension_base.h
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_KD_DIMENSION_BASE_h
-#define CGAL_KD_DIMENSION_BASE_h
-#include <CGAL/Dimension.h>
-#include <CGAL/assertions.h>
-#include <CGAL/NewKernel_d/utils.h>
-namespace CGAL {
-struct Store_dimension_base {
- //TODO: add some assertions
- Store_dimension_base(int dim=UNKNOWN_DIMENSION):dim_(dim){}
- int dimension()const{return dim_;}
- void set_dimension(int dim){dim_=dim;}
- private:
- int dim_;
-};
-template<class=Dynamic_dimension_tag>
-struct Dimension_base {
- Dimension_base(int = UNKNOWN_DIMENSION){}
- int dimension() const { return UNKNOWN_DIMENSION; }
- void set_dimension(int) {}
-};
-template<int dim_>
-struct Dimension_base<Dimension_tag<dim_> > {
- Dimension_base(){}
- Dimension_base(int CGAL_assertion_code(dim)){CGAL_assertion(dim_==dim);}
- int dimension()const{return dim_;}
- void set_dimension(int dim){CGAL_assertion(dim_==dim);}
-};
-}
-#endif
-
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/Filtered_predicate2.h b/include/gudhi_patches/CGAL/NewKernel_d/Filtered_predicate2.h
deleted file mode 100644
index 1a6a67bc..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/Filtered_predicate2.h
+++ /dev/null
@@ -1,137 +0,0 @@
-// Copyright (c) 2001-2005 INRIA Sophia-Antipolis (France).
-// All rights reserved.
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-//
-// Author(s) : Sylvain Pion
-
-#ifndef CGAL_FILTERED_PREDICATE2_H
-#define CGAL_FILTERED_PREDICATE2_H
-
-#include <string>
-#include <CGAL/config.h>
-#include <CGAL/Interval_nt.h>
-#include <CGAL/Uncertain.h>
-#include <CGAL/Profile_counter.h>
-#include <CGAL/NewKernel_d/store_kernel.h>
-#include <boost/preprocessor.hpp>
-
-namespace CGAL {
-
-// This template class is a wrapper that implements the filtering for any
-// predicate (dynamic filters with IA).
-
-// TODO :
-// - each predicate in the default kernel should define a tag that says if it
-// wants to be filtered or not (=> all homogeneous predicate define this
-// tag). We could even test-suite that automatically. It makes a strong
-// new requirement on the kernel though...
-// Could be done with a traits mechanism ?
-// A default template could use the current IA, but other tags or whatever
-// could specify no filtering at all, or static filtering...
-// - same thing for constructions => virtual operator() ?
-// - similarly, constructions should have a tag saying if they can throw or
-// not, or we let all this up to the compiler optimizer to figure out ?
-// - Some caching could be done at the Point_2 level.
-
-
-template <class EP, class AP, class C2E, class C2A, bool Protection = true>
-class Filtered_predicate2
-{
-//TODO: pack (at least use a tuple)
-//FIXME: is it better to store those, or just store enough to recreate them
-//(i.e. possibly references to the kernels)?
- EP ep;
- AP ap;
- C2E c2e;
- C2A c2a;
-
- typedef typename AP::result_type Ares;
-
-public:
-
- typedef AP Approximate_predicate;
- typedef EP Exact_predicate;
- typedef C2E To_exact_converter;
- typedef C2A To_approximate_converter;
-
- // FIXME: should use result_of, see emails by Nico
- typedef typename EP::result_type result_type;
- // AP::result_type must be convertible to EP::result_type.
-
- Filtered_predicate2()
- {}
-
- template <class K>
- Filtered_predicate2(const K& k)
- : ep(k.exact_kernel()), ap(k.approximate_kernel()), c2e(k,k.exact_kernel()), c2a(k,k.approximate_kernel())
- {}
-
-#ifdef CGAL_CXX11
- template <typename... Args>
- result_type
- operator()(Args&&... args) const
- {
- CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp);
- // Protection is outside the try block as VC8 has the CGAL_CFG_FPU_ROUNDING_MODE_UNWINDING_VC_BUG
- {
- Protect_FPU_rounding<Protection> p;
- try
- {
- // No forward here, the arguments may still be needed
- Ares res = ap(c2a(args)...);
- if (is_certain(res))
- return get_certain(res);
- }
- catch (Uncertain_conversion_exception) {}
- }
- CGAL_BRANCH_PROFILER_BRANCH(tmp);
- Protect_FPU_rounding<!Protection> p(CGAL_FE_TONEAREST);
- return ep(c2e(std::forward<Args>(args))...);
- }
-#else
-
-#define CGAL_VAR(Z,N,C) C(a##N)
-#define CGAL_CODE(Z,N,_) \
- template <BOOST_PP_ENUM_PARAMS(N,class A)> \
- result_type \
- operator()(BOOST_PP_ENUM_BINARY_PARAMS(N, A, const& a)) const \
- { \
- CGAL_BRANCH_PROFILER(std::string(" failures/calls to : ") + std::string(CGAL_PRETTY_FUNCTION), tmp); \
- { \
- Protect_FPU_rounding<Protection> p; \
- try \
- { \
- Ares res = ap(BOOST_PP_ENUM(N,CGAL_VAR,c2a)); \
- if (is_certain(res)) \
- return get_certain(res); \
- } \
- catch (Uncertain_conversion_exception) {} \
- } \
- CGAL_BRANCH_PROFILER_BRANCH(tmp); \
- Protect_FPU_rounding<!Protection> p(CGAL_FE_TONEAREST); \
- return ep(BOOST_PP_ENUM(N,CGAL_VAR,c2e)); \
- }
- BOOST_PP_REPEAT_FROM_TO(1, 10, CGAL_CODE, _ )
-#undef CGAL_CODE
-#undef CGAL_VAR
-
-#endif
-};
-
-} //namespace CGAL
-
-#endif // CGAL_FILTERED_PREDICATE2_H
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/KernelD_converter.h b/include/gudhi_patches/CGAL/NewKernel_d/KernelD_converter.h
deleted file mode 100644
index a8896976..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/KernelD_converter.h
+++ /dev/null
@@ -1,199 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_KERNEL_D_CARTESIAN_CONVERTER_H
-#define CGAL_KERNEL_D_CARTESIAN_CONVERTER_H
-
-#include <CGAL/basic.h>
-#include <CGAL/tuple.h>
-#include <CGAL/typeset.h>
-#include <CGAL/Object.h>
-#include <CGAL/Origin.h>
-#include <CGAL/NT_converter.h>
-#include <CGAL/NewKernel_d/functor_tags.h>
-#include <CGAL/Kernel/mpl.h>
-#include <CGAL/is_iterator.h>
-#include <CGAL/transforming_iterator.h>
-#include <boost/utility/enable_if.hpp>
-#include <boost/mpl/if.hpp>
-#include <CGAL/NewKernel_d/store_kernel.h>
-#include <CGAL/NewKernel_d/Kernel_object_converter.h>
-
-namespace CGAL {
-namespace internal {
-// Reverses order, but that shouldn't matter.
-template<class K,class T> struct Map_taglist_to_typelist :
- Map_taglist_to_typelist<K,typename T::tail>::type
- ::template add<typename Get_type<K, typename T::head>::type>
-{};
-template<class K> struct Map_taglist_to_typelist<K,typeset<> > : typeset<> {};
-}
-
-template<class List = typeset<> >
-struct Object_converter {
- typedef Object result_type;
- template<class F>
- result_type operator()(Object const& o, F const& f) const {
- typedef typename List::head H;
- if (H const* ptr = object_cast<H>(&o))
- return make_object(f(*ptr));
- else
- return Object_converter<typename List::tail>()(o,f);
- }
-};
-template<>
-struct Object_converter <typeset<> > {
- typedef Object result_type;
- template<class F>
- result_type operator()(Object const&,F const&)const {
- CGAL_error_msg("Cartesiand_converter is unable to determine what is wrapped in the Object");
- return Object();
- }
-};
-
-
- //TODO: special case when K1==K2 (or they are very close?)
-template<class Final_, class K1, class K2, class List>
-class KernelD_converter_
-: public KernelD_converter_<Final_,K1,K2,typename List::tail>
-{
- typedef typename List::head Tag_;
- typedef typename List::tail Rest;
- typedef KernelD_converter_<Final_,K1,K2,Rest> Base;
- typedef typename Get_type<K1,Tag_>::type K1_Obj;
- typedef typename Get_type<K2,Tag_>::type K2_Obj;
- typedef typename Get_functor<K1, Convert_ttag<Tag_> >::type K1_Conv;
- typedef KO_converter<Tag_,K1,K2> KOC;
- typedef CGAL_BOOSTD is_same<K1_Conv, Null_functor> no_converter;
- typedef typename internal::Map_taglist_to_typelist<K1,Rest>::type::template contains<K1_Obj> duplicate;
-
- // Disable the conversion in some cases:
- struct Do_not_use{};
-
- // Explicit calls to boost::mpl functions to avoid parenthesis
- // warning on some versions of GCC
- typedef typename boost::mpl::if_ <
- // If Point==Vector, keep only one conversion
- boost::mpl::or_<boost::mpl::bool_<duplicate::value>,
- // For iterator objects, the default is make_transforming_iterator
- boost::mpl::bool_<(iterator_tag_traits<Tag_>::is_iterator && no_converter::value)> >,
- Do_not_use,K1_Obj>::type argument_type;
- //typedef typename KOC::argument_type K1_Obj;
- //typedef typename KOC::result_type K2_Obj;
- public:
- using Base::operator(); // don't use directly, just make it accessible to the next level
- K2_Obj helper(K1_Obj const& o,CGAL_BOOSTD true_type)const{
- return KOC()(this->myself().kernel(),this->myself().kernel2(),this->myself(),o);
- }
- K2_Obj helper(K1_Obj const& o,CGAL_BOOSTD false_type)const{
- return K1_Conv(this->myself().kernel())(this->myself().kernel2(),this->myself(),o);
- }
- K2_Obj operator()(argument_type const& o)const{
- return helper(o,no_converter());
- }
- template<class X,int=0> struct result:Base::template result<X>{};
- template<int i> struct result<Final_(argument_type),i> {typedef K2_Obj type;};
-};
-
-template<class Final_, class K1, class K2>
-class KernelD_converter_<Final_,K1,K2,typeset<> > {
- public:
- struct Do_not_use2{};
- void operator()(Do_not_use2)const{}
- template<class T> struct result;
- Final_& myself(){return *static_cast<Final_*>(this);}
- Final_ const& myself()const{return *static_cast<Final_ const*>(this);}
-};
-
-
-// TODO: use the intersection of Kn::Object_list.
-template<class K1, class K2, class List_=
-typename typeset_intersection<typename K1::Object_list, typename K2::Object_list>::type
-//typeset<Point_tag>::add<Vector_tag>::type/*::add<Segment_tag>::type*/
-> class KernelD_converter
- : public Store_kernel<K1>, public Store_kernel2<K2>,
- public KernelD_converter_<KernelD_converter<K1,K2,List_>,K1,K2,List_>
-{
- typedef KernelD_converter Self;
- typedef Self Final_;
- typedef KernelD_converter_<Self,K1,K2,List_> Base;
- typedef typename Get_type<K1, FT_tag>::type FT1;
- typedef typename Get_type<K2, FT_tag>::type FT2;
- typedef NT_converter<FT1, FT2> NTc;
- NTc c; // TODO: compressed storage as this is likely empty and the converter gets passed around (and stored in iterators)
-
- public:
- KernelD_converter(){}
- KernelD_converter(K1 const&a,K2 const&b):Store_kernel<K1>(a),Store_kernel2<K2>(b){}
-
- // For boost::result_of, used in transforming_iterator
- template<class T,int i=is_iterator<T>::value?42:0> struct result:Base::template result<T>{};
- template<class T> struct result<Final_(T),42> {
- typedef transforming_iterator<Final_,T> type;
- };
- template<int i> struct result<Final_(K1),i>{typedef K2 type;};
- template<int i> struct result<Final_(int),i>{typedef int type;};
- // Ideally the next 2 would come with Point_tag and Vector_tag, but that's hard...
- template<int i> struct result<Final_(Origin),i>{typedef Origin type;};
- template<int i> struct result<Final_(Null_vector),i>{typedef Null_vector type;};
- template<int i> struct result<Final_(Object),i>{typedef Object type;};
- template<int i> struct result<Final_(FT1),i>{typedef FT2 type;};
-
- using Base::operator();
- typename Store_kernel2<K2>::reference2_type operator()(K1 const&)const{return this->kernel2();}
- int operator()(int i)const{return i;}
- Origin operator()(Origin const&o)const{return o;}
- Null_vector operator()(Null_vector const&v)const{return v;}
- FT2 operator()(FT1 const&x)const{return c(x);}
- //RT2 operator()(typename First_if_different<RT1,FT1>::Type const&x)const{return cr(x);}
-
- typename Get_type<K2, Flat_orientation_tag>::type const&
- operator()(typename Get_type<K1, Flat_orientation_tag>::type const&o)const
- { return o; } // Both kernels should have the same, returning a reference should warn if not.
-
- template<class It>
- transforming_iterator<Final_,typename boost::enable_if<is_iterator<It>,It>::type>
- operator()(It const& it) const {
- return make_transforming_iterator(it,*this);
- }
-
- template<class T>
- //TODO: use decltype in C++11 instead of result
- std::vector<typename result<Final_(T)>::type>
- operator()(const std::vector<T>& v) const {
- return std::vector<typename result<Final_(T)>::type>(operator()(v.begin()),operator()(v.begin()));
- }
-
- //TODO: convert std::list and other containers?
-
- Object
- operator()(const Object &obj) const
- {
- typedef typename internal::Map_taglist_to_typelist<K1,List_>::type Possibilities;
- //TODO: add Empty, vector<Point>, etc to the list.
- return Object_converter<Possibilities>()(obj,*this);
- }
-
- //TODO: convert boost::variant
-
-};
-
-} //namespace CGAL
-
-#endif // CGAL_KERNEL_D_CARTESIAN_CONVERTER_H
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/Kernel_2_interface.h b/include/gudhi_patches/CGAL/NewKernel_d/Kernel_2_interface.h
deleted file mode 100644
index fa30dff0..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/Kernel_2_interface.h
+++ /dev/null
@@ -1,104 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_KD_KERNEL_2_INTERFACE_H
-#define CGAL_KD_KERNEL_2_INTERFACE_H
-
-#include <CGAL/NewKernel_d/functor_tags.h>
-#include <CGAL/transforming_iterator.h>
-#include <CGAL/NewKernel_d/utils.h>
-#include <CGAL/tuple.h>
-
-
-namespace CGAL {
-template <class Base_> struct Kernel_2_interface : public Base_ {
- typedef Base_ Base;
- typedef Kernel_2_interface<Base> Kernel;
- typedef typename Get_type<Base, RT_tag>::type RT;
- typedef typename Get_type<Base, FT_tag>::type FT;
- typedef typename Get_type<Base, Bool_tag>::type Boolean;
- typedef typename Get_type<Base, Sign_tag>::type Sign;
- typedef typename Get_type<Base, Comparison_result_tag>::type Comparison_result;
- typedef typename Get_type<Base, Orientation_tag>::type Orientation;
- typedef typename Get_type<Base, Oriented_side_tag>::type Oriented_side;
- typedef typename Get_type<Base, Bounded_side_tag>::type Bounded_side;
- typedef typename Get_type<Base, Angle_tag>::type Angle;
- typedef typename Get_type<Base, Point_tag>::type Point_2;
- typedef typename Get_type<Base, Vector_tag>::type Vector_2;
- typedef typename Get_type<Base, Segment_tag>::type Segment_2;
- typedef cpp0x::tuple<Point_2,Point_2,Point_2> Triangle_2; // triangulation insists...
- template <class T,int i> struct Help_2p_i {
- typedef typename Get_functor<Base, T>::type LT;
- typedef typename LT::result_type result_type;
- LT lt;
- Help_2p_i(Kernel const&k):lt(k){}
- result_type operator()(Point_2 const&a, Point_2 const&b) {
- return lt(a,b,i);
- }
- };
- typedef Help_2p_i<Less_point_cartesian_coordinate_tag,0> Less_x_2;
- typedef Help_2p_i<Less_point_cartesian_coordinate_tag,1> Less_y_2;
- typedef Help_2p_i<Compare_point_cartesian_coordinate_tag,0> Compare_x_2;
- typedef Help_2p_i<Compare_point_cartesian_coordinate_tag,1> Compare_y_2;
- struct Compare_distance_2 {
- typedef typename Get_functor<Base, Compare_distance_tag>::type CD;
- typedef typename CD::result_type result_type;
- CD cd;
- Compare_distance_2(Kernel const&k):cd(k){}
- result_type operator()(Point_2 const&a, Point_2 const&b, Point_2 const&c) {
- return cd(a,b,c);
- }
- result_type operator()(Point_2 const&a, Point_2 const&b, Point_2 const&c, Point_2 const&d) {
- return cd(a,b,c,d);
- }
- };
- struct Orientation_2 {
- typedef typename Get_functor<Base, Orientation_of_points_tag>::type O;
- typedef typename O::result_type result_type;
- O o;
- Orientation_2(Kernel const&k):o(k){}
- result_type operator()(Point_2 const&a, Point_2 const&b, Point_2 const&c) {
- //return o(a,b,c);
- Point_2 const* t[3]={&a,&b,&c};
- return o(make_transforming_iterator<Dereference_functor>(t+0),make_transforming_iterator<Dereference_functor>(t+3));
-
- }
- };
- struct Side_of_oriented_circle_2 {
- typedef typename Get_functor<Base, Side_of_oriented_sphere_tag>::type SOS;
- typedef typename SOS::result_type result_type;
- SOS sos;
- Side_of_oriented_circle_2(Kernel const&k):sos(k){}
- result_type operator()(Point_2 const&a, Point_2 const&b, Point_2 const&c, Point_2 const&d) {
- //return sos(a,b,c,d);
- Point_2 const* t[4]={&a,&b,&c,&d};
- return sos(make_transforming_iterator<Dereference_functor>(t+0),make_transforming_iterator<Dereference_functor>(t+4));
- }
- };
- Less_x_2 less_x_2_object()const{ return Less_x_2(*this); }
- Less_y_2 less_y_2_object()const{ return Less_y_2(*this); }
- Compare_x_2 compare_x_2_object()const{ return Compare_x_2(*this); }
- Compare_y_2 compare_y_2_object()const{ return Compare_y_2(*this); }
- Compare_distance_2 compare_distance_2_object()const{ return Compare_distance_2(*this); }
- Orientation_2 orientation_2_object()const{ return Orientation_2(*this); }
- Side_of_oriented_circle_2 side_of_oriented_circle_2_object()const{ return Side_of_oriented_circle_2(*this); }
-};
-}
-
-#endif
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/Kernel_3_interface.h b/include/gudhi_patches/CGAL/NewKernel_d/Kernel_3_interface.h
deleted file mode 100644
index 96076aa8..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/Kernel_3_interface.h
+++ /dev/null
@@ -1,102 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_KD_KERNEL_3_INTERFACE_H
-#define CGAL_KD_KERNEL_3_INTERFACE_H
-
-#include <CGAL/NewKernel_d/functor_tags.h>
-#include <CGAL/transforming_iterator.h>
-#include <CGAL/NewKernel_d/utils.h>
-#include <CGAL/tuple.h>
-
-
-namespace CGAL {
-template <class Base_> struct Kernel_3_interface : public Base_ {
- typedef Base_ Base;
- typedef Kernel_3_interface<Base> Kernel;
- typedef typename Get_type<Base, RT_tag>::type RT;
- typedef typename Get_type<Base, FT_tag>::type FT;
- typedef typename Get_type<Base, Bool_tag>::type Boolean;
- typedef typename Get_type<Base, Sign_tag>::type Sign;
- typedef typename Get_type<Base, Comparison_result_tag>::type Comparison_result;
- typedef typename Get_type<Base, Orientation_tag>::type Orientation;
- typedef typename Get_type<Base, Oriented_side_tag>::type Oriented_side;
- typedef typename Get_type<Base, Bounded_side_tag>::type Bounded_side;
- typedef typename Get_type<Base, Angle_tag>::type Angle;
- typedef typename Get_type<Base, Point_tag>::type Point_3;
- typedef typename Get_type<Base, Vector_tag>::type Vector_3;
- typedef typename Get_type<Base, Segment_tag>::type Segment_3;
- typedef cpp0x::tuple<Point_3,Point_3,Point_3> Triangle_3; // placeholder
- typedef cpp0x::tuple<Point_3,Point_3,Point_3,Point_3> Tetrahedron_3; // placeholder
- struct Compare_xyz_3 {
- typedef typename Get_functor<Base, Compare_lexicographically_tag>::type CL;
- typedef typename CL::result_type result_type;
- CL cl;
- Compare_xyz_3(Kernel const&k):cl(k){}
- result_type operator()(Point_3 const&a, Point_3 const&b) {
- return cl(a,b);
- }
- };
- struct Compare_distance_3 {
- typedef typename Get_functor<Base, Compare_distance_tag>::type CD;
- typedef typename CD::result_type result_type;
- CD cd;
- Compare_distance_3(Kernel const&k):cd(k){}
- result_type operator()(Point_3 const&a, Point_3 const&b, Point_3 const&c) {
- return cd(a,b,c);
- }
- result_type operator()(Point_3 const&a, Point_3 const&b, Point_3 const&c, Point_3 const&d) {
- return cd(a,b,c,d);
- }
- };
- struct Orientation_3 {
- typedef typename Get_functor<Base, Orientation_of_points_tag>::type O;
- typedef typename O::result_type result_type;
- O o;
- Orientation_3(Kernel const&k):o(k){}
- result_type operator()(Point_3 const&a, Point_3 const&b, Point_3 const&c, Point_3 const&d) {
- //return o(a,b,c,d);
- Point_3 const* t[4]={&a,&b,&c,&d};
- return o(make_transforming_iterator<Dereference_functor>(t+0),make_transforming_iterator<Dereference_functor>(t+4));
-
- }
- };
- struct Side_of_oriented_sphere_3 {
- typedef typename Get_functor<Base, Side_of_oriented_sphere_tag>::type SOS;
- typedef typename SOS::result_type result_type;
- SOS sos;
- Side_of_oriented_sphere_3(Kernel const&k):sos(k){}
- result_type operator()(Point_3 const&a, Point_3 const&b, Point_3 const&c, Point_3 const&d, Point_3 const&e) {
- //return sos(a,b,c,d);
- Point_3 const* t[5]={&a,&b,&c,&d,&e};
- return sos(make_transforming_iterator<Dereference_functor>(t+0),make_transforming_iterator<Dereference_functor>(t+5));
- }
- };
-
- // I don't have the Coplanar predicates (yet)
-
-
- Compare_xyz_3 compare_xyz_3_object()const{ return Compare_xyz_3(*this); }
- Compare_distance_3 compare_distance_3_object()const{ return Compare_distance_3(*this); }
- Orientation_3 orientation_3_object()const{ return Orientation_3(*this); }
- Side_of_oriented_sphere_3 side_of_oriented_sphere_3_object()const{ return Side_of_oriented_sphere_3(*this); }
-};
-}
-
-#endif
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/Kernel_d_interface.h b/include/gudhi_patches/CGAL/NewKernel_d/Kernel_d_interface.h
deleted file mode 100644
index dd888005..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/Kernel_d_interface.h
+++ /dev/null
@@ -1,298 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_KD_KERNEL_D_INTERFACE_H
-#define CGAL_KD_KERNEL_D_INTERFACE_H
-
-#include <CGAL/NewKernel_d/functor_tags.h>
-#include <CGAL/transforming_iterator.h>
-#include <CGAL/NewKernel_d/utils.h>
-#include <CGAL/tuple.h>
-
-
-namespace CGAL {
-template <class Base_> struct Kernel_d_interface : public Base_ {
- CGAL_CONSTEXPR Kernel_d_interface(){}
- CGAL_CONSTEXPR Kernel_d_interface(int d):Base_(d){}
-
- typedef Base_ Base;
- typedef Kernel_d_interface<Base> Kernel;
- typedef Base_ R_; // for the macros
- typedef typename Get_type<Base, RT_tag>::type RT;
- typedef typename Get_type<Base, FT_tag>::type FT;
- typedef typename Get_type<Base, Bool_tag>::type Boolean;
- typedef typename Get_type<Base, Sign_tag>::type Sign;
- typedef typename Get_type<Base, Comparison_result_tag>::type Comparison_result;
- typedef typename Get_type<Base, Orientation_tag>::type Orientation;
- typedef typename Get_type<Base, Oriented_side_tag>::type Oriented_side;
- typedef typename Get_type<Base, Bounded_side_tag>::type Bounded_side;
- typedef typename Get_type<Base, Angle_tag>::type Angle;
- typedef typename Get_type<Base, Flat_orientation_tag>::type Flat_orientation_d;
- typedef typename Get_type<Base, Point_tag>::type Point_d;
- typedef typename Get_type<Base, Vector_tag>::type Vector_d;
- typedef typename Get_type<Base, Segment_tag>::type Segment_d;
- typedef typename Get_type<Base, Sphere_tag>::type Sphere_d;
- typedef typename Get_type<Base, Hyperplane_tag>::type Hyperplane_d;
- typedef Vector_d Direction_d;
- typedef typename Get_type<Base, Line_tag>::type Line_d;
- typedef typename Get_type<Base, Ray_tag>::type Ray_d;
- typedef typename Get_type<Base, Iso_box_tag>::type Iso_box_d;
- typedef typename Get_type<Base, Aff_transformation_tag>::type Aff_transformation_d;
- typedef typename Get_type<Base, Weighted_point_tag>::type Weighted_point_d;
- typedef typename Get_functor<Base, Compute_point_cartesian_coordinate_tag>::type Compute_coordinate_d;
- typedef typename Get_functor<Base, Compare_lexicographically_tag>::type Compare_lexicographically_d;
- typedef typename Get_functor<Base, Equal_points_tag>::type Equal_d;
- typedef typename Get_functor<Base, Less_lexicographically_tag>::type Less_lexicographically_d;
- typedef typename Get_functor<Base, Less_or_equal_lexicographically_tag>::type Less_or_equal_lexicographically_d;
- // FIXME: and vectors?
- typedef typename Get_functor<Base, Orientation_of_points_tag>::type Orientation_d;
- typedef typename Get_functor<Base, Less_point_cartesian_coordinate_tag>::type Less_coordinate_d;
- typedef typename Get_functor<Base, Point_dimension_tag>::type Point_dimension_d;
- typedef typename Get_functor<Base, Side_of_oriented_sphere_tag>::type Side_of_oriented_sphere_d;
- typedef typename Get_functor<Base, Power_side_of_power_sphere_tag>::type Power_side_of_power_sphere_d;
- typedef typename Get_functor<Base, Power_center_tag>::type Power_center_d;
- typedef typename Get_functor<Base, Power_distance_tag>::type Power_distance_d;
- typedef typename Get_functor<Base, Contained_in_affine_hull_tag>::type Contained_in_affine_hull_d;
- typedef typename Get_functor<Base, Construct_flat_orientation_tag>::type Construct_flat_orientation_d;
- typedef typename Get_functor<Base, In_flat_orientation_tag>::type In_flat_orientation_d;
- typedef typename Get_functor<Base, In_flat_side_of_oriented_sphere_tag>::type In_flat_side_of_oriented_sphere_d;
- typedef typename Get_functor<Base, In_flat_power_side_of_power_sphere_tag>::type In_flat_power_side_of_power_sphere_d;
- typedef typename Get_functor<Base, Point_to_vector_tag>::type Point_to_vector_d;
- typedef typename Get_functor<Base, Vector_to_point_tag>::type Vector_to_point_d;
- typedef typename Get_functor<Base, Translated_point_tag>::type Translated_point_d;
- typedef typename Get_functor<Base, Scaled_vector_tag>::type Scaled_vector_d;
- typedef typename Get_functor<Base, Difference_of_vectors_tag>::type Difference_of_vectors_d;
- typedef typename Get_functor<Base, Difference_of_points_tag>::type Difference_of_points_d;
- //typedef typename Get_functor<Base, Construct_ttag<Point_tag> >::type Construct_point_d;
- struct Construct_point_d : private Store_kernel<Kernel> {
- typedef Kernel R_; // for the macro
- CGAL_FUNCTOR_INIT_STORE(Construct_point_d)
- typedef typename Get_functor<Base, Construct_ttag<Point_tag> >::type CP;
- typedef Point_d result_type;
- Point_d operator()(Weighted_point_d const&wp)const{
- return typename Get_functor<Base, Point_drop_weight_tag>::type(this->kernel())(wp);
- }
-#ifdef CGAL_CXX11
- Point_d operator()(Weighted_point_d &wp)const{
- return typename Get_functor<Base, Point_drop_weight_tag>::type(this->kernel())(wp);
- }
- Point_d operator()(Weighted_point_d &&wp)const{
- return typename Get_functor<Base, Point_drop_weight_tag>::type(this->kernel())(std::move(wp));
- }
- Point_d operator()(Weighted_point_d const&&wp)const{
- return typename Get_functor<Base, Point_drop_weight_tag>::type(this->kernel())(std::move(wp));
- }
- template<class...T>
-# if __cplusplus >= 201402L
- decltype(auto)
-# else
- Point_d
-# endif
- operator()(T&&...t)const{
- return CP(this->kernel())(std::forward<T>(t)...);
- //return CP(this->kernel())(t...);
- }
-#else
-# define CGAL_CODE(Z,N,_) template<BOOST_PP_ENUM_PARAMS(N,class T)> \
- Point_d operator()(BOOST_PP_ENUM_BINARY_PARAMS(N,T,const&t))const{ \
- return CP(this->kernel())(BOOST_PP_ENUM_PARAMS(N,t)); \
- }
- BOOST_PP_REPEAT_FROM_TO(1,11,CGAL_CODE,_)
-# undef CGAL_CODE
- Point_d operator()()const{ \
- return CP(this->kernel())(); \
- }
-#endif
- };
- typedef typename Get_functor<Base, Construct_ttag<Vector_tag> >::type Construct_vector_d;
- typedef typename Get_functor<Base, Construct_ttag<Segment_tag> >::type Construct_segment_d;
- typedef typename Get_functor<Base, Construct_ttag<Sphere_tag> >::type Construct_sphere_d;
- typedef typename Get_functor<Base, Construct_ttag<Hyperplane_tag> >::type Construct_hyperplane_d;
- typedef Construct_vector_d Construct_direction_d;
- typedef typename Get_functor<Base, Construct_ttag<Line_tag> >::type Construct_line_d;
- typedef typename Get_functor<Base, Construct_ttag<Ray_tag> >::type Construct_ray_d;
- typedef typename Get_functor<Base, Construct_ttag<Iso_box_tag> >::type Construct_iso_box_d;
- typedef typename Get_functor<Base, Construct_ttag<Aff_transformation_tag> >::type Construct_aff_transformation_d;
- typedef typename Get_functor<Base, Construct_ttag<Weighted_point_tag> >::type Construct_weighted_point_d;
- typedef typename Get_functor<Base, Midpoint_tag>::type Midpoint_d;
- struct Component_accessor_d : private Store_kernel<Kernel> {
- typedef Kernel R_; // for the macro
- CGAL_FUNCTOR_INIT_STORE(Component_accessor_d)
- int dimension(Point_d const&p){
- return this->kernel().point_dimension_d_object()(p);
- }
- FT cartesian(Point_d const&p, int i){
- return this->kernel().compute_coordinate_d_object()(p,i);
- }
- RT homogeneous(Point_d const&p, int i){
- if (i == dimension(p))
- return 1;
- return cartesian(p, i);
- }
- };
- struct Construct_cartesian_const_iterator_d : private Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Construct_cartesian_const_iterator_d)
- typedef typename Get_functor<Base, Construct_ttag<Point_cartesian_const_iterator_tag> >::type CPI;
- typedef typename Get_functor<Base, Construct_ttag<Vector_cartesian_const_iterator_tag> >::type CVI;
- // FIXME: The following sometimes breaks compilation. The typedef below forces instantiation of this, which forces Point_d, which itself (in the wrapper) needs the derived kernel to tell it what the base kernel is, and that's a cycle. The exact circumstances are not clear, g++ and clang++ are ok in both C++03 and C++11, it is only clang in C++11 without CGAL_CXX11 that breaks. For now, rely on result_type.
- //typedef typename CGAL::decay<typename boost::result_of<CPI(Point_d,CGAL::Begin_tag)>::type>::type result_type;
- typedef typename CGAL::decay<typename CPI::result_type>::type result_type;
- // Kernel_d requires a common iterator type for points and vectors
- // TODO: provide this mixed functor in preKernel?
- //CGAL_static_assertion((boost::is_same<typename CGAL::decay<typename boost::result_of<CVI(Vector_d,CGAL::Begin_tag)>::type>::type, result_type>::value));
- CGAL_static_assertion((boost::is_same<typename CGAL::decay<typename CVI::result_type>::type, result_type>::value));
- template <class Tag_>
- result_type operator()(Point_d const&p, Tag_ t)const{
- return CPI(this->kernel())(p,t);
- }
- template <class Tag_>
- result_type operator()(typename First_if_different<Vector_d,Point_d>::Type const&v, Tag_ t)const{
- return CVI(this->kernel())(v,t);
- }
-
- template <class Obj>
- result_type operator()(Obj const&o)const{
- return operator()(o, Begin_tag());
- }
- result_type operator()(Point_d const&p, int)const{
- return operator()(p, End_tag());
- }
- result_type operator()(typename First_if_different<Vector_d,Point_d>::Type const&v, int)const{
- return operator()(v, End_tag());
- }
- };
- struct Compute_squared_radius_d : private Store_kernel<Kernel> {
- typedef Kernel R_; // for the macro
- CGAL_FUNCTOR_INIT_STORE(Compute_squared_radius_d)
- typedef FT result_type;
- template<class S> FT operator()(CGAL_FORWARDABLE(S) s)const{
- return typename Get_functor<Base, Squared_radius_tag>::type(this->kernel())(CGAL_FORWARD(S,s));
- }
- template<class I> FT operator()(I b, I e)const{
- return typename Get_functor<Base, Squared_circumradius_tag>::type(this->kernel())(b,e);
- }
- };
- typedef typename Construct_cartesian_const_iterator_d::result_type Cartesian_const_iterator_d;
- typedef typename Get_functor<Base, Squared_distance_tag>::type Squared_distance_d;
- typedef typename Get_functor<Base, Squared_length_tag>::type Squared_length_d;
- typedef typename Get_functor<Base, Scalar_product_tag>::type Scalar_product_d;
- typedef typename Get_functor<Base, Affine_rank_tag>::type Affine_rank_d;
- typedef typename Get_functor<Base, Affinely_independent_tag>::type Affinely_independent_d;
- typedef typename Get_functor<Base, Contained_in_linear_hull_tag>::type Contained_in_linear_hull_d;
- typedef typename Get_functor<Base, Contained_in_simplex_tag>::type Contained_in_simplex_d;
- typedef typename Get_functor<Base, Has_on_positive_side_tag>::type Has_on_positive_side_d;
- typedef typename Get_functor<Base, Linear_rank_tag>::type Linear_rank_d;
- typedef typename Get_functor<Base, Linearly_independent_tag>::type Linearly_independent_d;
- typedef typename Get_functor<Base, Oriented_side_tag>::type Oriented_side_d;
- typedef typename Get_functor<Base, Side_of_bounded_circumsphere_tag>::type Side_of_bounded_sphere_d;
-
- typedef typename Get_functor<Base, Center_of_sphere_tag>::type Center_of_sphere_d;
- typedef Center_of_sphere_d Construct_center_d; // RangeSearchTraits
- typedef typename Get_functor<Base, Construct_circumcenter_tag>::type Construct_circumcenter_d;
- typedef typename Get_functor<Base, Value_at_tag>::type Value_at_d;
- typedef typename Get_functor<Base, Point_of_sphere_tag>::type Point_of_sphere_d;
- typedef typename Get_functor<Base, Orthogonal_vector_tag>::type Orthogonal_vector_d;
- typedef typename Get_functor<Base, Linear_base_tag>::type Linear_base_d;
- typedef typename Get_functor<Base, Construct_min_vertex_tag>::type Construct_min_vertex_d;
- typedef typename Get_functor<Base, Construct_max_vertex_tag>::type Construct_max_vertex_d;
-
- typedef typename Get_functor<Base, Point_weight_tag>::type Compute_weight_d;
- typedef typename Get_functor<Base, Point_drop_weight_tag>::type Point_drop_weight_d;
-
- //TODO:
- //typedef ??? Intersect_d;
-
-
- Compute_coordinate_d compute_coordinate_d_object()const{ return Compute_coordinate_d(*this); }
- Has_on_positive_side_d has_on_positive_side_d_object()const{ return Has_on_positive_side_d(*this); }
- Compare_lexicographically_d compare_lexicographically_d_object()const{ return Compare_lexicographically_d(*this); }
- Equal_d equal_d_object()const{ return Equal_d(*this); }
- Less_lexicographically_d less_lexicographically_d_object()const{ return Less_lexicographically_d(*this); }
- Less_or_equal_lexicographically_d less_or_equal_lexicographically_d_object()const{ return Less_or_equal_lexicographically_d(*this); }
- Less_coordinate_d less_coordinate_d_object()const{ return Less_coordinate_d(*this); }
- Orientation_d orientation_d_object()const{ return Orientation_d(*this); }
- Oriented_side_d oriented_side_d_object()const{ return Oriented_side_d(*this); }
- Point_dimension_d point_dimension_d_object()const{ return Point_dimension_d(*this); }
- Point_of_sphere_d point_of_sphere_d_object()const{ return Point_of_sphere_d(*this); }
- Side_of_oriented_sphere_d side_of_oriented_sphere_d_object()const{ return Side_of_oriented_sphere_d(*this); }
- Power_side_of_power_sphere_d power_side_of_power_sphere_d_object()const{ return Power_side_of_power_sphere_d(*this); }
- Power_center_d power_center_d_object()const{ return Power_center_d(*this); }
- Power_distance_d power_distance_d_object()const{ return Power_distance_d(*this); }
- Side_of_bounded_sphere_d side_of_bounded_sphere_d_object()const{ return Side_of_bounded_sphere_d(*this); }
- Contained_in_affine_hull_d contained_in_affine_hull_d_object()const{ return Contained_in_affine_hull_d(*this); }
- Contained_in_linear_hull_d contained_in_linear_hull_d_object()const{ return Contained_in_linear_hull_d(*this); }
- Contained_in_simplex_d contained_in_simplex_d_object()const{ return Contained_in_simplex_d(*this); }
- Construct_flat_orientation_d construct_flat_orientation_d_object()const{ return Construct_flat_orientation_d(*this); }
- In_flat_orientation_d in_flat_orientation_d_object()const{ return In_flat_orientation_d(*this); }
- In_flat_side_of_oriented_sphere_d in_flat_side_of_oriented_sphere_d_object()const{ return In_flat_side_of_oriented_sphere_d(*this); }
- In_flat_power_side_of_power_sphere_d in_flat_power_side_of_power_sphere_d_object()const{ return In_flat_power_side_of_power_sphere_d(*this); }
- Point_to_vector_d point_to_vector_d_object()const{ return Point_to_vector_d(*this); }
- Vector_to_point_d vector_to_point_d_object()const{ return Vector_to_point_d(*this); }
- Translated_point_d translated_point_d_object()const{ return Translated_point_d(*this); }
- Scaled_vector_d scaled_vector_d_object()const{ return Scaled_vector_d(*this); }
- Difference_of_vectors_d difference_of_vectors_d_object()const{ return Difference_of_vectors_d(*this); }
- Difference_of_points_d difference_of_points_d_object()const{ return Difference_of_points_d(*this); }
- Affine_rank_d affine_rank_d_object()const{ return Affine_rank_d(*this); }
- Affinely_independent_d affinely_independent_d_object()const{ return Affinely_independent_d(*this); }
- Linear_base_d linear_base_d_object()const{ return Linear_base_d(*this); }
- Linear_rank_d linear_rank_d_object()const{ return Linear_rank_d(*this); }
- Linearly_independent_d linearly_independent_d_object()const{ return Linearly_independent_d(*this); }
- Midpoint_d midpoint_d_object()const{ return Midpoint_d(*this); }
- Value_at_d value_at_d_object()const{ return Value_at_d(*this); }
- /// Intersect_d intersect_d_object()const{ return Intersect_d(*this); }
- Component_accessor_d component_accessor_d_object()const{ return Component_accessor_d(*this); }
- Orthogonal_vector_d orthogonal_vector_d_object()const{ return Orthogonal_vector_d(*this); }
- Construct_cartesian_const_iterator_d construct_cartesian_const_iterator_d_object()const{ return Construct_cartesian_const_iterator_d(*this); }
- Construct_point_d construct_point_d_object()const{ return Construct_point_d(*this); }
- Construct_vector_d construct_vector_d_object()const{ return Construct_vector_d(*this); }
- Construct_segment_d construct_segment_d_object()const{ return Construct_segment_d(*this); }
- Construct_sphere_d construct_sphere_d_object()const{ return Construct_sphere_d(*this); }
- Construct_hyperplane_d construct_hyperplane_d_object()const{ return Construct_hyperplane_d(*this); }
- Compute_squared_radius_d compute_squared_radius_d_object()const{ return Compute_squared_radius_d(*this); }
- Squared_distance_d squared_distance_d_object()const{ return Squared_distance_d(*this); }
- Squared_length_d squared_length_d_object()const{ return Squared_length_d(*this); }
- Scalar_product_d scalar_product_d_object()const{ return Scalar_product_d(*this); }
- Center_of_sphere_d center_of_sphere_d_object()const{ return Center_of_sphere_d(*this); }
- Construct_circumcenter_d construct_circumcenter_d_object()const{ return Construct_circumcenter_d(*this); }
- Construct_direction_d construct_direction_d_object()const{ return Construct_direction_d(*this); }
- Construct_line_d construct_line_d_object()const{ return Construct_line_d(*this); }
- Construct_ray_d construct_ray_d_object()const{ return Construct_ray_d(*this); }
- Construct_iso_box_d construct_iso_box_d_object()const{ return Construct_iso_box_d(*this); }
- Construct_aff_transformation_d construct_aff_transformation_d_object()const{ return Construct_aff_transformation_d(*this); }
- Construct_min_vertex_d construct_min_vertex_d_object()const{ return Construct_min_vertex_d(*this); }
- Construct_max_vertex_d construct_max_vertex_d_object()const{ return Construct_max_vertex_d(*this); }
- Construct_weighted_point_d construct_weighted_point_d_object()const{ return Construct_weighted_point_d(*this); }
-
- Compute_weight_d compute_weight_d_object()const{ return Compute_weight_d(*this); }
- Point_drop_weight_d point_drop_weight_d_object()const{ return Point_drop_weight_d(*this); }
-
- // Dummies for those required functors missing a concept.
- typedef Null_functor Position_on_line_d;
- Position_on_line_d position_on_line_d_object()const{return Null_functor();}
- typedef Null_functor Barycentric_coordinates_d;
- Barycentric_coordinates_d barycentric_coordinates_d_object()const{return Null_functor();}
-
- /* Not provided because they don't make sense here:
- Lift_to_paraboloid_d
- Project_along_d_axis_d
- */
-};
-}
-
-#endif // CGAL_KD_KERNEL_D_INTERFACE_H
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/Kernel_object_converter.h b/include/gudhi_patches/CGAL/NewKernel_d/Kernel_object_converter.h
deleted file mode 100644
index 99918ed2..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/Kernel_object_converter.h
+++ /dev/null
@@ -1,134 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_KD_KO_CONVERTER_H
-#define CGAL_KD_KO_CONVERTER_H
-#include <CGAL/NewKernel_d/utils.h>
-#include <CGAL/NewKernel_d/functor_tags.h>
-#include <CGAL/Kernel/mpl.h> // First_if_different
-#include <CGAL/Dimension.h>
-namespace CGAL {
-template <class Tag_, class K1, class K2> struct KO_converter;
-//TODO: It would probably be better if this was a Misc Functor in K1.
-// This way K1 could chose how it wants to present its points (sparse
-// iterator?) and derived classes would inherit it.
-
-namespace internal {
-template <class D /*=Dynamic_dimension_tag*/, class K1, class K2>
-struct Point_converter_help {
- typedef typename Get_type<K1, Point_tag>::type argument_type;
- typedef typename Get_type<K2, Point_tag>::type result_type;
- template <class C>
- result_type operator()(K1 const& k1, K2 const& k2, C const& conv, argument_type const& p) const {
- typename Get_functor<K1, Construct_ttag<Point_cartesian_const_iterator_tag> >::type i(k1);
- typename Get_functor<K2, Construct_ttag<Point_tag> >::type cp(k2);
- return cp(conv(i(p,Begin_tag())),conv(i(p,End_tag())));
- }
-};
-#ifdef CGAL_CXX11
-// This doesn't seem so useful, the compiler should be able to handle
-// the iterators just as efficiently.
-template <int d, class K1, class K2>
-struct Point_converter_help<Dimension_tag<d>,K1,K2> {
- typedef typename Get_type<K1, Point_tag>::type argument_type;
- typedef typename Get_type<K2, Point_tag>::type result_type;
- template <class C,int...I>
- result_type help(Indices<I...>, K1 const& k1, K2 const& k2, C const& conv, argument_type const& p) const {
- typename Get_functor<K1, Compute_point_cartesian_coordinate_tag>::type cc(k1);
- typename Get_functor<K2, Construct_ttag<Point_tag> >::type cp(k2);
- return cp(conv(cc(p,I))...);
- }
- template <class C>
- result_type operator()(K1 const& k1, K2 const& k2, C const& conv, argument_type const& p) const {
- return help(typename N_increasing_indices<d>::type(),k1,k2,conv,p);
- }
-};
-#endif
-}
-template <class K1, class K2> struct KO_converter<Point_tag,K1,K2>
-: internal::Point_converter_help<typename K1::Default_ambient_dimension,K1,K2>
-{};
-
-template <class K1, class K2> struct KO_converter<Vector_tag,K1,K2>{
- typedef typename Get_type<K1, Vector_tag>::type K1_Vector;
-
- // Disabling is now done in KernelD_converter
- // // can't use vector without at least a placeholder point because of this
- // typedef typename K1:: Point K1_Point;
- // typedef typename First_if_different<K1_Vector,K1_Point>::Type argument_type;
-
- typedef K1_Vector argument_type;
- typedef typename Get_type<K2, Vector_tag>::type result_type;
- template <class C>
- result_type operator()(K1 const& k1, K2 const& k2, C const& conv, argument_type const& v) const {
- typename Get_functor<K1, Construct_ttag<Vector_cartesian_const_iterator_tag> >::type i(k1);
- typename Get_functor<K2, Construct_ttag<Vector_tag> >::type cp(k2);
- return cp(conv(i(v,Begin_tag())),conv(i(v,End_tag())));
- }
-};
-
-template <class K1, class K2> struct KO_converter<Segment_tag,K1,K2>{
- typedef typename Get_type<K1, Segment_tag>::type argument_type;
- typedef typename Get_type<K2, Segment_tag>::type result_type;
- template <class C>
- result_type operator()(K1 const& k1, K2 const& k2, C const& conv, argument_type const& s) const {
- typename Get_functor<K1, Segment_extremity_tag>::type f(k1);
- typename Get_functor<K2, Construct_ttag<Segment_tag> >::type cs(k2);
- return cs(conv(f(s,0)),conv(f(s,1)));
- }
-};
-
-template <class K1, class K2> struct KO_converter<Hyperplane_tag,K1,K2>{
- typedef typename Get_type<K1, Hyperplane_tag>::type argument_type;
- typedef typename Get_type<K2, Hyperplane_tag>::type result_type;
- template <class C>
- result_type operator()(K1 const& k1, K2 const& k2, C const& conv, argument_type const& h) const {
- typename Get_functor<K1, Orthogonal_vector_tag>::type ov(k1);
- typename Get_functor<K1, Hyperplane_translation_tag>::type ht(k1);
- typename Get_functor<K2, Construct_ttag<Hyperplane_tag> >::type ch(k2);
- return ch(conv(ov(h)),conv(ht(h)));
- }
-};
-
-template <class K1, class K2> struct KO_converter<Sphere_tag,K1,K2>{
- typedef typename Get_type<K1, Sphere_tag>::type argument_type;
- typedef typename Get_type<K2, Sphere_tag>::type result_type;
- template <class C>
- result_type operator()(K1 const& k1, K2 const& k2, C const& conv, argument_type const& s) const {
- typename Get_functor<K1, Center_of_sphere_tag>::type cos(k1);
- typename Get_functor<K1, Squared_radius_tag>::type sr(k1);
- typename Get_functor<K2, Construct_ttag<Sphere_tag> >::type cs(k2);
- return cs(conv(cos(s)),conv(sr(s)));
- }
-};
-
-template <class K1, class K2> struct KO_converter<Weighted_point_tag,K1,K2>{
- typedef typename Get_type<K1, Weighted_point_tag>::type argument_type;
- typedef typename Get_type<K2, Weighted_point_tag>::type result_type;
- template <class C>
- result_type operator()(K1 const& k1, K2 const& k2, C const& conv, argument_type const& s) const {
- typename Get_functor<K1, Point_drop_weight_tag>::type pdw(k1);
- typename Get_functor<K1, Point_weight_tag>::type pw(k1);
- typename Get_functor<K2, Construct_ttag<Weighted_point_tag> >::type cwp(k2);
- return cwp(conv(pdw(s)),conv(pw(s)));
- }
-};
-
-}
-#endif
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/LA_eigen/LA.h b/include/gudhi_patches/CGAL/NewKernel_d/LA_eigen/LA.h
deleted file mode 100644
index ddbdc37b..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/LA_eigen/LA.h
+++ /dev/null
@@ -1,175 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_LA_EIGEN_H
-#define CGAL_LA_EIGEN_H
-#include <CGAL/config.h>
-#ifndef CGAL_EIGEN3_ENABLED
-#error Requires Eigen
-#endif
-#include <boost/type_traits/is_arithmetic.hpp>
-#include <boost/utility/enable_if.hpp>
-#include <CGAL/Dimension.h>
-#include <Eigen/Dense>
-#include <CGAL/NewKernel_d/LA_eigen/constructors.h>
-#include <CGAL/iterator_from_indices.h>
-
-namespace CGAL {
-
-//FIXME: where could we use Matrix_base instead of Matrix?
-// Dim_ real dimension
-// Max_dim_ upper bound on the dimension
-template<class NT_,class Dim_,class Max_dim_=Dim_> struct LA_eigen {
- typedef NT_ NT;
- typedef Dim_ Dimension;
- typedef Max_dim_ Max_dimension;
- enum { dimension = Eigen_dimension<Dimension>::value };
- enum { max_dimension = Eigen_dimension<Max_dimension>::value };
- template< class D2, class D3=D2 >
- struct Rebind_dimension {
- typedef LA_eigen< NT, D2, D3 > Other;
- };
- template<class,class=void> struct Property : boost::false_type {};
- template<class D> struct Property<Has_vector_plus_minus_tag,D> : boost::true_type {};
- template<class D> struct Property<Has_vector_scalar_ops_tag,D> : boost::true_type {};
- template<class D> struct Property<Has_dot_product_tag,D> : boost::true_type {};
-
- typedef Eigen::Matrix<NT,Eigen_dimension<Dim_>::value,1,Eigen::ColMajor|Eigen::AutoAlign,Eigen_dimension<Max_dim_>::value,1> Vector;
- typedef Eigen::Matrix<NT,Eigen::Dynamic,1> Dynamic_vector;
- typedef Construct_eigen<Vector> Construct_vector;
-
-#if (EIGEN_WORLD_VERSION>=3)
- typedef NT const* Vector_const_iterator;
-#else
- typedef Iterator_from_indices<const type,const NT
-#ifndef CGAL_CXX11
- ,NT
-#endif
- > Vector_const_iterator;
-#endif
-
- template<class Vec_>static Vector_const_iterator vector_begin(Vec_ const&a){
-#if (EIGEN_WORLD_VERSION>=3)
- return &a[0];
-#else
- return Vector_const_iterator(a,0);
-#endif
- }
-
- template<class Vec_>static Vector_const_iterator vector_end(Vec_ const&a){
-#if (EIGEN_WORLD_VERSION>=3)
- // FIXME: Isn't that dangerous if a is an expression and not a concrete vector?
- return &a[0]+a.size();
-#else
- return Vector_const_iterator(a,a.size());
-#endif
- }
-
- typedef Eigen::Matrix<NT,dimension,dimension,Eigen::ColMajor|Eigen::AutoAlign,max_dimension,max_dimension> Square_matrix;
- typedef Eigen::Matrix<NT,dimension,Eigen::Dynamic,Eigen::ColMajor|Eigen::AutoAlign,max_dimension,Eigen::Dynamic> Dynamic_matrix;
- //TODO: don't pass on the values of Max_* for an expensive NT
- // typedef ... Constructor
- // typedef ... Accessor
-#if 0
- private:
- template <class T> class Canonicalize_vector {
- typedef typename Dimension_eigen<T::SizeAtCompileTime>::type S1;
- typedef typename Dimension_eigen<T::MaxSizeAtCompileTime>::type S2;
- public:
- typedef typename Vector<S1,S2>::type type;
- };
- public:
-#endif
-
- template<class Vec_>static int size_of_vector(Vec_ const&v){
- return (int)v.size();
- }
-
- template<class Vec_>static NT dot_product(Vec_ const&a,Vec_ const&b){
- return a.dot(b);
- }
-
- template<class Vec_> static int rows(Vec_ const&v) {
- return (int)v.rows();
- }
- template<class Vec_> static int columns(Vec_ const&v) {
- return (int)v.cols();
- }
-
- template<class Mat_> static NT determinant(Mat_ const&m,bool=false){
- return m.determinant();
- }
-
- template<class Mat_> static typename
- Same_uncertainty_nt<CGAL::Sign, NT>::type
- sign_of_determinant(Mat_ const&m,bool=false)
- {
- return CGAL::sign(m.determinant());
- }
-
- template<class Mat_> static int rank(Mat_ const&m){
- // return m.rank();
- // This one uses sqrt so cannot be used with Gmpq
- // TODO: use different algo for different NT?
- // Eigen::ColPivHouseholderQR<Mat_> decomp(m);
- Eigen::FullPivLU<Mat_> decomp(m);
- // decomp.setThreshold(0);
- return static_cast<int>(decomp.rank());
- }
-
- // m*a==b
- template<class DV, class DM, class V>
- static void solve(DV&a, DM const&m, V const& b){
- //a = m.colPivHouseholderQr().solve(b);
- a = m.fullPivLu().solve(b);
- }
- template<class DV, class DM, class V>
- static bool solve_and_check(DV&a, DM const&m, V const& b){
- //a = m.colPivHouseholderQr().solve(b);
- a = m.fullPivLu().solve(b);
- return b.isApprox(m*a);
- }
-
- static Dynamic_matrix basis(Dynamic_matrix const&m){
- return m.fullPivLu().image(m);
- }
-
- template<class Vec1,class Vec2> static Vector homogeneous_add(Vec1 const&a,Vec2 const&b){
- //TODO: use compile-time size when available
- int d=a.size();
- Vector v(d);
- v << b[d-1]*a.topRows(d-1)+a[d-1]*b.topRows(d-1), a[d-1]*b[d-1];
- return v;
- }
-
- template<class Vec1,class Vec2> static Vector homogeneous_sub(Vec1 const&a,Vec2 const&b){
- int d=a.size();
- Vector v(d);
- v << b[d-1]*a.topRows(d-1)-a[d-1]*b.topRows(d-1), a[d-1]*b[d-1];
- return v;
- }
-
- template<class Vec1,class Vec2> static std::pair<NT,NT> homogeneous_dot_product(Vec1 const&a,Vec2 const&b){
- int d=a.size();
- return make_pair(a.topRows(d-1).dot(b.topRows(d-1)), a[d-1]*b[d-1]);
- }
-
-};
-}
-#endif
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/LA_eigen/constructors.h b/include/gudhi_patches/CGAL/NewKernel_d/LA_eigen/constructors.h
deleted file mode 100644
index 3636996f..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/LA_eigen/constructors.h
+++ /dev/null
@@ -1,162 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_LA_EIGEN_CONSTRUCTORS_H
-#define CGAL_LA_EIGEN_CONSTRUCTORS_H
-#include <CGAL/config.h>
-
-#if defined(BOOST_MSVC)
-# pragma warning(push)
-# pragma warning(disable:4003) // not enough actual parameters for macro 'BOOST_PP_EXPAND_I'
- // http://lists.boost.org/boost-users/2014/11/83291.php
-#endif
-
-#ifndef CGAL_EIGEN3_ENABLED
-#error Requires Eigen
-#endif
-#include <boost/type_traits/is_arithmetic.hpp>
-#include <boost/utility/enable_if.hpp>
-#include <CGAL/Dimension.h>
-#include <Eigen/Dense>
-#include <CGAL/iterator_from_indices.h>
-#include <CGAL/NewKernel_d/utils.h>
-#include <boost/preprocessor/repetition.hpp>
-#include <boost/preprocessor/repetition/enum.hpp>
-#include <boost/preprocessor/repetition/enum_params.hpp>
-
-namespace CGAL {
- template <class Vector_> struct Construct_eigen {
- typedef Vector_ result_type;
- typedef typename Vector_::Scalar NT;
-
- private:
- static void check_dim(int CGAL_assertion_code(d)){
- CGAL_assertion_code(int m = result_type::MaxSizeAtCompileTime;)
- CGAL_assertion((m == Eigen::Dynamic) || (d <= m));
- }
- public:
-
- struct Dimension {
- // Initialize with NaN if possible?
- result_type operator()(int d) const {
- check_dim(d);
- return result_type(d);
- }
- };
-
- struct Iterator {
- template<typename Iter>
- result_type operator()(int d,Iter const& f,Iter const& e) const {
- check_dim(d);
- CGAL_assertion(d==std::distance(f,e));
- result_type a(d);
- // TODO: check the right way to do this
- std::copy(f,e,&a[0]);
- return a;
- }
- };
-
-#if 0
- struct Iterator_add_one {
- template<typename Iter>
- result_type operator()(int d,Iter const& f,Iter const& e) const {
- check_dim(d);
- CGAL_assertion(d==std::distance(f,e)+1);
- result_type a(d);
- std::copy(f,e,&a[0]);
- a[d-1]=1;
- return a;
- }
- };
-#endif
-
- struct Iterator_and_last {
- template<typename Iter,typename T>
- result_type operator()(int d,Iter const& f,Iter const& e,CGAL_FORWARDABLE(T) t) const {
- check_dim(d);
- CGAL_assertion(d==std::distance(f,e)+1);
- result_type a(d);
- std::copy(f,e,&a[0]);
- a[d-1]=CGAL_FORWARD(T,t);
- return a;
- }
- };
-
-#ifdef CGAL_CXX11
- struct Initializer_list {
- // Fix T==NT?
- template<class T>
- result_type operator()(std::initializer_list<T> l) const {
- return Iterator()(l.size(),l.begin(),l.end());
- }
- };
-#endif
-
- struct Values {
-#ifdef CGAL_CXX11
- // TODO avoid going through Initializer_list which may cause extra copies. Possibly use forward_as_tuple.
- template<class...U>
- result_type operator()(U&&...u) const {
- check_dim(sizeof...(U)); // TODO: use static_assert
- return Initializer_list()({forward_safe<NT,U>(u)...});
- }
-#else
-
-#define CGAL_CODE(Z,N,_) result_type operator()(BOOST_PP_ENUM_PARAMS(N,NT const& t)) const { \
- check_dim(N); \
- result_type a(N); \
- a << BOOST_PP_ENUM_PARAMS(N,t); \
- return a; \
-}
-BOOST_PP_REPEAT_FROM_TO(1, 11, CGAL_CODE, _ )
-#undef CGAL_CODE
-
-#endif
- };
-
- struct Values_divide {
-#ifdef CGAL_CXX11
- template<class H,class...U>
- result_type operator()(H const&h,U&&...u) const {
- check_dim(sizeof...(U)); // TODO: use static_assert
- return Initializer_list()({Rational_traits<NT>().make_rational(std::forward<U>(u),h)...});
- }
-#else
-
-#define CGAL_VAR(Z,N,_) ( Rational_traits<NT>().make_rational( t##N ,h) )
-#define CGAL_CODE(Z,N,_) template <class H> result_type \
- operator()(H const&h, BOOST_PP_ENUM_PARAMS(N,NT const& t)) const { \
- check_dim(N); \
- result_type a(N); \
- a << BOOST_PP_ENUM(N,CGAL_VAR,); \
- return a; \
- }
- BOOST_PP_REPEAT_FROM_TO(1, 11, CGAL_CODE, _ )
-#undef CGAL_CODE
-#undef CGAL_VAR
-
-#endif
- };
- };
-}
-#if defined(BOOST_MSVC)
-# pragma warning(pop)
-#endif
-
-#endif
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/Lazy_cartesian.h b/include/gudhi_patches/CGAL/NewKernel_d/Lazy_cartesian.h
deleted file mode 100644
index 9ecc2b63..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/Lazy_cartesian.h
+++ /dev/null
@@ -1,188 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_KERNEL_D_LAZY_CARTESIAN_H
-#define CGAL_KERNEL_D_LAZY_CARTESIAN_H
-
-#include <CGAL/basic.h>
-#include <CGAL/algorithm.h>
-#include <CGAL/Lazy.h>
-#include <CGAL/Default.h>
-#include <CGAL/NewKernel_d/Filtered_predicate2.h>
-#include <CGAL/iterator_from_indices.h>
-#include <CGAL/NewKernel_d/Define_kernel_types.h>
-
-namespace CGAL {
-
-template<class K,class T>
-struct Nth_iterator_element : private Store_kernel<K> {
- Nth_iterator_element(){}
- Nth_iterator_element(K const&k):Store_kernel<K>(k){}
- typedef typename Get_type<K, typename iterator_tag_traits<T>::value_tag>::type result_type;
- template<class U> result_type operator()(CGAL_FORWARDABLE(U) u, int i) const {
- typename Get_functor<K, Construct_ttag<T> >::type ci(this->kernel());
- return *cpp0x::next(ci(CGAL_FORWARD(U,u),Begin_tag()),i);
- }
-};
- //typedef typename Functor<typename iterator_tag_traits<T>::nth_element>::type nth_elem;
-template<class K, class T, bool = iterator_tag_traits<T>::has_nth_element>
-struct Select_nth_element_functor {
- typedef Nth_iterator_element<K, T> type;
-};
-template<class K, class T>
-struct Select_nth_element_functor <K, T, true> :
- Get_functor<K, typename iterator_tag_traits<T>::nth_element> {};
-
-namespace internal {
- template<class A,class B,class C,bool/*is_NT=false*/>
- struct Lazy_construction_maybe_nt {
- typedef Lazy_construction<A,B,C> type;
- };
- template<class A,class B,class C>
- struct Lazy_construction_maybe_nt<A,B,C,true> {
- typedef Lazy_construction_nt<A,B,C> type;
- };
-}
-
-template <class EK_, class AK_, class E2A_, class Kernel_>
-struct Lazy_cartesian_types
-{
- typedef typename typeset_intersection<
- typename AK_::Object_list,
- typename EK_::Object_list
- >::type Object_list;
-
- typedef typename typeset_intersection<
- typename AK_::Iterator_list,
- typename EK_::Iterator_list
- >::type Iterator_list;
-
- template <class T,class=typename Get_type_category<Kernel_,T>::type> struct Type {};
- template <class T> struct Type<T,Object_tag> {
- typedef Lazy<
- typename Get_type<AK_,T>::type,
- typename Get_type<EK_,T>::type,
- typename Get_type<EK_, FT_tag>::type,
- E2A_> type;
- };
- template <class T> struct Type<T,Number_tag> {
- typedef CGAL::Lazy_exact_nt<typename Get_type<EK_,T>::type> type;
- };
-
- template <class T> struct Iterator {
- typedef typename iterator_tag_traits<T>::value_tag Vt;
- typedef typename Type<Vt>::type V;
- typedef typename Select_nth_element_functor<AK_,T>::type AF;
- typedef typename Select_nth_element_functor<EK_,T>::type EF;
-
- typedef typename internal::Lazy_construction_maybe_nt<
- Kernel_, AF, EF, is_NT_tag<Vt>::value
- >::type nth_elem;
-
- typedef Iterator_from_indices<
- const typename Type<typename iterator_tag_traits<T>::container>::type,
- const V, V, nth_elem
- > type;
- };
-};
-
-template <class EK_, class AK_, class E2A_/*, class Kernel_=Default*/>
-struct Lazy_cartesian : Dimension_base<typename EK_::Default_ambient_dimension>,
- Lazy_cartesian_types<EK_,AK_,E2A_,Lazy_cartesian<EK_,AK_,E2A_> >
-{
- //CGAL_CONSTEXPR Lazy_cartesian(){}
- //CGAL_CONSTEXPR Lazy_cartesian(int d):Base_(d){}
-
- //TODO: Do we want to store an AK and an EK? Or just references?
- //FIXME: references would be better I guess.
- //TODO: In any case, make sure that we don't end up storing this kernel for
- //nothing (it is not empty but references empty kernels or something)
- AK_ ak; EK_ ek;
- AK_ const& approximate_kernel()const{return ak;}
- EK_ const& exact_kernel()const{return ek;}
-
- typedef Lazy_cartesian Self;
- typedef Lazy_cartesian_types<EK_,AK_,E2A_,Self> Base;
- //typedef typename Default::Get<Kernel_,Self>::type Kernel;
- typedef Self Kernel;
- typedef AK_ Approximate_kernel;
- typedef EK_ Exact_kernel;
- typedef E2A_ E2A;
- typedef Approx_converter<Kernel, Approximate_kernel> C2A;
- typedef Exact_converter<Kernel, Exact_kernel> C2E;
-
- typedef typename Exact_kernel::Rep_tag Rep_tag;
- typedef typename Exact_kernel::Kernel_tag Kernel_tag;
- typedef typename Exact_kernel::Default_ambient_dimension Default_ambient_dimension;
- typedef typename Exact_kernel::Max_ambient_dimension Max_ambient_dimension;
- //typedef typename Exact_kernel::Flat_orientation Flat_orientation;
- // Check that Approximate_kernel agrees with all that...
-
- template<class T,class D=void,class=typename Get_functor_category<Lazy_cartesian,T,D>::type> struct Functor {
- typedef Null_functor type;
- };
- //FIXME: what do we do with D here?
- template<class T,class D> struct Functor<T,D,Predicate_tag> {
- typedef typename Get_functor<Approximate_kernel, T>::type FA;
- typedef typename Get_functor<Exact_kernel, T>::type FE;
- typedef Filtered_predicate2<FE,FA,C2E,C2A> type;
- };
- template<class T,class D> struct Functor<T,D,Compute_tag> {
- typedef typename Get_functor<Approximate_kernel, T>::type FA;
- typedef typename Get_functor<Exact_kernel, T>::type FE;
- typedef Lazy_construction_nt<Kernel,FA,FE> type;
- };
- template<class T,class D> struct Functor<T,D,Construct_tag> {
- typedef typename Get_functor<Approximate_kernel, T>::type FA;
- typedef typename Get_functor<Exact_kernel, T>::type FE;
- typedef Lazy_construction<Kernel,FA,FE> type;
- };
-
- //typedef typename Iterator<Point_cartesian_const_iterator_tag>::type Point_cartesian_const_iterator;
- //typedef typename Iterator<Vector_cartesian_const_iterator_tag>::type Vector_cartesian_const_iterator;
-
- template<class U>
- struct Construct_iter : private Store_kernel<Kernel> {
- Construct_iter(){}
- Construct_iter(Kernel const&k):Store_kernel<Kernel>(k){}
- //FIXME: pass the kernel to the functor in the iterator
- typedef U result_type;
- template<class T>
- result_type operator()(T const& t,Begin_tag)const{
- return result_type(t,0,this->kernel());
- }
- template<class T>
- result_type operator()(T const& t,End_tag)const{
- return result_type(t,Self().dimension(),this->kernel());
- }
- };
- template<class T,class D> struct Functor<T,D,Construct_iterator_tag> {
- typedef Construct_iter<typename Base::template Iterator<typename map_result_tag<T>::type>::type> type;
- };
-
-
- //TODO: what about other functors of the Misc category?
- // for Point_dimension, we should apply it to the approximate point
- // for printing, we should??? just not do printing this way?
-};
-
-
-} //namespace CGAL
-
-#endif // CGAL_KERNEL_D_LAZY_CARTESIAN_H
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/Types/Aff_transformation.h b/include/gudhi_patches/CGAL/NewKernel_d/Types/Aff_transformation.h
deleted file mode 100644
index 6d9f070f..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/Types/Aff_transformation.h
+++ /dev/null
@@ -1,59 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_KD_TYPE_AFF_TRANSFORMATION_H
-#define CGAL_KD_TYPE_AFF_TRANSFORMATION_H
-#include <CGAL/config.h>
-#include <CGAL/NewKernel_d/store_kernel.h>
-#include <boost/preprocessor/repetition.hpp>
-
-// Dummy, that's all the Kernel_d concept requires, so a useful class will wait.
-
-namespace CGAL {
-template<class R_>
-struct Aff_transformation {
- typedef R_ R;
-};
-namespace CartesianDKernelFunctors {
-template<class R_> struct Construct_aff_transformation {
- CGAL_FUNCTOR_INIT_IGNORE(Construct_aff_transformation)
- typedef R_ R;
- typedef typename Get_type<R, Aff_transformation_tag>::type result_type;
-#ifdef CGAL_CXX11
- template<class...T>
- result_type operator()(T&&...)const{return result_type();}
-#else
- result_type operator()()const{
- return result_type();
- }
-#define CGAL_CODE(Z,N,_) template<BOOST_PP_ENUM_PARAMS(N,class U)> \
- result_type operator()(BOOST_PP_ENUM_BINARY_PARAMS(N,U,const& BOOST_PP_INTERCEPT))const{ \
- return result_type(); \
- }
- BOOST_PP_REPEAT_FROM_TO(1, 9, CGAL_CODE, _ )
-#undef CGAL_CODE
-
-#endif
-};
-}
-CGAL_KD_DEFAULT_TYPE(Aff_transformation_tag,(CGAL::Aff_transformation<K>),(),());
-CGAL_KD_DEFAULT_FUNCTOR(Construct_ttag<Aff_transformation_tag>,(CartesianDKernelFunctors::Construct_aff_transformation<K>),(Aff_transformation_tag),());
-
-}
-#endif
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/Types/Hyperplane.h b/include/gudhi_patches/CGAL/NewKernel_d/Types/Hyperplane.h
deleted file mode 100644
index 14e35b01..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/Types/Hyperplane.h
+++ /dev/null
@@ -1,159 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_KD_TYPE_HYPERPLANE_H
-#define CGAL_KD_TYPE_HYPERPLANE_H
-#include <CGAL/enum.h>
-#include <CGAL/number_utils.h>
-#include <CGAL/NewKernel_d/store_kernel.h>
-#include <boost/iterator/transform_iterator.hpp>
-#include <boost/iterator/counting_iterator.hpp>
-namespace CGAL {
-template <class R_> class Hyperplane {
- typedef typename Get_type<R_, FT_tag>::type FT_;
- typedef typename Get_type<R_, Vector_tag>::type Vector_;
- Vector_ v_;
- FT_ s_;
-
- public:
- Hyperplane(Vector_ const&v, FT_ const&s): v_(v), s_(s) {}
- // TODO: Add a piecewise constructor?
-
- Vector_ const& orthogonal_vector()const{return v_;}
- FT_ translation()const{return s_;}
-};
-namespace CartesianDKernelFunctors {
-template <class R_> struct Construct_hyperplane : Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Construct_hyperplane)
- typedef typename Get_type<R_, Hyperplane_tag>::type result_type;
- typedef typename Get_type<R_, Point_tag>::type Point;
- typedef typename Get_type<R_, Vector_tag>::type Vector;
- typedef typename Get_type<R_, FT_tag>::type FT;
- private:
- struct One {
- typedef int result_type;
- template<class T>int const& operator()(T const&)const{
- static const int one = 1;
- return one;
- }
- };
- public:
-
- result_type operator()(Vector const&a, FT const&b)const{
- return result_type(a,b);
- }
- // Not really needed
- result_type operator()()const{
- typename Get_functor<R_, Construct_ttag<Vector_tag> >::type cv(this->kernel());
- return result_type(cv(),0);
- }
-
- template <class Iter>
- result_type through(Iter f, Iter e)const{
- typedef typename R_::LA LA;
- typedef typename R_::Default_ambient_dimension D1;
- typedef typename R_::Max_ambient_dimension D2;
- typedef typename Increment_dimension<D1>::type D1i;
- typedef typename Increment_dimension<D2>::type D2i;
-
- typedef Eigen::Matrix<FT, Eigen_dimension<D1>::value, Eigen_dimension<D1i>::value,
- Eigen::ColMajor|Eigen::AutoAlign, Eigen_dimension<D2>::value, Eigen_dimension<D2i>::value> Matrix;
- typedef Eigen::Matrix<FT, Eigen_dimension<D1i>::value, 1,
- Eigen::ColMajor|Eigen::AutoAlign, Eigen_dimension<D2i>::value, 1> Vec;
- typename Get_functor<R_, Compute_point_cartesian_coordinate_tag>::type c(this->kernel());
- typename Get_functor<R_, Construct_ttag<Vector_tag> >::type cv(this->kernel());
- typename Get_functor<R_, Point_dimension_tag>::type pd(this->kernel());
-
- Point const& p0=*f;
- int d = pd(p0);
- Matrix m(d,d+1);
- for(int j=0;j<d;++j)
- m(0,j)=c(p0,j);
- // Write the point coordinates in lines.
- int i;
- for (i=1; ++f!=e; ++i) {
- Point const& p=*f;
- for(int j=0;j<d;++j)
- m(i,j)=c(p,j);
- }
- CGAL_assertion (i == d);
- for(i=0;i<d;++i)
- m(i,d)=-1;
- Eigen::FullPivLU<Matrix> lu(m);
- Vec res = lu.kernel().col(0);
- return this->operator()(cv(d,LA::vector_begin(res),LA::vector_end(res)-1),res(d));
- }
- template <class Iter>
- result_type operator()(Iter f, Iter e, Point const&p, CGAL::Oriented_side s=ON_ORIENTED_BOUNDARY)const{
- result_type ret = through(f, e);
- // I don't really like using ON_ORIENTED_BOUNDARY to mean that we don't care, we might as well not pass 'p' at all.
- if (s == ON_ORIENTED_BOUNDARY)
- return ret;
- typename Get_functor<R_, Oriented_side_tag>::type os(this->kernel());
- CGAL::Oriented_side o = os(ret, p);
- if (o == ON_ORIENTED_BOUNDARY || o == s)
- return ret;
- typename Get_functor<R_, Opposite_vector_tag>::type ov(this->kernel());
- typename Get_functor<R_, Construct_ttag<Vector_tag> >::type cv(this->kernel());
- return this->operator()(ov(ret.orthogonal_vector()), -ret.translation());
- }
-};
-template <class R_> struct Orthogonal_vector {
- CGAL_FUNCTOR_INIT_IGNORE(Orthogonal_vector)
- typedef typename Get_type<R_, Hyperplane_tag>::type Hyperplane;
- typedef typename Get_type<R_, Vector_tag>::type const& result_type;
- result_type operator()(Hyperplane const&s)const{
- return s.orthogonal_vector();
- }
-};
-template <class R_> struct Hyperplane_translation {
- CGAL_FUNCTOR_INIT_IGNORE(Hyperplane_translation)
- typedef typename Get_type<R_, Hyperplane_tag>::type Hyperplane;
- typedef typename Get_type<R_, FT_tag>::type result_type;
- // TODO: Is_exact?
- result_type operator()(Hyperplane const&s)const{
- return s.translation();
- }
-};
-template <class R_> struct Value_at : Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Value_at)
- typedef typename Get_type<R_, Hyperplane_tag>::type Hyperplane;
- typedef typename Get_type<R_, Vector_tag>::type Vector;
- typedef typename Get_type<R_, Point_tag>::type Point;
- typedef typename Get_type<R_, FT_tag>::type FT;
- typedef FT result_type;
- typedef typename Get_functor<R_, Scalar_product_tag>::type Dot;
- typedef typename Get_functor<R_, Point_to_vector_tag>::type P2V;
- result_type operator()(Hyperplane const&h, Point const&p)const{
- Dot dot(this->kernel());
- P2V p2v(this->kernel());
- return dot(h.orthogonal_vector(),p2v(p));
- // Use Orthogonal_vector to make it generic?
- // Copy the code from Scalar_product to avoid p2v?
- }
-};
-}
-//TODO: Add a condition that the hyperplane type is the one from this file.
-CGAL_KD_DEFAULT_TYPE(Hyperplane_tag,(CGAL::Hyperplane<K>),(Vector_tag),());
-CGAL_KD_DEFAULT_FUNCTOR(Construct_ttag<Hyperplane_tag>,(CartesianDKernelFunctors::Construct_hyperplane<K>),(Vector_tag,Hyperplane_tag),(Opposite_vector_tag,Oriented_side_tag));
-CGAL_KD_DEFAULT_FUNCTOR(Orthogonal_vector_tag,(CartesianDKernelFunctors::Orthogonal_vector<K>),(Vector_tag,Hyperplane_tag),());
-CGAL_KD_DEFAULT_FUNCTOR(Hyperplane_translation_tag,(CartesianDKernelFunctors::Hyperplane_translation<K>),(Hyperplane_tag),());
-CGAL_KD_DEFAULT_FUNCTOR(Value_at_tag,(CartesianDKernelFunctors::Value_at<K>),(Point_tag,Vector_tag,Hyperplane_tag),(Scalar_product_tag,Point_to_vector_tag));
-} // namespace CGAL
-#endif
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/Types/Iso_box.h b/include/gudhi_patches/CGAL/NewKernel_d/Types/Iso_box.h
deleted file mode 100644
index d053f351..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/Types/Iso_box.h
+++ /dev/null
@@ -1,88 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_KERNELD_TYPES_ISO_BOX_H
-#define CGAL_KERNELD_TYPES_ISO_BOX_H
-#include <utility>
-#include <CGAL/basic.h>
-#include <CGAL/NewKernel_d/functor_tags.h>
-#include <CGAL/Kernel/mpl.h>
-#include <CGAL/transforming_pair_iterator.h>
-namespace CGAL {
-template <class R_> class Iso_box {
- typedef typename Get_type<R_, FT_tag>::type FT_;
- typedef typename Get_type<R_, Point_tag>::type Point_;
- typedef std::pair<Point_,Point_> Data_;
- Data_ data;
- public:
- Iso_box(){}
- Iso_box(Point_ const&a, Point_ const&b): data(a,b) {}
- Point_ min BOOST_PREVENT_MACRO_SUBSTITUTION ()const{
- return data.first;
- }
- Point_ max BOOST_PREVENT_MACRO_SUBSTITUTION ()const{
- return data.second;
- }
-};
-namespace CartesianDKernelFunctors {
- template <class R_> struct Construct_iso_box : Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Construct_iso_box)
- typedef typename Get_type<R_, Iso_box_tag>::type result_type;
- typedef typename Get_type<R_, RT_tag>::type RT;
- typedef typename Get_type<R_, Point_tag>::type Point;
- typedef typename Get_functor<R_, Construct_ttag<Point_tag> >::type Cp_;
- typedef typename Get_functor<R_, Construct_ttag<Point_cartesian_const_iterator_tag> >::type Ci_;
- result_type operator()(Point const&a, Point const&b)const{
- Cp_ cp(this->kernel());
- Ci_ ci(this->kernel());
- return result_type(cp(
- make_transforming_pair_iterator(ci(a,Begin_tag()), ci(b,Begin_tag()), Min<RT>()),
- make_transforming_pair_iterator(ci(a,End_tag()), ci(b,End_tag()), Min<RT>())),
- cp(
- make_transforming_pair_iterator(ci(a,Begin_tag()), ci(b,Begin_tag()), Max<RT>()),
- make_transforming_pair_iterator(ci(a,End_tag()), ci(b,End_tag()), Max<RT>())));
- }
- };
-
- template <class R_> struct Construct_min_vertex {
- CGAL_FUNCTOR_INIT_IGNORE(Construct_min_vertex)
- typedef typename Get_type<R_, Iso_box_tag>::type argument_type;
- //TODO: make result_type a reference
- typedef typename Get_type<R_, Point_tag>::type result_type;
- result_type operator()(argument_type const&b)const{
- return b.min BOOST_PREVENT_MACRO_SUBSTITUTION ();
- }
- };
- template <class R_> struct Construct_max_vertex {
- CGAL_FUNCTOR_INIT_IGNORE(Construct_max_vertex)
- typedef typename Get_type<R_, Iso_box_tag>::type argument_type;
- typedef typename Get_type<R_, Point_tag>::type result_type;
- result_type operator()(argument_type const&b)const{
- return b.max BOOST_PREVENT_MACRO_SUBSTITUTION ();
- }
- };
-}
-//TODO (other types as well) only enable these functors if the Iso_box type is the one defined in this file...
-CGAL_KD_DEFAULT_TYPE(Iso_box_tag,(CGAL::Iso_box<K>),(Point_tag),());
-CGAL_KD_DEFAULT_FUNCTOR(Construct_ttag<Iso_box_tag>,(CartesianDKernelFunctors::Construct_iso_box<K>),(Iso_box_tag,Point_tag),(Construct_ttag<Point_cartesian_const_iterator_tag>,Construct_ttag<Point_tag>));
-CGAL_KD_DEFAULT_FUNCTOR(Construct_min_vertex_tag,(CartesianDKernelFunctors::Construct_min_vertex<K>),(Iso_box_tag),());
-CGAL_KD_DEFAULT_FUNCTOR(Construct_max_vertex_tag,(CartesianDKernelFunctors::Construct_max_vertex<K>),(Iso_box_tag),());
-} // namespace CGAL
-
-#endif // CGAL_KERNELD_TYPES_ISO_BOX_H
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/Types/Line.h b/include/gudhi_patches/CGAL/NewKernel_d/Types/Line.h
deleted file mode 100644
index 6a09571c..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/Types/Line.h
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_KERNELD_TYPES_LINE_H
-#define CGAL_KERNELD_TYPES_LINE_H
-#include <utility>
-#include <CGAL/NewKernel_d/functor_tags.h>
-#include <CGAL/Kernel/mpl.h>
-namespace CGAL {
-template <class R_> class Line {
- typedef typename Get_type<R_, FT_tag>::type FT_;
- typedef typename Get_type<R_, Point_tag>::type Point_;
- typedef std::pair<Point_,Point_> Data_;
- Data_ data;
- public:
- Line(){}
- Line(Point_ const&a, Point_ const&b): data(a,b) {}
- Point_ point(int i)const{
- if(i==0) return data.first;
- if(i==1) return data.second;
- throw "not implemented";
- }
- Line opposite()const{
- return Line(data.second,data.first);
- }
-};
-namespace CartesianDKernelFunctors {
- template <class R_> struct Construct_line : Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Construct_line)
- typedef typename Get_type<R_, Line_tag>::type result_type;
- typedef typename Get_type<R_, Point_tag>::type Point;
- typedef typename Get_type<R_, Vector_tag>::type Vector;
- typedef typename Get_functor<R_, Translated_point_tag>::type Tp_;
- //typedef typename Get_functor<R_, Difference_of_points_tag>::type Dp_;
- //typedef typename Get_functor<R_, Scaled_vector_tag>::type Sv_;
- result_type operator()(Point const&a, Point const&b)const{
- return result_type(a,b);
- }
- result_type operator()(Point const&a, typename First_if_different<Vector,Point>::Type const&b)const{
- Tp_ tp(this->kernel());
- return result_type(a,tp(a,b));
- }
- };
-}
-CGAL_KD_DEFAULT_TYPE(Line_tag,(CGAL::Line<K>),(Point_tag),());
-CGAL_KD_DEFAULT_FUNCTOR(Construct_ttag<Line_tag>,(CartesianDKernelFunctors::Construct_line<K>),(Line_tag,Point_tag,Vector_tag),(Translated_point_tag));
-
-} // namespace CGAL
-
-#endif // CGAL_KERNELD_TYPES_LINE_H
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/Types/Ray.h b/include/gudhi_patches/CGAL/NewKernel_d/Types/Ray.h
deleted file mode 100644
index be845e76..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/Types/Ray.h
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_KERNELD_TYPES_RAY_H
-#define CGAL_KERNELD_TYPES_RAY_H
-#include <utility>
-#include <CGAL/NewKernel_d/functor_tags.h>
-#include <CGAL/Kernel/mpl.h>
-namespace CGAL {
-template <class R_> class Ray {
- typedef typename Get_type<R_, FT_tag>::type FT_;
- typedef typename Get_type<R_, Point_tag>::type Point_;
- typedef typename Get_type<R_, Vector_tag>::type Vector_;
- typedef std::pair<Point_,Vector_> Data_;
- Data_ data;
- public:
- Ray(){}
- Ray(Point_ const&a, Vector_ const&b): data(a,b) {}
- Point_ source()const{
- return data.first;
- }
- // FIXME: return a R_::Direction?
- Vector_ direction()const{
- return data.second;
- }
-};
-namespace CartesianDKernelFunctors {
- template <class R_> struct Construct_ray : Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Construct_ray)
- typedef typename Get_type<R_, Ray_tag>::type result_type;
- typedef typename Get_type<R_, Point_tag>::type Point;
- typedef typename Get_type<R_, Vector_tag>::type Vector;
- typedef typename Get_functor<R_, Difference_of_points_tag>::type Dp_;
- //typedef typename Get_functor<R_, Translated_point_tag>::type Tp_;
- //typedef typename Get_functor<R_, Scaled_vector_tag>::type Sv_;
- result_type operator()(Point const&a, Vector const&b)const{
- return result_type(a,b);
- }
- result_type operator()(Point const&a, typename First_if_different<Point,Vector>::Type const&b)const{
- Dp_ dp(this->kernel());
- return result_type(a,dp(b,a));
- }
- };
-}
-CGAL_KD_DEFAULT_TYPE(Ray_tag,(CGAL::Ray<K>),(Point_tag,Vector_tag),());
-CGAL_KD_DEFAULT_FUNCTOR(Construct_ttag<Ray_tag>,(CartesianDKernelFunctors::Construct_ray<K>),(Point_tag,Ray_tag,Vector_tag),(Difference_of_points_tag));
-
-} // namespace CGAL
-
-#endif // CGAL_KERNELD_TYPES_RAY_H
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/Types/Segment.h b/include/gudhi_patches/CGAL/NewKernel_d/Types/Segment.h
deleted file mode 100644
index 38361c2b..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/Types/Segment.h
+++ /dev/null
@@ -1,121 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_KERNELD_SEGMENTD_H
-#define CGAL_KERNELD_SEGMENTD_H
-#include <CGAL/config.h>
-#include <utility>
-#include <CGAL/NewKernel_d/functor_tags.h>
-namespace CGAL {
-template <class R_> class Segment {
- typedef typename Get_type<R_, FT_tag>::type FT_;
- typedef typename Get_type<R_, Point_tag>::type Point_;
- //typedef typename R_::Vector Vector_;
- //typedef typename Get_functor<R_, Construct_ttag<Vector_tag> >::type Cv_;
-// typedef typename R_::Squared_distance Csd_;
- typedef std::pair<Point_,Point_> Data_;
- Data_ data;
- public:
- //typedef Segmentd<R_> Segment;
-#ifdef CGAL_CXX11
- //FIXME: don't forward directly, piecewise_constuct should call the point construction functor (I guess? or is it unnecessary?)
- template<class...U,class=typename std::enable_if<!std::is_same<std::tuple<typename std::decay<U>::type...>,std::tuple<Segment>>::value>::type>
- Segment(U&&...u):data(std::forward<U>(u)...){}
-#else
- Segment(){}
- Segment(Point_ const&a, Point_ const&b): data(a,b) {}
- //template<class A,class T1,class T2>
- //Segment(A const&,T1 const&t1,T2 const&t2)
-#endif
- Point_ source()const{return data.first;}
- Point_ target()const{return data.second;}
- Point_ operator[](int i)const{
- if((i%2)==0)
- return source();
- else
- return target();
- }
- Segment opposite()const{
- return Segment(target(),source());
- }
- //Vector_ vector()const{
- // return Cv_()(data.first,data.second);
- //}
-// FT_ squared_length()const{
-// return Csd_()(data.first,data.second);
-// }
-};
-
-namespace CartesianDKernelFunctors {
-
-template<class R_> struct Construct_segment : Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Construct_segment)
- typedef R_ R;
- typedef typename Get_type<R_, Point_tag>::type Point;
- typedef typename Get_type<R_, Segment_tag>::type Segment;
- typedef typename Get_functor<R_, Construct_ttag<Point_tag> >::type CP;
- typedef Segment result_type;
- result_type operator()(Point const&a, Point const&b)const{
- return result_type(a,b);
- }
- // Not really needed, especially since it forces us to store the kernel
- result_type operator()()const{
- Point p = typename Get_functor<R_, Construct_ttag<Point_tag> >::type (this->kernel()) ();
- return result_type (p, p);
- }
- // T should only be std::piecewise_construct_t, but we shouldn't fail if it doesn't exist.
- template<class T,class U,class V>
- result_type operator()(CGAL_FORWARDABLE(T),CGAL_FORWARDABLE(U) u,CGAL_FORWARDABLE(V) v)const{
- CP cp(this->kernel());
- result_type r = {{
- call_on_tuple_elements<Point>(cp, CGAL_FORWARD(U,u)),
- call_on_tuple_elements<Point>(cp, CGAL_FORWARD(V,v)) }};
- return r;
- }
-};
-
-// This should be part of Construct_point, according to Kernel_23 conventions
-template<class R_> struct Segment_extremity {
- CGAL_FUNCTOR_INIT_IGNORE(Segment_extremity)
- typedef R_ R;
- typedef typename Get_type<R_, Point_tag>::type Point;
- typedef typename Get_type<R_, Segment_tag>::type Segment;
- typedef Point result_type;
- result_type operator()(Segment const&s, int i)const{
- if(i==0) return s.source();
- CGAL_assertion(i==1);
- return s.target();
- }
-#ifdef CGAL_CXX11
- result_type operator()(Segment &&s, int i)const{
- if(i==0) return std::move(s.source());
- CGAL_assertion(i==1);
- return std::move(s.target());
- }
-#endif
-};
-} // CartesianDKernelFunctors
-
-CGAL_KD_DEFAULT_TYPE(Segment_tag,(CGAL::Segment<K>),(Point_tag),());
-CGAL_KD_DEFAULT_FUNCTOR(Construct_ttag<Segment_tag>,(CartesianDKernelFunctors::Construct_segment<K>),(Segment_tag,Point_tag),(Construct_ttag<Point_tag>));
-CGAL_KD_DEFAULT_FUNCTOR(Segment_extremity_tag,(CartesianDKernelFunctors::Segment_extremity<K>),(Segment_tag,Point_tag),());
-
-} // namespace CGAL
-
-#endif // CGAL_KERNELD_SEGMENTD_H
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/Types/Sphere.h b/include/gudhi_patches/CGAL/NewKernel_d/Types/Sphere.h
deleted file mode 100644
index 114410b4..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/Types/Sphere.h
+++ /dev/null
@@ -1,132 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_KD_TYPE_SPHERE_H
-#define CGAL_KD_TYPE_SPHERE_H
-#include <CGAL/NewKernel_d/store_kernel.h>
-#include <boost/iterator/counting_iterator.hpp>
-namespace CGAL {
-template <class R_> class Sphere {
- typedef typename Get_type<R_, FT_tag>::type FT_;
- typedef typename Get_type<R_, Point_tag>::type Point_;
- Point_ c_;
- FT_ r2_;
-
- public:
- Sphere(Point_ const&p, FT_ const&r2): c_(p), r2_(r2) {}
- // TODO: Add a piecewise constructor?
-
- Point_ const& center()const{return c_;}
- FT_ const& squared_radius()const{return r2_;}
-};
-
-namespace CartesianDKernelFunctors {
-template <class R_> struct Construct_sphere : Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Construct_sphere)
- typedef typename Get_type<R_, Sphere_tag>::type result_type;
- typedef typename Get_type<R_, Point_tag>::type Point;
- typedef typename Get_type<R_, FT_tag>::type FT;
- result_type operator()(Point const&a, FT const&b)const{
- return result_type(a,b);
- }
- // Not really needed
- result_type operator()()const{
- typename Get_functor<R_, Construct_ttag<Point_tag> >::type cp(this->kernel());
- return result_type(cp(),0);
- }
- template <class Iter>
- result_type operator()(Iter f, Iter e)const{
- typename Get_functor<R_, Construct_circumcenter_tag>::type cc(this->kernel());
- typename Get_functor<R_, Squared_distance_tag>::type sd(this->kernel());
-
- // It should be possible to avoid copying the center by moving this code to a constructor.
- Point center = cc(f, e);
- FT const& r2 = sd(center, *f);
- return this->operator()(CGAL_MOVE(center), r2);
- }
-};
-
-template <class R_> struct Center_of_sphere : private Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Center_of_sphere)
- typedef typename Get_type<R_, Sphere_tag>::type Sphere;
- // No reference because of the second overload
- typedef typename Get_type<R_, Point_tag>::type result_type;
-
- result_type const& operator()(Sphere const&s)const{
- return s.center();
- }
-
- template<class Iter>
- result_type operator()(Iter b, Iter e)const{
- typename Get_functor<R_, Construct_ttag<Sphere_tag> >::type cs(this->kernel());
- return operator()(cs(b,e)); // computes the radius needlessly
- }
-};
-
-template <class R_> struct Squared_radius {
- CGAL_FUNCTOR_INIT_IGNORE(Squared_radius)
- typedef typename Get_type<R_, Sphere_tag>::type Sphere;
- typedef typename Get_type<R_, FT_tag>::type const& result_type;
- // TODO: Is_exact?
- result_type operator()(Sphere const&s)const{
- return s.squared_radius();
- }
-};
-
-// FIXME: Move it to the generic functors, using the two above and conditional to the existence of sqrt(FT)
-template<class R_> struct Point_of_sphere : private Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Point_of_sphere)
- typedef R_ R;
- typedef typename Get_type<R, FT_tag>::type FT;
- typedef typename Get_type<R, RT_tag>::type RT;
- typedef typename Get_type<R, Point_tag>::type Point;
- typedef typename Get_type<R, Sphere_tag>::type Sphere;
- typedef typename Get_functor<R, Construct_ttag<Point_tag> >::type CP;
- typedef typename Get_functor<R, Construct_ttag<Point_cartesian_const_iterator_tag> >::type CI;
- typedef typename Get_functor<R, Point_dimension_tag>::type PD;
- typedef Point result_type;
- typedef Sphere first_argument_type;
- typedef int second_argument_type;
- struct Trans : std::binary_function<FT,int,FT> {
- FT const& r_; int idx; bool sgn;
- Trans (int n, FT const& r, bool b) : r_(r), idx(n), sgn(b) {}
- FT operator()(FT const&x, int i)const{
- return (i == idx) ? sgn ? x + r_ : x - r_ : x;
- }
- };
- result_type operator()(Sphere const&s, int i)const{
- CI ci(this->kernel());
- PD pd(this->kernel());
- typedef boost::counting_iterator<int,std::random_access_iterator_tag> Count;
- Point const&c = s.center();
- int d=pd(c);
- bool last = (i == d);
- FT r = sqrt(s.squared_radius());
- Trans t(last ? 0 : i, r, !last);
- return CP(this->kernel())(make_transforming_pair_iterator(ci(c,Begin_tag()),Count(0),t),make_transforming_pair_iterator(ci(c,End_tag()),Count(d),t));
- }
-};
-}
-CGAL_KD_DEFAULT_TYPE(Sphere_tag,(CGAL::Sphere<K>),(Point_tag),());
-CGAL_KD_DEFAULT_FUNCTOR(Construct_ttag<Sphere_tag>,(CartesianDKernelFunctors::Construct_sphere<K>),(Sphere_tag,Point_tag),(Construct_ttag<Point_tag>,Compute_point_cartesian_coordinate_tag,Squared_distance_tag,Squared_distance_to_origin_tag,Point_dimension_tag));
-CGAL_KD_DEFAULT_FUNCTOR(Center_of_sphere_tag,(CartesianDKernelFunctors::Center_of_sphere<K>),(Sphere_tag,Point_tag),(Construct_ttag<Sphere_tag>));
-CGAL_KD_DEFAULT_FUNCTOR(Squared_radius_tag,(CartesianDKernelFunctors::Squared_radius<K>),(Sphere_tag),());
-CGAL_KD_DEFAULT_FUNCTOR(Point_of_sphere_tag,(CartesianDKernelFunctors::Point_of_sphere<K>),(Sphere_tag,Point_tag),(Construct_ttag<Point_tag>, Construct_ttag<Point_cartesian_const_iterator_tag>));
-} // namespace CGAL
-#endif
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/Types/Weighted_point.h b/include/gudhi_patches/CGAL/NewKernel_d/Types/Weighted_point.h
deleted file mode 100644
index 1caf8701..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/Types/Weighted_point.h
+++ /dev/null
@@ -1,205 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_KD_TYPE_WP_H
-#define CGAL_KD_TYPE_WP_H
-#include <CGAL/NewKernel_d/store_kernel.h>
-#include <boost/iterator/counting_iterator.hpp>
-namespace CGAL {
-namespace KerD {
-template <class R_> class Weighted_point {
- typedef typename Get_type<R_, FT_tag>::type FT_;
- typedef typename Get_type<R_, Point_tag>::type Point_;
- Point_ c_;
- FT_ w_;
-
- public:
- Weighted_point(Point_ const&p, FT_ const&w): c_(p), w_(w) {}
- // TODO: Add a piecewise constructor?
-
- Point_ const& point()const{return c_;}
- FT_ const& weight()const{return w_;}
-};
-}
-
-namespace CartesianDKernelFunctors {
-template <class R_> struct Construct_weighted_point : Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Construct_weighted_point)
- typedef typename Get_type<R_, Weighted_point_tag>::type result_type;
- typedef typename Get_type<R_, Point_tag>::type Point;
- typedef typename Get_type<R_, FT_tag>::type FT;
- result_type operator()(Point const&a, FT const&b)const{
- return result_type(a,b);
- }
- // Not really needed
- result_type operator()()const{
- typename Get_functor<R_, Construct_ttag<Point_tag> >::type cp(this->kernel());
- return result_type(cp(),0);
- }
-};
-
-template <class R_> struct Point_drop_weight {
- CGAL_FUNCTOR_INIT_IGNORE(Point_drop_weight)
- typedef typename Get_type<R_, Weighted_point_tag>::type argument_type;
- typedef typename Get_type<R_, Point_tag>::type const& result_type;
- // Returning a reference is fragile
-
- result_type operator()(argument_type const&s)const{
- return s.point();
- }
-};
-
-template <class R_> struct Point_weight {
- CGAL_FUNCTOR_INIT_IGNORE(Point_weight)
- typedef typename Get_type<R_, Weighted_point_tag>::type argument_type;
- typedef typename Get_type<R_, FT_tag>::type result_type;
-
- result_type operator()(argument_type const&s)const{
- return s.weight();
- }
-};
-
-template <class R_> struct Power_distance : private Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Power_distance)
- typedef typename Get_type<R_, Weighted_point_tag>::type first_argument_type;
- typedef first_argument_type second_argument_type;
- typedef typename Get_type<R_, FT_tag>::type result_type;
-
- result_type operator()(first_argument_type const&a, second_argument_type const&b)const{
- typename Get_functor<R_, Point_drop_weight_tag>::type pdw(this->kernel());
- typename Get_functor<R_, Point_weight_tag>::type pw(this->kernel());
- typename Get_functor<R_, Squared_distance_tag>::type sd(this->kernel());
- return sd(pdw(a),pdw(b))-pw(a)-pw(b);
- }
-};
-template <class R_> struct Power_distance_to_point : private Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Power_distance_to_point)
- typedef typename Get_type<R_, Weighted_point_tag>::type first_argument_type;
- typedef typename Get_type<R_, Point_tag>::type second_argument_type;
- typedef typename Get_type<R_, FT_tag>::type result_type;
-
- result_type operator()(first_argument_type const&a, second_argument_type const&b)const{
- typename Get_functor<R_, Point_drop_weight_tag>::type pdw(this->kernel());
- typename Get_functor<R_, Point_weight_tag>::type pw(this->kernel());
- typename Get_functor<R_, Squared_distance_tag>::type sd(this->kernel());
- return sd(pdw(a),b)-pw(a);
- }
-};
-
-template<class R_> struct Power_side_of_power_sphere : private Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Power_side_of_power_sphere)
- typedef R_ R;
- typedef typename Get_type<R, Oriented_side_tag>::type result_type;
-
- template<class Iter, class Pt>
- result_type operator()(Iter const& f, Iter const& e, Pt const& p0) const {
- typename Get_functor<R, Power_side_of_power_sphere_raw_tag>::type ptr(this->kernel());
- typename Get_functor<R, Point_drop_weight_tag>::type pdw(this->kernel());
- typename Get_functor<R, Point_weight_tag>::type pw(this->kernel());
- return ptr (
- make_transforming_iterator (f, pdw),
- make_transforming_iterator (e, pdw),
- make_transforming_iterator (f, pw),
- pdw (p0),
- pw (p0));
- }
-};
-
-template<class R_> struct In_flat_power_side_of_power_sphere : private Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(In_flat_power_side_of_power_sphere)
- typedef R_ R;
- typedef typename Get_type<R, Oriented_side_tag>::type result_type;
-
- template<class Fo, class Iter, class Pt>
- result_type operator()(Fo const& fo, Iter const& f, Iter const& e, Pt const& p0) const {
- typename Get_functor<R, In_flat_power_side_of_power_sphere_raw_tag>::type ptr(this->kernel());
- typename Get_functor<R, Point_drop_weight_tag>::type pdw(this->kernel());
- typename Get_functor<R, Point_weight_tag>::type pw(this->kernel());
- return ptr (
- fo,
- make_transforming_iterator (f, pdw),
- make_transforming_iterator (e, pdw),
- make_transforming_iterator (f, pw),
- pdw (p0),
- pw (p0));
- }
-};
-
-// Construct a point at (weighted) distance 0 from all the input
-template <class R_> struct Power_center : Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Power_center)
- typedef typename Get_type<R_, Weighted_point_tag>::type WPoint;
- typedef WPoint result_type;
- typedef typename Get_type<R_, Point_tag>::type Point;
- typedef typename Get_type<R_, FT_tag>::type FT;
- template <class Iter>
- result_type operator()(Iter f, Iter e)const{
- // 2*(x-y).c == (x^2-wx^2)-(y^2-wy^2)
- typedef typename R_::LA LA;
- typedef typename LA::Square_matrix Matrix;
- typedef typename LA::Vector Vec;
- typedef typename LA::Construct_vector CVec;
- typename Get_functor<R_, Compute_point_cartesian_coordinate_tag>::type c(this->kernel());
- typename Get_functor<R_, Construct_ttag<Point_tag> >::type cp(this->kernel());
- typename Get_functor<R_, Point_dimension_tag>::type pd(this->kernel());
- typename Get_functor<R_, Squared_distance_to_origin_tag>::type sdo(this->kernel());
- typename Get_functor<R_, Power_distance_to_point_tag>::type pdp(this->kernel());
- typename Get_functor<R_, Point_drop_weight_tag>::type pdw(this->kernel());
- typename Get_functor<R_, Point_weight_tag>::type pw(this->kernel());
- typename Get_functor<R_, Construct_ttag<Weighted_point_tag> >::type cwp(this->kernel());
-
- WPoint const& wp0 = *f;
- Point const& p0 = pdw(wp0);
- int d = pd(p0);
- FT const& n0 = sdo(p0) - pw(wp0);
- Matrix m(d,d);
- Vec b = typename CVec::Dimension()(d);
- // Write the point coordinates in lines.
- int i;
- for(i=0; ++f!=e; ++i) {
- WPoint const& wp=*f;
- Point const& p=pdw(wp);
- FT const& np = sdo(p) - pw(wp);
- for(int j=0;j<d;++j) {
- m(i,j)=2*(c(p,j)-c(p0,j));
- b[i] = np - n0;
- }
- }
- CGAL_assertion (i == d);
- Vec res = typename CVec::Dimension()(d);;
- //std::cout << "Mat: " << m << "\n Vec: " << one << std::endl;
- LA::solve(res, CGAL_MOVE(m), CGAL_MOVE(b));
- //std::cout << "Sol: " << res << std::endl;
- Point center = cp(d,LA::vector_begin(res),LA::vector_end(res));
- FT const& r2 = pdp (wp0, center);
- return cwp(CGAL_MOVE(center), r2);
- }
-};
-}
-CGAL_KD_DEFAULT_TYPE(Weighted_point_tag,(CGAL::KerD::Weighted_point<K>),(Point_tag),());
-CGAL_KD_DEFAULT_FUNCTOR(Construct_ttag<Weighted_point_tag>,(CartesianDKernelFunctors::Construct_weighted_point<K>),(Weighted_point_tag,Point_tag),());
-CGAL_KD_DEFAULT_FUNCTOR(Point_drop_weight_tag,(CartesianDKernelFunctors::Point_drop_weight<K>),(Weighted_point_tag,Point_tag),());
-CGAL_KD_DEFAULT_FUNCTOR(Point_weight_tag,(CartesianDKernelFunctors::Point_weight<K>),(Weighted_point_tag,Point_tag),());
-CGAL_KD_DEFAULT_FUNCTOR(Power_side_of_power_sphere_tag,(CartesianDKernelFunctors::Power_side_of_power_sphere<K>),(Weighted_point_tag),(Power_side_of_power_sphere_raw_tag,Point_drop_weight_tag,Point_weight_tag));
-CGAL_KD_DEFAULT_FUNCTOR(In_flat_power_side_of_power_sphere_tag,(CartesianDKernelFunctors::In_flat_power_side_of_power_sphere<K>),(Weighted_point_tag),(In_flat_power_side_of_power_sphere_raw_tag,Point_drop_weight_tag,Point_weight_tag));
-CGAL_KD_DEFAULT_FUNCTOR(Power_distance_tag,(CartesianDKernelFunctors::Power_distance<K>),(Weighted_point_tag,Point_tag),(Squared_distance_tag,Point_drop_weight_tag,Point_weight_tag));
-CGAL_KD_DEFAULT_FUNCTOR(Power_distance_to_point_tag,(CartesianDKernelFunctors::Power_distance_to_point<K>),(Weighted_point_tag,Point_tag),(Squared_distance_tag,Point_drop_weight_tag,Point_weight_tag));
-CGAL_KD_DEFAULT_FUNCTOR(Power_center_tag,(CartesianDKernelFunctors::Power_center<K>),(Weighted_point_tag,Point_tag),(Compute_point_cartesian_coordinate_tag,Construct_ttag<Point_tag>,Construct_ttag<Weighted_point_tag>,Point_dimension_tag,Squared_distance_to_origin_tag,Point_drop_weight_tag,Point_weight_tag,Power_distance_to_point_tag));
-} // namespace CGAL
-#endif
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/Vector/array.h b/include/gudhi_patches/CGAL/NewKernel_d/Vector/array.h
deleted file mode 100644
index 0ad9bb36..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/Vector/array.h
+++ /dev/null
@@ -1,165 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_VECTOR_ARRAY_H
-#define CGAL_VECTOR_ARRAY_H
-#include <boost/type_traits/is_arithmetic.hpp>
-#include <boost/utility/enable_if.hpp>
-#include <CGAL/Dimension.h>
-#include <CGAL/NewKernel_d/utils.h>
-#include <CGAL/array.h>
-#include <boost/preprocessor/repetition.hpp>
-#include <boost/preprocessor/repetition/enum.hpp>
-
-#include <CGAL/NewKernel_d/Vector/determinant_of_points_from_vectors.h>
-#include <CGAL/NewKernel_d/Vector/determinant_of_vectors_small_dim.h>
-#include <CGAL/NewKernel_d/Vector/determinant_of_iterator_to_points_from_iterator_to_vectors.h>
-#include <CGAL/NewKernel_d/Vector/determinant_of_iterator_to_points_from_points.h>
-#include <CGAL/NewKernel_d/Vector/determinant_of_iterator_to_vectors_from_vectors.h>
-
-
-
-namespace CGAL {
-
-// May not be safe to use with dim!=max_dim.
-// In that case, we should store the real dim next to the array.
-template<class NT_,class Dim_,class Max_dim_=Dim_> struct Array_vector {
- typedef NT_ NT;
- typedef Dim_ Dimension;
- typedef Max_dim_ Max_dimension;
- template< class D2, class D3=D2 >
- struct Rebind_dimension {
- typedef Array_vector< NT, D2, D3 > Other;
- };
- template<class> struct Property : boost::false_type {};
-
- static const unsigned d_=Max_dim_::value;
- CGAL_static_assertion(d_ != (unsigned)UNKNOWN_DIMENSION);
-
- typedef cpp0x::array<NT,d_> Vector;
- struct Construct_vector {
- struct Dimension {
- // Initialize with NaN if possible?
- Vector operator()(unsigned CGAL_assertion_code(d)) const {
- CGAL_assertion(d<=d_);
- return Vector();
- }
- };
-
- struct Iterator {
- template<typename Iter>
- Vector operator()(unsigned CGAL_assertion_code(d),Iter const& f,Iter const& e) const {
- CGAL_assertion(d==(unsigned) std::distance(f,e));
- CGAL_assertion(d<=d_);
- //TODO: optimize for forward iterators
- Vector a;
- std::copy(f,e,a.begin());
- return a;
- }
- };
-
-#if 0
- struct Iterator_add_one {
- template<typename Iter>
- Vector operator()(unsigned d,Iter const& f,Iter const& e) const {
- CGAL_assertion(d==std::distance(f,e)+1);
- CGAL_assertion(d<=d_);
- //TODO: optimize
- Vector a;
- std::copy(f,e,a.begin());
- a.back()=1;
- return a;
- }
- };
-#endif
-
- struct Iterator_and_last {
- template<typename Iter,typename T>
- Vector operator()(unsigned CGAL_assertion_code(d),Iter const& f,Iter const& e,CGAL_FORWARDABLE(T) t) const {
- CGAL_assertion(d==std::distance(f,e)+1);
- CGAL_assertion(d<=d_);
- //TODO: optimize for forward iterators
- Vector a;
- std::copy(f,e,a.begin());
- a.back()=CGAL_FORWARD(T,t);
- return a;
- }
- };
-
- struct Values {
-#ifdef CGAL_CXX11
- template<class...U>
- Vector operator()(U&&...u) const {
- static_assert(sizeof...(U)<=d_,"too many arguments");
- Vector a={{forward_safe<NT,U>(u)...}};
- return a;
- }
-#else
-
-#define CGAL_CODE(Z,N,_) Vector operator()(BOOST_PP_ENUM_PARAMS(N,NT const& t)) const { \
- CGAL_assertion(N<=d_); \
- Vector a={{BOOST_PP_ENUM_PARAMS(N,t)}}; \
- return a; \
-}
-BOOST_PP_REPEAT_FROM_TO(1, 11, CGAL_CODE, _ )
-#undef CGAL_CODE
-
-#endif
- };
-
- struct Values_divide {
-#ifdef CGAL_CXX11
- template<class H,class...U>
- Vector operator()(H const& h,U&&...u) const {
- static_assert(sizeof...(U)<=d_,"too many arguments");
- Vector a={{Rational_traits<NT>().make_rational(std::forward<U>(u),h)...}};
- return a;
- }
-#else
-
-#define CGAL_VAR(Z,N,_) Rational_traits<NT>().make_rational( t##N , h)
-#define CGAL_CODE(Z,N,_) template <class H> Vector \
- operator()(H const&h, BOOST_PP_ENUM_PARAMS(N,NT const& t)) const { \
- CGAL_assertion(N<=d_); \
- Vector a={{BOOST_PP_ENUM(N,CGAL_VAR,_)}}; \
- return a; \
- }
- BOOST_PP_REPEAT_FROM_TO(1, 11, CGAL_CODE, _ )
-#undef CGAL_CODE
-#undef CGAL_VAR
-
-#endif
- };
- };
-
- typedef NT const* Vector_const_iterator;
- static Vector_const_iterator vector_begin(Vector const&a){
- return &a[0];
- }
- static Vector_const_iterator vector_end(Vector const&a){
- return &a[0]+d_; // Don't know the real size
- }
- static unsigned size_of_vector(Vector const&){
- return d_; // Don't know the real size
- }
-
-};
-
-}
-#endif
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/Vector/avx4.h b/include/gudhi_patches/CGAL/NewKernel_d/Vector/avx4.h
deleted file mode 100644
index 954a3c1b..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/Vector/avx4.h
+++ /dev/null
@@ -1,213 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_VECTOR_AVX4_H
-#define CGAL_VECTOR_AVX4_H
-
-#if !defined __AVX__ || (__GNUC__ * 100 + __GNUC_MINOR__ < 408)
-#error Requires AVX and gcc 4.8+
-#endif
-#include <x86intrin.h>
-
-#include <CGAL/NewKernel_d/functor_tags.h>
-#include <CGAL/Dimension.h>
-#include <CGAL/enum.h> // CGAL::Sign
-#include <CGAL/number_utils.h> // CGAL::sign
-
-
-
-namespace CGAL {
-
- struct Avx_vector_4 {
- typedef double NT;
- typedef Dimension_tag<4> Dimension;
- typedef Dimension_tag<4> Max_dimension;
- // No Rebind_dimension, this is a building block
- template<class,bool=true> struct Property : boost::false_type {};
- template<bool b> struct Property<Has_vector_plus_minus_tag,b>
- : boost::true_type {};
- /* MAYBE?
- template<bool b> struct Property<Has_vector_scalar_ops_tag,b>
- : boost::true_type {};
- */
- template<bool b> struct Property<Has_determinant_of_vectors_tag,b>
- : boost::true_type {};
- template<bool b> struct Property<Has_dot_product_tag,b>
- : boost::true_type {};
- template<bool b> struct Property<Has_determinant_of_vectors_omit_last_tag,b>
- : boost::true_type {};
-
- typedef __m256d Vector;
- struct Construct_vector {
- struct Dimension {
- // Initialize with NaN?
- Vector operator()(unsigned d) const {
- CGAL_assertion(d==4);
- return Vector();
- }
- };
-
- struct Iterator {
- template<typename Iter>
- Vector operator()(unsigned d,Iter const& f,Iter const& e) const {
- CGAL_assertion(d==4);
- double x0 = *f;
- double x1 = *++f;
- double x2 = *++f;
- double x3 = *++f;
- CGAL_assertion(++f==e);
- Vector a = { x0, x1, x2, x3 };
- return a;
- }
- };
-
- struct Iterator_and_last {
- template<typename Iter,typename T>
- Vector operator()(unsigned d,Iter const& f,Iter const& e,double t) const {
- CGAL_assertion(d==4);
- double x0 = *f;
- double x1 = *++f;
- double x2 = *++f;
- CGAL_assertion(++f==e);
- Vector a = { x0, x1, x2, t };
- return a;
- }
- };
-
- struct Values {
- Vector operator()(double a,double b,double c,double d) const {
- Vector r = { a, b, c, d };
- return r;
- }
- };
-
- struct Values_divide {
- Vector operator()(double h,double a,double b,double c,double d) const {
- // {a,b,c,d}/{h,h,h,h} should be roughly the same
- Vector r = { a/h, b/h, c/h, d/h };
- return r;
- }
- };
- };
-
- public:
- typedef double const* Vector_const_iterator;
- static inline Vector_const_iterator vector_begin(Vector const&a){
- return (Vector_const_iterator)(&a);
- }
- static inline Vector_const_iterator vector_end(Vector const&a){
- return (Vector_const_iterator)(&a)+4;
- }
- static inline unsigned size_of_vector(Vector){
- return 4;
- }
- static inline double dot_product(__m256d x, __m256d y){
- __m256d p=x*y;
- __m256d z=_mm256_hadd_pd(p,p);
- return z[0]+z[2];
- }
- private:
- static inline __m256d avx_sym(__m256d x){
-#if 0
- return __builtin_shuffle(x,(__m256i){2,3,0,1});
-#else
- return _mm256_permute2f128_pd(x,x,1);
-#endif
- }
- static inline __m256d avx_left(__m256d x){
-#if 0
- return __builtin_shuffle(x,(__m256i){1,2,3,0});
-#else
-#ifdef __AVX2__
- return _mm256_permute4x64_pd(x,1+2*4+3*16+0*64);
-#else
- __m256d s = _mm256_permute2f128_pd(x,x,1);
- return _mm256_shuffle_pd(x,s,5);
-#endif
-#endif
- }
- static inline __m256d avx_right(__m256d x){
-#if 0
- return __builtin_shuffle(x,(__m256i){3,0,1,2});
-#else
-#ifdef __AVX2__
- return _mm256_permute4x64_pd(x,3+0*4+1*16+2*64);
-#else
- __m256d s = _mm256_permute2f128_pd(x,x,1);
- return _mm256_shuffle_pd(s,x,5);
-#endif
-#endif
- }
- static inline double avx_altprod(__m256d x, __m256d y){
- __m256d p=x*y;
- __m256d z=_mm256_hsub_pd(p,p);
- return z[0]+z[2];
- }
- public:
- static double
- determinant_of_vectors(Vector a, Vector b, Vector c, Vector d) {
- __m256d x=a*avx_left(b)-avx_left(a)*b;
- __m256d yy=a*avx_sym(b);
- __m256d y=yy-avx_sym(yy);
- __m256d z0=x*avx_sym(c);
- __m256d z1=avx_left(x)*c;
- __m256d z2=y*avx_left(c);
- __m256d z=z0+z1-z2;
- return avx_altprod(z,avx_right(d));
- }
- static CGAL::Sign
- sign_of_determinant_of_vectors(Vector a, Vector b, Vector c, Vector d) {
- return CGAL::sign(determinant_of_vectors(a,b,c,d));
- }
-
- private:
- static inline __m256d avx3_right(__m256d x){
-#if 0
- return __builtin_shuffle(x,(__m256i){2,0,1,3}); // can replace 3 with anything
-#else
-#ifdef __AVX2__
- return _mm256_permute4x64_pd(x,2+0*4+1*16+3*64);
-#else
- __m256d s = _mm256_permute2f128_pd(x,x,1);
- return _mm256_shuffle_pd(s,x,12);
-#endif
-#endif
- }
- public:
- static inline double dot_product_omit_last(__m256d x, __m256d y){
- __m256d p=x*y;
- __m128d q=_mm256_extractf128_pd(p,0);
- double z=_mm_hadd_pd(q,q)[0];
- return z+p[2];
- }
- // Note: without AVX2, is it faster than the scalar computation?
- static double
- determinant_of_vectors_omit_last(Vector a, Vector b, Vector c) {
- __m256d x=a*avx3_right(b)-avx3_right(a)*b;
- return dot_product_omit_last(c,avx3_right(x));
- }
- static CGAL::Sign
- sign_of_determinant_of_vectors_omit_last(Vector a, Vector b, Vector c) {
- return CGAL::sign(determinant_of_vectors_omit_last(a,b,c));
- }
-
- };
-
-}
-#endif
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/Vector/determinant_of_iterator_to_points_from_iterator_to_vectors.h b/include/gudhi_patches/CGAL/NewKernel_d/Vector/determinant_of_iterator_to_points_from_iterator_to_vectors.h
deleted file mode 100644
index b8efbe28..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/Vector/determinant_of_iterator_to_points_from_iterator_to_vectors.h
+++ /dev/null
@@ -1,76 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_VECTOR_DET_ITER_PTS_ITER_VEC_H
-#define CGAL_VECTOR_DET_ITER_PTS_ITER_VEC_H
-#include <functional>
-#include <CGAL/transforming_iterator.h>
-#include <CGAL/NewKernel_d/functor_tags.h>
-#include <CGAL/Dimension.h>
-
-namespace CGAL {
-
-template <class LA, class Dim_=typename LA::Dimension,
- class Max_dim_=typename LA::Max_dimension,
- bool = LA::template Property<Has_determinant_of_iterator_to_points_tag>::value,
- bool = LA::template Property<Has_determinant_of_iterator_to_vectors_tag>::value>
-struct Add_determinant_of_iterator_to_points_from_iterator_to_vectors : LA {
- template< class D2, class D3=D2 >
- struct Rebind_dimension {
- typedef typename LA::template Rebind_dimension<D2,D3> LA2;
- typedef Add_determinant_of_iterator_to_points_from_iterator_to_vectors<LA2> Other;
- };
-};
-
-template <class LA, class Dim_,class Max_dim_>
-struct Add_determinant_of_iterator_to_points_from_iterator_to_vectors
-<LA, Dim_, Max_dim_, false, true> : LA {
- typedef typename LA::NT NT;
- typedef typename LA::Vector Vector;
- template< class D2, class D3=D2 >
- struct Rebind_dimension {
- typedef typename LA::template Rebind_dimension<D2,D3> LA2;
- typedef Add_determinant_of_iterator_to_points_from_iterator_to_vectors<LA2> Other;
- };
- template<class P,class=void> struct Property : LA::template Property<P> {};
- template<class D> struct Property<Has_determinant_of_iterator_to_points_tag, D> :
- boost::true_type {};
-
- // TODO: use std::minus, boost::bind, etc
- template<class T> struct Minus_fixed {
- T const& a;
- Minus_fixed(T const&a_):a(a_){}
- T operator()(T const&b)const{return b-a;}
- };
- template<class Iter>
- static NT determinant_of_iterator_to_points(Iter const&first, Iter const&end){
- Vector const&a=*first; ++first;
- Minus_fixed<Vector> f(a);
- return LA::determinant_of_iterator_to_vectors(make_transforming_iterator(first,f),make_transforming_iterator(end,f));
- }
- template<class Iter>
- static Sign sign_of_determinant_of_iterator_to_points(Iter const&first, Iter const&end){
- Vector const&a=*first; ++first;
- Minus_fixed<Vector> f(a);
- return LA::sign_of_determinant_of_iterator_to_vectors(make_transforming_iterator(first,f),make_transforming_iterator(end,f));
- }
-};
-
-}
-#endif
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/Vector/determinant_of_iterator_to_points_from_points.h b/include/gudhi_patches/CGAL/NewKernel_d/Vector/determinant_of_iterator_to_points_from_points.h
deleted file mode 100644
index 71a31d81..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/Vector/determinant_of_iterator_to_points_from_points.h
+++ /dev/null
@@ -1,211 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_VECTOR_DET_ITER_PTS_PTS_H
-#define CGAL_VECTOR_DET_ITER_PTS_PTS_H
-#include <CGAL/NewKernel_d/functor_tags.h>
-#include <CGAL/Dimension.h>
-
-namespace CGAL {
-
-template <class LA, class Dim_=typename LA::Dimension,
- class Max_dim_=typename LA::Max_dimension,
- bool = LA::template Property<Has_determinant_of_iterator_to_points_tag>::value,
- bool = LA::template Property<Has_determinant_of_points_tag>::value>
-struct Add_determinant_of_iterator_to_points_from_points : LA {
- template< class D2, class D3=D2 >
- struct Rebind_dimension {
- typedef typename LA::template Rebind_dimension<D2,D3> LA2;
- typedef Add_determinant_of_iterator_to_points_from_points<LA2> Other;
- };
-};
-
-//FIXME: Use variadics and boost so it works in any dimension.
-template <class LA, class Max_dim_>
-struct Add_determinant_of_iterator_to_points_from_points
-<LA, Dimension_tag<2>, Max_dim_, false, true> : LA {
- typedef typename LA::NT NT;
- typedef typename LA::Vector Vector;
- template< class D2, class D3=D2 >
- struct Rebind_dimension {
- typedef typename LA::template Rebind_dimension<D2,D3> LA2;
- typedef Add_determinant_of_iterator_to_points_from_points<LA2> Other;
- };
- template<class P,class=void> struct Property : LA::template Property<P> {};
- template<class D> struct Property<Has_determinant_of_iterator_to_points_tag, D> :
- boost::true_type {};
-
- template<class Iter>
- static NT determinant_of_iterator_to_points(Iter const&first, Iter const&end){
- Vector const&a=*first; ++first;
- Vector const&b=*first; ++first;
- Vector const&c=*first; CGAL_assertion(++first==end);
- return LA::determinant_of_points(a,b,c);
- }
- template<class Iter>
- static Sign sign_of_determinant_of_iterator_to_points(Iter const&first, Iter const&end){
- Vector const&a=*first; ++first;
- Vector const&b=*first; ++first;
- Vector const&c=*first; CGAL_assertion(++first==end);
- return LA::sign_of_determinant_of_points(a,b,c);
- }
-};
-
-template <class LA, class Max_dim_>
-struct Add_determinant_of_iterator_to_points_from_points
-<LA, Dimension_tag<3>, Max_dim_, false, true> : LA {
- typedef typename LA::NT NT;
- typedef typename LA::Vector Vector;
- template< class D2, class D3=D2 >
- struct Rebind_dimension {
- typedef typename LA::template Rebind_dimension<D2,D3> LA2;
- typedef Add_determinant_of_iterator_to_points_from_points<LA2> Other;
- };
- template<class P,class=void> struct Property : LA::template Property<P> {};
- template<class D> struct Property<Has_determinant_of_iterator_to_points_tag, D> :
- boost::true_type {};
-
- template<class Iter>
- static NT determinant_of_iterator_to_points(Iter const&first, Iter const&end){
- Vector const&a=*first; ++first;
- Vector const&b=*first; ++first;
- Vector const&c=*first; ++first;
- Vector const&d=*first; CGAL_assertion(++first==end);
- return LA::determinant_of_points(a,b,c,d);
- }
- template<class Iter>
- static Sign sign_of_determinant_of_iterator_to_points(Iter const&first, Iter const&end){
- Vector const&a=*first; ++first;
- Vector const&b=*first; ++first;
- Vector const&c=*first; ++first;
- Vector const&d=*first; CGAL_assertion(++first==end);
- return LA::sign_of_determinant_of_points(a,b,c,d);
- }
-};
-
-template <class LA, class Max_dim_>
-struct Add_determinant_of_iterator_to_points_from_points
-<LA, Dimension_tag<4>, Max_dim_, false, true> : LA {
- typedef typename LA::NT NT;
- typedef typename LA::Vector Vector;
- template< class D2, class D3=D2 >
- struct Rebind_dimension {
- typedef typename LA::template Rebind_dimension<D2,D3> LA2;
- typedef Add_determinant_of_iterator_to_points_from_points<LA2> Other;
- };
- template<class P,class=void> struct Property : LA::template Property<P> {};
- template<class D> struct Property<Has_determinant_of_iterator_to_points_tag, D> :
- boost::true_type {};
-
- template<class Iter>
- static NT determinant_of_iterator_to_points(Iter const&first, Iter const&end){
- Vector const&a=*first; ++first;
- Vector const&b=*first; ++first;
- Vector const&c=*first; ++first;
- Vector const&d=*first; ++first;
- Vector const&e=*first; CGAL_assertion(++first==end);
- return LA::determinant_of_points(a,b,c,d,e);
- }
- template<class Iter>
- static Sign sign_of_determinant_of_iterator_to_points(Iter const&first, Iter const&end){
- Vector const&a=*first; ++first;
- Vector const&b=*first; ++first;
- Vector const&c=*first; ++first;
- Vector const&d=*first; ++first;
- Vector const&e=*first; CGAL_assertion(++first==end);
- return LA::sign_of_determinant_of_points(a,b,c,d,e);
- }
-};
-
-template <class LA, class Max_dim_>
-struct Add_determinant_of_iterator_to_points_from_points
-<LA, Dimension_tag<5>, Max_dim_, false, true> : LA {
- typedef typename LA::NT NT;
- typedef typename LA::Vector Vector;
- template< class D2, class D3=D2 >
- struct Rebind_dimension {
- typedef typename LA::template Rebind_dimension<D2,D3> LA2;
- typedef Add_determinant_of_iterator_to_points_from_points<LA2> Other;
- };
- template<class P,class=void> struct Property : LA::template Property<P> {};
- template<class D> struct Property<Has_determinant_of_iterator_to_points_tag, D> :
- boost::true_type {};
-
- template<class Iter>
- static NT determinant_of_iterator_to_points(Iter const&first, Iter const&end){
- Vector const&a=*first; ++first;
- Vector const&b=*first; ++first;
- Vector const&c=*first; ++first;
- Vector const&d=*first; ++first;
- Vector const&e=*first; ++first;
- Vector const&f=*first; CGAL_assertion(++first==end);
- return LA::determinant_of_points(a,b,c,d,e,f);
- }
- template<class Iter>
- static Sign sign_of_determinant_of_iterator_to_points(Iter const&first, Iter const&end){
- Vector const&a=*first; ++first;
- Vector const&b=*first; ++first;
- Vector const&c=*first; ++first;
- Vector const&d=*first; ++first;
- Vector const&e=*first; ++first;
- Vector const&f=*first; CGAL_assertion(++first==end);
- return LA::sign_of_determinant_of_points(a,b,c,d,e,f);
- }
-};
-
-template <class LA, class Max_dim_>
-struct Add_determinant_of_iterator_to_points_from_points
-<LA, Dimension_tag<6>, Max_dim_, false, true> : LA {
- typedef typename LA::NT NT;
- typedef typename LA::Vector Vector;
- template< class D2, class D3=D2 >
- struct Rebind_dimension {
- typedef typename LA::template Rebind_dimension<D2,D3> LA2;
- typedef Add_determinant_of_iterator_to_points_from_points<LA2> Other;
- };
- template<class P,class=void> struct Property : LA::template Property<P> {};
- template<class D> struct Property<Has_determinant_of_iterator_to_points_tag, D> :
- boost::true_type {};
-
- template<class Iter>
- static NT determinant_of_iterator_to_points(Iter const&first, Iter const&end){
- Vector const&a=*first; ++first;
- Vector const&b=*first; ++first;
- Vector const&c=*first; ++first;
- Vector const&d=*first; ++first;
- Vector const&e=*first; ++first;
- Vector const&f=*first; ++first;
- Vector const&g=*first; CGAL_assertion(++first==end);
- return LA::determinant_of_points(a,b,c,d,e,f,g);
- }
- template<class Iter>
- static Sign sign_of_determinant_of_iterator_to_points(Iter const&first, Iter const&end){
- Vector const&a=*first; ++first;
- Vector const&b=*first; ++first;
- Vector const&c=*first; ++first;
- Vector const&d=*first; ++first;
- Vector const&e=*first; ++first;
- Vector const&f=*first; ++first;
- Vector const&g=*first; CGAL_assertion(++first==end);
- return LA::sign_of_determinant_of_points(a,b,c,d,e,f,g);
- }
-};
-
-}
-#endif
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/Vector/determinant_of_iterator_to_vectors_from_vectors.h b/include/gudhi_patches/CGAL/NewKernel_d/Vector/determinant_of_iterator_to_vectors_from_vectors.h
deleted file mode 100644
index f096d6c7..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/Vector/determinant_of_iterator_to_vectors_from_vectors.h
+++ /dev/null
@@ -1,201 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_VECTOR_DET_ITER_VEC_VEC_H
-#define CGAL_VECTOR_DET_ITER_VEC_VEC_H
-#include <CGAL/NewKernel_d/functor_tags.h>
-#include <CGAL/Dimension.h>
-
-namespace CGAL {
-
-template <class LA, class Dim_=typename LA::Dimension,
- class Max_dim_=typename LA::Max_dimension,
- bool = LA::template Property<Has_determinant_of_iterator_to_vectors_tag>::value,
- bool = LA::template Property<Has_determinant_of_vectors_tag>::value>
-struct Add_determinant_of_iterator_to_vectors_from_vectors : LA {
- template< class D2, class D3=D2 >
- struct Rebind_dimension {
- typedef typename LA::template Rebind_dimension<D2,D3> LA2;
- typedef Add_determinant_of_iterator_to_vectors_from_vectors<LA2> Other;
- };
-};
-
-//FIXME: Use variadics and boost so it works in any dimension.
-template <class LA, class Max_dim_>
-struct Add_determinant_of_iterator_to_vectors_from_vectors
-<LA, Dimension_tag<2>, Max_dim_, false, true> : LA {
- typedef typename LA::NT NT;
- typedef typename LA::Vector Vector;
- template< class D2, class D3=D2 >
- struct Rebind_dimension {
- typedef typename LA::template Rebind_dimension<D2,D3> LA2;
- typedef Add_determinant_of_iterator_to_vectors_from_vectors<LA2> Other;
- };
- template<class P,class=void> struct Property : LA::template Property<P> {};
- template<class D> struct Property<Has_determinant_of_iterator_to_vectors_tag, D> :
- boost::true_type {};
-
- template<class Iter>
- static NT determinant_of_iterator_to_vectors(Iter const&first, Iter const&end){
- Vector const&a=*first; ++first;
- Vector const&b=*first; CGAL_assertion(++first==end);
- return LA::determinant_of_vectors(a,b);
- }
- template<class Iter>
- static Sign sign_of_determinant_of_iterator_to_vectors(Iter const&first, Iter const&end){
- Vector const&a=*first; ++first;
- Vector const&b=*first; CGAL_assertion(++first==end);
- return LA::sign_of_determinant_of_vectors(a,b);
- }
-};
-
-template <class LA, class Max_dim_>
-struct Add_determinant_of_iterator_to_vectors_from_vectors
-<LA, Dimension_tag<3>, Max_dim_, false, true> : LA {
- typedef typename LA::NT NT;
- typedef typename LA::Vector Vector;
- template< class D2, class D3=D2 >
- struct Rebind_dimension {
- typedef typename LA::template Rebind_dimension<D2,D3> LA2;
- typedef Add_determinant_of_iterator_to_vectors_from_vectors<LA2> Other;
- };
- template<class P,class=void> struct Property : LA::template Property<P> {};
- template<class D> struct Property<Has_determinant_of_iterator_to_vectors_tag, D> :
- boost::true_type {};
-
- template<class Iter>
- static NT determinant_of_iterator_to_vectors(Iter const&first, Iter const&end){
- Vector const&a=*first; ++first;
- Vector const&b=*first; ++first;
- Vector const&c=*first; CGAL_assertion(++first==end);
- return LA::determinant_of_vectors(a,b,c);
- }
- template<class Iter>
- static Sign sign_of_determinant_of_iterator_to_vectors(Iter const&first, Iter const&end){
- Vector const&a=*first; ++first;
- Vector const&b=*first; ++first;
- Vector const&c=*first; CGAL_assertion(++first==end);
- return LA::sign_of_determinant_of_vectors(a,b,c);
- }
-};
-
-template <class LA, class Max_dim_>
-struct Add_determinant_of_iterator_to_vectors_from_vectors
-<LA, Dimension_tag<4>, Max_dim_, false, true> : LA {
- typedef typename LA::NT NT;
- typedef typename LA::Vector Vector;
- template< class D2, class D3=D2 >
- struct Rebind_dimension {
- typedef typename LA::template Rebind_dimension<D2,D3> LA2;
- typedef Add_determinant_of_iterator_to_vectors_from_vectors<LA2> Other;
- };
- template<class P,class=void> struct Property : LA::template Property<P> {};
- template<class D> struct Property<Has_determinant_of_iterator_to_vectors_tag, D> :
- boost::true_type {};
-
- template<class Iter>
- static NT determinant_of_iterator_to_vectors(Iter const&first, Iter const&end){
- Vector const&a=*first; ++first;
- Vector const&b=*first; ++first;
- Vector const&c=*first; ++first;
- Vector const&d=*first; CGAL_assertion(++first==end);
- return LA::determinant_of_vectors(a,b,c,d);
- }
- template<class Iter>
- static Sign sign_of_determinant_of_iterator_to_vectors(Iter const&first, Iter const&end){
- Vector const&a=*first; ++first;
- Vector const&b=*first; ++first;
- Vector const&c=*first; ++first;
- Vector const&d=*first; CGAL_assertion(++first==end);
- return LA::sign_of_determinant_of_vectors(a,b,c,d);
- }
-};
-
-template <class LA, class Max_dim_>
-struct Add_determinant_of_iterator_to_vectors_from_vectors
-<LA, Dimension_tag<5>, Max_dim_, false, true> : LA {
- typedef typename LA::NT NT;
- typedef typename LA::Vector Vector;
- template< class D2, class D3=D2 >
- struct Rebind_dimension {
- typedef typename LA::template Rebind_dimension<D2,D3> LA2;
- typedef Add_determinant_of_iterator_to_vectors_from_vectors<LA2> Other;
- };
- template<class P,class=void> struct Property : LA::template Property<P> {};
- template<class D> struct Property<Has_determinant_of_iterator_to_vectors_tag, D> :
- boost::true_type {};
-
- template<class Iter>
- static NT determinant_of_iterator_to_vectors(Iter const&first, Iter const&end){
- Vector const&a=*first; ++first;
- Vector const&b=*first; ++first;
- Vector const&c=*first; ++first;
- Vector const&d=*first; ++first;
- Vector const&e=*first; CGAL_assertion(++first==end);
- return LA::determinant_of_vectors(a,b,c,d,e);
- }
- template<class Iter>
- static Sign sign_of_determinant_of_iterator_to_vectors(Iter const&first, Iter const&end){
- Vector const&a=*first; ++first;
- Vector const&b=*first; ++first;
- Vector const&c=*first; ++first;
- Vector const&d=*first; ++first;
- Vector const&e=*first; CGAL_assertion(++first==end);
- return LA::sign_of_determinant_of_vectors(a,b,c,d,e);
- }
-};
-
-template <class LA, class Max_dim_>
-struct Add_determinant_of_iterator_to_vectors_from_vectors
-<LA, Dimension_tag<6>, Max_dim_, false, true> : LA {
- typedef typename LA::NT NT;
- typedef typename LA::Vector Vector;
- template< class D2, class D3=D2 >
- struct Rebind_dimension {
- typedef typename LA::template Rebind_dimension<D2,D3> LA2;
- typedef Add_determinant_of_iterator_to_vectors_from_vectors<LA2> Other;
- };
- template<class P,class=void> struct Property : LA::template Property<P> {};
- template<class D> struct Property<Has_determinant_of_iterator_to_vectors_tag, D> :
- boost::true_type {};
-
- template<class Iter>
- static NT determinant_of_iterator_to_vectors(Iter const&first, Iter const&end){
- Vector const&a=*first; ++first;
- Vector const&b=*first; ++first;
- Vector const&c=*first; ++first;
- Vector const&d=*first; ++first;
- Vector const&e=*first; ++first;
- Vector const&f=*first; CGAL_assertion(++first==end);
- return LA::determinant_of_vectors(a,b,c,d,e,f);
- }
- template<class Iter>
- static Sign sign_of_determinant_of_iterator_to_vectors(Iter const&first, Iter const&end){
- Vector const&a=*first; ++first;
- Vector const&b=*first; ++first;
- Vector const&c=*first; ++first;
- Vector const&d=*first; ++first;
- Vector const&e=*first; ++first;
- Vector const&f=*first; CGAL_assertion(++first==end);
- return LA::sign_of_determinant_of_vectors(a,b,c,d,e,f);
- }
-};
-
-}
-#endif
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/Vector/determinant_of_points_from_vectors.h b/include/gudhi_patches/CGAL/NewKernel_d/Vector/determinant_of_points_from_vectors.h
deleted file mode 100644
index 7ddb73c3..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/Vector/determinant_of_points_from_vectors.h
+++ /dev/null
@@ -1,164 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_VECTOR_DETPTS_H
-#define CGAL_VECTOR_DETPTS_H
-#include <CGAL/NewKernel_d/functor_tags.h>
-#include <CGAL/Dimension.h>
-
-namespace CGAL {
-
-template <class LA, class Dim_=typename LA::Dimension,
- class Max_dim_=typename LA::Max_dimension,
- bool = LA::template Property<Has_determinant_of_points_tag>::value,
- bool = LA::template Property<Has_determinant_of_vectors_tag>::value
- && LA::template Property<Has_vector_plus_minus_tag>::value>
-struct Add_determinant_of_points_from_vectors_and_minus : LA {
- template< class D2, class D3=D2 >
- struct Rebind_dimension {
- typedef typename LA::template Rebind_dimension<D2,D3> LA2;
- typedef Add_determinant_of_points_from_vectors_and_minus<LA2> Other;
- };
-};
-
-//FIXME: Use variadics and boost so it works in any dimension.
-template <class LA, class Max_dim_>
-struct Add_determinant_of_points_from_vectors_and_minus
-<LA, Dimension_tag<2>, Max_dim_, false, true> : LA {
- typedef typename LA::NT NT;
- typedef typename LA::Vector Vector;
- template< class D2, class D3=D2 >
- struct Rebind_dimension {
- typedef typename LA::template Rebind_dimension<D2,D3> LA2;
- typedef Add_determinant_of_points_from_vectors_and_minus<LA2> Other;
- };
- template<class P,class=void> struct Property : LA::template Property<P> {};
- template<class D> struct Property<Has_determinant_of_points_tag, D> :
- boost::true_type {};
-
- static NT determinant_of_points(Vector const&a, Vector const&b,
- Vector const&c){
- return LA::determinant_of_vectors(b-a,c-a);
- }
- static Sign sign_of_determinant_of_points(Vector const&a, Vector const&b,
- Vector const&c){
- return LA::sign_of_determinant_of_vectors(b-a,c-a);
- }
-};
-
-template <class LA, class Max_dim_>
-struct Add_determinant_of_points_from_vectors_and_minus
-<LA, Dimension_tag<3>, Max_dim_, false, true> : LA {
- typedef typename LA::NT NT;
- typedef typename LA::Vector Vector;
- template< class D2, class D3=D2 >
- struct Rebind_dimension {
- typedef typename LA::template Rebind_dimension<D2,D3> LA2;
- typedef Add_determinant_of_points_from_vectors_and_minus<LA2> Other;
- };
- template<class P,class=void> struct Property : LA::template Property<P> {};
- template<class D> struct Property<Has_determinant_of_points_tag, D> :
- boost::true_type {};
-
- static NT determinant_of_points(Vector const&a, Vector const&b,
- Vector const&c, Vector const&d){
- return LA::determinant_of_vectors(b-a,c-a,d-a);
- }
- static Sign sign_of_determinant_of_points(Vector const&a, Vector const&b,
- Vector const&c, Vector const&d){
- return LA::sign_of_determinant_of_vectors(b-a,c-a,d-a);
- }
-};
-
-template <class LA, class Max_dim_>
-struct Add_determinant_of_points_from_vectors_and_minus
-<LA, Dimension_tag<4>, Max_dim_, false, true> : LA {
- typedef typename LA::NT NT;
- typedef typename LA::Vector Vector;
- template< class D2, class D3=D2 >
- struct Rebind_dimension {
- typedef typename LA::template Rebind_dimension<D2,D3> LA2;
- typedef Add_determinant_of_points_from_vectors_and_minus<LA2> Other;
- };
- template<class P,class=void> struct Property : LA::template Property<P> {};
- template<class D> struct Property<Has_determinant_of_points_tag, D> :
- boost::true_type {};
-
- static NT determinant_of_points(Vector const&a, Vector const&b,
- Vector const&c, Vector const&d, Vector const&e){
- return LA::determinant_of_vectors(b-a,c-a,d-a,e-a);
- }
- static Sign sign_of_determinant_of_points(Vector const&a, Vector const&b,
- Vector const&c, Vector const&d, Vector const&e){
- return LA::sign_of_determinant_of_vectors(b-a,c-a,d-a,e-a);
- }
-};
-
-template <class LA, class Max_dim_>
-struct Add_determinant_of_points_from_vectors_and_minus
-<LA, Dimension_tag<5>, Max_dim_, false, true> : LA {
- typedef typename LA::NT NT;
- typedef typename LA::Vector Vector;
- template< class D2, class D3=D2 >
- struct Rebind_dimension {
- typedef typename LA::template Rebind_dimension<D2,D3> LA2;
- typedef Add_determinant_of_points_from_vectors_and_minus<LA2> Other;
- };
- template<class P,class=void> struct Property : LA::template Property<P> {};
- template<class D> struct Property<Has_determinant_of_points_tag, D> :
- boost::true_type {};
-
- static NT determinant_of_points(Vector const&a, Vector const&b,
- Vector const&c, Vector const&d, Vector const&e, Vector const&f){
- return LA::determinant_of_vectors(b-a,c-a,d-a,e-a,f-a);
- }
- static Sign sign_of_determinant_of_points(Vector const&a, Vector const&b,
- Vector const&c, Vector const&d, Vector const&e, Vector const&f){
- return LA::sign_of_determinant_of_vectors(b-a,c-a,d-a,e-a,f-a);
- }
-};
-
-template <class LA, class Max_dim_>
-struct Add_determinant_of_points_from_vectors_and_minus
-<LA, Dimension_tag<6>, Max_dim_, false, true> : LA {
- typedef typename LA::NT NT;
- typedef typename LA::Vector Vector;
- template< class D2, class D3=D2 >
- struct Rebind_dimension {
- typedef typename LA::template Rebind_dimension<D2,D3> LA2;
- typedef Add_determinant_of_points_from_vectors_and_minus<LA2> Other;
- };
- template<class P,class=void> struct Property : LA::template Property<P> {};
- template<class D> struct Property<Has_determinant_of_points_tag, D> :
- boost::true_type {};
-
- static NT determinant_of_points(Vector const&a, Vector const&b,
- Vector const&c, Vector const&d, Vector const&e, Vector const&f,
- Vector const&g){
- return LA::determinant_of_vectors(b-a,c-a,d-a,e-a,f-a,g-a);
- }
- static Sign sign_of_determinant_of_points(Vector const&a, Vector const&b,
- Vector const&c, Vector const&d, Vector const&e, Vector const&f,
- Vector const&g){
- return LA::sign_of_determinant_of_vectors(b-a,c-a,d-a,e-a,f-a,g-a);
- }
-};
-
-}
-#endif
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/Vector/determinant_of_vectors_small_dim.h b/include/gudhi_patches/CGAL/NewKernel_d/Vector/determinant_of_vectors_small_dim.h
deleted file mode 100644
index 64eafe69..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/Vector/determinant_of_vectors_small_dim.h
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_VECTOR_DETVEC_SMALL_H
-#define CGAL_VECTOR_DETVEC_SMALL_H
-#include <CGAL/NewKernel_d/functor_tags.h>
-#include <CGAL/Dimension.h>
-#include <CGAL/determinant_of_vectors.h>
-
-#define CGAL_ALLOWED_INCLUSION 1
-
-#define CGAL_CLASS Add_determinant_of_vectors_small_dim
-#define CGAL_TAG Has_determinant_of_vectors_tag
-#define CGAL_FUNC determinant_of_vectors
-#define CGAL_SIGN_FUNC sign_of_determinant_of_vectors
-#define CGAL_SHIFT 0
-
-#include <CGAL/NewKernel_d/Vector/determinant_of_vectors_small_dim_internal.h>
-
-#undef CGAL_CLASS
-#undef CGAL_TAG
-#undef CGAL_FUNC
-#undef CGAL_SIGN_FUNC
-#undef CGAL_SHIFT
-
-#define CGAL_CLASS Add_determinant_of_vectors_omit_last_small_dim
-#define CGAL_TAG Has_determinant_of_vectors_omit_last_tag
-#define CGAL_FUNC determinant_of_vectors_omit_last
-#define CGAL_SIGN_FUNC sign_of_determinant_of_vectors_omit_last
-#define CGAL_SHIFT 1
-
-#include <CGAL/NewKernel_d/Vector/determinant_of_vectors_small_dim_internal.h>
-
-#undef CGAL_CLASS
-#undef CGAL_TAG
-#undef CGAL_FUNC
-#undef CGAL_SIGN_FUNC
-#undef CGAL_SHIFT
-
-#undef CGAL_ALLOWED_INCLUSION
-
-#endif
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/Vector/determinant_of_vectors_small_dim_internal.h b/include/gudhi_patches/CGAL/NewKernel_d/Vector/determinant_of_vectors_small_dim_internal.h
deleted file mode 100644
index b4856742..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/Vector/determinant_of_vectors_small_dim_internal.h
+++ /dev/null
@@ -1,164 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_ALLOWED_INCLUSION
-#error Must not include this header directly
-#endif
-#if !defined(CGAL_TAG) \
- || ! defined(CGAL_CLASS) \
- || ! defined(CGAL_FUNC) \
- || ! defined(CGAL_SIGN_FUNC) \
- || ! defined(CGAL_SHIFT)
-
-#error Forgot one macro
-#endif
-
-namespace CGAL {
-
-template <class LA, class Dim_=typename LA::Dimension,
- class Max_dim_=typename LA::Max_dimension,
- bool=LA::template Property<CGAL_TAG>::value>
-struct CGAL_CLASS : LA {
- template< class D2, class D3=D2 >
- struct Rebind_dimension {
- typedef typename LA::template Rebind_dimension<D2,D3> LA2;
- typedef CGAL_CLASS<LA2> Other;
- };
-};
-
-template <class LA, class Max_dim_>
-struct CGAL_CLASS
-<LA, Dimension_tag<2+CGAL_SHIFT>, Max_dim_, false> : LA {
- typedef typename LA::NT NT;
- typedef typename LA::Vector Vector;
- template< class D2, class D3=D2 >
- struct Rebind_dimension {
- typedef typename LA::template Rebind_dimension<D2,D3> LA2;
- typedef CGAL_CLASS<LA2> Other;
- };
- template<class P,class=void> struct Property : LA::template Property<P> {};
- template<class D> struct Property<CGAL_TAG, D> :
- boost::true_type {};
-
- static NT CGAL_FUNC(Vector const&a, Vector const&b){
- return CGAL::determinant_of_vectors<NT>(a,b);
- }
- template <class V1, class V2>
- static Sign CGAL_SIGN_FUNC(V1 const&a, V2 const&b){
- return CGAL::sign_of_determinant_of_vectors<NT>(a,b);
- }
-};
-
-template <class LA, class Max_dim_>
-struct CGAL_CLASS
-<LA, Dimension_tag<3+CGAL_SHIFT>, Max_dim_, false> : LA {
- typedef typename LA::NT NT;
- typedef typename LA::Vector Vector;
- template< class D2, class D3=D2 >
- struct Rebind_dimension {
- typedef typename LA::template Rebind_dimension<D2,D3> LA2;
- typedef CGAL_CLASS<LA2> Other;
- };
- template<class P,class=void> struct Property : LA::template Property<P> {};
- template<class D> struct Property<CGAL_TAG, D> :
- boost::true_type {};
-
- static NT CGAL_FUNC(Vector const&a, Vector const&b,
- Vector const&c){
- return CGAL::determinant_of_vectors<NT>(a,b,c);
- }
- static Sign CGAL_SIGN_FUNC(Vector const&a, Vector const&b,
- Vector const&c){
- return CGAL::sign_of_determinant_of_vectors<NT>(a,b,c);
- }
-};
-
-template <class LA, class Max_dim_>
-struct CGAL_CLASS
-<LA, Dimension_tag<4+CGAL_SHIFT>, Max_dim_, false> : LA {
- typedef typename LA::NT NT;
- typedef typename LA::Vector Vector;
- template< class D2, class D3=D2 >
- struct Rebind_dimension {
- typedef typename LA::template Rebind_dimension<D2,D3> LA2;
- typedef CGAL_CLASS<LA2> Other;
- };
- template<class P,class=void> struct Property : LA::template Property<P> {};
- template<class D> struct Property<CGAL_TAG, D> :
- boost::true_type {};
-
- static NT CGAL_FUNC(Vector const&a, Vector const&b,
- Vector const&c, Vector const&d){
- return CGAL::determinant_of_vectors<NT>(a,b,c,d);
- }
- static Sign CGAL_SIGN_FUNC(Vector const&a, Vector const&b,
- Vector const&c, Vector const&d){
- return CGAL::sign_of_determinant_of_vectors<NT>(a,b,c,d);
- }
-};
-
-template <class LA, class Max_dim_>
-struct CGAL_CLASS
-<LA, Dimension_tag<5+CGAL_SHIFT>, Max_dim_, false> : LA {
- typedef typename LA::NT NT;
- typedef typename LA::Vector Vector;
- template< class D2, class D3=D2 >
- struct Rebind_dimension {
- typedef typename LA::template Rebind_dimension<D2,D3> LA2;
- typedef CGAL_CLASS<LA2> Other;
- };
- template<class P,class=void> struct Property : LA::template Property<P> {};
- template<class D> struct Property<CGAL_TAG, D> :
- boost::true_type {};
-
- static NT CGAL_FUNC(Vector const&a, Vector const&b,
- Vector const&c, Vector const&d, Vector const&e){
- return CGAL::determinant_of_vectors<NT>(a,b,c,d,e);
- }
- static Sign CGAL_SIGN_FUNC(Vector const&a, Vector const&b,
- Vector const&c, Vector const&d, Vector const&e){
- return CGAL::sign_of_determinant_of_vectors<NT>(a,b,c,d,e);
- }
-};
-
-template <class LA, class Max_dim_>
-struct CGAL_CLASS
-<LA, Dimension_tag<6+CGAL_SHIFT>, Max_dim_, false> : LA {
- typedef typename LA::NT NT;
- typedef typename LA::Vector Vector;
- template< class D2, class D3=D2 >
- struct Rebind_dimension {
- typedef typename LA::template Rebind_dimension<D2,D3> LA2;
- typedef CGAL_CLASS<LA2> Other;
- };
- template<class P,class=void> struct Property : LA::template Property<P> {};
- template<class D> struct Property<CGAL_TAG, D> :
- boost::true_type {};
-
- static NT CGAL_FUNC(Vector const&a, Vector const&b,
- Vector const&c, Vector const&d, Vector const&e, Vector const&f){
- return CGAL::determinant_of_vectors<NT>(a,b,c,d,e,f);
- }
- static Sign CGAL_SIGN_FUNC(Vector const&a, Vector const&b,
- Vector const&c, Vector const&d, Vector const&e, Vector const&f){
- return CGAL::sign_of_determinant_of_vectors<NT>(a,b,c,d,e,f);
- }
-};
-
-}
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/Vector/mix.h b/include/gudhi_patches/CGAL/NewKernel_d/Vector/mix.h
deleted file mode 100644
index d4cfeeb1..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/Vector/mix.h
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_KD_MIX_VECTOR_H
-#define CGAL_KD_MIX_VECTOR_H
-#include <CGAL/Dimension.h>
-namespace CGAL {
-
-template <class Static_, class Dynamic_, class NT_ ,class Dim_, class Max_dim_ = Dim_>
-struct Mix_vector
-: Dynamic_::template Rebind_dimension<Dim_, Max_dim_>::Other
-{
- template <class D2, class D3 = D2>
- struct Rebind_dimension {
- typedef Mix_vector<Static_, Dynamic_, NT_, D2, D3> Other;
- };
-};
-
-template <class Static_, class Dynamic_, class NT_, int d, class Max_dim_>
-struct Mix_vector<Static_, Dynamic_, NT_, Dimension_tag<d>, Max_dim_>
-: Static_::template Rebind_dimension<Dimension_tag<d>, Max_dim_>::Other
-{
- template <class D2, class D3 = D2>
- struct Rebind_dimension {
- typedef Mix_vector<Static_, Dynamic_, NT_, D2, D3> Other;
- };
-};
-}
-#endif
-
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/Vector/sse2.h b/include/gudhi_patches/CGAL/NewKernel_d/Vector/sse2.h
deleted file mode 100644
index 2a75385c..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/Vector/sse2.h
+++ /dev/null
@@ -1,145 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_VECTOR_SSE2_H
-#define CGAL_VECTOR_SSE2_H
-
-// Check what needs adapting for clang, intel and microsoft
-#if !defined __SSE2__ || (__GNUC__ * 100 + __GNUC_MINOR__ < 408)
-#error Requires SSE2 and gcc 4.8+
-#endif
-#include <x86intrin.h> // FIXME: other platforms call it differently
-
-#include <CGAL/NewKernel_d/functor_tags.h>
-#include <CGAL/Dimension.h>
-#include <CGAL/enum.h> // CGAL::Sign
-#include <CGAL/number_utils.h> // CGAL::sign
-
-
-
-namespace CGAL {
-
- struct Sse_vector_2 {
- typedef double NT;
- typedef Dimension_tag<2> Dimension;
- typedef Dimension_tag<2> Max_dimension;
- // No Rebind_dimension, this is a building block
- template<class,bool=true> struct Property : boost::false_type {};
- template<bool b> struct Property<Has_vector_plus_minus_tag,b>
- : boost::true_type {};
- /* MAYBE?
- template<bool b> struct Property<Has_vector_scalar_ops_tag,b>
- : boost::true_type {};
- */
- template<bool b> struct Property<Has_determinant_of_vectors_tag,b>
- : boost::true_type {};
- template<bool b> struct Property<Has_dot_product_tag,b>
- : boost::true_type {};
-
- typedef __m128d Vector;
- struct Construct_vector {
- struct Dimension {
- // Initialize with NaN?
- Vector operator()(unsigned d) const {
- CGAL_assertion(d==2);
- return Vector();
- }
- };
-
- struct Iterator {
- template<typename Iter>
- Vector operator()(unsigned d,Iter const& f,Iter const& e) const {
- CGAL_assertion(d==2);
- double x0 = *f;
- double x1 = *++f;
- CGAL_assertion(++f==e);
- Vector a = { x0, x1 };
- return a;
- }
- };
-
- struct Iterator_and_last {
- template<typename Iter,typename T>
- Vector operator()(unsigned d,Iter const& f,Iter const& e,double t) const {
- CGAL_assertion(d==2);
- Vector a = { *f, t };
- CGAL_assertion(++f==e);
- return a;
- }
- };
-
- struct Values {
- Vector operator()(double a,double b) const {
- Vector r = { a, b };
- return r;
- }
- };
-
- struct Values_divide {
- Vector operator()(double h,double a,double b) const {
- // {a,b}/{h,h} is probably slower
- Vector r = { a/h, b/h };
- return r;
- }
- };
- };
-
- typedef double const* Vector_const_iterator;
- static inline Vector_const_iterator vector_begin(Vector const&a){
- return (Vector_const_iterator)(&a);
- }
- static inline Vector_const_iterator vector_end(Vector const&a){
- return (Vector_const_iterator)(&a)+2;
- }
- static inline unsigned size_of_vector(Vector){
- return 2;
- }
- public:
-
- static double determinant_of_vectors(Vector a, Vector b) {
- __m128d c = _mm_shuffle_pd (b, b, 1); // b1, b0
- __m128d d = a * c; // a0*b1, a1*b0
-#ifdef __SSE3__
- __m128d e = _mm_hsub_pd (d, d);
- return e[0];
-#else
- return d[0]-d[1];
-#endif
- }
- static CGAL::Sign sign_of_determinant_of_vectors(Vector a, Vector b) {
- return CGAL::sign(determinant_of_vectors(a,b));
- }
-
- static double dot_product(Vector a,Vector b){
-#ifdef __SSE4_1__
- return _mm_dp_pd (a, b, 1+16+32)[0];
-#else
- __m128d p = a * b;
-#if defined __SSE3__
- __m128d s = _mm_hadd_pd (p, p);
- return s[0];
-#else
- return p[0]+p[1];
-#endif
-#endif
- };
- };
-
-}
-#endif
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/Vector/v2int.h b/include/gudhi_patches/CGAL/NewKernel_d/Vector/v2int.h
deleted file mode 100644
index b85a3734..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/Vector/v2int.h
+++ /dev/null
@@ -1,181 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_VECTOR_2INT_H
-#define CGAL_VECTOR_2INT_H
-
-#include <stdint.h>
-#include <cmath>
-#include <CGAL/array.h>
-#include <CGAL/Dimension.h>
-#include <CGAL/enum.h>
-#include <CGAL/number_utils.h>
-#include <CGAL/NT_converter.h>
-#include <CGAL/transforming_iterator.h>
-#include <CGAL/determinant_of_vectors.h>
-#include <CGAL/NewKernel_d/functor_tags.h>
-
-
-// What are the pros and cons of having NT be int vs double?
-
-namespace CGAL {
- struct Vector_2_int_prop1 {
- typedef double NT; // try lying a bit
- typedef int32_t NT1; // what is really stored
- typedef int32_t NT1b; // slightly longer
- typedef int_fast64_t NT2; // longer type for computations
- typedef int_fast64_t NT2b; // slightly longer
- bool check_limits(int32_t x){return std::abs(x)<(1<<30);}
- // TODO: find nice bounds
- };
-#ifdef __SIZEOF_INT128__
- struct Vector_2_int_prop2 {
- typedef double NT;
- typedef int32_t NT1;
- typedef int_fast64_t NT1b;
- typedef int_fast64_t NT2;
- typedef __int128 NT2b;
- bool check_limits(int32_t){return true;}
- // take a template/int64_t input and still check the limits?
- };
- struct Vector_2_int_prop3 {
- typedef long double NT;
- typedef int64_t NT1;
- typedef int64_t NT1b;
- typedef __int128 NT2;
- typedef __int128 NT2b;
- enum { has_limit=true };
- bool check_limits(int32_t x){return std::abs(x)<(1L<<62);}
- // TODO: find nice bounds
- };
-#endif
-
- template<class Prop=Vector_2_int_prop1>
- struct Vector_2_int : Prop {
- using typename Prop::NT;
- using typename Prop::NT1;
- using typename Prop::NT1b;
- using typename Prop::NT2;
- using typename Prop::NT2b;
- using Prop::check_limits;
-
- typedef Dimension_tag<2> Dimension;
- typedef Dimension_tag<2> Max_dimension;
- // No Rebind_dimension, this is a building block
- template<class,bool=true> struct Property : boost::false_type {};
- //template<bool b> struct Property<Has_vector_plus_minus_tag,b>
- // : boost::true_type {};
- template<bool b> struct Property<Has_determinant_of_vectors_tag,b>
- : boost::true_type {};
- //template<bool b> struct Property<Has_determinant_of_points_tag,b>
- // : boost::true_type {};
- // Advertise somehow that the sign_of_determinant* are exact?
-
- typedef cpp0x::array<NT1,2> Vector;
- struct Construct_vector {
- struct Dimension {
- Vector operator()(unsigned d) const {
- CGAL_assertion(d==2);
- return Vector();
- }
- };
-
- // TODO (for all constructors): check that input fits in NT1...
- struct Iterator {
- template<typename Iter>
- Vector operator()(unsigned d,Iter const& f,Iter const& e) const {
- CGAL_assertion(d==2);
- NT1 x0 = *f;
- NT1 x1 = *++f;
- CGAL_assertion (++f == e);
- CGAL_assertion (check_limits(x0) && check_limits(x1));
- Vector a = { x0, x1 };
- return a;
- }
- };
-
- struct Iterator_and_last {
- template<typename Iter,typename T>
- Vector operator()(unsigned d,Iter const& f,Iter const& e,double t) const {
- CGAL_assertion(d==2);
- NT1 x = *f;
- CGAL_assertion (++f == e);
- CGAL_assertion (check_limits(x) && check_limits(t));
- Vector a = { x, t };
- return a;
- }
- };
-
- struct Values {
- Vector operator()(NT1 a,NT1 b) const {
- CGAL_assertion (check_limits(a) && check_limits(b));
- Vector r = { a, b };
- return r;
- }
- };
-
- /*
- // Maybe safer not to provide it
- struct Values_divide {
- Vector operator()(double h,double a,double b) const {
- Vector r = { a/h, b/h };
- return r;
- }
- };
- */
- };
-
- // Since we lie about NT, be consistent about it
- typedef transforming_iterator<NT_converter<NT1,NT>,NT1 const*> Vector_const_iterator;
- static inline Vector_const_iterator vector_begin(Vector const&a){
- return Vector_const_iterator(a.begin());
- }
- static inline Vector_const_iterator vector_end(Vector const&a){
- return Vector_const_iterator(a.end());
- }
- static inline unsigned size_of_vector(Vector){
- return 2;
- }
-
- // for unsigned NT1, check what changes to do.
- // return NT or NT2?
- static NT determinant_of_vectors(Vector a, Vector b) {
- return CGAL::determinant_of_vectors<NT2>(a,b);
- }
- static CGAL::Sign sign_of_determinant_of_vectors(Vector a, Vector b) {
- return CGAL::sign_of_determinant_of_vectors<NT2>(a,b);
- }
-
- static NT determinant_of_points(Vector a, Vector b, Vector c) {
- // could be faster to convert to NT directly
- NT1b a0=a[0]; NT1b a1=a[1];
- NT1b x0=b[0]-a0; NT1b x1=b[1]-a1;
- NT1b y0=c[0]-a0; NT1b y1=c[1]-a1;
- return CGAL::determinant<NT>(x0,x1,y0,y1);
- }
- static CGAL::Sign sign_of_determinant_of_points(Vector a, Vector b, Vector c) {
- NT1b a0=a[0]; NT1b a1=a[1];
- NT1b x0=b[0]-a0; NT1b x1=b[1]-a1;
- NT2b y0=c[0]-a0; NT2b y1=c[1]-a1;
- return CGAL::compare(x0*y1,x1*y0);
- }
- };
-
-}
-#endif
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/Vector/vector.h b/include/gudhi_patches/CGAL/NewKernel_d/Vector/vector.h
deleted file mode 100644
index f9cc4e3c..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/Vector/vector.h
+++ /dev/null
@@ -1,167 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_VECTOR_VECTOR_H
-#define CGAL_VECTOR_VECTOR_H
-#include <boost/type_traits/is_arithmetic.hpp>
-#include <boost/utility/enable_if.hpp>
-#include <CGAL/Dimension.h>
-#include <CGAL/NewKernel_d/utils.h>
-#include <vector>
-#include <boost/preprocessor/repetition.hpp>
-#include <boost/preprocessor/repetition/enum.hpp>
-namespace CGAL {
-
-//Derive from a class that doesn't depend on Dim, or still use Dim for checking?
-template<class NT_,class Dim_,class Max_dim_=Dim_> struct Vector_vector {
- typedef NT_ NT;
- typedef Dim_ Dimension;
- typedef Max_dim_ Max_dimension;
- typedef std::vector<NT> Vector;
- template< class D2, class D3=D2 >
- struct Rebind_dimension {
- typedef Vector_vector< NT, D2, D3 > Other;
- };
- template<class> struct Property : boost::false_type {};
-
- struct Construct_vector {
- struct Dimension {
- Vector operator()(int d) const {
- return Vector(d);
- }
- };
-
- struct Iterator {
- template<typename Iter>
- Vector operator()(int CGAL_assertion_code(d),Iter const& f,Iter const& e) const {
- CGAL_assertion(d==std::distance(f,e));
- return Vector(f,e);
- }
- };
-
- // unneeded thanks to Iterator_and_last?
-#if 0
- struct Iterator_add_one {
- template<typename Iter>
- Vector operator()(int CGAL_assertion_code(d),Iter const& f,Iter const& e) const {
- CGAL_assertion(d==std::distance(f,e)+1);
- Vector a;
- a.reserve(d+1);
- a.insert(a.end(),f,e);
- a.push_back(1);
- return a;
- }
- };
-#endif
-
- struct Iterator_and_last {
- template<typename Iter,typename T>
- Vector operator()(int d,Iter const& f,Iter const& e,CGAL_FORWARDABLE(T) t) const {
- CGAL_assertion(d==std::distance(f,e)+1);
- Vector a;
- a.reserve(d+1);
- a.insert(a.end(),f,e);
- a.push_back(CGAL_FORWARD(T,t));
- return a;
- }
- };
-
- // useless, use a transform_iterator?
-#if 0
- struct Iterator_and_last_divide {
- template<typename Iter,typename T>
- Vector operator()(int d,Iter f,Iter const& e,T const&t) const {
- CGAL_assertion(d==std::distance(f,e)+1);
- Vector a;
- a.reserve(d+1);
- for(;f!=e;++f){
- a.push_back(*f/t);
- }
- return a;
- }
- };
-#endif
-
- struct Values {
-#ifdef CGAL_CXX11
- template<class...U>
- Vector operator()(U&&...u) const {
- //TODO: check the right number of {}, g++ accepts one and two
- Vector a={forward_safe<NT,U>(u)...};
- return a;
- }
-#else
-
-#define CGAL_VAR(Z,N,_) a.push_back(t##N);
-#define CGAL_CODE(Z,N,_) Vector operator()(BOOST_PP_ENUM_PARAMS(N,NT const& t)) const { \
- Vector a; \
- a.reserve(N); \
- BOOST_PP_REPEAT(N,CGAL_VAR,) \
- return a; \
-}
-BOOST_PP_REPEAT_FROM_TO(1, 11, CGAL_CODE, _ )
-#undef CGAL_CODE
-#undef CGAL_VAR
-
-#endif
- };
-
- struct Values_divide {
-#ifdef CGAL_CXX11
- template<class H,class...U>
- Vector operator()(H const&h,U&&...u) const {
- //TODO: do we want to cast at some point?
- //e.g. to avoid 1/2 in integers
- // ==> use Rational_traits<NT>().make_rational(x,y) ?
- Vector a={Rational_traits<NT>().make_rational(std::forward<U>(u),h)...};
- return a;
- }
-#else
-
-#define CGAL_VAR(Z,N,_) a.push_back(Rational_traits<NT>().make_rational( t##N ,h));
-#define CGAL_CODE(Z,N,_) template<class H> Vector \
- operator()(H const&h, BOOST_PP_ENUM_PARAMS(N,NT const& t)) const { \
- Vector a; \
- a.reserve(N); \
- BOOST_PP_REPEAT(N,CGAL_VAR,) \
- return a; \
- }
- BOOST_PP_REPEAT_FROM_TO(1, 11, CGAL_CODE, _ )
-#undef CGAL_CODE
-#undef CGAL_VAR
-
-#endif
- };
- };
- typedef typename Vector::const_iterator Vector_const_iterator;
- static Vector_const_iterator vector_begin(Vector const&a){
- return a.begin();
- }
- static Vector_const_iterator vector_end(Vector const&a){
- return a.end();
- }
- static int size_of_vector(Vector const&a){
- return (int)a.size();
- }
-};
-
-
-}
-#endif
-
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Cartesian_wrap.h b/include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Cartesian_wrap.h
deleted file mode 100644
index 44e9aa96..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Cartesian_wrap.h
+++ /dev/null
@@ -1,305 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_KERNEL_D_CARTESIAN_WRAP_H
-#define CGAL_KERNEL_D_CARTESIAN_WRAP_H
-
-#include <CGAL/basic.h>
-#include <CGAL/is_iterator.h>
-
-#if defined(BOOST_MSVC)
-# pragma warning(push)
-# pragma warning(disable:4003) // not enough actual parameters for macro 'BOOST_PP_EXPAND_I'
- // http://lists.boost.org/boost-users/2014/11/83291.php
-#endif
-#include <CGAL/NewKernel_d/Wrapper/Point_d.h>
-#include <CGAL/NewKernel_d/Wrapper/Vector_d.h>
-#include <CGAL/NewKernel_d/Wrapper/Segment_d.h>
-#include <CGAL/NewKernel_d/Wrapper/Sphere_d.h>
-#include <CGAL/NewKernel_d/Wrapper/Hyperplane_d.h>
-#include <CGAL/NewKernel_d/Wrapper/Weighted_point_d.h>
-
-#include <CGAL/NewKernel_d/Wrapper/Ref_count_obj.h>
-
-#include <boost/mpl/or.hpp>
-#include <boost/mpl/contains.hpp>
-#include <boost/mpl/vector.hpp>
-
-//TODO: do we want to store the kernel ref in the Object wrappers? It would allow for additions and operator[] and things like that to work, but objects would still need to be created by functors.
-
-namespace CGAL {
-namespace internal {
-BOOST_MPL_HAS_XXX_TRAIT_DEF(Is_wrapper)
-template<class T,bool=has_Is_wrapper<T>::value> struct Is_wrapper {
- enum { value=false };
- typedef Tag_false type;
-};
-template<class T> struct Is_wrapper<T,true> {
- typedef typename T::Is_wrapper type;
- enum { value=type::value };
-};
-
-template<class T,bool=is_iterator_type<T,std::input_iterator_tag>::value> struct Is_wrapper_iterator {
- enum { value=false };
- typedef Tag_false type;
-};
-template<class T> struct Is_wrapper_iterator<T,true> :
- Is_wrapper<typename std::iterator_traits<typename CGAL::decay<T>::type>::value_type>
-{ };
-
-struct Forward_rep {
-//TODO: make a good C++0X version with perfect forwarding
-//#ifdef CGAL_CXX11
-//template <class T,class=typename std::enable_if<!Is_wrapper<typename std::decay<T>::type>::value&&!Is_wrapper_iterator<typename std::decay<T>::type>::value>::type>
-//T&& operator()(typename std::remove_reference<T>::type&& t) const {return static_cast<T&&>(t);};
-//template <class T,class=typename std::enable_if<!Is_wrapper<typename std::decay<T>::type>::value&&!Is_wrapper_iterator<typename std::decay<T>::type>::value>::type>
-//T&& operator()(typename std::remove_reference<T>::type& t) const {return static_cast<T&&>(t);};
-//
-//template <class T,class=typename std::enable_if<Is_wrapper<typename std::decay<T>::type>::value>::type>
-//typename Type_copy_cvref<T,typename std::decay<T>::type::Rep>::type&&
-//operator()(T&& t) const {
-// return static_cast<typename Type_copy_cvref<T,typename std::decay<T>::type::Rep>::type&&>(t.rep());
-//};
-//
-//template <class T,class=typename std::enable_if<Is_wrapper_iterator<typename std::decay<T>::type>::value>::type>
-//transforming_iterator<Forward_rep,typename std::decay<T>::type>
-//operator()(T&& t) const {
-// return make_transforming_iterator(std::forward<T>(t),Forward_rep());
-//};
-//#else
-template <class T,bool=Is_wrapper<T>::value,bool=Is_wrapper_iterator<T>::value> struct result_;
-template <class T> struct result_<T,false,false>{typedef T const& type;};
-template <class T> struct result_<T,true,false>{typedef typename decay<T>::type::Rep const& type;};
-template <class T> struct result_<T,false,true>{typedef transforming_iterator<Forward_rep,typename decay<T>::type> type;};
-template<class> struct result;
-template<class T> struct result<Forward_rep(T)> : result_<T> {};
-
-template <class T> typename boost::disable_if<boost::mpl::or_<Is_wrapper<T>,Is_wrapper_iterator<T> >,T>::type const& operator()(T const& t) const {return t;}
-template <class T> typename boost::disable_if<boost::mpl::or_<Is_wrapper<T>,Is_wrapper_iterator<T> >,T>::type& operator()(T& t) const {return t;}
-
-template <class T> typename T::Rep const& operator()(T const& t, typename boost::enable_if<Is_wrapper<T> >::type* = 0) const {return t.rep();}
-
-template <class T> transforming_iterator<Forward_rep,typename boost::enable_if<Is_wrapper_iterator<T>,T>::type> operator()(T const& t) const {return make_transforming_iterator(t,Forward_rep());}
-//#endif
-};
-}
-
-template <class B, class K, class T, bool = Provides_type<B, T>::value>
-struct Map_wrapping_type : Get_type<B, T> {};
-#define CGAL_REGISTER_OBJECT_WRAPPER(X) \
- template <class B, class K> \
- struct Map_wrapping_type <B, K, X##_tag, true> { \
- typedef Wrap::X##_d<K> type; \
- }
-CGAL_REGISTER_OBJECT_WRAPPER(Point);
-CGAL_REGISTER_OBJECT_WRAPPER(Vector);
-CGAL_REGISTER_OBJECT_WRAPPER(Segment);
-CGAL_REGISTER_OBJECT_WRAPPER(Sphere);
-CGAL_REGISTER_OBJECT_WRAPPER(Hyperplane);
-CGAL_REGISTER_OBJECT_WRAPPER(Weighted_point);
-#undef CGAL_REGISTER_OBJECT_WRAPPER
-
-// Note: this tends to be an all or nothing thing currently, wrapping
-// only some types breaks, probably because we don't check whether the
-// return type is indeed wrapped.
-template < typename Base_ , typename Derived_ = Default >
-struct Cartesian_wrap : public Base_
-{
- CGAL_CONSTEXPR Cartesian_wrap(){}
- CGAL_CONSTEXPR Cartesian_wrap(int d):Base_(d){}
- typedef Base_ Kernel_base;
- typedef Cartesian_wrap Self;
- // TODO: pass the 2 types Self and Derived to the wrappers, they can use Self for most purposes and Derived only for Kernel_traits' typedef R.
- typedef typename Default::Get<Derived_, Self>::type Derived;
- // FIXME: The list doesn't belong here.
- typedef boost::mpl::vector<Point_tag,Segment_tag,Sphere_tag,Vector_tag,Hyperplane_tag> Wrapped_list;
-
- template <class T>
- struct Type : Map_wrapping_type<Base_, Derived, T> {};
-
- //Translate the arguments
- template <class T, class D = void,
- class=typename Get_functor_category<Derived,T>::type,
- bool=Provides_functor<Kernel_base, T>::value,
- bool=boost::mpl::contains<Wrapped_list,typename map_result_tag<T>::type>::type::value>
- struct Functor {
- typedef typename Get_functor<Kernel_base, T>::type B;
- struct type {
- B b;
- type(){}
- type(Self const&k):b(k){}
- typedef typename B::result_type result_type;
-#ifdef CGAL_CXX11
- template<class...U> result_type operator()(U&&...u)const{
- return b(internal::Forward_rep()(u)...);
- }
-#else
-#define CGAL_VAR(Z,N,_) internal::Forward_rep()(u##N)
-#define CGAL_CODE(Z,N,_) template<BOOST_PP_ENUM_PARAMS(N,class U)> result_type \
- operator()(BOOST_PP_ENUM_BINARY_PARAMS(N,U,const&u))const{ \
- return b(BOOST_PP_ENUM(N,CGAL_VAR,)); \
- }
- BOOST_PP_REPEAT_FROM_TO(1,11,CGAL_CODE,_)
-#undef CGAL_CODE
-#undef CGAL_VAR
-// In case the last argument needs to be non-const. Fragile...
-#define CGAL_VAR(Z,N,_) internal::Forward_rep()(u##N)
-#define CGAL_CODE(Z,N,_) template<BOOST_PP_ENUM_PARAMS(N,class U),class V> result_type \
- operator()(BOOST_PP_ENUM_BINARY_PARAMS(N,U,const&u),V&v)const{ \
- return b(BOOST_PP_ENUM(N,CGAL_VAR,),internal::Forward_rep()(v)); \
- }
- BOOST_PP_REPEAT_FROM_TO(1,8,CGAL_CODE,_)
-#undef CGAL_CODE
-#undef CGAL_VAR
-#endif
- };
- };
-
- // Preserve the difference between Null_functor and nothing.
- template <class T, class D, class C, bool b>
- struct Functor <T, D, C, false, b>
- : Get_functor <Kernel_base, T> {};
-
- //Translate both the arguments and the result
- //TODO: Check Is_wrapper instead of relying on map_result_tag?
- template<class T,class D> struct Functor<T,D,Construct_tag,true,true> {
- typedef typename Get_functor<Kernel_base, T>::type B;
- struct type {
- B b;
- type(){}
- type(Self const&k):b(k){}
- typedef typename map_result_tag<T>::type result_tag;
- // FIXME: Self or Derived?
- typedef typename Get_type<Self,result_tag>::type result_type;
-#ifdef CGAL_CXX11
- template<class...U> result_type operator()(U&&...u)const{
- return result_type(Eval_functor(),b,internal::Forward_rep()(u)...);
- }
-#else
-#define CGAL_VAR(Z,N,_) internal::Forward_rep()(u##N)
-#define CGAL_CODE(Z,N,_) template<BOOST_PP_ENUM_PARAMS(N,class U)> result_type \
- operator()(BOOST_PP_ENUM_BINARY_PARAMS(N,U,const&u))const{ \
- return result_type(Eval_functor(),b,BOOST_PP_ENUM(N,CGAL_VAR,)); \
- }
- BOOST_PP_REPEAT_FROM_TO(1,11,CGAL_CODE,_)
-#undef CGAL_CODE
-#undef CGAL_VAR
-#endif
- };
- };
-
-};
-
-template < typename Base_ >
-struct Cartesian_refcount : public Base_
-{
- CGAL_CONSTEXPR Cartesian_refcount(){}
- CGAL_CONSTEXPR Cartesian_refcount(int d):Base_(d){}
- typedef Base_ Kernel_base;
- typedef Cartesian_refcount Self;
-
- // FIXME: Use object_list, or a list passed as argument, or anything
- // automatic.
- template <class T, class=void> struct Type : Get_type<Base_, T> {};
-#define CGAL_Kernel_obj(X,Y) \
- template <class D> struct Type<X##_tag, D> { typedef Ref_count_obj<Cartesian_refcount, X##_tag> type; };
-
- CGAL_Kernel_obj(Point,point)
- CGAL_Kernel_obj(Vector,vector)
-#undef CGAL_Kernel_obj
-
- template<class T> struct Dispatch {
- //typedef typename map_functor_type<T>::type f_t;
- typedef typename map_result_tag<T>::type r_t;
- enum {
- is_nul = boost::is_same<typename Get_functor<Kernel_base, T>::type,Null_functor>::value,
- ret_rcobj = boost::is_same<r_t,Point_tag>::value || boost::is_same<r_t,Vector_tag>::value
- };
- };
-
- //Translate the arguments
- template<class T,class D=void,bool=Dispatch<T>::is_nul,bool=Dispatch<T>::ret_rcobj> struct Functor {
- typedef typename Get_functor<Kernel_base, T>::type B;
- struct type {
- B b;
- type(){}
- type(Self const&k):b(k){}
- typedef typename B::result_type result_type;
-#ifdef CGAL_CXX11
- template<class...U> result_type operator()(U&&...u)const{
- return b(internal::Forward_rep()(u)...);
- }
-#else
- result_type operator()()const{
- return b();
- }
-#define CGAL_VAR(Z,N,_) internal::Forward_rep()(u##N)
-#define CGAL_CODE(Z,N,_) template<BOOST_PP_ENUM_PARAMS(N,class U)> result_type \
- operator()(BOOST_PP_ENUM_BINARY_PARAMS(N,U,const&u))const{ \
- return b(BOOST_PP_ENUM(N,CGAL_VAR,)); \
- }
- BOOST_PP_REPEAT_FROM_TO(1,11,CGAL_CODE,_)
-#undef CGAL_CODE
-#undef CGAL_VAR
-#endif
- };
- };
-
- //Translate both the arguments and the result
- template<class T,class D,bool b> struct Functor<T,D,true,b> {
- typedef Null_functor type;
- };
-
- template<class T,class D> struct Functor<T,D,false,true> {
- typedef typename Get_functor<Kernel_base, T>::type B;
- struct type {
- B b;
- type(){}
- type(Self const&k):b(k){}
- typedef typename map_result_tag<T>::type result_tag;
- typedef typename Get_type<Self,result_tag>::type result_type;
-#ifdef CGAL_CXX11
- template<class...U> result_type operator()(U&&...u)const{
- return result_type(Eval_functor(),b,internal::Forward_rep()(u)...);
- }
-#else
- result_type operator()()const{
- return result_type(Eval_functor(),b);
- }
-#define CGAL_VAR(Z,N,_) internal::Forward_rep()(u##N)
-#define CGAL_CODE(Z,N,_) template<BOOST_PP_ENUM_PARAMS(N,class U)> result_type \
- operator()(BOOST_PP_ENUM_BINARY_PARAMS(N,U,const&u))const{ \
- return result_type(Eval_functor(),b,BOOST_PP_ENUM(N,CGAL_VAR,)); \
- }
- BOOST_PP_REPEAT_FROM_TO(1,11,CGAL_CODE,_)
-#undef CGAL_CODE
-#undef CGAL_VAR
-#endif
- };
- };
-
-};
-
-} //namespace CGAL
-
-#if defined(BOOST_MSVC)
-# pragma warning(pop)
-#endif
-
-#endif // CGAL_KERNEL_D_CARTESIAN_WRAP_H
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Hyperplane_d.h b/include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Hyperplane_d.h
deleted file mode 100644
index 54fd50bd..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Hyperplane_d.h
+++ /dev/null
@@ -1,131 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_WRAPPER_HYPERPLANE_D_H
-#define CGAL_WRAPPER_HYPERPLANE_D_H
-
-#include <CGAL/representation_tags.h>
-#include <CGAL/assertions.h>
-#include <boost/type_traits.hpp>
-#include <CGAL/Kernel/Return_base_tag.h>
-#include <CGAL/Dimension.h>
-#ifndef CGAL_CXX11
-#include <boost/preprocessor/repetition.hpp>
-#endif
-#include <boost/utility/result_of.hpp>
-
-namespace CGAL {
-namespace Wrap {
-
-template <class R_>
-class Hyperplane_d : public Get_type<typename R_::Kernel_base, Hyperplane_tag>::type
-{
- typedef typename Get_type<R_, FT_tag>::type FT_;
- typedef typename R_::Kernel_base Kbase;
- typedef typename Get_type<R_, Vector_tag>::type Vector_;
- typedef typename Get_functor<Kbase, Construct_ttag<Hyperplane_tag> >::type CHBase;
- typedef typename Get_functor<Kbase, Orthogonal_vector_tag>::type OVBase;
- typedef typename Get_functor<Kbase, Hyperplane_translation_tag>::type HTBase;
-
- typedef Hyperplane_d Self;
- CGAL_static_assertion((boost::is_same<Self, typename Get_type<R_, Hyperplane_tag>::type>::value));
-
-public:
-
- typedef Tag_true Is_wrapper;
- typedef typename R_::Default_ambient_dimension Ambient_dimension;
- typedef typename Increment_dimension<Ambient_dimension,-1>::type Feature_dimension;
-
- typedef typename Get_type<Kbase, Hyperplane_tag>::type Rep;
-
- const Rep& rep() const
- {
- return *this;
- }
-
- Rep& rep()
- {
- return *this;
- }
-
- typedef R_ R;
-
-#ifdef CGAL_CXX11
- template<class...U,class=typename std::enable_if<!std::is_same<std::tuple<typename std::decay<U>::type...>,std::tuple<Hyperplane_d> >::value>::type> explicit Hyperplane_d(U&&...u)
- : Rep(CHBase()(std::forward<U>(u)...)){}
-
-// // called from Construct_point_d
-// template<class...U> explicit Point_d(Eval_functor&&,U&&...u)
-// : Rep(Eval_functor(), std::forward<U>(u)...){}
- template<class F,class...U> explicit Hyperplane_d(Eval_functor&&,F&&f,U&&...u)
- : Rep(std::forward<F>(f)(std::forward<U>(u)...)){}
-
-#if 0
- // the new standard may make this necessary
- Point_d(Point_d const&)=default;
- Point_d(Point_d &);//=default;
- Point_d(Point_d &&)=default;
-#endif
-
- // try not to use these
- Hyperplane_d(Rep const& v) : Rep(v) {}
- Hyperplane_d(Rep& v) : Rep(static_cast<Rep const&>(v)) {}
- Hyperplane_d(Rep&& v) : Rep(std::move(v)) {}
-
-#else
-
- Hyperplane_d() : Rep(CHBase()()) {}
-
- Hyperplane_d(Rep const& v) : Rep(v) {} // try not to use it
-
-#define CGAL_CODE(Z,N,_) template<BOOST_PP_ENUM_PARAMS(N,class T)> \
- explicit Hyperplane_d(BOOST_PP_ENUM_BINARY_PARAMS(N,T,const&t)) \
- : Rep(CHBase()( \
- BOOST_PP_ENUM_PARAMS(N,t))) {} \
- \
- template<class F,BOOST_PP_ENUM_PARAMS(N,class T)> \
- Hyperplane_d(Eval_functor,F const& f,BOOST_PP_ENUM_BINARY_PARAMS(N,T,const&t)) \
- : Rep(f(BOOST_PP_ENUM_PARAMS(N,t))) {}
- /*
- template<BOOST_PP_ENUM_PARAMS(N,class T)> \
- Point_d(Eval_functor,BOOST_PP_ENUM_BINARY_PARAMS(N,T,const&t)) \
- : Rep(Eval_functor(), BOOST_PP_ENUM_PARAMS(N,t)) {}
- */
-
- BOOST_PP_REPEAT_FROM_TO(1,11,CGAL_CODE,_)
-#undef CGAL_CODE
-
-#endif
-
- //TODO: if OVBase returns a reference to a base vector, cast it to a
- //reference to a wrapper vector. Ugly but should be safe.
- Vector_ orthogonal_vector()const{
- return Vector_(Eval_functor(),OVBase(),rep());
- }
- FT_ translation()const{
- return HTBase()(rep());
- }
-
-
-};
-
-} //namespace Wrap
-} //namespace CGAL
-
-#endif // CGAL_WRAPPER_SPHERE_D_H
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Point_d.h b/include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Point_d.h
deleted file mode 100644
index 0718c947..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Point_d.h
+++ /dev/null
@@ -1,284 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_WRAPPER_POINT_D_H
-#define CGAL_WRAPPER_POINT_D_H
-
-#include <ostream>
-#include <CGAL/Origin.h>
-#include <CGAL/Kernel/mpl.h>
-#include <CGAL/representation_tags.h>
-#include <CGAL/assertions.h>
-#include <boost/type_traits.hpp>
-#include <CGAL/Kernel/Return_base_tag.h>
-#include <CGAL/Dimension.h>
-#ifndef CGAL_CXX11
-#include <boost/preprocessor/repetition.hpp>
-#endif
-#include <boost/utility/result_of.hpp>
-
-namespace CGAL {
-namespace Wrap {
-
-template <class R_>
-class Point_d : public Get_type<typename R_::Kernel_base, Point_tag>::type
- // Deriving won't work if the point is just a __m256d.
- // Test boost/std::is_class for instance
-{
- typedef typename Get_type<R_, RT_tag>::type RT_;
- typedef typename Get_type<R_, FT_tag>::type FT_;
- typedef typename R_::Kernel_base Kbase;
- typedef typename Get_type<R_, Vector_tag>::type Vector_;
- typedef typename Get_functor<Kbase, Construct_ttag<Point_tag> >::type CPBase;
- typedef typename Get_functor<Kbase, Compute_point_cartesian_coordinate_tag>::type CCBase;
- typedef typename Get_functor<Kbase, Construct_ttag<Point_cartesian_const_iterator_tag> >::type CPI;
-
-
- typedef Point_d Self;
- CGAL_static_assertion((boost::is_same<Self, typename Get_type<R_, Point_tag>::type>::value));
-
-public:
-
- typedef Tag_true Is_wrapper;
- typedef typename R_::Default_ambient_dimension Ambient_dimension;
- typedef Dimension_tag<0> Feature_dimension;
-
- typedef typename Get_type<Kbase, Point_tag>::type Rep;
- //typedef typename CGAL::decay<typename boost::result_of<CPI(Rep,Begin_tag)>::type>::type Cartesian_const_iterator;
-
- const Rep& rep() const
- {
- return *this;
- }
-
- Rep& rep()
- {
- return *this;
- }
-
- typedef R_ R;
-
-#ifdef CGAL_CXX11
- template<class...U,class=typename std::enable_if<!std::is_same<std::tuple<typename std::decay<U>::type...>,std::tuple<Point_d> >::value>::type> explicit Point_d(U&&...u)
- : Rep(CPBase()(std::forward<U>(u)...)){}
-
-// // called from Construct_point_d
-// template<class...U> explicit Point_d(Eval_functor&&,U&&...u)
-// : Rep(Eval_functor(), std::forward<U>(u)...){}
- template<class F,class...U> explicit Point_d(Eval_functor&&,F&&f,U&&...u)
- : Rep(std::forward<F>(f)(std::forward<U>(u)...)){}
-
-#if 0
- // the new standard may make this necessary
- Point_d(Point_d const&)=default;
- Point_d(Point_d &);//=default;
- Point_d(Point_d &&)=default;
-#endif
-
- // try not to use these
- Point_d(Rep const& v) : Rep(v) {}
- Point_d(Rep& v) : Rep(static_cast<Rep const&>(v)) {}
- Point_d(Rep&& v) : Rep(std::move(v)) {}
-
- // this one should be implicit
- Point_d(Origin const& v)
- : Rep(CPBase()(v)) {}
- Point_d(Origin& v)
- : Rep(CPBase()(v)) {}
- Point_d(Origin&& v)
- : Rep(CPBase()(std::move(v))) {}
-
-#else
-
- Point_d() : Rep(CPBase()()) {}
-
- Point_d(Rep const& v) : Rep(v) {} // try not to use it
-
-#define CGAL_CODE(Z,N,_) template<BOOST_PP_ENUM_PARAMS(N,class T)> \
- explicit Point_d(BOOST_PP_ENUM_BINARY_PARAMS(N,T,const&t)) \
- : Rep(CPBase()( \
- BOOST_PP_ENUM_PARAMS(N,t))) {} \
- \
- template<class F,BOOST_PP_ENUM_PARAMS(N,class T)> \
- Point_d(Eval_functor,F const& f,BOOST_PP_ENUM_BINARY_PARAMS(N,T,const&t)) \
- : Rep(f(BOOST_PP_ENUM_PARAMS(N,t))) {}
- /*
- template<BOOST_PP_ENUM_PARAMS(N,class T)> \
- Point_d(Eval_functor,BOOST_PP_ENUM_BINARY_PARAMS(N,T,const&t)) \
- : Rep(Eval_functor(), BOOST_PP_ENUM_PARAMS(N,t)) {}
- */
-
- BOOST_PP_REPEAT_FROM_TO(1,11,CGAL_CODE,_)
-#undef CGAL_CODE
-
- // this one should be implicit
- Point_d(Origin const& o)
- : Rep(CPBase()(o)) {}
-
-#endif
-
- typename boost::result_of<CCBase(Rep,int)>::type cartesian(int i)const{
- return CCBase()(rep(),i);
- }
- typename boost::result_of<CCBase(Rep,int)>::type operator[](int i)const{
- return CCBase()(rep(),i);
- }
-
- typename boost::result_of<CPI(Rep,Begin_tag)>::type cartesian_begin()const{
- return CPI()(rep(),Begin_tag());
- }
-
- typename boost::result_of<CPI(Rep,End_tag)>::type cartesian_end()const{
- return CPI()(rep(),End_tag());
- }
-
- int dimension() const {
- typedef typename Get_functor<Kbase, Point_dimension_tag>::type PDBase;
- return PDBase()(rep());
- }
-
- /*
- Direction_d direction() const
- {
- return R().construct_direction_d_object()(*this);
- }
-
- Vector_d transform(const Aff_transformation_d &t) const
- {
- return t.transform(*this);
- }
-
- Vector_d operator/(const RT& c) const
- {
- return R().construct_divided_vector_d_object()(*this,c);
- }
-
- Vector_d operator/(const typename First_if_different<FT_,RT>::Type & c) const
- {
- return R().construct_divided_vector_d_object()(*this,c);
- }
-
- typename Qualified_result_of<typename R::Compute_x_3, Vector_3>::type
- x() const
- {
- return R().compute_x_3_object()(*this);
- }
-
- typename Qualified_result_of<typename R::Compute_y_3, Vector_3>::type
- y() const
- {
- return R().compute_y_3_object()(*this);
- }
-
- typename Qualified_result_of<typename R::Compute_z_3, Vector_3>::type
- z() const
- {
- return R().compute_z_3_object()(*this);
- }
-
- typename Qualified_result_of<typename R::Compute_hx_3, Vector_3>::type
- hx() const
- {
- return R().compute_hx_3_object()(*this);
- }
-
- typename Qualified_result_of<typename R::Compute_hy_3, Vector_3>::type
- hy() const
- {
- return R().compute_hy_3_object()(*this);
- }
-
- typename Qualified_result_of<typename R::Compute_hz_3, Vector_3>::type
- hz() const
- {
- return R().compute_hz_3_object()(*this);
- }
-
- typename Qualified_result_of<typename R::Compute_hw_3, Vector_3>::type
- hw() const
- {
- return R().compute_hw_3_object()(*this);
- }
-
- typename Qualified_result_of<typename R::Compute_x_3, Vector_3>::type
- cartesian(int i) const
- {
- CGAL_kernel_precondition( (i == 0) || (i == 1) || (i == 2) );
- if (i==0) return x();
- if (i==1) return y();
- return z();
- }
-
- typename Qualified_result_of<typename R::Compute_hw_3, Vector_3>::type
- homogeneous(int i) const
- {
- CGAL_kernel_precondition( (i >= 0) || (i <= 3) );
- if (i==0) return hx();
- if (i==1) return hy();
- if (i==2) return hz();
- return hw();
- }
-
- typename Qualified_result_of<typename R::Compute_squared_length_3, Vector_3>::type
- squared_length() const
- {
- return R().compute_squared_length_3_object()(*this);
- }
-*/
-};
-#if 0
-template <class R_> Point_d<R_>::Point_d(Point_d &)=default;
-#endif
-
-//TODO: IO
-
-template <class R_>
-std::ostream& operator <<(std::ostream& os, const Point_d<R_>& p)
-{
- typedef typename R_::Kernel_base Kbase;
- typedef typename Get_functor<Kbase, Construct_ttag<Point_cartesian_const_iterator_tag> >::type CPI;
- // Should just be "auto"...
- typename CGAL::decay<typename boost::result_of<
- CPI(typename Point_d<R_>::Rep,Begin_tag)
- >::type>::type
- b = p.cartesian_begin(),
- e = p.cartesian_end();
- os << p.dimension();
- for(; b != e; ++b){
- os << " " << *b;
- }
- return os;
-}
-
-//template <class R_>
-//Vector_d<R_> operator+(const Vector_d<R_>& v,const Vector_d<R_>& w) const
-//{
-// return typename R::template Construct<Sum_of_vectors_tag>::type()(v,w);
-//}
-//
-//template <class R_>
-//Vector_d<R_> operator-(const Vector_d<R_>& v,const Vector_d<R_>& w) const
-//{
-// return typename R::template Construct<Difference_of_vectors_tag>::type()(v,w);
-//}
-
-} //namespace Wrap
-} //namespace CGAL
-
-#endif // CGAL_WRAPPER_POINT_D_H
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Ref_count_obj.h b/include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Ref_count_obj.h
deleted file mode 100644
index f33e14c0..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Ref_count_obj.h
+++ /dev/null
@@ -1,120 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_WRAPPER_REF_COUNT_OBJ_H
-#define CGAL_WRAPPER_REF_COUNT_OBJ_H
-
-#include <CGAL/Origin.h>
-#include <CGAL/Handle_for.h>
-#include <CGAL/Kernel/mpl.h>
-#include <CGAL/representation_tags.h>
-#include <CGAL/assertions.h>
-#include <boost/type_traits.hpp>
-#include <CGAL/Kernel/Return_base_tag.h>
-#include <CGAL/Dimension.h>
-#ifndef CGAL_CXX11
-#include <boost/preprocessor/repetition.hpp>
-#endif
-#include <boost/utility/result_of.hpp>
-
-// no need for a fancy interface here, people can use the Point_d wrapper on
-// top.
-
-namespace CGAL {
-
-template <class R_, class Tag_>
-class Ref_count_obj
-{
- typedef typename R_::Kernel_base Kbase;
- typedef typename Get_functor<Kbase, Construct_ttag<Tag_> >::type CBase;
-
- typedef Ref_count_obj Self;
- CGAL_static_assertion((boost::is_same<Self, typename Get_type<R_, Tag_>::type>::value));
-
-public:
- typedef R_ R;
-
- typedef Tag_true Is_wrapper;
- typedef typename R_::Default_ambient_dimension Ambient_dimension;
- //typedef Dimension_tag<0> Feature_dimension;
-
- typedef typename Get_type<Kbase, Tag_>::type Rep;
- typedef Handle_for<Rep> Data;
-
-private:
- Data data;
-public:
-
- const Rep& rep() const
- {
- return CGAL::get_pointee_or_identity(data);
- }
-
-#ifdef CGAL_CXX11
- template<class...U,class=typename std::enable_if<!std::is_same<std::tuple<typename std::decay<U>::type...>,std::tuple<Ref_count_obj> >::value>::type> explicit Ref_count_obj(U&&...u)
- : data(Eval_functor(),CBase(),std::forward<U>(u)...){}
-
- template<class F,class...U> explicit Ref_count_obj(Eval_functor&&,F&&f,U&&...u)
- : data(Eval_functor(),std::forward<F>(f),std::forward<U>(u)...){}
-
- // try not to use these
- Ref_count_obj(Rep const& v) : data(v) {}
- Ref_count_obj(Rep& v) : data(static_cast<Rep const&>(v)) {}
- Ref_count_obj(Rep&& v) : data(std::move(v)) {}
-
- // Do we really need this for point?
-// // this one should be implicit
-// Ref_count_obj(Origin const& v)
-// : data(Eval_functor(),CBase(),v) {}
-// Ref_count_obj(Origin& v)
-// : data(Eval_functor(),CBase(),v) {}
-// Ref_count_obj(Origin&& v)
-// : data(Eval_functor(),CBase(),std::move(v)) {}
-
-#else
-
- Ref_count_obj() : data(Eval_functor(),CBase()) {}
-
- Ref_count_obj(Rep const& v) : data(v) {} // try not to use it
-
-#define CGAL_CODE(Z,N,_) template<BOOST_PP_ENUM_PARAMS(N,class T)> \
- explicit Ref_count_obj(BOOST_PP_ENUM_BINARY_PARAMS(N,T,const&t)) \
- : data(Eval_functor(),CBase(),BOOST_PP_ENUM_PARAMS(N,t)) {} \
- \
- template<class F,BOOST_PP_ENUM_PARAMS(N,class T)> \
- Ref_count_obj(Eval_functor,F const& f,BOOST_PP_ENUM_BINARY_PARAMS(N,T,const&t)) \
- : data(Eval_functor(),f,BOOST_PP_ENUM_PARAMS(N,t)) {}
-
- BOOST_PP_REPEAT_FROM_TO(1,11,CGAL_CODE,_)
-#undef CGAL_CODE
- template<class F>
- Ref_count_obj(Eval_functor,F const& f)
- : data(Eval_functor(),f) {}
-
-// // this one should be implicit
-// Ref_count_obj(Origin const& o)
-// : data(Eval_functor(),CBase(),o) {}
-
-#endif
-
-};
-
-} //namespace CGAL
-
-#endif
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Segment_d.h b/include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Segment_d.h
deleted file mode 100644
index bfb20a77..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Segment_d.h
+++ /dev/null
@@ -1,133 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_WRAPPER_SEGMENT_D_H
-#define CGAL_WRAPPER_SEGMENT_D_H
-
-#include <CGAL/Origin.h>
-#include <CGAL/Kernel/mpl.h>
-#include <CGAL/representation_tags.h>
-#include <CGAL/assertions.h>
-#include <boost/type_traits.hpp>
-#include <CGAL/Kernel/Return_base_tag.h>
-#include <CGAL/Dimension.h>
-#ifndef CGAL_CXX11
-#include <boost/preprocessor/repetition.hpp>
-#endif
-#include <boost/utility/result_of.hpp>
-
-namespace CGAL {
-namespace Wrap {
-
-template <class R_>
-class Segment_d : public Get_type<typename R_::Kernel_base, Segment_tag>::type
-{
- typedef typename Get_type<R_, RT_tag>::type RT_;
- typedef typename Get_type<R_, FT_tag>::type FT_;
- typedef typename R_::Kernel_base Kbase;
- typedef typename Get_type<R_, Point_tag>::type Point_;
- typedef typename Get_functor<Kbase, Construct_ttag<Point_tag> >::type CPBase;
- typedef typename Get_functor<Kbase, Construct_ttag<Segment_tag> >::type CSBase;
- typedef typename Get_functor<Kbase, Segment_extremity_tag>::type CSEBase;
-
- typedef Segment_d Self;
- CGAL_static_assertion((boost::is_same<Self, typename Get_type<R_, Segment_tag>::type>::value));
-
-public:
-
- typedef Tag_true Is_wrapper;
- typedef typename R_::Default_ambient_dimension Ambient_dimension;
- typedef Dimension_tag<1> Feature_dimension;
-
- typedef typename Get_type<Kbase, Segment_tag>::type Rep;
-
- const Rep& rep() const
- {
- return *this;
- }
-
- Rep& rep()
- {
- return *this;
- }
-
- typedef R_ R;
-
-#ifdef CGAL_CXX11
- template<class...U,class=typename std::enable_if<!std::is_same<std::tuple<typename std::decay<U>::type...>,std::tuple<Segment_d> >::value>::type> explicit Segment_d(U&&...u)
- : Rep(CSBase()(std::forward<U>(u)...)){}
-
-// // called from Construct_point_d
-// template<class...U> explicit Point_d(Eval_functor&&,U&&...u)
-// : Rep(Eval_functor(), std::forward<U>(u)...){}
- template<class F,class...U> explicit Segment_d(Eval_functor&&,F&&f,U&&...u)
- : Rep(std::forward<F>(f)(std::forward<U>(u)...)){}
-
-#if 0
- // the new standard may make this necessary
- Point_d(Point_d const&)=default;
- Point_d(Point_d &);//=default;
- Point_d(Point_d &&)=default;
-#endif
-
- // try not to use these
- Segment_d(Rep const& v) : Rep(v) {}
- Segment_d(Rep& v) : Rep(static_cast<Rep const&>(v)) {}
- Segment_d(Rep&& v) : Rep(std::move(v)) {}
-
-#else
-
- Segment_d() : Rep(CSBase()()) {}
-
- Segment_d(Rep const& v) : Rep(v) {} // try not to use it
-
-#define CGAL_CODE(Z,N,_) template<BOOST_PP_ENUM_PARAMS(N,class T)> \
- explicit Segment_d(BOOST_PP_ENUM_BINARY_PARAMS(N,T,const&t)) \
- : Rep(CSBase()( \
- BOOST_PP_ENUM_PARAMS(N,t))) {} \
- \
- template<class F,BOOST_PP_ENUM_PARAMS(N,class T)> \
- Segment_d(Eval_functor,F const& f,BOOST_PP_ENUM_BINARY_PARAMS(N,T,const&t)) \
- : Rep(f(BOOST_PP_ENUM_PARAMS(N,t))) {}
- /*
- template<BOOST_PP_ENUM_PARAMS(N,class T)> \
- Point_d(Eval_functor,BOOST_PP_ENUM_BINARY_PARAMS(N,T,const&t)) \
- : Rep(Eval_functor(), BOOST_PP_ENUM_PARAMS(N,t)) {}
- */
-
- BOOST_PP_REPEAT_FROM_TO(1,11,CGAL_CODE,_)
-#undef CGAL_CODE
-
-#endif
-
- //TODO: if CSEBase returns a reference to a base point, cast it to a
- //reference to a wrapper point. Ugly but should be safe.
- Point_ source()const{
- return Point_(Eval_functor(),CSEBase(),rep(),0);
- }
- Point_ target()const{
- return Point_(Eval_functor(),CSEBase(),rep(),1);
- }
-
-};
-
-} //namespace Wrap
-} //namespace CGAL
-
-#endif // CGAL_WRAPPER_SEGMENT_D_H
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Sphere_d.h b/include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Sphere_d.h
deleted file mode 100644
index 87f0c66e..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Sphere_d.h
+++ /dev/null
@@ -1,130 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_WRAPPER_SPHERE_D_H
-#define CGAL_WRAPPER_SPHERE_D_H
-
-#include <CGAL/representation_tags.h>
-#include <CGAL/assertions.h>
-#include <boost/type_traits.hpp>
-#include <CGAL/Kernel/Return_base_tag.h>
-#include <CGAL/Dimension.h>
-#ifndef CGAL_CXX11
-#include <boost/preprocessor/repetition.hpp>
-#endif
-#include <boost/utility/result_of.hpp>
-
-namespace CGAL {
-namespace Wrap {
-
-template <class R_>
-class Sphere_d : public Get_type<typename R_::Kernel_base, Sphere_tag>::type
-{
- typedef typename Get_type<R_, FT_tag>::type FT_;
- typedef typename R_::Kernel_base Kbase;
- typedef typename Get_type<R_, Point_tag>::type Point_;
- typedef typename Get_functor<Kbase, Construct_ttag<Sphere_tag> >::type CSBase;
- typedef typename Get_functor<Kbase, Center_of_sphere_tag>::type COSBase;
- typedef typename Get_functor<Kbase, Squared_radius_tag>::type SRBase;
-
- typedef Sphere_d Self;
- CGAL_static_assertion((boost::is_same<Self, typename Get_type<R_, Sphere_tag>::type>::value));
-
-public:
-
- typedef Tag_true Is_wrapper;
- typedef typename R_::Default_ambient_dimension Ambient_dimension;
- typedef typename Increment_dimension<Ambient_dimension,-1>::type Feature_dimension;
-
- typedef typename Get_type<Kbase, Sphere_tag>::type Rep;
-
- const Rep& rep() const
- {
- return *this;
- }
-
- Rep& rep()
- {
- return *this;
- }
-
- typedef R_ R;
-
-#ifdef CGAL_CXX11
- template<class...U,class=typename std::enable_if<!std::is_same<std::tuple<typename std::decay<U>::type...>,std::tuple<Sphere_d> >::value>::type> explicit Sphere_d(U&&...u)
- : Rep(CSBase()(std::forward<U>(u)...)){}
-
-// // called from Construct_point_d
-// template<class...U> explicit Point_d(Eval_functor&&,U&&...u)
-// : Rep(Eval_functor(), std::forward<U>(u)...){}
- template<class F,class...U> explicit Sphere_d(Eval_functor&&,F&&f,U&&...u)
- : Rep(std::forward<F>(f)(std::forward<U>(u)...)){}
-
-#if 0
- // the new standard may make this necessary
- Point_d(Point_d const&)=default;
- Point_d(Point_d &);//=default;
- Point_d(Point_d &&)=default;
-#endif
-
- // try not to use these
- Sphere_d(Rep const& v) : Rep(v) {}
- Sphere_d(Rep& v) : Rep(static_cast<Rep const&>(v)) {}
- Sphere_d(Rep&& v) : Rep(std::move(v)) {}
-
-#else
-
- Sphere_d() : Rep(CSBase()()) {}
-
- Sphere_d(Rep const& v) : Rep(v) {} // try not to use it
-
-#define CGAL_CODE(Z,N,_) template<BOOST_PP_ENUM_PARAMS(N,class T)> \
- explicit Sphere_d(BOOST_PP_ENUM_BINARY_PARAMS(N,T,const&t)) \
- : Rep(CSBase()( \
- BOOST_PP_ENUM_PARAMS(N,t))) {} \
- \
- template<class F,BOOST_PP_ENUM_PARAMS(N,class T)> \
- Sphere_d(Eval_functor,F const& f,BOOST_PP_ENUM_BINARY_PARAMS(N,T,const&t)) \
- : Rep(f(BOOST_PP_ENUM_PARAMS(N,t))) {}
- /*
- template<BOOST_PP_ENUM_PARAMS(N,class T)> \
- Point_d(Eval_functor,BOOST_PP_ENUM_BINARY_PARAMS(N,T,const&t)) \
- : Rep(Eval_functor(), BOOST_PP_ENUM_PARAMS(N,t)) {}
- */
-
- BOOST_PP_REPEAT_FROM_TO(1,11,CGAL_CODE,_)
-#undef CGAL_CODE
-
-#endif
-
- //TODO: if COSBase returns a reference to a base point, cast it to a
- //reference to a wrapper point. Ugly but should be safe.
- Point_ center()const{
- return Point_(Eval_functor(),COSBase(),rep());
- }
- FT_ squared_radius()const{
- return SRBase()(rep());
- }
-
-};
-
-} //namespace Wrap
-} //namespace CGAL
-
-#endif // CGAL_WRAPPER_SPHERE_D_H
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Vector_d.h b/include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Vector_d.h
deleted file mode 100644
index b7d1f0d0..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Vector_d.h
+++ /dev/null
@@ -1,266 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_WRAPPER_VECTOR_D_H
-#define CGAL_WRAPPER_VECTOR_D_H
-
-#include <CGAL/Origin.h>
-#include <CGAL/Kernel/mpl.h>
-#include <CGAL/representation_tags.h>
-#include <CGAL/assertions.h>
-#include <boost/type_traits.hpp>
-#include <CGAL/Kernel/Return_base_tag.h>
-#include <CGAL/Dimension.h>
-#ifndef CGAL_CXX11
-#include <boost/preprocessor/repetition.hpp>
-#endif
-#include <boost/utility/result_of.hpp>
-
-namespace CGAL {
-namespace Wrap {
-
-template <class R_>
-class Vector_d : public Get_type<typename R_::Kernel_base, Vector_tag>::type
-{
- typedef typename Get_type<R_, RT_tag>::type RT_;
- typedef typename Get_type<R_, FT_tag>::type FT_;
- typedef typename R_::Kernel_base Kbase;
- typedef typename Get_type<R_, Point_tag>::type Point_;
- typedef typename Get_functor<Kbase, Construct_ttag<Vector_tag> >::type CVBase;
- typedef typename Get_functor<Kbase, Compute_vector_cartesian_coordinate_tag>::type CCBase;
- typedef typename Get_functor<Kbase, Construct_ttag<Vector_cartesian_const_iterator_tag> >::type CVI;
- typedef typename Get_functor<Kbase, Squared_length_tag>::type SLBase;
-
- typedef Vector_d Self;
- CGAL_static_assertion((boost::is_same<Self, typename Get_type<R_, Vector_tag>::type>::value));
-
-public:
-
- typedef Tag_true Is_wrapper;
- typedef typename R_::Default_ambient_dimension Ambient_dimension;
- typedef Dimension_tag<0> Feature_dimension;
-
- //typedef typename R_::Vector_cartesian_const_iterator Cartesian_const_iterator;
- typedef typename Get_type<Kbase, Vector_tag>::type Rep;
-
- const Rep& rep() const
- {
- return *this;
- }
-
- Rep& rep()
- {
- return *this;
- }
-
- typedef R_ R;
-
-#ifdef CGAL_CXX11
- template<class...U,class=typename std::enable_if<!std::is_same<std::tuple<typename std::decay<U>::type...>,std::tuple<Vector_d> >::value>::type> explicit Vector_d(U&&...u)
- : Rep(CVBase()(std::forward<U>(u)...)){}
-
-// // called from Construct_vector_d
-// template<class...U> explicit Vector_d(Eval_functor&&,U&&...u)
-// : Rep(Eval_functor(), std::forward<U>(u)...){}
- template<class F,class...U> explicit Vector_d(Eval_functor&&,F&&f,U&&...u)
- : Rep(std::forward<F>(f)(std::forward<U>(u)...)){}
-
-#if 0
- // the new standard may make this necessary
- Vector_d(Vector_d const&)=default;
- Vector_d(Vector_d &);//=default;
- Vector_d(Vector_d &&)=default;
-#endif
-
- // try not to use these
- Vector_d(Rep const& v) : Rep(v) {}
- Vector_d(Rep& v) : Rep(static_cast<Rep const&>(v)) {}
- Vector_d(Rep&& v) : Rep(std::move(v)) {}
-
- // this one should be implicit
- Vector_d(Null_vector const& v)
- : Rep(CVBase()(v)) {}
- Vector_d(Null_vector& v)
- : Rep(CVBase()(v)) {}
- Vector_d(Null_vector&& v)
- : Rep(CVBase()(std::move(v))) {}
-
-#else
-
- Vector_d() : Rep(CVBase()()) {}
-
- Vector_d(Rep const& v) : Rep(v) {} // try not to use it
-
-#define CGAL_CODE(Z,N,_) template<BOOST_PP_ENUM_PARAMS(N,class T)> \
- explicit Vector_d(BOOST_PP_ENUM_BINARY_PARAMS(N,T,const&t)) \
- : Rep(CVBase()( \
- BOOST_PP_ENUM_PARAMS(N,t))) {} \
- \
- template<class F,BOOST_PP_ENUM_PARAMS(N,class T)> \
- Vector_d(Eval_functor,F const& f,BOOST_PP_ENUM_BINARY_PARAMS(N,T,const&t)) \
- : Rep(f(BOOST_PP_ENUM_PARAMS(N,t))) {}
- /*
- template<BOOST_PP_ENUM_PARAMS(N,class T)> \
- Vector_d(Eval_functor,BOOST_PP_ENUM_BINARY_PARAMS(N,T,const&t)) \
- : Rep(Eval_functor(), BOOST_PP_ENUM_PARAMS(N,t)) {}
- */
-
- BOOST_PP_REPEAT_FROM_TO(1,11,CGAL_CODE,_)
-#undef CGAL_CODE
-
- // this one should be implicit
- Vector_d(Null_vector const& v)
- : Rep(CVBase()(v)) {}
-
-#endif
-
- typename boost::result_of<CCBase(Rep,int)>::type cartesian(int i)const{
- return CCBase()(rep(),i);
- }
-
- typename boost::result_of<CCBase(Rep,int)>::type operator[](int i)const{
- return CCBase()(rep(),i);
- }
-
- typename boost::result_of<CVI(Rep,Begin_tag)>::type cartesian_begin()const{
- return CVI()(rep(),Begin_tag());
- }
-
- typename boost::result_of<CVI(Rep,End_tag)>::type cartesian_end()const{
- return CVI()(rep(),End_tag());
- }
-
- Vector_d operator-() const
- {
- return typename Get_functor<R, Opposite_vector_tag>::type()(*this);
- }
-
- /*
- Direction_d direction() const
- {
- return R().construct_direction_d_object()(*this);
- }
-
- Vector_d transform(const Aff_transformation_d &t) const
- {
- return t.transform(*this);
- }
-
- Vector_d operator/(const RT& c) const
- {
- return R().construct_divided_vector_d_object()(*this,c);
- }
-
- Vector_d operator/(const typename First_if_different<FT_,RT>::Type & c) const
- {
- return R().construct_divided_vector_d_object()(*this,c);
- }
-
- typename Qualified_result_of<typename R::Compute_x_3, Vector_3>::type
- x() const
- {
- return R().compute_x_3_object()(*this);
- }
-
- typename Qualified_result_of<typename R::Compute_y_3, Vector_3>::type
- y() const
- {
- return R().compute_y_3_object()(*this);
- }
-
- typename Qualified_result_of<typename R::Compute_z_3, Vector_3>::type
- z() const
- {
- return R().compute_z_3_object()(*this);
- }
-
- typename Qualified_result_of<typename R::Compute_hx_3, Vector_3>::type
- hx() const
- {
- return R().compute_hx_3_object()(*this);
- }
-
- typename Qualified_result_of<typename R::Compute_hy_3, Vector_3>::type
- hy() const
- {
- return R().compute_hy_3_object()(*this);
- }
-
- typename Qualified_result_of<typename R::Compute_hz_3, Vector_3>::type
- hz() const
- {
- return R().compute_hz_3_object()(*this);
- }
-
- typename Qualified_result_of<typename R::Compute_hw_3, Vector_3>::type
- hw() const
- {
- return R().compute_hw_3_object()(*this);
- }
-
- typename Qualified_result_of<typename R::Compute_x_3, Vector_3>::type
- cartesian(int i) const
- {
- CGAL_kernel_precondition( (i == 0) || (i == 1) || (i == 2) );
- if (i==0) return x();
- if (i==1) return y();
- return z();
- }
-
- typename Qualified_result_of<typename R::Compute_hw_3, Vector_3>::type
- homogeneous(int i) const
- {
- CGAL_kernel_precondition( (i >= 0) || (i <= 3) );
- if (i==0) return hx();
- if (i==1) return hy();
- if (i==2) return hz();
- return hw();
- }
-
- int dimension() const // bad idea?
- {
- return rep.dimension();
- }
-*/
- typename boost::result_of<SLBase(Rep)>::type squared_length()const{
- return SLBase()(rep());
- }
-};
-#if 0
-template <class R_> Vector_d<R_>::Vector_d(Vector_d &)=default;
-#endif
-
-//TODO: IO
-
-template <class R_>
-Vector_d<R_> operator+(const Vector_d<R_>& v,const Vector_d<R_>& w)
-{
- return typename Get_functor<R_, Sum_of_vectors_tag>::type()(v,w);
-}
-
-template <class R_>
-Vector_d<R_> operator-(const Vector_d<R_>& v,const Vector_d<R_>& w)
-{
- return typename Get_functor<R_, Difference_of_vectors_tag>::type()(v,w);
-}
-
-} //namespace Wrap
-} //namespace CGAL
-
-#endif // CGAL_WRAPPER_VECTOR_D_H
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Weighted_point_d.h b/include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Weighted_point_d.h
deleted file mode 100644
index 877eea21..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Weighted_point_d.h
+++ /dev/null
@@ -1,129 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_WRAPPER_WEIGHTED_POINT_D_H
-#define CGAL_WRAPPER_WEIGHTED_POINT_D_H
-
-#include <CGAL/representation_tags.h>
-#include <boost/static_assert.hpp>
-#include <boost/type_traits.hpp>
-#include <CGAL/Kernel/Return_base_tag.h>
-#include <CGAL/Dimension.h>
-#ifndef CGAL_CXX11
-#include <boost/preprocessor/repetition.hpp>
-#endif
-#include <boost/utility/result_of.hpp>
-
-namespace CGAL {
-namespace Wrap {
-
-template <class R_>
-class Weighted_point_d : public Get_type<typename R_::Kernel_base, Weighted_point_tag>::type
-{
- typedef typename Get_type<R_, FT_tag>::type FT_;
- typedef typename R_::Kernel_base Kbase;
- typedef typename Get_type<R_, Point_tag>::type Point_;
- typedef typename Get_functor<Kbase, Construct_ttag<Weighted_point_tag> >::type CWPBase;
- typedef typename Get_functor<Kbase, Point_drop_weight_tag>::type PDWBase;
- typedef typename Get_functor<Kbase, Point_weight_tag>::type PWBase;
-
- typedef Weighted_point_d Self;
- BOOST_STATIC_ASSERT((boost::is_same<Self, typename Get_type<R_, Weighted_point_tag>::type>::value));
-
-public:
-
- typedef Tag_true Is_wrapper;
- typedef typename R_::Default_ambient_dimension Ambient_dimension;
- typedef Dimension_tag<0> Feature_dimension;
-
- typedef typename Get_type<Kbase, Weighted_point_tag>::type Rep;
-
- const Rep& rep() const
- {
- return *this;
- }
-
- Rep& rep()
- {
- return *this;
- }
-
- typedef R_ R;
-
-#ifdef CGAL_CXX11
- template<class...U,class=typename std::enable_if<!std::is_same<std::tuple<typename std::decay<U>::type...>,std::tuple<Weighted_point_d> >::value>::type> explicit Weighted_point_d(U&&...u)
- : Rep(CWPBase()(std::forward<U>(u)...)){}
-
-// // called from Construct_point_d
-// template<class...U> explicit Point_d(Eval_functor&&,U&&...u)
-// : Rep(Eval_functor(), std::forward<U>(u)...){}
- template<class F,class...U> explicit Weighted_point_d(Eval_functor&&,F&&f,U&&...u)
- : Rep(std::forward<F>(f)(std::forward<U>(u)...)){}
-
-#if 0
- // the new standard may make this necessary
- Point_d(Point_d const&)=default;
- Point_d(Point_d &);//=default;
- Point_d(Point_d &&)=default;
-#endif
-
- // try not to use these
- Weighted_point_d(Rep const& v) : Rep(v) {}
- Weighted_point_d(Rep& v) : Rep(static_cast<Rep const&>(v)) {}
- Weighted_point_d(Rep&& v) : Rep(std::move(v)) {}
-
-#else
-
- Weighted_point_d() : Rep(CWPBase()()) {}
-
- Weighted_point_d(Rep const& v) : Rep(v) {} // try not to use it
-
-#define CGAL_CODE(Z,N,_) template<BOOST_PP_ENUM_PARAMS(N,class T)> \
- explicit Weighted_point_d(BOOST_PP_ENUM_BINARY_PARAMS(N,T,const&t)) \
- : Rep(CWPBase()( \
- BOOST_PP_ENUM_PARAMS(N,t))) {} \
- \
- template<class F,BOOST_PP_ENUM_PARAMS(N,class T)> \
- Weighted_point_d(Eval_functor,F const& f,BOOST_PP_ENUM_BINARY_PARAMS(N,T,const&t)) \
- : Rep(f(BOOST_PP_ENUM_PARAMS(N,t))) {}
- /*
- template<BOOST_PP_ENUM_PARAMS(N,class T)> \
- Point_d(Eval_functor,BOOST_PP_ENUM_BINARY_PARAMS(N,T,const&t)) \
- : Rep(Eval_functor(), BOOST_PP_ENUM_PARAMS(N,t)) {}
- */
-
- BOOST_PP_REPEAT_FROM_TO(1,11,CGAL_CODE,_)
-#undef CGAL_CODE
-
-#endif
-
- //TODO: use references?
- Point_ point()const{
- return Point_(Eval_functor(),PDWBase(),rep());
- }
- FT_ weight()const{
- return PWBase()(rep());
- }
-
-};
-
-} //namespace Wrap
-} //namespace CGAL
-
-#endif // CGAL_WRAPPER_SPHERE_D_H
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/function_objects_cartesian.h b/include/gudhi_patches/CGAL/NewKernel_d/function_objects_cartesian.h
deleted file mode 100644
index 5a132ad2..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/function_objects_cartesian.h
+++ /dev/null
@@ -1,1355 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_KERNEL_D_FUNCTION_OBJECTS_CARTESIAN_H
-#define CGAL_KERNEL_D_FUNCTION_OBJECTS_CARTESIAN_H
-
-#include <CGAL/NewKernel_d/utils.h>
-#include <CGAL/Dimension.h>
-#include <CGAL/Uncertain.h>
-#include <CGAL/NewKernel_d/store_kernel.h>
-#include <CGAL/is_iterator.h>
-#include <CGAL/iterator_from_indices.h>
-#include <CGAL/number_utils.h>
-#include <CGAL/Kernel/Return_base_tag.h>
-#include <CGAL/transforming_iterator.h>
-#include <CGAL/transforming_pair_iterator.h>
-#include <CGAL/NewKernel_d/functor_tags.h>
-#include <CGAL/NewKernel_d/functor_properties.h>
-#include <CGAL/predicates/sign_of_determinant.h>
-#include <functional>
-#ifdef CGAL_CXX11
-#include <initializer_list>
-#endif
-
-namespace CGAL {
-namespace CartesianDKernelFunctors {
-namespace internal {
-template<class,int> struct Dimension_at_most { enum { value = false }; };
-template<int a,int b> struct Dimension_at_most<Dimension_tag<a>,b> {
- enum { value = (a <= b) };
-};
-}
-
-template<class R_,class D_=typename R_::Default_ambient_dimension,bool=internal::Dimension_at_most<D_,6>::value> struct Orientation_of_points : private Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Orientation_of_points)
- typedef R_ R;
- typedef typename Get_type<R, Point_tag>::type Point;
- typedef typename Get_type<R, Orientation_tag>::type result_type;
- typedef typename R::LA::Square_matrix Matrix;
-
- template<class Iter>
- result_type operator()(Iter f, Iter e)const{
- typename Get_functor<R, Compute_point_cartesian_coordinate_tag>::type c(this->kernel());
- typename Get_functor<R, Point_dimension_tag>::type pd(this->kernel());
- Point const& p0=*f++;
- int d=pd(p0);
- Matrix m(d,d);
- // FIXME: this writes the vector coordinates in lines ? check all the other uses in this file, this may be wrong for some.
- for(int i=0;f!=e;++f,++i) {
- Point const& p=*f;
- for(int j=0;j<d;++j){
- m(i,j)=c(p,j)-c(p0,j);
- // should we cache the coordinates of p0 in case they are computed?
- }
- }
- return R::LA::sign_of_determinant(CGAL_MOVE(m));
- }
-
-#ifdef CGAL_CXX11
- // Since the dimension is at least 2, there are at least 3 points and no ambiguity with iterators.
- // template <class...U,class=typename std::enable_if<std::is_same<Dimension_tag<sizeof...(U)-1>,typename R::Default_ambient_dimension>::value>::type>
- template <class...U,class=typename std::enable_if<(sizeof...(U)>=3)>::type>
- result_type operator()(U&&...u) const {
- return operator()({std::forward<U>(u)...});
- }
-
- template <class P>
- result_type operator()(std::initializer_list<P> l) const {
- return operator()(l.begin(),l.end());
- }
-#else
- //should we make it template to avoid instantiation for wrong dim?
- //or iterate outside the class?
-#define CGAL_VAR(Z,J,I) m(I,J)=c(p##I,J)-c(x,J);
-#define CGAL_VAR2(Z,I,N) BOOST_PP_REPEAT(N,CGAL_VAR,I)
-#define CGAL_CODE(Z,N,_) \
- result_type operator()(Point const&x, BOOST_PP_ENUM_PARAMS(N,Point const&p)) const { \
- typename Get_functor<R, Compute_point_cartesian_coordinate_tag>::type c(this->kernel()); \
- Matrix m(N,N); \
- BOOST_PP_REPEAT(N,CGAL_VAR2,N) \
- return R::LA::sign_of_determinant(CGAL_MOVE(m)); \
- }
-
-BOOST_PP_REPEAT_FROM_TO(7, 10, CGAL_CODE, _ )
- // No need to do it for <=6, since that uses a different code path
-#undef CGAL_CODE
-#undef CGAL_VAR2
-#undef CGAL_VAR
-#endif
-};
-
-#ifdef CGAL_CXX11
-template<class R_,int d> struct Orientation_of_points<R_,Dimension_tag<d>,true> : private Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Orientation_of_points)
- typedef R_ R;
- typedef typename Get_type<R, RT_tag>::type RT;
- typedef typename Get_type<R, Point_tag>::type Point;
- typedef typename Get_type<R, Orientation_tag>::type result_type;
- template<class>struct Help;
- template<int...I>struct Help<Indices<I...> > {
- template<class C,class P,class T> result_type operator()(C const&c,P const&x,T&&t)const{
- return sign_of_determinant<RT>(c(std::get<I/d>(t),I%d)-c(x,I%d)...);
- }
- };
- template<class P0,class...P> result_type operator()(P0 const&x,P&&...p)const{
- static_assert(d==sizeof...(P),"Wrong number of arguments");
- typename Get_functor<R, Compute_point_cartesian_coordinate_tag>::type c(this->kernel());
- return Help<typename N_increasing_indices<d*d>::type>()(c,x,std::forward_as_tuple(std::forward<P>(p)...));
- }
-
-
- template<int N,class Iter,class...U> result_type help2(Dimension_tag<N>, Iter f, Iter const&e, U&&...u)const{
- auto const&p=*f;
- return help2(Dimension_tag<N-1>(),++f,e,std::forward<U>(u)...,p);
- }
- template<class Iter,class...U> result_type help2(Dimension_tag<0>, Iter CGAL_assertion_code(f), Iter const& CGAL_assertion_code(e), U&&...u)const{
- CGAL_assertion(f==e);
- return operator()(std::forward<U>(u)...);
- }
- template<class Iter>
- result_type operator()(Iter f, Iter e)const{
- return help2(Dimension_tag<d+1>(),f,e);
- }
-};
-#else
-#define CGAL_VAR(Z,J,I) c(p##I,J)-x##J
-#define CGAL_VAR2(Z,I,N) BOOST_PP_ENUM(N,CGAL_VAR,I)
-#define CGAL_VAR3(Z,N,_) Point const&p##N=*++f;
-#define CGAL_VAR4(Z,N,_) RT const&x##N=c(x,N);
-#define CGAL_CODE(Z,N,_) \
-template<class R_> struct Orientation_of_points<R_,Dimension_tag<N>,true> : private Store_kernel<R_> { \
- CGAL_FUNCTOR_INIT_STORE(Orientation_of_points) \
- typedef R_ R; \
- typedef typename Get_type<R, RT_tag>::type RT; \
- typedef typename Get_type<R, Point_tag>::type Point; \
- typedef typename Get_type<R, Orientation_tag>::type result_type; \
- result_type operator()(Point const&x, BOOST_PP_ENUM_PARAMS(N,Point const&p)) const { \
- typename Get_functor<R, Compute_point_cartesian_coordinate_tag>::type c(this->kernel()); \
- BOOST_PP_REPEAT(N,CGAL_VAR4,) \
- return sign_of_determinant<RT>(BOOST_PP_ENUM(N,CGAL_VAR2,N)); \
- } \
- template<class Iter> \
- result_type operator()(Iter f, Iter CGAL_assertion_code(e))const{ \
- Point const&x=*f; \
- BOOST_PP_REPEAT(N,CGAL_VAR3,) \
- CGAL_assertion(++f==e); \
- return operator()(x,BOOST_PP_ENUM_PARAMS(N,p)); \
- } \
-};
-
- BOOST_PP_REPEAT_FROM_TO(2, 7, CGAL_CODE, _ )
-#undef CGAL_CODE
-#undef CGAL_VAR4
-#undef CGAL_VAR3
-#undef CGAL_VAR2
-#undef CGAL_VAR
-
-#endif
-
-template<class R_> struct Orientation_of_points<R_,Dimension_tag<1>,true> : private Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Orientation_of_points)
- typedef R_ R;
- typedef typename Get_type<R, RT_tag>::type RT;
- typedef typename Get_type<R, Point_tag>::type Point;
- typedef typename Get_type<R, Orientation_tag>::type result_type;
- result_type operator()(Point const&x, Point const&y) const {
- typename Get_functor<R, Compute_point_cartesian_coordinate_tag>::type c(this->kernel());
- // No sign_of_determinant(RT) :-(
- return CGAL::compare(c(y,0),c(x,0));
- }
- template<class Iter>
- result_type operator()(Iter f, Iter CGAL_assertion_code(e))const{
- Point const&x=*f;
- Point const&y=*++f;
- CGAL_assertion(++f==e);
- return operator()(x,y);
- }
-};
-}
-
-CGAL_KD_DEFAULT_FUNCTOR(Orientation_of_points_tag,(CartesianDKernelFunctors::Orientation_of_points<K>),(Point_tag),(Point_dimension_tag,Compute_point_cartesian_coordinate_tag));
-
-namespace CartesianDKernelFunctors {
-template<class R_> struct Orientation_of_vectors : private Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Orientation_of_vectors)
- typedef R_ R;
- typedef typename Get_type<R, Vector_tag>::type Vector;
- typedef typename Get_type<R, Orientation_tag>::type result_type;
- typedef typename R::LA::Square_matrix Matrix;
-
- template<class Iter>
- result_type operator()(Iter f, Iter e)const{
- typename Get_functor<R, Compute_vector_cartesian_coordinate_tag>::type c(this->kernel());
- typename Get_functor<R, Point_dimension_tag>::type vd(this->kernel());
- // FIXME: Uh? Using it on a vector ?!
- Vector const& v0=*f;
- int d=vd(v0);
- Matrix m(d,d);
- for(int j=0;j<d;++j){
- m(0,j)=c(v0,j);
- }
- for(int i=1;++f!=e;++i) {
- Vector const& v=*f;
- for(int j=0;j<d;++j){
- m(i,j)=c(v,j);
- }
- }
- return R::LA::sign_of_determinant(CGAL_MOVE(m));
- }
-
-#ifdef CGAL_CXX11
- template <class...U,class=typename std::enable_if<(sizeof...(U)>=3)>::type>
- result_type operator()(U&&...u) const {
- return operator()({std::forward<U>(u)...});
- }
-
- template <class V>
- result_type operator()(std::initializer_list<V> l) const {
- return operator()(l.begin(),l.end());
- }
-#else
- //TODO
-#endif
-};
-}
-
-CGAL_KD_DEFAULT_FUNCTOR(Orientation_of_vectors_tag,(CartesianDKernelFunctors::Orientation_of_vectors<K>),(Vector_tag),(Point_dimension_tag,Compute_vector_cartesian_coordinate_tag));
-
-namespace CartesianDKernelFunctors {
-template<class R_> struct Linear_rank : private Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Linear_rank)
- typedef R_ R;
- typedef typename Get_type<R, Vector_tag>::type Vector;
- // Computing a sensible Uncertain<int> is not worth it
- typedef int result_type;
- typedef typename R::LA::Dynamic_matrix Matrix;
-
- template<class Iter>
- result_type operator()(Iter f, Iter e)const{
- typename Get_functor<R, Compute_vector_cartesian_coordinate_tag>::type c(this->kernel());
- typename Get_functor<R, Point_dimension_tag>::type vd(this->kernel());
- std::ptrdiff_t n=std::distance(f,e);
- if (n==0) return 0;
- Vector const& v0 = *f;
- // FIXME: Uh? Using it on a vector ?!
- int d=vd(v0);
- Matrix m(d,n);
- for(int j=0;j<d;++j){
- m(j,0)=c(v0,j);
- }
- for(int i=1; ++f!=e; ++i){
- Vector const& v = *f;
- for(int j=0;j<d;++j){
- m(j,i)=c(v,j);
- }
- }
- return R::LA::rank(CGAL_MOVE(m));
- }
-};
-}
-
-CGAL_KD_DEFAULT_FUNCTOR(Linear_rank_tag,(CartesianDKernelFunctors::Linear_rank<K>),(Vector_tag),(Point_dimension_tag,Compute_vector_cartesian_coordinate_tag));
-
-namespace CartesianDKernelFunctors {
-template<class R_> struct Linearly_independent : private Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Linearly_independent)
- typedef R_ R;
- typedef typename Get_type<R, Bool_tag>::type result_type;
-
- template<class Iter>
- result_type operator()(Iter f, Iter e)const{
- typename Get_functor<R, Point_dimension_tag>::type vd(this->kernel());
- std::ptrdiff_t n=std::distance(f,e);
- // FIXME: Uh? Using it on a vector ?!
- int d=vd(*f);
- if (n>d) return false;
- typename Get_functor<R, Linear_rank_tag>::type lr(this->kernel());
- return lr(f,e) == n;
- }
-};
-}
-
-CGAL_KD_DEFAULT_FUNCTOR(Linearly_independent_tag,(CartesianDKernelFunctors::Linearly_independent<K>),(Vector_tag),(Point_dimension_tag,Linear_rank_tag));
-
-namespace CartesianDKernelFunctors {
-template<class R_> struct Contained_in_linear_hull : private Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Contained_in_linear_hull)
- typedef R_ R;
- typedef typename Get_type<R, Vector_tag>::type Vector;
- // Computing a sensible Uncertain<bool> is not worth it
- typedef bool result_type;
- typedef typename R::LA::Dynamic_matrix Matrix;
-
- template<class Iter,class V>
- result_type operator()(Iter f, Iter e,V const&w)const{
- typename Get_functor<R, Compute_vector_cartesian_coordinate_tag>::type c(this->kernel());
- typename Get_functor<R, Point_dimension_tag>::type vd(this->kernel());
- std::ptrdiff_t n=std::distance(f,e);
- if (n==0) return false;
- // FIXME: Uh? Using it on a vector ?!
- int d=vd(w);
- Matrix m(d,n+1);
- for(int i=0; f!=e; ++f,++i){
- Vector const& v = *f;
- for(int j=0;j<d;++j){
- m(j,i)=c(v,j);
- }
- }
- for(int j=0;j<d;++j){
- m(j,n)=c(w,j);
- }
- int r1 = R::LA::rank(m);
- // FIXME: Don't use eigen directly, go through an interface in LA...
- m.conservativeResize(Eigen::NoChange, n);
- int r2 = R::LA::rank(CGAL_MOVE(m));
- return r1 == r2;
- // TODO: This is very very far from optimal...
- }
-};
-}
-
-CGAL_KD_DEFAULT_FUNCTOR(Contained_in_linear_hull_tag,(CartesianDKernelFunctors::Contained_in_linear_hull<K>),(Vector_tag),(Point_dimension_tag,Compute_vector_cartesian_coordinate_tag));
-
-namespace CartesianDKernelFunctors {
-template<class R_> struct Affine_rank : private Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Affine_rank)
- typedef R_ R;
- typedef typename Get_type<R, Point_tag>::type Point;
- // Computing a sensible Uncertain<int> is not worth it
- typedef int result_type;
- typedef typename R::LA::Dynamic_matrix Matrix;
-
- template<class Iter>
- result_type operator()(Iter f, Iter e)const{
- typename Get_functor<R, Compute_point_cartesian_coordinate_tag>::type c(this->kernel());
- typename Get_functor<R, Point_dimension_tag>::type pd(this->kernel());
- int n=(int)std::distance(f,e);
- if (--n<=0) return n;
- Point const& p0 = *f;
- int d=pd(p0);
- Matrix m(d,n);
- for(int i=0; ++f!=e; ++i){
- Point const& p = *f;
- for(int j=0;j<d;++j){
- m(j,i)=c(p,j)-c(p0,j);
- // TODO: cache p0[j] in case it is computed?
- }
- }
- return R::LA::rank(CGAL_MOVE(m));
- }
-};
-}
-
-CGAL_KD_DEFAULT_FUNCTOR(Affine_rank_tag,(CartesianDKernelFunctors::Affine_rank<K>),(Point_tag),(Point_dimension_tag,Compute_point_cartesian_coordinate_tag));
-
-namespace CartesianDKernelFunctors {
-template<class R_> struct Affinely_independent : private Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Affinely_independent)
- typedef R_ R;
- typedef typename Get_type<R, Bool_tag>::type result_type;
-
- template<class Iter>
- result_type operator()(Iter f, Iter e)const{
- typename Get_functor<R, Point_dimension_tag>::type pd(this->kernel());
- std::ptrdiff_t n=std::distance(f,e);
- int d=pd(*f);
- if (--n>d) return false;
- typename Get_functor<R, Affine_rank_tag>::type ar(this->kernel());
- return ar(f,e) == n;
- }
-};
-}
-
-CGAL_KD_DEFAULT_FUNCTOR(Affinely_independent_tag,(CartesianDKernelFunctors::Affinely_independent<K>),(Point_tag),(Point_dimension_tag,Affine_rank_tag));
-
-namespace CartesianDKernelFunctors {
-template<class R_> struct Contained_in_simplex : private Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Contained_in_simplex)
- typedef R_ R;
- typedef typename Get_type<R, Point_tag>::type Point;
- // Computing a sensible Uncertain<*> is not worth it
- // typedef typename Get_type<R, Boolean_tag>::type result_type;
- typedef bool result_type;
- typedef typename Increment_dimension<typename R::Default_ambient_dimension>::type D1;
- typedef typename Increment_dimension<typename R::Max_ambient_dimension>::type D2;
- typedef typename R::LA::template Rebind_dimension<D1,D2>::Other LA;
- typedef typename LA::Dynamic_matrix Matrix;
- typedef typename LA::Dynamic_vector DynVec;
- typedef typename LA::Vector Vec;
-
- template<class Iter, class P>
- result_type operator()(Iter f, Iter e, P const&q)const{
- typename Get_functor<R, Compute_point_cartesian_coordinate_tag>::type c(this->kernel());
- typename Get_functor<R, Point_dimension_tag>::type pd(this->kernel());
- std::ptrdiff_t n=std::distance(f,e);
- if (n==0) return false;
- int d=pd(q);
- Matrix m(d+1,n);
- DynVec a(n);
- // FIXME: Should use the proper vector constructor (Iterator_and_last)
- Vec b(d+1);
- for(int j=0;j<d;++j) b[j]=c(q,j);
- b[d]=1;
-
- for(int i=0; f!=e; ++i,++f){
- Point const& p = *f;
- for(int j=0;j<d;++j){
- m(j,i)=c(p,j);
- }
- m(d,i)=1;
- }
- // If the simplex has full dimension, there must be a solution, only the signs need to be checked.
- if (n == d+1)
- LA::solve(a,CGAL_MOVE(m),CGAL_MOVE(b));
- else if (!LA::solve_and_check(a,CGAL_MOVE(m),CGAL_MOVE(b)))
- return false;
- for(int i=0;i<n;++i){
- if (a[i]<0) return false;
- }
- return true;
- }
-};
-}
-
-CGAL_KD_DEFAULT_FUNCTOR(Contained_in_simplex_tag,(CartesianDKernelFunctors::Contained_in_simplex<K>),(Point_tag),(Point_dimension_tag,Compute_point_cartesian_coordinate_tag));
-
-namespace CartesianDKernelFunctors {
- namespace internal {
- template<class Ref_>
- struct Matrix_col_access {
- typedef Ref_ result_type;
- int col;
- Matrix_col_access(int r):col(r){}
- template<class Mat> Ref_ operator()(Mat const& m, std::ptrdiff_t row)const{
- return m(row,col);
- }
- };
- }
-template<class R_> struct Linear_base : private Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Linear_base)
- typedef R_ R;
- typedef typename Get_type<R, Vector_tag>::type Vector;
- typedef typename Get_type<R, FT_tag>::type FT;
- typedef void result_type;
- typedef typename R::LA::Dynamic_matrix Matrix;
-
- template<class Iter, class Oter>
- result_type operator()(Iter f, Iter e, Oter&o)const{
- typename Get_functor<R, Compute_vector_cartesian_coordinate_tag>::type c(this->kernel());
- typename Get_functor<R, Point_dimension_tag>::type vd(this->kernel());
- typename Get_functor<R, Construct_ttag<Vector_tag> >::type cv(this->kernel());
- std::ptrdiff_t n=std::distance(f,e);
- if (n==0) return;
- Vector const& v0 = *f;
- // FIXME: Uh? Using it on a vector ?!
- int d=vd(v0);
- Matrix m(d,n);
- for(int j=0;j<d;++j){
- m(0,j)=c(v0,j);
- }
- for(int i=1; ++f!=e; ++i){
- Vector const& v = *f;
- for(int j=0;j<d;++j){
- m(i,j)=c(v,j);
- }
- }
- Matrix b = R::LA::basis(CGAL_MOVE(m));
- for(int i=0; i < R::LA::columns(b); ++i){
- //*o++ = Vector(b.col(i));
- typedef
-#ifdef CGAL_CXX11
- decltype(std::declval<const Matrix>()(0,0))
-#else
- FT
-#endif
- Ref;
- typedef Iterator_from_indices<Matrix, FT, Ref,
- internal::Matrix_col_access<Ref> > IFI;
- *o++ = cv(IFI(b,0,i),IFI(b,d,i));
- }
- }
-};
-}
-
-CGAL_KD_DEFAULT_FUNCTOR(Linear_base_tag,(CartesianDKernelFunctors::Linear_base<K>),(Vector_tag),(Point_dimension_tag,Compute_vector_cartesian_coordinate_tag));
-
-#if 0
-namespace CartesianDKernelFunctors {
-template<class R_,bool=boost::is_same<typename R_::Point,typename R_::Vector>::value> struct Orientation : private Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Orientation)
- typedef R_ R;
- typedef typename Get_type<R, Vector_tag>::type Vector;
- typedef typename Get_type<R, Point_tag>::type Point;
- typedef typename Get_type<R, Orientation_tag>::type result_type;
- typedef typename Get_functor<R, Orientation_of_points_tag>::type OP;
- typedef typename Get_functor<R, Orientation_of_vectors_tag>::type OV;
-
- //FIXME!!!
- //when Point and Vector are distinct types, the dispatch should be made
- //in a way that doesn't instantiate a conversion from Point to Vector
- template<class Iter>
- result_type operator()(Iter const&f, Iter const& e)const{
- typename Get_functor<R, Point_dimension_tag>::type pd(this->kernel());
- typename std::iterator_traits<Iter>::difference_type d=std::distance(f,e);
- int dim=pd(*f); // BAD
- if(d==dim) return OV(this->kernel())(f,e);
- CGAL_assertion(d==dim+1);
- return OP(this->kernel())(f,e);
- }
- //TODO: version that takes objects directly instead of iterators
-};
-
-template<class R_> struct Orientation<R_,false> : private Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Orientation)
- typedef R_ R;
- typedef typename Get_type<R, Vector_tag>::type Vector;
- typedef typename Get_type<R, Point_tag>::type Point;
- typedef typename Get_type<R, Orientation_tag>::type result_type;
- typedef typename Get_functor<R, Orientation_of_points_tag>::type OP;
- typedef typename Get_functor<R, Orientation_of_vectors_tag>::type OV;
- typedef typename R::LA::Square_matrix Matrix;
-
- //FIXME!!!
- //when Point and Vector are distinct types, the dispatch should be made
- //in a way that doesn't instantiate a conversion from Point to Vector
- template<class Iter>
- typename boost::enable_if<is_iterator_to<Iter,Point>,result_type>::type
- operator()(Iter const&f, Iter const& e)const{
- return OP(this->kernel())(f,e);
- }
- template<class Iter>
- typename boost::enable_if<is_iterator_to<Iter,Vector>,result_type>::type
- operator()(Iter const&f, Iter const& e)const{
- return OV(this->kernel())(f,e);
- }
- //TODO: version that takes objects directly instead of iterators
-};
-}
-#endif
-
-namespace CartesianDKernelFunctors {
-template<class R_> struct Power_side_of_power_sphere_raw : private Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Power_side_of_power_sphere_raw)
- typedef R_ R;
- typedef typename Get_type<R, RT_tag>::type RT;
- typedef typename Get_type<R, FT_tag>::type FT;
- typedef typename Get_type<R, Point_tag>::type Point;
- typedef typename Get_type<R, Oriented_side_tag>::type result_type;
- typedef typename Increment_dimension<typename R::Default_ambient_dimension>::type D1;
- typedef typename Increment_dimension<typename R::Max_ambient_dimension>::type D2;
- typedef typename R::LA::template Rebind_dimension<D1,D2>::Other LA;
- typedef typename LA::Square_matrix Matrix;
-
- template<class IterP, class IterW, class Pt, class Wt>
- result_type operator()(IterP f, IterP const& e, IterW fw, Pt const& p0, Wt const& w0) const {
- typedef typename Get_functor<R, Squared_distance_to_origin_tag>::type Sqdo;
- typename Get_functor<R, Compute_point_cartesian_coordinate_tag>::type c(this->kernel());
- typename Get_functor<R, Point_dimension_tag>::type pd(this->kernel());
-
- int d=pd(p0);
- Matrix m(d+1,d+1);
- if(CGAL::Is_stored<Sqdo>::value) {
- Sqdo sqdo(this->kernel());
- FT const& h0 = sqdo(p0) - w0;
- for(int i=0;f!=e;++f,++fw,++i) {
- Point const& p=*f;
- for(int j=0;j<d;++j){
- RT const& x=c(p,j);
- m(i,j)=x-c(p0,j);
- }
- m(i,d) = sqdo(p) - *fw - h0;
- }
- } else {
- for(int i=0;f!=e;++f,++fw,++i) {
- Point const& p=*f;
- m(i,d) = w0 - *fw;
- for(int j=0;j<d;++j){
- RT const& x=c(p,j);
- m(i,j)=x-c(p0,j);
- m(i,d)+=CGAL::square(m(i,j));
- }
- }
- }
- if(d%2)
- return -LA::sign_of_determinant(CGAL_MOVE(m));
- else
- return LA::sign_of_determinant(CGAL_MOVE(m));
- }
-};
-}
-
-CGAL_KD_DEFAULT_FUNCTOR(Power_side_of_power_sphere_raw_tag,(CartesianDKernelFunctors::Power_side_of_power_sphere_raw<K>),(Point_tag),(Point_dimension_tag,Squared_distance_to_origin_tag,Compute_point_cartesian_coordinate_tag));
-
-// TODO: make Side_of_oriented_sphere call Power_side_of_power_sphere_raw
-namespace CartesianDKernelFunctors {
-template<class R_> struct Side_of_oriented_sphere : private Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Side_of_oriented_sphere)
- typedef R_ R;
- typedef typename Get_type<R, RT_tag>::type RT;
- typedef typename Get_type<R, Point_tag>::type Point;
- typedef typename Get_type<R, Oriented_side_tag>::type result_type;
- typedef typename Increment_dimension<typename R::Default_ambient_dimension>::type D1;
- typedef typename Increment_dimension<typename R::Max_ambient_dimension>::type D2;
- typedef typename R::LA::template Rebind_dimension<D1,D2>::Other LA;
- typedef typename LA::Square_matrix Matrix;
-
- template<class Iter>
- result_type operator()(Iter f, Iter const& e)const{
- Point const& p0=*f++; // *--e ?
- return this->operator()(f,e,p0);
- }
-
- template<class Iter>
- result_type operator()(Iter f, Iter const& e, Point const& p0) const {
- typedef typename Get_functor<R, Squared_distance_to_origin_tag>::type Sqdo;
- typename Get_functor<R, Compute_point_cartesian_coordinate_tag>::type c(this->kernel());
- typename Get_functor<R, Point_dimension_tag>::type pd(this->kernel());
-
- int d=pd(p0);
- Matrix m(d+1,d+1);
- if(CGAL::Is_stored<Sqdo>::value) {
- Sqdo sqdo(this->kernel());
- for(int i=0;f!=e;++f,++i) {
- Point const& p=*f;
- for(int j=0;j<d;++j){
- RT const& x=c(p,j);
- m(i,j)=x-c(p0,j);
- }
- m(i,d) = sqdo(p) - sqdo(p0);
- }
- } else {
- for(int i=0;f!=e;++f,++i) {
- Point const& p=*f;
- m(i,d) = 0;
- for(int j=0;j<d;++j){
- RT const& x=c(p,j);
- m(i,j)=x-c(p0,j);
- m(i,d)+=CGAL::square(m(i,j));
- }
- }
- }
- if(d%2)
- return -LA::sign_of_determinant(CGAL_MOVE(m));
- else
- return LA::sign_of_determinant(CGAL_MOVE(m));
- }
-
-#ifdef CGAL_CXX11
- template <class...U,class=typename std::enable_if<(sizeof...(U)>=4)>::type>
- result_type operator()(U&&...u) const {
- return operator()({std::forward<U>(u)...});
- }
-
- template <class P>
- result_type operator()(std::initializer_list<P> l) const {
- return operator()(l.begin(),l.end());
- }
-#else
- //TODO
-#endif
-};
-}
-
-CGAL_KD_DEFAULT_FUNCTOR(Side_of_oriented_sphere_tag,(CartesianDKernelFunctors::Side_of_oriented_sphere<K>),(Point_tag),(Point_dimension_tag,Squared_distance_to_origin_tag,Compute_point_cartesian_coordinate_tag));
-
-namespace CartesianDKernelFunctors {
-template <class R_> struct Construct_circumcenter : Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Construct_circumcenter)
- typedef typename Get_type<R_, Point_tag>::type Point;
- typedef Point result_type;
- typedef typename Get_type<R_, FT_tag>::type FT;
- template <class Iter>
- result_type operator()(Iter f, Iter e)const{
- typedef typename Get_type<R_, Point_tag>::type Point;
- typedef typename R_::LA LA;
- typename Get_functor<R_, Compute_point_cartesian_coordinate_tag>::type c(this->kernel());
- typename Get_functor<R_, Construct_ttag<Point_tag> >::type cp(this->kernel());
- typename Get_functor<R_, Point_dimension_tag>::type pd(this->kernel());
- typename Get_functor<R_, Squared_distance_to_origin_tag>::type sdo(this->kernel());
-
- Point const& p0=*f;
- int d = pd(p0);
- if (d+1 == std::distance(f,e))
- {
- // 2*(x-y).c == x^2-y^2
- typedef typename LA::Square_matrix Matrix;
- typedef typename LA::Vector Vec;
- typedef typename LA::Construct_vector CVec;
- FT const& n0 = sdo(p0);
- Matrix m(d,d);
- Vec b = typename CVec::Dimension()(d);
- // Write the point coordinates in lines.
- int i;
- for(i=0; ++f!=e; ++i) {
- Point const& p=*f;
- for(int j=0;j<d;++j) {
- m(i,j)=2*(c(p,j)-c(p0,j));
- b[i] = sdo(p) - n0;
- }
- }
- CGAL_assertion (i == d);
- Vec res = typename CVec::Dimension()(d);;
- //std::cout << "Mat: " << m << "\n Vec: " << one << std::endl;
- LA::solve(res, CGAL_MOVE(m), CGAL_MOVE(b));
- //std::cout << "Sol: " << res << std::endl;
- return cp(d,LA::vector_begin(res),LA::vector_end(res));
- }
- else
- {
- /*
- * Matrix P=(p1, p2, ...) (each point as a column)
- * Matrix Q=2*t(p2-p1,p3-p1, ...) (each vector as a line)
- * Matrix M: QP, adding a line of 1 at the top
- * Vector B: (1, p2^2-p1^2, p3^2-p1^2, ...)
- * Solve ML=B, the center of the sphere is PL
- *
- * It would likely be faster to write P then transpose, multiply,
- * etc instead of doing it by hand.
- */
- // TODO: check for degenerate cases?
-
- typedef typename R_::Max_ambient_dimension D2;
- typedef typename R_::LA::template Rebind_dimension<Dynamic_dimension_tag,D2>::Other LAd;
- typedef typename LAd::Square_matrix Matrix;
- typedef typename LAd::Vector Vec;
- typename Get_functor<R_, Scalar_product_tag>::type sp(this->kernel());
- int k=static_cast<int>(std::distance(f,e));
- Matrix m(k,k);
- Vec b(k);
- Vec l(k);
- int j,i=0;
- for(Iter f2=f;f2!=e;++f2,++i){
- b(i)=m(i,i)=sdo(*f2);
- j=0;
- for(Iter f3=f;f3!=e;++f3,++j){
- m(j,i)=m(i,j)=sp(*f2,*f3);
- }
- }
- for(i=1;i<k;++i){
- b(i)-=b(0);
- for(j=0;j<k;++j){
- m(i,j)=2*(m(i,j)-m(0,j));
- }
- }
- for(j=0;j<k;++j) m(0,j)=1;
- b(0)=1;
-
- LAd::solve(l,CGAL_MOVE(m),CGAL_MOVE(b));
-
- typename LA::Vector center=typename LA::Construct_vector::Dimension()(d);
- for(i=0;i<d;++i) center(i)=0;
- j=0;
- for(Iter f2=f;f2!=e;++f2,++j){
- for(i=0;i<d;++i){
- center(i)+=l(j)*c(*f2,i);
- }
- }
-
- return cp(LA::vector_begin(center),LA::vector_end(center));
- }
- }
-};
-}
-
-CGAL_KD_DEFAULT_FUNCTOR(Construct_circumcenter_tag,(CartesianDKernelFunctors::Construct_circumcenter<K>),(Point_tag),(Construct_ttag<Point_tag>,Compute_point_cartesian_coordinate_tag,Scalar_product_tag,Squared_distance_to_origin_tag,Point_dimension_tag));
-
-namespace CartesianDKernelFunctors {
-template <class R_> struct Squared_circumradius : Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Squared_circumradius)
- typedef typename Get_type<R_, FT_tag>::type result_type;
- template <class Iter>
- result_type operator()(Iter f, Iter e)const{
- typename Get_functor<R_, Construct_circumcenter_tag>::type cc(this->kernel());
- typename Get_functor<R_, Squared_distance_tag>::type sd(this->kernel());
- return sd(cc(f, e), *f);
- }
-};
-}
-
-CGAL_KD_DEFAULT_FUNCTOR(Squared_circumradius_tag,(CartesianDKernelFunctors::Squared_circumradius<K>),(Point_tag),(Construct_circumcenter_tag,Squared_distance_tag));
-
-namespace CartesianDKernelFunctors {
-// TODO: implement it directly, it should be at least as fast as Side_of_oriented_sphere.
-template<class R_> struct Side_of_bounded_sphere : private Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Side_of_bounded_sphere)
- typedef R_ R;
- typedef typename Get_type<R, Point_tag>::type Point;
- typedef typename Get_type<R, Bounded_side_tag>::type result_type;
-
- template<class Iter>
- result_type operator()(Iter f, Iter const& e) const {
- Point const& p0 = *f++; // *--e ?
- typename Get_functor<R, Point_dimension_tag>::type pd(this->kernel());
- //FIXME: Doesn't work for non-full dimension.
- CGAL_assertion (std::distance(f,e) == pd(p0)+1);
- return operator() (f, e, p0);
- }
-
- template<class Iter>
- result_type operator()(Iter const& f, Iter const& e, Point const& p0) const {
- typename Get_functor<R, Side_of_oriented_sphere_tag>::type sos (this->kernel());
- typename Get_functor<R, Orientation_of_points_tag>::type op (this->kernel());
- // enum_cast is not very generic, but since this function isn't supposed to remain like this...
- return enum_cast<Bounded_side> (sos (f, e, p0) * op (f, e));
- }
-
-#ifdef CGAL_CXX11
- template <class...U,class=typename std::enable_if<(sizeof...(U)>=4)>::type>
- result_type operator()(U&&...u) const {
- return operator()({std::forward<U>(u)...});
- }
-
- template <class P>
- result_type operator()(std::initializer_list<P> l) const {
- return operator()(l.begin(),l.end());
- }
-#else
- //TODO
-#endif
-};
-}
-
-CGAL_KD_DEFAULT_FUNCTOR(Side_of_bounded_sphere_tag,(CartesianDKernelFunctors::Side_of_bounded_sphere<K>),(Point_tag),(Side_of_oriented_sphere_tag,Orientation_of_points_tag));
-
-namespace CartesianDKernelFunctors {
-template<class R_> struct Side_of_bounded_circumsphere : private Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Side_of_bounded_circumsphere)
- typedef typename Get_type<R_, Bounded_side_tag>::type result_type;
-
- template<class Iter, class P>
- result_type operator()(Iter f, Iter const& e, P const& p0) const {
- // TODO: Special case when the dimension is full.
- typename Get_functor<R_, Construct_circumcenter_tag>::type cc(this->kernel());
- typename Get_functor<R_, Compare_distance_tag>::type cd(this->kernel());
-
- return enum_cast<Bounded_side>(cd(cc(f, e), *f, p0));
- }
-};
-}
-
-CGAL_KD_DEFAULT_FUNCTOR(Side_of_bounded_circumsphere_tag,(CartesianDKernelFunctors::Side_of_bounded_circumsphere<K>),(Point_tag),(Squared_distance_tag,Construct_circumcenter_tag));
-
-namespace CartesianDKernelFunctors {
-template<class R_> struct Point_to_vector : private Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Point_to_vector)
- typedef R_ R;
- typedef typename Get_type<R, RT_tag>::type RT;
- typedef typename Get_type<R, Vector_tag>::type Vector;
- typedef typename Get_type<R, Point_tag>::type Point;
- typedef typename Get_functor<R, Construct_ttag<Vector_tag> >::type CV;
- typedef typename Get_functor<R, Construct_ttag<Point_cartesian_const_iterator_tag> >::type CI;
- typedef Vector result_type;
- typedef Point argument_type;
- result_type operator()(argument_type const&v)const{
- CI ci(this->kernel());
- return CV(this->kernel())(ci(v,Begin_tag()),ci(v,End_tag()));
- }
-};
-}
-
-CGAL_KD_DEFAULT_FUNCTOR(Point_to_vector_tag,(CartesianDKernelFunctors::Point_to_vector<K>),(Point_tag,Vector_tag),(Construct_ttag<Vector_tag>, Construct_ttag<Point_cartesian_const_iterator_tag>));
-
-namespace CartesianDKernelFunctors {
-template<class R_> struct Vector_to_point : private Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Vector_to_point)
- typedef R_ R;
- typedef typename Get_type<R, RT_tag>::type RT;
- typedef typename Get_type<R, Vector_tag>::type Vector;
- typedef typename Get_type<R, Point_tag>::type Point;
- typedef typename Get_functor<R, Construct_ttag<Point_tag> >::type CP;
- typedef typename Get_functor<R, Construct_ttag<Vector_cartesian_const_iterator_tag> >::type CI;
- typedef Point result_type;
- typedef Vector argument_type;
- result_type operator()(argument_type const&v)const{
- CI ci(this->kernel());
- return CP(this->kernel())(ci(v,Begin_tag()),ci(v,End_tag()));
- }
-};
-}
-
-CGAL_KD_DEFAULT_FUNCTOR(Vector_to_point_tag,(CartesianDKernelFunctors::Vector_to_point<K>),(Point_tag,Vector_tag),(Construct_ttag<Point_tag>, Construct_ttag<Vector_cartesian_const_iterator_tag>));
-
-namespace CartesianDKernelFunctors {
-template<class R_> struct Opposite_vector : private Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Opposite_vector)
- typedef R_ R;
- typedef typename Get_type<R, RT_tag>::type RT;
- typedef typename Get_type<R, Vector_tag>::type Vector;
- typedef typename Get_functor<R, Construct_ttag<Vector_tag> >::type CV;
- typedef typename Get_functor<R, Construct_ttag<Vector_cartesian_const_iterator_tag> >::type CI;
- typedef Vector result_type;
- typedef Vector argument_type;
- result_type operator()(Vector const&v)const{
- CI ci(this->kernel());
- return CV(this->kernel())(make_transforming_iterator(ci(v,Begin_tag()),std::negate<RT>()),make_transforming_iterator(ci(v,End_tag()),std::negate<RT>()));
- }
-};
-}
-
-CGAL_KD_DEFAULT_FUNCTOR(Opposite_vector_tag,(CartesianDKernelFunctors::Opposite_vector<K>),(Vector_tag),(Construct_ttag<Vector_tag>, Construct_ttag<Vector_cartesian_const_iterator_tag>));
-
-namespace CartesianDKernelFunctors {
-template<class R_> struct Scaled_vector : private Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Scaled_vector)
- typedef R_ R;
- typedef typename Get_type<R, FT_tag>::type FT;
- typedef typename Get_type<R, Vector_tag>::type Vector;
- typedef typename Get_functor<R, Construct_ttag<Vector_tag> >::type CV;
- typedef typename Get_functor<R, Construct_ttag<Vector_cartesian_const_iterator_tag> >::type CI;
- typedef Vector result_type;
- typedef Vector first_argument_type;
- typedef FT second_argument_type;
- result_type operator()(Vector const&v,FT const& s)const{
- CI ci(this->kernel());
- return CV(this->kernel())(make_transforming_iterator(ci(v,Begin_tag()),Scale<FT>(s)),make_transforming_iterator(ci(v,End_tag()),Scale<FT>(s)));
- }
-};
-}
-
-CGAL_KD_DEFAULT_FUNCTOR(Scaled_vector_tag,(CartesianDKernelFunctors::Scaled_vector<K>),(Vector_tag),(Construct_ttag<Vector_tag>, Construct_ttag<Vector_cartesian_const_iterator_tag>));
-
-namespace CartesianDKernelFunctors {
-template<class R_> struct Sum_of_vectors : private Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Sum_of_vectors)
- typedef R_ R;
- typedef typename Get_type<R, RT_tag>::type RT;
- typedef typename Get_type<R, Vector_tag>::type Vector;
- typedef typename Get_functor<R, Construct_ttag<Vector_tag> >::type CV;
- typedef typename Get_functor<R, Construct_ttag<Vector_cartesian_const_iterator_tag> >::type CI;
- typedef Vector result_type;
- typedef Vector first_argument_type;
- typedef Vector second_argument_type;
- result_type operator()(Vector const&a, Vector const&b)const{
- CI ci(this->kernel());
- return CV(this->kernel())(make_transforming_pair_iterator(ci(a,Begin_tag()),ci(b,Begin_tag()),std::plus<RT>()),make_transforming_pair_iterator(ci(a,End_tag()),ci(b,End_tag()),std::plus<RT>()));
- }
-};
-}
-
-CGAL_KD_DEFAULT_FUNCTOR(Sum_of_vectors_tag,(CartesianDKernelFunctors::Sum_of_vectors<K>),(Vector_tag),(Construct_ttag<Vector_tag>, Construct_ttag<Vector_cartesian_const_iterator_tag>));
-
-namespace CartesianDKernelFunctors {
-template<class R_> struct Difference_of_vectors : private Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Difference_of_vectors)
- typedef R_ R;
- typedef typename Get_type<R, RT_tag>::type RT;
- typedef typename Get_type<R, Vector_tag>::type Vector;
- typedef typename Get_functor<R, Construct_ttag<Vector_tag> >::type CV;
- typedef typename Get_functor<R, Construct_ttag<Vector_cartesian_const_iterator_tag> >::type CI;
- typedef Vector result_type;
- typedef Vector first_argument_type;
- typedef Vector second_argument_type;
- result_type operator()(Vector const&a, Vector const&b)const{
- CI ci(this->kernel());
- return CV(this->kernel())(make_transforming_pair_iterator(ci(a,Begin_tag()),ci(b,Begin_tag()),std::minus<RT>()),make_transforming_pair_iterator(ci(a,End_tag()),ci(b,End_tag()),std::minus<RT>()));
- }
-};
-}
-
-CGAL_KD_DEFAULT_FUNCTOR(Difference_of_vectors_tag,(CartesianDKernelFunctors::Difference_of_vectors<K>),(Vector_tag),(Construct_ttag<Vector_tag>, Construct_ttag<Vector_cartesian_const_iterator_tag>));
-
-namespace CartesianDKernelFunctors {
-template<class R_> struct Translated_point : private Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Translated_point)
- typedef R_ R;
- typedef typename Get_type<R, RT_tag>::type RT;
- typedef typename Get_type<R, Vector_tag>::type Vector;
- typedef typename Get_type<R, Point_tag>::type Point;
- typedef typename Get_functor<R, Construct_ttag<Point_tag> >::type CP;
- typedef typename Get_functor<R, Construct_ttag<Vector_cartesian_const_iterator_tag> >::type CVI;
- typedef typename Get_functor<R, Construct_ttag<Point_cartesian_const_iterator_tag> >::type CPI;
- typedef Point result_type;
- typedef Point first_argument_type;
- typedef Vector second_argument_type;
- result_type operator()(Point const&a, Vector const&b)const{
- CVI cvi(this->kernel());
- CPI cpi(this->kernel());
- return CP(this->kernel())(make_transforming_pair_iterator(cpi(a,Begin_tag()),cvi(b,Begin_tag()),std::plus<RT>()),make_transforming_pair_iterator(cpi(a,End_tag()),cvi(b,End_tag()),std::plus<RT>()));
- }
-};
-}
-
-CGAL_KD_DEFAULT_FUNCTOR(Translated_point_tag,(CartesianDKernelFunctors::Translated_point<K>),(Point_tag, Vector_tag),(Construct_ttag<Point_tag>, Construct_ttag<Vector_cartesian_const_iterator_tag>, Construct_ttag<Point_cartesian_const_iterator_tag>));
-
-namespace CartesianDKernelFunctors {
-template<class R_> struct Difference_of_points : private Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Difference_of_points)
- typedef R_ R;
- typedef typename Get_type<R, RT_tag>::type RT;
- typedef typename Get_type<R, Point_tag>::type Point;
- typedef typename Get_type<R, Vector_tag>::type Vector;
- typedef typename Get_functor<R, Construct_ttag<Vector_tag> >::type CV;
- typedef typename Get_functor<R, Construct_ttag<Point_cartesian_const_iterator_tag> >::type CI;
- typedef Vector result_type;
- typedef Point first_argument_type;
- typedef Point second_argument_type;
- result_type operator()(Point const&a, Point const&b)const{
- CI ci(this->kernel());
- return CV(this->kernel())(make_transforming_pair_iterator(ci(a,Begin_tag()),ci(b,Begin_tag()),std::minus<RT>()),make_transforming_pair_iterator(ci(a,End_tag()),ci(b,End_tag()),std::minus<RT>()));
- }
-};
-}
-
-CGAL_KD_DEFAULT_FUNCTOR(Difference_of_points_tag,(CartesianDKernelFunctors::Difference_of_points<K>),(Point_tag, Vector_tag),(Construct_ttag<Vector_tag>, Construct_ttag<Point_cartesian_const_iterator_tag>));
-
-namespace CartesianDKernelFunctors {
-template<class R_> struct Midpoint : private Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Midpoint)
- typedef R_ R;
- typedef typename Get_type<R, FT_tag>::type FT;
- typedef typename Get_type<R, RT_tag>::type RT;
- typedef typename Get_type<R, Point_tag>::type Point;
- typedef typename Get_functor<R, Construct_ttag<Point_tag> >::type CP;
- typedef typename Get_functor<R, Construct_ttag<Point_cartesian_const_iterator_tag> >::type CI;
- typedef Point result_type;
- typedef Point first_argument_type;
- typedef Point second_argument_type;
- // There is a division, but it will be cast to RT afterwards anyway, so maybe we could use RT.
- struct Average : std::binary_function<FT,RT,FT> {
- FT operator()(FT const&a, RT const&b)const{
- return (a+b)/2;
- }
- };
- result_type operator()(Point const&a, Point const&b)const{
- CI ci(this->kernel());
- //Divide<FT,int> half(2);
- //return CP(this->kernel())(make_transforming_iterator(make_transforming_pair_iterator(ci.begin(a),ci.begin(b),std::plus<FT>()),half),make_transforming_iterator(make_transforming_pair_iterator(ci.end(a),ci.end(b),std::plus<FT>()),half));
- return CP(this->kernel())(make_transforming_pair_iterator(ci(a,Begin_tag()),ci(b,Begin_tag()),Average()),make_transforming_pair_iterator(ci(a,End_tag()),ci(b,End_tag()),Average()));
- }
-};
-}
-
-CGAL_KD_DEFAULT_FUNCTOR(Midpoint_tag,(CartesianDKernelFunctors::Midpoint<K>),(Point_tag),(Construct_ttag<Point_tag>, Construct_ttag<Point_cartesian_const_iterator_tag>));
-
-namespace CartesianDKernelFunctors {
-template<class R_> struct Squared_length : private Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Squared_length)
- typedef R_ R;
- typedef typename Get_type<R, RT_tag>::type RT;
- typedef typename Get_type<R, Vector_tag>::type Vector;
- typedef typename Get_functor<R, Construct_ttag<Vector_cartesian_const_iterator_tag> >::type CI;
- typedef RT result_type;
- typedef Vector argument_type;
- result_type operator()(Vector const&a)const{
- CI ci(this->kernel());
- typename Algebraic_structure_traits<RT>::Square f;
- // TODO: avoid this RT(0)+...
- return std::accumulate(make_transforming_iterator(ci(a,Begin_tag()),f),make_transforming_iterator(ci(a,End_tag()),f),RT(0));
- }
-};
-}
-
-CGAL_KD_DEFAULT_FUNCTOR(Squared_length_tag,(CartesianDKernelFunctors::Squared_length<K>),(Vector_tag),(Construct_ttag<Vector_cartesian_const_iterator_tag>));
-
-namespace CartesianDKernelFunctors {
-template<class R_> struct Squared_distance_to_origin : private Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Squared_distance_to_origin)
- typedef R_ R;
- typedef typename Get_type<R, RT_tag>::type RT;
- typedef typename Get_type<R, Point_tag>::type Point;
- typedef typename Get_functor<R, Construct_ttag<Point_cartesian_const_iterator_tag> >::type CI;
- typedef RT result_type;
- typedef Point argument_type;
- result_type operator()(Point const&a)const{
- CI ci(this->kernel());
- typename Algebraic_structure_traits<RT>::Square f;
- // TODO: avoid this RT(0)+...
- return std::accumulate(make_transforming_iterator(ci(a,Begin_tag()),f),make_transforming_iterator(ci(a,End_tag()),f),RT(0));
- }
-};
-}
-
-CGAL_KD_DEFAULT_FUNCTOR(Squared_distance_to_origin_tag,(CartesianDKernelFunctors::Squared_distance_to_origin<K>),(Point_tag),(Construct_ttag<Point_cartesian_const_iterator_tag>));
-
-namespace CartesianDKernelFunctors {
-template<class R_> struct Squared_distance : private Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Squared_distance)
- typedef R_ R;
- typedef typename Get_type<R, RT_tag>::type RT;
- typedef typename Get_type<R, Point_tag>::type Point;
- typedef typename Get_functor<R, Construct_ttag<Point_cartesian_const_iterator_tag> >::type CI;
- typedef RT result_type;
- typedef Point first_argument_type;
- typedef Point second_argument_type;
- struct Sq_diff : std::binary_function<RT,RT,RT> {
- RT operator()(RT const&a, RT const&b)const{
- return CGAL::square(a-b);
- }
- };
- result_type operator()(Point const&a, Point const&b)const{
- CI ci(this->kernel());
- Sq_diff f;
- // TODO: avoid this RT(0)+...
- return std::accumulate(make_transforming_pair_iterator(ci(a,Begin_tag()),ci(b,Begin_tag()),f),make_transforming_pair_iterator(ci(a,End_tag()),ci(b,End_tag()),f),RT(0));
- }
-};
-}
-
-CGAL_KD_DEFAULT_FUNCTOR(Squared_distance_tag,(CartesianDKernelFunctors::Squared_distance<K>),(Point_tag),(Construct_ttag<Point_cartesian_const_iterator_tag>));
-
-namespace CartesianDKernelFunctors {
-template<class R_> struct Scalar_product : private Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Scalar_product)
- typedef R_ R;
- typedef typename Get_type<R, RT_tag>::type RT;
- typedef typename Get_type<R, Vector_tag>::type Vector;
- typedef typename Get_functor<R, Construct_ttag<Vector_cartesian_const_iterator_tag> >::type CI;
- typedef RT result_type;
- typedef Vector first_argument_type;
- typedef Vector second_argument_type;
- result_type operator()(Vector const&a, Vector const&b)const{
- CI ci(this->kernel());
- std::multiplies<RT> f;
- // TODO: avoid this RT(0)+...
- return std::accumulate(
- make_transforming_pair_iterator(ci(a,Begin_tag()),ci(b,Begin_tag()),f),
- make_transforming_pair_iterator(ci(a, End_tag()),ci(b, End_tag()),f),
- RT(0));
- }
-};
-}
-
-CGAL_KD_DEFAULT_FUNCTOR(Scalar_product_tag,(CartesianDKernelFunctors::Scalar_product<K>),(Vector_tag),(Construct_ttag<Vector_cartesian_const_iterator_tag>));
-
-namespace CartesianDKernelFunctors {
-template<class R_> struct Compare_distance : private Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Compare_distance)
- typedef R_ R;
- typedef typename Get_type<R, Point_tag>::type Point;
- typedef typename Get_functor<R, Squared_distance_tag>::type CSD;
- typedef typename Get_type<R, Comparison_result_tag>::type result_type;
- typedef Point first_argument_type;
- typedef Point second_argument_type;
- typedef Point third_argument_type; // why am I doing this already?
- typedef Point fourth_argument_type;
- result_type operator()(Point const&a, Point const&b, Point const&c)const{
- CSD csd(this->kernel());
- return CGAL_NTS compare(csd(a,b),csd(a,c));
- }
- result_type operator()(Point const&a, Point const&b, Point const&c, Point const&d)const{
- CSD csd(this->kernel());
- return CGAL_NTS compare(csd(a,b),csd(c,d));
- }
-};
-}
-
-CGAL_KD_DEFAULT_FUNCTOR(Compare_distance_tag,(CartesianDKernelFunctors::Compare_distance<K>),(Point_tag),(Squared_distance_tag));
-
-namespace CartesianDKernelFunctors {
-template<class R_> struct Less_point_cartesian_coordinate : private Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Less_point_cartesian_coordinate)
- typedef R_ R;
- typedef typename Get_type<R, Bool_tag>::type result_type;
- typedef typename Get_functor<R, Compute_point_cartesian_coordinate_tag>::type Cc;
- // TODO: This is_exact thing should be reengineered.
- // the goal is to have a way to tell: don't filter this
- typedef typename CGAL::Is_exact<Cc> Is_exact;
-
- template<class V,class W,class I>
- result_type operator()(V const&a, W const&b, I i)const{
- Cc c(this->kernel());
- return c(a,i)<c(b,i);
- }
-};
-}
-
-CGAL_KD_DEFAULT_FUNCTOR(Less_point_cartesian_coordinate_tag,(CartesianDKernelFunctors::Less_point_cartesian_coordinate<K>),(),(Compute_point_cartesian_coordinate_tag));
-
-namespace CartesianDKernelFunctors {
-template<class R_> struct Compare_point_cartesian_coordinate : private Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Compare_point_cartesian_coordinate)
- typedef R_ R;
- typedef typename Get_type<R, Comparison_result_tag>::type result_type;
- typedef typename Get_functor<R, Compute_point_cartesian_coordinate_tag>::type Cc;
- // TODO: This is_exact thing should be reengineered.
- // the goal is to have a way to tell: don't filter this
- typedef typename CGAL::Is_exact<Cc> Is_exact;
-
- template<class V,class W,class I>
- result_type operator()(V const&a, W const&b, I i)const{
- Cc c(this->kernel());
- return CGAL_NTS compare(c(a,i),c(b,i));
- }
-};
-}
-
-CGAL_KD_DEFAULT_FUNCTOR(Compare_point_cartesian_coordinate_tag,(CartesianDKernelFunctors::Compare_point_cartesian_coordinate<K>),(),(Compute_point_cartesian_coordinate_tag));
-
-namespace CartesianDKernelFunctors {
-template<class R_> struct Compare_lexicographically : private Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Compare_lexicographically)
- typedef R_ R;
- typedef typename Get_type<R, Comparison_result_tag>::type result_type;
- typedef typename Get_functor<R, Construct_ttag<Point_cartesian_const_iterator_tag> >::type CI;
- // TODO: This is_exact thing should be reengineered.
- // the goal is to have a way to tell: don't filter this
- typedef typename CGAL::Is_exact<CI> Is_exact;
-
- template<class V,class W>
- result_type operator()(V const&a, W const&b)const{
- CI c(this->kernel());
-#ifdef CGAL_CXX11
- auto
-#else
- typename CI::result_type
-#endif
- a_begin=c(a,Begin_tag()),
- b_begin=c(b,Begin_tag()),
- a_end=c(a,End_tag());
- result_type res;
- // can't we do slightly better for Uncertain<*> ?
- // after res=...; if(is_uncertain(res))return indeterminate<result_type>();
- do res=CGAL_NTS compare(*a_begin++,*b_begin++);
- while(a_begin!=a_end && res==EQUAL);
- return res;
- }
-};
-}
-
-CGAL_KD_DEFAULT_FUNCTOR(Compare_lexicographically_tag,(CartesianDKernelFunctors::Compare_lexicographically<K>),(),(Construct_ttag<Point_cartesian_const_iterator_tag>));
-
-namespace CartesianDKernelFunctors {
-template<class R_> struct Less_lexicographically : private Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Less_lexicographically)
- typedef R_ R;
- typedef typename Get_type<R, Bool_tag>::type result_type;
- typedef typename Get_functor<R, Compare_lexicographically_tag>::type CL;
- typedef typename CGAL::Is_exact<CL> Is_exact;
-
- template <class V, class W>
- result_type operator() (V const&a, W const&b) const {
- CL c (this->kernel());
- return c(a,b) < 0;
- }
-};
-}
-
-CGAL_KD_DEFAULT_FUNCTOR(Less_lexicographically_tag,(CartesianDKernelFunctors::Less_lexicographically<K>),(),(Compare_lexicographically_tag));
-
-namespace CartesianDKernelFunctors {
-template<class R_> struct Less_or_equal_lexicographically : private Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Less_or_equal_lexicographically)
- typedef R_ R;
- typedef typename Get_type<R, Bool_tag>::type result_type;
- typedef typename Get_functor<R, Compare_lexicographically_tag>::type CL;
- typedef typename CGAL::Is_exact<CL> Is_exact;
-
- template <class V, class W>
- result_type operator() (V const&a, W const&b) const {
- CL c (this->kernel());
- return c(a,b) <= 0;
- }
-};
-}
-
-CGAL_KD_DEFAULT_FUNCTOR(Less_or_equal_lexicographically_tag,(CartesianDKernelFunctors::Less_or_equal_lexicographically<K>),(),(Compare_lexicographically_tag));
-
-namespace CartesianDKernelFunctors {
-template<class R_> struct Equal_points : private Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Equal_points)
- typedef R_ R;
- typedef typename Get_type<R, Bool_tag>::type result_type;
- typedef typename Get_functor<R, Construct_ttag<Point_cartesian_const_iterator_tag> >::type CI;
- // TODO: This is_exact thing should be reengineered.
- // the goal is to have a way to tell: don't filter this
- typedef typename CGAL::Is_exact<CI> Is_exact;
-
- template<class V,class W>
- result_type operator()(V const&a, W const&b)const{
- CI c(this->kernel());
-#ifdef CGAL_CXX11
- auto
-#else
- typename CI::result_type
-#endif
- a_begin=c(a,Begin_tag()),
- b_begin=c(b,Begin_tag()),
- a_end=c(a,End_tag());
- result_type res = true;
- // Is using CGAL::possibly for Uncertain really an optimization?
- do res = res & (*a_begin++ == *b_begin++);
- while(a_begin!=a_end && possibly(res));
- return res;
- }
-};
-}
-
-CGAL_KD_DEFAULT_FUNCTOR(Equal_points_tag,(CartesianDKernelFunctors::Equal_points<K>),(),(Construct_ttag<Point_cartesian_const_iterator_tag>));
-
-namespace CartesianDKernelFunctors {
-template<class R_> struct Oriented_side : private Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Oriented_side)
- typedef R_ R;
- typedef typename Get_type<R, Oriented_side_tag>::type result_type;
- typedef typename Get_type<R, Point_tag>::type Point;
- typedef typename Get_type<R, Hyperplane_tag>::type Hyperplane;
- typedef typename Get_type<R, Sphere_tag>::type Sphere;
- typedef typename Get_functor<R, Value_at_tag>::type VA;
- typedef typename Get_functor<R, Hyperplane_translation_tag>::type HT;
- typedef typename Get_functor<R, Squared_distance_tag>::type SD;
- typedef typename Get_functor<R, Squared_radius_tag>::type SR;
- typedef typename Get_functor<R, Center_of_sphere_tag>::type CS;
-
- result_type operator()(Hyperplane const&h, Point const&p)const{
- HT ht(this->kernel());
- VA va(this->kernel());
- return CGAL::compare(va(h,p),ht(h));
- }
- result_type operator()(Sphere const&s, Point const&p)const{
- SD sd(this->kernel());
- SR sr(this->kernel());
- CS cs(this->kernel());
- return CGAL::compare(sd(cs(s),p),sr(s));
- }
-};
-}
-
-CGAL_KD_DEFAULT_FUNCTOR(Oriented_side_tag,(CartesianDKernelFunctors::Oriented_side<K>),(Point_tag,Sphere_tag,Hyperplane_tag),(Value_at_tag,Hyperplane_translation_tag,Squared_distance_tag,Squared_radius_tag,Center_of_sphere_tag));
-
-namespace CartesianDKernelFunctors {
-template<class R_> struct Has_on_positive_side : private Store_kernel<R_> {
- CGAL_FUNCTOR_INIT_STORE(Has_on_positive_side)
- typedef R_ R;
- typedef typename Get_type<R, Bool_tag>::type result_type;
- typedef typename Get_functor<R, Oriented_side_tag>::type OS;
-
- template <class Obj, class Pt>
- result_type operator()(Obj const&o, Pt const&p)const{
- OS os(this->kernel());
- return os(o,p) == ON_POSITIVE_SIDE;
- }
-};
-}
-
-CGAL_KD_DEFAULT_FUNCTOR(Has_on_positive_side_tag,(CartesianDKernelFunctors::Has_on_positive_side<K>),(),(Oriented_side_tag));
-
-}
-#include <CGAL/NewKernel_d/Coaffine.h>
-#endif // CGAL_KERNEL_D_FUNCTION_OBJECTS_CARTESIAN_H
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/functor_properties.h b/include/gudhi_patches/CGAL/NewKernel_d/functor_properties.h
deleted file mode 100644
index c25c4e2b..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/functor_properties.h
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_EXACTNESS_H
-#define CGAL_EXACTNESS_H
-#include <boost/mpl/has_xxx.hpp>
-#include <CGAL/tags.h>
-namespace CGAL {
-
-#define CGAL_STRAWBERRY(Is_pretty) \
- namespace internal { \
- BOOST_MPL_HAS_XXX_TRAIT_DEF(Is_pretty) \
- } \
- template<class T,bool=internal::has_##Is_pretty<T>::value> \
- struct Is_pretty : boost::false_type {}; \
- template<class T> \
- struct Is_pretty<T,true> : T::Is_pretty {}
-
-CGAL_STRAWBERRY(Is_exact);
-CGAL_STRAWBERRY(Is_fast);
-CGAL_STRAWBERRY(Is_stored);
-#undef CGAL_STRAWBERRY
-}
-#endif // CGAL_EXACTNESS_H
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/functor_tags.h b/include/gudhi_patches/CGAL/NewKernel_d/functor_tags.h
deleted file mode 100644
index b8e17886..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/functor_tags.h
+++ /dev/null
@@ -1,363 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_FUNCTOR_TAGS_H
-#define CGAL_FUNCTOR_TAGS_H
-#include <CGAL/tags.h> // for Null_tag
-#include <CGAL/NewKernel_d/utils.h>
-#ifdef CGAL_CXX11
-#include <type_traits>
-#include <utility>
-#endif
-#include <boost/type_traits.hpp>
-#include <boost/mpl/has_xxx.hpp>
-#include <boost/mpl/not.hpp>
-#include <boost/mpl/if.hpp>
-#include <boost/mpl/vector.hpp>
-#include <boost/mpl/empty.hpp>
-#include <boost/mpl/front.hpp>
-#include <boost/mpl/pop_front.hpp>
-namespace CGAL {
-
- // Find a better place for this later
-
- template <class K, class T, class=void> struct Get_type
- : K::template Type<T> {};
- template <class K, class F, class O=void, class=void> struct Get_functor
- : K::template Functor<F, O> {};
-#ifdef CGAL_CXX11
- template <class K, class T> using Type = typename Get_type<K, T>::type;
- template <class K, class T> using Functor = typename Get_functor<K, T>::type;
-#endif
-
- class Null_type {~Null_type();}; // no such object should be created
-
- // To construct iterators
- struct Begin_tag {};
- struct End_tag {};
-
- // Functor category
- struct Predicate_tag {};
- struct Construct_tag {};
- struct Construct_iterator_tag {};
- struct Compute_tag {};
- struct Misc_tag {};
-
- struct No_filter_tag {};
-
- template<class>struct Construct_ttag {};
- template<class>struct Convert_ttag {};
-
- template <class K, class F, class=void, class=void> struct Get_functor_category { typedef Misc_tag type; };
- template<class Tg, class Obj, class Base> struct Typedef_tag_type;
- //template<class Kernel, class Tg> struct Read_tag_type {};
-
- template<class Kernel, class Tg>
- struct Provides_type
- : Has_type_different_from<Get_type<Kernel, Tg>, Null_type> {};
-
- template<class Kernel, class Tg, class O=void>
- struct Provides_functor
- : Has_type_different_from<Get_functor<Kernel, Tg, O>, Null_functor> {};
-
- template<class K, class List, bool=boost::mpl::empty<List>::type::value>
- struct Provides_functors : boost::mpl::and_ <
- Provides_functor<K, typename boost::mpl::front<List>::type>,
- Provides_functors<K, typename boost::mpl::pop_front<List>::type> > {};
- template<class K, class List>
- struct Provides_functors<K, List, true> : boost::true_type {};
-
- template<class K, class List, bool=boost::mpl::empty<List>::type::value>
- struct Provides_types : boost::mpl::and_ <
- Provides_type<K, typename boost::mpl::front<List>::type>,
- Provides_types<K, typename boost::mpl::pop_front<List>::type> > {};
- template<class K, class List>
- struct Provides_types<K, List, true> : boost::true_type {};
-
- namespace internal { BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(has_Type,template Type<Null_tag>,false) }
- template<class Kernel, class Tg,
- bool = internal::has_Type<Kernel>::value /* false */>
- struct Provides_type_i : boost::false_type {};
- template<class Kernel, class Tg>
- struct Provides_type_i <Kernel, Tg, true>
- : Has_type_different_from<typename Kernel::template Type<Tg>, Null_type> {};
-
- //// This version does not like Functor<T,bool=false>
- //namespace internal { BOOST_MPL_HAS_XXX_TEMPLATE_NAMED_DEF(has_Functor,Functor,false) }
- // This version lets us use non-type template parameters, but fails with older EDG-based compilers (Intel 14).
- namespace internal { BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(has_Functor,template Functor<Null_tag>,false) }
-
- template<class Kernel, class Tg, class O=void,
- bool = internal::has_Functor<Kernel>::value /* false */>
- struct Provides_functor_i : boost::false_type {};
- template<class Kernel, class Tg, class O>
- struct Provides_functor_i <Kernel, Tg, O, true>
- : Has_type_different_from<typename Kernel::template Functor<Tg, O>, Null_functor> {};
-
- // TODO: Refine this a bit.
- template <class K, class T, class D=void,
- //bool=Provides_functor<K,T>::value,
- //bool=Provides_functor_i<K,T>::value,
- bool = internal::has_Functor<K>::value
- >
- struct Inherit_functor : K::template Functor<T> {};
- template <class K, class T, class D>
- struct Inherit_functor <K, T, D, false> {};
-
- template <class K, class T, bool=internal::has_Type<K>::value>
- struct Inherit_type : K::template Type<T> {};
- template <class K, class T>
- struct Inherit_type <K, T, false> {};
-
- struct Number_tag {};
- struct Discrete_tag {};
- struct Object_tag {};
- template <class K, class T, class=void> struct Get_type_category {
- // The lazy kernel uses it too eagerly,
- // so it currently needs a default.
- typedef Null_tag type;
- };
-
-#define CGAL_DECL_OBJ_(X,Y) \
- template<class Obj,class Base> \
- struct Typedef_tag_type<X##_tag, Obj, Base> : Base { typedef Obj X; }; \
- template<class K, class D> \
- struct Get_type_category <K, X##_tag, D> { typedef Y##_tag type; }
-#define CGAL_DECL_OBJ(X,Y) struct X##_tag {}; \
- CGAL_DECL_OBJ_(X,Y)
-
- //namespace has_object { BOOST_MPL_HAS_XXX_TRAIT_DEF(X) }
- //template<class Kernel>
- //struct Provides_tag_type<Kernel, X##_tag> : has_object::has_##X<Kernel> {};
- //template<class Kernel>
- //struct Read_tag_type<Kernel, X##_tag> { typedef typename Kernel::X type; }
-
- // Not exactly objects, but the extras can't hurt.
- CGAL_DECL_OBJ(FT, Number);
- CGAL_DECL_OBJ(RT, Number);
-
- CGAL_DECL_OBJ(Bool, Discrete); // Boolean_tag is already taken, and is a template :-(
- CGAL_DECL_OBJ(Comparison_result, Discrete);
- CGAL_DECL_OBJ(Sign, Discrete);
- CGAL_DECL_OBJ(Orientation, Discrete); // Note: duplicate with the functor tag!
- CGAL_DECL_OBJ(Oriented_side, Discrete);
- CGAL_DECL_OBJ(Bounded_side, Discrete);
- CGAL_DECL_OBJ(Angle, Discrete);
- CGAL_DECL_OBJ(Flat_orientation, Discrete);
-
- CGAL_DECL_OBJ(Vector, Object);
- CGAL_DECL_OBJ(Point, Object);
- CGAL_DECL_OBJ(Segment, Object);
- CGAL_DECL_OBJ(Sphere, Object);
- CGAL_DECL_OBJ(Line, Object);
- CGAL_DECL_OBJ(Direction, Object);
- CGAL_DECL_OBJ(Hyperplane, Object);
- CGAL_DECL_OBJ(Ray, Object);
- CGAL_DECL_OBJ(Iso_box, Object);
- CGAL_DECL_OBJ(Bbox, Object);
- CGAL_DECL_OBJ(Aff_transformation, Object);
- CGAL_DECL_OBJ(Weighted_point, Object);
-#undef CGAL_DECL_OBJ_
-#undef CGAL_DECL_OBJ
-
-// Intel fails with those, and they are not so useful.
-// CGAL_KD_DEFAULT_TYPE(RT_tag,(typename Get_type<K, FT_tag>::type),(),());
-// CGAL_KD_DEFAULT_TYPE(FT_tag,(CGAL::Quotient<typename Get_type<K, RT_tag>::type>),(),());
-
-#define CGAL_SMURF2(A,B) CGAL_KD_DEFAULT_TYPE(A##_tag,(typename Same_uncertainty_nt<B, typename Get_type<K,RT_tag>::type>::type),(RT_tag),())
-#define CGAL_SMURF1(A) CGAL_SMURF2(A,CGAL::A)
- CGAL_SMURF2(Bool, bool);
- CGAL_SMURF1(Sign);
- CGAL_SMURF1(Comparison_result);
- CGAL_SMURF1(Orientation);
- CGAL_SMURF1(Oriented_side);
- CGAL_SMURF1(Bounded_side);
- CGAL_SMURF1(Angle);
-#undef CGAL_SMURF1
-#undef CGAL_SMURF2
-
- // TODO: replace with Get_type_category
- template<class> struct is_NT_tag { enum { value = false }; };
- template<> struct is_NT_tag<FT_tag> { enum { value = true }; };
- template<> struct is_NT_tag<RT_tag> { enum { value = true }; };
-
- template<class> struct iterator_tag_traits {
- enum { is_iterator = false, has_nth_element = false };
- typedef Null_tag value_tag;
- };
-
-#define CGAL_DECL_COMPUTE(X) struct X##_tag {}; \
- template<class A,class B,class C>struct Get_functor_category<A,X##_tag,B,C>{typedef Compute_tag type;}
- CGAL_DECL_COMPUTE(Compute_point_cartesian_coordinate);
- CGAL_DECL_COMPUTE(Compute_vector_cartesian_coordinate);
- CGAL_DECL_COMPUTE(Compute_homogeneous_coordinate);
- CGAL_DECL_COMPUTE(Squared_distance);
- CGAL_DECL_COMPUTE(Squared_distance_to_origin);
- CGAL_DECL_COMPUTE(Squared_length);
- CGAL_DECL_COMPUTE(Squared_radius);
- CGAL_DECL_COMPUTE(Squared_circumradius);
- CGAL_DECL_COMPUTE(Scalar_product);
- CGAL_DECL_COMPUTE(Hyperplane_translation);
- CGAL_DECL_COMPUTE(Value_at);
- CGAL_DECL_COMPUTE(Point_weight);
- CGAL_DECL_COMPUTE(Power_distance);
- CGAL_DECL_COMPUTE(Power_distance_to_point);
-#undef CGAL_DECL_COMPUTE
-
-#define CGAL_DECL_ITER_OBJ(X,Y,Z,C) struct X##_tag {}; \
- template<>struct iterator_tag_traits<X##_tag> { \
- enum { is_iterator = true, has_nth_element = true }; \
- typedef Y##_tag value_tag; \
- typedef Z##_tag nth_element; \
- typedef C##_tag container; \
- }; \
- template<class Obj,class Base> \
- struct Typedef_tag_type<X##_tag, Obj, Base> : Base { typedef Obj X; }
-
- //namespace has_object { BOOST_MPL_HAS_XXX_TRAIT_DEF(X) }
- //template<class Kernel>
- //struct Provides_tag_type<Kernel, X##_tag> : has_object::has_##X<Kernel> {};
- //template<class Kernel>
- //struct Read_tag_type<Kernel, X##_tag> { typedef typename Kernel::X type; }
-
- CGAL_DECL_ITER_OBJ(Vector_cartesian_const_iterator, FT, Compute_vector_cartesian_coordinate, Vector);
- CGAL_DECL_ITER_OBJ(Point_cartesian_const_iterator, FT, Compute_point_cartesian_coordinate, Point);
-#undef CGAL_DECL_ITER_OBJ
-
- template<class>struct map_result_tag{typedef Null_type type;};
- template<class T>struct map_result_tag<Construct_ttag<T> >{typedef T type;};
-
- template<class A,class T,class B,class C>struct Get_functor_category<A,Construct_ttag<T>,B,C> :
- boost::mpl::if_c<iterator_tag_traits<T>::is_iterator,
- Construct_iterator_tag,
- Construct_tag> {};
-
- // Really?
- template<class A,class T,class B,class C>struct Get_functor_category<A,Convert_ttag<T>,B,C>{typedef Misc_tag type;};
-
-#define CGAL_DECL_CONSTRUCT(X,Y) struct X##_tag {}; \
- template<>struct map_result_tag<X##_tag>{typedef Y##_tag type;}; \
- template<class A,class B,class C>struct Get_functor_category<A,X##_tag,B,C>{typedef Construct_tag type;}
- CGAL_DECL_CONSTRUCT(Midpoint,Point);
- CGAL_DECL_CONSTRUCT(Center_of_sphere,Point);
- CGAL_DECL_CONSTRUCT(Point_of_sphere,Point);
- CGAL_DECL_CONSTRUCT(Segment_extremity,Point);
- CGAL_DECL_CONSTRUCT(Sum_of_vectors,Vector);
- CGAL_DECL_CONSTRUCT(Difference_of_vectors,Vector);
- CGAL_DECL_CONSTRUCT(Opposite_vector,Vector);
- CGAL_DECL_CONSTRUCT(Scaled_vector,Vector);
- CGAL_DECL_CONSTRUCT(Orthogonal_vector,Vector);
- CGAL_DECL_CONSTRUCT(Difference_of_points,Vector);
- CGAL_DECL_CONSTRUCT(Translated_point,Point);
- CGAL_DECL_CONSTRUCT(Point_to_vector,Vector);
- CGAL_DECL_CONSTRUCT(Vector_to_point,Point);
- CGAL_DECL_CONSTRUCT(Construct_min_vertex,Point);
- CGAL_DECL_CONSTRUCT(Construct_max_vertex,Point);
- CGAL_DECL_CONSTRUCT(Construct_circumcenter,Point);
- CGAL_DECL_CONSTRUCT(Point_drop_weight,Point);
- CGAL_DECL_CONSTRUCT(Power_center,Weighted_point);
-#undef CGAL_DECL_CONSTRUCT
-#if 0
-#define CGAL_DECL_ITER_CONSTRUCT(X,Y) struct X##_tag {}; \
- template<>struct map_result_tag<X##_tag>{typedef Y##_tag type;}; \
- template<>struct map_functor_type<X##_tag>{typedef Construct_iterator_tag type;}
- CGAL_DECL_ITER_CONSTRUCT(Construct_point_cartesian_const_iterator,Point_cartesian_const_iterator);
- CGAL_DECL_ITER_CONSTRUCT(Construct_vector_cartesian_const_iterator,Vector_cartesian_const_iterator);
-#undef CGAL_DECL_ITER_CONSTRUCT
-#endif
-
- //FIXME: choose a convention: prefix with Predicate_ ?
-#define CGAL_DECL_PREDICATE_(X) \
- template<class A,class B,class C>struct Get_functor_category<A,X##_tag,B,C>{typedef Predicate_tag type;}
-#define CGAL_DECL_PREDICATE(X) struct X##_tag {}; \
- CGAL_DECL_PREDICATE_(X)
- CGAL_DECL_PREDICATE(Less_point_cartesian_coordinate);
- CGAL_DECL_PREDICATE(Compare_point_cartesian_coordinate);
- CGAL_DECL_PREDICATE(Compare_distance);
- CGAL_DECL_PREDICATE(Compare_lexicographically);
- CGAL_DECL_PREDICATE(Less_lexicographically);
- CGAL_DECL_PREDICATE(Less_or_equal_lexicographically);
- CGAL_DECL_PREDICATE(Equal_points);
- CGAL_DECL_PREDICATE(Has_on_positive_side);
- CGAL_DECL_PREDICATE_(Orientation); // duplicate with the type
- CGAL_DECL_PREDICATE_(Oriented_side); // duplicate with the type
- CGAL_DECL_PREDICATE(Orientation_of_points);
- CGAL_DECL_PREDICATE(Orientation_of_vectors);
- CGAL_DECL_PREDICATE(Side_of_oriented_sphere);
- CGAL_DECL_PREDICATE(Side_of_bounded_sphere);
- CGAL_DECL_PREDICATE(Side_of_bounded_circumsphere);
- CGAL_DECL_PREDICATE(Contained_in_affine_hull);
- CGAL_DECL_PREDICATE(In_flat_orientation);
- CGAL_DECL_PREDICATE(In_flat_side_of_oriented_sphere);
- CGAL_DECL_PREDICATE(Construct_flat_orientation); // Making it a predicate is a questionable choice, it should be possible to let it be a construction for some implementations. Not sure how to do that... TODO
- CGAL_DECL_PREDICATE(Linear_rank);
- CGAL_DECL_PREDICATE(Affine_rank);
- CGAL_DECL_PREDICATE(Linearly_independent);
- CGAL_DECL_PREDICATE(Affinely_independent);
- CGAL_DECL_PREDICATE(Contained_in_linear_hull);
- CGAL_DECL_PREDICATE(Contained_in_simplex);
- CGAL_DECL_PREDICATE(Power_side_of_power_sphere_raw);
- CGAL_DECL_PREDICATE(Power_side_of_power_sphere);
- CGAL_DECL_PREDICATE(In_flat_power_side_of_power_sphere_raw);
- CGAL_DECL_PREDICATE(In_flat_power_side_of_power_sphere);
-#undef CGAL_DECL_PREDICATE
-
-#define CGAL_DECL_MISC(X) struct X##_tag {}; \
- template<class A,class B,class C>struct Get_functor_category<A,X##_tag,B,C>{typedef Misc_tag type;}
- //TODO: split into _begin and _end ?
- //CGAL_DECL_MISC(Construct_point_cartesian_const_iterator);
- //CGAL_DECL_MISC(Construct_vector_cartesian_const_iterator);
- CGAL_DECL_MISC(Point_dimension);
- CGAL_DECL_MISC(Vector_dimension);
- CGAL_DECL_MISC(Linear_base); // Find a more appropriate category?
-#undef CGAL_DECL_MISC
-
-
- // Properties for LA
- struct Has_extra_dimension_tag {};
- struct Has_vector_plus_minus_tag {};
- struct Has_vector_scalar_ops_tag {};
- struct Has_dot_product_tag {};
- struct Has_determinant_of_vectors_tag {};
- struct Has_determinant_of_points_tag {};
- struct Has_determinant_of_iterator_to_vectors_tag {};
- struct Has_determinant_of_iterator_to_points_tag {};
- struct Has_determinant_of_vectors_omit_last_tag {};
- struct Stores_squared_norm_tag {};
-
- template<class> struct Preserved_by_non_linear_extra_coordinate
- : boost::false_type {};
- template<> struct Preserved_by_non_linear_extra_coordinate
- <Has_extra_dimension_tag> : boost::true_type {};
- template<> struct Preserved_by_non_linear_extra_coordinate
- <Has_determinant_of_vectors_tag> : boost::true_type {};
- template<> struct Preserved_by_non_linear_extra_coordinate
- <Has_determinant_of_points_tag> : boost::true_type {};
- template<> struct Preserved_by_non_linear_extra_coordinate
- <Has_determinant_of_iterator_to_vectors_tag> : boost::true_type {};
- template<> struct Preserved_by_non_linear_extra_coordinate
- <Has_determinant_of_iterator_to_points_tag> : boost::true_type {};
- template<> struct Preserved_by_non_linear_extra_coordinate
- <Has_determinant_of_vectors_omit_last_tag> : boost::true_type {};
-
- // Kernel properties
- struct Point_stores_squared_distance_to_origin_tag {};
-
-}
-#endif // CGAL_FUNCTOR_TAGS_H
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/static_int.h b/include/gudhi_patches/CGAL/NewKernel_d/static_int.h
deleted file mode 100644
index 21858804..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/static_int.h
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_STATIC_INT_H
-#define CGAL_STATIC_INT_H
-#include <CGAL/constant.h>
-
-namespace CGAL {
-template <class NT> struct static_zero {
- operator NT() const { return constant<NT,0>(); }
-};
-template <class NT> struct static_one {
- operator NT() const { return constant<NT,1>(); }
-};
-
-template <class NT> static_zero<NT> operator-(static_zero<NT>) { return static_zero<NT>(); }
-
-template <class NT> NT operator+(NT const& x, static_zero<NT>) { return x; }
-template <class NT> NT operator+(static_zero<NT>, NT const& x) { return x; }
-template <class NT> static_zero<NT> operator+(static_zero<NT>, static_zero<NT>) { return static_zero<NT>(); }
-template <class NT> static_one<NT> operator+(static_zero<NT>, static_one<NT>) { return static_one<NT>(); }
-template <class NT> static_one<NT> operator+(static_one<NT>, static_zero<NT>) { return static_one<NT>(); }
-
-template <class NT> NT operator-(NT const& x, static_zero<NT>) { return x; }
-template <class NT> NT operator-(static_zero<NT>, NT const& x) { return -x; }
-template <class NT> static_zero<NT> operator-(static_zero<NT>, static_zero<NT>) { return static_zero<NT>(); }
-template <class NT> static_zero<NT> operator-(static_one<NT>, static_one<NT>) { return static_zero<NT>(); }
-template <class NT> static_one<NT> operator-(static_one<NT>, static_zero<NT>) { return static_one<NT>(); }
-
-template <class NT> NT operator*(NT const& x, static_one<NT>) { return x; }
-template <class NT> NT operator*(static_one<NT>, NT const& x) { return x; }
-template <class NT> static_zero<NT> operator*(NT const&, static_zero<NT>) { return static_zero<NT>(); }
-template <class NT> static_zero<NT> operator*(static_zero<NT>, NT const&) { return static_zero<NT>(); }
-template <class NT> static_zero<NT> operator*(static_zero<NT>, static_zero<NT>) { return static_zero<NT>(); }
-template <class NT> static_one<NT> operator*(static_one<NT>, static_one<NT>) { return static_one<NT>(); }
-template <class NT> static_zero<NT> operator*(static_zero<NT>, static_one<NT>) { return static_zero<NT>(); }
-template <class NT> static_zero<NT> operator*(static_one<NT>, static_zero<NT>) { return static_zero<NT>(); }
-
-template <class NT> NT operator/(NT const& x, static_one<NT>) { return x; }
-template <class NT> static_zero<NT> operator/(static_zero<NT>, NT const&) { return static_zero<NT>(); }
-template <class NT> static_zero<NT> operator/(static_zero<NT>, static_one<NT>) { return static_zero<NT>(); }
-template <class NT> static_one<NT> operator/(static_one<NT>, static_one<NT>) { return static_one<NT>(); }
-
-}
-#endif // CGAL_STATIC_INT_H
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/store_kernel.h b/include/gudhi_patches/CGAL/NewKernel_d/store_kernel.h
deleted file mode 100644
index 253e1282..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/store_kernel.h
+++ /dev/null
@@ -1,104 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_STORE_KERNEL_H
-#define CGAL_STORE_KERNEL_H
-
-#include <CGAL/assertions.h>
-#include <boost/type_traits/is_empty.hpp>
-
-namespace CGAL {
-namespace internal {
-BOOST_MPL_HAS_XXX_TRAIT_DEF(Do_not_store_kernel)
-template<class T,bool=boost::is_empty<T>::value,bool=has_Do_not_store_kernel<T>::value> struct Do_not_store_kernel {
- enum { value=false };
- typedef Tag_false type;
-};
-template<class T> struct Do_not_store_kernel<T,true,false> {
- enum { value=true };
- typedef Tag_true type;
-};
-template<class T,bool b> struct Do_not_store_kernel<T,b,true> {
- typedef typename T::Do_not_store_kernel type;
- enum { value=type::value };
-};
-}
-
-template<class R_,bool=internal::Do_not_store_kernel<R_>::value>
-struct Store_kernel {
- Store_kernel(){}
- Store_kernel(R_ const&){}
- enum { kernel_is_stored = false };
- R_ kernel()const{return R_();}
- typedef R_ reference_type;
- void set_kernel(R_ const&){}
-};
-template<class R_>
-struct Store_kernel<R_,false> {
- Store_kernel():rp(0){
- CGAL_warning_msg(true,"I should know my kernel");
- }
- Store_kernel(R_ const& r):rp(&r){}
- enum { kernel_is_stored = true };
- R_ const& kernel()const{
- CGAL_warning_msg(rp!=0,"I should know my kernel");
- return *rp;
- }
- typedef R_ const& reference_type;
- void set_kernel(R_ const&r){rp=&r;}
- private:
- R_ const* rp;
-};
-
-//For a second kernel. TODO: find something more elegant
-template<class R_,bool=internal::Do_not_store_kernel<R_>::value>
-struct Store_kernel2 {
- Store_kernel2(){}
- Store_kernel2(R_ const&){}
- enum { kernel2_is_stored = false };
- R_ kernel2()const{return R_();}
- typedef R_ reference2_type;
- void set_kernel2(R_ const&){}
-};
-template<class R_>
-struct Store_kernel2<R_,false> {
- Store_kernel2(){
- //CGAL_warning_msg(true,"I should know my kernel");
- }
- Store_kernel2(R_ const& r):rp(&r){}
- enum { kernel2_is_stored = true };
- R_ const& kernel2()const{
- CGAL_warning_msg(rp==0,"I should know my kernel");
- return *rp;
- }
- typedef R_ const& reference2_type;
- void set_kernel2(R_ const&r){rp=&r;}
- private:
- R_ const* rp;
-};
-}
-#define CGAL_BASE_INIT(X,Y) \
- X():Y(){} \
- X(R_ const&r):Y(r){}
-#define CGAL_FUNCTOR_INIT_STORE(X) CGAL_BASE_INIT(X,Store_kernel<R_>)
-#define CGAL_FUNCTOR_INIT_IGNORE(X) \
- X(){} \
- X(R_ const&){}
-
-#endif // CGAL_STORE_KERNEL_H
diff --git a/include/gudhi_patches/CGAL/NewKernel_d/utils.h b/include/gudhi_patches/CGAL/NewKernel_d/utils.h
deleted file mode 100644
index 238a2230..00000000
--- a/include/gudhi_patches/CGAL/NewKernel_d/utils.h
+++ /dev/null
@@ -1,306 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_MARCUTILS
-#define CGAL_MARCUTILS
-
-#include <CGAL/config.h>
-
-#if defined(BOOST_MSVC)
-# pragma warning(push)
-# pragma warning(disable:4003) // not enough actual parameters for macro 'BOOST_PP_EXPAND_I'
- // http://lists.boost.org/boost-users/2014/11/83291.php
-#endif
-
-#ifdef CGAL_CXX11
-#include <type_traits>
-#include <utility>
-#define CGAL_FORWARDABLE(T) T&&
-#define CGAL_FORWARD(T,t) std::forward<T>(t)
-#define CGAL_MOVE(t) std::move(t)
-#define CGAL_CONSTEXPR constexpr
-#else
-#define CGAL_FORWARDABLE(T) T const&
-#define CGAL_FORWARD(T,t) t
-#define CGAL_MOVE(t) t
-#define CGAL_CONSTEXPR
-#endif
-#include <boost/utility/enable_if.hpp>
-#include <boost/preprocessor/repetition.hpp>
-#include <CGAL/Rational_traits.h>
-#include <CGAL/tuple.h>
-#include <boost/mpl/has_xxx.hpp>
-#include <boost/mpl/not.hpp>
-#include <boost/type_traits.hpp>
-
-#ifdef CGAL_CXX11
-#define CGAL_BOOSTD std::
-#else
-#define CGAL_BOOSTD boost::
-#endif
-
-namespace CGAL {
-namespace internal {
- BOOST_MPL_HAS_XXX_TRAIT_DEF(type)
-}
-
-template <class T, class No, bool=internal::has_type<T>::value /*false*/>
-struct Has_type_different_from : boost::false_type {};
-template <class T, class No>
-struct Has_type_different_from <T, No, true>
-: boost::mpl::not_<boost::is_same<typename T::type, No> > {};
-
-
- template <class T> struct Wrap_type { typedef T type; };
-
- // tell a function f(a,b,c) that its real argument is a(b,c)
- struct Eval_functor {};
-
- // forget the first argument. Useful to make something dependant
- // (and thus usable in SFINAE), although that's not a great design.
- template<class A,class B> struct Second_arg {
- typedef B type;
- };
-
- // like std::forward, except for basic types where it does a cast, to
- // avoid issues with narrowing conversions
-#ifdef CGAL_CXX11
- template<class T,class U,class V> inline
- typename std::conditional<std::is_arithmetic<T>::value&&std::is_arithmetic<typename std::remove_reference<U>::type>::value,T,U&&>::type
- forward_safe(V&& u) { return std::forward<U>(u); }
-#else
- template<class T,class U> inline U const& forward_safe(U const& u) {
- return u;
- }
-#endif
-
-#ifdef CGAL_CXX11
- template<class...> struct Constructible_from_each;
- template<class To,class From1,class...From> struct Constructible_from_each<To,From1,From...>{
- enum { value=std::is_convertible<From1,To>::value&&Constructible_from_each<To,From...>::value };
- };
- template<class To> struct Constructible_from_each<To>{
- enum { value=true };
- };
-#else
-// currently only used in C++0X code
-#endif
-
- template<class T> struct Scale {
-#ifndef CGAL_CXX11
- template<class> struct result;
- template<class FT> struct result<Scale(FT)> {
- typedef FT type;
- };
-#endif
- T const& scale;
- Scale(T const& t):scale(t){}
- template<class FT>
-#ifdef CGAL_CXX11
- auto operator()(FT&& x)const->decltype(scale*std::forward<FT>(x))
-#else
- FT operator()(FT const& x)const
-#endif
- {
- return scale*CGAL_FORWARD(FT,x);
- }
- };
- template<class NT,class T> struct Divide {
-#if !defined(CGAL_CXX11) || !defined(BOOST_RESULT_OF_USE_DECLTYPE)
- // requires boost > 1.44
- // shouldn't be needed with C++0X
- //template<class> struct result;
- //template<class FT> struct result<Divide(FT)> {
- // typedef FT type;
- //};
- typedef NT result_type;
-#endif
- T const& scale;
- Divide(T const& t):scale(t){}
- template<class FT>
-#ifdef CGAL_CXX11
- //FIXME: gcc complains for Gmpq
- //auto operator()(FT&& x)const->decltype(Rational_traits<NT>().make_rational(std::forward<FT>(x),scale))
- NT operator()(FT&& x)const
-#else
- NT operator()(FT const& x)const
-#endif
- {
- return Rational_traits<NT>().
- make_rational(CGAL_FORWARD(FT,x),scale);
- }
- };
-
- template <class NT> struct has_cheap_constructor : boost::is_arithmetic<NT>{};
- template <bool p> struct has_cheap_constructor<Interval_nt<p> > {
- enum { value=true };
- };
-
- // like std::multiplies but allows mixing types
- // in C++11 in doesn't need to be a template
- template < class Ret >
- struct multiplies {
- template<class A,class B>
-#ifdef CGAL_CXX11
- auto operator()(A&&a,B&&b)const->decltype(std::forward<A>(a)*std::forward<B>(b))
-#else
- Ret operator()(A const& a, B const& b)const
-#endif
- {
- return CGAL_FORWARD(A,a)*CGAL_FORWARD(B,b);
- }
- };
- template < class Ret >
- struct division {
- template<class A,class B>
-#ifdef CGAL_CXX11
- auto operator()(A&&a,B&&b)const->decltype(std::forward<A>(a)/std::forward<B>(b))
-#else
- Ret operator()(A const& a, B const& b)const
-#endif
- {
- return CGAL_FORWARD(A,a)/CGAL_FORWARD(B,b);
- }
- };
-
-#ifdef CGAL_CXX11
- using std::decay;
-#else
- template<class T> struct decay : boost::remove_cv<typename boost::decay<T>::type> {};
-#endif
-
- template<class T,class U> struct Type_copy_ref { typedef U type; };
- template<class T,class U> struct Type_copy_ref<T&,U> { typedef U& type; };
-#ifdef CGAL_CXX11
- template<class T,class U> struct Type_copy_ref<T&&,U> { typedef U&& type; };
-#endif
- template<class T,class U> struct Type_copy_cv { typedef U type; };
- template<class T,class U> struct Type_copy_cv<T const,U> { typedef U const type; };
- template<class T,class U> struct Type_copy_cv<T volatile,U> { typedef U volatile type; };
- template<class T,class U> struct Type_copy_cv<T const volatile,U> { typedef U const volatile type; };
-
- template<class T,class U> struct Type_copy_cvref :
- Type_copy_ref<T,typename Type_copy_cv<typename boost::remove_reference<T>::type,U>::type> {};
-
- struct Dereference_functor {
- template<class> struct result{};
- template<class It> struct result<Dereference_functor(It)> {
- typedef typename std::iterator_traits<It>::reference type;
- };
- template<class It> typename result<Dereference_functor(It)>::type
- operator()(It const&i)const{
- return *i;
- }
- };
-
-#ifdef CGAL_CXX11
- template<int...> struct Indices{};
- template<class> struct Next_increasing_indices;
- template<int...I> struct Next_increasing_indices<Indices<I...> > {
- typedef Indices<I...,sizeof...(I)> type;
- };
- template<int N> struct N_increasing_indices {
- typedef typename Next_increasing_indices<typename N_increasing_indices<N-1>::type>::type type;
- };
- template<> struct N_increasing_indices<0> { typedef Indices<> type; };
- namespace internal {
- template<class F,class...U,int...I> inline typename std::result_of<F&&(U...)>::type
- do_call_on_tuple_elements(F&&f, std::tuple<U...>&&t, Indices<I...>&&) {
- return f(std::get<I>(std::move(t))...);
- }
- } // internal
- template<class/*result type, ignored*/,class F,class...U>
- inline typename std::result_of<F&&(U...)>::type
- call_on_tuple_elements(F&&f, std::tuple<U...>&&t) {
- return internal::do_call_on_tuple_elements(std::forward<F>(f),std::move(t),
- typename N_increasing_indices<sizeof...(U)>::type());
- }
-#else
-#define CGAL_VAR(Z,N,_) cpp0x::get<N>(t)
-#define CGAL_CODE(Z,N,_) template<class Res, class F BOOST_PP_COMMA_IF(N) BOOST_PP_ENUM_PARAMS(N,class U)> \
- inline Res call_on_tuple_elements(F const&f, \
- cpp0x::tuple<BOOST_PP_ENUM_PARAMS(N,U)> const&t) { \
- return f(BOOST_PP_ENUM(N,CGAL_VAR,)); \
- }
- template<class Res, class F>
- inline Res call_on_tuple_elements(F const&f, cpp0x::tuple<>) {
- return f();
- }
-BOOST_PP_REPEAT_FROM_TO(1, 8, CGAL_CODE, _ )
-#undef CGAL_CODE
-#undef CGAL_VAR
-#endif
-
- template<class A> struct Factory {
- typedef A result_type;
-#ifdef CGAL_CXX11
- template<class...U> result_type operator()(U&&...u)const{
- return A(std::forward<U>(u)...);
- }
-#else
- result_type operator()()const{
- return A();
- }
-#define CGAL_CODE(Z,N,_) template<BOOST_PP_ENUM_PARAMS(N,class U)> \
- result_type operator()(BOOST_PP_ENUM_BINARY_PARAMS(N,U,const&u))const{ \
- return A(BOOST_PP_ENUM_PARAMS(N,u)); \
- }
-BOOST_PP_REPEAT_FROM_TO(1, 8, CGAL_CODE, _ )
-#undef CGAL_CODE
-#endif
- };
-}
-
-// TODO: make a Cartesian-only variant
-// WARNING: do not use the Req* parameters too much, they can cause circular instanciations and are only useful for dispatching.
-#define CGAL_STRIP_PAREN_(...) __VA_ARGS__
-#define CGAL_STRIP_PAREN(...) CGAL_STRIP_PAREN_ __VA_ARGS__
-// What to do with O? pass it down to other functors or drop it?
-#define CGAL_KD_DEFAULT_FUNCTOR(Tg,Name,ReqTyp,ReqFun) \
- template <class K, class O> \
- struct Get_functor<K, Tg, O, \
- typename boost::mpl::if_c< \
- Provides_functor_i<K, Tg, O>::value \
- || !Provides_types<K, boost::mpl::vector<CGAL_STRIP_PAREN_ ReqTyp> >::value \
- || !Provides_functors<K, boost::mpl::vector<CGAL_STRIP_PAREN_ ReqFun> >::value \
- , int, void>::type> \
- { \
- typedef CGAL_STRIP_PAREN_ Name type; \
- typedef K Bound_kernel; \
- }
-
-// Not used yet, may need some changes.
-#define CGAL_KD_DEFAULT_TYPE(Tg,Name,ReqTyp,ReqFun) \
- template <class K> \
- struct Get_type<K, Tg, \
- typename boost::mpl::if_c< \
- Provides_type_i<K, Tg>::value \
- || !Provides_types<K, boost::mpl::vector<CGAL_STRIP_PAREN_ ReqTyp> >::value \
- || !Provides_functors<K, boost::mpl::vector<CGAL_STRIP_PAREN_ ReqFun> >::value \
- , int, void>::type> \
- { \
- typedef CGAL_STRIP_PAREN_ Name type; \
- typedef K Bound_kernel; \
- }
-
-#if defined(BOOST_MSVC)
-# pragma warning(pop)
-#endif
-
-#endif
diff --git a/include/gudhi_patches/CGAL/Orthogonal_incremental_neighbor_search.h b/include/gudhi_patches/CGAL/Orthogonal_incremental_neighbor_search.h
deleted file mode 100644
index e29ce14f..00000000
--- a/include/gudhi_patches/CGAL/Orthogonal_incremental_neighbor_search.h
+++ /dev/null
@@ -1,620 +0,0 @@
-// Copyright (c) 2002,2011 Utrecht University (The Netherlands).
-// All rights reserved.
-//
-// This file is part of CGAL (www.cgal.org).
-// 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.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-//
-// Author(s) : Hans Tangelder (<hanst@cs.uu.nl>)
-
-#ifndef CGAL_ORTHOGONAL_INCREMENTAL_NEIGHBOR_SEARCH
-#define CGAL_ORTHOGONAL_INCREMENTAL_NEIGHBOR_SEARCH
-
-#include <CGAL/Kd_tree.h>
-#include <cstring>
-#include <list>
-#include <queue>
-#include <memory>
-#include <CGAL/Euclidean_distance.h>
-#include <CGAL/tuple.h>
-
-namespace CGAL {
-
- template <class SearchTraits,
- class Distance_= typename internal::Spatial_searching_default_distance<SearchTraits>::type,
- class Splitter_ = Sliding_midpoint<SearchTraits>,
- class Tree_= Kd_tree<SearchTraits, Splitter_, Tag_true> >
- class Orthogonal_incremental_neighbor_search {
-
- public:
- typedef Splitter_ Splitter;
- typedef Tree_ Tree;
- typedef Distance_ Distance;
- typedef typename SearchTraits::Point_d Point_d;
- typedef typename Distance::Query_item Query_item;
- typedef typename SearchTraits::FT FT;
- typedef typename Tree::Point_d_iterator Point_d_iterator;
- typedef typename Tree::Node_const_handle Node_const_handle;
-
- typedef std::pair<Point_d,FT> Point_with_transformed_distance;
- typedef CGAL::cpp11::tuple<Node_const_handle,FT,std::vector<FT> > Node_with_distance;
- typedef std::vector<Node_with_distance*> Node_with_distance_vector;
- typedef std::vector<Point_with_transformed_distance*> Point_with_transformed_distance_vector;
-
- template<class T>
- struct Object_wrapper
- {
- T object;
- Object_wrapper(const T& t):object(t){}
- const T& operator* () const { return object; }
- const T* operator-> () const { return &object; }
- };
-
- class Iterator_implementation {
- SearchTraits traits;
- public:
-
- int number_of_neighbours_computed;
- int number_of_internal_nodes_visited;
- int number_of_leaf_nodes_visited;
- int number_of_items_visited;
-
- private:
-
- typedef std::vector<FT> Distance_vector;
-
- Distance_vector dists;
-
- Distance Orthogonal_distance_instance;
-
- FT multiplication_factor;
-
- Query_item query_point;
-
- FT distance_to_root;
-
- bool search_nearest_neighbour;
-
- FT rd;
-
-
- class Priority_higher {
- public:
-
- bool search_nearest;
-
- Priority_higher(bool search_the_nearest_neighbour)
- : search_nearest(search_the_nearest_neighbour)
- {}
-
- //highest priority is smallest distance
- bool
- operator() (Node_with_distance* n1, Node_with_distance* n2) const
- {
- return (search_nearest) ? (CGAL::cpp11::get<1>(*n1) > CGAL::cpp11::get<1>(*n2)) : (CGAL::cpp11::get<1>(*n2) > CGAL::cpp11::get<1>(*n1));
- }
- };
-
- class Distance_smaller {
-
- public:
-
- bool search_nearest;
-
- Distance_smaller(bool search_the_nearest_neighbour)
- : search_nearest(search_the_nearest_neighbour)
- {}
-
- //highest priority is smallest distance
- bool operator() (Point_with_transformed_distance* p1, Point_with_transformed_distance* p2) const
- {
- return (search_nearest) ? (p1->second > p2->second) : (p2->second > p1->second);
- }
- };
-
-
- std::priority_queue<Node_with_distance*, Node_with_distance_vector,
- Priority_higher> PriorityQueue;
-
- public:
- std::priority_queue<Point_with_transformed_distance*, Point_with_transformed_distance_vector,
- Distance_smaller> Item_PriorityQueue;
-
-
- public:
-
- int reference_count;
-
-
-
- // constructor
- Iterator_implementation(const Tree& tree,const Query_item& q, const Distance& tr,
- FT Eps=FT(0.0), bool search_nearest=true)
- : traits(tree.traits()),number_of_neighbours_computed(0), number_of_internal_nodes_visited(0),
- number_of_leaf_nodes_visited(0), number_of_items_visited(0),
- Orthogonal_distance_instance(tr), multiplication_factor(Orthogonal_distance_instance.transformed_distance(FT(1.0)+Eps)),
- query_point(q), search_nearest_neighbour(search_nearest),
- PriorityQueue(Priority_higher(search_nearest)), Item_PriorityQueue(Distance_smaller(search_nearest)),
- reference_count(1)
-
-
- {
- if (tree.empty()) return;
-
- typename SearchTraits::Construct_cartesian_const_iterator_d ccci=traits.construct_cartesian_const_iterator_d_object();
- int dim = static_cast<int>(std::distance(ccci(q), ccci(q,0)));
-
- dists.resize(dim);
- for(int i=0 ; i<dim ; ++i){
- dists[i] = 0;
- }
-
- if (search_nearest){
- distance_to_root=
- Orthogonal_distance_instance.min_distance_to_rectangle(q, tree.bounding_box(),dists);
- Node_with_distance *The_Root = new Node_with_distance(tree.root(),
- distance_to_root, dists);
- PriorityQueue.push(The_Root);
-
- // rd is the distance of the top of the priority queue to q
- rd=CGAL::cpp11::get<1>(*The_Root);
- Compute_the_next_nearest_neighbour();
- }
- else{
- distance_to_root=
- Orthogonal_distance_instance.max_distance_to_rectangle(q,
- tree.bounding_box(), dists);
- Node_with_distance *The_Root = new Node_with_distance(tree.root(),
- distance_to_root, dists);
- PriorityQueue.push(The_Root);
-
- // rd is the distance of the top of the priority queue to q
- rd=CGAL::cpp11::get<1>(*The_Root);
- Compute_the_next_furthest_neighbour();
- }
-
-
- }
-
- // * operator
- const Point_with_transformed_distance&
- operator* () const
- {
- return *(Item_PriorityQueue.top());
- }
-
- // prefix operator
- Iterator_implementation&
- operator++()
- {
- Delete_the_current_item_top();
- if(search_nearest_neighbour)
- Compute_the_next_nearest_neighbour();
- else
- Compute_the_next_furthest_neighbour();
- return *this;
- }
-
- // postfix operator
- Object_wrapper<Point_with_transformed_distance>
- operator++(int)
- {
- Object_wrapper<Point_with_transformed_distance> result( *(Item_PriorityQueue.top()) );
- ++*this;
- return result;
- }
-
- // Print statistics of the general priority search process.
- std::ostream&
- statistics (std::ostream& s) const {
- s << "Orthogonal priority search statistics:"
- << std::endl;
- s << "Number of internal nodes visited:"
- << number_of_internal_nodes_visited << std::endl;
- s << "Number of leaf nodes visited:"
- << number_of_leaf_nodes_visited << std::endl;
- s << "Number of items visited:"
- << number_of_items_visited << std::endl;
- s << "Number of neighbours computed:"
- << number_of_neighbours_computed << std::endl;
- return s;
- }
-
-
- //destructor
- ~Iterator_implementation()
- {
- while (!PriorityQueue.empty()) {
- Node_with_distance* The_top=PriorityQueue.top();
- PriorityQueue.pop();
- delete The_top;
- }
- while (!Item_PriorityQueue.empty()) {
- Point_with_transformed_distance* The_top=Item_PriorityQueue.top();
- Item_PriorityQueue.pop();
- delete The_top;
- }
- }
-
- private:
-
- void
- Delete_the_current_item_top()
- {
- Point_with_transformed_distance* The_item_top=Item_PriorityQueue.top();
- Item_PriorityQueue.pop();
- delete The_item_top;
- }
-
- void
- Compute_the_next_nearest_neighbour()
- {
- // compute the next item
- bool next_neighbour_found=false;
- if (!(Item_PriorityQueue.empty())) {
- next_neighbour_found=
- (multiplication_factor*rd > Item_PriorityQueue.top()->second);
- }
- typename SearchTraits::Construct_cartesian_const_iterator_d construct_it=traits.construct_cartesian_const_iterator_d_object();
- typename SearchTraits::Cartesian_const_iterator_d query_point_it = construct_it(query_point);
- // otherwise browse the tree further
- while ((!next_neighbour_found) && (!PriorityQueue.empty())) {
- Node_with_distance* The_node_top=PriorityQueue.top();
- Node_const_handle N= CGAL::cpp11::get<0>(*The_node_top);
- dists = CGAL::cpp11::get<2>(*The_node_top);
- PriorityQueue.pop();
- delete The_node_top;
- FT copy_rd=rd;
- while (!(N->is_leaf())) { // compute new distance
- typename Tree::Internal_node_const_handle node =
- static_cast<typename Tree::Internal_node_const_handle>(N);
- number_of_internal_nodes_visited++;
- int new_cut_dim=node->cutting_dimension();
- FT new_rd,dst = dists[new_cut_dim];
- FT val = *(query_point_it + new_cut_dim);
- FT diff1 = val - node->upper_low_value();
- FT diff2 = val - node->lower_high_value();
- if (diff1 + diff2 < FT(0.0)) {
- new_rd=
- Orthogonal_distance_instance.new_distance(copy_rd,dst,diff1,new_cut_dim);
-
- CGAL_assertion(new_rd >= copy_rd);
- dists[new_cut_dim] = diff1;
- Node_with_distance *Upper_Child =
- new Node_with_distance(node->upper(), new_rd, dists);
- PriorityQueue.push(Upper_Child);
- dists[new_cut_dim] = dst;
- N=node->lower();
-
- }
- else { // compute new distance
- new_rd=Orthogonal_distance_instance.new_distance(copy_rd,dst,diff2,new_cut_dim);
- CGAL_assertion(new_rd >= copy_rd);
- dists[new_cut_dim] = diff2;
- Node_with_distance *Lower_Child =
- new Node_with_distance(node->lower(), new_rd, dists);
- PriorityQueue.push(Lower_Child);
- dists[new_cut_dim] = dst;
- N=node->upper();
- }
- }
- // n is a leaf
- typename Tree::Leaf_node_const_handle node =
- static_cast<typename Tree::Leaf_node_const_handle>(N);
- number_of_leaf_nodes_visited++;
- if (node->size() > 0) {
- for (typename Tree::iterator it=node->begin(); it != node->end(); it++) {
- number_of_items_visited++;
- FT distance_to_query_point=
- Orthogonal_distance_instance.transformed_distance(query_point,*it);
- Point_with_transformed_distance *NN_Candidate=
- new Point_with_transformed_distance(*it,distance_to_query_point);
- Item_PriorityQueue.push(NN_Candidate);
- }
- // old top of PriorityQueue has been processed,
- // hence update rd
-
- if (!(PriorityQueue.empty())) {
- rd = CGAL::cpp11::get<1>(*PriorityQueue.top());
- next_neighbour_found =
- (multiplication_factor*rd >
- Item_PriorityQueue.top()->second);
- }
- else // priority queue empty => last neighbour found
- {
- next_neighbour_found=true;
- }
-
- number_of_neighbours_computed++;
- }
- } // next_neighbour_found or priority queue is empty
- // in the latter case also the item priority quee is empty
- }
-
-
- void
- Compute_the_next_furthest_neighbour()
- {
- // compute the next item
- bool next_neighbour_found=false;
- if (!(Item_PriorityQueue.empty())) {
- next_neighbour_found=
- (rd < multiplication_factor*Item_PriorityQueue.top()->second);
- }
- typename SearchTraits::Construct_cartesian_const_iterator_d construct_it=traits.construct_cartesian_const_iterator_d_object();
- typename SearchTraits::Cartesian_const_iterator_d query_point_it = construct_it(query_point);
- // otherwise browse the tree further
- while ((!next_neighbour_found) && (!PriorityQueue.empty())) {
- Node_with_distance* The_node_top=PriorityQueue.top();
- Node_const_handle N= CGAL::cpp11::get<0>(*The_node_top);
- dists = CGAL::cpp11::get<2>(*The_node_top);
- PriorityQueue.pop();
- delete The_node_top;
- FT copy_rd=rd;
- while (!(N->is_leaf())) { // compute new distance
- typename Tree::Internal_node_const_handle node =
- static_cast<typename Tree::Internal_node_const_handle>(N);
- number_of_internal_nodes_visited++;
- int new_cut_dim=node->cutting_dimension();
- FT new_rd,dst = dists[new_cut_dim];
- FT val = *(query_point_it + new_cut_dim);
- FT diff1 = val - node->upper_low_value();
- FT diff2 = val - node->lower_high_value();
- if (diff1 + diff2 < FT(0.0)) {
- diff1 = val - node->upper_high_value();
- new_rd=
- Orthogonal_distance_instance.new_distance(copy_rd,dst,diff1,new_cut_dim);
- Node_with_distance *Lower_Child =
- new Node_with_distance(node->lower(), copy_rd, dists);
- PriorityQueue.push(Lower_Child);
- N=node->upper();
- dists[new_cut_dim] = diff1;
- copy_rd=new_rd;
-
- }
- else { // compute new distance
- diff2 = val - node->lower_low_value();
- new_rd=Orthogonal_distance_instance.new_distance(copy_rd,dst,diff2,new_cut_dim);
- Node_with_distance *Upper_Child =
- new Node_with_distance(node->upper(), copy_rd, dists);
- PriorityQueue.push(Upper_Child);
- N=node->lower();
- dists[new_cut_dim] = diff2;
- copy_rd=new_rd;
- }
- }
- // n is a leaf
- typename Tree::Leaf_node_const_handle node =
- static_cast<typename Tree::Leaf_node_const_handle>(N);
- number_of_leaf_nodes_visited++;
- if (node->size() > 0) {
- for (typename Tree::iterator it=node->begin(); it != node->end(); it++) {
- number_of_items_visited++;
- FT distance_to_query_point=
- Orthogonal_distance_instance.transformed_distance(query_point,*it);
- Point_with_transformed_distance *NN_Candidate=
- new Point_with_transformed_distance(*it,distance_to_query_point);
- Item_PriorityQueue.push(NN_Candidate);
- }
- // old top of PriorityQueue has been processed,
- // hence update rd
-
- if (!(PriorityQueue.empty())) {
- rd = CGAL::cpp11::get<1>(*PriorityQueue.top());
- next_neighbour_found =
- (multiplication_factor*rd <
- Item_PriorityQueue.top()->second);
- }
- else // priority queue empty => last neighbour found
- {
- next_neighbour_found=true;
- }
-
- number_of_neighbours_computed++;
- }
- } // next_neighbour_found or priority queue is empty
- // in the latter case also the item priority quee is empty
- }
- }; // class Iterator_implementaion
-
-
-
-
-
-
-
-
-
- public:
- class iterator;
- typedef iterator const_iterator;
-
- // constructor
- Orthogonal_incremental_neighbor_search(const Tree& tree,
- const Query_item& q, FT Eps = FT(0.0),
- bool search_nearest=true, const Distance& tr=Distance())
- : m_tree(tree),m_query(q),m_dist(tr),m_Eps(Eps),m_search_nearest(search_nearest)
- {}
-
- iterator
- begin() const
- {
- return iterator(m_tree,m_query,m_dist,m_Eps,m_search_nearest);
- }
-
- iterator
- end() const
- {
- return iterator();
- }
-
- std::ostream&
- statistics(std::ostream& s)
- {
- begin()->statistics(s);
- return s;
- }
-
-
-
-
- class iterator {
-
- public:
-
- typedef std::input_iterator_tag iterator_category;
- typedef Point_with_transformed_distance value_type;
- typedef Point_with_transformed_distance* pointer;
- typedef const Point_with_transformed_distance& reference;
- typedef std::size_t size_type;
- typedef std::ptrdiff_t difference_type;
- typedef int distance_type;
-
- //class Iterator_implementation;
- Iterator_implementation *Ptr_implementation;
-
-
- public:
-
- // default constructor
- iterator()
- : Ptr_implementation(0)
- {}
-
- int
- the_number_of_items_visited()
- {
- return Ptr_implementation->number_of_items_visited;
- }
-
- // constructor
- iterator(const Tree& tree,const Query_item& q, const Distance& tr=Distance(), FT eps=FT(0.0),
- bool search_nearest=true)
- : Ptr_implementation(new Iterator_implementation(tree, q, tr, eps, search_nearest))
- {}
-
- // copy constructor
- iterator(const iterator& Iter)
- {
- Ptr_implementation = Iter.Ptr_implementation;
- if (Ptr_implementation != 0) Ptr_implementation->reference_count++;
- }
-
- iterator& operator=(const iterator& Iter)
- {
- if (Ptr_implementation != Iter.Ptr_implementation){
- if (Ptr_implementation != 0 && --(Ptr_implementation->reference_count)==0) {
- delete Ptr_implementation;
- }
- Ptr_implementation = Iter.Ptr_implementation;
- if (Ptr_implementation != 0) Ptr_implementation->reference_count++;
- }
- return *this;
- }
-
-
- const Point_with_transformed_distance&
- operator* () const
- {
- return *(*Ptr_implementation);
- }
-
- // -> operator
- const Point_with_transformed_distance*
- operator-> () const
- {
- return &*(*Ptr_implementation);
- }
-
- // prefix operator
- iterator&
- operator++()
- {
- ++(*Ptr_implementation);
- return *this;
- }
-
- // postfix operator
- Object_wrapper<Point_with_transformed_distance>
- operator++(int)
- {
- return (*Ptr_implementation)++;
- }
-
-
- bool
- operator==(const iterator& It) const
- {
- if (
- ((Ptr_implementation == 0) ||
- Ptr_implementation->Item_PriorityQueue.empty()) &&
- ((It.Ptr_implementation == 0) ||
- It.Ptr_implementation->Item_PriorityQueue.empty())
- )
- return true;
- // else
- return (Ptr_implementation == It.Ptr_implementation);
- }
-
- bool
- operator!=(const iterator& It) const
- {
- return !(*this == It);
- }
-
- std::ostream&
- statistics (std::ostream& s)
- {
- Ptr_implementation->statistics(s);
- return s;
- }
-
- ~iterator()
- {
- if (Ptr_implementation != 0) {
- Ptr_implementation->reference_count--;
- if (Ptr_implementation->reference_count==0) {
- delete Ptr_implementation;
- Ptr_implementation = 0;
- }
- }
- }
-
-
- }; // class iterator
-
- //data members
- const Tree& m_tree;
- Query_item m_query;
- Distance m_dist;
- FT m_Eps;
- bool m_search_nearest;
- }; // class
-
- template <class Traits, class Query_item, class Distance>
- void swap (typename Orthogonal_incremental_neighbor_search<Traits,
- Query_item, Distance>::iterator& x,
- typename Orthogonal_incremental_neighbor_search<Traits,
- Query_item, Distance>::iterator& y)
- {
- typename Orthogonal_incremental_neighbor_search<Traits,
- Query_item, Distance>::iterator::Iterator_implementation
- *tmp = x.Ptr_implementation;
- x.Ptr_implementation = y.Ptr_implementation;
- y.Ptr_implementation = tmp;
- }
-
-} // namespace CGAL
-
-#endif // CGAL_ORTHOGONAL_INCREMENTAL_NEIGHBOR_SEARCH_H
diff --git a/include/gudhi_patches/CGAL/Regular_triangulation.h b/include/gudhi_patches/CGAL/Regular_triangulation.h
deleted file mode 100644
index 111c6ac9..00000000
--- a/include/gudhi_patches/CGAL/Regular_triangulation.h
+++ /dev/null
@@ -1,1169 +0,0 @@
-// Copyright (c) 2014 INRIA Sophia-Antipolis (France).
-// All rights reserved.
-//
-// This file is part of CGAL (www.cgal.org).
-// 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.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Clement Jamin
-
-#ifndef CGAL_REGULAR_TRIANGULATION_H
-#define CGAL_REGULAR_TRIANGULATION_H
-
-#include <CGAL/Triangulation.h>
-#include <CGAL/Dimension.h>
-#include <CGAL/Default.h>
-#include <CGAL/spatial_sort.h>
-#include <CGAL/Regular_triangulation_traits_adapter.h>
-
-#include <boost/property_map/function_property_map.hpp>
-
-namespace CGAL {
-
-template< typename Traits_, typename TDS_ = Default >
-class Regular_triangulation
-: public Triangulation<
- Regular_triangulation_traits_adapter<Traits_>,
- typename Default::Get<
- TDS_,
- Triangulation_data_structure<
- typename Regular_triangulation_traits_adapter<Traits_>::Dimension,
- Triangulation_vertex<Regular_triangulation_traits_adapter<Traits_> >,
- Triangulation_full_cell<Regular_triangulation_traits_adapter<Traits_> >
- >
- >::type>
-{
- typedef Regular_triangulation_traits_adapter<Traits_> RTTraits;
- typedef typename RTTraits::Dimension Maximal_dimension_;
- typedef typename Default::Get<
- TDS_,
- Triangulation_data_structure<
- Maximal_dimension_,
- Triangulation_vertex<RTTraits>,
- Triangulation_full_cell<RTTraits>
- > >::type TDS;
- typedef Triangulation<RTTraits, TDS> Base;
- typedef Regular_triangulation<Traits_, TDS_> Self;
-
- typedef typename RTTraits::Orientation_d Orientation_d;
- typedef typename RTTraits::Power_side_of_power_sphere_d Power_side_of_power_sphere_d;
- typedef typename RTTraits::In_flat_power_side_of_power_sphere_d
- In_flat_power_side_of_power_sphere_d;
- typedef typename RTTraits::Flat_orientation_d Flat_orientation_d;
- typedef typename RTTraits::Construct_flat_orientation_d Construct_flat_orientation_d;
-
-public: // PUBLIC NESTED TYPES
-
- typedef RTTraits Geom_traits;
- typedef typename Base::Triangulation_ds Triangulation_ds;
-
- typedef typename Base::Vertex Vertex;
- typedef typename Base::Full_cell Full_cell;
- typedef typename Base::Facet Facet;
- typedef typename Base::Face Face;
-
- typedef Maximal_dimension_ Maximal_dimension;
- typedef typename RTTraits::Bare_point_d Bare_point;
- typedef typename RTTraits::Weighted_point_d Weighted_point;
-
- typedef typename Base::Point_const_iterator Point_const_iterator;
- typedef typename Base::Vertex_handle Vertex_handle;
- typedef typename Base::Vertex_iterator Vertex_iterator;
- typedef typename Base::Vertex_const_handle Vertex_const_handle;
- typedef typename Base::Vertex_const_iterator Vertex_const_iterator;
-
- typedef typename Base::Full_cell_handle Full_cell_handle;
- typedef typename Base::Full_cell_iterator Full_cell_iterator;
- typedef typename Base::Full_cell_const_handle Full_cell_const_handle;
- typedef typename Base::Full_cell_const_iterator Full_cell_const_iterator;
- typedef typename Base::Finite_full_cell_const_iterator
- Finite_full_cell_const_iterator;
-
- typedef typename Base::size_type size_type;
- typedef typename Base::difference_type difference_type;
-
- typedef typename Base::Locate_type Locate_type;
-
- //Tag to distinguish Delaunay from Regular triangulations
- typedef Tag_true Weighted_tag;
-
-protected: // DATA MEMBERS
-
-
-public:
-
- using typename Base::Rotor;
- using Base::maximal_dimension;
- using Base::are_incident_full_cells_valid;
- using Base::coaffine_orientation_predicate;
- using Base::reset_flat_orientation;
- using Base::current_dimension;
- using Base::geom_traits;
- using Base::index_of_covertex;
- //using Base::index_of_second_covertex;
- using Base::rotate_rotor;
- using Base::infinite_vertex;
- using Base::insert_in_hole;
- using Base::is_infinite;
- using Base::locate;
- using Base::points_begin;
- using Base::set_neighbors;
- using Base::new_full_cell;
- using Base::number_of_vertices;
- using Base::orientation;
- using Base::tds;
- using Base::reorient_full_cells;
- using Base::full_cell;
- using Base::full_cells_begin;
- using Base::full_cells_end;
- using Base::finite_full_cells_begin;
- using Base::finite_full_cells_end;
- using Base::vertices_begin;
- using Base::vertices_end;
-
-private:
-
- // Wrapper
- struct Power_side_of_power_sphere_for_non_maximal_dim_d
- {
- boost::optional<Flat_orientation_d>* fop;
- Construct_flat_orientation_d cfo;
- In_flat_power_side_of_power_sphere_d ifpt;
-
- Power_side_of_power_sphere_for_non_maximal_dim_d(
- boost::optional<Flat_orientation_d>& x,
- Construct_flat_orientation_d const&y,
- In_flat_power_side_of_power_sphere_d const&z)
- : fop(&x), cfo(y), ifpt(z) {}
-
- template<class Iter>
- CGAL::Orientation operator()(Iter a, Iter b, const Weighted_point & p)const
- {
- if(!*fop)
- *fop=cfo(a,b);
- return ifpt(fop->get(),a,b,p);
- }
- };
-
-public:
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - CREATION / CONSTRUCTORS
-
- Regular_triangulation(int dim, const Geom_traits &k = Geom_traits())
- : Base(dim, k)
- {
- }
-
- // With this constructor,
- // the user can specify a Flat_orientation_d object to be used for
- // orienting simplices of a specific dimension
- // (= preset_flat_orientation_.first)
- // It it used by the dark triangulations created by DT::remove
- Regular_triangulation(
- int dim,
- const std::pair<int, const Flat_orientation_d *> &preset_flat_orientation,
- const Geom_traits &k = Geom_traits())
- : Base(dim, preset_flat_orientation, k)
- {
- }
-
- ~Regular_triangulation() {}
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ACCESS
-
- // Not Documented
- Power_side_of_power_sphere_for_non_maximal_dim_d power_side_of_power_sphere_for_non_maximal_dim_predicate() const
- {
- return Power_side_of_power_sphere_for_non_maximal_dim_d (
- flat_orientation_,
- geom_traits().construct_flat_orientation_d_object(),
- geom_traits().in_flat_power_side_of_power_sphere_d_object()
- );
- }
-
-
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - REMOVALS
-
- // Warning: these functions are not correct since they do not restore hidden
- // vertices
-
- Full_cell_handle remove(Vertex_handle);
- Full_cell_handle remove(const Weighted_point & p, Full_cell_handle hint = Full_cell_handle())
- {
- Locate_type lt;
- Face f(maximal_dimension());
- Facet ft;
- Full_cell_handle s = locate(p, lt, f, ft, hint);
- if( Base::ON_VERTEX == lt )
- {
- return remove(s->vertex(f.index(0)));
- }
- return Full_cell_handle();
- }
-
- template< typename ForwardIterator >
- void remove(ForwardIterator start, ForwardIterator end)
- {
- while( start != end )
- remove(*start++);
- }
-
- // Not documented
- void remove_decrease_dimension(Vertex_handle);
-
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - INSERTIONS
-
- template< typename ForwardIterator >
- std::ptrdiff_t insert(ForwardIterator start, ForwardIterator end)
- {
- size_type n = number_of_vertices();
- typedef std::vector<Weighted_point> WP_vec;
- WP_vec points(start, end);
-
- spatial_sort(points.begin(), points.end(), geom_traits());
-
- Full_cell_handle hint;
- for(typename WP_vec::const_iterator p = points.begin(); p != points.end(); ++p )
- {
- Locate_type lt;
- Face f(maximal_dimension());
- Facet ft;
- Full_cell_handle c = locate (*p, lt, f, ft, hint);
- Vertex_handle v = insert (*p, lt, f, ft, c);
-
- hint = v == Vertex_handle() ? c : v->full_cell();
- }
- return number_of_vertices() - n;
- }
-
- Vertex_handle insert(const Weighted_point &,
- Locate_type,
- const Face &,
- const Facet &,
- Full_cell_handle);
-
- Vertex_handle insert(const Weighted_point & p,
- Full_cell_handle start = Full_cell_handle())
- {
- Locate_type lt;
- Face f(maximal_dimension());
- Facet ft;
- Full_cell_handle s = locate(p, lt, f, ft, start);
- return insert(p, lt, f, ft, s);
- }
-
- Vertex_handle insert(const Weighted_point & p, Vertex_handle hint)
- {
- CGAL_assertion( Vertex_handle() != hint );
- return insert(p, hint->full_cell());
- }
-
- Vertex_handle insert_outside_affine_hull(const Weighted_point &);
- Vertex_handle insert_in_conflicting_cell(
- const Weighted_point &, Full_cell_handle,
- Vertex_handle only_if_this_vertex_is_in_the_cz = Vertex_handle());
-
- Vertex_handle insert_if_in_star(const Weighted_point &,
- Vertex_handle,
- Locate_type,
- const Face &,
- const Facet &,
- Full_cell_handle);
-
- Vertex_handle insert_if_in_star(
- const Weighted_point & p, Vertex_handle star_center,
- Full_cell_handle start = Full_cell_handle())
- {
- Locate_type lt;
- Face f(maximal_dimension());
- Facet ft;
- Full_cell_handle s = locate(p, lt, f, ft, start);
- return insert_if_in_star(p, star_center, lt, f, ft, s);
- }
-
- Vertex_handle insert_if_in_star(
- const Weighted_point & p, Vertex_handle star_center,
- Vertex_handle hint)
- {
- CGAL_assertion( Vertex_handle() != hint );
- return insert_if_in_star(p, star_center, hint->full_cell());
- }
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - GATHERING CONFLICTING SIMPLICES
-
- bool is_in_conflict(const Weighted_point &, Full_cell_const_handle) const;
-
- template< class OrientationPredicate >
- Oriented_side perturbed_power_side_of_power_sphere(const Weighted_point &,
- Full_cell_const_handle, const OrientationPredicate &) const;
-
- template< typename OutputIterator >
- Facet compute_conflict_zone(const Weighted_point &, Full_cell_handle, OutputIterator) const;
-
- template < typename OrientationPredicate, typename PowerTestPredicate >
- class Conflict_predicate
- {
- const Self & rt_;
- const Weighted_point & p_;
- OrientationPredicate ori_;
- PowerTestPredicate power_side_of_power_sphere_;
- int cur_dim_;
- public:
- Conflict_predicate(
- const Self & rt,
- const Weighted_point & p,
- const OrientationPredicate & ori,
- const PowerTestPredicate & power_side_of_power_sphere)
- : rt_(rt), p_(p), ori_(ori), power_side_of_power_sphere_(power_side_of_power_sphere), cur_dim_(rt.current_dimension()) {}
-
- inline
- bool operator()(Full_cell_const_handle s) const
- {
- bool ok;
- if( ! rt_.is_infinite(s) )
- {
- Oriented_side power_side_of_power_sphere = power_side_of_power_sphere_(rt_.points_begin(s), rt_.points_begin(s) + cur_dim_ + 1, p_);
- if( ON_POSITIVE_SIDE == power_side_of_power_sphere )
- ok = true;
- else if( ON_NEGATIVE_SIDE == power_side_of_power_sphere )
- ok = false;
- else
- ok = ON_POSITIVE_SIDE == rt_.perturbed_power_side_of_power_sphere<OrientationPredicate>(p_, s, ori_);
- }
- else
- {
- typedef typename Full_cell::Vertex_handle_const_iterator VHCI;
- typedef Substitute_point_in_vertex_iterator<VHCI> F;
- F spivi(rt_.infinite_vertex(), &p_);
-
- Orientation o = ori_(
- boost::make_transform_iterator(s->vertices_begin(), spivi),
- boost::make_transform_iterator(s->vertices_begin() + cur_dim_ + 1,
- spivi));
-
- if( POSITIVE == o )
- ok = true;
- else if( o == NEGATIVE )
- ok = false;
- else
- ok = (*this)(s->neighbor( s->index( rt_.infinite_vertex() ) ));
- }
- return ok;
- }
- };
-
- template < typename ConflictPredicate >
- class Conflict_traversal_predicate
- {
- const Self & rt_;
- const ConflictPredicate & pred_;
- public:
- Conflict_traversal_predicate(const Self & rt, const ConflictPredicate & pred)
- : rt_(rt), pred_(pred)
- {}
- inline
- bool operator()(const Facet & f) const
- {
- return pred_(rt_.full_cell(f)->neighbor(rt_.index_of_covertex(f)));
- }
- };
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - VALIDITY
-
- bool is_valid(bool verbose = false, int level = 0) const;
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - MISC
-
- std::size_t number_of_hidden_vertices() const
- {
- return m_hidden_points.size();
- }
-
-private:
-
- template<typename InputIterator>
- bool
- does_cell_range_contain_vertex(InputIterator cz_begin, InputIterator cz_end,
- Vertex_handle vh) const
- {
- // Check all vertices
- while(cz_begin != cz_end)
- {
- Full_cell_handle fch = *cz_begin;
- for (int i = 0 ; i <= current_dimension() ; ++i)
- {
- if (fch->vertex(i) == vh)
- return true;
- }
- ++cz_begin;
- }
- return false;
- }
-
- template<typename InputIterator, typename OutputIterator>
- void
- process_conflict_zone(InputIterator cz_begin, InputIterator cz_end,
- OutputIterator vertices_out) const
- {
- // Get all vertices
- while(cz_begin != cz_end)
- {
- Full_cell_handle fch = *cz_begin;
- for (int i = 0 ; i <= current_dimension() ; ++i)
- {
- Vertex_handle vh = fch->vertex(i);
- if (vh->full_cell() != Full_cell_handle())
- {
- (*vertices_out++) = vh;
- vh->set_full_cell(Full_cell_handle());
- }
- }
- ++cz_begin;
- }
- }
-
-
- template<typename InputIterator>
- void
- process_cz_vertices_after_insertion(InputIterator vertices_begin,
- InputIterator vertices_end)
- {
- // Get all vertices
- while(vertices_begin != vertices_end)
- {
- Vertex_handle vh = *vertices_begin;
- if (vh->full_cell() == Full_cell_handle())
- {
- m_hidden_points.push_back(vh->point());
- tds().delete_vertex(vh);
- }
- ++vertices_begin;
- }
- }
-
-private:
- // Some internal types to shorten notation
- using typename Base::Coaffine_orientation_d;
- using Base::flat_orientation_;
- typedef Conflict_predicate<Coaffine_orientation_d, Power_side_of_power_sphere_for_non_maximal_dim_d>
- Conflict_pred_in_subspace;
- typedef Conflict_predicate<Orientation_d, Power_side_of_power_sphere_d>
- Conflict_pred_in_fullspace;
- typedef Conflict_traversal_predicate<Conflict_pred_in_subspace>
- Conflict_traversal_pred_in_subspace;
- typedef Conflict_traversal_predicate<Conflict_pred_in_fullspace>
- Conflict_traversal_pred_in_fullspace;
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - MEMBER VARIABLES
- std::vector<Weighted_point> m_hidden_points;
-
-}; // class Regular_triangulation
-
-
-// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
-// FUNCTIONS THAT ARE MEMBER METHODS:
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - REMOVALS
-
-
-// Warning: this function is not correct since it does not restore hidden
-// vertices
-template< typename Traits, typename TDS >
-typename Regular_triangulation<Traits, TDS>::Full_cell_handle
-Regular_triangulation<Traits, TDS>
-::remove( Vertex_handle v )
-{
- CGAL_precondition( ! is_infinite(v) );
- CGAL_expensive_precondition( is_vertex(v) );
-
- // THE CASE cur_dim == 0
- if( 0 == current_dimension() )
- {
- remove_decrease_dimension(v);
- return Full_cell_handle();
- }
- else if( 1 == current_dimension() )
- { // THE CASE cur_dim == 1
- if( 2 == number_of_vertices() )
- {
- remove_decrease_dimension(v);
- return Full_cell_handle();
- }
- Full_cell_handle left = v->full_cell();
- if( 0 == left->index(v) )
- left = left->neighbor(1);
- CGAL_assertion( 1 == left->index(v) );
- Full_cell_handle right = left->neighbor(0);
- tds().associate_vertex_with_full_cell(left, 1, right->vertex(1));
- set_neighbors(left, 0, right->neighbor(0), right->mirror_index(0));
- tds().delete_vertex(v);
- tds().delete_full_cell(right);
- return left;
- }
-
- // THE CASE cur_dim >= 2
- // Gather the finite vertices sharing an edge with |v|
- typedef typename Base::template Full_cell_set<Full_cell_handle> Simplices;
- Simplices simps;
- std::back_insert_iterator<Simplices> out(simps);
- tds().incident_full_cells(v, out);
- typedef std::set<Vertex_handle> Vertex_set;
- Vertex_set verts;
- Vertex_handle vh;
- for( typename Simplices::iterator it = simps.begin(); it != simps.end(); ++it )
- for( int i = 0; i <= current_dimension(); ++i )
- {
- vh = (*it)->vertex(i);
- if( is_infinite(vh) )
- continue;
- if( vh == v )
- continue;
- verts.insert(vh);
- }
-
- // After gathering finite neighboring vertices, create their Dark Delaunay triangulation
- typedef Triangulation_vertex<Geom_traits, Vertex_handle> Dark_vertex_base;
- typedef Triangulation_full_cell<
- Geom_traits,
- internal::Triangulation::Dark_full_cell_data<TDS> > Dark_full_cell_base;
- typedef Triangulation_data_structure<Maximal_dimension,
- Dark_vertex_base,
- Dark_full_cell_base
- > Dark_tds;
- typedef Regular_triangulation<Traits, Dark_tds> Dark_triangulation;
- typedef typename Dark_triangulation::Face Dark_face;
- typedef typename Dark_triangulation::Facet Dark_facet;
- typedef typename Dark_triangulation::Vertex_handle Dark_v_handle;
- typedef typename Dark_triangulation::Full_cell_handle Dark_s_handle;
-
- // If flat_orientation_ is defined, we give it the Dark triangulation
- // so that the orientation it uses for "current_dimension()"-simplices is
- // coherent with the global triangulation
- Dark_triangulation dark_side(
- maximal_dimension(),
- flat_orientation_ ?
- std::pair<int, const Flat_orientation_d *>(current_dimension(), flat_orientation_.get_ptr())
- : std::pair<int, const Flat_orientation_d *>(std::numeric_limits<int>::max(), NULL) );
-
- Dark_s_handle dark_s;
- Dark_v_handle dark_v;
- typedef std::map<Vertex_handle, Dark_v_handle> Vertex_map;
- Vertex_map light_to_dark;
- typename Vertex_set::iterator vit = verts.begin();
- while( vit != verts.end() )
- {
- dark_v = dark_side.insert((*vit)->point(), dark_s);
- dark_s = dark_v->full_cell();
- dark_v->data() = *vit;
- light_to_dark[*vit] = dark_v;
- ++vit;
- }
-
- if( dark_side.current_dimension() != current_dimension() )
- {
- CGAL_assertion( dark_side.current_dimension() + 1 == current_dimension() );
- // Here, the finite neighbors of |v| span a affine subspace of
- // dimension one less than the current dimension. Two cases are possible:
- if( (size_type)(verts.size() + 1) == number_of_vertices() )
- {
- remove_decrease_dimension(v);
- return Full_cell_handle();
- }
- else
- { // |v| is strictly outside the convex hull of the rest of the points. This is an
- // easy case: first, modify the finite full_cells, then, delete the infinite ones.
- // We don't even need the Dark triangulation.
- Simplices infinite_simps;
- {
- Simplices finite_simps;
- for( typename Simplices::iterator it = simps.begin(); it != simps.end(); ++it )
- if( is_infinite(*it) )
- infinite_simps.push_back(*it);
- else
- finite_simps.push_back(*it);
- simps.swap(finite_simps);
- } // now, simps only contains finite simplices
- // First, modify the finite full_cells:
- for( typename Simplices::iterator it = simps.begin(); it != simps.end(); ++it )
- {
- int v_idx = (*it)->index(v);
- tds().associate_vertex_with_full_cell(*it, v_idx, infinite_vertex());
- }
- // Make the handles to infinite full cells searchable
- infinite_simps.make_searchable();
- // Then, modify the neighboring relation
- for( typename Simplices::iterator it = simps.begin(); it != simps.end(); ++it )
- {
- for( int i = 0 ; i <= current_dimension(); ++i )
- {
- if (is_infinite((*it)->vertex(i)))
- continue;
- (*it)->vertex(i)->set_full_cell(*it);
- Full_cell_handle n = (*it)->neighbor(i);
- // Was |n| a finite full cell prior to removing |v| ?
- if( ! infinite_simps.contains(n) )
- continue;
- int n_idx = n->index(v);
- set_neighbors(*it, i, n->neighbor(n_idx), n->neighbor(n_idx)->index(n));
- }
- }
- Full_cell_handle ret_s;
- // Then, we delete the infinite full_cells
- for( typename Simplices::iterator it = infinite_simps.begin(); it != infinite_simps.end(); ++it )
- tds().delete_full_cell(*it);
- tds().delete_vertex(v);
- return simps.front();
- }
- }
- else // From here on, dark_side.current_dimension() == current_dimension()
- {
- dark_side.infinite_vertex()->data() = infinite_vertex();
- light_to_dark[infinite_vertex()] = dark_side.infinite_vertex();
- }
-
- // Now, compute the conflict zone of v->point() in
- // the dark side. This is precisely the set of full_cells
- // that we have to glue back into the light side.
- Dark_face dark_f(dark_side.maximal_dimension());
- Dark_facet dark_ft;
- typename Dark_triangulation::Locate_type lt;
- dark_s = dark_side.locate(v->point(), lt, dark_f, dark_ft);
- CGAL_assertion( lt != Dark_triangulation::ON_VERTEX
- && lt != Dark_triangulation::OUTSIDE_AFFINE_HULL );
-
- // |ret_s| is the full_cell that we return
- Dark_s_handle dark_ret_s = dark_s;
- Full_cell_handle ret_s;
-
- typedef typename Base::template Full_cell_set<Dark_s_handle> Dark_full_cells;
- Dark_full_cells conflict_zone;
- std::back_insert_iterator<Dark_full_cells> dark_out(conflict_zone);
-
- dark_ft = dark_side.compute_conflict_zone(v->point(), dark_s, dark_out);
- // Make the dark simplices in the conflict zone searchable
- conflict_zone.make_searchable();
-
- // THE FOLLOWING SHOULD MAYBE GO IN TDS.
- // Here is the plan:
- // 1. Pick any Facet from boundary of the light zone
- // 2. Find corresponding Facet on boundary of dark zone
- // 3. stitch.
-
- // 1. Build a facet on the boudary of the light zone:
- Full_cell_handle light_s = *simps.begin();
- Facet light_ft(light_s, light_s->index(v));
-
- // 2. Find corresponding Dark_facet on boundary of the dark zone
- Dark_full_cells dark_incident_s;
- for( int i = 0; i <= current_dimension(); ++i )
- {
- if( index_of_covertex(light_ft) == i )
- continue;
- Dark_v_handle dark_v = light_to_dark[full_cell(light_ft)->vertex(i)];
- dark_incident_s.clear();
- dark_out = std::back_inserter(dark_incident_s);
- dark_side.tds().incident_full_cells(dark_v, dark_out);
- for(typename Dark_full_cells::iterator it = dark_incident_s.begin();
- it != dark_incident_s.end();
- ++it)
- {
- (*it)->data().count_ += 1;
- }
- }
-
- for( typename Dark_full_cells::iterator it = dark_incident_s.begin(); it != dark_incident_s.end(); ++it )
- {
- if( current_dimension() != (*it)->data().count_ )
- continue;
- if( ! conflict_zone.contains(*it) )
- continue;
- // We found a full_cell incident to the dark facet corresponding to the light facet |light_ft|
- int ft_idx = 0;
- while( light_s->has_vertex( (*it)->vertex(ft_idx)->data() ) )
- ++ft_idx;
- dark_ft = Dark_facet(*it, ft_idx);
- break;
- }
- // Pre-3. Now, we are ready to traverse both boundary and do the stiching.
-
- // But first, we create the new full_cells in the light triangulation,
- // with as much adjacency information as possible.
-
- // Create new full_cells with vertices
- for( typename Dark_full_cells::iterator it = conflict_zone.begin(); it != conflict_zone.end(); ++it )
- {
- Full_cell_handle new_s = new_full_cell();
- (*it)->data().light_copy_ = new_s;
- for( int i = 0; i <= current_dimension(); ++i )
- tds().associate_vertex_with_full_cell(new_s, i, (*it)->vertex(i)->data());
- if( dark_ret_s == *it )
- ret_s = new_s;
- }
-
- // Setup adjacencies inside the hole
- for( typename Dark_full_cells::iterator it = conflict_zone.begin(); it != conflict_zone.end(); ++it )
- {
- Full_cell_handle new_s = (*it)->data().light_copy_;
- for( int i = 0; i <= current_dimension(); ++i )
- if( conflict_zone.contains((*it)->neighbor(i)) )
- tds().set_neighbors(new_s, i, (*it)->neighbor(i)->data().light_copy_, (*it)->mirror_index(i));
- }
-
- // 3. Stitch
- simps.make_searchable();
- typedef std::queue<std::pair<Facet, Dark_facet> > Queue;
- Queue q;
- q.push(std::make_pair(light_ft, dark_ft));
- dark_s = dark_side.full_cell(dark_ft);
- int dark_i = dark_side.index_of_covertex(dark_ft);
- // mark dark_ft as visited:
- // TODO try by marking with Dark_v_handle (vertex)
- dark_s->neighbor(dark_i)->set_neighbor(dark_s->mirror_index(dark_i), Dark_s_handle());
- while( ! q.empty() )
- {
- std::pair<Facet, Dark_facet> p = q.front();
- q.pop();
- light_ft = p.first;
- dark_ft = p.second;
- light_s = full_cell(light_ft);
- int light_i = index_of_covertex(light_ft);
- dark_s = dark_side.full_cell(dark_ft);
- int dark_i = dark_side.index_of_covertex(dark_ft);
- Full_cell_handle light_n = light_s->neighbor(light_i);
- set_neighbors(dark_s->data().light_copy_, dark_i, light_n, light_s->mirror_index(light_i));
- for( int di = 0; di <= current_dimension(); ++di )
- {
- if( di == dark_i )
- continue;
- int li = light_s->index(dark_s->vertex(di)->data());
- Rotor light_r(light_s, li, light_i);
- typename Dark_triangulation::Rotor dark_r(dark_s, di, dark_i);
-
- while( simps.contains(cpp11::get<0>(light_r)->neighbor(cpp11::get<1>(light_r))) )
- light_r = rotate_rotor(light_r);
-
- while( conflict_zone.contains(cpp11::get<0>(dark_r)->neighbor(cpp11::get<1>(dark_r))) )
- dark_r = dark_side.rotate_rotor(dark_r);
-
- Dark_s_handle dark_ns = cpp11::get<0>(dark_r);
- int dark_ni = cpp11::get<1>(dark_r);
- Full_cell_handle light_ns = cpp11::get<0>(light_r);
- int light_ni = cpp11::get<1>(light_r);
- // mark dark_r as visited:
- // TODO try by marking with Dark_v_handle (vertex)
- Dark_s_handle outside = dark_ns->neighbor(dark_ni);
- Dark_v_handle mirror = dark_ns->mirror_vertex(dark_ni, current_dimension());
- int dn = outside->index(mirror);
- if( Dark_s_handle() == outside->neighbor(dn) )
- continue;
- outside->set_neighbor(dn, Dark_s_handle());
- q.push(std::make_pair(Facet(light_ns, light_ni), Dark_facet(dark_ns, dark_ni)));
- }
- }
- tds().delete_full_cells(simps.begin(), simps.end());
- tds().delete_vertex(v);
- return ret_s;
-}
-
-template< typename Traits, typename TDS >
-void
-Regular_triangulation<Traits, TDS>
-::remove_decrease_dimension(Vertex_handle v)
-{
- CGAL_precondition( current_dimension() >= 0 );
- tds().remove_decrease_dimension(v, infinite_vertex());
- // reset the predicates:
- reset_flat_orientation();
- if( 1 <= current_dimension() )
- {
- Full_cell_handle inf_v_cell = infinite_vertex()->full_cell();
- int inf_v_index = inf_v_cell->index(infinite_vertex());
- Full_cell_handle s = inf_v_cell->neighbor(inf_v_index);
- Orientation o = orientation(s);
- CGAL_assertion( ZERO != o );
- if( NEGATIVE == o )
- reorient_full_cells();
- }
-}
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - INSERTIONS
-
-template< typename Traits, typename TDS >
-typename Regular_triangulation<Traits, TDS>::Vertex_handle
-Regular_triangulation<Traits, TDS>
-::insert(const Weighted_point & p, Locate_type lt, const Face & f, const Facet & ft, Full_cell_handle s)
-{
- switch( lt )
- {
- case Base::OUTSIDE_AFFINE_HULL:
- return insert_outside_affine_hull(p);
- break;
- case Base::ON_VERTEX:
- {
- Vertex_handle v = s->vertex(f.index(0));
- typename RTTraits::Compute_weight_d pw =
- geom_traits().compute_weight_d_object();
-
- if (pw(p) == pw(v->point()))
- return v;
- // If dim == 0 and the new point has a bigger weight,
- // we just replace the point, and the former point gets hidden
- else if (current_dimension() == 0)
- {
- if (pw(p) > pw(v->point()))
- {
- m_hidden_points.push_back(v->point());
- v->set_point(p);
- return v;
- }
- // Otherwise, the new point is hidden
- else
- {
- m_hidden_points.push_back(p);
- return Vertex_handle();
- }
- }
- // Otherwise, we apply the "normal" algorithm
-
- // !NO break here!
- }
- default:
- return insert_in_conflicting_cell(p, s);
- }
-}
-
-/*
-Inserts the point `p` in the regular triangulation. Returns a handle to the
-newly created vertex at that position.
-\pre The point `p`
-must lie outside the affine hull of the regular triangulation. This implies that
-`rt`.`current_dimension()` must be smaller than `rt`.`maximal_dimension()`.
-*/
-template< typename Traits, typename TDS >
-typename Regular_triangulation<Traits, TDS>::Vertex_handle
-Regular_triangulation<Traits, TDS>
-::insert_outside_affine_hull(const Weighted_point & p)
-{
- // we don't use Base::insert_outside_affine_hull(...) because here, we
- // also need to reset the side_of_oriented_subsphere functor.
- CGAL_precondition( current_dimension() < maximal_dimension() );
- Vertex_handle v = tds().insert_increase_dimension(infinite_vertex());
- // reset the predicates:
- reset_flat_orientation();
- v->set_point(p);
- if( current_dimension() >= 1 )
- {
- Full_cell_handle inf_v_cell = infinite_vertex()->full_cell();
- int inf_v_index = inf_v_cell->index(infinite_vertex());
- Full_cell_handle s = inf_v_cell->neighbor(inf_v_index);
- Orientation o = orientation(s);
- CGAL_assertion( ZERO != o );
- if( NEGATIVE == o )
- reorient_full_cells();
-
- // We just inserted the second finite point and the right infinite
- // cell is like : (inf_v, v), but we want it to be (v, inf_v) to be
- // consistent with the rest of the cells
- if (current_dimension() == 1)
- {
- // Is "inf_v_cell" the right infinite cell? Then inf_v_index should be 1
- if (inf_v_cell->neighbor(inf_v_index)->index(inf_v_cell) == 0
- && inf_v_index == 0)
- {
- inf_v_cell->swap_vertices(current_dimension() - 1, current_dimension());
- }
- else
- {
- inf_v_cell = inf_v_cell->neighbor((inf_v_index + 1) % 2);
- inf_v_index = inf_v_cell->index(infinite_vertex());
- // Is "inf_v_cell" the right infinite cell? Then inf_v_index should be 1
- if (inf_v_cell->neighbor(inf_v_index)->index(inf_v_cell) == 0
- && inf_v_index == 0)
- {
- inf_v_cell->swap_vertices(current_dimension() - 1, current_dimension());
- }
- }
- }
- }
- return v;
-}
-
-template< typename Traits, typename TDS >
-typename Regular_triangulation<Traits, TDS>::Vertex_handle
-Regular_triangulation<Traits, TDS>
-::insert_if_in_star(const Weighted_point & p,
- Vertex_handle star_center,
- Locate_type lt,
- const Face & f,
- const Facet & ft,
- Full_cell_handle s)
-{
- switch( lt )
- {
- case Base::OUTSIDE_AFFINE_HULL:
- return insert_outside_affine_hull(p);
- break;
- case Base::ON_VERTEX:
- {
- Vertex_handle v = s->vertex(f.index(0));
- typename RTTraits::Compute_weight_d pw =
- geom_traits().compute_weight_d_object();
- if (pw(p) == pw(v->point()))
- return v;
- // If dim == 0 and the new point has a bigger weight,
- // we replace the point
- else if (current_dimension() == 0)
- {
- if (pw(p) > pw(v->point()))
- v->set_point(p);
- else
- return v;
- }
- // Otherwise, we apply the "normal" algorithm
-
- // !NO break here!
- }
- default:
- return insert_in_conflicting_cell(p, s, star_center);
- }
-
- return Vertex_handle();
-}
-
-/*
-[Undocumented function]
-
-Inserts the point `p` in the regular triangulation. `p` must be
-in conflict with the second parameter `c`, which is used as a
-starting point for `compute_conflict_zone`.
-The function is faster than the standard `insert` function since
-it does not need to call `locate`.
-
-If this insertion creates a vertex, this vertex is returned.
-
-If `p` coincides with an existing vertex and has a greater weight,
-then the existing weighted point becomes hidden and `p` replaces it as vertex
-of the triangulation.
-
-If `p` coincides with an already existing vertex (both point and
-weights being equal), then this vertex is returned and the triangulation
-remains unchanged.
-
-Otherwise if `p` does not appear as a vertex of the triangulation,
-then it is stored as a hidden point and this method returns the default
-constructed handle.
-
-\pre The point `p` must be in conflict with the full cell `c`.
-*/
-
-template< typename Traits, typename TDS >
-typename Regular_triangulation<Traits, TDS>::Vertex_handle
-Regular_triangulation<Traits, TDS>
-::insert_in_conflicting_cell(const Weighted_point & p,
- Full_cell_handle s,
- Vertex_handle only_if_this_vertex_is_in_the_cz)
-{
- typedef std::vector<Full_cell_handle> Full_cell_h_vector;
-
- bool in_conflict = is_in_conflict(p, s);
-
- // If p is not in conflict with s, then p is hidden
- // => we don't insert it
- if (!in_conflict)
- {
- m_hidden_points.push_back(p);
- return Vertex_handle();
- }
- else
- {
- Full_cell_h_vector cs; // for storing conflicting full_cells.
- cs.reserve(64);
- std::back_insert_iterator<Full_cell_h_vector> out(cs);
- Facet ft = compute_conflict_zone(p, s, out);
-
- // Check if the CZ contains "only_if_this_vertex_is_in_the_cz"
- if (only_if_this_vertex_is_in_the_cz != Vertex_handle()
- && !does_cell_range_contain_vertex(cs.begin(), cs.end(),
- only_if_this_vertex_is_in_the_cz))
- {
- return Vertex_handle();
- }
-
- // Otherwise, proceed with the insertion
- std::vector<Vertex_handle> cz_vertices;
- cz_vertices.reserve(64);
- process_conflict_zone(cs.begin(), cs.end(),
- std::back_inserter(cz_vertices));
-
- Vertex_handle ret = insert_in_hole(p, cs.begin(), cs.end(), ft);
-
- process_cz_vertices_after_insertion(cz_vertices.begin(), cz_vertices.end());
-
- return ret;
- }
-}
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - GATHERING CONFLICTING SIMPLICES
-
-// NOT DOCUMENTED
-template< typename Traits, typename TDS >
-template< typename OrientationPred >
-Oriented_side
-Regular_triangulation<Traits, TDS>
-::perturbed_power_side_of_power_sphere(const Weighted_point & p, Full_cell_const_handle s,
- const OrientationPred & ori) const
-{
- CGAL_precondition_msg( ! is_infinite(s), "full cell must be finite");
- CGAL_expensive_precondition( POSITIVE == orientation(s) );
- typedef std::vector<const Weighted_point *> Points;
- Points points(current_dimension() + 2);
- int i(0);
- for( ; i <= current_dimension(); ++i )
- points[i] = &(s->vertex(i)->point());
- points[i] = &p;
- std::sort(points.begin(), points.end(),
- internal::Triangulation::Compare_points_for_perturbation<Self>(*this));
- typename Points::const_reverse_iterator cut_pt = points.rbegin();
- Points test_points;
- while( cut_pt != points.rend() )
- {
- if( &p == *cut_pt )
- // because the full_cell "s" is assumed to be positively oriented
- return ON_NEGATIVE_SIDE; // we consider |p| to lie outside the sphere
- test_points.clear();
- Point_const_iterator spit = points_begin(s);
- int adjust_sign = -1;
- for( i = 0; i < current_dimension(); ++i )
- {
- if( &(*spit) == *cut_pt )
- {
- ++spit;
- adjust_sign = (((current_dimension() + i) % 2) == 0) ? -1 : +1;
- }
- test_points.push_back(&(*spit));
- ++spit;
- }
- test_points.push_back(&p);
-
- typedef typename CGAL::Iterator_project<
- typename Points::iterator,
- internal::Triangulation::Point_from_pointer<Self>,
- const Weighted_point &, const Weighted_point *
- > Point_pointer_iterator;
-
- Orientation ori_value = ori(
- Point_pointer_iterator(test_points.begin()),
- Point_pointer_iterator(test_points.end()));
-
- if( ZERO != ori_value )
- return Oriented_side( - adjust_sign * ori_value );
-
- ++cut_pt;
- }
- CGAL_assertion(false); // we should never reach here
- return ON_NEGATIVE_SIDE;
-}
-
-template< typename Traits, typename TDS >
-bool
-Regular_triangulation<Traits, TDS>
-::is_in_conflict(const Weighted_point & p, Full_cell_const_handle s) const
-{
- CGAL_precondition( 1 <= current_dimension() );
- if( current_dimension() < maximal_dimension() )
- {
- Conflict_pred_in_subspace c(
- *this, p,
- coaffine_orientation_predicate(),
- power_side_of_power_sphere_for_non_maximal_dim_predicate());
- return c(s);
- }
- else
- {
- Orientation_d ori = geom_traits().orientation_d_object();
- Power_side_of_power_sphere_d side = geom_traits().power_side_of_power_sphere_d_object();
- Conflict_pred_in_fullspace c(*this, p, ori, side);
- return c(s);
- }
-}
-
-template< typename Traits, typename TDS >
-template< typename OutputIterator >
-typename Regular_triangulation<Traits, TDS>::Facet
-Regular_triangulation<Traits, TDS>
-::compute_conflict_zone(const Weighted_point & p, Full_cell_handle s, OutputIterator out) const
-{
- CGAL_precondition( 1 <= current_dimension() );
- if( current_dimension() < maximal_dimension() )
- {
- Conflict_pred_in_subspace c(
- *this, p,
- coaffine_orientation_predicate(),
- power_side_of_power_sphere_for_non_maximal_dim_predicate());
- Conflict_traversal_pred_in_subspace tp(*this, c);
- return tds().gather_full_cells(s, tp, out);
- }
- else
- {
- Orientation_d ori = geom_traits().orientation_d_object();
- Power_side_of_power_sphere_d side = geom_traits().power_side_of_power_sphere_d_object();
- Conflict_pred_in_fullspace c(*this, p, ori, side);
- Conflict_traversal_pred_in_fullspace tp(*this, c);
- return tds().gather_full_cells(s, tp, out);
- }
-}
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - VALIDITY
-
-template< typename Traits, typename TDS >
-bool
-Regular_triangulation<Traits, TDS>
-::is_valid(bool verbose, int level) const
-{
- if (!Base::is_valid(verbose, level))
- return false;
-
- int dim = current_dimension();
- if (dim == maximal_dimension())
- {
- for (Finite_full_cell_const_iterator cit = finite_full_cells_begin() ;
- cit != finite_full_cells_end() ; ++cit )
- {
- Full_cell_const_handle ch = cit.base();
- for(int i = 0; i < dim+1 ; ++i )
- {
- // If the i-th neighbor is not an infinite cell
- Vertex_handle opposite_vh =
- ch->neighbor(i)->vertex(ch->neighbor(i)->index(ch));
- if (!is_infinite(opposite_vh))
- {
- Power_side_of_power_sphere_d side =
- geom_traits().power_side_of_power_sphere_d_object();
- if (side(Point_const_iterator(ch->vertices_begin()),
- Point_const_iterator(ch->vertices_end()),
- opposite_vh->point()) == ON_POSITIVE_SIDE)
- {
- if (verbose)
- CGAL_warning_msg(false, "Non-empty sphere");
- return false;
- }
- }
- }
- }
- }
- return true;
-}
-
-} //namespace CGAL
-
-#endif //CGAL_REGULAR_TRIANGULATION_H
diff --git a/include/gudhi_patches/CGAL/Regular_triangulation_traits_adapter.h b/include/gudhi_patches/CGAL/Regular_triangulation_traits_adapter.h
deleted file mode 100644
index 78bb95a6..00000000
--- a/include/gudhi_patches/CGAL/Regular_triangulation_traits_adapter.h
+++ /dev/null
@@ -1,288 +0,0 @@
-// Copyright (c) 2014 INRIA Sophia-Antipolis (France).
-// All rights reserved.
-//
-// This file is part of CGAL (www.cgal.org).
-// 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.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Clement Jamin
-
-#ifndef CGAL_REGULAR_TRIANGULATION_TRAITS_ADAPTER_H
-#define CGAL_REGULAR_TRIANGULATION_TRAITS_ADAPTER_H
-
-#include <CGAL/basic.h>
-
-#include <boost/iterator/transform_iterator.hpp>
-
-namespace CGAL {
-
-// Wrapper class to make a model of `RegularTriangulationTraits` easily usable
-// by the `Regular_triangulation` class. By using this class:
-// - Point_d (used by `Triangulation` and the TDS) becomes a weighted point
-// - Predicates and functors such as Less_coordinate_d or Orientation_d
-// can be called using weighted points instead of bare points (this is
-// needed because `Weighted_point_d` is not convertible to `Point_d`)
-// This way, `Triangulation` works perfectly well with weighted points.
-
-template <class K>
-class Regular_triangulation_traits_adapter
- : public K
-{
-public:
- typedef K Base;
-
- // Required by TriangulationTraits
- typedef typename K::Dimension Dimension;
- typedef typename K::FT FT;
- typedef typename K::Flat_orientation_d Flat_orientation_d;
- typedef typename K::Weighted_point_d Point_d;
-
- // Required by RegularTriangulationTraits
- typedef typename K::Point_d Bare_point_d;
- typedef typename K::Weighted_point_d Weighted_point_d;
- typedef typename K::Construct_point_d Construct_point_d;
- typedef typename K::Compute_weight_d Compute_weight_d;
- typedef typename K::Power_side_of_power_sphere_d Power_side_of_power_sphere_d;
- typedef typename K::In_flat_power_side_of_power_sphere_d
- In_flat_power_side_of_power_sphere_d;
-
- //===========================================================================
- // Custom types
- //===========================================================================
-
- // Required by SpatialSortingTraits_d
- class Less_coordinate_d
- {
- const K &m_kernel;
-
- public:
- typedef bool result_type;
-
- Less_coordinate_d(const K &kernel)
- : m_kernel(kernel) {}
-
- result_type operator()(
- Weighted_point_d const& p, Weighted_point_d const& q, int i) const
- {
- Construct_point_d cp = m_kernel.construct_point_d_object();
- return m_kernel.less_coordinate_d_object() (cp(p), cp(q), i);
- }
- };
-
- //===========================================================================
-
- // Required by TriangulationTraits
- class Orientation_d
- {
- const K &m_kernel;
-
- public:
- typedef Orientation result_type;
-
- Orientation_d(const K &kernel)
- : m_kernel(kernel) {}
-
- template <typename ForwardIterator>
- result_type operator()(ForwardIterator start, ForwardIterator end) const
- {
- Construct_point_d cp = m_kernel.construct_point_d_object();
- return m_kernel.orientation_d_object() (
- boost::make_transform_iterator(start, cp),
- boost::make_transform_iterator(end, cp)
- );
- }
- };
-
- //===========================================================================
-
- // Required by TriangulationTraits
- class Construct_flat_orientation_d
- {
- const K &m_kernel;
-
- public:
- typedef Flat_orientation_d result_type;
-
- Construct_flat_orientation_d(const K &kernel)
- : m_kernel(kernel) {}
-
- template <typename ForwardIterator>
- result_type operator()(ForwardIterator start, ForwardIterator end) const
- {
- Construct_point_d cp = m_kernel.construct_point_d_object();
- return m_kernel.construct_flat_orientation_d_object() (
- boost::make_transform_iterator(start, cp),
- boost::make_transform_iterator(end, cp)
- );
- }
- };
-
-
- //===========================================================================
-
- // Required by TriangulationTraits
- class In_flat_orientation_d
- {
- const K &m_kernel;
-
- public:
- typedef Orientation result_type;
-
- In_flat_orientation_d(const K &kernel)
- : m_kernel(kernel) {}
-
- template <typename ForwardIterator>
- result_type operator()(Flat_orientation_d orient,
- ForwardIterator start, ForwardIterator end) const
- {
- Construct_point_d cp = m_kernel.construct_point_d_object();
- return m_kernel.in_flat_orientation_d_object() (
- orient,
- boost::make_transform_iterator(start, cp),
- boost::make_transform_iterator(end, cp)
- );
- }
- };
-
- //===========================================================================
-
- // Required by TriangulationTraits
- class Contained_in_affine_hull_d
- {
- const K &m_kernel;
-
- public:
- typedef bool result_type;
-
- Contained_in_affine_hull_d(const K &kernel)
- : m_kernel(kernel) {}
-
- template <typename ForwardIterator>
- result_type operator()(ForwardIterator start, ForwardIterator end,
- const Weighted_point_d & p) const
- {
- Construct_point_d cp = m_kernel.construct_point_d_object();
- return m_kernel.contained_in_affine_hull_d_object() (
- boost::make_transform_iterator(start, cp),
- boost::make_transform_iterator(end, cp),
- cp(p)
- );
- }
- };
-
- //===========================================================================
-
- // Required by TriangulationTraits
- class Compare_lexicographically_d
- {
- const K &m_kernel;
-
- public:
- typedef Comparison_result result_type;
-
- Compare_lexicographically_d(const K &kernel)
- : m_kernel(kernel) {}
-
- result_type operator()(
- const Weighted_point_d & p, const Weighted_point_d & q) const
- {
- Construct_point_d cp = m_kernel.construct_point_d_object();
- return m_kernel.compare_lexicographically_d_object()(cp(p), cp(q));
- }
- };
-
- //===========================================================================
-
- // Only for Triangulation_off_ostream.h (undocumented)
- class Compute_coordinate_d
- {
- const K &m_kernel;
-
- public:
- typedef FT result_type;
-
- Compute_coordinate_d(const K &kernel)
- : m_kernel(kernel) {}
-
- result_type operator()(
- const Weighted_point_d & p, const int i) const
- {
- Construct_point_d cp = m_kernel.construct_point_d_object();
- return m_kernel.compute_coordinate_d_object()(cp(p), i);
- }
- };
-
- //===========================================================================
-
- // To satisfy SpatialSortingTraits_d
- // and also for Triangulation_off_ostream.h (undocumented)
- class Point_dimension_d
- {
- const K &m_kernel;
-
- public:
- typedef int result_type;
-
- Point_dimension_d(const K &kernel)
- : m_kernel(kernel) {}
-
- result_type operator()(
- const Weighted_point_d & p) const
- {
- Construct_point_d cp = m_kernel.construct_point_d_object();
- return m_kernel.point_dimension_d_object()(cp(p));
- }
- };
-
- //===========================================================================
- // Object creation
- //===========================================================================
-
- Less_coordinate_d less_coordinate_d_object() const
- {
- return Less_coordinate_d(*this);
- }
- Contained_in_affine_hull_d contained_in_affine_hull_d_object() const
- {
- return Contained_in_affine_hull_d(*this);
- }
- Orientation_d orientation_d_object() const
- {
- return Orientation_d(*this);
- }
- Construct_flat_orientation_d construct_flat_orientation_d_object() const
- {
- return Construct_flat_orientation_d(*this);
- }
- In_flat_orientation_d in_flat_orientation_d_object() const
- {
- return In_flat_orientation_d(*this);
- }
- Compare_lexicographically_d compare_lexicographically_d_object() const
- {
- return Compare_lexicographically_d(*this);
- }
- Compute_coordinate_d compute_coordinate_d_object() const
- {
- return Compute_coordinate_d(*this);
- }
- Point_dimension_d point_dimension_d_object() const
- {
- return Point_dimension_d(*this);
- }
-};
-
-
-} //namespace CGAL
-
-#endif // CGAL_REGULAR_TRIANGULATION_TRAITS_ADAPTER_H
diff --git a/include/gudhi_patches/CGAL/TDS_full_cell_default_storage_policy.h b/include/gudhi_patches/CGAL/TDS_full_cell_default_storage_policy.h
deleted file mode 100644
index 9a6030e5..00000000
--- a/include/gudhi_patches/CGAL/TDS_full_cell_default_storage_policy.h
+++ /dev/null
@@ -1,99 +0,0 @@
-// Copyright (c) 2009-2014 INRIA Sophia-Antipolis (France).
-// All rights reserved.
-//
-// This file is part of CGAL (www.cgal.org).
-// 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.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Samuel Hornus
-
-#ifndef CGAL_TDS_FULL_CELL_DEFAULT_STORAGE_POLICY_H
-#define CGAL_TDS_FULL_CELL_DEFAULT_STORAGE_POLICY_H
-
-#include <CGAL/Dimension.h>
-#include <CGAL/Compact_container.h>
-#include <CGAL/internal/Static_or_dynamic_array.h>
-
-#include <boost/cstdint.hpp>
-
-namespace CGAL {
-
-// POLICY TAG
-
-struct TDS_full_cell_default_storage_policy {}; // stores no additional data. Uses XOR trick.
-
-template< typename V, typename S, typename D, typename StoragePolicy >
-struct TFC_data; // TFC = Triangulation Full Cell
-
-template< typename Vertex_handle, typename Full_cell_handle, typename Dimen >
-struct TFC_data< Vertex_handle, Full_cell_handle, Dimen, TDS_full_cell_default_storage_policy >
-{
- typedef typename internal::Dimen_plus_one<Dimen>::type Dimen_plus;
- typedef typename internal::S_or_D_array< Vertex_handle, Dimen_plus, true > Vertex_handle_array;
- typedef typename internal::S_or_D_array< Full_cell_handle, Dimen_plus > Full_cell_handle_array;
-
- Vertex_handle_array vertices_;
- Full_cell_handle_array neighbors_;
-
- TFC_data(const int dmax)
- : vertices_(dmax+1), neighbors_(dmax+1)
- {}
- void* for_compact_container() const { return vertices_.for_compact_container(); }
- void* & for_compact_container() { return vertices_.for_compact_container(); }
- int dimension() const { return ( vertices_.size() - 1 ); }
- void set_mirror_index(const int, const int) {}
-#ifdef BOOST_NO_INT64_T
- typedef std::ptrdiff_t Xor_type;
-#else
- typedef boost::int_least64_t Xor_type;
-#endif
- Xor_type xor_of_vertices(const int cur_dim) const
- {
- Xor_type result(0);
- for( int i = 0; i <= cur_dim; ++i )
- result ^= reinterpret_cast<Xor_type>(&(*vertices_[i]));
- return result;
- }
- // ASSUMES |*this| is indeed a neighbor of neighbor(i):
- // NOT correct when the hole (in insert_in_hole) is doubly covered.
- int mirror_index(const int i) const
- {
- int index = 0;
- Full_cell_handle n = neighbors_[i];
- Full_cell_handle o = n->neighbor(index);
- while( &(o->combinatorics_) != this )
- o = n->neighbor(++index);
- return index;
- }
- Vertex_handle mirror_vertex(const int i, const int cur_dim) const
- {
- Xor_type opp_vertex = xor_of_vertices(cur_dim)
- ^ neighbors_[i]->xor_of_vertices(cur_dim)
- ^ reinterpret_cast<Xor_type>(&(*vertices_[i]));
- Vertex_handle mirror;
- typedef typename Vertex_handle::pointer pointer;
- // mirror.set_pointer(reinterpret_cast<pointer>(opp_vertex));
- mirror = Compact_container<typename Vertex_handle::value_type>
- ::s_iterator_to(*(reinterpret_cast<pointer>(opp_vertex)));
- return mirror;
- }
- void swap_vertices(const int d1, const int d2)
- {
- std::swap(vertices_[d1], vertices_[d2]);
- std::swap(neighbors_[d1], neighbors_[d2]);
- }
-};
-
-} //namespace CGAL
-
-#endif // CGAL_TDS_FULL_CELL_DEFAULT_STORAGE_POLICY_H
diff --git a/include/gudhi_patches/CGAL/TDS_full_cell_mirror_storage_policy.h b/include/gudhi_patches/CGAL/TDS_full_cell_mirror_storage_policy.h
deleted file mode 100644
index 095dfe68..00000000
--- a/include/gudhi_patches/CGAL/TDS_full_cell_mirror_storage_policy.h
+++ /dev/null
@@ -1,71 +0,0 @@
-// Copyright (c) 2009-2014 INRIA Sophia-Antipolis (France).
-// All rights reserved.
-//
-// This file is part of CGAL (www.cgal.org).
-// 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.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Samuel Hornus
-
-#ifndef CGAL_TDS_FULL_CELL_MIRROR_STORAGE_POLICY_H
-#define CGAL_TDS_FULL_CELL_MIRROR_STORAGE_POLICY_H
-
-#include <CGAL/TDS_full_cell_default_storage_policy.h>
-
-namespace CGAL {
-
-// POLICY TAGS
-
-struct TDS_full_cell_mirror_storage_policy {}; // Stores the mirror index of all vertices.
-
-template< typename Vertex_handle, typename Full_cell_handle, typename Maximal_dimension >
-struct TFC_data< Vertex_handle, Full_cell_handle, Maximal_dimension, TDS_full_cell_mirror_storage_policy >
-: public TFC_data< Vertex_handle, Full_cell_handle, Maximal_dimension, TDS_full_cell_default_storage_policy >
-{
- typedef TFC_data< Vertex_handle, Full_cell_handle, Maximal_dimension, TDS_full_cell_default_storage_policy > Base;
- typedef typename Base::Vertex_handle_array Vertex_handle_array;
- typedef typename Base::Full_cell_handle_array Full_cell_handle_array;
- typedef typename internal::S_or_D_array< int, typename Base::Dimen_plus > Int_array;
-
-private:
- Int_array mirror_vertices_;
-
-public:
- TFC_data(const int dmax)
- : Base(dmax), mirror_vertices_(dmax+1)
- {}
-
- void set_mirror_index(const int i, const int index)
- {
- mirror_vertices_[i] = index;
- }
- int mirror_index(const int i) const
- {
- return mirror_vertices_[i];
- }
- Vertex_handle mirror_vertex(const int i, const int) const
- {
- return Base::neighbors_[i]->vertex(mirror_index(i));
- }
- void swap_vertices(const int d1, const int d2)
- {
- Base::swap_vertices(d1, d2);
- std::swap(mirror_vertices_[d1], mirror_vertices_[d2]);
- Base::neighbors_[d1]->set_mirror_index(mirror_vertices_[d1], d1);
- Base::neighbors_[d2]->set_mirror_index(mirror_vertices_[d2], d2);
- }
-};
-
-} //namespace CGAL
-
-#endif // CGAL_TDS_FULL_CELL_MIRROR_STORAGE_POLICY_H
diff --git a/include/gudhi_patches/CGAL/Triangulation.h b/include/gudhi_patches/CGAL/Triangulation.h
deleted file mode 100644
index 906df92e..00000000
--- a/include/gudhi_patches/CGAL/Triangulation.h
+++ /dev/null
@@ -1,1424 +0,0 @@
-// Copyright (c) 2009-2014 INRIA Sophia-Antipolis (France).
-// All rights reserved.
-//
-// This file is part of CGAL (www.cgal.org).
-// 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.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Samuel Hornus
-
-#ifndef CGAL_TRIANGULATION_H
-#define CGAL_TRIANGULATION_H
-
-#include <CGAL/internal/Triangulation/utilities.h>
-#include <CGAL/Triangulation_data_structure.h>
-#include <CGAL/Triangulation_full_cell.h>
-#include <CGAL/Triangulation_vertex.h>
-#include <CGAL/Iterator_project.h>
-#include <CGAL/spatial_sort.h>
-#include <CGAL/Dimension.h>
-#include <CGAL/iterator.h>
-#include <CGAL/Default.h>
-#include <CGAL/Random.h>
-
-#include <boost/iterator/filter_iterator.hpp>
-#include <boost/iterator/transform_iterator.hpp>
-
-namespace CGAL {
-
-// Iterator which iterates over vertex_handle's, but returns a point when
-// dereferenced. If the current
-// vertex_handle vh == vh_where_point_should_be_substituted, it returns
-// "subtitute_point", otherwise, it returns vh->point()
-template<class VertexHandleConstIter>
-class Substitute_point_in_vertex_iterator
-{
- typedef typename std::iterator_traits<VertexHandleConstIter>::value_type Vertex_handle;
- typedef typename Vertex_handle::value_type Vertex;
- typedef typename Vertex::Point Point;
-
-public:
- typedef Point const& result_type; // For result_of
-
- Substitute_point_in_vertex_iterator(
- Vertex_handle vh_where_point_should_be_substituted,
- Point const *subtitute_point)
- : vh_where_point_should_be_substituted_(vh_where_point_should_be_substituted)
- , subtitute_point_(subtitute_point)
- {}
-
- result_type operator()(Vertex_handle vh) const
- {
- if (vh == vh_where_point_should_be_substituted_)
- return *subtitute_point_;
- else
- return vh->point();
- }
-
-private:
- Vertex_handle vh_where_point_should_be_substituted_;
- Point const *subtitute_point_;
-
-};
-
-
-template < class TriangulationTraits, class TDS_ = Default >
-class Triangulation
-{
- typedef typename TriangulationTraits::Dimension Maximal_dimension_;
- typedef typename Default::Get<TDS_, Triangulation_data_structure
- < Maximal_dimension_,
- Triangulation_vertex<TriangulationTraits>,
- Triangulation_full_cell<TriangulationTraits> >
- >::type TDS;
- typedef Triangulation<TriangulationTraits, TDS_> Self;
-
-protected:
- typedef typename TriangulationTraits::Flat_orientation_d Flat_orientation_d;
- typedef typename TriangulationTraits::Construct_flat_orientation_d Construct_flat_orientation_d;
- typedef typename TriangulationTraits::In_flat_orientation_d In_flat_orientation_d;
-
- // Wrapper
- struct Coaffine_orientation_d
- {
- boost::optional<Flat_orientation_d>* fop;
- Construct_flat_orientation_d cfo;
- In_flat_orientation_d ifo;
-
- Coaffine_orientation_d(
- boost::optional<Flat_orientation_d>& x,
- Construct_flat_orientation_d const&y,
- In_flat_orientation_d const&z)
- : fop(&x), cfo(y), ifo(z) {}
-
- template<class Iter>
- CGAL::Orientation operator()(Iter a, Iter b) const
- {
- if (*fop)
- return ifo(fop->get(),a,b);
- *fop = cfo(a,b);
- CGAL_assertion(ifo(fop->get(),a,b) == CGAL::POSITIVE);
- return CGAL::POSITIVE;
- }
- };
-
- void reset_flat_orientation()
- {
- if (current_dimension() == preset_flat_orientation_.first)
- {
- CGAL_assertion(preset_flat_orientation_.second != NULL);
- flat_orientation_ = *preset_flat_orientation_.second;
- }
- else
- flat_orientation_ = boost::none;
- }
-
- typedef typename TriangulationTraits::Orientation_d
- Orientation_d;
-
-public:
-
- typedef TriangulationTraits Geom_traits;
- typedef TDS Triangulation_ds;
-
- typedef typename TDS::Vertex Vertex;
- typedef typename TDS::Full_cell Full_cell;
- typedef typename TDS::Facet Facet;
- typedef typename TDS::Face Face;
-
- typedef Maximal_dimension_ Maximal_dimension;
- typedef typename Geom_traits::Point_d Point;
-
- typedef typename TDS::Vertex_handle Vertex_handle;
- typedef typename TDS::Vertex_iterator Vertex_iterator;
- typedef typename TDS::Vertex_const_handle Vertex_const_handle;
- typedef typename TDS::Vertex_const_iterator Vertex_const_iterator;
-
- typedef typename TDS::Full_cell_handle Full_cell_handle;
- typedef typename TDS::Full_cell_iterator Full_cell_iterator;
- typedef typename TDS::Full_cell_const_handle Full_cell_const_handle;
- typedef typename TDS::Full_cell_const_iterator Full_cell_const_iterator;
-
- typedef typename TDS::Facet_iterator Facet_iterator;
-
- typedef typename TDS::size_type size_type;
- typedef typename TDS::difference_type difference_type;
-
- /// The type of location a new point is found lying on
- enum Locate_type
- {
- ON_VERTEX = 0 // simplex of dimension 0
- , IN_FACE = 1 // simplex of dimension in [ 1, |current_dimension()| - 2 ]
- , IN_FACET = 2 // simplex of dimension |current_dimension()| - 1
- , IN_FULL_CELL = 3 /// simplex of dimension |current_dimension()|
- , OUTSIDE_CONVEX_HULL = 4
- , OUTSIDE_AFFINE_HULL = 5
- };
-
- // Finite elements iterators
-
- class Finiteness_predicate;
-
- typedef boost::filter_iterator<Finiteness_predicate, Vertex_iterator>
- Finite_vertex_iterator;
- typedef boost::filter_iterator<Finiteness_predicate, Vertex_const_iterator>
- Finite_vertex_const_iterator;
- typedef boost::filter_iterator<Finiteness_predicate, Full_cell_iterator>
- Finite_full_cell_iterator;
- typedef boost::filter_iterator<Finiteness_predicate, Full_cell_const_iterator>
- Finite_full_cell_const_iterator;
- typedef boost::filter_iterator<Finiteness_predicate, Facet_iterator>
- Finite_facet_iterator;
-
-protected: // DATA MEMBERS
-
- Triangulation_ds tds_;
- const Geom_traits kernel_;
- Vertex_handle infinity_;
- mutable std::vector<Oriented_side> orientations_;
- mutable boost::optional<Flat_orientation_d> flat_orientation_;
- // The user can specify a Flat_orientation_d object to be used for
- // orienting simplices of a specific dimension
- // (= preset_flat_orientation_.first)
- // preset_flat_orientation_.first = numeric_limits<int>::max() otherwise)
- std::pair<int, const Flat_orientation_d *> preset_flat_orientation_;
- // for stochastic walk in the locate() function:
- mutable Random rng_;
-#ifdef CGAL_TRIANGULATION_STATISTICS
- mutable unsigned long walk_size_;
-#endif
-
-protected: // HELPER FUNCTIONS
-
- typedef CGAL::Iterator_project<
- typename Full_cell::Vertex_handle_const_iterator,
- internal::Triangulation::Point_from_vertex_handle<Vertex_handle, Point>
- > Point_const_iterator;
-
- Point_const_iterator points_begin(Full_cell_const_handle c) const
- { return Point_const_iterator(c->vertices_begin()); }
- Point_const_iterator points_end(Full_cell_const_handle c) const
- { return Point_const_iterator(c->vertices_end()); }
- Point_const_iterator points_begin(Full_cell_handle c) const
- { return Point_const_iterator(c->vertices_begin()); }
- Point_const_iterator points_end(Full_cell_handle c) const
- { return Point_const_iterator(c->vertices_end()); }
-
-public:
-
- // FACETS OPERATIONS
-
- Full_cell_handle full_cell(const Facet & f) const
- {
- return tds().full_cell(f);
- }
-
- int index_of_covertex(const Facet & f) const
- {
- return tds().index_of_covertex(f);
- }
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - UTILITIES
-
- // A co-dimension 2 sub-simplex. called a Rotor because we can rotate
- // the two "covertices" around the sub-simplex. Useful for traversing the
- // boundary of a hole. NOT DOCUMENTED
- typedef cpp11::tuple<Full_cell_handle, int, int> Rotor;
-
- // Commented out because it was causing "internal compiler error" in MSVC
- /*Full_cell_handle full_cell(const Rotor & r) const // NOT DOCUMENTED
- {
- return cpp11::get<0>(r);
- }
- int index_of_covertex(const Rotor & r) const // NOT DOCUMENTED
- {
- return cpp11::get<1>(r);
- }
- int index_of_second_covertex(const Rotor & r) const // NOT DOCUMENTED
- {
- return cpp11::get<2>(r);
- }*/
- Rotor rotate_rotor(Rotor & r) // NOT DOCUMENTED...
- {
- int opposite = cpp11::get<0>(r)->mirror_index(cpp11::get<1>(r));
- Full_cell_handle s = cpp11::get<0>(r)->neighbor(cpp11::get<1>(r));
- int new_second = s->index(cpp11::get<0>(r)->vertex(cpp11::get<2>(r)));
- return Rotor(s, new_second, opposite);
- }
-
- // - - - - - - - - - - - - - - - - - - - - - - - - CREATION / CONSTRUCTORS
-
- Triangulation(int dim, const Geom_traits &k = Geom_traits())
- : tds_(dim)
- , kernel_(k)
- , infinity_()
- , preset_flat_orientation_((std::numeric_limits<int>::max)(),
- (Flat_orientation_d*) NULL)
- , rng_((long)0)
-#ifdef CGAL_TRIANGULATION_STATISTICS
- ,walk_size_(0)
-#endif
- {
- clear();
- }
-
- // With this constructor,
- // the user can specify a Flat_orientation_d object to be used for
- // orienting simplices of a specific dimension
- // (= preset_flat_orientation_.first)
- // It it used for by dark triangulations created by DT::remove
- Triangulation(
- int dim,
- const std::pair<int, const Flat_orientation_d *> &preset_flat_orientation,
- const Geom_traits k = Geom_traits())
- : tds_(dim)
- , kernel_(k)
- , infinity_()
- , preset_flat_orientation_(preset_flat_orientation)
- , rng_((long)0)
-#ifdef CGAL_TRIANGULATION_STATISTICS
- ,walk_size_(0)
-#endif
- {
- clear();
- }
-
- Triangulation(const Triangulation & t2)
- : tds_(t2.tds_)
- , kernel_(t2.kernel_)
- , infinity_()
- , preset_flat_orientation_((std::numeric_limits<int>::max)(),
- (Flat_orientation_d*) NULL)
- , rng_(t2.rng_)
-#ifdef CGAL_TRIANGULATION_STATISTICS
- ,walk_size_(t2.walk_size_)
-#endif
- {
- // We find the vertex at infinity by scanning the vertices of both
- // triangulations. This works because Compact_container garantees that
- // the vertices in the copy (*this) are stored in the same order as in
- // the original triangulation (t2)
- infinity_ = vertices_begin();
- Vertex_const_iterator inf2 = t2.vertices_begin();
- while( inf2 != t2.infinite_vertex() )
- {
- ++infinity_;
- ++inf2;
- }
- // A full_cell has at most 1 + maximal_dimension() facets:
- orientations_.resize(1 + maximal_dimension());
- // Our coaffine orientation predicates HAS state member variables
- reset_flat_orientation();
- }
-
- ~Triangulation() {}
-
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ACCESS FUNCTIONS
-
- /* These three function are no longer needed since we do not use them anymore
- in the Delaunay_triangulation::remove. *But*, they may reappear in the future
- if we manage to passe the information that flags/TDS_data is available or not
- for marking simplices in Delaunay_triangulation::remove. This would be useful
- to make it a little faster, instead of binary searching if a simplex is marked
- or not...
- // NOT DOCUMENTED --
- bool get_visited(Full_cell_handle s) const
- {
- return tds().get_visited(s);
- }
- // NOT DOCUMENTED --
- bool get_visited(Full_cell_const_handle s) const
- {
- return tds().get_visited(s);
- }
-
- // NOT DOCUMENTED --
- void set_visited(Full_cell_handle s, bool b) const
- {
- tds().set_visited(s, b);
- } */
-
- Coaffine_orientation_d coaffine_orientation_predicate() const
- {
- return Coaffine_orientation_d (
- flat_orientation_,
- geom_traits().construct_flat_orientation_d_object(),
- geom_traits().in_flat_orientation_d_object()
- );
- }
-
- const Triangulation_ds & tds() const
- {
- return tds_;
- }
-
- Triangulation_ds & tds()
- {
- return tds_;
- }
-
- const Geom_traits & geom_traits() const
- {
- return kernel_;
- }
-
- int maximal_dimension() const { return tds().maximal_dimension(); }
- int current_dimension() const { return tds().current_dimension(); }
-
- bool empty() const
- {
- return current_dimension() == -1;
- }
-
- size_type number_of_vertices() const
- {
- return tds().number_of_vertices() - 1;
- }
-
- size_type number_of_full_cells() const
- {
- return tds().number_of_full_cells();
- }
-
- Vertex_handle infinite_vertex() const
- {
- return infinity_;
- }
-
- Full_cell_handle infinite_full_cell() const
- {
- CGAL_assertion(infinite_vertex()->full_cell()->has_vertex(infinite_vertex()));
- return infinite_vertex()->full_cell();
- }
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - NON CONSTANT-TIME ACCESS FUNCTIONS
-
- size_type number_of_finite_full_cells() const
- {
- Full_cell_const_iterator s = full_cells_begin();
- size_type result = number_of_full_cells();
- for( ; s != full_cells_end(); ++s )
- {
- if( is_infinite(s) )
- --result;
- }
- return result;
- }
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - TRAVERSAL
-
- Vertex_iterator vertices_begin() { return tds().vertices_begin(); }
- Vertex_iterator vertices_end() { return tds().vertices_end(); }
-
- Vertex_const_iterator vertices_begin() const { return tds().vertices_begin(); }
- Vertex_const_iterator vertices_end() const { return tds().vertices_end(); }
-
- Finite_vertex_iterator finite_vertices_begin()
- { return Finite_vertex_iterator(Finiteness_predicate(*this), vertices_begin(), vertices_end()); }
- Finite_vertex_iterator finite_vertices_end()
- { return Finite_vertex_iterator(Finiteness_predicate(*this), vertices_end(), vertices_end()); }
- Finite_vertex_const_iterator finite_vertices_begin() const
- { return Finite_vertex_const_iterator(Finiteness_predicate(*this), vertices_begin(), vertices_end()); }
- Finite_vertex_const_iterator finite_vertices_end() const
- { return Finite_vertex_const_iterator(Finiteness_predicate(*this), vertices_end(), vertices_end()); }
-
- Full_cell_iterator full_cells_begin() { return tds().full_cells_begin(); }
- Full_cell_iterator full_cells_end() { return tds().full_cells_end(); }
-
- Full_cell_const_iterator full_cells_begin() const { return tds().full_cells_begin(); }
- Full_cell_const_iterator full_cells_end() const { return tds().full_cells_end(); }
-
- Finite_full_cell_iterator finite_full_cells_begin()
- { return Finite_full_cell_iterator(Finiteness_predicate(*this), full_cells_begin(), full_cells_end()); }
- Finite_full_cell_iterator finite_full_cells_end()
- { return Finite_full_cell_iterator(Finiteness_predicate(*this), full_cells_end(), full_cells_end()); }
- Finite_full_cell_const_iterator finite_full_cells_begin() const
- { return Finite_full_cell_const_iterator(Finiteness_predicate(*this), full_cells_begin(), full_cells_end()); }
- Finite_full_cell_const_iterator finite_full_cells_end() const
- { return Finite_full_cell_const_iterator(Finiteness_predicate(*this), full_cells_end(), full_cells_end()); }
-
- Facet_iterator facets_begin() { return tds().facets_begin(); }
- Facet_iterator facets_end() { return tds().facets_end(); }
- Facet_iterator finite_facets_begin()
- { return Finite_facet_iterator(Finiteness_predicate(*this), facets_begin(), facets_end()); }
- Facet_iterator finite_facets_end()
- { return Finite_facet_iterator(Finiteness_predicate(*this), facets_end(), facets_end()); }
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SOME PREDICATE FUNCTORS
-
- class Finiteness_predicate
- {
- const Self & t_;
- public:
- Finiteness_predicate(const Self & t) : t_(t) {}
- template < class T >
- bool operator()(const T & t) const
- {
- return ! t_.is_infinite(t);
- }
- };
-
- class Point_equality_predicate
- {
- const Point & o_;
- public:
- Point_equality_predicate(const Point & o) : o_(o) {}
- bool operator()(const Point & o) const { return (o == o_ );}
- };
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SIMPLE QUERIES
-/*
- bool is_vertex(const Point & p, Vertex_handle & v, Full_cell_handle hint = Full_cell_handle()) const
- {
- Locate_type lt;
- Face f(maximal_dimension());
- Facet ft;
- Full_cell_handle s = locate(p, lt, f, ft, hint);
- if( ON_VERTEX == lt )
- {
- v = s->vertex(f.index(0));
- return true;
- }
- return false;
- }
-
- bool is_vertex(Vertex_const_handle v) const
- {
- return tds().is_vertex(v);
- }
-
- bool is_full_cell(Full_cell_const_handle s) const
- {
- return tds().is_full_cell(s);
- }
-*/
-
- bool is_infinite(Vertex_const_handle v) const
- {
- CGAL_precondition(Vertex_const_handle() != v);
- return (infinite_vertex() == v);
- }
-
- bool is_infinite(const Vertex & v) const /* internal use, not documented */
- {
- return (&(*infinite_vertex()) == &v);
- }
-
- bool is_infinite(Full_cell_const_handle s) const
- {
- CGAL_precondition(Full_cell_const_handle() != s);
- return is_infinite(*s);
- }
- bool is_infinite(const Full_cell & s) const /* internal use, not documented */
- {
- for(int i = 0; i <= current_dimension(); ++i)
- if( is_infinite(s.vertex(i)) )
- return true;
- return false;
- }
- bool is_infinite(const Facet & ft) const
- {
- Full_cell_const_handle s = full_cell(ft);
- CGAL_precondition(s != Full_cell_const_handle());
- if( is_infinite(s) )
- return (s->vertex(index_of_covertex(ft)) != infinite_vertex());
- return false;
- }
-
- bool is_infinite(const Face & f) const
- {
- Full_cell_const_handle s = f.full_cell();
- CGAL_precondition(s != Full_cell_const_handle());
- if( is_infinite(s) )
- {
- Vertex_handle v;
- for( int i(0); i<= f.face_dimension(); ++i)
- if ( is_infinite( f.vertex(i) )) return true;
- }
- return false;
- }
-
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ELEMENT GATHERING
-
-
- template< typename OutputIterator >
- OutputIterator incident_full_cells(const Face & f, OutputIterator out) const
- {
- return tds().incident_full_cells(f, out);
- }
- template< typename OutputIterator >
- OutputIterator incident_full_cells(Vertex_const_handle v, OutputIterator out) const
- {
- return tds().incident_full_cells(v, out);
- }
- template< typename OutputIterator >
- OutputIterator star(const Face & f, OutputIterator out) const
- {
- return tds().star(f, out);
- }
-
- template< typename OutputIterator >
- OutputIterator incident_faces(Vertex_const_handle v, int d, OutputIterator out) const
- {
- return tds().incident_faces(v, d, out);
- }
- /*
- template< typename OutputIterator, class Comparator >
- OutputIterator incident_upper_faces( Vertex_const_handle v, int d,
- OutputIterator out, Comparator cmp = Comparator())
- {
- return tds().incident_upper_faces(v, d, out, cmp);
- }
- template< typename OutputIterator >
- OutputIterator incident_upper_faces( Vertex_const_handle v, int d,
- OutputIterator out)
- { // FIXME: uncomment this function, since it uses a comparator specific to
- // *geometric* triangulation (taking infinite vertex into account)
- internal::Triangulation::Compare_vertices_for_upper_face<Self> cmp(*this);
- return tds().incident_upper_faces(v, d, out, cmp);
- }
- */
- Orientation orientation(Full_cell_const_handle s, bool in_is_valid = false) const
- {
- if( ! in_is_valid )
- CGAL_assertion( ! is_infinite(s) );
- if( 0 == current_dimension() )
- return POSITIVE;
- if( current_dimension() == maximal_dimension() )
- {
- Orientation_d ori = geom_traits().orientation_d_object();
- return ori(points_begin(s), points_begin(s) + 1 + current_dimension());
- }
- else
- {
- return coaffine_orientation_predicate()(points_begin(s), points_begin(s) + 1 + current_dimension());
- }
- }
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - UPDATE OPERATIONS
-
- void clear()
- {
- tds_.clear();
- infinity_ = tds().insert_increase_dimension();
- // A full_cell has at most 1 + maximal_dimension() facets:
- orientations_.resize(1 + maximal_dimension());
- // Our coaffine orientation predicates HAS state member variables
- reset_flat_orientation();
-#ifdef CGAL_TRIANGULATION_STATISTICS
- walk_size_ = 0;
-#endif
- }
-
- void set_current_dimension(int d)
- {
- tds().set_current_dimension(d);
- }
-
- Full_cell_handle new_full_cell()
- {
- return tds().new_full_cell();
- }
-
- Vertex_handle new_vertex()
- {
- return tds().new_vertex();
- }
-
- Vertex_handle new_vertex(const Point & p)
- {
- return tds().new_vertex(p);
- }
-
- void set_neighbors(Full_cell_handle s, int i, Full_cell_handle s1, int j)
- {
- tds().set_neighbors(s, i, s1, j);
- }
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - VALIDITY
-
- bool is_valid(bool = false, int = 0) const;
- bool are_incident_full_cells_valid(Vertex_const_handle, bool = false, int = 0) const;
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POINT LOCATION
-
-protected:
- template< typename OrientationPredicate >
- Full_cell_handle do_locate(const Point &, Locate_type &, Face &, Facet &,
- Full_cell_handle start,
- const OrientationPredicate & o) const;
-public:
- Full_cell_handle locate(const Point &, Locate_type &, Face &, Facet &,
- Full_cell_handle start = Full_cell_handle()) const;
- Full_cell_handle locate(const Point &, Locate_type &, Face &, Facet &,
- Vertex_handle) const;
- Full_cell_handle locate(const Point & p, Full_cell_handle s = Full_cell_handle()) const;
- Full_cell_handle locate(const Point & p, Vertex_handle v) const;
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - REMOVALS
-
- Vertex_handle contract_face(const Point &, const Face &);
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - POINT INSERTION
-
- template< typename ForwardIterator >
- size_type insert(ForwardIterator start, ForwardIterator end)
- {
- size_type n = number_of_vertices();
- std::vector<Point> points(start, end);
- spatial_sort(points.begin(), points.end(), geom_traits());
- Full_cell_handle hint = Full_cell_handle();
- typename std::vector<Point>::const_iterator s = points.begin();
- while( s != points.end() )
- {
- hint = insert(*s++, hint)->full_cell();
- }
- return number_of_vertices() - n;
- }
- Vertex_handle insert(const Point &, Locate_type, const Face &, const Facet &, Full_cell_handle);
- Vertex_handle insert(const Point &, Full_cell_handle start = Full_cell_handle());
- Vertex_handle insert(const Point &, Vertex_handle);
- template< typename ForwardIterator >
- Vertex_handle insert_in_hole(const Point & p, ForwardIterator start, ForwardIterator end, const Facet & ft)
- {
- Emptyset_iterator out;
- return insert_in_hole(p, start, end, ft, out);
- }
- template< typename ForwardIterator, typename OutputIterator >
- Vertex_handle insert_in_hole(const Point & p, ForwardIterator start, ForwardIterator end, const Facet & ft,
- OutputIterator out)
- {
- Vertex_handle v = tds().insert_in_hole(start, end, ft, out);
- v->set_point(p);
- return v;
- }
- Vertex_handle insert_in_face(const Point &, const Face &);
- Vertex_handle insert_in_facet(const Point &, const Facet &);
- Vertex_handle insert_in_full_cell(const Point &, Full_cell_handle);
- Vertex_handle insert_outside_convex_hull_1(const Point &, Full_cell_handle);
- Vertex_handle insert_outside_convex_hull(const Point &, Full_cell_handle);
- Vertex_handle insert_outside_affine_hull(const Point &);
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - FACET-TRAVERSAL PREDICATES
-
- template< typename OrientationPredicate >
- class Outside_convex_hull_traversal_predicate
- {
- Triangulation & t_;
- const Point & p_;
- OrientationPredicate const& ori_;
- int cur_dim_;
- public:
- Outside_convex_hull_traversal_predicate(Triangulation & t, const Point & p,
- OrientationPredicate const& ori)
- : t_(t), p_(p), ori_(ori), cur_dim_(t.current_dimension()) {}
- // FUTURE change parameter to const reference
- bool operator()(Facet f) const
- {
- Full_cell_handle s = t_.full_cell(f);
- const int i = t_.index_of_covertex(f);
- Full_cell_handle n = s->neighbor(i);
- if( ! t_.is_infinite(n) )
- return false;
- int inf_v_index = n->index(t_.infinite_vertex());
- n->vertex(inf_v_index)->set_point(p_);
- bool ok = (POSITIVE == ori_(t_.points_begin(n), t_.points_begin(n) + cur_dim_ + 1));
- return ok;
- }
- };
-
- // make sure all full_cells have positive orientation
- void reorient_full_cells();
-
-protected:
- // This is used in the |remove(v)| member function to manage sets of Full_cell_handles
- template< typename FCH >
- struct Full_cell_set : public std::vector<FCH>
- {
- typedef std::vector<FCH> Base_set;
- using Base_set::begin;
- using Base_set::end;
- void make_searchable()
- { // sort the full cell handles
- std::sort(begin(), end());
- }
- bool contains(const FCH & fch) const
- {
- return std::binary_search(begin(), end(), fch);
- }
- bool contains_1st_and_not_2nd(const FCH & fst, const FCH & snd) const
- {
- return ( ! contains(snd) ) && ( contains(fst) );
- }
- };
-
- void display_all_full_cells__debugging() const
- {
- std::cerr << "ALL FULL CELLS:" << std::endl;
- for (Full_cell_const_iterator cit = full_cells_begin() ;
- cit != full_cells_end() ; ++cit )
- {
- std::cerr << std::hex << &*cit << ": ";
- for (int jj = 0 ; jj <= current_dimension() ; ++jj)
- std::cerr << (is_infinite(cit->vertex(jj)) ? 0xFFFFFFFF : (unsigned int)&*cit->vertex(jj)) << " - ";
- std::cerr << std::dec << std::endl;
- }
- std::cerr << std::endl;
- }
-
-
-}; // Triangulation<...>
-
-// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
-
-// CLASS MEMBER FUNCTIONS
-
-template < class TT, class TDS >
-void
-Triangulation<TT, TDS>
-::reorient_full_cells()
-{
- if( current_dimension() < 1 )
- return;
-
- Full_cell_iterator sit = full_cells_begin();
- Full_cell_iterator send = full_cells_end();
- for ( ; sit != send ; ++sit)
- {
- if( ! (is_infinite(sit) && (1 == current_dimension())) )
- {
- sit->swap_vertices(current_dimension() - 1, current_dimension());
- }
- }
-}
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-// - - - - - - - - - - - - - - - - - - - - - - - - THE REMOVAL METHODS
-
-template < class TT, class TDS >
-typename Triangulation<TT, TDS>::Vertex_handle
-Triangulation<TT, TDS>
-::contract_face(const Point & p, const Face & f)
-{
- CGAL_precondition( ! is_infinite(f) );
- Vertex_handle v = tds().contract_face(f);
- v->set_point(p);
- CGAL_expensive_postcondition_msg(are_incident_full_cells_valid(v), "new point is not where it should be");
- return v;
-}
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-// - - - - - - - - - - - - - - - - - - - - - - - - THE INSERTION METHODS
-
-template < class TT, class TDS >
-typename Triangulation<TT, TDS>::Vertex_handle
-Triangulation<TT, TDS>
-::insert(const Point & p, Locate_type lt, const Face & f, const Facet & ft, Full_cell_handle s)
-{
- switch( lt )
- {
- case IN_FULL_CELL:
- return insert_in_full_cell(p, s);
- break;
- case OUTSIDE_CONVEX_HULL:
- return insert_outside_convex_hull(p, s);
- break;
- case OUTSIDE_AFFINE_HULL:
- return insert_outside_affine_hull(p);
- break;
- case IN_FACET:
- {
- return insert_in_facet(p, ft);
- break;
- }
- case IN_FACE:
- return insert_in_face(p, f);
- break;
- case ON_VERTEX:
- s->vertex(f.index(0))->set_point(p);
- return s->vertex(f.index(0));
- break;
- }
- CGAL_assertion(false);
- return Vertex_handle();
-}
-
-template < class TT, class TDS >
-typename Triangulation<TT, TDS>::Vertex_handle
-Triangulation<TT, TDS>
-::insert(const Point & p, Full_cell_handle start)
-{
- Locate_type lt;
- Face f(maximal_dimension());
- Facet ft;
- Full_cell_handle s = locate(p, lt, f, ft, start);
- return insert(p, lt, f, ft, s);
-}
-
-template < class TT, class TDS >
-typename Triangulation<TT, TDS>::Vertex_handle
-Triangulation<TT, TDS>
-::insert(const Point & p, Vertex_handle v)
-{
- if( Vertex_handle() == v )
- v = infinite_vertex();
- return insert(p, v->full_cell());
-}
-
-template < class TT, class TDS >
-typename Triangulation<TT, TDS>::Vertex_handle
-Triangulation<TT, TDS>
-::insert_in_face(const Point & p, const Face & f)
-{
- CGAL_precondition( ! is_infinite(f) );
- Vertex_handle v = tds().insert_in_face(f);
- v->set_point(p);
- return v;
-}
-
-template < class TT, class TDS >
-typename Triangulation<TT, TDS>::Vertex_handle
-Triangulation<TT, TDS>
-::insert_in_facet(const Point & p, const Facet & ft)
-{
- CGAL_precondition( ! is_infinite(ft) );
- Vertex_handle v = tds().insert_in_facet(ft);
- v->set_point(p);
- return v;
-}
-
-template < class TT, class TDS >
-typename Triangulation<TT, TDS>::Vertex_handle
-Triangulation<TT, TDS>
-::insert_in_full_cell(const Point & p, Full_cell_handle s)
-{
- CGAL_precondition( ! is_infinite(s) );
- Vertex_handle v = tds().insert_in_full_cell(s);
- v->set_point(p);
- return v;
-}
-
-// NOT DOCUMENTED...
-template < class TT, class TDS >
-typename Triangulation<TT, TDS>::Vertex_handle
-Triangulation<TT, TDS>
-::insert_outside_convex_hull_1(const Point & p, Full_cell_handle s)
-{
- // This is a special case for dimension 1, because in that case, the right
- // infinite full_cell is not correctly oriented... (sice its first vertex is the
- // infinite one...
- CGAL_precondition( is_infinite(s) );
- CGAL_precondition( 1 == current_dimension() );
- Vertex_handle v = tds().insert_in_full_cell(s);
- v->set_point(p);
- return v;
-}
-
-template < class TT, class TDS >
-typename Triangulation<TT, TDS>::Vertex_handle
-Triangulation<TT, TDS>
-::insert_outside_convex_hull(const Point & p, Full_cell_handle s)
-{
- if( 1 == current_dimension() )
- {
- return insert_outside_convex_hull_1(p, s);
- }
- CGAL_precondition( is_infinite(s) );
- CGAL_assertion( current_dimension() >= 2 );
- std::vector<Full_cell_handle> simps;
- simps.reserve(64);
- std::back_insert_iterator<std::vector<Full_cell_handle> > out(simps);
- if( current_dimension() < maximal_dimension() )
- {
- Coaffine_orientation_d ori = coaffine_orientation_predicate();
- Outside_convex_hull_traversal_predicate<Coaffine_orientation_d>
- ochtp(*this, p, ori);
- tds().gather_full_cells(s, ochtp, out);
- }
- else
- {
- Orientation_d ori = geom_traits().orientation_d_object();
- Outside_convex_hull_traversal_predicate<Orientation_d>
- ochtp(*this, p, ori);
- tds().gather_full_cells(s, ochtp, out);
- }
- int inf_v_index = s->index(infinite_vertex());
- Vertex_handle v = insert_in_hole(
- p, simps.begin(), simps.end(), Facet(s, inf_v_index));
- return v;
-}
-
-template < class TT, class TDS >
-typename Triangulation<TT, TDS>::Vertex_handle
-Triangulation<TT, TDS>
-::insert_outside_affine_hull(const Point & p)
-{
- CGAL_precondition( current_dimension() < maximal_dimension() );
- Vertex_handle v = tds().insert_increase_dimension(infinite_vertex());
- // reset the orientation predicate:
- reset_flat_orientation();
- v->set_point(p);
- if( current_dimension() >= 1 )
- {
- Full_cell_handle inf_v_cell = infinite_vertex()->full_cell();
- int inf_v_index = inf_v_cell->index(infinite_vertex());
- Full_cell_handle s = inf_v_cell->neighbor(inf_v_index);
- Orientation o = orientation(s);
- CGAL_assertion( COPLANAR != o );
- if( NEGATIVE == o )
- reorient_full_cells();
-
-
- // We just inserted the second finite point and the right infinite
- // cell is like : (inf_v, v), but we want it to be (v, inf_v) to be
- // consistent with the rest of the cells
- if (current_dimension() == 1)
- {
- // Is "inf_v_cell" the right infinite cell?
- // Then inf_v_index should be 1
- if (inf_v_cell->neighbor(inf_v_index)->index(inf_v_cell) == 0
- && inf_v_index == 0)
- {
- inf_v_cell->swap_vertices(
- current_dimension() - 1, current_dimension());
- }
- // Otherwise, let's find the right infinite cell
- else
- {
- inf_v_cell = inf_v_cell->neighbor((inf_v_index + 1) % 2);
- inf_v_index = inf_v_cell->index(infinite_vertex());
- // Is "inf_v_cell" the right infinite cell?
- // Then inf_v_index should be 1
- if (inf_v_cell->neighbor(inf_v_index)->index(inf_v_cell) == 0
- && inf_v_index == 0)
- {
- inf_v_cell->swap_vertices(
- current_dimension() - 1, current_dimension());
- }
- }
- }
- }
- return v;
-}
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-// - - - - - - - - - - - - - - - - - - - - THE MAIN LOCATE(...) FUNCTION
-
-template < class TT, class TDS >
-template< typename OrientationPredicate >
-typename Triangulation<TT, TDS>::Full_cell_handle
-Triangulation<TT, TDS>
-::do_locate(const Point & p, // query point
- Locate_type & loc_type,// type of result (full_cell, face, vertex)
- Face & face,// the face containing the query in its interior (when appropriate)
- Facet & facet,// the facet containing the query in its interior (when appropriate)
- Full_cell_handle start, // starting full_cell for the walk
- OrientationPredicate const& orientation_pred
- ) const
-{
- const int cur_dim = current_dimension();
-
- if( cur_dim == -1 )
- {
- loc_type = OUTSIDE_AFFINE_HULL;
- return Full_cell_handle();
- }
- else if( cur_dim == 0 )
- {
- Vertex_handle vit = infinite_full_cell()->neighbor(0)->vertex(0);
- if( EQUAL != geom_traits().compare_lexicographically_d_object()(p, vit->point()) )
- {
- loc_type = OUTSIDE_AFFINE_HULL;
- return Full_cell_handle();
- }
- else
- {
- loc_type = ON_VERTEX;
- face.set_full_cell(vit->full_cell());
- face.set_index(0, 0);
- return vit->full_cell();
- }
- }
-
- Full_cell_handle s;
-
- // if we don't know where to start, we start from any bounded full_cell
- if( Full_cell_handle() == start )
- {
- // THE HACK THAT NOBODY SHOULD DO... BUT DIFFICULT TO WORK AROUND
- // THIS... TODO: WORK AROUND IT
- Full_cell_handle inf_c = const_cast<Self*>(this)->infinite_full_cell();
- int inf_v_index = inf_c->index(infinite_vertex());
- s = inf_c->neighbor(inf_v_index);
- }
- else
- {
- s = start;
- if( is_infinite(s) )
- {
- int inf_v_index = s->index(infinite_vertex());
- s = s->neighbor(inf_v_index);
- }
- }
-
- // Check if query |p| is outside the affine hull
- if( cur_dim < maximal_dimension() )
- {
- if( ! geom_traits().contained_in_affine_hull_d_object()(
- points_begin(s),
- points_begin(s) + current_dimension() + 1,
- p) )
- {
- loc_type = OUTSIDE_AFFINE_HULL;
- return Full_cell_handle();
- }
- }
-
- // we remember the |previous|ly visited full_cell to avoid the evaluation
- // of one |orientation| predicate
- Full_cell_handle previous = Full_cell_handle();
- bool full_cell_not_found = true;
- while(full_cell_not_found) // we walk until we locate the query point |p|
- {
- #ifdef CGAL_TRIANGULATION_STATISTICS
- ++walk_size_;
- #endif
- // For the remembering stochastic walk, we need to start trying
- // with a random index:
- int j, i = rng_.get_int(0, cur_dim);
- // we check |p| against all the full_cell's hyperplanes in turn
-
- for(j = 0; j <= cur_dim; ++j, i = (i + 1) % (cur_dim + 1) )
- {
- Full_cell_handle next = s->neighbor(i);
- if( previous == next )
- { // no need to compute the orientation, we already know it
- orientations_[i] = POSITIVE;
- continue; // go to next full_cell's facet
- }
-
- Substitute_point_in_vertex_iterator<
- typename Full_cell::Vertex_handle_const_iterator>
- spivi(s->vertex(i), &p);
-
- orientations_[i] = orientation_pred(
- boost::make_transform_iterator(s->vertices_begin(), spivi),
- boost::make_transform_iterator(s->vertices_begin() + cur_dim + 1,
- spivi));
-
- if( orientations_[i] != NEGATIVE )
- {
- // from this facet's point of view, we are inside the
- // full_cell or on its boundary, so we continue to next facet
- continue;
- }
-
- // At this point, we know that we have to jump to the |next|
- // full_cell because orientation_[i] == NEGATIVE
- previous = s;
- s = next;
- if( is_infinite(next) )
- { // we have arrived OUTSIDE the convex hull of the triangulation,
- // so we stop the search
- full_cell_not_found = false;
- loc_type = OUTSIDE_CONVEX_HULL;
- face.set_full_cell(s);
- }
- break;
- } // end of the 'for' loop
- if( ( cur_dim + 1 ) == j ) // we found the full_cell containing |p|
- full_cell_not_found = false;
- }
- // Here, we know in which full_cell |p| is in.
- // We now check more precisely where |p| landed:
- // vertex, facet, face or full_cell.
- if( ! is_infinite(s) )
- {
- face.set_full_cell(s);
- int num(0);
- int verts(0);
- for(int i = 0; i < cur_dim; ++i)
- {
- if( orientations_[i] == COPLANAR )
- {
- ++num;
- facet = Facet(s, i);
- }
- else
- face.set_index(verts++, i);
- }
- //-- We could put the if{}else{} below in the loop above, but then we would
- // need to test if (verts < cur_dim) many times... we do it only once
- // here:
- if( orientations_[cur_dim] == COPLANAR )
- {
- ++num;
- facet = Facet(s, cur_dim);
- }
- else if( verts < cur_dim )
- face.set_index(verts, cur_dim);
- //-- end of remark above //
- if( 0 == num )
- {
- loc_type = IN_FULL_CELL;
- face.clear();
- }
- else if( cur_dim == num )
- loc_type = ON_VERTEX;
- else if( 1 == num )
- loc_type = IN_FACET;
- else
- loc_type = IN_FACE;
- }
- return s;
-}
-
-template < class TT, class TDS >
-typename Triangulation<TT, TDS>::Full_cell_handle
-Triangulation<TT, TDS>
-::locate( const Point & p, // query point
- Locate_type & loc_type,// type of result (full_cell, face, vertex)
- Face & face,// the face containing the query in its interior (when appropriate)
- Facet & facet,// the facet containing the query in its interior (when appropriate)
- Full_cell_handle start// starting full_cell for the walk
- ) const
-{
- if( current_dimension() == maximal_dimension() )
- {
- Orientation_d ori = geom_traits().orientation_d_object();
- return do_locate(p, loc_type, face, facet, start, ori);
- }
- else
- return do_locate(p, loc_type, face, facet, start, coaffine_orientation_predicate());
-}
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-// - - - - - - - - - - - - - - - - - - - - the locate(...) variants
-
-template < class TT, class TDS >
-typename Triangulation<TT, TDS>::Full_cell_handle
-Triangulation<TT, TDS>
-::locate( const Point & p,
- Locate_type & loc_type,
- Face & face,
- Facet & facet,
- Vertex_handle start) const
-{
- if( Vertex_handle() == start )
- start = infinite_vertex();
- return locate(p, loc_type, face, facet, start->full_cell());
-}
-
-template < class TT, class TDS >
-typename Triangulation<TT, TDS>::Full_cell_handle
-Triangulation<TT, TDS>
-::locate(const Point & p, Full_cell_handle s) const
-{
- Locate_type lt;
- Face face(maximal_dimension());
- Facet facet;
- return locate(p, lt, face, facet, s);
-}
-
-template < class TT, class TDS >
-typename Triangulation<TT, TDS>::Full_cell_handle
-Triangulation<TT, TDS>
-::locate(const Point & p, Vertex_handle v) const
-{
- if( Vertex_handle() != v )
- v = infinite_vertex();
- return this->locate(p, v->full_cell());
-}
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - VALIDITY
-
-template < class TT, class TDS >
-bool
-Triangulation<TT, TDS>
-::is_valid(bool verbose, int level) const
-{
- if( ! tds().is_valid(verbose, level) )
- return false;
-
- Full_cell_const_iterator c;
- if( current_dimension() < 0 )
- return true;
- Orientation o;
- for( c = full_cells_begin(); c != full_cells_end(); ++c )
- {
- if( is_infinite(c) )
- {
- if( current_dimension() > 1 )
- {
- int i = c->index( infinite_vertex() );
- Full_cell_handle n = c->neighbor(i);
- infinite_vertex()->set_point(n->vertex(c->mirror_index(i))->point());
- o = - orientation(c, true);
- }
- else
- o = POSITIVE;
- }
- else
- o = orientation(c, true);
- if( NEGATIVE == o )
- {
- if( verbose ) CGAL_warning_msg(false, "full_cell is not correctly oriented");
- return false;
- }
- if( COPLANAR == o )
- {
- if( verbose ) CGAL_warning_msg(false, "full_cell is flat");
- return false;
- }
- }
- return true;
-}
-
-template < class TT, class TDS >
-bool Triangulation<TT, TDS>::are_incident_full_cells_valid(Vertex_const_handle v, bool verbose, int) const
-{
- if( current_dimension() <= 0 )
- return true;
- typedef std::vector<Full_cell_const_handle> Simps;
- Simps simps;
- simps.reserve(64);
- std::back_insert_iterator<Simps> out(simps);
- incident_full_cells(v, out);
- typename Simps::const_iterator sit = simps.begin();
- for( ; sit != simps.end(); ++sit )
- {
- if( is_infinite(*sit) )
- continue;
- Orientation o = orientation(*sit);
- if( NEGATIVE == o )
- {
- if( verbose ) CGAL_warning_msg(false, "full_cell is not correctly oriented");
- return false;
- }
- if( COPLANAR == o )
- {
- if( verbose ) CGAL_warning_msg(false, "full_cell is flat");
- return false;
- }
- }
- return true;
-}
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-// FUNCTIONS THAT ARE NOT MEMBER FUNCTIONS:
-
-template < class TT, class TDS >
-std::istream &
-operator>>(std::istream & is, Triangulation<TT, TDS> & tr)
- // reads :
- // - the dimensions (maximal and current)
- // - the number of finite vertices
- // - the non combinatorial information on vertices (point, etc)
- // - the number of full_cells
- // - the full_cells by the indices of their vertices in the preceding list
- // of vertices, plus the non combinatorial information on each full_cell
- // - the neighbors of each full_cell by their index in the preceding list
-{
- typedef Triangulation<TT, TDS> T;
- typedef typename T::Vertex_handle Vertex_handle;
-
- // read current dimension and number of vertices
- size_t n;
- int cd;
- if( is_ascii(is) )
- is >> cd >> n;
- else
- {
- read(is, cd);
- read(is, n, io_Read_write());
- }
-
- CGAL_assertion_msg( cd <= tr.maximal_dimension(), "input Triangulation has too high dimension");
-
- tr.clear();
- tr.set_current_dimension(cd);
-
- if( n == 0 )
- return is;
-
- std::vector<Vertex_handle> vertices;
- vertices.resize(n+1);
- vertices[0] = tr.infinite_vertex();
- is >> (*vertices[0]);
-
- // read the vertices:
- size_t i(1);
- while( i <= n )
- {
- vertices[i] = tr.new_vertex();
- is >> (*vertices[i]); // read a vertex
- ++i;
- }
-
- // now, read the combinatorial information
- return tr.tds().read_full_cells(is, vertices);
-}
-
-template < class TT, class TDS >
-std::ostream &
-operator<<(std::ostream & os, const Triangulation<TT, TDS> & tr)
- // writes :
- // - the dimensions (maximal and current)
- // - the number of finite vertices
- // - the non combinatorial information on vertices (point, etc)
- // - the number of full_cells
- // - the full_cells by the indices of their vertices in the preceding list
- // of vertices, plus the non combinatorial information on each full_cell
- // - the neighbors of each full_cell by their index in the preceding list
-{
- typedef Triangulation<TT, TDS> T;
- typedef typename T::Vertex_const_handle Vertex_handle;
- typedef typename T::Vertex_const_iterator Vertex_iterator;
-
- // outputs dimensions and number of vertices
- size_t n = tr.number_of_vertices();
- if( is_ascii(os) )
- os << tr.current_dimension() << std::endl << n << std::endl;
- else
- {
- write(os, tr.current_dimension());
- write(os, n, io_Read_write());
- }
-
- if( n == 0 )
- return os;
-
- size_t i(0);
- // write the vertices
- std::map<Vertex_handle, int> index_of_vertex;
-
- // infinite vertex has index 0 (among all the vertices)
- index_of_vertex[tr.infinite_vertex()] = i++;
- os << *tr.infinite_vertex();
- for( Vertex_iterator it = tr.vertices_begin(); it != tr.vertices_end(); ++it )
- {
- if( tr.is_infinite(it) )
- continue;
- os << *it; // write the vertex
- index_of_vertex[it] = i++;
- }
- CGAL_assertion( i == n+1 );
-
- // output the combinatorial information
- return tr.tds().write_full_cells(os, index_of_vertex);
-}
-
-} //namespace CGAL
-
-#endif // CGAL_TRIANGULATION_H
diff --git a/include/gudhi_patches/CGAL/Triangulation_data_structure.h b/include/gudhi_patches/CGAL/Triangulation_data_structure.h
deleted file mode 100644
index 2493c712..00000000
--- a/include/gudhi_patches/CGAL/Triangulation_data_structure.h
+++ /dev/null
@@ -1,1603 +0,0 @@
-// Copyright (c) 2009-2014 INRIA Sophia-Antipolis (France).
-// All rights reserved.
-//
-// This file is part of CGAL (www.cgal.org).
-// 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.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Samuel Hornus
-
-#ifndef CGAL_TRIANGULATION_DATA_STRUCTURE_H
-#define CGAL_TRIANGULATION_DATA_STRUCTURE_H
-
-#include <CGAL/basic.h>
-#include <CGAL/Default.h>
-#include <CGAL/iterator.h>
-#include <CGAL/Compact_container.h>
-#include <CGAL/Triangulation_face.h>
-#include <CGAL/Triangulation_ds_vertex.h>
-#include <CGAL/Triangulation_ds_full_cell.h>
-#include <CGAL/internal/Combination_enumerator.h>
-#include <CGAL/internal/Triangulation/utilities.h>
-#include <CGAL/internal/Triangulation/Triangulation_ds_iterators.h>
-
-#include <algorithm>
-#include <vector>
-#include <queue>
-#include <set>
-
-namespace CGAL {
-
-template< class Dimen,
- class Vb = Default,
- class Fcb = Default >
-class Triangulation_data_structure
-{
- typedef Triangulation_data_structure<Dimen, Vb, Fcb> Self;
- typedef typename Default::Get<Vb, Triangulation_ds_vertex<> >::type V_base;
- typedef typename Default::Get<Fcb, Triangulation_ds_full_cell<> >::type FC_base;
-
-public:
- typedef typename V_base::template Rebind_TDS<Self>::Other Vertex; /* Concept */
- typedef typename FC_base::template Rebind_TDS<Self>::Other Full_cell; /* Concept */
-
- // Tools to change the Vertex and Cell types of the TDS.
- template < typename Vb2 >
- struct Rebind_vertex {
- typedef Triangulation_data_structure<Dimen, Vb2, Fcb> Other;
- };
-
- template < typename Fcb2 >
- struct Rebind_full_cell {
- typedef Triangulation_data_structure<Dimen, Vb, Fcb2> Other;
- };
-
-
-
- // we want to store an object of this class in every Full_cell:
- class Full_cell_data
- {
- unsigned char bits_;
- public:
- Full_cell_data() : bits_(0) {}
- Full_cell_data(const Full_cell_data & fcd) : bits_(fcd.bits_) {}
-
- void clear() { bits_ = 0; }
- void mark_visited() { bits_ = 1; }
- void clear_visited() { bits_ = 0; }
-
- bool is_clear() const { return bits_ == 0; }
- bool is_visited() const { return bits_ == 1; }
- // WARNING: if we use more bits and several bits can be set at once,
- // then make sure to use bitwise operation above, instead of direct
- // affectation.
- };
-
-protected:
- typedef Compact_container<Vertex> Vertex_container;
- typedef Compact_container<Full_cell> Full_cell_container;
-
-public:
- typedef Dimen Maximal_dimension;
-
- typedef typename Vertex_container::size_type size_type; /* Concept */
- typedef typename Vertex_container::difference_type difference_type; /* Concept */
-
- typedef typename Vertex_container::iterator Vertex_handle; /* Concept */
- typedef typename Vertex_container::iterator Vertex_iterator; /* Concept */
- typedef typename Vertex_container::const_iterator Vertex_const_handle;
- typedef typename Vertex_container::const_iterator Vertex_const_iterator;
-
- typedef typename Full_cell_container::iterator Full_cell_handle; /* Concept */
- typedef typename Full_cell_container::iterator Full_cell_iterator; /* Concept */
- typedef typename Full_cell_container::const_iterator Full_cell_const_handle;
- typedef typename Full_cell_container::const_iterator Full_cell_const_iterator;
-
- typedef internal::Triangulation::
- Triangulation_ds_facet_iterator<Self> Facet_iterator; /* Concept */
-
- /* The 2 types defined below, |Facet| and |Rotor| are used when traversing
- the boundary `B' of the union of a set of full cells. |Rotor| makes it
- easy to rotate around itself, in the search of neighbors in `B' (see
- |rotate_rotor| and |insert_in_tagged_hole|) */
-
- // A co-dimension 1 sub-simplex.
- class Facet /* Concept */
- {
- Full_cell_handle full_cell_;
- int index_of_covertex_;
- public:
- Facet() : full_cell_(), index_of_covertex_(0) {}
- Facet(Full_cell_handle f, int i) : full_cell_(f), index_of_covertex_(i) {}
- Full_cell_handle full_cell() const { return full_cell_; }
- int index_of_covertex() const { return index_of_covertex_; }
- };
-
- // A co-dimension 2 sub-simplex. called a Rotor because we can rotate
- // the two "covertices" around the sub-simplex. Useful for traversing the
- // boundary of a hole. NOT DOCUMENTED
- class Rotor : public Facet
- {
- int index_of_second_covertex_;
- public:
- Rotor() : Facet(), index_of_second_covertex_(0) {}
- Rotor(Full_cell_handle f, int first, int second) : Facet(f, first), index_of_second_covertex_(second) {}
- int index_of_second_covertex() const { return index_of_second_covertex_; }
- };
-
- typedef Triangulation_face<Self> Face; /* Concept */
-
-protected: // DATA MEMBERS
-
- int dmax_, dcur_; // dimension of the current triangulation
- Vertex_container vertices_; // list of all vertices
- Full_cell_container full_cells_; // list of all full cells
-
-private:
-
- void clean_dynamic_memory()
- {
- vertices_.clear();
- full_cells_.clear();
- }
-
- template < class Dim_tag >
- struct get_maximal_dimension
- {
- static int value(int D) { return D; }
- };
- // specialization
- template < int D >
- struct get_maximal_dimension<Dimension_tag<D> >
- {
- static int value(int) { return D; }
- };
-
-public:
- Triangulation_data_structure( int dim=0) /* Concept */
- : dmax_(get_maximal_dimension<Dimen>::value(dim)), dcur_(-2),
- vertices_(), full_cells_()
- {
- CGAL_assertion_msg(dmax_ > 0, "maximal dimension must be positive.");
- }
-
- ~Triangulation_data_structure()
- {
- clean_dynamic_memory();
- }
-
- Triangulation_data_structure(const Triangulation_data_structure & tds)
- : dmax_(tds.dmax_), dcur_(tds.dcur_),
- vertices_(tds.vertices_), full_cells_(tds.full_cells_)
- {
- typedef std::map<Vertex_const_handle, Vertex_handle> V_map;
- typedef std::map<Full_cell_const_handle, Full_cell_handle> C_map;
- V_map vmap;
- C_map cmap;
- Vertex_const_iterator vfrom = tds.vertices_begin();
- Vertex_iterator vto = vertices_begin();
- Full_cell_const_iterator cfrom = tds.full_cells_begin();
- Full_cell_iterator cto = full_cells_begin();
- while( vfrom != tds.vertices_end() )
- vmap[vfrom++] = vto++;
- while( cfrom != tds.full_cells_end() )
- cmap[cfrom++] = cto++;
- cto = full_cells_begin();
- while( cto != full_cells_end() )
- {
- for( int i = 0; i <= (std::max)(0, current_dimension()); ++i )
- {
- associate_vertex_with_full_cell(cto, i, vmap[cto->vertex(i)]);
- cto->set_neighbor(i, cmap[cto->neighbor(i)]);
- }
- ++cto;
- }
- }
-
- // QUERIES
-
-protected:
-
- bool check_range(int i) const
- {
- if( current_dimension() < 0 )
- {
- return (0 == i);
- }
- return ( (0 <= i) && (i <= current_dimension()) );
- }
-
-public:
-
- /* returns the current dimension of the full cells in the triangulation. */
- int maximal_dimension() const { return dmax_; } /* Concept */
- int current_dimension() const { return dcur_; } /* Concept */
-
- size_type number_of_vertices() const /* Concept */
- {
- return this->vertices_.size();
- }
- size_type number_of_full_cells() const /* Concept */
- {
- return this->full_cells_.size();
- }
-
- bool empty() const /* Concept */
- {
- return current_dimension() == -2;
- }
-
- Vertex_container & vertices() { return vertices_; }
- const Vertex_container & vertices() const { return vertices_; }
- Full_cell_container & full_cells() { return full_cells_; }
- const Full_cell_container & full_cells() const { return full_cells_; }
-
- Vertex_handle vertex(Full_cell_handle s, int i) const /* Concept */
- {
- CGAL_precondition(s != Full_cell_handle() && check_range(i));
- return s->vertex(i);
- }
-
- Vertex_const_handle vertex(Full_cell_const_handle s, int i) const /* Concept */
- {
- CGAL_precondition(s != Full_cell_handle() && check_range(i));
- return s->vertex(i);
- }
-
- bool is_vertex(Vertex_const_handle v) const /* Concept */
- {
- if( Vertex_const_handle() == v )
- return false;
- Vertex_const_iterator vit = vertices_begin();
- while( vit != vertices_end() && ( v != vit ) )
- ++vit;
- return v == vit;
- }
-
- bool is_full_cell(Full_cell_const_handle s) const /* Concept */
- {
- if( Full_cell_const_handle() == s )
- return false;
- Full_cell_const_iterator sit = full_cells_begin();
- while( sit != full_cells_end() && ( s != sit ) )
- ++sit;
- return s == sit;
- }
-
- Full_cell_handle full_cell(Vertex_handle v) const /* Concept */
- {
- CGAL_precondition(v != Vertex_handle());
- return v->full_cell();
- }
-
- Full_cell_const_handle full_cell(Vertex_const_handle v) const /* Concept */
- {
- CGAL_precondition(Vertex_const_handle() != v);
- return v->full_cell();
- }
-
- Full_cell_handle neighbor(Full_cell_handle s, int i) const /* Concept */
- {
- CGAL_precondition(Full_cell_handle() != s && check_range(i));
- return s->neighbor(i);
- }
-
- Full_cell_const_handle neighbor(Full_cell_const_handle s, int i) const/* Concept */
- {
- CGAL_precondition(Full_cell_const_handle() != s && check_range(i));
- return s->neighbor(i);
- }
-
- int mirror_index(Full_cell_handle s, int i) const /* Concept */
- {
- CGAL_precondition(Full_cell_handle() != s && check_range(i));
- return s->mirror_index(i);
- }
-
- int mirror_index(Full_cell_const_handle s, int i) const
- {
- CGAL_precondition(Full_cell_const_handle() != s && check_range(i)); /* Concept */
- return s->mirror_index(i);
- }
-
- int mirror_vertex(Full_cell_handle s, int i) const /* Concept */
- {
- CGAL_precondition(Full_cell_handle() != s && check_range(i));
- return s->mirror_vertex(i);
- }
-
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - FACETS OPERATIONS
-
- // works for Face_ = Facet and Face_ = Rotor.
- // NOT DOCUMENTED for the Rotor case...
- template< typename Face_ >
- Full_cell_handle full_cell(const Face_ & f) const /* Concept */
- {
- return f.full_cell();
- }
-
- // works for Face_ = Facet and Face_ = Rotor.
- // NOT DOCUMENTED for the Rotor case...
- template< class Face_ >
- int index_of_covertex(const Face_ & f) const /* Concept */
- {
- return f.index_of_covertex();
- }
-
- // NOT DOCUMENTED
- // A Rotor has two covertices
- int index_of_second_covertex(const Rotor & f) const
- {
- return f.index_of_second_covertex();
- }
-
- // works for Face_ = Facet and Face_ = Rotor.
- // NOT DOCUMENTED...
- template< class Face_ >
- bool is_boundary_facet(const Face_ & f) const
- {
- if( get_visited(neighbor(full_cell(f), index_of_covertex(f))) )
- return false;
- if( ! get_visited(full_cell(f)) )
- return false;
- return true;
- }
-
- // NOT DOCUMENTED...
- Rotor rotate_rotor(Rotor & f)
- {
- int opposite = mirror_index(full_cell(f), index_of_covertex(f));
- Full_cell_handle s = neighbor(full_cell(f), index_of_covertex(f));
- int new_second = s->index(vertex(full_cell(f), index_of_second_covertex(f)));
- return Rotor(s, new_second, opposite);
- }
-
- // NICE UPDATE OPERATIONS
-
-protected:
- void do_insert_increase_dimension(Vertex_handle, Vertex_handle);
-public:
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - REMOVALS
-
- Vertex_handle collapse_face(const Face &); /* Concept */
- void remove_decrease_dimension(Vertex_handle, Vertex_handle); /* Concept */
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - INSERTIONS
-
- Vertex_handle insert_in_full_cell(Full_cell_handle); /* Concept */
- Vertex_handle insert_in_face(const Face &); /* Concept */
- Vertex_handle insert_in_facet(const Facet &); /* Concept */
- template< typename Forward_iterator >
- Vertex_handle insert_in_hole(Forward_iterator, Forward_iterator, Facet); /* Concept */
- template< typename Forward_iterator, typename OutputIterator >
- Vertex_handle insert_in_hole(Forward_iterator, Forward_iterator, Facet, OutputIterator); /* Concept */
-
- template< typename OutputIterator >
- Full_cell_handle insert_in_tagged_hole(Vertex_handle, Facet, OutputIterator);
-
- Vertex_handle insert_increase_dimension(Vertex_handle=Vertex_handle()); /* Concept */
-
-private:
-
- // Used by insert_in_tagged_hole
- struct IITH_task
- {
- IITH_task(
- Facet boundary_facet_,
- int index_of_inside_cell_in_outside_cell_,
- Full_cell_handle future_neighbor_ = Full_cell_handle(),
- int new_cell_index_in_future_neighbor_ = -1,
- int index_of_future_neighbor_in_new_cell_ = -1)
- : boundary_facet(boundary_facet_),
- index_of_inside_cell_in_outside_cell(index_of_inside_cell_in_outside_cell_),
- future_neighbor(future_neighbor_),
- new_cell_index_in_future_neighbor(new_cell_index_in_future_neighbor_),
- index_of_future_neighbor_in_new_cell(index_of_future_neighbor_in_new_cell_)
- {}
-
- // "new_cell" is the cell about to be created
- Facet boundary_facet;
- int index_of_inside_cell_in_outside_cell;
- Full_cell_handle future_neighbor;
- int new_cell_index_in_future_neighbor;
- int index_of_future_neighbor_in_new_cell;
- };
-
- // NOT DOCUMENTED
- void clear_visited_marks(Full_cell_handle) const;
-
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - DANGEROUS UPDATE OPERATIONS
-
-private:
-
- // NOT DOCUMENTED
- template< typename FCH > // FCH = Full_cell_[const_]handle
- bool get_visited(FCH c) const
- {
- return c->tds_data().is_visited();
- }
-
- // NOT DOCUMENTED
- template< typename FCH > // FCH = Full_cell_[const_]handle
- void set_visited(FCH c, bool m) const
- {
- if( m )
- c->tds_data().mark_visited();
- else
- c->tds_data().clear_visited();
- }
-
-public:
-
- void clear() /* Concept */
- {
- clean_dynamic_memory();
- dcur_ = -2;
- }
-
- void set_current_dimension(int d) /* Concept */
- {
- CGAL_precondition(-2<=d && d<=maximal_dimension());
- dcur_ = d;
- }
-
- Full_cell_handle new_full_cell(Full_cell_handle s)
- {
- return full_cells_.emplace(*s);
- }
-
- Full_cell_handle new_full_cell() /* Concept */
- {
- return full_cells_.emplace(dmax_);
- }
-
- void delete_full_cell(Full_cell_handle s) /* Concept */
- {
- CGAL_precondition(Full_cell_handle() != s);
- // CGAL_expensive_precondition(is_full_cell(s));
- full_cells_.erase(s);
- }
-
- template< typename Forward_iterator >
- void delete_full_cells(Forward_iterator start, Forward_iterator end) /* Concept */
- {
- Forward_iterator s = start;
- while( s != end )
- full_cells_.erase(*s++);
- }
-
- template< class T >
- Vertex_handle new_vertex( const T & t )
- {
- return vertices_.emplace(t);
- }
-
- Vertex_handle new_vertex() /* Concept */
- {
- return vertices_.emplace();
- }
-
- void delete_vertex(Vertex_handle v) /* Concept */
- {
- CGAL_precondition( Vertex_handle() != v );
- vertices_.erase(v);
- }
-
- void associate_vertex_with_full_cell(Full_cell_handle s, int i, Vertex_handle v) /* Concept */
- {
- CGAL_precondition(check_range(i));
- CGAL_precondition(s != Full_cell_handle());
- CGAL_precondition(v != Vertex_handle());
- s->set_vertex(i, v);
- v->set_full_cell(s);
- }
-
- void set_neighbors(Full_cell_handle s, int i, Full_cell_handle s1, int j) /* Concept */
- {
- CGAL_precondition(check_range(i));
- CGAL_precondition(check_range(j));
- CGAL_precondition(s != Full_cell_handle());
- CGAL_precondition(s1 != Full_cell_handle());
- s->set_neighbor(i, s1);
- s1->set_neighbor(j, s);
- s->set_mirror_index(i, j);
- s1->set_mirror_index(j, i);
- }
-
- // SANITY CHECKS
-
- bool is_valid(bool = true, int = 0) const; /* Concept */
-
- // NOT DOCUMENTED
- template< class OutStream> void write_graph(OutStream &);
-
- Vertex_iterator vertices_begin() { return vertices_.begin(); } /* Concept */
- Vertex_iterator vertices_end() { return vertices_.end(); } /* Concept */
- Full_cell_iterator full_cells_begin() { return full_cells_.begin(); } /* Concept */
- Full_cell_iterator full_cells_end() { return full_cells_.end(); } /* Concept */
-
- Vertex_const_iterator vertices_begin() const { return vertices_.begin(); } /* Concept */
- Vertex_const_iterator vertices_end() const { return vertices_.end(); } /* Concept */
- Full_cell_const_iterator full_cells_begin() const { return full_cells_.begin(); } /* Concept */
- Full_cell_const_iterator full_cells_end() const { return full_cells_.end(); } /* Concept */
-
- Facet_iterator facets_begin() /* Concept */
- {
- if( current_dimension() <= 0 )
- return facets_end();
- return Facet_iterator(*this);
- }
- Facet_iterator facets_end() /* Concept */
- {
- return Facet_iterator(*this, 0);
- }
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - FULL CELL GATHERING
-
- // a traversal predicate for gathering full_cells incident to a given face
- // ``incident'' means that the given face is a subface of the full_cell
- class Incident_full_cell_traversal_predicate
- {
- const Face & f_;
- int dim_;
- const Triangulation_data_structure & tds_;
- public:
- Incident_full_cell_traversal_predicate(const Triangulation_data_structure & tds,
- const Face & f)
- : f_(f), tds_(tds)
- {
- dim_ = f.face_dimension();
- }
- bool operator()(const Facet & facet) const
- {
- Vertex_handle v = tds_.full_cell(facet)->vertex(tds_.index_of_covertex(facet));
- for( int i = 0; i <= dim_; ++i )
- {
- if( v == f_.vertex(i) )
- return false;
- }
- return true;
- }
- };
-
- // a traversal predicate for gathering full_cells having a given face as subface
- class Star_traversal_predicate
- {
- const Face & f_;
- int dim_;
- const Triangulation_data_structure & tds_;
- public:
- Star_traversal_predicate(const Triangulation_data_structure & tds,
- const Face & f)
- : f_(f), tds_(tds)
- {
- dim_ = f.face_dimension();
- }
- bool operator()(const Facet & facet) const
- {
- Full_cell_handle s = tds_.full_cell(facet)->neighbor(tds_.index_of_covertex(facet));
- for( int j = 0; j <= tds_.current_dimension(); ++j )
- {
- for( int i = 0; i <= dim_; ++i )
- if( s->vertex(j) == f_.vertex(i) )
- return true;
- }
- return false;
- }
- };
-
- template< typename TraversalPredicate, typename OutputIterator >
- Facet gather_full_cells(Full_cell_handle, TraversalPredicate &, OutputIterator &) const; /* Concept */
- template< typename OutputIterator >
- OutputIterator incident_full_cells(const Face &, OutputIterator) const; /* Concept */
- template< typename OutputIterator >
- OutputIterator incident_full_cells(Vertex_const_handle, OutputIterator) const; /* Concept */
- template< typename OutputIterator >
- OutputIterator star(const Face &, OutputIterator) const; /* Concept */
-#ifndef CGAL_CFG_NO_CPP0X_DEFAULT_TEMPLATE_ARGUMENTS_FOR_FUNCTION_TEMPLATES
- template< typename OutputIterator, typename Comparator = std::less<Vertex_const_handle> >
- OutputIterator incident_upper_faces(Vertex_const_handle v, int dim, OutputIterator out, Comparator cmp = Comparator())
- {
- return incident_faces(v, dim, out, cmp, true);
- }
- template< typename OutputIterator, typename Comparator = std::less<Vertex_const_handle> >
- OutputIterator incident_faces(Vertex_const_handle, int, OutputIterator, Comparator = Comparator(), bool = false) const;
-#else
- template< typename OutputIterator, typename Comparator >
- OutputIterator incident_upper_faces(Vertex_const_handle v, int dim, OutputIterator out, Comparator cmp = Comparator())
- {
- return incident_faces(v, dim, out, cmp, true);
- }
- template< typename OutputIterator >
- OutputIterator incident_upper_faces(Vertex_const_handle v, int dim, OutputIterator out)
- {
- return incident_faces(v, dim, out, std::less<Vertex_const_handle>(), true);
- }
- template< typename OutputIterator, typename Comparator >
- OutputIterator incident_faces(Vertex_const_handle, int, OutputIterator, Comparator = Comparator(), bool = false) const;
- template< typename OutputIterator >
- OutputIterator incident_faces(Vertex_const_handle, int, OutputIterator,
- std::less<Vertex_const_handle> = std::less<Vertex_const_handle>(), bool = false) const;
-#endif
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - INPUT / OUTPUT
-
- std::istream & read_full_cells(std::istream &, const std::vector<Vertex_handle> &);
- std::ostream & write_full_cells(std::ostream &, std::map<Vertex_const_handle, int> &) const;
-
-}; // end of ``declaration/definition'' of Triangulation_data_structure<...>
-
-// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
-
-// FUNCTIONS THAT ARE MEMBER FUNCTIONS:
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-// - - - - - - - - - - - - - - - - - - - - - - - - THE GATHERING METHODS
-
-template< class Dim, class Vb, class Fcb >
-template< typename OutputIterator >
-OutputIterator
-Triangulation_data_structure<Dim, Vb, Fcb>
-::incident_full_cells(const Face & f, OutputIterator out) const /* Concept */
-{
- // CGAL_expensive_precondition_msg(is_full_cell(f.full_cell()), "the facet does not belong to the Triangulation");
- Incident_full_cell_traversal_predicate tp(*this, f);
- gather_full_cells(f.full_cell(), tp, out);
- return out;
-}
-
-template< class Dim, class Vb, class Fcb >
-template< typename OutputIterator >
-OutputIterator
-Triangulation_data_structure<Dim, Vb, Fcb>
-::incident_full_cells(Vertex_const_handle v, OutputIterator out) const /* Concept */
-{
-// CGAL_expensive_precondition(is_vertex(v));
- CGAL_precondition(Vertex_handle() != v);
- Face f(v->full_cell());
- f.set_index(0, v->full_cell()->index(v));
- return incident_full_cells(f, out);
-}
-
-template< class Dim, class Vb, class Fcb >
-template< typename OutputIterator >
-OutputIterator
-Triangulation_data_structure<Dim, Vb, Fcb>
-::star(const Face & f, OutputIterator out) const /* Concept */
-{
- // CGAL_precondition_msg(is_full_cell(f.full_cell()), "the facet does not belong to the Triangulation");
- Star_traversal_predicate tp(*this, f);
- gather_full_cells(f.full_cell(), tp, out);
- return out;
-}
-
-template< class Dim, class Vb, class Fcb >
-template< typename TraversalPredicate, typename OutputIterator >
-typename Triangulation_data_structure<Dim, Vb, Fcb>::Facet
-Triangulation_data_structure<Dim, Vb, Fcb>
-::gather_full_cells(Full_cell_handle start,
- TraversalPredicate & tp,
- OutputIterator & out) const /* Concept */
-{
- std::queue<Full_cell_handle> queue;
- set_visited(start, true);
- queue.push(start);
- const int cur_dim = current_dimension();
- Facet ft;
- while( ! queue.empty() )
- {
- Full_cell_handle s = queue.front();
- queue.pop();
- *out = s;
- ++out;
- for( int i = 0; i <= cur_dim; ++i )
- {
- Full_cell_handle n = s->neighbor(i);
- if( ! get_visited(n) )
- {
- set_visited(n, true);
- if( tp(Facet(s, i)) )
- queue.push(n);
- else
- ft = Facet(s, i);
- }
- }
- }
- clear_visited_marks(start);
- return ft;
-}
-
-#ifdef CGAL_CFG_NO_CPP0X_DEFAULT_TEMPLATE_ARGUMENTS_FOR_FUNCTION_TEMPLATES
-template< class Dim, class Vb, class Fcb >
-template< typename OutputIterator >
-OutputIterator
-Triangulation_data_structure<Dim, Vb, Fcb>
-::incident_faces(Vertex_const_handle v, int dim, OutputIterator out,
- std::less<Vertex_const_handle> cmp, bool upper_faces) const
-{
- return incident_faces<OutputIterator, std::less<Vertex_const_handle> >(v, dim, out, cmp, upper_faces);
-}
-#endif
-
-template< class Dim, class Vb, class Fcb >
-template< typename OutputIterator, typename Comparator >
-OutputIterator
-Triangulation_data_structure<Dim, Vb, Fcb>
-::incident_faces(Vertex_const_handle v, int dim, OutputIterator out, Comparator cmp, bool upper_faces) const
-{
- CGAL_precondition( 0 < dim );
- if( dim >= current_dimension() )
- return out;
- typedef std::vector<Full_cell_handle> Simplices;
- Simplices simps;
- simps.reserve(64);
- // gather incident full_cells
- std::back_insert_iterator<Simplices> sout(simps);
- incident_full_cells(v, sout);
- // for storing the handles to the vertices of a full_cell
- typedef std::vector<Vertex_const_handle> Vertices;
- typedef std::vector<int> Indices;
- Vertices vertices(1 + current_dimension());
- Indices sorted_idx(1 + current_dimension());
- // setup Face comparator and Face_set
- typedef internal::Triangulation::Compare_faces_with_common_first_vertex<Self>
- Upper_face_comparator;
- Upper_face_comparator ufc(dim);
- typedef std::set<Face, Upper_face_comparator> Face_set;
- Face_set face_set(ufc);
- for( typename Simplices::const_iterator s = simps.begin(); s != simps.end(); ++s )
- {
- int v_idx(0); // the index of |v| in the sorted full_cell
- // get the vertices of the full_cell and sort them
- for( int i = 0; i <= current_dimension(); ++i )
- vertices[i] = (*s)->vertex(i);
- if( upper_faces )
- {
- std::sort(vertices.begin(), vertices.end(), cmp);
- while( vertices[v_idx] != v )
- ++v_idx;
- }
- else
- {
- while( vertices[v_idx] != v )
- ++v_idx;
- if( 0 != v_idx )
- std::swap(vertices[0], vertices[v_idx]);
- v_idx = 0;
- typename Vertices::iterator vbegin(vertices.begin());
- ++vbegin;
- std::sort(vbegin, vertices.end(), cmp);
- }
- if( v_idx + dim > current_dimension() )
- continue; // |v| is too far to the right
- // stores the index of the vertices of s in the same order
- // as in |vertices|:
- for( int i = 0; i <= current_dimension(); ++i )
- sorted_idx[i] = (*s)->index(vertices[i]);
- // init state for enumerating all candidate faces:
- internal::Combination_enumerator f_idx(dim, v_idx + 1, current_dimension());
- Face f(*s);
- f.set_index(0, sorted_idx[v_idx]);
- while( ! f_idx.end() )
- {
- for( int i = 0; i < dim; ++i )
- f.set_index(1 + i, sorted_idx[f_idx[i]]);
- face_set.insert(f); // checks if face has already been found
-
- // compute next sorted face (lexicographic enumeration)
- ++f_idx;
- }
- }
- typename Face_set::iterator fit = face_set.begin();
- while( fit != face_set.end() )
- *out++ = *fit++;
- return out;
-}
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-// - - - - - - - - - - - - - - - - - - - - - - - - THE REMOVAL METHODS
-
-template <class Dim, class Vb, class Fcb>
-typename Triangulation_data_structure<Dim, Vb, Fcb>::Vertex_handle
-Triangulation_data_structure<Dim, Vb, Fcb>
-::collapse_face(const Face & f) /* Concept */
-{
- const int fd = f.face_dimension();
- CGAL_precondition( (1 <= fd ) && (fd < current_dimension()));
- std::vector<Full_cell_handle> simps;
- // save the Face's vertices:
- Full_cell s;
- for( int i = 0; i <= fd; ++i )
- s.set_vertex(i, f.vertex(i));
- // compute the star of f
- simps.reserve(64);
- std::back_insert_iterator<std::vector<Full_cell_handle> > out(simps);
- star(f, out);
- Vertex_handle v = insert_in_hole(simps.begin(), simps.end(), Facet(f.full_cell(), f.index(0)));
- for( int i = 0; i <= fd; ++i )
- delete_vertex(s.vertex(i));
- return v;
-}
-
-template <class Dim, class Vb, class Fcb>
-void
-Triangulation_data_structure<Dim, Vb, Fcb>
-::remove_decrease_dimension(Vertex_handle v, Vertex_handle star) /* Concept */
-{
- CGAL_assertion( current_dimension() >= -1 );
- if( -1 == current_dimension() )
- {
- clear();
- return;
- }
- else if( 0 == current_dimension() )
- {
- delete_full_cell(v->full_cell());
- delete_vertex(v);
- star->full_cell()->set_neighbor(0, Full_cell_handle());
- set_current_dimension(-1);
- return;
- }
- else if( 1 == current_dimension() )
- {
- Full_cell_handle s = v->full_cell();
- int star_index;
- if( s->has_vertex(star, star_index) )
- s = s->neighbor(star_index);
- // Here, |star| is not a vertex of |s|, so it's the only finite
- // full_cell
- Full_cell_handle inf1 = s->neighbor(0);
- Full_cell_handle inf2 = s->neighbor(1);
- Vertex_handle v2 = s->vertex(1 - s->index(v));
- delete_vertex(v);
- delete_full_cell(s);
- inf1->set_vertex(1, Vertex_handle());
- inf1->set_vertex(1, Vertex_handle());
- inf2->set_neighbor(1, Full_cell_handle());
- inf2->set_neighbor(1, Full_cell_handle());
- associate_vertex_with_full_cell(inf1, 0, star);
- associate_vertex_with_full_cell(inf2, 0, v2);
- set_neighbors(inf1, 0, inf2, 0);
- set_current_dimension(0);
- return;
- }
- typedef std::vector<Full_cell_handle> Simplices;
- Simplices simps;
- incident_full_cells(v, std::back_inserter(simps));
- for( typename Simplices::iterator it = simps.begin(); it != simps.end(); ++it )
- {
- int v_idx = (*it)->index(v);
- if( ! (*it)->has_vertex(star) )
- {
- delete_full_cell((*it)->neighbor(v_idx));
- for( int i = 0; i <= current_dimension(); ++i )
- (*it)->vertex(i)->set_full_cell(*it);
- }
- else
- star->set_full_cell(*it);
- if( v_idx != current_dimension() )
- {
- (*it)->swap_vertices(v_idx, current_dimension());
- (*it)->swap_vertices(current_dimension() - 2, current_dimension() - 1);
- }
- (*it)->set_vertex(current_dimension(), Vertex_handle());
- (*it)->set_neighbor(current_dimension(), Full_cell_handle());
- }
- set_current_dimension(current_dimension()-1);
- delete_vertex(v);
-}
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-// - - - - - - - - - - - - - - - - - - - - - - - - THE INSERTION METHODS
-
-template <class Dim, class Vb, class Fcb>
-typename Triangulation_data_structure<Dim, Vb, Fcb>::Vertex_handle
-Triangulation_data_structure<Dim, Vb, Fcb>
-::insert_in_full_cell(Full_cell_handle s) /* Concept */
-{
- CGAL_precondition(0 < current_dimension());
- CGAL_precondition(Full_cell_handle() != s);
- // CGAL_expensive_precondition(is_full_cell(s));
-
- const int cur_dim = current_dimension();
- Vertex_handle v = new_vertex();
- // the full_cell 'fc' is just used to store the handle to all the new full_cells.
- Full_cell fc(maximal_dimension());
- for( int i = 1; i <= cur_dim; ++i )
- {
- Full_cell_handle new_s = new_full_cell(s);
- fc.set_neighbor(i, new_s);
- associate_vertex_with_full_cell(new_s, i, v);
- s->vertex(i-1)->set_full_cell(new_s);
- set_neighbors(new_s, i, neighbor(s, i), mirror_index(s, i));
- }
- fc.set_neighbor(0, s);
- associate_vertex_with_full_cell(s, 0, v);
- for( int i = 0; i <= cur_dim; ++i )
- for( int j = 0; j <= cur_dim; ++j )
- {
- if( j == i ) continue;
- set_neighbors(fc.neighbor(i), j, fc.neighbor(j), i);
- }
- return v;
-}
-
-template <class Dim, class Vb, class Fcb >
-typename Triangulation_data_structure<Dim, Vb, Fcb>::Vertex_handle
-Triangulation_data_structure<Dim, Vb, Fcb>
-::insert_in_face(const Face & f) /* Concept */
-{
- std::vector<Full_cell_handle> simps;
- simps.reserve(64);
- std::back_insert_iterator<std::vector<Full_cell_handle> > out(simps);
- incident_full_cells(f, out);
- return insert_in_hole(simps.begin(), simps.end(), Facet(f.full_cell(), f.index(0)));
-}
-template <class Dim, class Vb, class Fcb >
-typename Triangulation_data_structure<Dim, Vb, Fcb>::Vertex_handle
-Triangulation_data_structure<Dim, Vb, Fcb>
-::insert_in_facet(const Facet & ft) /* Concept */
-{
- Full_cell_handle s[2];
- s[0] = full_cell(ft);
- int i = index_of_covertex(ft);
- s[1] = s[0]->neighbor(i);
- i = ( i + 1 ) % current_dimension();
- return insert_in_hole(s, s+2, Facet(s[0], i));
-}
-
-template <class Dim, class Vb, class Fcb >
-template < typename OutputIterator >
-typename Triangulation_data_structure<Dim, Vb, Fcb>::Full_cell_handle
-Triangulation_data_structure<Dim, Vb, Fcb>
-::insert_in_tagged_hole(Vertex_handle v, Facet f,
- OutputIterator new_full_cells)
-{
- CGAL_assertion_msg(is_boundary_facet(f), "starting facet should be on the hole boundary");
-
- const int cur_dim = current_dimension();
- Full_cell_handle new_s;
-
- std::queue<IITH_task> task_queue;
- task_queue.push(
- IITH_task(f, mirror_index(full_cell(f), index_of_covertex(f))) );
-
- while (!task_queue.empty())
- {
- IITH_task task = task_queue.front();
- task_queue.pop();
-
- Full_cell_handle old_s = full_cell(task.boundary_facet);
- const int facet_index = index_of_covertex(task.boundary_facet);
-
- Full_cell_handle outside_neighbor = neighbor(old_s, facet_index);
- // Here, "new_s" might actually be a new cell, but it might also be "old_s"
- // if it has not been treated already in the meantime
- new_s = neighbor(outside_neighbor, task.index_of_inside_cell_in_outside_cell);
- // If the cell has not been treated yet
- if (old_s == new_s)
- {
- new_s = new_full_cell();
-
- int i(0);
- for ( ; i < facet_index ; ++i)
- associate_vertex_with_full_cell(new_s, i, old_s->vertex(i));
- ++i; // skip facet_index
- for ( ; i <= cur_dim ; ++i)
- associate_vertex_with_full_cell(new_s, i, old_s->vertex(i));
- associate_vertex_with_full_cell(new_s, facet_index, v);
- set_neighbors(new_s,
- facet_index,
- outside_neighbor,
- mirror_index(old_s, facet_index));
-
- // add the new full_cell to the list of new full_cells
- *new_full_cells++ = new_s;
-
- // check all of |Facet f|'s neighbors
- for (i = 0 ; i <= cur_dim ; ++i)
- {
- if (facet_index == i)
- continue;
- // we define a |Rotor| because it makes it easy to rotate around
- // in a self contained fashion. The corresponding potential
- // boundary facet is Facet(full_cell(rot), index_of_covertex(rot))
- Rotor rot(old_s, i, facet_index);
- // |rot| on line above, stands for Candidate Facet
- while (!is_boundary_facet(rot))
- rot = rotate_rotor(rot);
-
- // we did find the |i|-th neighbor of Facet(old_s, facet_index)...
- // has it already been extruded to center point |v| ?
- Full_cell_handle inside = full_cell(rot);
- Full_cell_handle outside = neighbor(inside, index_of_covertex(rot));
- // "m" is the vertex of outside which is not on the boundary
- Vertex_handle m = inside->mirror_vertex(index_of_covertex(rot), current_dimension()); // CJTODO: use mirror_index?
- // "index" is the index of m in "outside"
- int index = outside->index(m);
- // new_neighbor is the inside cell which is registered as the neighbor
- // of the outside cell => it's either a newly created inside cell or an
- // old inside cell which we are about to delete
- Full_cell_handle new_neighbor = outside->neighbor(index);
-
- // Is new_neighbor still the old neighbor?
- if (new_neighbor == inside)
- {
- task_queue.push(IITH_task(
- Facet(inside, index_of_covertex(rot)), // boundary facet
- index, // index_of_inside_cell_in_outside_cell
- new_s, // future_neighbor
- i, // new_cell_index_in_future_neighbor
- index_of_second_covertex(rot) // index_of_future_neighbor_in_new_cell
- ));
- }
- }
- }
-
- // If there is some neighbor stories to fix
- if (task.future_neighbor != Full_cell_handle())
- {
- // now the new neighboring full_cell exists, we link both
- set_neighbors(new_s,
- task.index_of_future_neighbor_in_new_cell,
- task.future_neighbor,
- task.new_cell_index_in_future_neighbor);
- }
- }
-
- return new_s;
-}
-
-template< class Dim, class Vb, class Fcb >
-template< typename Forward_iterator, typename OutputIterator >
-typename Triangulation_data_structure<Dim, Vb, Fcb>::Vertex_handle
-Triangulation_data_structure<Dim, Vb, Fcb>
-::insert_in_hole(Forward_iterator start, Forward_iterator end, Facet f,
- OutputIterator out) /* Concept */
-{
- CGAL_expensive_precondition(
- ( std::distance(start, end) == 1 )
- || ( current_dimension() > 1 ) );
- Forward_iterator sit = start;
- while( end != sit )
- set_visited(*sit++, true);
- Vertex_handle v = new_vertex();
- insert_in_tagged_hole(v, f, out);
- delete_full_cells(start, end);
- return v;
-}
-
-template< class Dim, class Vb, class Fcb >
-template< typename Forward_iterator >
-typename Triangulation_data_structure<Dim, Vb, Fcb>::Vertex_handle
-Triangulation_data_structure<Dim, Vb, Fcb>
-::insert_in_hole(Forward_iterator start, Forward_iterator end, Facet f) /* Concept */
-{
- Emptyset_iterator out;
- return insert_in_hole(start, end, f, out);
-}
-
-template <class Dim, class Vb, class Fcb>
-void
-Triangulation_data_structure<Dim, Vb, Fcb>
-::clear_visited_marks(Full_cell_handle start) const // NOT DOCUMENTED
-{
- CGAL_precondition(start != Full_cell_handle());
-
- std::queue<Full_cell_handle> queue;
- set_visited(start, false);
- queue.push(start);
- const int cur_dim = current_dimension();
- while( ! queue.empty() )
- {
- Full_cell_handle s = queue.front();
- queue.pop();
- for( int i = 0; i <= cur_dim; ++i )
- {
- if( get_visited(s->neighbor(i)) )
- {
- set_visited(s->neighbor(i), false);
- queue.push(s->neighbor(i));
- }
- }
- }
-}
-
-template <class Dim, class Vb, class Fcb>
-void Triangulation_data_structure<Dim, Vb, Fcb>
-::do_insert_increase_dimension(Vertex_handle x, Vertex_handle star)
-{
- Full_cell_handle start = full_cells_begin();
- Full_cell_handle swap_me;
- const int cur_dim = current_dimension();
- for( Full_cell_iterator S = full_cells_begin(); S != full_cells_end(); ++S )
- {
- if( Vertex_handle() != S->vertex(cur_dim) )
- continue;
- set_visited(S, true);
- // extends full_cell |S| to include the new vertex as the
- // current_dimension()-th vertex
- associate_vertex_with_full_cell(S, cur_dim, x);
- if( ! S->has_vertex(star) )
- { // S is bounded, we create its unbounded "twin" full_cell
- Full_cell_handle S_new = new_full_cell();
- set_neighbors(S, cur_dim, S_new, 0);
- associate_vertex_with_full_cell(S_new, 0, star);
- // here, we could be clever so as to get consistent orientation
- for( int k = 1; k <= cur_dim; ++k )
- associate_vertex_with_full_cell(S_new, k, vertex(S, k - 1));
- }
- }
- // now we setup the neighbors
- set_visited(start, false);
- std::queue<Full_cell_handle> queue;
- queue.push(start);
- while( ! queue.empty() )
- {
- Full_cell_handle S = queue.front();
- queue.pop();
- // here, the first visit above ensured that all neighbors exist now.
- // Now we need to connect them with adjacency relation
- int star_index;
- if( S->has_vertex(star, star_index) )
- {
- set_neighbors( S, cur_dim, neighbor(neighbor(S, star_index), cur_dim),
- // this is tricky :-) :
- mirror_index(S, star_index) + 1);
- }
- else
- {
- Full_cell_handle S_new = neighbor(S, cur_dim);
- for( int k = 0 ; k < cur_dim ; ++k )
- {
- Full_cell_handle S_opp = neighbor(S, k);
- if( ! S_opp->has_vertex(star) )
- set_neighbors(S_new, k + 1, neighbor(S_opp, cur_dim), mirror_index(S, k) + 1);
- // neighbor of S_new opposite to v is S_new'
- // the vertex opposite to v remains the same but ...
- // remember the shifting of the vertices one step to the right
- }
- }
- for( int k = 0 ; k < cur_dim ; ++k )
- if( get_visited(neighbor(S, k)) )
- {
- set_visited(neighbor(S, k), false);
- queue.push(neighbor(S, k));
- }
- }
- if( ( ( cur_dim % 2 ) == 0 ) && ( cur_dim > 1 ) )
- {
- for( Full_cell_iterator S = full_cells_begin(); S != full_cells_end(); ++S )
- {
- if( x != S->vertex(cur_dim) )
- S->swap_vertices(cur_dim - 1, cur_dim);
- }
- }
- if( Full_cell_handle() != swap_me )
- swap_me->swap_vertices(1, 2);
-}
-
-template <class Dim, class Vb, class Fcb>
-typename Triangulation_data_structure<Dim, Vb, Fcb>::Vertex_handle
-Triangulation_data_structure<Dim, Vb, Fcb>
-::insert_increase_dimension(Vertex_handle star) /* Concept */
-{
- const int prev_cur_dim = current_dimension();
- CGAL_precondition(prev_cur_dim < maximal_dimension());
- if( -2 != current_dimension() )
- {
- CGAL_precondition( Vertex_handle() != star );
- CGAL_expensive_precondition(is_vertex(star));
- }
-
- set_current_dimension(prev_cur_dim + 1);
- Vertex_handle v = new_vertex();
- switch( prev_cur_dim )
- {
- case -2:
- { // insertion of the first vertex
- // ( geometrically : infinite vertex )
- Full_cell_handle s = new_full_cell();
- associate_vertex_with_full_cell(s, 0, v);
- break;
- }
- case -1:
- { // insertion of the second vertex
- // ( geometrically : first finite vertex )
- //we create a triangulation of the 0-sphere, with
- // vertices |star| and |v|
- Full_cell_handle infinite_full_cell = star->full_cell();
- Full_cell_handle finite_full_cell = new_full_cell();
- associate_vertex_with_full_cell(finite_full_cell, 0, v);
- set_neighbors(infinite_full_cell, 0, finite_full_cell, 0);
- break;
- }
- default:
- do_insert_increase_dimension(v, star);
- break;
- }
- return v;
-}
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-// - - - - - - - - - - - - - - - - - - - - - - - - VALIDITY CHECKS
-
-template <class Dimen, class Vb, class Fcb>
-bool Triangulation_data_structure<Dimen, Vb, Fcb>
-::is_valid(bool verbose, int /* level */) const /* Concept */
-{
- Full_cell_const_handle s, t;
- Vertex_const_handle v;
- int i, j, k;
-
- if( current_dimension() == -2 )
- {
- if( ! vertices_.empty() || ! full_cells_.empty() )
- {
- if( verbose ) CGAL_warning_msg(false, "current dimension is -2 but there are vertices or full_cells");
- return false;
- }
- }
-
- if( current_dimension() == -1 )
- {
- if ( (number_of_vertices() != 1) || (number_of_full_cells() != 1) )
- {
- if( verbose ) CGAL_warning_msg(false, "current dimension is -1 but there isn't one vertex and one full_cell");
- return false;
- }
- }
-
- for( v = vertices_begin(); v != vertices_end(); ++v )
- {
- if( ! v->is_valid(verbose) )
- return false;
- }
-
- // FUTURE: for each vertex v, gather incident full_cells. then, check that
- // any full_cell containing v is among those gathered full_cells...
-
- if( current_dimension() < 0 )
- return true;
-
- for( s = full_cells_begin(); s != full_cells_end(); ++s )
- {
- if( ! s->is_valid(verbose) )
- return false;
- // check that the full cell has no duplicate vertices
- for( i = 0; i <= current_dimension(); ++i )
- for( j = i + 1; j <= current_dimension(); ++j )
- if( vertex(s,i) == vertex(s,j) )
- {
- CGAL_warning_msg(false, "a full_cell has two equal vertices");
- return false;
- }
- }
-
- for( s = full_cells_begin(); s != full_cells_end(); ++s )
- {
- for( i = 0; i <= current_dimension(); ++i )
- if( (t = neighbor(s,i)) != Full_cell_const_handle() )
- {
- int l = mirror_index(s,i);
- if( s != neighbor(t,l) || i != mirror_index(t,l) )
- {
- if( verbose ) CGAL_warning_msg(false, "neighbor relation is not symmetric");
- return false;
- }
- for( j = 0; j <= current_dimension(); ++j )
- if( j != i )
- {
- // j must also occur as a vertex of t
- for( k = 0; k <= current_dimension() && ( vertex(s,j) != vertex(t,k) || k == l); ++k )
- ;
- if( k > current_dimension() )
- {
- if( verbose ) CGAL_warning_msg(false, "too few shared vertices between neighbors full_cells.");
- return false;
- }
- }
- }
- else
- {
- if( verbose ) CGAL_warning_msg(false, "full_cell has a NULL neighbor");
- return false;
- }
- }
- return true;
-}
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-// - - - - - - - - - - - - - - - - - - - - - - - - INPUT / OUTPUT
-
-// NOT DOCUMENTED
-template <class Dim, class Vb, class Fcb>
-template <class OutStream>
-void Triangulation_data_structure<Dim, Vb, Fcb>
-::write_graph(OutStream & os)
-{
- std::vector<std::set<int> > edges;
- os << number_of_vertices() + 1; // add the vertex at infinity
- int count(1);
- for( Vertex_iterator vit = vertices_begin(); vit != vertices_end(); ++vit )
- vit->idx_ = count++;
- edges.resize(number_of_vertices()+1);
- for( Full_cell_iterator sit = full_cells_begin(); sit != full_cells_end(); ++sit )
- {
- int v1 = 0;
- while( v1 < current_dimension() )
- {
- int v2 = v1 + 1;
- while( v2 <= current_dimension() )
- {
- int i1, i2;
- if( Vertex_handle() != sit-> vertex(v1) )
- i1 = sit->vertex(v1)->idx_;
- else
- i1 = 0;
- if( Vertex_handle() != sit-> vertex(v2) )
- i2 = sit->vertex(v2)->idx_;
- else
- i2 = 0;
- edges[i1].insert(i2);
- edges[i2].insert(i1);
- ++v2;
- }
- ++v1;
- }
- }
- for( std::size_t i = 0; i < edges.size(); ++i )
- {
- os << std::endl << edges[i].size();
- for( std::set<int>::const_iterator nit = edges[i].begin();
- nit != edges[i].end(); ++nit )
- {
- os << ' ' << (*nit);
- }
- }
-}
-
-// NOT DOCUMENTED...
-template<class Dimen, class Vb, class Fcb>
-std::istream &
-Triangulation_data_structure<Dimen, Vb, Fcb>
-::read_full_cells(std::istream & is, const std::vector<Vertex_handle> & vertices)
-{
- std::size_t m; // number of full_cells
- int index;
- const int cd = current_dimension();
- if( is_ascii(is) )
- is >> m;
- else
- read(is, m, io_Read_write());
-
- std::vector<Full_cell_handle> full_cells;
- full_cells.reserve(m);
- // read the vertices of each full_cell
- std::size_t i = 0;
- while( i < m )
- {
- Full_cell_handle s = new_full_cell();
- full_cells.push_back(s);
- for( int j = 0; j <= cd; ++j )
- {
- if( is_ascii(is) )
- is >> index;
- else
- read(is, index);
- s->set_vertex(j, vertices[index]);
- }
- // read other non-combinatorial information for the full_cells
- is >> (*s);
- ++i;
- }
-
- // read the neighbors of each full_cell
- i = 0;
- if( is_ascii(is) )
- while( i < m )
- {
- for( int j = 0; j <= cd; ++j )
- {
- is >> index;
- full_cells[i]->set_neighbor(j, full_cells[index]);
- }
- ++i;
- }
- else
- while( i < m )
- {
- for( int j = 0; j <= cd; ++j )
- {
- read(is, index);
- full_cells[i]->set_neighbor(j, full_cells[index]);
- }
- ++i;
- }
-
- // compute the mirror indices
- for( i = 0; i < m; ++i )
- {
- Full_cell_handle s = full_cells[i];
- for( int j = 0; j <= cd; ++j )
- {
- if( -1 != s->mirror_index(j) )
- continue;
- Full_cell_handle n = s->neighbor(j);
- int k = 0;
- Full_cell_handle nn = n->neighbor(k);
- while( s != nn )
- nn = n->neighbor(++k);
- s->set_mirror_index(j,k);
- n->set_mirror_index(k,j);
- }
- }
- return is;
-}
-
-// NOT DOCUMENTED...
-template<class Dimen, class Vb, class Fcb>
-std::ostream &
-Triangulation_data_structure<Dimen, Vb, Fcb>
-::write_full_cells(std::ostream & os, std::map<Vertex_const_handle, int> & index_of_vertex) const
-{
- std::map<Full_cell_const_handle, int> index_of_full_cell;
-
- std::size_t m = number_of_full_cells();
-
- if( is_ascii(os) )
- os << std::endl << m;
- else
- write(os, m, io_Read_write());
-
- const int cur_dim = current_dimension();
- // write the vertex indices of each full_cell
- int i = 0;
- for( Full_cell_const_iterator it = full_cells_begin(); it != full_cells_end(); ++it )
- {
- index_of_full_cell[it] = i++;
- if( is_ascii(os) )
- os << std::endl;
- for( int j = 0; j <= cur_dim; ++j )
- {
- if( is_ascii(os) )
- os << ' ' << index_of_vertex[it->vertex(j)];
- else
- write(os, index_of_vertex[it->vertex(j)]);
- }
- // write other non-combinatorial information for the full_cells
- os << (*it);
- }
-
- CGAL_assertion( (std::size_t) i == m );
-
- // write the neighbors of each full_cell
- if( is_ascii(os) )
- for( Full_cell_const_iterator it = full_cells_begin(); it != full_cells_end(); ++it )
- {
- os << std::endl;
- for( int j = 0; j <= cur_dim; ++j )
- os << ' ' << index_of_full_cell[it->neighbor(j)];
- }
- else
- for( Full_cell_const_iterator it = full_cells_begin(); it != full_cells_end(); ++it )
- {
- for( int j = 0; j <= cur_dim; ++j )
- write(os, index_of_full_cell[it->neighbor(j)]);
- }
-
- return os;
-}
-
-// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
-
-// FUNCTIONS THAT ARE NOT MEMBER FUNCTIONS:
-
-template<class Dimen, class Vb, class Fcb>
-std::istream &
-operator>>(std::istream & is, Triangulation_data_structure<Dimen, Vb, Fcb> & tr)
- // reads :
- // - the dimensions (maximal and current)
- // - the number of finite vertices
- // - the non combinatorial information on vertices (point, etc)
- // - the number of full_cells
- // - the full_cells by the indices of their vertices in the preceding list
- // of vertices, plus the non combinatorial information on each full_cell
- // - the neighbors of each full_cell by their index in the preceding list
-{
- typedef Triangulation_data_structure<Dimen, Vb, Fcb> TDS;
- typedef typename TDS::Vertex_handle Vertex_handle;
-
- // read current dimension and number of vertices
- std::size_t n;
- int cd;
- if( is_ascii(is) )
- is >> cd >> n;
- else
- {
- read(is, cd);
- read(is, n, io_Read_write());
- }
-
- CGAL_assertion_msg( cd <= tr.maximal_dimension(), "input Triangulation_data_structure has too high dimension");
-
- tr.clear();
- tr.set_current_dimension(cd);
-
- if( n == 0 )
- return is;
-
- std::vector<Vertex_handle> vertices;
- vertices.resize(n);
-
- // read the vertices:
- std::size_t i(0);
- while( i < n )
- {
- vertices[i] = tr.new_vertex();
- is >> (*vertices[i]); // read a vertex
- ++i;
- }
-
- // now, read the combinatorial information
- return tr.read_full_cells(is, vertices);
-}
-
-template<class Dimen, class Vb, class Fcb>
-std::ostream &
-operator<<(std::ostream & os, const Triangulation_data_structure<Dimen, Vb, Fcb> & tr)
- // writes :
- // - the dimensions (maximal and current)
- // - the number of finite vertices
- // - the non combinatorial information on vertices (point, etc)
- // - the number of full cells
- // - the full cells by the indices of their vertices in the preceding list
- // of vertices, plus the non combinatorial information on each full_cell
- // - the neighbors of each full_cell by their index in the preceding list
-{
- typedef Triangulation_data_structure<Dimen, Vb, Fcb> TDS;
- typedef typename TDS::Vertex_const_handle Vertex_handle;
- typedef typename TDS::Vertex_const_iterator Vertex_iterator;
-
- // outputs dimension and number of vertices
- std::size_t n = tr.number_of_vertices();
- if( is_ascii(os) )
- os << tr.current_dimension() << std::endl << n;
- else
- {
- write(os, tr.current_dimension());
- write(os, n, io_Read_write());
- }
-
- if( n == 0 )
- return os;
-
- // write the vertices
- std::map<Vertex_handle, int> index_of_vertex;
- int i = 0;
- for( Vertex_iterator it = tr.vertices_begin(); it != tr.vertices_end(); ++it, ++i )
- {
- os << *it; // write the vertex
- if (is_ascii(os))
- os << std::endl;
- index_of_vertex[it] = i;
- }
- CGAL_assertion( (std::size_t) i == n );
-
- // output the combinatorial information
- return tr.write_full_cells(os, index_of_vertex);
-}
-
-} //namespace CGAL
-
-#endif // CGAL_TRIANGULATION_DATA_STRUCTURE_H
diff --git a/include/gudhi_patches/CGAL/Triangulation_ds_full_cell.h b/include/gudhi_patches/CGAL/Triangulation_ds_full_cell.h
deleted file mode 100644
index 541a6a85..00000000
--- a/include/gudhi_patches/CGAL/Triangulation_ds_full_cell.h
+++ /dev/null
@@ -1,311 +0,0 @@
-// Copyright (c) 2009-2014 INRIA Sophia-Antipolis (France).
-// All rights reserved.
-//
-// This file is part of CGAL (www.cgal.org).
-// 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.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Samuel Hornus
-
-#ifndef CGAL_TRIANGULATION_DS_FULL_CELL_H
-#define CGAL_TRIANGULATION_DS_FULL_CELL_H
-
-#include <CGAL/TDS_full_cell_default_storage_policy.h>
-#include <CGAL/TDS_full_cell_mirror_storage_policy.h>
-#include <CGAL/internal/Triangulation/Dummy_TDS.h>
-#include <CGAL/Dimension.h>
-#include <CGAL/Default.h>
-#include <CGAL/array.h>
-
-namespace CGAL {
-
-template< class TDS = void, typename FullCellStoragePolicy = Default >
-class Triangulation_ds_full_cell
-{
- typedef typename Default::Get<FullCellStoragePolicy, TDS_full_cell_default_storage_policy>::type
- Storage_policy;
- typedef Triangulation_ds_full_cell<TDS> Self;
- typedef typename TDS::Maximal_dimension Maximal_dimension;
-
-public:
- typedef TDS Triangulation_data_structure;
- typedef typename TDS::Face Face;
- typedef typename TDS::Vertex_handle Vertex_handle; /* Concept */
- typedef typename TDS::Vertex_const_handle Vertex_const_handle;
- typedef typename TDS::Full_cell_handle Full_cell_handle; /* Concept */
- typedef typename TDS::Full_cell_const_handle Full_cell_const_handle;
- typedef typename TDS::Full_cell_data TDS_data; /* data that the TDS wants to be stored here */
- template< typename TDS2 >
- struct Rebind_TDS /* Concept */
- {
- typedef Triangulation_ds_full_cell<TDS2, FullCellStoragePolicy> Other;
- };
-
-private: // STORAGE
- typedef TFC_data< Vertex_handle, Full_cell_handle,
- Maximal_dimension, Storage_policy > Combinatorics;
- friend struct TFC_data< Vertex_handle, Full_cell_handle,
- Maximal_dimension, Storage_policy >;
- // array of vertices
- typedef typename Combinatorics::Vertex_handle_array Vertex_handle_array;
- // neighbor simplices
- typedef typename Combinatorics::Full_cell_handle_array Full_cell_handle_array;
-
- // NOT DOCUMENTED...
- typename Combinatorics::Xor_type xor_of_vertices(const int cur_dim) const
- {
- return combinatorics_.xor_of_vertices(cur_dim);
- }
-
-public:
- typedef typename Vertex_handle_array::const_iterator Vertex_handle_const_iterator;
- typedef Vertex_handle_const_iterator Vertex_handle_iterator; /* Concept */
-
- Triangulation_ds_full_cell(const int dmax) /* Concept */
- : combinatorics_(dmax), tds_data_()
- {
- CGAL_assertion( dmax > 0 );
- for( int i = 0; i <= dmax; ++i )
- {
- set_neighbor(i, Full_cell_handle());
- set_vertex(i, Vertex_handle());
- set_mirror_index(i, -1);
- }
- }
-
- Triangulation_ds_full_cell(const Triangulation_ds_full_cell & s) /* Concept */
- : combinatorics_(s.combinatorics_), tds_data_(s.tds_data_)
- {}
-
- ~Triangulation_ds_full_cell() {}
-
- int maximal_dimension() const /* Concept */
- {
- return static_cast<int>(vertices().size() - 1);
- }
-
- Vertex_handle_const_iterator vertices_begin() const /* Concept */
- {
- return vertices().begin();
- }
-
- Vertex_handle_const_iterator vertices_end() const /* Concept */
- {
- return vertices().end();
- }
-
- Vertex_handle vertex(const int i) const /* Concept */
- {
- CGAL_precondition(0<=i && i<=maximal_dimension());
- return vertices()[i];
- }
-
- Full_cell_handle neighbor(const int i) const /* Concept */
- {
- CGAL_precondition(0<=i && i<=maximal_dimension());
- return neighbors()[i];
- }
-
- int mirror_index(const int i) const /* Concept */
- {
- CGAL_precondition(0<=i && i<=maximal_dimension());
- return combinatorics_.mirror_index(i);
- }
-
- // Advanced...
- Vertex_handle mirror_vertex(const int i, const int cur_dim) const /* Concept */
- {
- CGAL_precondition(0<=i && i<=maximal_dimension());
- return combinatorics_.mirror_vertex(i, cur_dim);
- }
-
- int index(Full_cell_const_handle s) const /* Concept */
- {
- // WE ASSUME THE FULL CELL WE ARE LOOKING FOR INDEED EXISTS !
- CGAL_precondition(has_neighbor(s));
- int index(0);
- while( neighbor(index) != s )
- ++index;
- return index;
- }
-
- int index(Vertex_const_handle v) const /* Concept */
- {
- // WE ASSUME THE VERTEX WE ARE LOOKING FOR INDEED EXISTS !
- CGAL_precondition(has_vertex(v));
- int index(0);
- while( vertex(index) != v )
- ++index;
- return index;
- }
-
- void set_vertex(const int i, Vertex_handle v) /* Concept */
- {
- CGAL_precondition(0<=i && i<=maximal_dimension());
- vertices()[i] = v;
- }
-
- void set_neighbor(const int i, Full_cell_handle s) /* Concept */
- {
- CGAL_precondition(0<=i && i<=maximal_dimension());
- neighbors()[i] = s;
- }
-
- void set_mirror_index(const int i, const int index) /* Concept */
- {
- CGAL_precondition(0<=i && i<=maximal_dimension());
- combinatorics_.set_mirror_index(i, index);
- }
-
- bool has_vertex(Vertex_const_handle v) const /* Concept */
- {
- int index;
- return has_vertex(v, index);
- }
-
- bool has_vertex(Vertex_const_handle v, int & index) const /* Concept */
- {
- const int d = maximal_dimension();
- index = 0;
- while( (index <= d) && (vertex(index) != v) )
- ++index;
- return (index <= d);
- }
-
- bool has_neighbor(Full_cell_const_handle s) const /* Concept */
- {
- int index;
- return has_neighbor(s, index);
- }
-
- bool has_neighbor(Full_cell_const_handle s, int & index) const /* Concept */
- {
- const int d = maximal_dimension();
- index = 0;
- while( (index <= d) && (neighbor(index) != s) )
- ++index;
- return (index <= d);
- }
-
- void swap_vertices(const int d1, const int d2) /* Concept */
- {
- CGAL_precondition(0 <= d1 && d1<=maximal_dimension());
- CGAL_precondition(0 <= d2 && d2<=maximal_dimension());
- combinatorics_.swap_vertices(d1, d2);
- }
-
- const TDS_data & tds_data() const { return tds_data_; } /* Concept */
- TDS_data & tds_data() { return tds_data_; } /* Concept */
-
- void* for_compact_container() const { return combinatorics_.for_compact_container(); }
- void* & for_compact_container() { return combinatorics_.for_compact_container(); }
-
- bool is_valid(bool verbose = false, int = 0) const /* Concept */
- {
- const int d = maximal_dimension();
- int i(0);
- // test that the non-null Vertex_handles come first, before all null ones
- while( i <= d && vertex(i) != Vertex_handle() ) ++i;
- while( i <= d && vertex(i) == Vertex_handle() ) ++i;
- if( i <= d )
- {
- if( verbose ) CGAL_warning_msg(false, "full cell has garbage handles to vertices.");
- return false;
- }
- for( i = 0; i <= d; ++i )
- {
- if( Vertex_handle() == vertex(i) )
- break; // there are no more vertices
- Full_cell_handle n(neighbor(i));
- if( Full_cell_handle() != n )
- {
- int mirror_idx(mirror_index(i));
- if( n->neighbor(mirror_idx) == Full_cell_handle() )
- {
- if( verbose ) CGAL_warning_msg(false, "neighbor has no back-neighbor.");
- return false;
- }
- if( &(*(n->neighbor(mirror_idx))) != this )
- {
- if( verbose ) CGAL_warning_msg(false, "neighbor does not point back to correct full cell.");
- return false;
- }
- }
- }
- return true;
- }
-
-private:
- // access to data members:
- Full_cell_handle_array & neighbors() {return combinatorics_.neighbors_; }
- const Full_cell_handle_array & neighbors() const {return combinatorics_.neighbors_; }
- Vertex_handle_array & vertices() {return combinatorics_.vertices_; }
- const Vertex_handle_array & vertices() const {return combinatorics_.vertices_; }
-
- // DATA MEMBERS
- Combinatorics combinatorics_;
- mutable TDS_data tds_data_;
-};
-
-// FUNCTIONS THAT ARE NOT MEMBER FUNCTIONS:
-
-template < typename TDS, typename SSP >
-std::ostream &
-operator<<(std::ostream & O, const Triangulation_ds_full_cell<TDS,SSP> &) /* Concept */
-{
- /*if( is_ascii(O) )
- {
- // os << '\n';
- }
- else {}*/
- return O;
-}
-
-template < typename TDS, typename SSP >
-std::istream &
-operator>>(std::istream & I, Triangulation_ds_full_cell<TDS,SSP> &) /* Concept */
-{
- /*if( is_ascii(I) )
- {}
- else {}*/
- return I;
-}
-
-// Special case: specialization when template parameter is void.
-
-// we must declare it for each possible full_cell storage policy because :
-// (GCC error:) default template arguments may not be used in partial specializations
-template< typename StoragePolicy >
-class Triangulation_ds_full_cell<void, StoragePolicy>
-{
-public:
- typedef internal::Triangulation::Dummy_TDS TDS;
- typedef TDS Triangulation_data_structure;
- typedef TDS::Vertex_handle Vertex_handle;
- typedef TDS::Vertex_const_handle Vertex_const_handle;
- typedef TDS::Full_cell_handle Full_cell_handle;
- typedef TDS::Full_cell_const_handle Full_cell_const_handle;
- typedef TDS::Vertex_handle_const_iterator Vertex_handle_const_iterator;
- typedef TDS::Full_cell_data TDS_data;
- template <typename TDS2>
- struct Rebind_TDS
- {
- typedef Triangulation_ds_full_cell<TDS2, StoragePolicy> Other;
- };
- Vertex_handle_const_iterator vertices_begin();
- Vertex_handle_const_iterator vertices_end();
-};
-
-} //namespace CGAL
-
-#endif // CGAL_TRIANGULATION_DS_FULL_CELL_H
diff --git a/include/gudhi_patches/CGAL/Triangulation_ds_vertex.h b/include/gudhi_patches/CGAL/Triangulation_ds_vertex.h
deleted file mode 100644
index 381b97e1..00000000
--- a/include/gudhi_patches/CGAL/Triangulation_ds_vertex.h
+++ /dev/null
@@ -1,154 +0,0 @@
-// Copyright (c) 2009-2014 INRIA Sophia-Antipolis (France).
-// All rights reserved.
-//
-// This file is part of CGAL (www.cgal.org).
-// 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.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Samuel Hornus
-
-#ifndef CGAL_TRIANGULATION_DS_VERTEX_H
-#define CGAL_TRIANGULATION_DS_VERTEX_H
-
-#include <CGAL/Compact_container.h>
-#include <CGAL/internal/Triangulation/Dummy_TDS.h>
-
-namespace CGAL {
-
-/* The template parameter TDS must be a model of the concept
- * 'TriangulationDataStructure' that stores vertices of type
- * 'Triangulation_ds_vertex<TDS>'
- */
-template< class TDS = void >
-class Triangulation_ds_vertex
-{
- typedef Triangulation_ds_vertex<TDS> Self;
-
-public:
- typedef TDS Triangulation_data_structure;
- typedef typename TDS::Full_cell_handle Full_cell_handle; /* Concept */
-
- template <typename TDS2>
- struct Rebind_TDS /* Concept */
- {
- typedef Triangulation_ds_vertex<TDS2> Other;
- };
-
-protected: // DATA MEMBERS
- Full_cell_handle full_cell_; // A handle to an incident full_cell
-
-public:
- // Constructs a vertex with incident full_cell 's'
- Triangulation_ds_vertex(Full_cell_handle s) : full_cell_(s) /* Concept */
- {
- CGAL_assertion( Full_cell_handle() != s );
- }
- // Constructs a vertex with no incident full_cell
- Triangulation_ds_vertex() : full_cell_() {} /* Concept */
-
- ~Triangulation_ds_vertex() {}
-
- /// Set 's' as an incident full_cell
- void set_full_cell(Full_cell_handle s) /* Concept */
- {
- full_cell_ = s;
- }
-
- /// Returns a full_cell incident to the vertex
- Full_cell_handle full_cell() const /* Concept */
- {
- return full_cell_;
- }
-
- bool is_valid(bool verbose = false, int /* level */ = 0) const /* Concept */
- {
- if( Full_cell_handle() == full_cell() )
- {
- if( verbose )
- CGAL_warning_msg(false, "vertex has no incident full cell.");
- return false;
- }
- bool found(false);
- // These two typename below are OK because TDS fullfils the
- // TriangulationDataStructure concept.
- typename TDS::Full_cell::Vertex_handle_iterator vit(full_cell()->vertices_begin());
- typedef typename TDS::Vertex_handle Vertex_handle;
- while( vit != full_cell()->vertices_end() )
- {
- if( Vertex_handle() == *vit )
- break; // The full cell has no more vertices
- if( this == &(**vit) )
- {
- found = true;
- break;
- }
- ++vit;
- }
- if( ! found )
- {
- if( verbose )
- CGAL_warning_msg(false, "vertex's adjacent full cell does not contain that vertex.");
- return false;
- }
- return true;
- }
-
-public: // FOR MEMORY MANAGEMENT
-
- void* for_compact_container() const { return full_cell_.for_compact_container(); }
- void* & for_compact_container() { return full_cell_.for_compact_container(); }
-
-}; // end of Triangulation_ds_vertex
-
-// FUNCTIONS THAT ARE NOT MEMBER FUNCTIONS:
-
-template < class TDS >
-std::istream &
-operator>>(std::istream & is, Triangulation_ds_vertex<TDS> &) /* Concept */
-{
- /*if( is_ascii(is) )
- {}
- else {}*/
- return is;
-}
-
-template< class TDS >
-std::ostream &
-operator<<(std::ostream & os, const Triangulation_ds_vertex<TDS> &) /* Concept */
-{
- /*if( is_ascii(os) )
- {
- os << '\n';
- }
- else {}*/
- return os;
-}
-
-// Special case: specialization when template parameter is void.
-
-template<>
-class Triangulation_ds_vertex<void>
-{
-public:
- typedef internal::Triangulation::Dummy_TDS Triangulation_data_structure;
- typedef Triangulation_data_structure::Full_cell_handle Full_cell_handle; /* Concept */
- template <typename TDS2>
- struct Rebind_TDS /* Concept */
- {
- typedef Triangulation_ds_vertex<TDS2> Other;
- };
-};
-
-} //namespace CGAL
-
-#endif // CGAL_TRIANGULATION_DS_VERTEX_H
diff --git a/include/gudhi_patches/CGAL/Triangulation_face.h b/include/gudhi_patches/CGAL/Triangulation_face.h
deleted file mode 100644
index bc9c1781..00000000
--- a/include/gudhi_patches/CGAL/Triangulation_face.h
+++ /dev/null
@@ -1,111 +0,0 @@
-// Copyright (c) 2009-2014 INRIA Sophia-Antipolis (France).
-// All rights reserved.
-//
-// This file is part of CGAL (www.cgal.org).
-// 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.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Samuel Hornus
-
-#ifndef CGAL_TRIANGULATION_FACE_H
-#define CGAL_TRIANGULATION_FACE_H
-
-#include <CGAL/basic.h>
-#include <CGAL/internal/Static_or_dynamic_array.h>
-
-namespace CGAL {
-
-template< typename TDS >
-class Triangulation_face
-{
- typedef typename internal::Dimen_plus_one<typename TDS::Maximal_dimension>::type Dimen_plus;
-public:
- typedef TDS Triangulation_data_structure;
- typedef typename TDS::Full_cell_handle Full_cell_handle; /* Concept */
- typedef typename TDS::Vertex_handle Vertex_handle; /* Concept */
- typedef internal::S_or_D_array<int, Dimen_plus> Indices;
-
-protected:
- Full_cell_handle full_cell_;
- Indices indices_;
-
-public:
- explicit Triangulation_face(Full_cell_handle s) /* Concept */
- : full_cell_(s), indices_(s->maximal_dimension()+2)
- {
- CGAL_assertion( Full_cell_handle() != s );
- clear();
- }
-
- explicit Triangulation_face(const int maximal_dim) /* Concept */
- : full_cell_(), indices_(maximal_dim+2)
- {
- clear();
- }
-
- Triangulation_face(const Triangulation_face & f) /* Concept */
- : full_cell_(f.full_cell_), indices_(f.indices_)
- {}
-
- int face_dimension() const /* Concept */
- {
- int i(0);
- while( -1 != indices_[i] ) ++i;
- return (i-1);
- }
-
- Full_cell_handle full_cell() const /* Concept */
- {
- return full_cell_;
- }
-
- int index(const int i) const /* Concept */
- {
- CGAL_precondition( (0 <= i) && (i <= face_dimension()) );
- return indices_[i];
- }
-
- Vertex_handle vertex(const int i) const /* Concept */
- {
- int j = index(i);
- if( j == -1 )
- return Vertex_handle();
- return full_cell()->vertex(j);
- }
-
-// - - - - - - - - - - - - - - - - - - UPDATE FUNCTIONS
-
- void clear() /* Concept */
- {
- const std::size_t d = indices_.size();
- for(std::size_t i = 0; i < d; ++i )
- indices_[i] = -1;
- }
-
- void set_full_cell(Full_cell_handle s) /* Concept */
- {
- CGAL_precondition( Full_cell_handle() != s );
- full_cell_ = s;
- }
-
- void set_index(const int i, const int idx) /* Concept */
- {
- CGAL_precondition( (0 <= i) && ((size_t)i+1 < indices_.size()) );
- CGAL_precondition( (0 <= idx) && ((size_t)idx < indices_.size()) );
- indices_[i] = idx;
- }
-};
-
-} //namespace CGAL
-
-#endif // CGAL_TRIANGULATION_FACE_H
diff --git a/include/gudhi_patches/CGAL/Triangulation_full_cell.h b/include/gudhi_patches/CGAL/Triangulation_full_cell.h
deleted file mode 100644
index a0c5246f..00000000
--- a/include/gudhi_patches/CGAL/Triangulation_full_cell.h
+++ /dev/null
@@ -1,148 +0,0 @@
-// Copyright (c) 2009-2014 INRIA Sophia-Antipolis (France).
-// All rights reserved.
-//
-// This file is part of CGAL (www.cgal.org).
-// 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.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Samuel Hornus
-
-#ifndef CGAL_TRIANGULATION_SIMPLEX_H
-#define CGAL_TRIANGULATION_SIMPLEX_H
-
-#include <CGAL/Triangulation_ds_full_cell.h>
-#include <CGAL/internal/Triangulation/utilities.h>
-#include <CGAL/Iterator_project.h>
-#include <CGAL/Default.h>
-
-namespace CGAL {
-
-struct No_full_cell_data {};
-
-template< class TriangulationTraits, typename Data_ = No_full_cell_data, class TDSFullCell = Default >
-class Triangulation_full_cell : public Default::Get<TDSFullCell, Triangulation_ds_full_cell<> >::type
-{
- // The default type for TDSFullCell is Triangulation_ds_full_cell<> :
- typedef typename Default::Get<TDSFullCell, Triangulation_ds_full_cell<> >::type
- Base;
- typedef Triangulation_full_cell<TriangulationTraits, Data_, TDSFullCell> Self;
-public:
- typedef Data_ Data;
- typedef typename Base::Vertex_handle Vertex_handle;
- typedef typename Base::Vertex_const_handle Vertex_const_handle;
- typedef typename Base::Vertex_handle_const_iterator Vertex_handle_const_iterator;
- typedef typename Base::Full_cell_const_handle Full_cell_const_handle;
- typedef typename TriangulationTraits::Point_d Point;
- typedef typename TriangulationTraits::Point_d Point_d;
-
-private: // DATA MEMBERS
- Data data_;
-
-public:
-
- using Base::vertices_begin;
- using Base::vertices_end;
-
- template< class TDS2 >
- struct Rebind_TDS
- {
- typedef typename Base::template Rebind_TDS<TDS2>::Other TDSFullCell2;
- typedef Triangulation_full_cell<TriangulationTraits, Data_, TDSFullCell2> Other;
- };
-
- Triangulation_full_cell(const int d)
- : Base(d), data_() {}
-
- Triangulation_full_cell(const Self & s)
- : Base(s), data_(s.data_) {}
-
- const Data & data() const
- {
- return data_;
- }
-
- Data & data()
- {
- return data_;
- }
-
- struct Point_from_vertex_handle
- {
- typedef Vertex_handle argument_type;
- typedef Point result_type;
- result_type & operator()(argument_type & x) const
- {
- return x->point();
- }
- const result_type & operator()(const argument_type & x) const
- {
- return x->point();
- }
- };
-
-protected:
-
- typedef CGAL::Iterator_project<
- Vertex_handle_const_iterator,
- internal::Triangulation::Point_from_vertex_handle<Vertex_handle, Point>
- > Point_const_iterator;
-
- Point_const_iterator points_begin() const
- { return Point_const_iterator(Base::vertices_begin()); }
- Point_const_iterator points_end() const
- { return Point_const_iterator(Base::vertices_end()); }
-};
-
-// FUNCTIONS THAT ARE NOT MEMBER FUNCTIONS:
-
-inline
-std::istream &
-operator>>(std::istream & is, No_full_cell_data &)
-{
- return is;
-}
-
-inline
-std::ostream &
-operator<<(std::ostream & os, const No_full_cell_data &)
-{
- return os;
-}
-
-template < typename TDS, typename Data, typename SSP >
-std::ostream &
-operator<<(std::ostream & O, const Triangulation_full_cell<TDS, Data, SSP> & s)
-{
- /*if( is_ascii(O) )
- {
- // os << '\n';
- }
- else {}*/
- O << s.data();
- return O;
-}
-
-template < typename TDS, typename Data, typename SSP >
-std::istream &
-operator>>(std::istream & I, Triangulation_full_cell<TDS, Data, SSP> & s)
-{
- /*if( is_ascii(I) )
- {}
- else {}*/
- I >> s.data();
- return I;
-}
-
-} //namespace CGAL
-
-#endif // CGAL_TRIANGULATION_SIMPLEX_H
diff --git a/include/gudhi_patches/CGAL/Triangulation_vertex.h b/include/gudhi_patches/CGAL/Triangulation_vertex.h
deleted file mode 100644
index f364717f..00000000
--- a/include/gudhi_patches/CGAL/Triangulation_vertex.h
+++ /dev/null
@@ -1,128 +0,0 @@
-// Copyright (c) 2009-2014 INRIA Sophia-Antipolis (France).
-// All rights reserved.
-//
-// This file is part of CGAL (www.cgal.org).
-// 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.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Samuel Hornus
-
-#ifndef CGAL_TRIANGULATION_VERTEX_H
-#define CGAL_TRIANGULATION_VERTEX_H
-
-#include <CGAL/Triangulation_ds_vertex.h>
-#include <CGAL/Default.h>
-
-namespace CGAL {
-
-struct No_vertex_data {};
-
-template< class TriangulationTraits, typename Data_ = No_vertex_data, class TDSVertex = Default >
-class Triangulation_vertex : public Default::Get<TDSVertex, Triangulation_ds_vertex<> >::type
-{
- // The default type for TDSVertex is Triangulation_ds_vertex<> :
- typedef typename Default::Get<TDSVertex, Triangulation_ds_vertex<> >::type
- Base;
- typedef Triangulation_vertex<TriangulationTraits, Data_, TDSVertex> Self;
-public:
- typedef Data_ Data;
- typedef typename TriangulationTraits::Point_d Point;
- typedef typename TriangulationTraits::Point_d Point_d;
- typedef typename Base::Full_cell_handle Full_cell_handle;
-
- template <typename TDS2>
- struct Rebind_TDS
- {
- typedef typename Base::template Rebind_TDS<TDS2>::Other TDSVertex2;
- typedef Triangulation_vertex<TriangulationTraits, Data_, TDSVertex2> Other;
- };
-
-private: // DATA MEMBERS
- Point point_;
- Data data_;
-
-public:
- template< typename T >
- Triangulation_vertex(Full_cell_handle s, const Point & p, const T & t)
- : Base(s), point_(p), data_(t) {}
- Triangulation_vertex(Full_cell_handle s, const Point & p)
- : Base(s), point_(p), data_() {}
- template< typename T >
- Triangulation_vertex(const Point & p, const T & t)
- : Base(), point_(p), data_(t) {}
- Triangulation_vertex(const Point & p)
- : Base(), point_(p), data_() {}
- Triangulation_vertex() : Base(), point_(), data_() {}
-
- ~Triangulation_vertex() {}
-
- /// Set the position in space of the vertex to 'p'
- void set_point(const Point & p)
- {
- point_ = p;
- }
-
- /// Returns the position in space of the vertex
- const Point & point() const
- {
- return point_;
- }
-
- const Data & data() const
- {
- return data_;
- }
-
- Data & data()
- {
- return data_;
- }
-
-}; // end of Triangulation_vertex
-
-// NON CLASS-MEMBER FUNCTIONS
-
-inline
-std::istream &
-operator>>(std::istream & is, No_vertex_data &)
-{
- return is;
-}
-
-inline
-std::ostream &
-operator<<(std::ostream & os, const No_vertex_data &)
-{
- return os;
-}
-
-template < class A, typename Data, class B >
-std::istream &
-operator>>(std::istream & is, Triangulation_vertex<A, Data, B> & v)
-{
- is >> v.point();
- return (is >> v.data());
-}
-
-template< class A, typename Data, class B >
-std::ostream &
-operator<<(std::ostream & os, const Triangulation_vertex<A, Data, B> & v)
-{
- os << v.point();
- os << v.data();
- return os;
-}
-
-} //namespace CGAL
-
-#endif // CGAL_TRIANGULATION_VERTEX_H
diff --git a/include/gudhi_patches/CGAL/argument_swaps.h b/include/gudhi_patches/CGAL/argument_swaps.h
deleted file mode 100644
index aa16f29b..00000000
--- a/include/gudhi_patches/CGAL/argument_swaps.h
+++ /dev/null
@@ -1,88 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_ARGUMENT_SWAPS_H
-#define CGAL_ARGUMENT_SWAPS_H
-
-#include <CGAL/config.h>
-#include <utility>
-
-#ifndef CGAL_CXX11
-#include <boost/preprocessor/repetition.hpp>
-#include <boost/utility/result_of.hpp>
-#endif
-
-namespace CGAL {
-
-#ifdef CGAL_CXX11
-
-namespace internal {
-
-template<int,class...> struct Apply_to_last_then_rest_;
-
-template<int d,class F,class T,class... U>
-struct Apply_to_last_then_rest_<d,F,T,U...> {
- typedef typename Apply_to_last_then_rest_<d-1,F,U...,T>::result_type result_type;
- inline result_type operator()(F&&f,T&&t,U&&...u)const{
- return Apply_to_last_then_rest_<d-1,F,U...,T>()(
- std::forward<F>(f),
- std::forward<U>(u)...,
- std::forward<T>(t));
- }
-};
-
-template<class F,class T,class... U>
-struct Apply_to_last_then_rest_<0,F,T,U...> {
- typedef decltype(std::declval<F>()(std::declval<T>(), std::declval<U>()...)) result_type;
- inline result_type operator()(F&&f,T&&t,U&&...u)const{
- return std::forward<F>(f)(std::forward<T>(t), std::forward<U>(u)...);
- }
-};
-
-} // namespace internal
-
-
-struct Apply_to_last_then_rest {
- template<class F,class T,class...U> inline
- typename internal::Apply_to_last_then_rest_<sizeof...(U),F,T,U...>::result_type
- operator()(F&&f,T&&t,U&&...u)const{
- return internal::Apply_to_last_then_rest_<sizeof...(U),F,T,U...>()(
- std::forward<F>(f),
- std::forward<T>(t),
- std::forward<U>(u)...);
- }
-};
-
-#else // CGAL_CXX11
-
-struct Apply_to_last_then_rest {
-#define CGAL_CODE(Z,N,_) template<class F,class T,BOOST_PP_ENUM_PARAMS(N,class T)> \
- typename boost::result_of<F(T,BOOST_PP_ENUM_PARAMS(N,T))>::type \
- operator()(F const&f, BOOST_PP_ENUM_BINARY_PARAMS(N,T,const&t), T const&t) const { \
- return f(t,BOOST_PP_ENUM_PARAMS(N,t)); \
- }
- BOOST_PP_REPEAT_FROM_TO(1,11,CGAL_CODE,_)
-#undef CGAL_CODE
-};
-
-#endif // CGAL_CXX11
-
-} // namespace CGAL
-
-#endif // CGAL_ARGUMENT_SWAPS_H
diff --git a/include/gudhi_patches/CGAL/determinant_of_vectors.h b/include/gudhi_patches/CGAL/determinant_of_vectors.h
deleted file mode 100644
index e1bad64e..00000000
--- a/include/gudhi_patches/CGAL/determinant_of_vectors.h
+++ /dev/null
@@ -1,117 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_DETVEC_H
-#define CGAL_DETVEC_H
-#include <CGAL/determinant.h>
-#include <CGAL/predicates/sign_of_determinant.h>
-
-namespace CGAL {
- // TODO: determine whether it is better to pass them by lines or columns.
-
- template <class NT, class Vector> inline
- NT determinant_of_vectors(Vector const&a, Vector const&b){
- return determinant<NT>(a[0],a[1],b[0],b[1]);
- }
- template <class NT, class Vector> inline
- typename Sgn<NT>::result_type
- sign_of_determinant_of_vectors(Vector const&a, Vector const&b){
- return sign_of_determinant<NT>(a[0],a[1],b[0],b[1]);
- }
-
- template <class NT, class Vector>
- NT determinant_of_vectors(Vector const&a, Vector const&b,
- Vector const&c){
- return determinant<NT>(a[0],a[1],a[2],b[0],b[1],b[2],c[0],c[1],c[2]);
- }
- template <class NT, class Vector>
- typename Sgn<NT>::result_type
- sign_of_determinant_of_vectors(Vector const&a, Vector const&b,
- Vector const&c){
- return sign_of_determinant<NT>(a[0],a[1],a[2],b[0],b[1],b[2],c[0],c[1],c[2]);
- }
-
- template <class NT, class Vector>
- NT determinant_of_vectors(Vector const&a, Vector const&b,
- Vector const&c, Vector const&d){
- return determinant<NT>(
- a[0],a[1],a[2],a[3],
- b[0],b[1],b[2],b[3],
- c[0],c[1],c[2],c[3],
- d[0],d[1],d[2],d[3]);
- }
- template <class NT, class Vector>
- typename Sgn<NT>::result_type
- sign_of_determinant_of_vectors(Vector const&a, Vector const&b,
- Vector const&c, Vector const&d){
- return sign_of_determinant<NT>(
- a[0],a[1],a[2],a[3],
- b[0],b[1],b[2],b[3],
- c[0],c[1],c[2],c[3],
- d[0],d[1],d[2],d[3]);
- }
-
- template <class NT, class Vector>
- NT determinant_of_vectors(Vector const&a, Vector const&b,
- Vector const&c, Vector const&d, Vector const&e){
- return determinant<NT>(
- a[0],a[1],a[2],a[3],a[4],
- b[0],b[1],b[2],b[3],b[4],
- c[0],c[1],c[2],c[3],c[4],
- d[0],d[1],d[2],d[3],d[4],
- e[0],e[1],e[2],e[3],e[4]);
- }
- template <class NT, class Vector>
- typename Sgn<NT>::result_type
- sign_of_determinant_of_vectors(Vector const&a, Vector const&b,
- Vector const&c, Vector const&d, Vector const&e){
- return sign_of_determinant<NT>(
- a[0],a[1],a[2],a[3],a[4],
- b[0],b[1],b[2],b[3],b[4],
- c[0],c[1],c[2],c[3],c[4],
- d[0],d[1],d[2],d[3],d[4],
- e[0],e[1],e[2],e[3],e[4]);
- }
-
- template <class NT, class Vector>
- NT determinant_of_vectors(Vector const&a, Vector const&b,
- Vector const&c, Vector const&d, Vector const&e, Vector const&f){
- return determinant<NT>(
- a[0],a[1],a[2],a[3],a[4],a[5],
- b[0],b[1],b[2],b[3],b[4],b[5],
- c[0],c[1],c[2],c[3],c[4],c[5],
- d[0],d[1],d[2],d[3],d[4],d[5],
- e[0],e[1],e[2],e[3],e[4],e[5],
- f[0],f[1],f[2],f[3],f[4],f[5]);
- }
- template <class NT, class Vector>
- typename Sgn<NT>::result_type
- sign_of_determinant_of_vectors(Vector const&a, Vector const&b,
- Vector const&c, Vector const&d, Vector const&e, Vector const&f){
- return sign_of_determinant<NT>(
- a[0],a[1],a[2],a[3],a[4],a[5],
- b[0],b[1],b[2],b[3],b[4],b[5],
- c[0],c[1],c[2],c[3],c[4],c[5],
- d[0],d[1],d[2],d[3],d[4],d[5],
- e[0],e[1],e[2],e[3],e[4],e[5],
- f[0],f[1],f[2],f[3],f[4],f[5]);
- }
-
-}
-#endif
diff --git a/include/gudhi_patches/CGAL/internal/Combination_enumerator.h b/include/gudhi_patches/CGAL/internal/Combination_enumerator.h
deleted file mode 100644
index f411e827..00000000
--- a/include/gudhi_patches/CGAL/internal/Combination_enumerator.h
+++ /dev/null
@@ -1,148 +0,0 @@
-// Copyright (c) 2009-2014 INRIA Sophia-Antipolis (France).
-// All rights reserved.
-//
-// This file is part of CGAL (www.cgal.org).
-// 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.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Samuel Hornus
-
-#ifndef CGAL_INTERNAL_COMBINATION_ENUMERATOR_H
-#define CGAL_INTERNAL_COMBINATION_ENUMERATOR_H
-
-#include <CGAL/basic.h>
-#include <vector>
-
-namespace CGAL {
-
-namespace internal {
-
-class Combination_enumerator
-{
- // types and member data
- typedef std::vector<int> Combination;
- Combination combi_;
- const int k_;
- const int min_;
- const int max_;
- const int max_at_pos_0_;
-
-public:
-
- // For generating all the combinations of |k| distinct elements in the
- // interval [min, max] (both included)
- Combination_enumerator(const int k, const int min, const int max)
- : combi_(k), k_(k), min_(min), max_(max), max_at_pos_0_(max + 1 - k)
- {
- CGAL_assertion_msg( min <= max, "min is larger than max");
- CGAL_assertion_msg( 1 <= k && k <= ( max - min + 1 ), "wrong value of k");
- init();
- }
-
- Combination_enumerator(const Combination_enumerator & c)
- : combi_(c.combi_), k_(c.k_), min_(c.min_), max_(c.max_), max_at_pos_0_(c.max_at_pos_0_)
- {}
-
- int number_of_elements()
- {
- return k_;
- }
-
- void init()
- {
- combi_.resize(k_);
- for( int i = 0; i < k_; ++i )
- element(i) = min_ + i;
- }
-
- bool end() const
- {
- return ( element(0) > max_at_pos_0_ );
- }
-
- int element(const int i) const
- {
- CGAL_assertion( 0 <= i && i < k_ );
- return combi_[i];
- }
-
- int & element(const int i)
- {
- CGAL_assertion( 0 <= i && i < k_ );
- return combi_[i];
- }
-
- int operator[](const int i) const
- {
- return element(i);
- }
-
- int & operator[](const int i)
- {
- return element(i);
- }
-
- void operator++()
- {
- int i = k_ - 1;
- int max_at_pos_i(max_);
- while( ( i >= 0 ) && ( element(i) >= max_at_pos_i ) )
- {
- --i;
- --max_at_pos_i;
- }
- if( -1 == i )
- {
- if( element(0) == max_at_pos_0_ )
- ++element(0); // mark then end of the enumeration with an impossible value
- // Note than when we have arrived at the end of the enumeration, applying
- // operator++() again does not change anything, so it is safe to
- // apply it too many times.
- }
- else
- {
- ++element(i);
- for( int j = i + 1; j < k_; ++j )
- element(j) = element(i) + j - i;
- }
- }
-
- Combination_enumerator operator++(int)
- {
- Combination_enumerator tmp(*this);
- ++(*this);
- return tmp;
- }
-
- // - - - - - - - - - - - - - - - - - - - - - - - - - - - TESTING
-#if 0
- void test()
- {
- std::cerr << '\n';
- while( ! end() )
- {
- std::cerr << '\n';
- for( int i = 0; i < k_; ++i )
- std::cerr << element(i) << ' ';
- ++(*this);
- }
- init();
- }
-#endif
-};
-
-} // end of namespace internal
-
-} // end of namespace CGAL
-
-#endif // CGAL_INTERNAL_COMBINATION_ENUMERATOR_H
diff --git a/include/gudhi_patches/CGAL/internal/Static_or_dynamic_array.h b/include/gudhi_patches/CGAL/internal/Static_or_dynamic_array.h
deleted file mode 100644
index ee6195d9..00000000
--- a/include/gudhi_patches/CGAL/internal/Static_or_dynamic_array.h
+++ /dev/null
@@ -1,116 +0,0 @@
-// Copyright (c) 2009-2014 INRIA Sophia-Antipolis (France).
-// All rights reserved.
-//
-// This file is part of CGAL (www.cgal.org).
-// 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.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Samuel Hornus
-
-#ifndef CGAL_INTERNAL_STATIC_OR_DYNAMIC_ARRAY_H
-#define CGAL_INTERNAL_STATIC_OR_DYNAMIC_ARRAY_H
-
-#include <CGAL/Compact_container.h>
-#include <CGAL/Dimension.h>
-#include <CGAL/array.h>
-#include <vector>
-
-namespace CGAL {
-
-namespace internal {
-
-// Utility for adding one to an Dimension_tag:
-
-template<typename D>
-struct Dimen_plus_one;
-
-template<>
-struct Dimen_plus_one<Dynamic_dimension_tag>
-{
- typedef Dynamic_dimension_tag type;
-};
-
-template<int D>
-struct Dimen_plus_one<Dimension_tag<D> >
-{
- typedef Dimension_tag<D+1> type;
-};
-
-// A SMALL CONTAINER UTILITY FOR DYNAMIC/STATIC MEMORY MANAGEMENT
-
-// stores an array of static or dynamic size, depending on template parameter <B>.
-
-template< typename Containee, typename D, bool WithCompactContainerHelper = false>
- struct S_or_D_array; // S = static, D = dynamic
-
-// The case of static size:
-template< typename Containee, int D, bool WithCompactContainerHelper >
-struct S_or_D_array< Containee, Dimension_tag< D >, WithCompactContainerHelper >
-: public array<Containee, D>
-{
- typedef array<Containee, D> Base;
- S_or_D_array(const int)
- : Base()
- {}
- S_or_D_array(const int, const Containee & c)
- : Base()
- {
- assign(c);
- }
- void* for_compact_container() const
- {
- return (*this)[0].for_compact_container();
- }
- void* & for_compact_container()
- {
- return (*this)[0].for_compact_container();
- }
-};
-
-// The case of dynamic size
-template< typename Containee >
-struct S_or_D_array< Containee, Dynamic_dimension_tag, false >
-: public std::vector<Containee>
-{
- typedef std::vector<Containee> Base;
- // TODO: maybe we should use some "small-vector-optimized" class.
- S_or_D_array(const int d)
- : Base(d)
- {}
- S_or_D_array(const int d, const Containee & c)
- : Base(d, c)
- {}
-};
-
-// The case of dynamic size with for_compact_container
-template< typename Containee >
-struct S_or_D_array< Containee, Dynamic_dimension_tag, true >
-: public std::vector<Containee>
-{
- typedef std::vector<Containee> Base;
- S_or_D_array(const int d)
- : Base(d), fcc_(NULL)
- {}
- S_or_D_array(const int d, const Containee & c)
- : Base(d, c), fcc_(NULL)
- {}
- void* fcc_;
- void* for_compact_container() const { return fcc_; }
- void* & for_compact_container() { return fcc_; }
-};
-
-} // end of namespace internal
-
-} // end of namespace CGAL
-
-#endif // CGAL_INTERNAL_STATIC_OR_DYNAMIC_ARRAY_H
diff --git a/include/gudhi_patches/CGAL/internal/Triangulation/Dummy_TDS.h b/include/gudhi_patches/CGAL/internal/Triangulation/Dummy_TDS.h
deleted file mode 100644
index b3a0ec98..00000000
--- a/include/gudhi_patches/CGAL/internal/Triangulation/Dummy_TDS.h
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright (c) 2009-2014 INRIA Sophia-Antipolis (France).
-// All rights reserved.
-//
-// This file is part of CGAL (www.cgal.org).
-// 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.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Samuel Hornus
-
-#ifndef CGAL_INTERNAL_TRIANGULATION_DUMMY_TDS_H
-#define CGAL_INTERNAL_TRIANGULATION_DUMMY_TDS_H
-
-namespace CGAL {
-
-namespace internal {
-namespace Triangulation {
-
-struct Dummy_TDS
-{
- struct Vertex {};
- struct Vertex_handle {};
- struct Vertex_iterator {};
- struct Vertex_const_handle {};
- struct Vertex_const_iterator {};
- struct Full_cell {};
- struct Full_cell_handle {};
- struct Full_cell_iterator {};
- struct Full_cell_const_handle {};
- struct Full_cell_const_iterator {};
- struct Vertex_handle_const_iterator {};
- struct Full_cell_data {};
-};
-
-} // namespace Triangulation
-} // namespace internal
-
-} //namespace CGAL
-
-#endif // CGAL_INTERNAL_TRIANGULATION_DUMMY_TDS_H
diff --git a/include/gudhi_patches/CGAL/internal/Triangulation/Triangulation_ds_iterators.h b/include/gudhi_patches/CGAL/internal/Triangulation/Triangulation_ds_iterators.h
deleted file mode 100644
index 7e360026..00000000
--- a/include/gudhi_patches/CGAL/internal/Triangulation/Triangulation_ds_iterators.h
+++ /dev/null
@@ -1,154 +0,0 @@
-// Copyright (c) 2009-2014 INRIA Sophia-Antipolis (France).
-// All rights reserved.
-//
-// This file is part of CGAL (www.cgal.org).
-// 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.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Samuel Hornus (Well... `copy, paste and hack' of Monique Teillaud's work)
-
-#ifndef CGAL_INTERNAL_TRIANGULATION_TRIANGULATION_DS_ITERATORS_H
-#define CGAL_INTERNAL_TRIANGULATION_TRIANGULATION_DS_ITERATORS_H
-
-namespace CGAL {
-
-namespace internal {
-namespace Triangulation {
-
-template< typename TDS >
-class Triangulation_ds_facet_iterator
-{
- typedef typename TDS::Full_cell_handle Full_cell_handle;
- typedef typename TDS::Facet Facet;
-
- typedef Facet value_type;
- typedef const Facet * pointer;
- typedef const Facet & reference;
- typedef std::size_t size_type;
- typedef std::ptrdiff_t difference_type;
- typedef std::bidirectional_iterator_tag iterator_category;
-
- typedef Triangulation_ds_facet_iterator<TDS> Facet_iterator;
-
- TDS & tds_;
- Facet ft_;
- const int cur_dim_;
-
-public:
- Triangulation_ds_facet_iterator(TDS & tds)
- : tds_(tds), ft_(tds.full_cells_begin(), 0), cur_dim_(tds.current_dimension())
- {
- CGAL_assertion( cur_dim_ > 0 );
- while( ! canonical() )
- raw_increment();
- }
-
- Triangulation_ds_facet_iterator(TDS & tds, int)
- : tds_(tds), ft_(tds.full_cells_end(), 0), cur_dim_(tds.current_dimension())
- {
- CGAL_assertion( cur_dim_ > 0 );
- CGAL_assertion( canonical() );
- }
-
- Facet_iterator & operator++()
- {
- increment();
- return (*this);
- }
-
- Facet_iterator operator++(int)
- {
- Facet_iterator tmp(*this);
- increment();
- return tmp;
- }
-
- Facet_iterator & operator--()
- {
- decrement();
- return (*this);
- }
-
- Facet_iterator operator--(int)
- {
- Facet_iterator tmp(*this);
- decrement();
- return tmp;
- }
-
- bool operator==(const Facet_iterator & fi) const
- {
- return (&tds_ == &fi.tds_) &&
- (tds_.index_of_covertex(ft_) == fi.tds_.index_of_covertex(fi.ft_)) &&
- (tds_.full_cell(ft_) == fi.tds_.full_cell(fi.ft_));
- }
-
- bool operator!=(const Facet_iterator & fi) const
- {
- return !(*this == fi);
- }
-
- reference operator*() const
- {
- return ft_;
- }
-
- pointer operator->() const
- {
- return &ft_;
- }
-
-private:
- bool canonical()
- {
- if( tds_.full_cells_end() == tds_.full_cell(ft_) )
- return ( 0 == tds_.index_of_covertex(ft_) );
- return ( tds_.full_cell(ft_) <
- tds_.full_cell(ft_)->neighbor(tds_.index_of_covertex(ft_)) );
- }
-
- void raw_decrement()
- {
- int i = tds_.index_of_covertex(ft_);
- if( i == 0 )
- ft_ = Facet(--tds_.full_cell(ft_), cur_dim_);
- else
- ft_ = Facet(tds_.full_cell(ft_), i - 1);
- }
-
- void raw_increment()
- {
- int i = tds_.index_of_covertex(ft_);
- if( i == cur_dim_ )
- ft_ = Facet(++tds_.full_cell(ft_), 0);
- else
- ft_ = Facet(tds_.full_cell(ft_), i + 1);
- }
-
- void decrement()
- {
- do { raw_decrement(); } while( ! canonical() );
- }
-
- void increment()
- {
- do { raw_increment(); } while( ! canonical() );
- }
-};
-
-} // namespace Triangulation
-} // namespace internal
-
-} //namespace CGAL
-
-#endif // CGAL_INTERNAL_TRIANGULATION_TRIANGULATION_DS_ITERATORS_H
diff --git a/include/gudhi_patches/CGAL/internal/Triangulation/utilities.h b/include/gudhi_patches/CGAL/internal/Triangulation/utilities.h
deleted file mode 100644
index a1ffc775..00000000
--- a/include/gudhi_patches/CGAL/internal/Triangulation/utilities.h
+++ /dev/null
@@ -1,154 +0,0 @@
-// Copyright (c) 2009-2014 INRIA Sophia-Antipolis (France).
-// All rights reserved.
-//
-// This file is part of CGAL (www.cgal.org).
-// 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.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Samuel Hornus
-
-#ifndef CGAL_INTERNAL_TRIANGULATION_UTILITIES_H
-#define CGAL_INTERNAL_TRIANGULATION_UTILITIES_H
-
-#include <CGAL/basic.h>
-
-namespace CGAL {
-
-namespace internal {
-namespace Triangulation {
-
-template< class TDS >
-struct Dark_full_cell_data
-{
- typedef typename TDS::Full_cell_handle Full_cell_handle;
- Full_cell_handle light_copy_;
- int count_;
- Dark_full_cell_data() : light_copy_(), count_(0) {}
-};
-
-template< class TDS >
-struct Compare_faces_with_common_first_vertex
-{
- typedef typename TDS::Face Face;
-
- const int d_;
-
-public:
-
- Compare_faces_with_common_first_vertex(const int d)
- : d_(d)
- {
- CGAL_assertion( 0 < d );
- }
-
- explicit Compare_faces_with_common_first_vertex();
-
- bool operator()(const Face & left, const Face & right) const
- {
- CGAL_assertion( d_ == left.face_dimension() );
- CGAL_assertion( d_ == right.face_dimension() );
- for( int i = 1; i <= d_; ++i )
- {
- if( left.vertex(i) < right.vertex(i) )
- return true;
- if( right.vertex(i) < left.vertex(i) )
- return false;
- }
- return false;
- }
-};
-
-template< class T >
-struct Compare_vertices_for_upper_face
-{
- typedef typename T::Vertex_const_handle VCH;
-
- const T & t_;
-
-public:
-
- Compare_vertices_for_upper_face(const T & t)
- : t_(t)
- {}
-
- explicit Compare_vertices_for_upper_face();
-
- bool operator()(const VCH & left, const VCH & right) const
- {
- if( left == right )
- return false;
- if( t_.is_infinite(left) )
- return true;
- if( t_.is_infinite(right) )
- return false;
- return left < right;
- }
-};
-
-template< class T >
-struct Compare_points_for_perturbation
-{
- typedef typename T::Geom_traits::Point_d Point;
-
- const T & t_;
-
-public:
-
- Compare_points_for_perturbation(const T & t)
- : t_(t)
- {}
-
- explicit Compare_points_for_perturbation();
-
- bool operator()(const Point * left, const Point * right) const
- {
- return (SMALLER == t_.geom_traits().compare_lexicographically_d_object()(*left, *right));
- }
-};
-
-template< class T >
-struct Point_from_pointer
-{
- typedef const typename T::Geom_traits::Point_d * argument_type;
- typedef const typename T::Geom_traits::Point_d result_type;
- result_type & operator()(argument_type & x) const
- {
- return (*x);
- }
- const result_type & operator()(const argument_type & x) const
- {
- return (*x);
- }
-};
-
-template< typename Vertex_handle, typename Point >
-struct Point_from_vertex_handle
-{
- typedef Vertex_handle argument_type;
- typedef Point result_type;
- result_type & operator()(argument_type & x) const
- {
- return x->point();
- }
- const result_type & operator()(const argument_type & x) const
- {
- return x->point();
- }
-};
-
-} // namespace Triangulation
-} // namespace internal
-
-} //namespace CGAL
-
-#endif // CGAL_INTERNAL_TRIANGULATION_UTILITIES_H
diff --git a/include/gudhi_patches/CGAL/iterator_from_indices.h b/include/gudhi_patches/CGAL/iterator_from_indices.h
deleted file mode 100644
index 110bb4be..00000000
--- a/include/gudhi_patches/CGAL/iterator_from_indices.h
+++ /dev/null
@@ -1,75 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_ITERATOR_FROM_INDICES_H
-#define CGAL_ITERATOR_FROM_INDICES_H
-#include <CGAL/config.h>
-#include <boost/iterator/iterator_facade.hpp>
-namespace CGAL {
-template <class Ref_>
-struct Default_coordinate_access {
- typedef Ref_ result_type;
- template<class T> Ref_ operator()(T const& t, std::ptrdiff_t i)const{
- return t[i];
- }
-};
-
-//TODO: default type for Value_: typename same_cv<Container_,typename remove_cv<Container_>::type::value_type>::type
-template <class Container_, class Value_, class Ref_=
-#ifdef CGAL_CXX11
- decltype(std::declval<Container_>()[0])
-#else
- Value_&
-#endif
- , class Coord_access = Default_coordinate_access<Ref_>
- >
-class Iterator_from_indices
-: public boost::iterator_facade<Iterator_from_indices<Container_,Value_,Ref_,Coord_access>,
- Value_, std::bidirectional_iterator_tag, Ref_>
-{
- friend class boost::iterator_core_access;
- //FIXME: use int to save space
- //TODO: use a tuple to save space when Coord_access is empty
- typedef std::ptrdiff_t index_t;
- Container_* cont;
- index_t index;
- Coord_access ca;
- void increment(){ ++index; }
- void decrement(){ --index; }
- void advance(std::ptrdiff_t n){ index+=n; }
- ptrdiff_t distance_to(Iterator_from_indices const& other)const{
- return other.index-index;
- }
- bool equal(Iterator_from_indices const& other)const{
- return index==other.index;
- }
- Ref_ dereference()const{
- //FIXME: use the functor properly
- //Uh, and what did I mean by that?
- return ca(*cont,index);
- }
- public:
- Iterator_from_indices(Container_& cont_,std::size_t n)
- : cont(&cont_), index(n) {}
- template<class T>
- Iterator_from_indices(Container_& cont_,std::size_t n,T const&t)
- : cont(&cont_), index(n), ca(t) {}
-};
-}
-#endif // CGAL_ITERATOR_FROM_INDICES_H
diff --git a/include/gudhi_patches/CGAL/transforming_iterator.h b/include/gudhi_patches/CGAL/transforming_iterator.h
deleted file mode 100644
index 15ea19a5..00000000
--- a/include/gudhi_patches/CGAL/transforming_iterator.h
+++ /dev/null
@@ -1,123 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_TRANSFORMING_ITERATOR_H
-#define CGAL_TRANSFORMING_ITERATOR_H
-#include <boost/iterator/iterator_adaptor.hpp>
-#include <boost/utility/result_of.hpp>
-#include <boost/type_traits/is_empty.hpp>
-#include <boost/type_traits/is_reference.hpp>
-#include <boost/type_traits/is_integral.hpp>
-#include <boost/mpl/if.hpp>
-#include <boost/mpl/or.hpp>
-#include <CGAL/Default.h>
-#include <utility>
-
-// Inspired by the boost version, but more compact and
-// without any iterator_category games.
-
-namespace CGAL {
-namespace internal {
-
-// non-empty case
-template<class T,bool=boost::is_empty<T>::value> struct Functor_as_base {
- Functor_as_base(){}
- Functor_as_base(T const& t):f(t){}
- //template<class T2> Functor_as_base(Functor_as_base<T2> const&g):f(g.functor()){}
- T const& functor()const{return f;}
- T & functor() {return f;}
- private:
- T f;
-};
-
-// empty case
-template<class T> struct Functor_as_base<T,true> : public T {
- Functor_as_base(){}
- Functor_as_base(T const& t):T(t){}
- //template<class T2> Functor_as_base(Functor_as_base<T2> const&g):T(g.functor()){}
- T const& functor()const{return *this;}
- T & functor() {return *this;}
-};
-
-template <typename Derived, typename F, typename Iter, typename Ref, typename Val>
-class transforming_iterator_helper
-{
- typedef std::iterator_traits<Iter> Iter_traits;
- typedef typename Iter_traits::reference Iter_ref;
- typedef typename Default::Get<Ref,
-#ifdef CGAL_CXX11
- decltype(std::declval<F>()(std::declval<Iter_ref>()))
-#else
- typename boost::result_of<F(typename Iter_traits::value_type)>::type
- // should be reference instead of value_type
-#endif
- >::type reference_;
-
- typedef typename Default::Get<Val,typename boost::remove_cv<typename boost::remove_reference<reference_>::type>::type>::type value_type;
-
- // Crappy heuristic. If we have *it that returns a Weighted_point and F that returns a reference to the Point contained in the Weighted_point it takes as argument, we do NOT want the transformed iterator to return a reference to the temporary *it. On the other hand, if *it returns an int n, and F returns a reference to array[n] it is not so good to lose the reference. This probably should be done elsewhere and should at least be made optional...
- typedef typename boost::mpl::if_<
- boost::mpl::or_<boost::is_reference<Iter_ref>,
- boost::is_integral<Iter_ref> >,
- reference_, value_type>::type reference;
-
- public:
- typedef boost::iterator_adaptor<
- Derived,
- Iter,
- value_type,
- typename Iter_traits::iterator_category,
- reference
- > type;
-};
-}
-
-template <typename F, typename Iter, typename Ref=Default, typename Val=Default>
-class transforming_iterator
-: public internal::transforming_iterator_helper<transforming_iterator<F,Iter,Ref,Val>,F,Iter,Ref,Val>::type,
-private internal::Functor_as_base<F>
-{
- friend class boost::iterator_core_access;
- typedef typename internal::transforming_iterator_helper<transforming_iterator,F,Iter,Ref,Val>::type Base;
- typedef internal::Functor_as_base<F> Functor_base;
- typename Base::reference dereference()const{
- return functor()(*this->base_reference());
- }
- public:
- using Functor_base::functor;
- transforming_iterator(){}
- explicit transforming_iterator(Iter i,F const& f=F())
- :Base(i),Functor_base(f){}
- template<class F2,class I2,class R2,class V2>
- transforming_iterator(
- transforming_iterator<F2,I2,R2,V2> const&i,
- typename boost::enable_if_convertible<I2, Iter>::type* = 0,
- typename boost::enable_if_convertible<F2, F>::type* = 0)
- : Base(i.base()),Functor_base(i.functor()) {}
-
-};
-
-template <typename F, typename Iter> inline
-transforming_iterator<F,Iter> make_transforming_iterator(Iter i, F const&f=F()) {
- return transforming_iterator<F,Iter>(i,f);
-}
-
-}
-
-#endif // CGAL_TRANSFORMING_ITERATOR_H
diff --git a/include/gudhi_patches/CGAL/transforming_pair_iterator.h b/include/gudhi_patches/CGAL/transforming_pair_iterator.h
deleted file mode 100644
index 48dac132..00000000
--- a/include/gudhi_patches/CGAL/transforming_pair_iterator.h
+++ /dev/null
@@ -1,127 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_TRANSFORMING_PAIR_ITERATOR_H
-#define CGAL_TRANSFORMING_PAIR_ITERATOR_H
-// Should be a combination of transform_iterator and zip_iterator,
-// but boost's iterator_category games are a pain.
-
-#include <CGAL/transforming_iterator.h>
-#include <CGAL/assertions.h>
-#include <boost/type_traits/is_convertible.hpp>
-
-
-
-
-namespace CGAL {
-namespace internal {
-template <class Cat1, class Cat2, bool=boost::is_convertible<Cat1,Cat2>::value>
-struct Min_category {
- CGAL_static_assertion((boost::is_convertible<Cat2,Cat1>::value));
- typedef Cat1 type;
-};
-
-template <class Cat1, class Cat2>
-struct Min_category<Cat1,Cat2,true> {
- typedef Cat2 type;
-};
-
-
-template <typename Derived, typename F, typename It1, typename It2, typename Ref, typename Val>
-class transforming_pair_iterator_helper
-{
- typedef typename Min_category<
- typename std::iterator_traits<It1>::iterator_category,
- typename std::iterator_traits<It1>::iterator_category>
- ::type iterator_category;
-
- typedef typename Default::Get<Ref,
-#ifdef CGAL_CXX11
- decltype(std::declval<F>()(std::declval<typename std::iterator_traits<It1>::reference>(),std::declval<typename std::iterator_traits<It2>::reference>()))
-#else
- typename boost::result_of<F(typename std::iterator_traits<It1>::value_type,typename std::iterator_traits<It2>::value_type)>::type
- // should be reference instead of value_type
-#endif
- >::type reference;
-
- typedef typename Default::Get<Val,typename boost::remove_cv<typename boost::remove_reference<reference>::type>::type>::type value_type;
-
- public:
- typedef boost::iterator_facade<
- Derived,
- value_type,
- iterator_category,
- reference
- // expect ptrdiff_t is good enough for difference
- > type;
-};
-}
-
-template <typename F, typename It1, typename It2, typename Ref=Default, typename Val=Default>
-class transforming_pair_iterator
-: public internal::transforming_pair_iterator_helper<transforming_pair_iterator<F,It1,It2,Ref,Val>,F,It1,It2,Ref,Val>::type,
-private internal::Functor_as_base<F>
-{
- It1 iter1; It2 iter2;
- friend class boost::iterator_core_access;
- typedef typename internal::transforming_pair_iterator_helper<transforming_pair_iterator,F,It1,It2,Ref,Val>::type Base;
- typedef internal::Functor_as_base<F> Functor_base;
- typename Base::reference dereference()const{
- return functor()(*iter1,*iter2);
- }
- bool equal(transforming_pair_iterator const&i)const{
- bool b=(iter1==i.iter1);
- CGAL_assertion(b==(iter2==i.iter2));
- //FIXME: or do we want only one driving iterator
- return b;
- }
- void increment(){ ++iter1; ++iter2; }
- void decrement(){ --iter1; --iter2; }
- void advance(std::ptrdiff_t n){
- std::advance(iter1,n);
- std::advance(iter2,n);
- }
- std::ptrdiff_t distance_to(transforming_pair_iterator const&i)const{
- std::ptrdiff_t dist=std::distance(iter1,i.iter1);
- CGAL_assertion(dist==std::distance(iter2,i.iter2));
- return dist;
- }
- public:
- using Functor_base::functor;
- transforming_pair_iterator(){}
- explicit transforming_pair_iterator(It1 i1,It2 i2,F const& f=F())
- :Functor_base(f),iter1(i1),iter2(i2){}
- template<class F2,class J1,class J2,class R2,class V2>
- transforming_pair_iterator(
- transforming_pair_iterator<F2,J1,J2,R2,V2> const&i,
- typename boost::enable_if_convertible<J1, It1>::type* = 0,
- typename boost::enable_if_convertible<J2, It2>::type* = 0,
- typename boost::enable_if_convertible<F2, F>::type* = 0)
- : Functor_base(i.functor()),iter1(i.iter1),iter2(i.iter2) {}
-
-};
-
-template <typename F, typename It1, typename It2> inline
-transforming_pair_iterator<F,It1,It2> make_transforming_pair_iterator(It1 i1, It2 i2, F const&f=F()) {
- return transforming_pair_iterator<F,It1,It2>(i1,i2,f);
-}
-
-}
-
-#endif // CGAL_TRANSFORMING_PAIR_ITERATOR_H
diff --git a/include/gudhi_patches/CGAL/typeset.h b/include/gudhi_patches/CGAL/typeset.h
deleted file mode 100644
index d4e24281..00000000
--- a/include/gudhi_patches/CGAL/typeset.h
+++ /dev/null
@@ -1,117 +0,0 @@
-// Copyright (c) 2014
-// INRIA Saclay-Ile de France (France)
-//
-// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public License as
-// published by the Free Software Foundation; either version 3 of the License,
-// or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL$
-// $Id$
-//
-// Author(s) : Marc Glisse
-
-#ifndef CGAL_TYPESET_H
-#define CGAL_TYPESET_H
-#include <CGAL/config.h>
-#ifdef CGAL_CXX11
-#include <type_traits>
-#else
-#include <boost/type_traits.hpp>
-#endif
-
-// Sometimes using tuple just to list types is overkill (takes forever to
-// instantiate).
-
-namespace CGAL {
-#ifdef CGAL_CXX11
- template<class...> struct typeset;
- template<class H,class...U> struct typeset<H,U...> {
- typedef H head;
- typedef typeset<U...> tail;
- typedef typeset type;
- template<class X> using contains = typename
- std::conditional<
- std::is_same<H,X>::value,
- std::true_type,
- typename tail::template contains<X>
- >::type;
- template<class X> using add = typename
- std::conditional<
- contains<X>::value,
- typeset<H,U...>,
- typeset<H,U...,X>
- >::type;
- };
- template<> struct typeset<> {
- typedef typeset type;
- template<class X> using contains = std::false_type;
- template<class X> using add = typeset<X>;
- };
-#else
- template<class,class> struct typeset;
- template<class H=void, class T=typename
- boost::mpl::if_<boost::is_same<H,void>, void, typeset<void, void> >::type >
- struct typeset {
- typedef typeset type;
- typedef H head;
- typedef T tail;
- template<class X> struct contains :
- boost::mpl::if_<boost::is_same<H,X>,boost::true_type,typename tail::template contains<X> >::type
- {};
- template<class X,class=void> struct add;
- //boost::mpl::if_<boost::is_same<H,X>,typeset,typeset<X,typeset> >::type
- };
- template<> struct typeset<> {
- typedef typeset type;
- template<class X> struct contains : boost::false_type {};
- template<class X> struct add : CGAL::typeset<X> {};
- };
-
- template<class H,class T>
- template<class X,class>
- struct typeset<H,T>::add : typeset<H,typename T::template add<X>::type> {};
- template<class H,class T>
- template<class V>
- struct typeset<H,T>::add<H,V> : typeset<H,T> {};
-#endif
-
- template<class T1, class T2> struct typeset_union_ :
- typeset_union_<typename T1::template add<typename T2::head>::type, typename T2::tail>
- {};
- template<class T> struct typeset_union_ <T, typeset<> > : T {};
-
- template<class T1, class T2>
- struct typeset_intersection_ {
- typedef typename T1::head H;
- typedef typename typeset_intersection_<typename T1::tail,T2>::type U;
- typedef typename
-#ifdef CGAL_CXX11
- std::conditional<T2::template contains<H>::value,
-#else
- boost::mpl::if_<typename T2::template contains<H>,
-#endif
- typename U::template add<H>::type, U>::type type;
- };
- template<class T>
- struct typeset_intersection_<typeset<>,T> : typeset<> {};
-
-#ifdef CGAL_CXX11
- template<class T1, class T2>
- using typeset_union = typename typeset_union_<T1,T2>::type;
- template<class T1, class T2>
- using typeset_intersection = typename typeset_intersection_<T1,T2>::type;
-#else
- template<class T1, class T2>
- struct typeset_union : typeset_union_<T1,T2>::type {};
- template<class T1, class T2>
- struct typeset_intersection : typeset_intersection_<T1,T2>::type {};
-#endif
-}
-#endif
diff --git a/include/gudhi_patches/Tangential_complex_CGAL_patches.txt b/include/gudhi_patches/Tangential_complex_CGAL_patches.txt
deleted file mode 100644
index 5b9581a0..00000000
--- a/include/gudhi_patches/Tangential_complex_CGAL_patches.txt
+++ /dev/null
@@ -1,82 +0,0 @@
-CGAL/Regular_triangulation_traits_adapter.h
-CGAL/Triangulation_ds_vertex.h
-CGAL/Triangulation_data_structure.h
-CGAL/transforming_pair_iterator.h
-CGAL/NewKernel_d/static_int.h
-CGAL/NewKernel_d/Cartesian_LA_functors.h
-CGAL/NewKernel_d/Cartesian_change_FT.h
-CGAL/NewKernel_d/Wrapper/Vector_d.h
-CGAL/NewKernel_d/Wrapper/Hyperplane_d.h
-CGAL/NewKernel_d/Wrapper/Ref_count_obj.h
-CGAL/NewKernel_d/Wrapper/Cartesian_wrap.h
-CGAL/NewKernel_d/Wrapper/Point_d.h
-CGAL/NewKernel_d/Wrapper/Segment_d.h
-CGAL/NewKernel_d/Wrapper/Weighted_point_d.h
-CGAL/NewKernel_d/Wrapper/Sphere_d.h
-CGAL/NewKernel_d/Cartesian_per_dimension.h
-CGAL/NewKernel_d/Kernel_object_converter.h
-CGAL/NewKernel_d/KernelD_converter.h
-CGAL/NewKernel_d/Vector/sse2.h
-CGAL/NewKernel_d/Vector/avx4.h
-CGAL/NewKernel_d/Vector/determinant_of_vectors_small_dim_internal.h
-CGAL/NewKernel_d/Vector/determinant_of_iterator_to_points_from_points.h
-CGAL/NewKernel_d/Vector/determinant_of_points_from_vectors.h
-CGAL/NewKernel_d/Vector/array.h
-CGAL/NewKernel_d/Vector/determinant_of_iterator_to_points_from_iterator_to_vectors.h
-CGAL/NewKernel_d/Vector/determinant_of_iterator_to_vectors_from_vectors.h
-CGAL/NewKernel_d/Vector/determinant_of_vectors_small_dim.h
-CGAL/NewKernel_d/Vector/vector.h
-CGAL/NewKernel_d/Vector/v2int.h
-CGAL/NewKernel_d/Vector/mix.h
-CGAL/NewKernel_d/Cartesian_static_filters.h
-CGAL/NewKernel_d/Cartesian_LA_base.h
-CGAL/NewKernel_d/Lazy_cartesian.h
-CGAL/NewKernel_d/Coaffine.h
-CGAL/NewKernel_d/store_kernel.h
-CGAL/NewKernel_d/Dimension_base.h
-CGAL/NewKernel_d/Kernel_3_interface.h
-CGAL/NewKernel_d/Cartesian_complete.h
-CGAL/NewKernel_d/Cartesian_base.h
-CGAL/NewKernel_d/Cartesian_filter_K.h
-CGAL/NewKernel_d/functor_tags.h
-CGAL/NewKernel_d/Filtered_predicate2.h
-CGAL/NewKernel_d/functor_properties.h
-CGAL/NewKernel_d/Define_kernel_types.h
-CGAL/NewKernel_d/LA_eigen/LA.h
-CGAL/NewKernel_d/LA_eigen/constructors.h
-CGAL/NewKernel_d/Types/Aff_transformation.h
-CGAL/NewKernel_d/Types/Sphere.h
-CGAL/NewKernel_d/Types/Hyperplane.h
-CGAL/NewKernel_d/Types/Line.h
-CGAL/NewKernel_d/Types/Ray.h
-CGAL/NewKernel_d/Types/Iso_box.h
-CGAL/NewKernel_d/Types/Weighted_point.h
-CGAL/NewKernel_d/Types/Segment.h
-CGAL/NewKernel_d/Kernel_d_interface.h
-CGAL/NewKernel_d/utils.h
-CGAL/NewKernel_d/Kernel_2_interface.h
-CGAL/NewKernel_d/Cartesian_filter_NT.h
-CGAL/NewKernel_d/function_objects_cartesian.h
-CGAL/Convex_hull.h
-CGAL/Triangulation_ds_full_cell.h
-CGAL/Regular_triangulation.h
-CGAL/Epick_d.h
-CGAL/transforming_iterator.h
-CGAL/iterator_from_indices.h
-CGAL/Delaunay_triangulation.h
-CGAL/IO/Triangulation_off_ostream.h
-CGAL/typeset.h
-CGAL/Triangulation_full_cell.h
-CGAL/Triangulation.h
-CGAL/internal/Static_or_dynamic_array.h
-CGAL/internal/Combination_enumerator.h
-CGAL/internal/Triangulation/utilities.h
-CGAL/internal/Triangulation/Triangulation_ds_iterators.h
-CGAL/internal/Triangulation/Dummy_TDS.h
-CGAL/argument_swaps.h
-CGAL/Epeck_d.h
-CGAL/determinant_of_vectors.h
-CGAL/TDS_full_cell_default_storage_policy.h
-CGAL/TDS_full_cell_mirror_storage_policy.h
-CGAL/Triangulation_face.h
-CGAL/Triangulation_vertex.h
diff --git a/utilities/Alpha_complex/CMakeLists.txt b/utilities/Alpha_complex/CMakeLists.txt
index a2dfac20..7ace6064 100644
--- a/utilities/Alpha_complex/CMakeLists.txt
+++ b/utilities/Alpha_complex/CMakeLists.txt
@@ -1,4 +1,3 @@
-cmake_minimum_required(VERSION 2.6)
project(Alpha_complex_utilities)
if(CGAL_FOUND)
diff --git a/utilities/Alpha_complex/alpha_complex_3d_helper.h b/utilities/Alpha_complex/alpha_complex_3d_helper.h
index a59f0654..a72fd96d 100644
--- a/utilities/Alpha_complex/alpha_complex_3d_helper.h
+++ b/utilities/Alpha_complex/alpha_complex_3d_helper.h
@@ -4,7 +4,7 @@
*
* Author(s): Vincent Rouvreau
*
- * Copyright (C) 2014 INRIA Saclay (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/utilities/Alpha_complex/alpha_complex_3d_persistence.cpp b/utilities/Alpha_complex/alpha_complex_3d_persistence.cpp
index 8ef5ffb2..8cda0b70 100644
--- a/utilities/Alpha_complex/alpha_complex_3d_persistence.cpp
+++ b/utilities/Alpha_complex/alpha_complex_3d_persistence.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Vincent Rouvreau
*
- * Copyright (C) 2014 INRIA
+ * Copyright (C) 2014 Inria
*
* 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
@@ -35,6 +35,8 @@
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Delaunay_triangulation_3.h>
#include <CGAL/Alpha_shape_3.h>
+#include <CGAL/Alpha_shape_cell_base_3.h>
+#include <CGAL/Alpha_shape_vertex_base_3.h>
#include <CGAL/iterator.h>
#include <fstream>
diff --git a/utilities/Alpha_complex/alpha_complex_persistence.cpp b/utilities/Alpha_complex/alpha_complex_persistence.cpp
index 2105220a..42390b0e 100644
--- a/utilities/Alpha_complex/alpha_complex_persistence.cpp
+++ b/utilities/Alpha_complex/alpha_complex_persistence.cpp
@@ -1,3 +1,25 @@
+/* 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): Vincent Rouvreau
+ *
+ * Copyright (C) 2016 Inria
+ *
+ * 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/>.
+ */
+
#include <boost/program_options.hpp>
#include <CGAL/Epick_d.h>
diff --git a/utilities/Alpha_complex/alphacomplex.md b/utilities/Alpha_complex/alphacomplex.md
index aace85d3..0fe98837 100644
--- a/utilities/Alpha_complex/alphacomplex.md
+++ b/utilities/Alpha_complex/alphacomplex.md
@@ -1,6 +1,13 @@
-
-
-# Alpha complex #
+---
+layout: page
+title: "Alpha complex"
+meta_title: "Alpha complex"
+teaser: ""
+permalink: /alphacomplex/
+---
+{::comment}
+Leave the lines above as it is required by the web site generator 'Jekyll'
+{:/comment}
## alpha_complex_persistence ##
diff --git a/utilities/Alpha_complex/exact_alpha_complex_3d_persistence.cpp b/utilities/Alpha_complex/exact_alpha_complex_3d_persistence.cpp
index cceac46e..cbe003ff 100644
--- a/utilities/Alpha_complex/exact_alpha_complex_3d_persistence.cpp
+++ b/utilities/Alpha_complex/exact_alpha_complex_3d_persistence.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Vincent Rouvreau
*
- * Copyright (C) 2014 INRIA
+ * Copyright (C) 2014 Inria
*
* 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
@@ -30,6 +30,8 @@
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Delaunay_triangulation_3.h>
#include <CGAL/Alpha_shape_3.h>
+#include <CGAL/Alpha_shape_cell_base_3.h>
+#include <CGAL/Alpha_shape_vertex_base_3.h>
#include <CGAL/iterator.h>
#include <fstream>
diff --git a/utilities/Alpha_complex/periodic_alpha_complex_3d_persistence.cpp b/utilities/Alpha_complex/periodic_alpha_complex_3d_persistence.cpp
index 188cf604..11010701 100644
--- a/utilities/Alpha_complex/periodic_alpha_complex_3d_persistence.cpp
+++ b/utilities/Alpha_complex/periodic_alpha_complex_3d_persistence.cpp
@@ -5,7 +5,7 @@
* Author(s): Vincent Rouvreau
* Pawel Dlotko - 2017 - Swansea University, UK
*
- * Copyright (C) 2014 INRIA
+ * Copyright (C) 2014 Inria
*
* 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
@@ -32,6 +32,8 @@
#include <CGAL/Periodic_3_Delaunay_triangulation_traits_3.h>
#include <CGAL/Periodic_3_Delaunay_triangulation_3.h>
#include <CGAL/Alpha_shape_3.h>
+#include <CGAL/Alpha_shape_cell_base_3.h>
+#include <CGAL/Alpha_shape_vertex_base_3.h>
#include <CGAL/iterator.h>
#include <fstream>
diff --git a/utilities/Alpha_complex/weighted_alpha_complex_3d_persistence.cpp b/utilities/Alpha_complex/weighted_alpha_complex_3d_persistence.cpp
index 93be8a05..cdeeabfc 100644
--- a/utilities/Alpha_complex/weighted_alpha_complex_3d_persistence.cpp
+++ b/utilities/Alpha_complex/weighted_alpha_complex_3d_persistence.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Vincent Rouvreau
*
- * Copyright (C) 2014 INRIA
+ * Copyright (C) 2014 Inria
*
* 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
@@ -31,6 +31,8 @@
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Regular_triangulation_3.h>
#include <CGAL/Alpha_shape_3.h>
+#include <CGAL/Alpha_shape_cell_base_3.h>
+#include <CGAL/Alpha_shape_vertex_base_3.h>
#include <CGAL/iterator.h>
// For CGAL < 4.11
diff --git a/utilities/Alpha_complex/weighted_periodic_alpha_complex_3d_persistence.cpp b/utilities/Alpha_complex/weighted_periodic_alpha_complex_3d_persistence.cpp
index 5321bb0a..d030c88c 100644
--- a/utilities/Alpha_complex/weighted_periodic_alpha_complex_3d_persistence.cpp
+++ b/utilities/Alpha_complex/weighted_periodic_alpha_complex_3d_persistence.cpp
@@ -5,7 +5,7 @@
* Author(s): Vincent Rouvreau
* Pawel Dlotko - 2017 - Swansea University, UK
*
- * Copyright (C) 2014 INRIA
+ * Copyright (C) 2014 Inria
*
* 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
@@ -31,6 +31,8 @@
#include <CGAL/Periodic_3_regular_triangulation_traits_3.h>
#include <CGAL/Periodic_3_regular_triangulation_3.h>
#include <CGAL/Alpha_shape_3.h>
+#include <CGAL/Alpha_shape_cell_base_3.h>
+#include <CGAL/Alpha_shape_vertex_base_3.h>
#include <CGAL/iterator.h>
#include <fstream>
diff --git a/utilities/Bitmap_cubical_complex/CMakeLists.txt b/utilities/Bitmap_cubical_complex/CMakeLists.txt
index 676a730a..416db67f 100644
--- a/utilities/Bitmap_cubical_complex/CMakeLists.txt
+++ b/utilities/Bitmap_cubical_complex/CMakeLists.txt
@@ -1,4 +1,3 @@
-cmake_minimum_required(VERSION 2.6)
project(Bitmap_cubical_complex_utilities)
add_executable ( cubical_complex_persistence cubical_complex_persistence.cpp )
diff --git a/utilities/Bitmap_cubical_complex/cubical_complex_persistence.cpp b/utilities/Bitmap_cubical_complex/cubical_complex_persistence.cpp
index 9d1bc08c..170aa684 100644
--- a/utilities/Bitmap_cubical_complex/cubical_complex_persistence.cpp
+++ b/utilities/Bitmap_cubical_complex/cubical_complex_persistence.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2015 INRIA Saclay (France)
+ * Copyright (C) 2015 Inria
*
* 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
diff --git a/utilities/Bitmap_cubical_complex/cubicalcomplex.md b/utilities/Bitmap_cubical_complex/cubicalcomplex.md
index 6e1b2578..5b0404c3 100644
--- a/utilities/Bitmap_cubical_complex/cubicalcomplex.md
+++ b/utilities/Bitmap_cubical_complex/cubicalcomplex.md
@@ -1,7 +1,15 @@
+---
+layout: page
+title: "Cubical complex"
+meta_title: "Cubical complex"
+teaser: ""
+permalink: /cubicalcomplex/
+---
+{::comment}
+Leave the lines above as it is required by the web site generator 'Jekyll'
+{:/comment}
-# Cubical complex#
-
## cubical_complex_persistence ##
This program computes persistent homology, by using the Bitmap_cubical_complex class, of cubical complexes provided in text files in Perseus style.
See [here](/doc/latest/fileformats.html#FileFormatsPerseus) for a description of the file format.
diff --git a/utilities/Bitmap_cubical_complex/periodic_cubical_complex_persistence.cpp b/utilities/Bitmap_cubical_complex/periodic_cubical_complex_persistence.cpp
index c812cb3a..e9ba5495 100644
--- a/utilities/Bitmap_cubical_complex/periodic_cubical_complex_persistence.cpp
+++ b/utilities/Bitmap_cubical_complex/periodic_cubical_complex_persistence.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2015 INRIA Saclay (France)
+ * Copyright (C) 2015 Inria
*
* 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
diff --git a/utilities/Bottleneck_distance/CMakeLists.txt b/utilities/Bottleneck_distance/CMakeLists.txt
index d19e3b1c..2f35885c 100644
--- a/utilities/Bottleneck_distance/CMakeLists.txt
+++ b/utilities/Bottleneck_distance/CMakeLists.txt
@@ -1,4 +1,3 @@
-cmake_minimum_required(VERSION 2.6)
project(Bottleneck_distance_utilities)
if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1)
diff --git a/utilities/Bottleneck_distance/bottleneck_distance.cpp b/utilities/Bottleneck_distance/bottleneck_distance.cpp
index 9dd52b31..8f724f95 100644
--- a/utilities/Bottleneck_distance/bottleneck_distance.cpp
+++ b/utilities/Bottleneck_distance/bottleneck_distance.cpp
@@ -4,7 +4,7 @@
*
* Authors: Francois Godi, small modifications by Pawel Dlotko
*
- * Copyright (C) 2015 INRIA
+ * Copyright (C) 2015 Inria
*
* 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
diff --git a/utilities/Bottleneck_distance/bottleneckdistance.md b/utilities/Bottleneck_distance/bottleneckdistance.md
index 526f5822..939eb911 100644
--- a/utilities/Bottleneck_distance/bottleneckdistance.md
+++ b/utilities/Bottleneck_distance/bottleneckdistance.md
@@ -1,7 +1,15 @@
+---
+layout: page
+title: "Bottleneck distance"
+meta_title: "Bottleneck distance"
+teaser: ""
+permalink: /bottleneckdistance/
+---
+{::comment}
+Leave the lines above as it is required by the web site generator 'Jekyll'
+{:/comment}
-# Bottleneck distance #
-
## bottleneck_read_file_example ##
This program computes the Bottleneck distance between two persistence diagram files.
diff --git a/utilities/Cech_complex/CMakeLists.txt b/utilities/Cech_complex/CMakeLists.txt
new file mode 100644
index 00000000..30b99729
--- /dev/null
+++ b/utilities/Cech_complex/CMakeLists.txt
@@ -0,0 +1,14 @@
+cmake_minimum_required(VERSION 2.6)
+project(Cech_complex_utilities)
+
+add_executable(cech_persistence cech_persistence.cpp)
+target_link_libraries(cech_persistence ${Boost_PROGRAM_OPTIONS_LIBRARY})
+
+if (TBB_FOUND)
+ target_link_libraries(cech_persistence ${TBB_LIBRARIES})
+endif()
+
+add_test(NAME Cech_complex_utility_from_rips_on_tore_3D COMMAND $<TARGET_FILE:cech_persistence>
+ "${CMAKE_SOURCE_DIR}/data/points/tore3D_300.off" "-r" "0.25" "-m" "0.5" "-d" "3" "-p" "3")
+
+install(TARGETS cech_persistence DESTINATION bin)
diff --git a/utilities/Cech_complex/cech_persistence.cpp b/utilities/Cech_complex/cech_persistence.cpp
new file mode 100644
index 00000000..abd9dbcd
--- /dev/null
+++ b/utilities/Cech_complex/cech_persistence.cpp
@@ -0,0 +1,136 @@
+/* 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): Vincent Rouvreau
+ *
+ * Copyright (C) 2018 Inria
+ *
+ * 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/>.
+ */
+
+#include <gudhi/Cech_complex.h>
+#include <gudhi/distance_functions.h>
+#include <gudhi/Simplex_tree.h>
+#include <gudhi/Persistent_cohomology.h>
+#include <gudhi/Points_off_io.h>
+
+#include <boost/program_options.hpp>
+
+#include <string>
+#include <vector>
+#include <limits> // infinity
+
+// Types definition
+using Simplex_tree = Gudhi::Simplex_tree<Gudhi::Simplex_tree_options_fast_persistence>;
+using Filtration_value = Simplex_tree::Filtration_value;
+using Point = std::vector<double>;
+using Point_cloud = std::vector<Point>;
+using Points_off_reader = Gudhi::Points_off_reader<Point>;
+using Cech_complex = Gudhi::cech_complex::Cech_complex<Simplex_tree, Point_cloud>;
+using Field_Zp = Gudhi::persistent_cohomology::Field_Zp;
+using Persistent_cohomology = Gudhi::persistent_cohomology::Persistent_cohomology<Simplex_tree, Field_Zp>;
+
+void program_options(int argc, char* argv[], std::string& off_file_points, std::string& filediag,
+ Filtration_value& max_radius, 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 max_radius;
+ int dim_max;
+ int p;
+ Filtration_value min_persistence;
+
+ program_options(argc, argv, off_file_points, filediag, max_radius, dim_max, p, min_persistence);
+
+ Points_off_reader off_reader(off_file_points);
+ Cech_complex cech_complex_from_file(off_reader.get_point_cloud(), max_radius);
+
+ // Construct the Cech complex in a Simplex Tree
+ Simplex_tree simplex_tree;
+
+ cech_complex_from_file.create_complex(simplex_tree, dim_max);
+ std::cout << "The complex contains " << simplex_tree.num_simplices() << " simplices \n";
+ std::cout << " and has dimension " << simplex_tree.dimension() << " \n";
+
+ // Sort the simplices in the order of the filtration
+ simplex_tree.initialize_filtration();
+
+ // Compute the persistence diagram of the complex
+ Persistent_cohomology pcoh(simplex_tree);
+ // initializes the coefficient field for homology
+ pcoh.init_coefficients(p);
+
+ pcoh.compute_persistent_cohomology(min_persistence);
+
+ // Output the diagram in filediag
+ if (filediag.empty()) {
+ pcoh.output_diagram();
+ } else {
+ std::ofstream out(filediag);
+ pcoh.output_diagram(out);
+ out.close();
+ }
+
+ return 0;
+}
+
+void program_options(int argc, char* argv[], std::string& off_file_points, std::string& filediag,
+ Filtration_value& max_radius, int& dim_max, int& p, Filtration_value& min_persistence) {
+ namespace po = boost::program_options;
+ po::options_description hidden("Hidden options");
+ hidden.add_options()("input-file", po::value<std::string>(&off_file_points),
+ "Name of an OFF file containing a point set.\n");
+
+ po::options_description visible("Allowed options", 100);
+ 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-radius,r",
+ po::value<Filtration_value>(&max_radius)->default_value(std::numeric_limits<Filtration_value>::infinity()),
+ "Maximal length of an edge for the Cech complex construction.")(
+ "cpx-dimension,d", po::value<int>(&dim_max)->default_value(1),
+ "Maximal dimension of the Cech complex we want to compute.")(
+ "field-charac,p", po::value<int>(&p)->default_value(11),
+ "Characteristic p of the coefficient field Z/pZ for computing homology.")(
+ "min-persistence,m", po::value<Filtration_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 a Cech 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/utilities/Cech_complex/cechcomplex.md b/utilities/Cech_complex/cechcomplex.md
new file mode 100644
index 00000000..f7817dbb
--- /dev/null
+++ b/utilities/Cech_complex/cechcomplex.md
@@ -0,0 +1,38 @@
+
+
+# Čech complex #
+
+## cech_persistence ##
+This program computes the persistent homology with coefficient field *Z/pZ* of
+a Čech complex defined on a set of input points, using Euclidean distance. The
+output diagram contains one bar per line, written with the convention:
+
+`p dim birth death`
+
+where `dim` is the dimension of the homological feature, `birth` and `death`
+are respectively the birth and death of the feature, and `p` is the
+characteristic of the field *Z/pZ* used for homology coefficients (`p` must be
+a prime number).
+
+**Usage**
+
+`cech_persistence [options] <OFF input file>`
+
+**Allowed options**
+
+* `-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 Čech complex construction.
+* `-d [ --cpx-dimension ]` (default = 1) Maximal dimension of the Čech complex we want to compute.
+* `-p [ --field-charac ]` (default = 11) Characteristic p of the coefficient field Z/pZ for computing homology.
+* `-m [ --min-persistence ]` (default = 0) Minimal lifetime of homology feature to be recorded. Enter a negative value to see zero length intervals.
+
+Beware: this program may use a lot of RAM and take a lot of time if `max-edge-length` is set to a large value.
+
+**Example 1 with Z/2Z coefficients**
+
+`cech_persistence ../../data/points/tore3D_1307.off -r 0.25 -m 0.5 -d 3 -p 2`
+
+**Example 2 with Z/3Z coefficients**
+
+`cech_persistence ../../data/points/tore3D_1307.off -r 0.25 -m 0.5 -d 3 -p 3`
diff --git a/utilities/Nerve_GIC/CMakeLists.txt b/utilities/Nerve_GIC/CMakeLists.txt
index 7762c8a0..215f9dfd 100644
--- a/utilities/Nerve_GIC/CMakeLists.txt
+++ b/utilities/Nerve_GIC/CMakeLists.txt
@@ -1,4 +1,3 @@
-cmake_minimum_required(VERSION 2.6)
project(Nerve_GIC_examples)
if (NOT CGAL_VERSION VERSION_LESS 4.8.1)
@@ -21,4 +20,8 @@ if (NOT CGAL_VERSION VERSION_LESS 4.8.1)
add_test(NAME Nerve_GIC_utilities_VoronoiGIC COMMAND $<TARGET_FILE:VoronoiGIC>
"human.off" "100")
+ install(TARGETS Nerve DESTINATION bin)
+ install(TARGETS VoronoiGIC DESTINATION bin)
+ install(FILES KeplerMapperVisuFromTxtFile.py km.py km.py.COPYRIGHT DESTINATION bin)
+
endif (NOT CGAL_VERSION VERSION_LESS 4.8.1)
diff --git a/utilities/Nerve_GIC/KeplerMapperVisuFromTxtFile.py b/utilities/Nerve_GIC/KeplerMapperVisuFromTxtFile.py
index c811f610..701e7a52 100755
--- a/utilities/Nerve_GIC/KeplerMapperVisuFromTxtFile.py
+++ b/utilities/Nerve_GIC/KeplerMapperVisuFromTxtFile.py
@@ -11,7 +11,7 @@ import argparse
Author(s): Mathieu Carriere
- Copyright (C) 2017 INRIA
+ Copyright (C) 2017 Inria
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
@@ -28,7 +28,7 @@ import argparse
"""
__author__ = "Mathieu Carriere"
-__copyright__ = "Copyright (C) 2017 INRIA"
+__copyright__ = "Copyright (C) 2017 Inria"
__license__ = "GPL v3"
parser = argparse.ArgumentParser(description='Creates an html Keppler Mapper '
diff --git a/utilities/Nerve_GIC/Nerve.cpp b/utilities/Nerve_GIC/Nerve.cpp
index aefc3874..667129e0 100644
--- a/utilities/Nerve_GIC/Nerve.cpp
+++ b/utilities/Nerve_GIC/Nerve.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Mathieu Carrière
*
- * Copyright (C) 2017 INRIA
+ * Copyright (C) 2017 Inria
*
* 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
diff --git a/utilities/Nerve_GIC/VoronoiGIC.cpp b/utilities/Nerve_GIC/VoronoiGIC.cpp
index 54bb871e..33deca40 100644
--- a/utilities/Nerve_GIC/VoronoiGIC.cpp
+++ b/utilities/Nerve_GIC/VoronoiGIC.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Mathieu Carrière
*
- * Copyright (C) 2017 INRIA
+ * Copyright (C) 2017 Inria
*
* 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
diff --git a/utilities/Nerve_GIC/covercomplex.md b/utilities/Nerve_GIC/covercomplex.md
index f33cb2e0..683c1b75 100644
--- a/utilities/Nerve_GIC/covercomplex.md
+++ b/utilities/Nerve_GIC/covercomplex.md
@@ -1,6 +1,13 @@
-
-
-# Cover complex #
+---
+layout: page
+title: "Cover complex"
+meta_title: "Cover complex"
+teaser: ""
+permalink: /covercomplex/
+---
+{::comment}
+Leave the lines above as it is required by the web site generator 'Jekyll'
+{:/comment}
## Nerve ##
diff --git a/utilities/Persistence_representations/CMakeLists.txt b/utilities/Persistence_representations/CMakeLists.txt
index 137eb0c1..fc51b1d6 100644
--- a/utilities/Persistence_representations/CMakeLists.txt
+++ b/utilities/Persistence_representations/CMakeLists.txt
@@ -10,6 +10,8 @@ function(add_persistence_representation_creation_utility creation_utility)
add_test(NAME Persistence_representation_utilities_${creation_utility} COMMAND $<TARGET_FILE:${creation_utility}>
${ARGN} "${CMAKE_CURRENT_BINARY_DIR}/../first.pers"
"${CMAKE_CURRENT_BINARY_DIR}/../second.pers")
+
+ install(TARGETS ${creation_utility} DESTINATION bin)
endfunction(add_persistence_representation_creation_utility)
function(add_persistence_representation_plot_utility plot_utility tool_extension)
@@ -26,6 +28,8 @@ function(add_persistence_representation_plot_utility plot_utility tool_extension
#add_test(NAME Persistence_representation_utilities_${plot_utility}_second_gnuplot COMMAND ${GNUPLOT_PATH}
# "-e" "load '${CMAKE_CURRENT_BINARY_DIR}/../second.pers${tool_extension}_GnuplotScript'")
endif()
+
+ install(TARGETS ${plot_utility} DESTINATION bin)
endfunction(add_persistence_representation_plot_utility)
function(add_persistence_representation_function_utility function_utility tool_extension)
@@ -44,6 +48,8 @@ function(add_persistence_representation_function_utility function_utility tool_e
"${CMAKE_CURRENT_BINARY_DIR}/../first.pers${tool_extension}"
"${CMAKE_CURRENT_BINARY_DIR}/../second.pers${tool_extension}")
endif()
+
+ install(TARGETS ${function_utility} DESTINATION bin)
endfunction(add_persistence_representation_function_utility)
add_subdirectory(persistence_heat_maps)
diff --git a/utilities/Persistence_representations/persistence_heat_maps/CMakeLists.txt b/utilities/Persistence_representations/persistence_heat_maps/CMakeLists.txt
index 386e9fa5..89ef232f 100644
--- a/utilities/Persistence_representations/persistence_heat_maps/CMakeLists.txt
+++ b/utilities/Persistence_representations/persistence_heat_maps/CMakeLists.txt
@@ -1,4 +1,3 @@
-cmake_minimum_required(VERSION 2.6)
project(Persistence_representations_heat_maps_utilities)
add_persistence_representation_creation_utility(create_pssk "10" "-1" "-1" "4" "-1")
diff --git a/utilities/Persistence_representations/persistence_heat_maps/average_persistence_heat_maps.cpp b/utilities/Persistence_representations/persistence_heat_maps/average_persistence_heat_maps.cpp
index 6739e0b6..2cbd812b 100644
--- a/utilities/Persistence_representations/persistence_heat_maps/average_persistence_heat_maps.cpp
+++ b/utilities/Persistence_representations/persistence_heat_maps/average_persistence_heat_maps.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_heat_maps/compute_distance_of_persistence_heat_maps.cpp b/utilities/Persistence_representations/persistence_heat_maps/compute_distance_of_persistence_heat_maps.cpp
index ed8278a2..14d0db8f 100644
--- a/utilities/Persistence_representations/persistence_heat_maps/compute_distance_of_persistence_heat_maps.cpp
+++ b/utilities/Persistence_representations/persistence_heat_maps/compute_distance_of_persistence_heat_maps.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_heat_maps/compute_scalar_product_of_persistence_heat_maps.cpp b/utilities/Persistence_representations/persistence_heat_maps/compute_scalar_product_of_persistence_heat_maps.cpp
index 63626853..12fceedc 100644
--- a/utilities/Persistence_representations/persistence_heat_maps/compute_scalar_product_of_persistence_heat_maps.cpp
+++ b/utilities/Persistence_representations/persistence_heat_maps/compute_scalar_product_of_persistence_heat_maps.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_heat_maps/create_p_h_m_weighted_by_arctan_of_their_persistence.cpp b/utilities/Persistence_representations/persistence_heat_maps/create_p_h_m_weighted_by_arctan_of_their_persistence.cpp
index b4a1daa5..21c553b9 100644
--- a/utilities/Persistence_representations/persistence_heat_maps/create_p_h_m_weighted_by_arctan_of_their_persistence.cpp
+++ b/utilities/Persistence_representations/persistence_heat_maps/create_p_h_m_weighted_by_arctan_of_their_persistence.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
-* Copyright (C) 2016 INRIA (France)
+* Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_heat_maps/create_p_h_m_weighted_by_distance_from_diagonal.cpp b/utilities/Persistence_representations/persistence_heat_maps/create_p_h_m_weighted_by_distance_from_diagonal.cpp
index c50f9ddb..99b0bd17 100644
--- a/utilities/Persistence_representations/persistence_heat_maps/create_p_h_m_weighted_by_distance_from_diagonal.cpp
+++ b/utilities/Persistence_representations/persistence_heat_maps/create_p_h_m_weighted_by_distance_from_diagonal.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_heat_maps/create_p_h_m_weighted_by_squared_diag_distance.cpp b/utilities/Persistence_representations/persistence_heat_maps/create_p_h_m_weighted_by_squared_diag_distance.cpp
index 59ff3c24..a4b6e458 100644
--- a/utilities/Persistence_representations/persistence_heat_maps/create_p_h_m_weighted_by_squared_diag_distance.cpp
+++ b/utilities/Persistence_representations/persistence_heat_maps/create_p_h_m_weighted_by_squared_diag_distance.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_heat_maps/create_persistence_heat_maps.cpp b/utilities/Persistence_representations/persistence_heat_maps/create_persistence_heat_maps.cpp
index 25cd1067..5960a89f 100644
--- a/utilities/Persistence_representations/persistence_heat_maps/create_persistence_heat_maps.cpp
+++ b/utilities/Persistence_representations/persistence_heat_maps/create_persistence_heat_maps.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_heat_maps/create_pssk.cpp b/utilities/Persistence_representations/persistence_heat_maps/create_pssk.cpp
index 97ddb8f0..04f33915 100644
--- a/utilities/Persistence_representations/persistence_heat_maps/create_pssk.cpp
+++ b/utilities/Persistence_representations/persistence_heat_maps/create_pssk.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_heat_maps/plot_persistence_heat_map.cpp b/utilities/Persistence_representations/persistence_heat_maps/plot_persistence_heat_map.cpp
index 63711d83..e4402589 100644
--- a/utilities/Persistence_representations/persistence_heat_maps/plot_persistence_heat_map.cpp
+++ b/utilities/Persistence_representations/persistence_heat_maps/plot_persistence_heat_map.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_intervals/CMakeLists.txt b/utilities/Persistence_representations/persistence_intervals/CMakeLists.txt
index 897e12a3..649b72cb 100644
--- a/utilities/Persistence_representations/persistence_intervals/CMakeLists.txt
+++ b/utilities/Persistence_representations/persistence_intervals/CMakeLists.txt
@@ -1,4 +1,3 @@
-cmake_minimum_required(VERSION 2.6)
project(Persistence_representations_intervals_utilities)
@@ -7,6 +6,8 @@ add_executable ( plot_histogram_of_intervals_lengths plot_histogram_of_intervals
add_test(NAME plot_histogram_of_intervals_lengths COMMAND $<TARGET_FILE:plot_histogram_of_intervals_lengths>
"${CMAKE_CURRENT_BINARY_DIR}/../first.pers" "-1")
+install(TARGETS plot_histogram_of_intervals_lengths DESTINATION bin)
+
add_persistence_representation_plot_utility(plot_persistence_intervals "")
add_persistence_representation_plot_utility(plot_persistence_Betti_numbers "")
@@ -18,6 +19,8 @@ add_test(NAME Persistence_representation_utilities_compute_number_of_dominant_in
COMMAND $<TARGET_FILE:compute_number_of_dominant_intervals>
"${CMAKE_CURRENT_BINARY_DIR}/../first.pers" "-1" "2")
+install(TARGETS compute_number_of_dominant_intervals DESTINATION bin)
+
if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1)
add_executable ( compute_bottleneck_distance compute_bottleneck_distance.cpp )
@@ -29,4 +32,6 @@ if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1)
"-1"
"${CMAKE_CURRENT_BINARY_DIR}/../first.pers"
"${CMAKE_CURRENT_BINARY_DIR}/../second.pers")
+
+ install(TARGETS compute_bottleneck_distance DESTINATION bin)
endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1)
diff --git a/utilities/Persistence_representations/persistence_intervals/compute_birth_death_range_in_persistence_diagram.cpp b/utilities/Persistence_representations/persistence_intervals/compute_birth_death_range_in_persistence_diagram.cpp
index 9102da79..3be3de8f 100644
--- a/utilities/Persistence_representations/persistence_intervals/compute_birth_death_range_in_persistence_diagram.cpp
+++ b/utilities/Persistence_representations/persistence_intervals/compute_birth_death_range_in_persistence_diagram.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_intervals/compute_bottleneck_distance.cpp b/utilities/Persistence_representations/persistence_intervals/compute_bottleneck_distance.cpp
index c8290845..a6953b98 100644
--- a/utilities/Persistence_representations/persistence_intervals/compute_bottleneck_distance.cpp
+++ b/utilities/Persistence_representations/persistence_intervals/compute_bottleneck_distance.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_intervals/compute_number_of_dominant_intervals.cpp b/utilities/Persistence_representations/persistence_intervals/compute_number_of_dominant_intervals.cpp
index b3d126f0..4f052f42 100644
--- a/utilities/Persistence_representations/persistence_intervals/compute_number_of_dominant_intervals.cpp
+++ b/utilities/Persistence_representations/persistence_intervals/compute_number_of_dominant_intervals.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_intervals/plot_histogram_of_intervals_lengths.cpp b/utilities/Persistence_representations/persistence_intervals/plot_histogram_of_intervals_lengths.cpp
index ccb5b645..f283971b 100644
--- a/utilities/Persistence_representations/persistence_intervals/plot_histogram_of_intervals_lengths.cpp
+++ b/utilities/Persistence_representations/persistence_intervals/plot_histogram_of_intervals_lengths.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_intervals/plot_persistence_Betti_numbers.cpp b/utilities/Persistence_representations/persistence_intervals/plot_persistence_Betti_numbers.cpp
index b433c2b3..1cacbcd0 100644
--- a/utilities/Persistence_representations/persistence_intervals/plot_persistence_Betti_numbers.cpp
+++ b/utilities/Persistence_representations/persistence_intervals/plot_persistence_Betti_numbers.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_intervals/plot_persistence_intervals.cpp b/utilities/Persistence_representations/persistence_intervals/plot_persistence_intervals.cpp
index 33387802..f92d5782 100644
--- a/utilities/Persistence_representations/persistence_intervals/plot_persistence_intervals.cpp
+++ b/utilities/Persistence_representations/persistence_intervals/plot_persistence_intervals.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_landscapes/CMakeLists.txt b/utilities/Persistence_representations/persistence_landscapes/CMakeLists.txt
index d7087ed8..6b24d032 100644
--- a/utilities/Persistence_representations/persistence_landscapes/CMakeLists.txt
+++ b/utilities/Persistence_representations/persistence_landscapes/CMakeLists.txt
@@ -1,4 +1,3 @@
-cmake_minimum_required(VERSION 2.6)
project(Persistence_representations_landscapes_utilities)
add_persistence_representation_creation_utility(create_landscapes "-1")
diff --git a/utilities/Persistence_representations/persistence_landscapes/average_landscapes.cpp b/utilities/Persistence_representations/persistence_landscapes/average_landscapes.cpp
index 1a59be8c..4048f508 100644
--- a/utilities/Persistence_representations/persistence_landscapes/average_landscapes.cpp
+++ b/utilities/Persistence_representations/persistence_landscapes/average_landscapes.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_landscapes/compute_distance_of_landscapes.cpp b/utilities/Persistence_representations/persistence_landscapes/compute_distance_of_landscapes.cpp
index 5062f521..253fa273 100644
--- a/utilities/Persistence_representations/persistence_landscapes/compute_distance_of_landscapes.cpp
+++ b/utilities/Persistence_representations/persistence_landscapes/compute_distance_of_landscapes.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_landscapes/compute_scalar_product_of_landscapes.cpp b/utilities/Persistence_representations/persistence_landscapes/compute_scalar_product_of_landscapes.cpp
index 5b5e9fa3..11fe2886 100644
--- a/utilities/Persistence_representations/persistence_landscapes/compute_scalar_product_of_landscapes.cpp
+++ b/utilities/Persistence_representations/persistence_landscapes/compute_scalar_product_of_landscapes.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_landscapes/create_landscapes.cpp b/utilities/Persistence_representations/persistence_landscapes/create_landscapes.cpp
index 6030e994..59aad2f3 100644
--- a/utilities/Persistence_representations/persistence_landscapes/create_landscapes.cpp
+++ b/utilities/Persistence_representations/persistence_landscapes/create_landscapes.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_landscapes/plot_landscapes.cpp b/utilities/Persistence_representations/persistence_landscapes/plot_landscapes.cpp
index c797a7a8..f32a92a1 100644
--- a/utilities/Persistence_representations/persistence_landscapes/plot_landscapes.cpp
+++ b/utilities/Persistence_representations/persistence_landscapes/plot_landscapes.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_landscapes_on_grid/CMakeLists.txt b/utilities/Persistence_representations/persistence_landscapes_on_grid/CMakeLists.txt
index c5ea4bbf..36f3196b 100644
--- a/utilities/Persistence_representations/persistence_landscapes_on_grid/CMakeLists.txt
+++ b/utilities/Persistence_representations/persistence_landscapes_on_grid/CMakeLists.txt
@@ -1,4 +1,3 @@
-cmake_minimum_required(VERSION 2.6)
project(Persistence_representations_lanscapes_on_grid_utilities)
# Need to set grid min and max for further average, distance and scalar_product
diff --git a/utilities/Persistence_representations/persistence_landscapes_on_grid/average_landscapes_on_grid.cpp b/utilities/Persistence_representations/persistence_landscapes_on_grid/average_landscapes_on_grid.cpp
index 0b098d1a..47102087 100644
--- a/utilities/Persistence_representations/persistence_landscapes_on_grid/average_landscapes_on_grid.cpp
+++ b/utilities/Persistence_representations/persistence_landscapes_on_grid/average_landscapes_on_grid.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_landscapes_on_grid/compute_distance_of_landscapes_on_grid.cpp b/utilities/Persistence_representations/persistence_landscapes_on_grid/compute_distance_of_landscapes_on_grid.cpp
index fd0fcd15..6cf2739d 100644
--- a/utilities/Persistence_representations/persistence_landscapes_on_grid/compute_distance_of_landscapes_on_grid.cpp
+++ b/utilities/Persistence_representations/persistence_landscapes_on_grid/compute_distance_of_landscapes_on_grid.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_landscapes_on_grid/compute_scalar_product_of_landscapes_on_grid.cpp b/utilities/Persistence_representations/persistence_landscapes_on_grid/compute_scalar_product_of_landscapes_on_grid.cpp
index 01de3dee..9417be6b 100644
--- a/utilities/Persistence_representations/persistence_landscapes_on_grid/compute_scalar_product_of_landscapes_on_grid.cpp
+++ b/utilities/Persistence_representations/persistence_landscapes_on_grid/compute_scalar_product_of_landscapes_on_grid.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_landscapes_on_grid/create_landscapes_on_grid.cpp b/utilities/Persistence_representations/persistence_landscapes_on_grid/create_landscapes_on_grid.cpp
index 78e8ef57..46e229bc 100644
--- a/utilities/Persistence_representations/persistence_landscapes_on_grid/create_landscapes_on_grid.cpp
+++ b/utilities/Persistence_representations/persistence_landscapes_on_grid/create_landscapes_on_grid.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_landscapes_on_grid/plot_landscapes_on_grid.cpp b/utilities/Persistence_representations/persistence_landscapes_on_grid/plot_landscapes_on_grid.cpp
index dddb3615..39e438d2 100644
--- a/utilities/Persistence_representations/persistence_landscapes_on_grid/plot_landscapes_on_grid.cpp
+++ b/utilities/Persistence_representations/persistence_landscapes_on_grid/plot_landscapes_on_grid.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_vectors/CMakeLists.txt b/utilities/Persistence_representations/persistence_vectors/CMakeLists.txt
index a401c955..bc982094 100644
--- a/utilities/Persistence_representations/persistence_vectors/CMakeLists.txt
+++ b/utilities/Persistence_representations/persistence_vectors/CMakeLists.txt
@@ -1,4 +1,3 @@
-cmake_minimum_required(VERSION 2.6)
project(Persistence_vectors_utilities)
add_persistence_representation_creation_utility(create_persistence_vectors "-1")
diff --git a/utilities/Persistence_representations/persistence_vectors/average_persistence_vectors.cpp b/utilities/Persistence_representations/persistence_vectors/average_persistence_vectors.cpp
index 0144e76f..45199838 100644
--- a/utilities/Persistence_representations/persistence_vectors/average_persistence_vectors.cpp
+++ b/utilities/Persistence_representations/persistence_vectors/average_persistence_vectors.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_vectors/compute_distance_of_persistence_vectors.cpp b/utilities/Persistence_representations/persistence_vectors/compute_distance_of_persistence_vectors.cpp
index 7e66d25e..0db7dbec 100644
--- a/utilities/Persistence_representations/persistence_vectors/compute_distance_of_persistence_vectors.cpp
+++ b/utilities/Persistence_representations/persistence_vectors/compute_distance_of_persistence_vectors.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_vectors/compute_scalar_product_of_persistence_vectors.cpp b/utilities/Persistence_representations/persistence_vectors/compute_scalar_product_of_persistence_vectors.cpp
index 303c6e3e..8e99251b 100644
--- a/utilities/Persistence_representations/persistence_vectors/compute_scalar_product_of_persistence_vectors.cpp
+++ b/utilities/Persistence_representations/persistence_vectors/compute_scalar_product_of_persistence_vectors.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_vectors/create_persistence_vectors.cpp b/utilities/Persistence_representations/persistence_vectors/create_persistence_vectors.cpp
index cc5e5393..364284e5 100644
--- a/utilities/Persistence_representations/persistence_vectors/create_persistence_vectors.cpp
+++ b/utilities/Persistence_representations/persistence_vectors/create_persistence_vectors.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Persistence_representations/persistence_vectors/plot_persistence_vectors.cpp b/utilities/Persistence_representations/persistence_vectors/plot_persistence_vectors.cpp
index aa33107d..550e47c5 100644
--- a/utilities/Persistence_representations/persistence_vectors/plot_persistence_vectors.cpp
+++ b/utilities/Persistence_representations/persistence_vectors/plot_persistence_vectors.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Rips_complex/CMakeLists.txt b/utilities/Rips_complex/CMakeLists.txt
index baa571fa..4b565628 100644
--- a/utilities/Rips_complex/CMakeLists.txt
+++ b/utilities/Rips_complex/CMakeLists.txt
@@ -1,4 +1,3 @@
-cmake_minimum_required(VERSION 2.6)
project(Rips_complex_utilities)
add_executable(rips_distance_matrix_persistence rips_distance_matrix_persistence.cpp)
@@ -7,15 +6,29 @@ target_link_libraries(rips_distance_matrix_persistence ${Boost_PROGRAM_OPTIONS_L
add_executable(rips_persistence rips_persistence.cpp)
target_link_libraries(rips_persistence ${Boost_PROGRAM_OPTIONS_LIBRARY})
+add_executable(rips_correlation_matrix_persistence rips_correlation_matrix_persistence.cpp)
+target_link_libraries(rips_correlation_matrix_persistence ${Boost_SYSTEM_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY})
+
+add_executable(sparse_rips_persistence sparse_rips_persistence.cpp)
+target_link_libraries(sparse_rips_persistence ${Boost_PROGRAM_OPTIONS_LIBRARY})
+
if (TBB_FOUND)
target_link_libraries(rips_distance_matrix_persistence ${TBB_LIBRARIES})
target_link_libraries(rips_persistence ${TBB_LIBRARIES})
+ target_link_libraries(rips_correlation_matrix_persistence ${TBB_LIBRARIES})
+ target_link_libraries(sparse_rips_persistence ${TBB_LIBRARIES})
endif()
add_test(NAME Rips_complex_utility_from_rips_distance_matrix COMMAND $<TARGET_FILE:rips_distance_matrix_persistence>
"${CMAKE_SOURCE_DIR}/data/distance_matrix/full_square_distance_matrix.csv" "-r" "1.0" "-d" "3" "-p" "3" "-m" "0")
add_test(NAME Rips_complex_utility_from_rips_on_tore_3D COMMAND $<TARGET_FILE:rips_persistence>
"${CMAKE_SOURCE_DIR}/data/points/tore3D_1307.off" "-r" "0.25" "-m" "0.5" "-d" "3" "-p" "3")
+add_test(NAME Rips_complex_utility_from_rips_correlation_matrix COMMAND $<TARGET_FILE:rips_correlation_matrix_persistence>
+ "${CMAKE_SOURCE_DIR}/data/correlation_matrix/lower_triangular_correlation_matrix.csv" "-c" "0.3" "-d" "3" "-p" "3" "-m" "0")
+add_test(NAME Sparse_rips_complex_utility_on_tore_3D COMMAND $<TARGET_FILE:sparse_rips_persistence>
+ "${CMAKE_SOURCE_DIR}/data/points/tore3D_300.off" "-e" "0.5" "-m" "0.2" "-d" "3" "-p" "2")
install(TARGETS rips_distance_matrix_persistence DESTINATION bin)
install(TARGETS rips_persistence DESTINATION bin)
+install(TARGETS rips_correlation_matrix_persistence DESTINATION bin)
+install(TARGETS sparse_rips_persistence DESTINATION bin)
diff --git a/utilities/Rips_complex/rips_correlation_matrix_persistence.cpp b/utilities/Rips_complex/rips_correlation_matrix_persistence.cpp
new file mode 100644
index 00000000..c78677d2
--- /dev/null
+++ b/utilities/Rips_complex/rips_correlation_matrix_persistence.cpp
@@ -0,0 +1,171 @@
+/* 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, Vincent Rouvreau
+ *
+ * Copyright (C) 2016 Inria
+ *
+ * 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/>.
+ */
+
+#include <gudhi/Rips_complex.h>
+#include <gudhi/Simplex_tree.h>
+#include <gudhi/Persistent_cohomology.h>
+#include <gudhi/reader_utils.h>
+#include <gudhi/writing_persistence_to_file.h>
+
+#include <boost/program_options.hpp>
+
+#include <string>
+#include <vector>
+#include <limits> // infinity
+#include <algorithm> // for sort
+
+// Types definition
+using Simplex_tree = Gudhi::Simplex_tree<Gudhi::Simplex_tree_options_fast_persistence>;
+using Filtration_value = Simplex_tree::Filtration_value;
+using Rips_complex = Gudhi::rips_complex::Rips_complex<Filtration_value>;
+using Field_Zp = Gudhi::persistent_cohomology::Field_Zp;
+using Persistent_cohomology = Gudhi::persistent_cohomology::Persistent_cohomology<Simplex_tree, Field_Zp>;
+using Correlation_matrix = std::vector<std::vector<Filtration_value>>;
+using intervals_common = Gudhi::Persistence_interval_common<double, int>;
+
+void program_options(int argc, char* argv[], std::string& csv_matrix_file, std::string& filediag,
+ Filtration_value& correlation_min, int& dim_max, int& p, Filtration_value& min_persistence);
+
+int main(int argc, char* argv[]) {
+ std::string csv_matrix_file;
+ std::string filediag;
+ Filtration_value correlation_min;
+ int dim_max;
+ int p;
+ Filtration_value min_persistence;
+
+ program_options(argc, argv, csv_matrix_file, filediag, correlation_min, dim_max, p, min_persistence);
+
+ Correlation_matrix correlations =
+ Gudhi::read_lower_triangular_matrix_from_csv_file<Filtration_value>(csv_matrix_file);
+
+ Filtration_value threshold = 0;
+
+ // Given a correlation matrix M, we compute component-wise M'[i,j] = 1-M[i,j] to get a distance matrix:
+ for (size_t i = 0; i != correlations.size(); ++i) {
+ for (size_t j = 0; j != correlations[i].size(); ++j) {
+ correlations[i][j] = 1 - correlations[i][j];
+ // Here we make sure that the values of corelations lie between -1 and 1.
+ // If not, we throw an exception.
+ if ((correlations[i][j] < -1) || (correlations[i][j] > 1)) {
+ std::cerr << "The input matrix is not a correlation matrix. The program will now terminate. \n";
+ throw "The input matrix is not a correlation matrix. The program will now terminate. \n";
+ }
+ if (correlations[i][j] > threshold) threshold = correlations[i][j];
+ }
+ }
+
+ Rips_complex rips_complex_from_file(correlations, threshold);
+
+ // Construct the Rips complex in a Simplex Tree
+ Simplex_tree simplex_tree;
+
+ rips_complex_from_file.create_complex(simplex_tree, dim_max);
+ std::cout << "The complex contains " << simplex_tree.num_simplices() << " simplices \n";
+ std::cout << " and has dimension " << simplex_tree.dimension() << " \n";
+
+ // Sort the simplices in the order of the filtration
+ simplex_tree.initialize_filtration();
+
+ // Compute the persistence diagram of the complex
+ Persistent_cohomology pcoh(simplex_tree);
+ // initializes the coefficient field for homology
+ pcoh.init_coefficients(p);
+ // compute persistence
+ pcoh.compute_persistent_cohomology(min_persistence);
+
+ // invert the persistence diagram. The reason for this procedure is the following:
+ // The input to the program is a corelation matrix M. When processing it, it is
+ // turned into 1-M and the obtained persistence intervals are in '1-M' units.
+ // Below we reverse every (birth,death) pair into (1-birth, 1-death) pair
+ // so that the input and the output to the program is expressed in the same
+ // units.
+ auto pairs = pcoh.get_persistent_pairs();
+ std::vector<intervals_common> processed_persistence_intervals;
+ processed_persistence_intervals.reserve(pairs.size());
+ for (auto pair : pairs) {
+ double birth = 1 - simplex_tree.filtration(get<0>(pair));
+ double death = 1 - simplex_tree.filtration(get<1>(pair));
+ unsigned dimension = (unsigned)simplex_tree.dimension(get<0>(pair));
+ int field = get<2>(pair);
+ processed_persistence_intervals.push_back(intervals_common(birth, death, dimension, field));
+ }
+
+ // sort the processed intervals:
+ std::sort(processed_persistence_intervals.begin(), processed_persistence_intervals.end());
+
+ // and write them to a file
+ if (filediag.empty()) {
+ write_persistence_intervals_to_stream(processed_persistence_intervals);
+ } else {
+ std::ofstream out(filediag);
+ write_persistence_intervals_to_stream(processed_persistence_intervals, out);
+ }
+ return 0;
+}
+
+void program_options(int argc, char* argv[], std::string& csv_matrix_file, std::string& filediag,
+ Filtration_value& correlation_min, int& dim_max, int& p, Filtration_value& min_persistence) {
+ namespace po = boost::program_options;
+ po::options_description hidden("Hidden options");
+ hidden.add_options()(
+ "input-file", po::value<std::string>(&csv_matrix_file),
+ "Name of file containing a corelation matrix. Can be square or lower triangular matrix. Separator is ';'.");
+ po::options_description visible("Allowed options", 100);
+ 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")(
+ "min-edge-corelation,c", po::value<Filtration_value>(&correlation_min)->default_value(0),
+ "Minimal corelation of an edge for the Rips complex construction.")(
+ "cpx-dimension,d", po::value<int>(&dim_max)->default_value(1),
+ "Maximal dimension of the Rips complex we want to compute.")(
+ "field-charac,p", po::value<int>(&p)->default_value(11),
+ "Characteristic p of the coefficient field Z/pZ for computing homology.")(
+ "min-persistence,m", po::value<Filtration_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 a Rips complex defined on a corelation matrix.\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/utilities/Rips_complex/rips_distance_matrix_persistence.cpp b/utilities/Rips_complex/rips_distance_matrix_persistence.cpp
index ca3c0327..53191ca7 100644
--- a/utilities/Rips_complex/rips_distance_matrix_persistence.cpp
+++ b/utilities/Rips_complex/rips_distance_matrix_persistence.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Pawel Dlotko, Vincent Rouvreau
*
- * Copyright (C) 2016 INRIA
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Rips_complex/rips_persistence.cpp b/utilities/Rips_complex/rips_persistence.cpp
index 8405c014..7cee927e 100644
--- a/utilities/Rips_complex/rips_persistence.cpp
+++ b/utilities/Rips_complex/rips_persistence.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Clément Maria
*
- * Copyright (C) 2014 INRIA
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/utilities/Rips_complex/ripscomplex.md b/utilities/Rips_complex/ripscomplex.md
index 4291fae7..6df49310 100644
--- a/utilities/Rips_complex/ripscomplex.md
+++ b/utilities/Rips_complex/ripscomplex.md
@@ -1,7 +1,15 @@
+---
+layout: page
+title: "Rips complex"
+meta_title: "Rips complex"
+teaser: ""
+permalink: /ripscomplex/
+---
+{::comment}
+Leave the lines above as it is required by the web site generator 'Jekyll'
+{:/comment}
-# Rips complex #
-
## rips_persistence ##
This program computes the persistent homology with coefficient field *Z/pZ* of a Rips complex defined on a set of input points, using Euclidean distance. The output diagram contains one bar per line, written with the convention:
@@ -39,11 +47,63 @@ Same as `rips_persistence` but taking a distance matrix as input.
**Usage**
-`rips_persistence [options] <CSV input file>`
+`rips_distance_matrix_persistence [options] <CSV input file>`
where
`<CSV input file>` is the path to the file containing a distance matrix. Can be square or lower triangular matrix. Separator is ';'.
+The code do not check if it is dealing with a distance matrix. It is the user responsibility to provide a valid input.
+Please refer to data/distance_matrix/lower_triangular_distance_matrix.csv for an example of a file.
**Example**
`rips_distance_matrix_persistence data/distance_matrix/full_square_distance_matrix.csv -r 15 -d 3 -p 3 -m 0`
+
+
+## rips_correlation_matrix_persistence ##
+
+Same as `rips_distance_matrix_persistence` but taking a correlation matrix as input.
+
+**Usage**
+
+`rips_correlation_matrix_persistence [options] <CSV input file>`
+
+where
+`<CSV input file>` is the path to the file containing a correlation matrix. Can be square or lower triangular matrix. Separator is ';'.
+Note that no check is performed if the matrix given as the input is a correlation matrix.
+It is the user responsibility to ensure that this is the case.
+Please refer to data/correlation_matrix/lower_triangular_correlation_matrix.csv for an example of a file.
+
+**Example**
+
+`rips_correlation_matrix_persistence data/distance_matrix/full_square_distance_matrix.csv -r 15 -d 3 -p 3 -m 0`
+
+**Warning**
+
+As persistence diagrams points will be under the diagonal, bottleneck distance and persistence graphical tool will not work
+properly, this is a known issue.
+
+
+## sparse_rips_persistence ##
+This program computes the persistent homology with coefficient field *Z/pZ*
+of a sparse (1+epsilon)-approximation of the Rips complex defined on a set of input Euclidean points. The output diagram contains one bar per line, written with the convention:
+
+`p dim birth death`
+
+where `dim` is the dimension of the homological feature, `birth` and `death` are respectively the birth and death of the feature, and `p` is the characteristic of the field *Z/pZ* used for homology coefficients (`p` must be a prime number).
+
+**Usage**
+
+`sparse_rips_persistence [options] <OFF input file>`
+
+**Allowed options**
+
+* `-h [ --help ]` Produce help message
+* `-o [ --output-file ]` Name of file in which the persistence diagram is written. Default print in standard output.
+* `-e [ --approximation ]` (default = .5) Epsilon, where the sparse Rips complex is a (1+epsilon)-approximation of the Rips complex.
+* `-d [ --cpx-dimension ]` (default = 1) 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.
+* `-m [ --min-persistence ]` (default = 0) Minimal lifetime of homology feature to be recorded. Enter a negative value to see zero length intervals.
+
+**Example with Z/2Z coefficients**
+
+`sparse_rips_persistence ../../data/points/tore3D_1307.off -e .5 -m .2 -d 3 -p 2`
diff --git a/utilities/Rips_complex/sparse_rips_persistence.cpp b/utilities/Rips_complex/sparse_rips_persistence.cpp
new file mode 100644
index 00000000..bcd5c2c5
--- /dev/null
+++ b/utilities/Rips_complex/sparse_rips_persistence.cpp
@@ -0,0 +1,133 @@
+/* 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): Marc Glisse, Clément Maria
+ *
+ * Copyright (C) 2018 Inria
+ *
+ * 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/>.
+ */
+
+#include <gudhi/Sparse_rips_complex.h>
+#include <gudhi/distance_functions.h>
+#include <gudhi/Simplex_tree.h>
+#include <gudhi/Persistent_cohomology.h>
+#include <gudhi/Points_off_io.h>
+
+#include <boost/program_options.hpp>
+
+#include <string>
+#include <vector>
+
+// Types definition
+using Simplex_tree = Gudhi::Simplex_tree<Gudhi::Simplex_tree_options_fast_persistence>;
+using Filtration_value = Simplex_tree::Filtration_value;
+using Sparse_rips = Gudhi::rips_complex::Sparse_rips_complex<Filtration_value>;
+using Field_Zp = Gudhi::persistent_cohomology::Field_Zp;
+using Persistent_cohomology = Gudhi::persistent_cohomology::Persistent_cohomology<Simplex_tree, Field_Zp>;
+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,
+ int& dim_max, int& p, Filtration_value& min_persistence);
+
+int main(int argc, char* argv[]) {
+ std::string off_file_points;
+ std::string filediag;
+ 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);
+
+ Points_off_reader off_reader(off_file_points);
+ Sparse_rips sparse_rips(off_reader.get_point_cloud(), Gudhi::Euclidean_distance(), epsilon);
+
+ // Construct the Rips complex in a Simplex Tree
+ Simplex_tree simplex_tree;
+
+ sparse_rips.create_complex(simplex_tree, dim_max);
+ std::cout << "The complex contains " << simplex_tree.num_simplices() << " simplices \n";
+ std::cout << " and has dimension " << simplex_tree.dimension() << " \n";
+
+ // Sort the simplices in the order of the filtration
+ simplex_tree.initialize_filtration();
+
+ // Compute the persistence diagram of the complex
+ Persistent_cohomology pcoh(simplex_tree);
+ // initializes the coefficient field for homology
+ pcoh.init_coefficients(p);
+
+ pcoh.compute_persistent_cohomology(min_persistence);
+
+ // Output the diagram in filediag
+ if (filediag.empty()) {
+ pcoh.output_diagram();
+ } else {
+ std::ofstream out(filediag);
+ pcoh.output_diagram(out);
+ out.close();
+ }
+
+ return 0;
+}
+
+void program_options(int argc, char* argv[], std::string& off_file_points, std::string& filediag, double& epsilon,
+ int& dim_max, int& p, Filtration_value& min_persistence) {
+ namespace po = boost::program_options;
+ po::options_description hidden("Hidden options");
+ hidden.add_options()("input-file", po::value<std::string>(&off_file_points),
+ "Name of an OFF file containing a point set.\n");
+
+ po::options_description visible("Allowed options", 100);
+ 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")(
+ "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(1),
+ "Maximal dimension of the Rips complex we want to compute.")(
+ "field-charac,p", po::value<int>(&p)->default_value(11),
+ "Characteristic p of the coefficient field Z/pZ for computing homology.")(
+ "min-persistence,m", po::value<Filtration_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 a sparse (1+epsilon)-approximation of the Rips complex \ndefined 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/utilities/Witness_complex/CMakeLists.txt b/utilities/Witness_complex/CMakeLists.txt
index 125a41ff..ce5e29f2 100644
--- a/utilities/Witness_complex/CMakeLists.txt
+++ b/utilities/Witness_complex/CMakeLists.txt
@@ -1,4 +1,3 @@
-cmake_minimum_required(VERSION 2.6)
project(Witness_complex_utilities)
# CGAL and Eigen3 are required for Euclidean version of Witness
diff --git a/utilities/Witness_complex/strong_witness_persistence.cpp b/utilities/Witness_complex/strong_witness_persistence.cpp
index 2fba631b..9d23df74 100644
--- a/utilities/Witness_complex/strong_witness_persistence.cpp
+++ b/utilities/Witness_complex/strong_witness_persistence.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Siargey Kachanovich
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Witness_complex/weak_witness_persistence.cpp b/utilities/Witness_complex/weak_witness_persistence.cpp
index 23fa93aa..1315d2ba 100644
--- a/utilities/Witness_complex/weak_witness_persistence.cpp
+++ b/utilities/Witness_complex/weak_witness_persistence.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Siargey Kachanovich
*
- * Copyright (C) 2016 INRIA (France)
+ * Copyright (C) 2016 Inria
*
* 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
diff --git a/utilities/Witness_complex/witnesscomplex.md b/utilities/Witness_complex/witnesscomplex.md
index 2341759b..da453cce 100644
--- a/utilities/Witness_complex/witnesscomplex.md
+++ b/utilities/Witness_complex/witnesscomplex.md
@@ -1,6 +1,13 @@
-
-
-# Witness complex #
+---
+layout: page
+title: "Witness complex"
+meta_title: "Witness complex"
+teaser: ""
+permalink: /witnesscomplex/
+---
+{::comment}
+Leave the lines above as it is required by the web site generator 'Jekyll'
+{:/comment}
For more details about the witness complex, please read the [user manual of the package](/doc/latest/group__witness__complex.html).
diff --git a/utilities/common/CMakeLists.txt b/utilities/common/CMakeLists.txt
index b3e4b436..7f1d1cd7 100644
--- a/utilities/common/CMakeLists.txt
+++ b/utilities/common/CMakeLists.txt
@@ -1,4 +1,3 @@
-cmake_minimum_required(VERSION 2.6)
project(off_file_from_shape_generator)
if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.6.0)
diff --git a/utilities/common/off_file_from_shape_generator.cpp b/utilities/common/off_file_from_shape_generator.cpp
index afcd558c..5e3da7f7 100644
--- a/utilities/common/off_file_from_shape_generator.cpp
+++ b/utilities/common/off_file_from_shape_generator.cpp
@@ -4,7 +4,7 @@
*
* Author(s): Vincent Rouvreau
*
- * Copyright (C) 2014 INRIA Saclay (France)
+ * Copyright (C) 2014 Inria
*
* 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
diff --git a/utilities/common/pointsetgenerator.md b/utilities/common/pointsetgenerator.md
index 284715d4..c8c819b7 100644
--- a/utilities/common/pointsetgenerator.md
+++ b/utilities/common/pointsetgenerator.md
@@ -1,9 +1,15 @@
+---
+layout: page
+title: "OFF point set generator"
+meta_title: "OFF point set generator"
+teaser: ""
+permalink: /pointsetgenerator/
+---
+{::comment}
+Leave the lines above as it is required by the web site generator 'Jekyll'
+{:/comment}
-# common #
-
-## off_file_from_shape_generator ##
-
Generates a pointset and save it in an OFF file. Command-line is:
```