summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeGUDHIVersion.txt4
-rw-r--r--COPYING674
-rw-r--r--LICENSE21
-rwxr-xr-xdata/points/generator/aurelien_alvarez_surfaces_in_R8.py31
-rwxr-xr-xscripts/check_google_style.sh33
-rwxr-xr-xscripts/concatenate_utils_readme.sh4
-rw-r--r--scripts/cpplint.py6324
-rwxr-xr-xscripts/cpplint_to_cppcheckxml.py66
-rw-r--r--src/Alpha_complex/concept/SimplicialComplexForAlpha.h20
-rw-r--r--src/Alpha_complex/concept/SimplicialComplexForAlpha3d.h14
-rw-r--r--src/Alpha_complex/doc/Intro_alpha_complex.h14
-rw-r--r--src/Alpha_complex/example/CMakeLists.txt4
-rw-r--r--src/Alpha_complex/include/gudhi/Alpha_complex.h14
-rw-r--r--src/Alpha_complex/include/gudhi/Alpha_complex_3d.h14
-rw-r--r--src/Alpha_complex/include/gudhi/Alpha_complex_options.h14
-rw-r--r--src/Alpha_complex/test/Alpha_complex_3d_unit_test.cpp14
-rw-r--r--src/Alpha_complex/test/Alpha_complex_unit_test.cpp14
-rw-r--r--src/Alpha_complex/test/CMakeLists.txt5
-rw-r--r--src/Alpha_complex/test/Periodic_alpha_complex_3d_unit_test.cpp14
-rw-r--r--src/Alpha_complex/test/Weighted_alpha_complex_3d_unit_test.cpp14
-rw-r--r--src/Alpha_complex/test/Weighted_periodic_alpha_complex_3d_unit_test.cpp14
-rw-r--r--src/Alpha_complex/utilities/CMakeLists.txt5
-rw-r--r--src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp14
-rw-r--r--src/Alpha_complex/utilities/alpha_complex_persistence.cpp14
-rw-r--r--src/Bitmap_cubical_complex/doc/Gudhi_Cubical_Complex_doc.h14
-rw-r--r--src/Bitmap_cubical_complex/example/Random_bitmap_cubical_complex.cpp14
-rw-r--r--src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex.h14
-rw-r--r--src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex/counter.h14
-rw-r--r--src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_base.h14
-rw-r--r--src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_periodic_boundary_conditions_base.h14
-rw-r--r--src/Bitmap_cubical_complex/test/Bitmap_test.cpp14
-rw-r--r--src/Bitmap_cubical_complex/utilities/cubical_complex_persistence.cpp14
-rw-r--r--src/Bitmap_cubical_complex/utilities/periodic_cubical_complex_persistence.cpp14
-rw-r--r--src/Bottleneck_distance/benchmark/CMakeLists.txt4
-rw-r--r--src/Bottleneck_distance/benchmark/bottleneck_chrono.cpp14
-rw-r--r--src/Bottleneck_distance/concept/Persistence_diagram.h14
-rw-r--r--src/Bottleneck_distance/doc/Intro_bottleneck_distance.h16
-rw-r--r--src/Bottleneck_distance/example/CMakeLists.txt20
-rw-r--r--src/Bottleneck_distance/example/alpha_rips_persistence_bottleneck_distance.cpp14
-rw-r--r--src/Bottleneck_distance/include/gudhi/Bottleneck.h16
-rw-r--r--src/Bottleneck_distance/include/gudhi/Graph_matching.h14
-rw-r--r--src/Bottleneck_distance/include/gudhi/Internal_point.h14
-rw-r--r--src/Bottleneck_distance/include/gudhi/Neighbors_finder.h14
-rw-r--r--src/Bottleneck_distance/include/gudhi/Persistence_graph.h14
-rw-r--r--src/Bottleneck_distance/test/CMakeLists.txt4
-rw-r--r--src/Bottleneck_distance/test/bottleneck_unit_test.cpp14
-rw-r--r--src/Bottleneck_distance/utilities/CMakeLists.txt4
-rw-r--r--src/Bottleneck_distance/utilities/bottleneck_distance.cpp14
-rw-r--r--src/Cech_complex/benchmark/cech_complex_benchmark.cpp14
-rw-r--r--src/Cech_complex/concept/SimplicialComplexForCech.h20
-rw-r--r--src/Cech_complex/doc/Intro_cech_complex.h14
-rw-r--r--src/Cech_complex/example/cech_complex_step_by_step.cpp14
-rw-r--r--src/Cech_complex/include/gudhi/Cech_complex.h14
-rw-r--r--src/Cech_complex/include/gudhi/Cech_complex_blocker.h14
-rw-r--r--src/Cech_complex/test/test_cech_complex.cpp14
-rw-r--r--src/Cech_complex/utilities/cech_persistence.cpp14
-rw-r--r--src/Contraction/example/CMakeLists.txt22
-rw-r--r--src/Contraction/example/Garland_heckbert.cpp21
-rw-r--r--src/Contraction/example/Garland_heckbert/Error_quadric.h21
-rw-r--r--src/Contraction/example/Rips_contraction.cpp14
-rw-r--r--src/Contraction/include/gudhi/Contraction/CGAL_queue/Modifiable_priority_queue.h101
-rw-r--r--src/Contraction/include/gudhi/Contraction/Edge_profile.h21
-rw-r--r--src/Contraction/include/gudhi/Contraction/policies/Contraction_visitor.h20
-rw-r--r--src/Contraction/include/gudhi/Contraction/policies/Cost_policy.h20
-rw-r--r--src/Contraction/include/gudhi/Contraction/policies/Dummy_valid_contraction.h20
-rw-r--r--src/Contraction/include/gudhi/Contraction/policies/Edge_length_cost.h20
-rw-r--r--src/Contraction/include/gudhi/Contraction/policies/First_vertex_placement.h20
-rw-r--r--src/Contraction/include/gudhi/Contraction/policies/Link_condition_valid_contraction.h20
-rw-r--r--src/Contraction/include/gudhi/Contraction/policies/Middle_placement.h20
-rw-r--r--src/Contraction/include/gudhi/Contraction/policies/Placement_policy.h20
-rw-r--r--src/Contraction/include/gudhi/Contraction/policies/Valid_contraction_policy.h20
-rw-r--r--src/Contraction/include/gudhi/Edge_contraction.h14
-rw-r--r--src/Contraction/include/gudhi/Skeleton_blocker_contractor.h19
-rw-r--r--src/Doxyfile.in3
-rw-r--r--src/GudhUI/CMakeLists.txt4
-rw-r--r--src/GudhUI/gui/MainWindow.cpp14
-rw-r--r--src/GudhUI/gui/MainWindow.h14
-rw-r--r--src/GudhUI/gui/Menu_edge_contraction.cpp14
-rw-r--r--src/GudhUI/gui/Menu_edge_contraction.h14
-rw-r--r--src/GudhUI/gui/Menu_k_nearest_neighbors.cpp14
-rw-r--r--src/GudhUI/gui/Menu_k_nearest_neighbors.h14
-rw-r--r--src/GudhUI/gui/Menu_persistence.cpp21
-rw-r--r--src/GudhUI/gui/Menu_persistence.h21
-rw-r--r--src/GudhUI/gui/Menu_uniform_neighbors.cpp21
-rw-r--r--src/GudhUI/gui/Menu_uniform_neighbors.h21
-rw-r--r--src/GudhUI/gui/gudhui.cpp21
-rw-r--r--src/GudhUI/model/Complex_typedefs.h21
-rw-r--r--src/GudhUI/model/Model.h30
-rw-r--r--src/GudhUI/utils/Bar_code_persistence.h21
-rw-r--r--src/GudhUI/utils/Critical_points.h21
-rw-r--r--src/GudhUI/utils/Edge_collapsor.h21
-rw-r--r--src/GudhUI/utils/Edge_contractor.h21
-rw-r--r--src/GudhUI/utils/Furthest_point_epsilon_net.h21
-rw-r--r--src/GudhUI/utils/Is_manifold.h15
-rw-r--r--src/GudhUI/utils/K_nearest_builder.h21
-rw-r--r--src/GudhUI/utils/Lloyd_builder.h21
-rw-r--r--src/GudhUI/utils/MClock.h21
-rw-r--r--src/GudhUI/utils/Persistence_compute.h21
-rw-r--r--src/GudhUI/utils/Rips_builder.h21
-rw-r--r--src/GudhUI/utils/UI_utils.h21
-rw-r--r--src/GudhUI/utils/Vertex_collapsor.h21
-rwxr-xr-xsrc/GudhUI/utils/homsimplbin118624 -> 0 bytes
-rw-r--r--src/GudhUI/view/Color.h21
-rw-r--r--src/GudhUI/view/FirstCoordProjector.h21
-rw-r--r--src/GudhUI/view/Projector3D.h21
-rw-r--r--src/GudhUI/view/View_parameter.h21
-rw-r--r--src/GudhUI/view/Viewer.cpp21
-rw-r--r--src/GudhUI/view/Viewer.h21
-rw-r--r--src/GudhUI/view/Viewer_instructor.cpp21
-rw-r--r--src/GudhUI/view/Viewer_instructor.h21
-rw-r--r--src/Hasse_complex/include/gudhi/Hasse_complex.h20
-rw-r--r--src/Nerve_GIC/doc/Intro_graph_induced_complex.h14
-rw-r--r--src/Nerve_GIC/example/CMakeLists.txt4
-rw-r--r--src/Nerve_GIC/example/CoordGIC.cpp14
-rw-r--r--src/Nerve_GIC/example/FuncGIC.cpp14
-rw-r--r--src/Nerve_GIC/include/gudhi/GIC.h14
-rw-r--r--src/Nerve_GIC/test/CMakeLists.txt4
-rw-r--r--src/Nerve_GIC/test/test_GIC.cpp14
-rw-r--r--src/Nerve_GIC/utilities/CMakeLists.txt4
-rwxr-xr-xsrc/Nerve_GIC/utilities/KeplerMapperVisuFromTxtFile.py22
-rw-r--r--src/Nerve_GIC/utilities/Nerve.cpp14
-rw-r--r--src/Nerve_GIC/utilities/VoronoiGIC.cpp14
-rw-r--r--src/Persistence_representations/concept/Real_valued_topological_data.h14
-rw-r--r--src/Persistence_representations/concept/Topological_data_with_averages.h14
-rw-r--r--src/Persistence_representations/concept/Topological_data_with_distances.h14
-rw-r--r--src/Persistence_representations/concept/Topological_data_with_scalar_product.h14
-rw-r--r--src/Persistence_representations/concept/Vectorized_topological_data.h14
-rw-r--r--src/Persistence_representations/doc/Persistence_representations_doc.h14
-rw-r--r--src/Persistence_representations/example/persistence_heat_maps.cpp14
-rw-r--r--src/Persistence_representations/example/persistence_intervals.cpp14
-rw-r--r--src/Persistence_representations/example/persistence_landscape.cpp14
-rw-r--r--src/Persistence_representations/example/persistence_landscape_on_grid.cpp14
-rw-r--r--src/Persistence_representations/example/persistence_vectors.cpp14
-rw-r--r--src/Persistence_representations/example/sliced_wasserstein.cpp14
-rw-r--r--src/Persistence_representations/include/gudhi/PSSK.h14
-rw-r--r--src/Persistence_representations/include/gudhi/Persistence_heat_maps.h14
-rw-r--r--src/Persistence_representations/include/gudhi/Persistence_intervals.h14
-rw-r--r--src/Persistence_representations/include/gudhi/Persistence_intervals_with_distances.h14
-rw-r--r--src/Persistence_representations/include/gudhi/Persistence_landscape.h14
-rw-r--r--src/Persistence_representations/include/gudhi/Persistence_landscape_on_grid.h23
-rw-r--r--src/Persistence_representations/include/gudhi/Persistence_vectors.h14
-rw-r--r--src/Persistence_representations/include/gudhi/Sliced_Wasserstein.h14
-rw-r--r--src/Persistence_representations/include/gudhi/common_persistence_representations.h14
-rw-r--r--src/Persistence_representations/include/gudhi/read_persistence_from_file.h14
-rw-r--r--src/Persistence_representations/test/CMakeLists.txt16
-rw-r--r--src/Persistence_representations/test/kernels.cpp14
-rw-r--r--src/Persistence_representations/test/persistence_heat_maps_test.cpp14
-rw-r--r--src/Persistence_representations/test/persistence_intervals_test.cpp14
-rw-r--r--src/Persistence_representations/test/persistence_intervals_with_distances_test.cpp14
-rw-r--r--src/Persistence_representations/test/persistence_lanscapes_on_grid_test.cpp14
-rw-r--r--src/Persistence_representations/test/persistence_lanscapes_test.cpp14
-rw-r--r--src/Persistence_representations/test/read_persistence_from_file_test.cpp14
-rw-r--r--src/Persistence_representations/test/vector_representation_test.cpp14
-rw-r--r--src/Persistence_representations/utilities/persistence_heat_maps/average_persistence_heat_maps.cpp14
-rw-r--r--src/Persistence_representations/utilities/persistence_heat_maps/compute_distance_of_persistence_heat_maps.cpp14
-rw-r--r--src/Persistence_representations/utilities/persistence_heat_maps/compute_scalar_product_of_persistence_heat_maps.cpp14
-rw-r--r--src/Persistence_representations/utilities/persistence_heat_maps/create_p_h_m_weighted_by_arctan_of_their_persistence.cpp30
-rw-r--r--src/Persistence_representations/utilities/persistence_heat_maps/create_p_h_m_weighted_by_distance_from_diagonal.cpp14
-rw-r--r--src/Persistence_representations/utilities/persistence_heat_maps/create_p_h_m_weighted_by_squared_diag_distance.cpp14
-rw-r--r--src/Persistence_representations/utilities/persistence_heat_maps/create_persistence_heat_maps.cpp14
-rw-r--r--src/Persistence_representations/utilities/persistence_heat_maps/create_pssk.cpp14
-rw-r--r--src/Persistence_representations/utilities/persistence_heat_maps/plot_persistence_heat_map.cpp14
-rw-r--r--src/Persistence_representations/utilities/persistence_intervals/CMakeLists.txt4
-rw-r--r--src/Persistence_representations/utilities/persistence_intervals/compute_birth_death_range_in_persistence_diagram.cpp14
-rw-r--r--src/Persistence_representations/utilities/persistence_intervals/compute_bottleneck_distance.cpp14
-rw-r--r--src/Persistence_representations/utilities/persistence_intervals/compute_number_of_dominant_intervals.cpp14
-rw-r--r--src/Persistence_representations/utilities/persistence_intervals/plot_histogram_of_intervals_lengths.cpp14
-rw-r--r--src/Persistence_representations/utilities/persistence_intervals/plot_persistence_Betti_numbers.cpp14
-rw-r--r--src/Persistence_representations/utilities/persistence_intervals/plot_persistence_intervals.cpp14
-rw-r--r--src/Persistence_representations/utilities/persistence_landscapes/average_landscapes.cpp14
-rw-r--r--src/Persistence_representations/utilities/persistence_landscapes/compute_distance_of_landscapes.cpp14
-rw-r--r--src/Persistence_representations/utilities/persistence_landscapes/compute_scalar_product_of_landscapes.cpp14
-rw-r--r--src/Persistence_representations/utilities/persistence_landscapes/create_landscapes.cpp14
-rw-r--r--src/Persistence_representations/utilities/persistence_landscapes/plot_landscapes.cpp14
-rw-r--r--src/Persistence_representations/utilities/persistence_landscapes_on_grid/average_landscapes_on_grid.cpp14
-rw-r--r--src/Persistence_representations/utilities/persistence_landscapes_on_grid/compute_distance_of_landscapes_on_grid.cpp14
-rw-r--r--src/Persistence_representations/utilities/persistence_landscapes_on_grid/compute_scalar_product_of_landscapes_on_grid.cpp14
-rw-r--r--src/Persistence_representations/utilities/persistence_landscapes_on_grid/create_landscapes_on_grid.cpp14
-rw-r--r--src/Persistence_representations/utilities/persistence_landscapes_on_grid/plot_landscapes_on_grid.cpp14
-rw-r--r--src/Persistence_representations/utilities/persistence_vectors/average_persistence_vectors.cpp14
-rw-r--r--src/Persistence_representations/utilities/persistence_vectors/compute_distance_of_persistence_vectors.cpp14
-rw-r--r--src/Persistence_representations/utilities/persistence_vectors/compute_scalar_product_of_persistence_vectors.cpp14
-rw-r--r--src/Persistence_representations/utilities/persistence_vectors/create_persistence_vectors.cpp14
-rw-r--r--src/Persistence_representations/utilities/persistence_vectors/plot_persistence_vectors.cpp14
-rw-r--r--src/Persistent_cohomology/benchmark/performance_rips_persistence.cpp20
-rw-r--r--src/Persistent_cohomology/concept/CoefficientField.h30
-rw-r--r--src/Persistent_cohomology/concept/FilteredComplex.h30
-rw-r--r--src/Persistent_cohomology/concept/PersistentHomology.h30
-rw-r--r--src/Persistent_cohomology/doc/Intro_persistent_cohomology.h14
-rw-r--r--src/Persistent_cohomology/example/CMakeLists.txt21
-rw-r--r--src/Persistent_cohomology/example/custom_persistence_sort.cpp14
-rw-r--r--src/Persistent_cohomology/example/persistence_from_file.cpp20
-rw-r--r--src/Persistent_cohomology/example/persistence_from_simple_simplex_tree.cpp14
-rw-r--r--src/Persistent_cohomology/example/plain_homology.cpp14
-rw-r--r--src/Persistent_cohomology/example/rips_multifield_persistence.cpp20
-rw-r--r--src/Persistent_cohomology/example/rips_persistence_step_by_step.cpp20
-rw-r--r--src/Persistent_cohomology/example/rips_persistence_via_boundary_matrix.cpp20
-rw-r--r--src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h14
-rw-r--r--src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Field_Zp.h14
-rw-r--r--src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Multi_field.h14
-rw-r--r--src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Persistent_cohomology_column.h14
-rw-r--r--src/Rips_complex/concept/SimplicialComplexForRips.h20
-rw-r--r--src/Rips_complex/doc/Intro_rips_complex.h14
-rw-r--r--src/Rips_complex/include/gudhi/Rips_complex.h14
-rw-r--r--src/Rips_complex/include/gudhi/Sparse_rips_complex.h14
-rw-r--r--src/Rips_complex/test/test_rips_complex.cpp14
-rw-r--r--src/Rips_complex/utilities/rips_correlation_matrix_persistence.cpp14
-rw-r--r--src/Rips_complex/utilities/rips_distance_matrix_persistence.cpp14
-rw-r--r--src/Rips_complex/utilities/rips_persistence.cpp14
-rw-r--r--src/Rips_complex/utilities/sparse_rips_persistence.cpp14
-rw-r--r--src/Simplex_tree/concept/FiltrationValue.h30
-rw-r--r--src/Simplex_tree/concept/IndexingTag.h30
-rw-r--r--src/Simplex_tree/concept/SimplexKey.h30
-rw-r--r--src/Simplex_tree/concept/SimplexTreeOptions.h30
-rw-r--r--src/Simplex_tree/concept/VertexHandle.h30
-rw-r--r--src/Simplex_tree/doc/Intro_simplex_tree.h14
-rw-r--r--src/Simplex_tree/example/CMakeLists.txt16
-rw-r--r--src/Simplex_tree/example/cech_complex_cgal_mini_sphere_3d.cpp14
-rw-r--r--src/Simplex_tree/example/example_alpha_shapes_3_simplex_tree_from_off_file.cpp14
-rw-r--r--src/Simplex_tree/example/graph_expansion_with_blocker.cpp14
-rw-r--r--src/Simplex_tree/example/mini_simplex_tree.cpp14
-rw-r--r--src/Simplex_tree/example/simple_simplex_tree.cpp14
-rw-r--r--src/Simplex_tree/example/simplex_tree_from_cliques_of_graph.cpp14
-rw-r--r--src/Simplex_tree/include/gudhi/Simplex_tree.h14
-rw-r--r--src/Simplex_tree/include/gudhi/Simplex_tree/Simplex_tree_iterators.h14
-rw-r--r--src/Simplex_tree/include/gudhi/Simplex_tree/Simplex_tree_node_explicit_storage.h14
-rw-r--r--src/Simplex_tree/include/gudhi/Simplex_tree/Simplex_tree_siblings.h14
-rw-r--r--src/Simplex_tree/include/gudhi/Simplex_tree/indexing_tag.h14
-rw-r--r--src/Skeleton_blocker/concept/SkeletonBlockerDS.h14
-rw-r--r--src/Skeleton_blocker/concept/SkeletonBlockerGeometricDS.h14
-rw-r--r--src/Skeleton_blocker/example/Skeleton_blocker_from_simplices.cpp20
-rw-r--r--src/Skeleton_blocker/example/Skeleton_blocker_iteration.cpp20
-rw-r--r--src/Skeleton_blocker/example/Skeleton_blocker_link.cpp20
-rw-r--r--src/Skeleton_blocker/include/gudhi/Skeleton_blocker.h14
-rw-r--r--src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_complex_visitor.h14
-rw-r--r--src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_link_superior.h14
-rw-r--r--src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_off_io.h14
-rw-r--r--src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_simple_geometric_traits.h14
-rw-r--r--src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_simple_traits.h14
-rw-r--r--src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_simplex.h14
-rw-r--r--src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_sub_complex.h14
-rw-r--r--src/Skeleton_blocker/include/gudhi/Skeleton_blocker/internal/Top_faces.h14
-rw-r--r--src/Skeleton_blocker/include/gudhi/Skeleton_blocker/internal/Trie.h21
-rw-r--r--src/Skeleton_blocker/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_blockers_iterators.h14
-rw-r--r--src/Skeleton_blocker/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_edges_iterators.h14
-rw-r--r--src/Skeleton_blocker/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_iterators.h30
-rw-r--r--src/Skeleton_blocker/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_simplices_iterators.h14
-rw-r--r--src/Skeleton_blocker/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_triangles_iterators.h14
-rw-r--r--src/Skeleton_blocker/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_vertices_iterators.h14
-rw-r--r--src/Skeleton_blocker/include/gudhi/Skeleton_blocker_complex.h14
-rw-r--r--src/Skeleton_blocker/include/gudhi/Skeleton_blocker_geometric_complex.h14
-rw-r--r--src/Skeleton_blocker/include/gudhi/Skeleton_blocker_link_complex.h14
-rw-r--r--src/Skeleton_blocker/include/gudhi/Skeleton_blocker_simplifiable_complex.h14
-rw-r--r--src/Skeleton_blocker/test/test_skeleton_blocker_complex.cpp14
-rw-r--r--src/Skeleton_blocker/test/test_skeleton_blocker_geometric_complex.cpp20
-rw-r--r--src/Skeleton_blocker/test/test_skeleton_blocker_simplifiable.cpp20
-rw-r--r--src/Spatial_searching/doc/Intro_spatial_searching.h14
-rw-r--r--src/Spatial_searching/example/CMakeLists.txt4
-rw-r--r--src/Spatial_searching/include/gudhi/Kd_tree_search.h14
-rw-r--r--src/Spatial_searching/test/CMakeLists.txt2
-rw-r--r--src/Spatial_searching/test/test_Kd_tree_search.cpp14
-rw-r--r--src/Subsampling/doc/Intro_subsampling.h14
-rw-r--r--src/Subsampling/example/CMakeLists.txt4
-rw-r--r--src/Subsampling/include/gudhi/choose_n_farthest_points.h14
-rw-r--r--src/Subsampling/include/gudhi/pick_n_random_points.h14
-rw-r--r--src/Subsampling/include/gudhi/sparsify_point_set.h14
-rw-r--r--src/Subsampling/test/CMakeLists.txt4
-rw-r--r--src/Subsampling/test/test_choose_n_farthest_points.cpp14
-rw-r--r--src/Subsampling/test/test_pick_n_random_points.cpp14
-rw-r--r--src/Subsampling/test/test_sparsify_point_set.cpp14
-rw-r--r--src/Tangential_complex/benchmark/CMakeLists.txt4
-rw-r--r--src/Tangential_complex/benchmark/RIB_exporter.h14
-rw-r--r--src/Tangential_complex/benchmark/XML_exporter.h14
-rw-r--r--src/Tangential_complex/doc/Intro_tangential_complex.h14
-rw-r--r--src/Tangential_complex/example/CMakeLists.txt4
-rw-r--r--src/Tangential_complex/include/gudhi/Tangential_complex.h14
-rw-r--r--src/Tangential_complex/include/gudhi/Tangential_complex/Simplicial_complex.h14
-rw-r--r--src/Tangential_complex/include/gudhi/Tangential_complex/config.h14
-rw-r--r--src/Tangential_complex/include/gudhi/Tangential_complex/utilities.h14
-rw-r--r--src/Tangential_complex/test/CMakeLists.txt4
-rw-r--r--src/Tangential_complex/test/test_tangential_complex.cpp14
-rw-r--r--src/Toplex_map/benchmark/benchmark_tm.cpp14
-rw-r--r--src/Toplex_map/doc/Intro_Toplex_map.h14
-rw-r--r--src/Toplex_map/example/simple_toplex_map.cpp14
-rw-r--r--src/Toplex_map/include/gudhi/Lazy_toplex_map.h14
-rw-r--r--src/Toplex_map/include/gudhi/Toplex_map.h14
-rw-r--r--src/Toplex_map/test/lazy_toplex_map_unit_test.cpp14
-rw-r--r--src/Toplex_map/test/toplex_map_unit_test.cpp14
-rw-r--r--src/Witness_complex/concept/SimplicialComplexForWitness.h20
-rw-r--r--src/Witness_complex/example/CMakeLists.txt4
-rw-r--r--src/Witness_complex/example/generators.h14
-rw-r--r--src/Witness_complex/include/gudhi/Active_witness/Active_witness.h14
-rw-r--r--src/Witness_complex/include/gudhi/Active_witness/Active_witness_iterator.h14
-rw-r--r--src/Witness_complex/include/gudhi/Euclidean_strong_witness_complex.h14
-rw-r--r--src/Witness_complex/include/gudhi/Euclidean_witness_complex.h14
-rw-r--r--src/Witness_complex/include/gudhi/Strong_witness_complex.h14
-rw-r--r--src/Witness_complex/include/gudhi/Witness_complex.h14
-rw-r--r--src/Witness_complex/include/gudhi/Witness_complex/all_faces_in.h14
-rw-r--r--src/Witness_complex/test/CMakeLists.txt4
-rw-r--r--src/Witness_complex/utilities/CMakeLists.txt4
-rw-r--r--src/Witness_complex/utilities/strong_witness_persistence.cpp14
-rw-r--r--src/Witness_complex/utilities/weak_witness_persistence.cpp14
-rw-r--r--src/cmake/modules/GUDHI_third_party_libraries.cmake34
-rw-r--r--src/cmake/modules/GUDHI_user_version_target.cmake9
-rw-r--r--src/common/benchmark/Graph_simplicial_complex_benchmark.cpp14
-rw-r--r--src/common/doc/file_formats.h30
-rw-r--r--src/common/doc/footer.html2
-rw-r--r--src/common/doc/installation.h14
-rw-r--r--src/common/doc/main_page.md50
-rw-r--r--src/common/example/CMakeLists.txt24
-rw-r--r--src/common/include/gudhi/Clock.h20
-rw-r--r--src/common/include/gudhi/Debug_utils.h14
-rw-r--r--src/common/include/gudhi/Null_output_iterator.h14
-rw-r--r--src/common/include/gudhi/Off_reader.h21
-rw-r--r--src/common/include/gudhi/Point.h21
-rw-r--r--src/common/include/gudhi/Points_3D_off_io.h14
-rw-r--r--src/common/include/gudhi/Points_off_io.h14
-rw-r--r--src/common/include/gudhi/Simple_object_pool.h14
-rw-r--r--src/common/include/gudhi/Unitary_tests_utils.h14
-rw-r--r--src/common/include/gudhi/allocator.h14
-rw-r--r--src/common/include/gudhi/console_color.h14
-rw-r--r--src/common/include/gudhi/distance_functions.h20
-rw-r--r--src/common/include/gudhi/graph_simplicial_complex.h20
-rw-r--r--src/common/include/gudhi/random_point_generators.h14
-rw-r--r--src/common/include/gudhi/reader_utils.h14
-rw-r--r--src/common/include/gudhi/writing_persistence_to_file.h14
-rw-r--r--src/common/include/gudhi_patches/Bottleneck_distance_CGAL_patches.txt3
-rw-r--r--src/common/include/gudhi_patches/CGAL/Convex_hull.h56
-rw-r--r--src/common/include/gudhi_patches/CGAL/Delaunay_triangulation.h933
-rw-r--r--src/common/include/gudhi_patches/CGAL/Epeck_d.h53
-rw-r--r--src/common/include/gudhi_patches/CGAL/Epick_d.h71
-rw-r--r--src/common/include/gudhi_patches/CGAL/IO/Triangulation_off_ostream.h320
-rw-r--r--src/common/include/gudhi_patches/CGAL/Kd_tree.h582
-rw-r--r--src/common/include/gudhi_patches/CGAL/Kd_tree_node.h586
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_LA_base.h177
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_LA_functors.h344
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_base.h40
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_change_FT.h117
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_complete.h33
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_filter_K.h79
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_filter_NT.h93
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_per_dimension.h33
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_static_filters.h95
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/Coaffine.h330
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/Define_kernel_types.h50
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/Dimension_base.h49
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/Filtered_predicate2.h137
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/KernelD_converter.h199
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/Kernel_2_interface.h104
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/Kernel_3_interface.h102
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/Kernel_d_interface.h298
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/Kernel_object_converter.h134
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/LA_eigen/LA.h175
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/LA_eigen/constructors.h162
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/Lazy_cartesian.h188
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/Types/Aff_transformation.h59
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/Types/Hyperplane.h159
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/Types/Iso_box.h88
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/Types/Line.h66
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/Types/Ray.h66
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/Types/Segment.h121
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/Types/Sphere.h132
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/Types/Weighted_point.h205
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/Vector/array.h165
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/Vector/avx4.h213
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/Vector/determinant_of_iterator_to_points_from_iterator_to_vectors.h76
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/Vector/determinant_of_iterator_to_points_from_points.h211
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/Vector/determinant_of_iterator_to_vectors_from_vectors.h201
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/Vector/determinant_of_points_from_vectors.h164
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/Vector/determinant_of_vectors_small_dim.h58
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/Vector/determinant_of_vectors_small_dim_internal.h164
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/Vector/mix.h46
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/Vector/sse2.h145
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/Vector/v2int.h181
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/Vector/vector.h167
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Cartesian_wrap.h305
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Hyperplane_d.h131
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Point_d.h284
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Ref_count_obj.h120
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Segment_d.h133
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Sphere_d.h130
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Vector_d.h266
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Weighted_point_d.h129
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/function_objects_cartesian.h1355
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/functor_properties.h40
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/functor_tags.h363
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/static_int.h61
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/store_kernel.h104
-rw-r--r--src/common/include/gudhi_patches/CGAL/NewKernel_d/utils.h306
-rw-r--r--src/common/include/gudhi_patches/CGAL/Orthogonal_incremental_neighbor_search.h620
-rw-r--r--src/common/include/gudhi_patches/CGAL/Regular_triangulation.h1169
-rw-r--r--src/common/include/gudhi_patches/CGAL/Regular_triangulation_traits_adapter.h288
-rw-r--r--src/common/include/gudhi_patches/CGAL/TDS_full_cell_default_storage_policy.h99
-rw-r--r--src/common/include/gudhi_patches/CGAL/TDS_full_cell_mirror_storage_policy.h71
-rw-r--r--src/common/include/gudhi_patches/CGAL/Triangulation.h1424
-rw-r--r--src/common/include/gudhi_patches/CGAL/Triangulation_data_structure.h1603
-rw-r--r--src/common/include/gudhi_patches/CGAL/Triangulation_ds_full_cell.h311
-rw-r--r--src/common/include/gudhi_patches/CGAL/Triangulation_ds_vertex.h154
-rw-r--r--src/common/include/gudhi_patches/CGAL/Triangulation_face.h111
-rw-r--r--src/common/include/gudhi_patches/CGAL/Triangulation_full_cell.h148
-rw-r--r--src/common/include/gudhi_patches/CGAL/Triangulation_vertex.h128
-rw-r--r--src/common/include/gudhi_patches/CGAL/argument_swaps.h88
-rw-r--r--src/common/include/gudhi_patches/CGAL/determinant_of_vectors.h117
-rw-r--r--src/common/include/gudhi_patches/CGAL/internal/Combination_enumerator.h148
-rw-r--r--src/common/include/gudhi_patches/CGAL/internal/Static_or_dynamic_array.h116
-rw-r--r--src/common/include/gudhi_patches/CGAL/internal/Triangulation/Dummy_TDS.h49
-rw-r--r--src/common/include/gudhi_patches/CGAL/internal/Triangulation/Triangulation_ds_iterators.h154
-rw-r--r--src/common/include/gudhi_patches/CGAL/internal/Triangulation/utilities.h154
-rw-r--r--src/common/include/gudhi_patches/CGAL/iterator_from_indices.h75
-rw-r--r--src/common/include/gudhi_patches/CGAL/transforming_iterator.h123
-rw-r--r--src/common/include/gudhi_patches/CGAL/transforming_pair_iterator.h127
-rw-r--r--src/common/include/gudhi_patches/CGAL/typeset.h117
-rw-r--r--src/common/include/gudhi_patches/Tangential_complex_CGAL_patches.txt82
-rw-r--r--src/common/test/test_distance_matrix_reader.cpp14
-rw-r--r--src/common/test/test_persistence_intervals_reader.cpp14
-rw-r--r--src/common/test/test_points_off_reader.cpp14
-rw-r--r--src/common/utilities/CMakeLists.txt4
-rw-r--r--src/common/utilities/off_file_from_shape_generator.cpp14
-rw-r--r--src/cython/CMakeLists.txt32
-rw-r--r--src/cython/cython/alpha_complex.pyx28
-rw-r--r--src/cython/cython/bottleneck_distance.pyx24
-rw-r--r--src/cython/cython/cubical_complex.pyx26
-rw-r--r--src/cython/cython/euclidean_strong_witness_complex.pyx24
-rw-r--r--src/cython/cython/euclidean_witness_complex.pyx24
-rw-r--r--src/cython/cython/nerve_gic.pyx24
-rw-r--r--src/cython/cython/off_reader.pyx26
-rw-r--r--src/cython/cython/periodic_cubical_complex.pyx26
-rw-r--r--src/cython/cython/persistence_graphical_tools.py259
-rw-r--r--src/cython/cython/reader_utils.pyx26
-rw-r--r--src/cython/cython/rips_complex.pyx26
-rw-r--r--src/cython/cython/simplex_tree.pyx26
-rw-r--r--src/cython/cython/strong_witness_complex.pyx26
-rw-r--r--src/cython/cython/subsampling.pyx24
-rw-r--r--src/cython/cython/tangential_complex.pyx24
-rw-r--r--src/cython/cython/witness_complex.pyx26
-rw-r--r--src/cython/doc/alpha_complex_sum.inc34
-rw-r--r--src/cython/doc/bottleneck_distance_sum.inc22
-rwxr-xr-xsrc/cython/doc/conf.py2
-rw-r--r--src/cython/doc/cubical_complex_sum.inc2
-rw-r--r--src/cython/doc/installation.rst15
-rw-r--r--src/cython/doc/nerve_gic_complex_sum.inc26
-rw-r--r--src/cython/doc/persistence_graphical_tools_sum.inc2
-rw-r--r--src/cython/doc/persistent_cohomology_sum.inc2
-rw-r--r--src/cython/doc/rips_complex_sum.inc2
-rw-r--r--src/cython/doc/simplex_tree_sum.inc2
-rw-r--r--src/cython/doc/tangential_complex_sum.inc22
-rw-r--r--src/cython/doc/witness_complex_sum.inc29
-rwxr-xr-xsrc/cython/example/alpha_complex_diagram_persistence_from_off_file_example.py70
-rwxr-xr-xsrc/cython/example/alpha_complex_from_points_example.py26
-rwxr-xr-xsrc/cython/example/alpha_rips_persistence_bottleneck_distance.py76
-rwxr-xr-xsrc/cython/example/bottleneck_basic_example.py39
-rwxr-xr-xsrc/cython/example/coordinate_graph_induced_complex.py70
-rwxr-xr-xsrc/cython/example/euclidean_strong_witness_complex_diagram_persistence_from_off_file_example.py80
-rwxr-xr-xsrc/cython/example/euclidean_witness_complex_diagram_persistence_from_off_file_example.py79
-rwxr-xr-xsrc/cython/example/functional_graph_induced_complex.py72
-rwxr-xr-xsrc/cython/example/gudhi_graphical_tools_example.py38
-rwxr-xr-xsrc/cython/example/nerve_of_a_covering.py70
-rwxr-xr-xsrc/cython/example/periodic_cubical_complex_barcode_persistence_from_perseus_file_example.py52
-rwxr-xr-xsrc/cython/example/random_cubical_complex_persistence_example.py53
-rwxr-xr-xsrc/cython/example/rips_complex_diagram_persistence_from_correlation_matrix_file_example.py75
-rwxr-xr-xsrc/cython/example/rips_complex_diagram_persistence_from_distance_matrix_file_example.py56
-rwxr-xr-xsrc/cython/example/rips_complex_diagram_persistence_from_off_file_example.py74
-rwxr-xr-xsrc/cython/example/rips_complex_from_points_example.py29
-rwxr-xr-xsrc/cython/example/rips_persistence_diagram.py29
-rwxr-xr-xsrc/cython/example/simplex_tree_example.py26
-rwxr-xr-xsrc/cython/example/sparse_rips_persistence_diagram.py31
-rwxr-xr-xsrc/cython/example/tangential_complex_plain_homology_from_off_file_example.py68
-rwxr-xr-xsrc/cython/example/voronoi_graph_induced_complex.py70
-rwxr-xr-xsrc/cython/example/witness_complex_from_nearest_landmark_table.py38
-rw-r--r--src/cython/gudhi.pyx.in26
-rw-r--r--src/cython/include/Alpha_complex_interface.h14
-rw-r--r--src/cython/include/Bottleneck_distance_interface.h14
-rw-r--r--src/cython/include/Cubical_complex_interface.h14
-rw-r--r--src/cython/include/Euclidean_strong_witness_complex_interface.h14
-rw-r--r--src/cython/include/Euclidean_witness_complex_interface.h14
-rw-r--r--src/cython/include/Nerve_gic_interface.h14
-rw-r--r--src/cython/include/Off_reader_interface.h14
-rw-r--r--src/cython/include/Persistent_cohomology_interface.h14
-rw-r--r--src/cython/include/Reader_utils_interface.h14
-rw-r--r--src/cython/include/Rips_complex_interface.h14
-rw-r--r--src/cython/include/Simplex_tree_interface.h14
-rw-r--r--src/cython/include/Strong_witness_complex_interface.h14
-rw-r--r--src/cython/include/Subsampling_interface.h14
-rw-r--r--src/cython/include/Tangential_complex_interface.h14
-rw-r--r--src/cython/include/Witness_complex_interface.h14
-rw-r--r--src/cython/setup.py.in22
-rwxr-xr-xsrc/cython/test/test_alpha_complex.py84
-rwxr-xr-xsrc/cython/test/test_bottleneck_distance.py34
-rwxr-xr-xsrc/cython/test/test_cover_complex.py85
-rwxr-xr-xsrc/cython/test/test_cubical_complex.py85
-rwxr-xr-xsrc/cython/test/test_euclidean_witness_complex.py94
-rwxr-xr-xsrc/cython/test/test_reader_utils.py131
-rwxr-xr-xsrc/cython/test/test_rips_complex.py118
-rwxr-xr-xsrc/cython/test/test_simplex_tree.py159
-rwxr-xr-xsrc/cython/test/test_subsampling.py166
-rwxr-xr-xsrc/cython/test/test_tangential_complex.py42
-rwxr-xr-xsrc/cython/test/test_witness_complex.py66
497 files changed, 2517 insertions, 32490 deletions
diff --git a/CMakeGUDHIVersion.txt b/CMakeGUDHIVersion.txt
index ebaddd47..eb2a0666 100644
--- a/CMakeGUDHIVersion.txt
+++ b/CMakeGUDHIVersion.txt
@@ -1,5 +1,5 @@
-set (GUDHI_MAJOR_VERSION 2)
-set (GUDHI_MINOR_VERSION 3)
+set (GUDHI_MAJOR_VERSION 3)
+set (GUDHI_MINOR_VERSION 0)
set (GUDHI_PATCH_VERSION 0)
set(GUDHI_VERSION ${GUDHI_MAJOR_VERSION}.${GUDHI_MINOR_VERSION}.${GUDHI_PATCH_VERSION})
diff --git a/COPYING b/COPYING
deleted file mode 100644
index 20d40b6b..00000000
--- a/COPYING
+++ /dev/null
@@ -1,674 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
-
- The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works. By contrast,
-the GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users. We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors. You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
- To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights. Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received. You must make sure that they, too, receive
-or can get the source code. And you must show them these terms so they
-know their rights.
-
- Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-
- For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software. For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
- Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so. This is fundamentally incompatible with the aim of
-protecting users' freedom to change the software. The systematic
-pattern of such abuse occurs in the area of products for individuals to
-use, which is precisely where it is most unacceptable. Therefore, we
-have designed this version of the GPL to prohibit the practice for those
-products. If such problems arise substantially in other domains, we
-stand ready to extend this provision to those domains in future versions
-of the GPL, as needed to protect the freedom of users.
-
- Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary. To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- TERMS AND CONDITIONS
-
- 0. Definitions.
-
- "This License" refers to version 3 of the GNU General Public License.
-
- "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
- "The Program" refers to any copyrightable work licensed under this
-License. Each licensee is addressed as "you". "Licensees" and
-"recipients" may be individuals or organizations.
-
- To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy. The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
- A "covered work" means either the unmodified Program or a work based
-on the Program.
-
- To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy. Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
- To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies. Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
- An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License. If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
- 1. Source Code.
-
- The "source code" for a work means the preferred form of the work
-for making modifications to it. "Object code" means any non-source
-form of a work.
-
- A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
- The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form. A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
- The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities. However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work. For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
- The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
- The Corresponding Source for a work in source code form is that
-same work.
-
- 2. Basic Permissions.
-
- All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met. This License explicitly affirms your unlimited
-permission to run the unmodified Program. The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work. This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
- You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force. You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright. Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
- Conveying under any other circumstances is permitted solely under
-the conditions stated below. Sublicensing is not allowed; section 10
-makes it unnecessary.
-
- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
- No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
- When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
- 4. Conveying Verbatim Copies.
-
- You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
- You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
- 5. Conveying Modified Source Versions.
-
- You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
- a) The work must carry prominent notices stating that you modified
- it, and giving a relevant date.
-
- b) The work must carry prominent notices stating that it is
- released under this License and any conditions added under section
- 7. This requirement modifies the requirement in section 4 to
- "keep intact all notices".
-
- c) You must license the entire work, as a whole, under this
- License to anyone who comes into possession of a copy. This
- License will therefore apply, along with any applicable section 7
- additional terms, to the whole of the work, and all its parts,
- regardless of how they are packaged. This License gives no
- permission to license the work in any other way, but it does not
- invalidate such permission if you have separately received it.
-
- d) If the work has interactive user interfaces, each must display
- Appropriate Legal Notices; however, if the Program has interactive
- interfaces that do not display Appropriate Legal Notices, your
- work need not make them do so.
-
- A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit. Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
- 6. Conveying Non-Source Forms.
-
- You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
- a) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by the
- Corresponding Source fixed on a durable physical medium
- customarily used for software interchange.
-
- b) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by a
- written offer, valid for at least three years and valid for as
- long as you offer spare parts or customer support for that product
- model, to give anyone who possesses the object code either (1) a
- copy of the Corresponding Source for all the software in the
- product that is covered by this License, on a durable physical
- medium customarily used for software interchange, for a price no
- more than your reasonable cost of physically performing this
- conveying of source, or (2) access to copy the
- Corresponding Source from a network server at no charge.
-
- c) Convey individual copies of the object code with a copy of the
- written offer to provide the Corresponding Source. This
- alternative is allowed only occasionally and noncommercially, and
- only if you received the object code with such an offer, in accord
- with subsection 6b.
-
- d) Convey the object code by offering access from a designated
- place (gratis or for a charge), and offer equivalent access to the
- Corresponding Source in the same way through the same place at no
- further charge. You need not require recipients to copy the
- Corresponding Source along with the object code. If the place to
- copy the object code is a network server, the Corresponding Source
- may be on a different server (operated by you or a third party)
- that supports equivalent copying facilities, provided you maintain
- clear directions next to the object code saying where to find the
- Corresponding Source. Regardless of what server hosts the
- Corresponding Source, you remain obligated to ensure that it is
- available for as long as needed to satisfy these requirements.
-
- e) Convey the object code using peer-to-peer transmission, provided
- you inform other peers where the object code and Corresponding
- Source of the work are being offered to the general public at no
- charge under subsection 6d.
-
- A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
- A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling. In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage. For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product. A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
- "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source. The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
- If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information. But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
- The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed. Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
- Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
- 7. Additional Terms.
-
- "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law. If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
- When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it. (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.) You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
- Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
- a) Disclaiming warranty or limiting liability differently from the
- terms of sections 15 and 16 of this License; or
-
- b) Requiring preservation of specified reasonable legal notices or
- author attributions in that material or in the Appropriate Legal
- Notices displayed by works containing it; or
-
- c) Prohibiting misrepresentation of the origin of that material, or
- requiring that modified versions of such material be marked in
- reasonable ways as different from the original version; or
-
- d) Limiting the use for publicity purposes of names of licensors or
- authors of the material; or
-
- e) Declining to grant rights under trademark law for use of some
- trade names, trademarks, or service marks; or
-
- f) Requiring indemnification of licensors and authors of that
- material by anyone who conveys the material (or modified versions of
- it) with contractual assumptions of liability to the recipient, for
- any liability that these contractual assumptions directly impose on
- those licensors and authors.
-
- All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10. If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term. If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
- If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
- Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
- 8. Termination.
-
- You may not propagate or modify a covered work except as expressly
-provided under this License. Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
- However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
- Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
- Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License. If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
- 9. Acceptance Not Required for Having Copies.
-
- You are not required to accept this License in order to receive or
-run a copy of the Program. Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance. However,
-nothing other than this License grants you permission to propagate or
-modify any covered work. These actions infringe copyright if you do
-not accept this License. Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
- 10. Automatic Licensing of Downstream Recipients.
-
- Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License. You are not responsible
-for enforcing compliance by third parties with this License.
-
- An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations. If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
- You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License. For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
- 11. Patents.
-
- A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based. The
-work thus licensed is called the contributor's "contributor version".
-
- A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version. For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
- Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
- In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement). To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
- If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients. "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
- If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
- A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License. You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
- Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
- 12. No Surrender of Others' Freedom.
-
- If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all. For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
- 13. Use with the GNU Affero General Public License.
-
- Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU Affero General Public License into a single
-combined work, and to convey the resulting work. The terms of this
-License will continue to apply to the part which is the covered work,
-but the special requirements of the GNU Affero General Public License,
-section 13, concerning interaction through a network will apply to the
-combination as such.
-
- 14. Revised Versions of this License.
-
- The Free Software Foundation may publish revised and/or new versions of
-the GNU General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
- Each version is given a distinguishing version number. If the
-Program specifies that a certain numbered version of the GNU General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation. If the Program does not specify a version number of the
-GNU General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
- If the Program specifies that a proxy can decide which future
-versions of the GNU General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
- Later license versions may give you additional or different
-permissions. However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
- 15. Disclaimer of Warranty.
-
- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. Limitation of Liability.
-
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
- 17. Interpretation of Sections 15 and 16.
-
- If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This 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/>.
-
-Also add information on how to contact you by electronic and paper mail.
-
- If the program does terminal interaction, make it output a short
-notice like this when it starts in an interactive mode:
-
- <program> Copyright (C) <year> <name of author>
- This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, your program's commands
-might be different; for a GUI interface, you would use an "about box".
-
- You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU GPL, see
-<http://www.gnu.org/licenses/>.
-
- The GNU General Public License does not permit incorporating your program
-into proprietary programs. If your program is a subroutine library, you
-may consider it more useful to permit linking proprietary applications with
-the library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License. But first, please read
-<http://www.gnu.org/philosophy/why-not-lgpl.html>. \ No newline at end of file
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 00000000..8af15c7c
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2014-2019 The GUDHI developers.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE. \ No newline at end of file
diff --git a/data/points/generator/aurelien_alvarez_surfaces_in_R8.py b/data/points/generator/aurelien_alvarez_surfaces_in_R8.py
index 57773c4c..cc23ca98 100755
--- a/data/points/generator/aurelien_alvarez_surfaces_in_R8.py
+++ b/data/points/generator/aurelien_alvarez_surfaces_in_R8.py
@@ -1,28 +1,19 @@
-# 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): Aurélien Alvarez
-#
-# Copyright (C) 2016 Université d'Orléans (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/>.
+#!/usr/bin/env python
import numpy as np
import random
from math import factorial
+"""This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ Author(s): Aurélien Alvarez
+
+ Copyright (C) 2016 Université d'Orléans (France)
+
+ Modification(s):
+ - YYYY/MM Author: Description of the modification
+"""
+
I = complex(0,1)
#################################################
diff --git a/scripts/check_google_style.sh b/scripts/check_google_style.sh
deleted file mode 100755
index 9ed5cad0..00000000
--- a/scripts/check_google_style.sh
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/bash
-#usage bash check_google_style.sh
-
-# VERSION CHECK
-ROOT_DIR=..
-FILE_TO_CHECK="$1"
-PYTHON_SCRIPT="$2"
-LOG_FILE=$FILE_TO_CHECK.cpplint
-
-if [ -f $LOG_FILE ]; then
- rm -f $LOG_FILE
-fi
-
-if [ ! -f $FILE_TO_CHECK ]; then
- echo "File not found! : $FILE_TO_CHECK" | tee -a $LOG_FILE
- exit 1
-fi
-
-# CPPLINT FILE
-echo "File: $FILE_TO_CHECK" 2>&1 | tee -a $LOG_FILE
-python $PYTHON_SCRIPT --linelength=120 $FILE_TO_CHECK 2>&1 | tee -a $LOG_FILE
-
-LINE_ERRORS=`grep "Total errors found:" $LOG_FILE`
-NB_ERRORS=${LINE_ERRORS:20}
-
-if [ "$NB_ERRORS" -gt 20 ]
-then
- echo "## Too many errors ($NB_ERRORS) in $FILE_TO_CHECK" 2>&1 | tee -a $LOG_FILE
- exit 1
-fi
-
-echo "Acceptable number of errors ($NB_ERRORS) in $FILE_TO_CHECK" 2>&1 | tee -a $LOG_FILE
-exit 0
diff --git a/scripts/concatenate_utils_readme.sh b/scripts/concatenate_utils_readme.sh
deleted file mode 100755
index f5390044..00000000
--- a/scripts/concatenate_utils_readme.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-
-rm README_FOR_UTILITIES.txt
-locate utilities/README | grep `svn info | grep '^URL:' | egrep -o '(tags|branches)/[^/]+|trunk' | egrep -o '[^/]+$'` | xargs cat -- >> README_FOR_UTILITIES.txt \ No newline at end of file
diff --git a/scripts/cpplint.py b/scripts/cpplint.py
deleted file mode 100644
index 0e186e23..00000000
--- a/scripts/cpplint.py
+++ /dev/null
@@ -1,6324 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright (c) 2009 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""Does google-lint on c++ files.
-
-The goal of this script is to identify places in the code that *may*
-be in non-compliance with google style. It does not attempt to fix
-up these problems -- the point is to educate. It does also not
-attempt to find all problems, or to ensure that everything it does
-find is legitimately a problem.
-
-In particular, we can get very confused by /* and // inside strings!
-We do a small hack, which is to ignore //'s with "'s after them on the
-same line, but it is far from perfect (in either direction).
-"""
-
-import codecs
-import copy
-import getopt
-import math # for log
-import os
-import re
-import sre_compile
-import string
-import sys
-import unicodedata
-
-
-_USAGE = """
-Syntax: cpplint.py [--verbose=#] [--output=vs7] [--filter=-x,+y,...]
- [--counting=total|toplevel|detailed] [--root=subdir]
- [--linelength=digits]
- <file> [file] ...
-
- The style guidelines this tries to follow are those in
- http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml
-
- Every problem is given a confidence score from 1-5, with 5 meaning we are
- certain of the problem, and 1 meaning it could be a legitimate construct.
- This will miss some errors, and is not a substitute for a code review.
-
- To suppress false-positive errors of a certain category, add a
- 'NOLINT(category)' comment to the line. NOLINT or NOLINT(*)
- suppresses errors of all categories on that line.
-
- The files passed in will be linted; at least one file must be provided.
- Default linted extensions are .cc, .cpp, .cu, .cuh and .h. Change the
- extensions with the --extensions flag.
-
- Flags:
-
- output=vs7
- By default, the output is formatted to ease emacs parsing. Visual Studio
- compatible output (vs7) may also be used. Other formats are unsupported.
-
- verbose=#
- Specify a number 0-5 to restrict errors to certain verbosity levels.
-
- filter=-x,+y,...
- Specify a comma-separated list of category-filters to apply: only
- error messages whose category names pass the filters will be printed.
- (Category names are printed with the message and look like
- "[whitespace/indent]".) Filters are evaluated left to right.
- "-FOO" and "FOO" means "do not print categories that start with FOO".
- "+FOO" means "do print categories that start with FOO".
-
- Examples: --filter=-whitespace,+whitespace/braces
- --filter=whitespace,runtime/printf,+runtime/printf_format
- --filter=-,+build/include_what_you_use
-
- To see a list of all the categories used in cpplint, pass no arg:
- --filter=
-
- counting=total|toplevel|detailed
- The total number of errors found is always printed. If
- 'toplevel' is provided, then the count of errors in each of
- the top-level categories like 'build' and 'whitespace' will
- also be printed. If 'detailed' is provided, then a count
- is provided for each category like 'build/class'.
-
- root=subdir
- The root directory used for deriving header guard CPP variable.
- By default, the header guard CPP variable is calculated as the relative
- path to the directory that contains .git, .hg, or .svn. When this flag
- is specified, the relative path is calculated from the specified
- directory. If the specified directory does not exist, this flag is
- ignored.
-
- Examples:
- Assuming that src/.git exists, the header guard CPP variables for
- src/chrome/browser/ui/browser.h are:
-
- No flag => CHROME_BROWSER_UI_BROWSER_H_
- --root=chrome => BROWSER_UI_BROWSER_H_
- --root=chrome/browser => UI_BROWSER_H_
-
- linelength=digits
- This is the allowed line length for the project. The default value is
- 80 characters.
-
- Examples:
- --linelength=120
-
- extensions=extension,extension,...
- The allowed file extensions that cpplint will check
-
- Examples:
- --extensions=hpp,cpp
-
- cpplint.py supports per-directory configurations specified in CPPLINT.cfg
- files. CPPLINT.cfg file can contain a number of key=value pairs.
- Currently the following options are supported:
-
- set noparent
- filter=+filter1,-filter2,...
- exclude_files=regex
- linelength=80
-
- "set noparent" option prevents cpplint from traversing directory tree
- upwards looking for more .cfg files in parent directories. This option
- is usually placed in the top-level project directory.
-
- The "filter" option is similar in function to --filter flag. It specifies
- message filters in addition to the |_DEFAULT_FILTERS| and those specified
- through --filter command-line flag.
-
- "exclude_files" allows to specify a regular expression to be matched against
- a file name. If the expression matches, the file is skipped and not run
- through liner.
-
- "linelength" allows to specify the allowed line length for the project.
-
- CPPLINT.cfg has an effect on files in the same directory and all
- sub-directories, unless overridden by a nested configuration file.
-
- Example file:
- filter=-build/include_order,+build/include_alpha
- exclude_files=.*\.cc
-
- The above example disables build/include_order warning and enables
- build/include_alpha as well as excludes all .cc from being
- processed by linter, in the current directory (where the .cfg
- file is located) and all sub-directories.
-"""
-
-# We categorize each error message we print. Here are the categories.
-# We want an explicit list so we can list them all in cpplint --filter=.
-# If you add a new error message with a new category, add it to the list
-# here! cpplint_unittest.py should tell you if you forget to do this.
-_ERROR_CATEGORIES = [
- 'build/class',
- 'build/c++11',
- 'build/deprecated',
- 'build/endif_comment',
- 'build/explicit_make_pair',
- 'build/forward_decl',
- 'build/header_guard',
- 'build/include',
- 'build/include_alpha',
- 'build/include_order',
- 'build/include_what_you_use',
- 'build/namespaces',
- 'build/printf_format',
- 'build/storage_class',
- 'legal/copyright',
- 'readability/alt_tokens',
- 'readability/braces',
- 'readability/casting',
- 'readability/check',
- 'readability/constructors',
- 'readability/fn_size',
- 'readability/function',
- 'readability/inheritance',
- 'readability/multiline_comment',
- 'readability/multiline_string',
- 'readability/namespace',
- 'readability/nolint',
- 'readability/nul',
- 'readability/strings',
- 'readability/todo',
- 'readability/utf8',
- 'runtime/arrays',
- 'runtime/casting',
- 'runtime/explicit',
- 'runtime/int',
- 'runtime/init',
- 'runtime/invalid_increment',
- 'runtime/member_string_references',
- 'runtime/memset',
- 'runtime/indentation_namespace',
- 'runtime/operator',
- 'runtime/printf',
- 'runtime/printf_format',
- 'runtime/references',
- 'runtime/string',
- 'runtime/threadsafe_fn',
- 'runtime/vlog',
- 'whitespace/blank_line',
- 'whitespace/braces',
- 'whitespace/comma',
- 'whitespace/comments',
- 'whitespace/empty_conditional_body',
- 'whitespace/empty_loop_body',
- 'whitespace/end_of_line',
- 'whitespace/ending_newline',
- 'whitespace/forcolon',
- 'whitespace/indent',
- 'whitespace/line_length',
- 'whitespace/newline',
- 'whitespace/operators',
- 'whitespace/parens',
- 'whitespace/semicolon',
- 'whitespace/tab',
- 'whitespace/todo',
- ]
-
-# These error categories are no longer enforced by cpplint, but for backwards-
-# compatibility they may still appear in NOLINT comments.
-_LEGACY_ERROR_CATEGORIES = [
- 'readability/streams',
- ]
-
-# The default state of the category filter. This is overridden by the --filter=
-# flag. By default all errors are on, so only add here categories that should be
-# off by default (i.e., categories that must be enabled by the --filter= flags).
-# All entries here should start with a '-' or '+', as in the --filter= flag.
-_DEFAULT_FILTERS = ['-build/include_alpha']
-
-# We used to check for high-bit characters, but after much discussion we
-# decided those were OK, as long as they were in UTF-8 and didn't represent
-# hard-coded international strings, which belong in a separate i18n file.
-
-# C++ headers
-_CPP_HEADERS = frozenset([
- # Legacy
- 'algobase.h',
- 'algo.h',
- 'alloc.h',
- 'builtinbuf.h',
- 'bvector.h',
- 'complex.h',
- 'defalloc.h',
- 'deque.h',
- 'editbuf.h',
- 'fstream.h',
- 'function.h',
- 'hash_map',
- 'hash_map.h',
- 'hash_set',
- 'hash_set.h',
- 'hashtable.h',
- 'heap.h',
- 'indstream.h',
- 'iomanip.h',
- 'iostream.h',
- 'istream.h',
- 'iterator.h',
- 'list.h',
- 'map.h',
- 'multimap.h',
- 'multiset.h',
- 'ostream.h',
- 'pair.h',
- 'parsestream.h',
- 'pfstream.h',
- 'procbuf.h',
- 'pthread_alloc',
- 'pthread_alloc.h',
- 'rope',
- 'rope.h',
- 'ropeimpl.h',
- 'set.h',
- 'slist',
- 'slist.h',
- 'stack.h',
- 'stdiostream.h',
- 'stl_alloc.h',
- 'stl_relops.h',
- 'streambuf.h',
- 'stream.h',
- 'strfile.h',
- 'strstream.h',
- 'tempbuf.h',
- 'tree.h',
- 'type_traits.h',
- 'vector.h',
- # 17.6.1.2 C++ library headers
- 'algorithm',
- 'array',
- 'atomic',
- 'bitset',
- 'chrono',
- 'codecvt',
- 'complex',
- 'condition_variable',
- 'deque',
- 'exception',
- 'forward_list',
- 'fstream',
- 'functional',
- 'future',
- 'initializer_list',
- 'iomanip',
- 'ios',
- 'iosfwd',
- 'iostream',
- 'istream',
- 'iterator',
- 'limits',
- 'list',
- 'locale',
- 'map',
- 'memory',
- 'mutex',
- 'new',
- 'numeric',
- 'ostream',
- 'queue',
- 'random',
- 'ratio',
- 'regex',
- 'set',
- 'sstream',
- 'stack',
- 'stdexcept',
- 'streambuf',
- 'string',
- 'strstream',
- 'system_error',
- 'thread',
- 'tuple',
- 'typeindex',
- 'typeinfo',
- 'type_traits',
- 'unordered_map',
- 'unordered_set',
- 'utility',
- 'valarray',
- 'vector',
- # 17.6.1.2 C++ headers for C library facilities
- 'cassert',
- 'ccomplex',
- 'cctype',
- 'cerrno',
- 'cfenv',
- 'cfloat',
- 'cinttypes',
- 'ciso646',
- 'climits',
- 'clocale',
- 'cmath',
- 'csetjmp',
- 'csignal',
- 'cstdalign',
- 'cstdarg',
- 'cstdbool',
- 'cstddef',
- 'cstdint',
- 'cstdio',
- 'cstdlib',
- 'cstring',
- 'ctgmath',
- 'ctime',
- 'cuchar',
- 'cwchar',
- 'cwctype',
- ])
-
-
-# These headers are excluded from [build/include] and [build/include_order]
-# checks:
-# - Anything not following google file name conventions (containing an
-# uppercase character, such as Python.h or nsStringAPI.h, for example).
-# - Lua headers.
-_THIRD_PARTY_HEADERS_PATTERN = re.compile(
- r'^(?:[^/]*[A-Z][^/]*\.h|lua\.h|lauxlib\.h|lualib\.h)$')
-
-
-# Assertion macros. These are defined in base/logging.h and
-# testing/base/gunit.h. Note that the _M versions need to come first
-# for substring matching to work.
-_CHECK_MACROS = [
- 'DCHECK', 'CHECK',
- 'EXPECT_TRUE_M', 'EXPECT_TRUE',
- 'ASSERT_TRUE_M', 'ASSERT_TRUE',
- 'EXPECT_FALSE_M', 'EXPECT_FALSE',
- 'ASSERT_FALSE_M', 'ASSERT_FALSE',
- ]
-
-# Replacement macros for CHECK/DCHECK/EXPECT_TRUE/EXPECT_FALSE
-_CHECK_REPLACEMENT = dict([(m, {}) for m in _CHECK_MACROS])
-
-for op, replacement in [('==', 'EQ'), ('!=', 'NE'),
- ('>=', 'GE'), ('>', 'GT'),
- ('<=', 'LE'), ('<', 'LT')]:
- _CHECK_REPLACEMENT['DCHECK'][op] = 'DCHECK_%s' % replacement
- _CHECK_REPLACEMENT['CHECK'][op] = 'CHECK_%s' % replacement
- _CHECK_REPLACEMENT['EXPECT_TRUE'][op] = 'EXPECT_%s' % replacement
- _CHECK_REPLACEMENT['ASSERT_TRUE'][op] = 'ASSERT_%s' % replacement
- _CHECK_REPLACEMENT['EXPECT_TRUE_M'][op] = 'EXPECT_%s_M' % replacement
- _CHECK_REPLACEMENT['ASSERT_TRUE_M'][op] = 'ASSERT_%s_M' % replacement
-
-for op, inv_replacement in [('==', 'NE'), ('!=', 'EQ'),
- ('>=', 'LT'), ('>', 'LE'),
- ('<=', 'GT'), ('<', 'GE')]:
- _CHECK_REPLACEMENT['EXPECT_FALSE'][op] = 'EXPECT_%s' % inv_replacement
- _CHECK_REPLACEMENT['ASSERT_FALSE'][op] = 'ASSERT_%s' % inv_replacement
- _CHECK_REPLACEMENT['EXPECT_FALSE_M'][op] = 'EXPECT_%s_M' % inv_replacement
- _CHECK_REPLACEMENT['ASSERT_FALSE_M'][op] = 'ASSERT_%s_M' % inv_replacement
-
-# Alternative tokens and their replacements. For full list, see section 2.5
-# Alternative tokens [lex.digraph] in the C++ standard.
-#
-# Digraphs (such as '%:') are not included here since it's a mess to
-# match those on a word boundary.
-_ALT_TOKEN_REPLACEMENT = {
- 'and': '&&',
- 'bitor': '|',
- 'or': '||',
- 'xor': '^',
- 'compl': '~',
- 'bitand': '&',
- 'and_eq': '&=',
- 'or_eq': '|=',
- 'xor_eq': '^=',
- 'not': '!',
- 'not_eq': '!='
- }
-
-# Compile regular expression that matches all the above keywords. The "[ =()]"
-# bit is meant to avoid matching these keywords outside of boolean expressions.
-#
-# False positives include C-style multi-line comments and multi-line strings
-# but those have always been troublesome for cpplint.
-_ALT_TOKEN_REPLACEMENT_PATTERN = re.compile(
- r'[ =()](' + ('|'.join(_ALT_TOKEN_REPLACEMENT.keys())) + r')(?=[ (]|$)')
-
-
-# These constants define types of headers for use with
-# _IncludeState.CheckNextIncludeOrder().
-_C_SYS_HEADER = 1
-_CPP_SYS_HEADER = 2
-_LIKELY_MY_HEADER = 3
-_POSSIBLE_MY_HEADER = 4
-_OTHER_HEADER = 5
-
-# These constants define the current inline assembly state
-_NO_ASM = 0 # Outside of inline assembly block
-_INSIDE_ASM = 1 # Inside inline assembly block
-_END_ASM = 2 # Last line of inline assembly block
-_BLOCK_ASM = 3 # The whole block is an inline assembly block
-
-# Match start of assembly blocks
-_MATCH_ASM = re.compile(r'^\s*(?:asm|_asm|__asm|__asm__)'
- r'(?:\s+(volatile|__volatile__))?'
- r'\s*[{(]')
-
-
-_regexp_compile_cache = {}
-
-# {str, set(int)}: a map from error categories to sets of linenumbers
-# on which those errors are expected and should be suppressed.
-_error_suppressions = {}
-
-# The root directory used for deriving header guard CPP variable.
-# This is set by --root flag.
-_root = None
-
-# The allowed line length of files.
-# This is set by --linelength flag.
-_line_length = 80
-
-# The allowed extensions for file names
-# This is set by --extensions flag.
-_valid_extensions = set(['cc', 'h', 'cpp', 'cu', 'cuh'])
-
-def ParseNolintSuppressions(filename, raw_line, linenum, error):
- """Updates the global list of error-suppressions.
-
- Parses any NOLINT comments on the current line, updating the global
- error_suppressions store. Reports an error if the NOLINT comment
- was malformed.
-
- Args:
- filename: str, the name of the input file.
- raw_line: str, the line of input text, with comments.
- linenum: int, the number of the current line.
- error: function, an error handler.
- """
- matched = Search(r'\bNOLINT(NEXTLINE)?\b(\([^)]+\))?', raw_line)
- if matched:
- if matched.group(1):
- suppressed_line = linenum + 1
- else:
- suppressed_line = linenum
- category = matched.group(2)
- if category in (None, '(*)'): # => "suppress all"
- _error_suppressions.setdefault(None, set()).add(suppressed_line)
- else:
- if category.startswith('(') and category.endswith(')'):
- category = category[1:-1]
- if category in _ERROR_CATEGORIES:
- _error_suppressions.setdefault(category, set()).add(suppressed_line)
- elif category not in _LEGACY_ERROR_CATEGORIES:
- error(filename, linenum, 'readability/nolint', 5,
- 'Unknown NOLINT error category: %s' % category)
-
-
-def ResetNolintSuppressions():
- """Resets the set of NOLINT suppressions to empty."""
- _error_suppressions.clear()
-
-
-def IsErrorSuppressedByNolint(category, linenum):
- """Returns true if the specified error category is suppressed on this line.
-
- Consults the global error_suppressions map populated by
- ParseNolintSuppressions/ResetNolintSuppressions.
-
- Args:
- category: str, the category of the error.
- linenum: int, the current line number.
- Returns:
- bool, True iff the error should be suppressed due to a NOLINT comment.
- """
- return (linenum in _error_suppressions.get(category, set()) or
- linenum in _error_suppressions.get(None, set()))
-
-
-def Match(pattern, s):
- """Matches the string with the pattern, caching the compiled regexp."""
- # The regexp compilation caching is inlined in both Match and Search for
- # performance reasons; factoring it out into a separate function turns out
- # to be noticeably expensive.
- if pattern not in _regexp_compile_cache:
- _regexp_compile_cache[pattern] = sre_compile.compile(pattern)
- return _regexp_compile_cache[pattern].match(s)
-
-
-def ReplaceAll(pattern, rep, s):
- """Replaces instances of pattern in a string with a replacement.
-
- The compiled regex is kept in a cache shared by Match and Search.
-
- Args:
- pattern: regex pattern
- rep: replacement text
- s: search string
-
- Returns:
- string with replacements made (or original string if no replacements)
- """
- if pattern not in _regexp_compile_cache:
- _regexp_compile_cache[pattern] = sre_compile.compile(pattern)
- return _regexp_compile_cache[pattern].sub(rep, s)
-
-
-def Search(pattern, s):
- """Searches the string for the pattern, caching the compiled regexp."""
- if pattern not in _regexp_compile_cache:
- _regexp_compile_cache[pattern] = sre_compile.compile(pattern)
- return _regexp_compile_cache[pattern].search(s)
-
-
-class _IncludeState(object):
- """Tracks line numbers for includes, and the order in which includes appear.
-
- include_list contains list of lists of (header, line number) pairs.
- It's a lists of lists rather than just one flat list to make it
- easier to update across preprocessor boundaries.
-
- Call CheckNextIncludeOrder() once for each header in the file, passing
- in the type constants defined above. Calls in an illegal order will
- raise an _IncludeError with an appropriate error message.
-
- """
- # self._section will move monotonically through this set. If it ever
- # needs to move backwards, CheckNextIncludeOrder will raise an error.
- _INITIAL_SECTION = 0
- _MY_H_SECTION = 1
- _C_SECTION = 2
- _CPP_SECTION = 3
- _OTHER_H_SECTION = 4
-
- _TYPE_NAMES = {
- _C_SYS_HEADER: 'C system header',
- _CPP_SYS_HEADER: 'C++ system header',
- _LIKELY_MY_HEADER: 'header this file implements',
- _POSSIBLE_MY_HEADER: 'header this file may implement',
- _OTHER_HEADER: 'other header',
- }
- _SECTION_NAMES = {
- _INITIAL_SECTION: "... nothing. (This can't be an error.)",
- _MY_H_SECTION: 'a header this file implements',
- _C_SECTION: 'C system header',
- _CPP_SECTION: 'C++ system header',
- _OTHER_H_SECTION: 'other header',
- }
-
- def __init__(self):
- self.include_list = [[]]
- self.ResetSection('')
-
- def FindHeader(self, header):
- """Check if a header has already been included.
-
- Args:
- header: header to check.
- Returns:
- Line number of previous occurrence, or -1 if the header has not
- been seen before.
- """
- for section_list in self.include_list:
- for f in section_list:
- if f[0] == header:
- return f[1]
- return -1
-
- def ResetSection(self, directive):
- """Reset section checking for preprocessor directive.
-
- Args:
- directive: preprocessor directive (e.g. "if", "else").
- """
- # The name of the current section.
- self._section = self._INITIAL_SECTION
- # The path of last found header.
- self._last_header = ''
-
- # Update list of includes. Note that we never pop from the
- # include list.
- if directive in ('if', 'ifdef', 'ifndef'):
- self.include_list.append([])
- elif directive in ('else', 'elif'):
- self.include_list[-1] = []
-
- def SetLastHeader(self, header_path):
- self._last_header = header_path
-
- def CanonicalizeAlphabeticalOrder(self, header_path):
- """Returns a path canonicalized for alphabetical comparison.
-
- - replaces "-" with "_" so they both cmp the same.
- - removes '-inl' since we don't require them to be after the main header.
- - lowercase everything, just in case.
-
- Args:
- header_path: Path to be canonicalized.
-
- Returns:
- Canonicalized path.
- """
- return header_path.replace('-inl.h', '.h').replace('-', '_').lower()
-
- def IsInAlphabeticalOrder(self, clean_lines, linenum, header_path):
- """Check if a header is in alphabetical order with the previous header.
-
- Args:
- clean_lines: A CleansedLines instance containing the file.
- linenum: The number of the line to check.
- header_path: Canonicalized header to be checked.
-
- Returns:
- Returns true if the header is in alphabetical order.
- """
- # If previous section is different from current section, _last_header will
- # be reset to empty string, so it's always less than current header.
- #
- # If previous line was a blank line, assume that the headers are
- # intentionally sorted the way they are.
- if (self._last_header > header_path and
- Match(r'^\s*#\s*include\b', clean_lines.elided[linenum - 1])):
- return False
- return True
-
- def CheckNextIncludeOrder(self, header_type):
- """Returns a non-empty error message if the next header is out of order.
-
- This function also updates the internal state to be ready to check
- the next include.
-
- Args:
- header_type: One of the _XXX_HEADER constants defined above.
-
- Returns:
- The empty string if the header is in the right order, or an
- error message describing what's wrong.
-
- """
- error_message = ('Found %s after %s' %
- (self._TYPE_NAMES[header_type],
- self._SECTION_NAMES[self._section]))
-
- last_section = self._section
-
- if header_type == _C_SYS_HEADER:
- if self._section <= self._C_SECTION:
- self._section = self._C_SECTION
- else:
- self._last_header = ''
- return error_message
- elif header_type == _CPP_SYS_HEADER:
- if self._section <= self._CPP_SECTION:
- self._section = self._CPP_SECTION
- else:
- self._last_header = ''
- return error_message
- elif header_type == _LIKELY_MY_HEADER:
- if self._section <= self._MY_H_SECTION:
- self._section = self._MY_H_SECTION
- else:
- self._section = self._OTHER_H_SECTION
- elif header_type == _POSSIBLE_MY_HEADER:
- if self._section <= self._MY_H_SECTION:
- self._section = self._MY_H_SECTION
- else:
- # This will always be the fallback because we're not sure
- # enough that the header is associated with this file.
- self._section = self._OTHER_H_SECTION
- else:
- assert header_type == _OTHER_HEADER
- self._section = self._OTHER_H_SECTION
-
- if last_section != self._section:
- self._last_header = ''
-
- return ''
-
-
-class _CppLintState(object):
- """Maintains module-wide state.."""
-
- def __init__(self):
- self.verbose_level = 1 # global setting.
- self.error_count = 0 # global count of reported errors
- # filters to apply when emitting error messages
- self.filters = _DEFAULT_FILTERS[:]
- # backup of filter list. Used to restore the state after each file.
- self._filters_backup = self.filters[:]
- self.counting = 'total' # In what way are we counting errors?
- self.errors_by_category = {} # string to int dict storing error counts
-
- # output format:
- # "emacs" - format that emacs can parse (default)
- # "vs7" - format that Microsoft Visual Studio 7 can parse
- self.output_format = 'emacs'
-
- def SetOutputFormat(self, output_format):
- """Sets the output format for errors."""
- self.output_format = output_format
-
- def SetVerboseLevel(self, level):
- """Sets the module's verbosity, and returns the previous setting."""
- last_verbose_level = self.verbose_level
- self.verbose_level = level
- return last_verbose_level
-
- def SetCountingStyle(self, counting_style):
- """Sets the module's counting options."""
- self.counting = counting_style
-
- def SetFilters(self, filters):
- """Sets the error-message filters.
-
- These filters are applied when deciding whether to emit a given
- error message.
-
- Args:
- filters: A string of comma-separated filters (eg "+whitespace/indent").
- Each filter should start with + or -; else we die.
-
- Raises:
- ValueError: The comma-separated filters did not all start with '+' or '-'.
- E.g. "-,+whitespace,-whitespace/indent,whitespace/badfilter"
- """
- # Default filters always have less priority than the flag ones.
- self.filters = _DEFAULT_FILTERS[:]
- self.AddFilters(filters)
-
- def AddFilters(self, filters):
- """ Adds more filters to the existing list of error-message filters. """
- for filt in filters.split(','):
- clean_filt = filt.strip()
- if clean_filt:
- self.filters.append(clean_filt)
- for filt in self.filters:
- if not (filt.startswith('+') or filt.startswith('-')):
- raise ValueError('Every filter in --filters must start with + or -'
- ' (%s does not)' % filt)
-
- def BackupFilters(self):
- """ Saves the current filter list to backup storage."""
- self._filters_backup = self.filters[:]
-
- def RestoreFilters(self):
- """ Restores filters previously backed up."""
- self.filters = self._filters_backup[:]
-
- def ResetErrorCounts(self):
- """Sets the module's error statistic back to zero."""
- self.error_count = 0
- self.errors_by_category = {}
-
- def IncrementErrorCount(self, category):
- """Bumps the module's error statistic."""
- self.error_count += 1
- if self.counting in ('toplevel', 'detailed'):
- if self.counting != 'detailed':
- category = category.split('/')[0]
- if category not in self.errors_by_category:
- self.errors_by_category[category] = 0
- self.errors_by_category[category] += 1
-
- def PrintErrorCounts(self):
- """Print a summary of errors by category, and the total."""
- for category, count in self.errors_by_category.iteritems():
- sys.stderr.write('Category \'%s\' errors found: %d\n' %
- (category, count))
- sys.stderr.write('Total errors found: %d\n' % self.error_count)
-
-_cpplint_state = _CppLintState()
-
-
-def _OutputFormat():
- """Gets the module's output format."""
- return _cpplint_state.output_format
-
-
-def _SetOutputFormat(output_format):
- """Sets the module's output format."""
- _cpplint_state.SetOutputFormat(output_format)
-
-
-def _VerboseLevel():
- """Returns the module's verbosity setting."""
- return _cpplint_state.verbose_level
-
-
-def _SetVerboseLevel(level):
- """Sets the module's verbosity, and returns the previous setting."""
- return _cpplint_state.SetVerboseLevel(level)
-
-
-def _SetCountingStyle(level):
- """Sets the module's counting options."""
- _cpplint_state.SetCountingStyle(level)
-
-
-def _Filters():
- """Returns the module's list of output filters, as a list."""
- return _cpplint_state.filters
-
-
-def _SetFilters(filters):
- """Sets the module's error-message filters.
-
- These filters are applied when deciding whether to emit a given
- error message.
-
- Args:
- filters: A string of comma-separated filters (eg "whitespace/indent").
- Each filter should start with + or -; else we die.
- """
- _cpplint_state.SetFilters(filters)
-
-def _AddFilters(filters):
- """Adds more filter overrides.
-
- Unlike _SetFilters, this function does not reset the current list of filters
- available.
-
- Args:
- filters: A string of comma-separated filters (eg "whitespace/indent").
- Each filter should start with + or -; else we die.
- """
- _cpplint_state.AddFilters(filters)
-
-def _BackupFilters():
- """ Saves the current filter list to backup storage."""
- _cpplint_state.BackupFilters()
-
-def _RestoreFilters():
- """ Restores filters previously backed up."""
- _cpplint_state.RestoreFilters()
-
-class _FunctionState(object):
- """Tracks current function name and the number of lines in its body."""
-
- _NORMAL_TRIGGER = 250 # for --v=0, 500 for --v=1, etc.
- _TEST_TRIGGER = 400 # about 50% more than _NORMAL_TRIGGER.
-
- def __init__(self):
- self.in_a_function = False
- self.lines_in_function = 0
- self.current_function = ''
-
- def Begin(self, function_name):
- """Start analyzing function body.
-
- Args:
- function_name: The name of the function being tracked.
- """
- self.in_a_function = True
- self.lines_in_function = 0
- self.current_function = function_name
-
- def Count(self):
- """Count line in current function body."""
- if self.in_a_function:
- self.lines_in_function += 1
-
- def Check(self, error, filename, linenum):
- """Report if too many lines in function body.
-
- Args:
- error: The function to call with any errors found.
- filename: The name of the current file.
- linenum: The number of the line to check.
- """
- if Match(r'T(EST|est)', self.current_function):
- base_trigger = self._TEST_TRIGGER
- else:
- base_trigger = self._NORMAL_TRIGGER
- trigger = base_trigger * 2**_VerboseLevel()
-
- if self.lines_in_function > trigger:
- error_level = int(math.log(self.lines_in_function / base_trigger, 2))
- # 50 => 0, 100 => 1, 200 => 2, 400 => 3, 800 => 4, 1600 => 5, ...
- if error_level > 5:
- error_level = 5
- error(filename, linenum, 'readability/fn_size', error_level,
- 'Small and focused functions are preferred:'
- ' %s has %d non-comment lines'
- ' (error triggered by exceeding %d lines).' % (
- self.current_function, self.lines_in_function, trigger))
-
- def End(self):
- """Stop analyzing function body."""
- self.in_a_function = False
-
-
-class _IncludeError(Exception):
- """Indicates a problem with the include order in a file."""
- pass
-
-
-class FileInfo(object):
- """Provides utility functions for filenames.
-
- FileInfo provides easy access to the components of a file's path
- relative to the project root.
- """
-
- def __init__(self, filename):
- self._filename = filename
-
- def FullName(self):
- """Make Windows paths like Unix."""
- return os.path.abspath(self._filename).replace('\\', '/')
-
- def RepositoryName(self):
- """FullName after removing the local path to the repository.
-
- If we have a real absolute path name here we can try to do something smart:
- detecting the root of the checkout and truncating /path/to/checkout from
- the name so that we get header guards that don't include things like
- "C:\Documents and Settings\..." or "/home/username/..." in them and thus
- people on different computers who have checked the source out to different
- locations won't see bogus errors.
- """
- fullname = self.FullName()
-
- if os.path.exists(fullname):
- project_dir = os.path.dirname(fullname)
-
- if os.path.exists(os.path.join(project_dir, ".svn")):
- # If there's a .svn file in the current directory, we recursively look
- # up the directory tree for the top of the SVN checkout
- root_dir = project_dir
- one_up_dir = os.path.dirname(root_dir)
- while os.path.exists(os.path.join(one_up_dir, ".svn")):
- root_dir = os.path.dirname(root_dir)
- one_up_dir = os.path.dirname(one_up_dir)
-
- prefix = os.path.commonprefix([root_dir, project_dir])
- return fullname[len(prefix) + 1:]
-
- # Not SVN <= 1.6? Try to find a git, hg, or svn top level directory by
- # searching up from the current path.
- root_dir = os.path.dirname(fullname)
- while (root_dir != os.path.dirname(root_dir) and
- not os.path.exists(os.path.join(root_dir, ".git")) and
- not os.path.exists(os.path.join(root_dir, ".hg")) and
- not os.path.exists(os.path.join(root_dir, ".svn"))):
- root_dir = os.path.dirname(root_dir)
-
- if (os.path.exists(os.path.join(root_dir, ".git")) or
- os.path.exists(os.path.join(root_dir, ".hg")) or
- os.path.exists(os.path.join(root_dir, ".svn"))):
- prefix = os.path.commonprefix([root_dir, project_dir])
- return fullname[len(prefix) + 1:]
-
- # Don't know what to do; header guard warnings may be wrong...
- return fullname
-
- def Split(self):
- """Splits the file into the directory, basename, and extension.
-
- For 'chrome/browser/browser.cc', Split() would
- return ('chrome/browser', 'browser', '.cc')
-
- Returns:
- A tuple of (directory, basename, extension).
- """
-
- googlename = self.RepositoryName()
- project, rest = os.path.split(googlename)
- return (project,) + os.path.splitext(rest)
-
- def BaseName(self):
- """File base name - text after the final slash, before the final period."""
- return self.Split()[1]
-
- def Extension(self):
- """File extension - text following the final period."""
- return self.Split()[2]
-
- def NoExtension(self):
- """File has no source file extension."""
- return '/'.join(self.Split()[0:2])
-
- def IsSource(self):
- """File has a source file extension."""
- return self.Extension()[1:] in ('c', 'cc', 'cpp', 'cxx')
-
-
-def _ShouldPrintError(category, confidence, linenum):
- """If confidence >= verbose, category passes filter and is not suppressed."""
-
- # There are three ways we might decide not to print an error message:
- # a "NOLINT(category)" comment appears in the source,
- # the verbosity level isn't high enough, or the filters filter it out.
- if IsErrorSuppressedByNolint(category, linenum):
- return False
-
- if confidence < _cpplint_state.verbose_level:
- return False
-
- is_filtered = False
- for one_filter in _Filters():
- if one_filter.startswith('-'):
- if category.startswith(one_filter[1:]):
- is_filtered = True
- elif one_filter.startswith('+'):
- if category.startswith(one_filter[1:]):
- is_filtered = False
- else:
- assert False # should have been checked for in SetFilter.
- if is_filtered:
- return False
-
- return True
-
-
-def Error(filename, linenum, category, confidence, message):
- """Logs the fact we've found a lint error.
-
- We log where the error was found, and also our confidence in the error,
- that is, how certain we are this is a legitimate style regression, and
- not a misidentification or a use that's sometimes justified.
-
- False positives can be suppressed by the use of
- "cpplint(category)" comments on the offending line. These are
- parsed into _error_suppressions.
-
- Args:
- filename: The name of the file containing the error.
- linenum: The number of the line containing the error.
- category: A string used to describe the "category" this bug
- falls under: "whitespace", say, or "runtime". Categories
- may have a hierarchy separated by slashes: "whitespace/indent".
- confidence: A number from 1-5 representing a confidence score for
- the error, with 5 meaning that we are certain of the problem,
- and 1 meaning that it could be a legitimate construct.
- message: The error message.
- """
- if _ShouldPrintError(category, confidence, linenum):
- _cpplint_state.IncrementErrorCount(category)
- if _cpplint_state.output_format == 'vs7':
- sys.stderr.write('%s(%s): %s [%s] [%d]\n' % (
- filename, linenum, message, category, confidence))
- elif _cpplint_state.output_format == 'eclipse':
- sys.stderr.write('%s:%s: warning: %s [%s] [%d]\n' % (
- filename, linenum, message, category, confidence))
- else:
- sys.stderr.write('%s:%s: %s [%s] [%d]\n' % (
- filename, linenum, message, category, confidence))
-
-
-# Matches standard C++ escape sequences per 2.13.2.3 of the C++ standard.
-_RE_PATTERN_CLEANSE_LINE_ESCAPES = re.compile(
- r'\\([abfnrtv?"\\\']|\d+|x[0-9a-fA-F]+)')
-# Match a single C style comment on the same line.
-_RE_PATTERN_C_COMMENTS = r'/\*(?:[^*]|\*(?!/))*\*/'
-# Matches multi-line C style comments.
-# This RE is a little bit more complicated than one might expect, because we
-# have to take care of space removals tools so we can handle comments inside
-# statements better.
-# The current rule is: We only clear spaces from both sides when we're at the
-# end of the line. Otherwise, we try to remove spaces from the right side,
-# if this doesn't work we try on left side but only if there's a non-character
-# on the right.
-_RE_PATTERN_CLEANSE_LINE_C_COMMENTS = re.compile(
- r'(\s*' + _RE_PATTERN_C_COMMENTS + r'\s*$|' +
- _RE_PATTERN_C_COMMENTS + r'\s+|' +
- r'\s+' + _RE_PATTERN_C_COMMENTS + r'(?=\W)|' +
- _RE_PATTERN_C_COMMENTS + r')')
-
-
-def IsCppString(line):
- """Does line terminate so, that the next symbol is in string constant.
-
- This function does not consider single-line nor multi-line comments.
-
- Args:
- line: is a partial line of code starting from the 0..n.
-
- Returns:
- True, if next character appended to 'line' is inside a
- string constant.
- """
-
- line = line.replace(r'\\', 'XX') # after this, \\" does not match to \"
- return ((line.count('"') - line.count(r'\"') - line.count("'\"'")) & 1) == 1
-
-
-def CleanseRawStrings(raw_lines):
- """Removes C++11 raw strings from lines.
-
- Before:
- static const char kData[] = R"(
- multi-line string
- )";
-
- After:
- static const char kData[] = ""
- (replaced by blank line)
- "";
-
- Args:
- raw_lines: list of raw lines.
-
- Returns:
- list of lines with C++11 raw strings replaced by empty strings.
- """
-
- delimiter = None
- lines_without_raw_strings = []
- for line in raw_lines:
- if delimiter:
- # Inside a raw string, look for the end
- end = line.find(delimiter)
- if end >= 0:
- # Found the end of the string, match leading space for this
- # line and resume copying the original lines, and also insert
- # a "" on the last line.
- leading_space = Match(r'^(\s*)\S', line)
- line = leading_space.group(1) + '""' + line[end + len(delimiter):]
- delimiter = None
- else:
- # Haven't found the end yet, append a blank line.
- line = '""'
-
- # Look for beginning of a raw string, and replace them with
- # empty strings. This is done in a loop to handle multiple raw
- # strings on the same line.
- while delimiter is None:
- # Look for beginning of a raw string.
- # See 2.14.15 [lex.string] for syntax.
- matched = Match(r'^(.*)\b(?:R|u8R|uR|UR|LR)"([^\s\\()]*)\((.*)$', line)
- if matched:
- delimiter = ')' + matched.group(2) + '"'
-
- end = matched.group(3).find(delimiter)
- if end >= 0:
- # Raw string ended on same line
- line = (matched.group(1) + '""' +
- matched.group(3)[end + len(delimiter):])
- delimiter = None
- else:
- # Start of a multi-line raw string
- line = matched.group(1) + '""'
- else:
- break
-
- lines_without_raw_strings.append(line)
-
- # TODO(unknown): if delimiter is not None here, we might want to
- # emit a warning for unterminated string.
- return lines_without_raw_strings
-
-
-def FindNextMultiLineCommentStart(lines, lineix):
- """Find the beginning marker for a multiline comment."""
- while lineix < len(lines):
- if lines[lineix].strip().startswith('/*'):
- # Only return this marker if the comment goes beyond this line
- if lines[lineix].strip().find('*/', 2) < 0:
- return lineix
- lineix += 1
- return len(lines)
-
-
-def FindNextMultiLineCommentEnd(lines, lineix):
- """We are inside a comment, find the end marker."""
- while lineix < len(lines):
- if lines[lineix].strip().endswith('*/'):
- return lineix
- lineix += 1
- return len(lines)
-
-
-def RemoveMultiLineCommentsFromRange(lines, begin, end):
- """Clears a range of lines for multi-line comments."""
- # Having // dummy comments makes the lines non-empty, so we will not get
- # unnecessary blank line warnings later in the code.
- for i in range(begin, end):
- lines[i] = '/**/'
-
-
-def RemoveMultiLineComments(filename, lines, error):
- """Removes multiline (c-style) comments from lines."""
- lineix = 0
- while lineix < len(lines):
- lineix_begin = FindNextMultiLineCommentStart(lines, lineix)
- if lineix_begin >= len(lines):
- return
- lineix_end = FindNextMultiLineCommentEnd(lines, lineix_begin)
- if lineix_end >= len(lines):
- error(filename, lineix_begin + 1, 'readability/multiline_comment', 5,
- 'Could not find end of multi-line comment')
- return
- RemoveMultiLineCommentsFromRange(lines, lineix_begin, lineix_end + 1)
- lineix = lineix_end + 1
-
-
-def CleanseComments(line):
- """Removes //-comments and single-line C-style /* */ comments.
-
- Args:
- line: A line of C++ source.
-
- Returns:
- The line with single-line comments removed.
- """
- commentpos = line.find('//')
- if commentpos != -1 and not IsCppString(line[:commentpos]):
- line = line[:commentpos].rstrip()
- # get rid of /* ... */
- return _RE_PATTERN_CLEANSE_LINE_C_COMMENTS.sub('', line)
-
-
-class CleansedLines(object):
- """Holds 4 copies of all lines with different preprocessing applied to them.
-
- 1) elided member contains lines without strings and comments.
- 2) lines member contains lines without comments.
- 3) raw_lines member contains all the lines without processing.
- 4) lines_without_raw_strings member is same as raw_lines, but with C++11 raw
- strings removed.
- All these members are of <type 'list'>, and of the same length.
- """
-
- def __init__(self, lines):
- self.elided = []
- self.lines = []
- self.raw_lines = lines
- self.num_lines = len(lines)
- self.lines_without_raw_strings = CleanseRawStrings(lines)
- for linenum in range(len(self.lines_without_raw_strings)):
- self.lines.append(CleanseComments(
- self.lines_without_raw_strings[linenum]))
- elided = self._CollapseStrings(self.lines_without_raw_strings[linenum])
- self.elided.append(CleanseComments(elided))
-
- def NumLines(self):
- """Returns the number of lines represented."""
- return self.num_lines
-
- @staticmethod
- def _CollapseStrings(elided):
- """Collapses strings and chars on a line to simple "" or '' blocks.
-
- We nix strings first so we're not fooled by text like '"http://"'
-
- Args:
- elided: The line being processed.
-
- Returns:
- The line with collapsed strings.
- """
- if _RE_PATTERN_INCLUDE.match(elided):
- return elided
-
- # Remove escaped characters first to make quote/single quote collapsing
- # basic. Things that look like escaped characters shouldn't occur
- # outside of strings and chars.
- elided = _RE_PATTERN_CLEANSE_LINE_ESCAPES.sub('', elided)
-
- # Replace quoted strings and digit separators. Both single quotes
- # and double quotes are processed in the same loop, otherwise
- # nested quotes wouldn't work.
- collapsed = ''
- while True:
- # Find the first quote character
- match = Match(r'^([^\'"]*)([\'"])(.*)$', elided)
- if not match:
- collapsed += elided
- break
- head, quote, tail = match.groups()
-
- if quote == '"':
- # Collapse double quoted strings
- second_quote = tail.find('"')
- if second_quote >= 0:
- collapsed += head + '""'
- elided = tail[second_quote + 1:]
- else:
- # Unmatched double quote, don't bother processing the rest
- # of the line since this is probably a multiline string.
- collapsed += elided
- break
- else:
- # Found single quote, check nearby text to eliminate digit separators.
- #
- # There is no special handling for floating point here, because
- # the integer/fractional/exponent parts would all be parsed
- # correctly as long as there are digits on both sides of the
- # separator. So we are fine as long as we don't see something
- # like "0.'3" (gcc 4.9.0 will not allow this literal).
- if Search(r'\b(?:0[bBxX]?|[1-9])[0-9a-fA-F]*$', head):
- match_literal = Match(r'^((?:\'?[0-9a-zA-Z_])*)(.*)$', "'" + tail)
- collapsed += head + match_literal.group(1).replace("'", '')
- elided = match_literal.group(2)
- else:
- second_quote = tail.find('\'')
- if second_quote >= 0:
- collapsed += head + "''"
- elided = tail[second_quote + 1:]
- else:
- # Unmatched single quote
- collapsed += elided
- break
-
- return collapsed
-
-
-def FindEndOfExpressionInLine(line, startpos, stack):
- """Find the position just after the end of current parenthesized expression.
-
- Args:
- line: a CleansedLines line.
- startpos: start searching at this position.
- stack: nesting stack at startpos.
-
- Returns:
- On finding matching end: (index just after matching end, None)
- On finding an unclosed expression: (-1, None)
- Otherwise: (-1, new stack at end of this line)
- """
- for i in xrange(startpos, len(line)):
- char = line[i]
- if char in '([{':
- # Found start of parenthesized expression, push to expression stack
- stack.append(char)
- elif char == '<':
- # Found potential start of template argument list
- if i > 0 and line[i - 1] == '<':
- # Left shift operator
- if stack and stack[-1] == '<':
- stack.pop()
- if not stack:
- return (-1, None)
- elif i > 0 and Search(r'\boperator\s*$', line[0:i]):
- # operator<, don't add to stack
- continue
- else:
- # Tentative start of template argument list
- stack.append('<')
- elif char in ')]}':
- # Found end of parenthesized expression.
- #
- # If we are currently expecting a matching '>', the pending '<'
- # must have been an operator. Remove them from expression stack.
- while stack and stack[-1] == '<':
- stack.pop()
- if not stack:
- return (-1, None)
- if ((stack[-1] == '(' and char == ')') or
- (stack[-1] == '[' and char == ']') or
- (stack[-1] == '{' and char == '}')):
- stack.pop()
- if not stack:
- return (i + 1, None)
- else:
- # Mismatched parentheses
- return (-1, None)
- elif char == '>':
- # Found potential end of template argument list.
-
- # Ignore "->" and operator functions
- if (i > 0 and
- (line[i - 1] == '-' or Search(r'\boperator\s*$', line[0:i - 1]))):
- continue
-
- # Pop the stack if there is a matching '<'. Otherwise, ignore
- # this '>' since it must be an operator.
- if stack:
- if stack[-1] == '<':
- stack.pop()
- if not stack:
- return (i + 1, None)
- elif char == ';':
- # Found something that look like end of statements. If we are currently
- # expecting a '>', the matching '<' must have been an operator, since
- # template argument list should not contain statements.
- while stack and stack[-1] == '<':
- stack.pop()
- if not stack:
- return (-1, None)
-
- # Did not find end of expression or unbalanced parentheses on this line
- return (-1, stack)
-
-
-def CloseExpression(clean_lines, linenum, pos):
- """If input points to ( or { or [ or <, finds the position that closes it.
-
- If lines[linenum][pos] points to a '(' or '{' or '[' or '<', finds the
- linenum/pos that correspond to the closing of the expression.
-
- TODO(unknown): cpplint spends a fair bit of time matching parentheses.
- Ideally we would want to index all opening and closing parentheses once
- and have CloseExpression be just a simple lookup, but due to preprocessor
- tricks, this is not so easy.
-
- Args:
- clean_lines: A CleansedLines instance containing the file.
- linenum: The number of the line to check.
- pos: A position on the line.
-
- Returns:
- A tuple (line, linenum, pos) pointer *past* the closing brace, or
- (line, len(lines), -1) if we never find a close. Note we ignore
- strings and comments when matching; and the line we return is the
- 'cleansed' line at linenum.
- """
-
- line = clean_lines.elided[linenum]
- if (line[pos] not in '({[<') or Match(r'<[<=]', line[pos:]):
- return (line, clean_lines.NumLines(), -1)
-
- # Check first line
- (end_pos, stack) = FindEndOfExpressionInLine(line, pos, [])
- if end_pos > -1:
- return (line, linenum, end_pos)
-
- # Continue scanning forward
- while stack and linenum < clean_lines.NumLines() - 1:
- linenum += 1
- line = clean_lines.elided[linenum]
- (end_pos, stack) = FindEndOfExpressionInLine(line, 0, stack)
- if end_pos > -1:
- return (line, linenum, end_pos)
-
- # Did not find end of expression before end of file, give up
- return (line, clean_lines.NumLines(), -1)
-
-
-def FindStartOfExpressionInLine(line, endpos, stack):
- """Find position at the matching start of current expression.
-
- This is almost the reverse of FindEndOfExpressionInLine, but note
- that the input position and returned position differs by 1.
-
- Args:
- line: a CleansedLines line.
- endpos: start searching at this position.
- stack: nesting stack at endpos.
-
- Returns:
- On finding matching start: (index at matching start, None)
- On finding an unclosed expression: (-1, None)
- Otherwise: (-1, new stack at beginning of this line)
- """
- i = endpos
- while i >= 0:
- char = line[i]
- if char in ')]}':
- # Found end of expression, push to expression stack
- stack.append(char)
- elif char == '>':
- # Found potential end of template argument list.
- #
- # Ignore it if it's a "->" or ">=" or "operator>"
- if (i > 0 and
- (line[i - 1] == '-' or
- Match(r'\s>=\s', line[i - 1:]) or
- Search(r'\boperator\s*$', line[0:i]))):
- i -= 1
- else:
- stack.append('>')
- elif char == '<':
- # Found potential start of template argument list
- if i > 0 and line[i - 1] == '<':
- # Left shift operator
- i -= 1
- else:
- # If there is a matching '>', we can pop the expression stack.
- # Otherwise, ignore this '<' since it must be an operator.
- if stack and stack[-1] == '>':
- stack.pop()
- if not stack:
- return (i, None)
- elif char in '([{':
- # Found start of expression.
- #
- # If there are any unmatched '>' on the stack, they must be
- # operators. Remove those.
- while stack and stack[-1] == '>':
- stack.pop()
- if not stack:
- return (-1, None)
- if ((char == '(' and stack[-1] == ')') or
- (char == '[' and stack[-1] == ']') or
- (char == '{' and stack[-1] == '}')):
- stack.pop()
- if not stack:
- return (i, None)
- else:
- # Mismatched parentheses
- return (-1, None)
- elif char == ';':
- # Found something that look like end of statements. If we are currently
- # expecting a '<', the matching '>' must have been an operator, since
- # template argument list should not contain statements.
- while stack and stack[-1] == '>':
- stack.pop()
- if not stack:
- return (-1, None)
-
- i -= 1
-
- return (-1, stack)
-
-
-def ReverseCloseExpression(clean_lines, linenum, pos):
- """If input points to ) or } or ] or >, finds the position that opens it.
-
- If lines[linenum][pos] points to a ')' or '}' or ']' or '>', finds the
- linenum/pos that correspond to the opening of the expression.
-
- Args:
- clean_lines: A CleansedLines instance containing the file.
- linenum: The number of the line to check.
- pos: A position on the line.
-
- Returns:
- A tuple (line, linenum, pos) pointer *at* the opening brace, or
- (line, 0, -1) if we never find the matching opening brace. Note
- we ignore strings and comments when matching; and the line we
- return is the 'cleansed' line at linenum.
- """
- line = clean_lines.elided[linenum]
- if line[pos] not in ')}]>':
- return (line, 0, -1)
-
- # Check last line
- (start_pos, stack) = FindStartOfExpressionInLine(line, pos, [])
- if start_pos > -1:
- return (line, linenum, start_pos)
-
- # Continue scanning backward
- while stack and linenum > 0:
- linenum -= 1
- line = clean_lines.elided[linenum]
- (start_pos, stack) = FindStartOfExpressionInLine(line, len(line) - 1, stack)
- if start_pos > -1:
- return (line, linenum, start_pos)
-
- # Did not find start of expression before beginning of file, give up
- return (line, 0, -1)
-
-
-def CheckForCopyright(filename, lines, error):
- """Logs an error if no Copyright message appears at the top of the file."""
-
- # We'll say it should occur by line 10. Don't forget there's a
- # dummy line at the front.
- for line in xrange(1, min(len(lines), 11)):
- if re.search(r'Copyright', lines[line], re.I): break
- else: # means no copyright line was found
- error(filename, 0, 'legal/copyright', 5,
- 'No copyright message found. '
- 'You should have a line: "Copyright [year] <Copyright Owner>"')
-
-
-def GetIndentLevel(line):
- """Return the number of leading spaces in line.
-
- Args:
- line: A string to check.
-
- Returns:
- An integer count of leading spaces, possibly zero.
- """
- indent = Match(r'^( *)\S', line)
- if indent:
- return len(indent.group(1))
- else:
- return 0
-
-
-def GetHeaderGuardCPPVariable(filename):
- """Returns the CPP variable that should be used as a header guard.
-
- Args:
- filename: The name of a C++ header file.
-
- Returns:
- The CPP variable that should be used as a header guard in the
- named file.
-
- """
-
- # Restores original filename in case that cpplint is invoked from Emacs's
- # flymake.
- filename = re.sub(r'_flymake\.h$', '.h', filename)
- filename = re.sub(r'/\.flymake/([^/]*)$', r'/\1', filename)
- # Replace 'c++' with 'cpp'.
- filename = filename.replace('C++', 'cpp').replace('c++', 'cpp')
-
- fileinfo = FileInfo(filename)
- file_path_from_root = fileinfo.RepositoryName()
- if _root:
- file_path_from_root = re.sub('^' + _root + os.sep, '', file_path_from_root)
- return re.sub(r'[^a-zA-Z0-9]', '_', file_path_from_root).upper() + '_'
-
-
-def CheckForHeaderGuard(filename, clean_lines, error):
- """Checks that the file contains a header guard.
-
- Logs an error if no #ifndef header guard is present. For other
- headers, checks that the full pathname is used.
-
- Args:
- filename: The name of the C++ header file.
- clean_lines: A CleansedLines instance containing the file.
- error: The function to call with any errors found.
- """
-
- # Don't check for header guards if there are error suppression
- # comments somewhere in this file.
- #
- # Because this is silencing a warning for a nonexistent line, we
- # only support the very specific NOLINT(build/header_guard) syntax,
- # and not the general NOLINT or NOLINT(*) syntax.
- raw_lines = clean_lines.lines_without_raw_strings
- for i in raw_lines:
- if Search(r'//\s*NOLINT\(build/header_guard\)', i):
- return
-
- cppvar = GetHeaderGuardCPPVariable(filename)
-
- ifndef = ''
- ifndef_linenum = 0
- define = ''
- endif = ''
- endif_linenum = 0
- for linenum, line in enumerate(raw_lines):
- linesplit = line.split()
- if len(linesplit) >= 2:
- # find the first occurrence of #ifndef and #define, save arg
- if not ifndef and linesplit[0] == '#ifndef':
- # set ifndef to the header guard presented on the #ifndef line.
- ifndef = linesplit[1]
- ifndef_linenum = linenum
- if not define and linesplit[0] == '#define':
- define = linesplit[1]
- # find the last occurrence of #endif, save entire line
- if line.startswith('#endif'):
- endif = line
- endif_linenum = linenum
-
- if not ifndef or not define or ifndef != define:
- error(filename, 0, 'build/header_guard', 5,
- 'No #ifndef header guard found, suggested CPP variable is: %s' %
- cppvar)
- return
-
- # The guard should be PATH_FILE_H_, but we also allow PATH_FILE_H__
- # for backward compatibility.
- if ifndef != cppvar:
- error_level = 0
- if ifndef != cppvar + '_':
- error_level = 5
-
- ParseNolintSuppressions(filename, raw_lines[ifndef_linenum], ifndef_linenum,
- error)
- error(filename, ifndef_linenum, 'build/header_guard', error_level,
- '#ifndef header guard has wrong style, please use: %s' % cppvar)
-
- # Check for "//" comments on endif line.
- ParseNolintSuppressions(filename, raw_lines[endif_linenum], endif_linenum,
- error)
- match = Match(r'#endif\s*//\s*' + cppvar + r'(_)?\b', endif)
- if match:
- if match.group(1) == '_':
- # Issue low severity warning for deprecated double trailing underscore
- error(filename, endif_linenum, 'build/header_guard', 0,
- '#endif line should be "#endif // %s"' % cppvar)
- return
-
- # Didn't find the corresponding "//" comment. If this file does not
- # contain any "//" comments at all, it could be that the compiler
- # only wants "/**/" comments, look for those instead.
- no_single_line_comments = True
- for i in xrange(1, len(raw_lines) - 1):
- line = raw_lines[i]
- if Match(r'^(?:(?:\'(?:\.|[^\'])*\')|(?:"(?:\.|[^"])*")|[^\'"])*//', line):
- no_single_line_comments = False
- break
-
- if no_single_line_comments:
- match = Match(r'#endif\s*/\*\s*' + cppvar + r'(_)?\s*\*/', endif)
- if match:
- if match.group(1) == '_':
- # Low severity warning for double trailing underscore
- error(filename, endif_linenum, 'build/header_guard', 0,
- '#endif line should be "#endif /* %s */"' % cppvar)
- return
-
- # Didn't find anything
- error(filename, endif_linenum, 'build/header_guard', 5,
- '#endif line should be "#endif // %s"' % cppvar)
-
-
-def CheckHeaderFileIncluded(filename, include_state, error):
- """Logs an error if a .cc file does not include its header."""
-
- # Do not check test files
- if filename.endswith('_test.cc') or filename.endswith('_unittest.cc'):
- return
-
- fileinfo = FileInfo(filename)
- headerfile = filename[0:len(filename) - 2] + 'h'
- if not os.path.exists(headerfile):
- return
- headername = FileInfo(headerfile).RepositoryName()
- first_include = 0
- for section_list in include_state.include_list:
- for f in section_list:
- if headername in f[0] or f[0] in headername:
- return
- if not first_include:
- first_include = f[1]
-
- error(filename, first_include, 'build/include', 5,
- '%s should include its header file %s' % (fileinfo.RepositoryName(),
- headername))
-
-
-def CheckForBadCharacters(filename, lines, error):
- """Logs an error for each line containing bad characters.
-
- Two kinds of bad characters:
-
- 1. Unicode replacement characters: These indicate that either the file
- contained invalid UTF-8 (likely) or Unicode replacement characters (which
- it shouldn't). Note that it's possible for this to throw off line
- numbering if the invalid UTF-8 occurred adjacent to a newline.
-
- 2. NUL bytes. These are problematic for some tools.
-
- Args:
- filename: The name of the current file.
- lines: An array of strings, each representing a line of the file.
- error: The function to call with any errors found.
- """
- for linenum, line in enumerate(lines):
- if u'\ufffd' in line:
- error(filename, linenum, 'readability/utf8', 5,
- 'Line contains invalid UTF-8 (or Unicode replacement character).')
- if '\0' in line:
- error(filename, linenum, 'readability/nul', 5, 'Line contains NUL byte.')
-
-
-def CheckForNewlineAtEOF(filename, lines, error):
- """Logs an error if there is no newline char at the end of the file.
-
- Args:
- filename: The name of the current file.
- lines: An array of strings, each representing a line of the file.
- error: The function to call with any errors found.
- """
-
- # The array lines() was created by adding two newlines to the
- # original file (go figure), then splitting on \n.
- # To verify that the file ends in \n, we just have to make sure the
- # last-but-two element of lines() exists and is empty.
- if len(lines) < 3 or lines[-2]:
- error(filename, len(lines) - 2, 'whitespace/ending_newline', 5,
- 'Could not find a newline character at the end of the file.')
-
-
-def CheckForMultilineCommentsAndStrings(filename, clean_lines, linenum, error):
- """Logs an error if we see /* ... */ or "..." that extend past one line.
-
- /* ... */ comments are legit inside macros, for one line.
- Otherwise, we prefer // comments, so it's ok to warn about the
- other. Likewise, it's ok for strings to extend across multiple
- lines, as long as a line continuation character (backslash)
- terminates each line. Although not currently prohibited by the C++
- style guide, it's ugly and unnecessary. We don't do well with either
- in this lint program, so we warn about both.
-
- Args:
- filename: The name of the current file.
- clean_lines: A CleansedLines instance containing the file.
- linenum: The number of the line to check.
- error: The function to call with any errors found.
- """
- line = clean_lines.elided[linenum]
-
- # Remove all \\ (escaped backslashes) from the line. They are OK, and the
- # second (escaped) slash may trigger later \" detection erroneously.
- line = line.replace('\\\\', '')
-
- if line.count('/*') > line.count('*/'):
- error(filename, linenum, 'readability/multiline_comment', 5,
- 'Complex multi-line /*...*/-style comment found. '
- 'Lint may give bogus warnings. '
- 'Consider replacing these with //-style comments, '
- 'with #if 0...#endif, '
- 'or with more clearly structured multi-line comments.')
-
- if (line.count('"') - line.count('\\"')) % 2:
- error(filename, linenum, 'readability/multiline_string', 5,
- 'Multi-line string ("...") found. This lint script doesn\'t '
- 'do well with such strings, and may give bogus warnings. '
- 'Use C++11 raw strings or concatenation instead.')
-
-
-# (non-threadsafe name, thread-safe alternative, validation pattern)
-#
-# The validation pattern is used to eliminate false positives such as:
-# _rand(); // false positive due to substring match.
-# ->rand(); // some member function rand().
-# ACMRandom rand(seed); // some variable named rand.
-# ISAACRandom rand(); // another variable named rand.
-#
-# Basically we require the return value of these functions to be used
-# in some expression context on the same line by matching on some
-# operator before the function name. This eliminates constructors and
-# member function calls.
-_UNSAFE_FUNC_PREFIX = r'(?:[-+*/=%^&|(<]\s*|>\s+)'
-_THREADING_LIST = (
- ('asctime(', 'asctime_r(', _UNSAFE_FUNC_PREFIX + r'asctime\([^)]+\)'),
- ('ctime(', 'ctime_r(', _UNSAFE_FUNC_PREFIX + r'ctime\([^)]+\)'),
- ('getgrgid(', 'getgrgid_r(', _UNSAFE_FUNC_PREFIX + r'getgrgid\([^)]+\)'),
- ('getgrnam(', 'getgrnam_r(', _UNSAFE_FUNC_PREFIX + r'getgrnam\([^)]+\)'),
- ('getlogin(', 'getlogin_r(', _UNSAFE_FUNC_PREFIX + r'getlogin\(\)'),
- ('getpwnam(', 'getpwnam_r(', _UNSAFE_FUNC_PREFIX + r'getpwnam\([^)]+\)'),
- ('getpwuid(', 'getpwuid_r(', _UNSAFE_FUNC_PREFIX + r'getpwuid\([^)]+\)'),
- ('gmtime(', 'gmtime_r(', _UNSAFE_FUNC_PREFIX + r'gmtime\([^)]+\)'),
- ('localtime(', 'localtime_r(', _UNSAFE_FUNC_PREFIX + r'localtime\([^)]+\)'),
- ('rand(', 'rand_r(', _UNSAFE_FUNC_PREFIX + r'rand\(\)'),
- ('strtok(', 'strtok_r(',
- _UNSAFE_FUNC_PREFIX + r'strtok\([^)]+\)'),
- ('ttyname(', 'ttyname_r(', _UNSAFE_FUNC_PREFIX + r'ttyname\([^)]+\)'),
- )
-
-
-def CheckPosixThreading(filename, clean_lines, linenum, error):
- """Checks for calls to thread-unsafe functions.
-
- Much code has been originally written without consideration of
- multi-threading. Also, engineers are relying on their old experience;
- they have learned posix before threading extensions were added. These
- tests guide the engineers to use thread-safe functions (when using
- posix directly).
-
- Args:
- filename: The name of the current file.
- clean_lines: A CleansedLines instance containing the file.
- linenum: The number of the line to check.
- error: The function to call with any errors found.
- """
- line = clean_lines.elided[linenum]
- for single_thread_func, multithread_safe_func, pattern in _THREADING_LIST:
- # Additional pattern matching check to confirm that this is the
- # function we are looking for
- if Search(pattern, line):
- error(filename, linenum, 'runtime/threadsafe_fn', 2,
- 'Consider using ' + multithread_safe_func +
- '...) instead of ' + single_thread_func +
- '...) for improved thread safety.')
-
-
-def CheckVlogArguments(filename, clean_lines, linenum, error):
- """Checks that VLOG() is only used for defining a logging level.
-
- For example, VLOG(2) is correct. VLOG(INFO), VLOG(WARNING), VLOG(ERROR), and
- VLOG(FATAL) are not.
-
- Args:
- filename: The name of the current file.
- clean_lines: A CleansedLines instance containing the file.
- linenum: The number of the line to check.
- error: The function to call with any errors found.
- """
- line = clean_lines.elided[linenum]
- if Search(r'\bVLOG\((INFO|ERROR|WARNING|DFATAL|FATAL)\)', line):
- error(filename, linenum, 'runtime/vlog', 5,
- 'VLOG() should be used with numeric verbosity level. '
- 'Use LOG() if you want symbolic severity levels.')
-
-# Matches invalid increment: *count++, which moves pointer instead of
-# incrementing a value.
-_RE_PATTERN_INVALID_INCREMENT = re.compile(
- r'^\s*\*\w+(\+\+|--);')
-
-
-def CheckInvalidIncrement(filename, clean_lines, linenum, error):
- """Checks for invalid increment *count++.
-
- For example following function:
- void increment_counter(int* count) {
- *count++;
- }
- is invalid, because it effectively does count++, moving pointer, and should
- be replaced with ++*count, (*count)++ or *count += 1.
-
- Args:
- filename: The name of the current file.
- clean_lines: A CleansedLines instance containing the file.
- linenum: The number of the line to check.
- error: The function to call with any errors found.
- """
- line = clean_lines.elided[linenum]
- if _RE_PATTERN_INVALID_INCREMENT.match(line):
- error(filename, linenum, 'runtime/invalid_increment', 5,
- 'Changing pointer instead of value (or unused value of operator*).')
-
-
-def IsMacroDefinition(clean_lines, linenum):
- if Search(r'^#define', clean_lines[linenum]):
- return True
-
- if linenum > 0 and Search(r'\\$', clean_lines[linenum - 1]):
- return True
-
- return False
-
-
-def IsForwardClassDeclaration(clean_lines, linenum):
- return Match(r'^\s*(\btemplate\b)*.*class\s+\w+;\s*$', clean_lines[linenum])
-
-
-class _BlockInfo(object):
- """Stores information about a generic block of code."""
-
- def __init__(self, seen_open_brace):
- self.seen_open_brace = seen_open_brace
- self.open_parentheses = 0
- self.inline_asm = _NO_ASM
- self.check_namespace_indentation = False
-
- def CheckBegin(self, filename, clean_lines, linenum, error):
- """Run checks that applies to text up to the opening brace.
-
- This is mostly for checking the text after the class identifier
- and the "{", usually where the base class is specified. For other
- blocks, there isn't much to check, so we always pass.
-
- Args:
- filename: The name of the current file.
- clean_lines: A CleansedLines instance containing the file.
- linenum: The number of the line to check.
- error: The function to call with any errors found.
- """
- pass
-
- def CheckEnd(self, filename, clean_lines, linenum, error):
- """Run checks that applies to text after the closing brace.
-
- This is mostly used for checking end of namespace comments.
-
- Args:
- filename: The name of the current file.
- clean_lines: A CleansedLines instance containing the file.
- linenum: The number of the line to check.
- error: The function to call with any errors found.
- """
- pass
-
- def IsBlockInfo(self):
- """Returns true if this block is a _BlockInfo.
-
- This is convenient for verifying that an object is an instance of
- a _BlockInfo, but not an instance of any of the derived classes.
-
- Returns:
- True for this class, False for derived classes.
- """
- return self.__class__ == _BlockInfo
-
-
-class _ExternCInfo(_BlockInfo):
- """Stores information about an 'extern "C"' block."""
-
- def __init__(self):
- _BlockInfo.__init__(self, True)
-
-
-class _ClassInfo(_BlockInfo):
- """Stores information about a class."""
-
- def __init__(self, name, class_or_struct, clean_lines, linenum):
- _BlockInfo.__init__(self, False)
- self.name = name
- self.starting_linenum = linenum
- self.is_derived = False
- self.check_namespace_indentation = True
- if class_or_struct == 'struct':
- self.access = 'public'
- self.is_struct = True
- else:
- self.access = 'private'
- self.is_struct = False
-
- # Remember initial indentation level for this class. Using raw_lines here
- # instead of elided to account for leading comments.
- self.class_indent = GetIndentLevel(clean_lines.raw_lines[linenum])
-
- # Try to find the end of the class. This will be confused by things like:
- # class A {
- # } *x = { ...
- #
- # But it's still good enough for CheckSectionSpacing.
- self.last_line = 0
- depth = 0
- for i in range(linenum, clean_lines.NumLines()):
- line = clean_lines.elided[i]
- depth += line.count('{') - line.count('}')
- if not depth:
- self.last_line = i
- break
-
- def CheckBegin(self, filename, clean_lines, linenum, error):
- # Look for a bare ':'
- if Search('(^|[^:]):($|[^:])', clean_lines.elided[linenum]):
- self.is_derived = True
-
- def CheckEnd(self, filename, clean_lines, linenum, error):
- # If there is a DISALLOW macro, it should appear near the end of
- # the class.
- seen_last_thing_in_class = False
- for i in xrange(linenum - 1, self.starting_linenum, -1):
- match = Search(
- r'\b(DISALLOW_COPY_AND_ASSIGN|DISALLOW_IMPLICIT_CONSTRUCTORS)\(' +
- self.name + r'\)',
- clean_lines.elided[i])
- if match:
- if seen_last_thing_in_class:
- error(filename, i, 'readability/constructors', 3,
- match.group(1) + ' should be the last thing in the class')
- break
-
- if not Match(r'^\s*$', clean_lines.elided[i]):
- seen_last_thing_in_class = True
-
- # Check that closing brace is aligned with beginning of the class.
- # Only do this if the closing brace is indented by only whitespaces.
- # This means we will not check single-line class definitions.
- indent = Match(r'^( *)\}', clean_lines.elided[linenum])
- if indent and len(indent.group(1)) != self.class_indent:
- if self.is_struct:
- parent = 'struct ' + self.name
- else:
- parent = 'class ' + self.name
- error(filename, linenum, 'whitespace/indent', 3,
- 'Closing brace should be aligned with beginning of %s' % parent)
-
-
-class _NamespaceInfo(_BlockInfo):
- """Stores information about a namespace."""
-
- def __init__(self, name, linenum):
- _BlockInfo.__init__(self, False)
- self.name = name or ''
- self.starting_linenum = linenum
- self.check_namespace_indentation = True
-
- def CheckEnd(self, filename, clean_lines, linenum, error):
- """Check end of namespace comments."""
- line = clean_lines.raw_lines[linenum]
-
- # Check how many lines is enclosed in this namespace. Don't issue
- # warning for missing namespace comments if there aren't enough
- # lines. However, do apply checks if there is already an end of
- # namespace comment and it's incorrect.
- #
- # TODO(unknown): We always want to check end of namespace comments
- # if a namespace is large, but sometimes we also want to apply the
- # check if a short namespace contained nontrivial things (something
- # other than forward declarations). There is currently no logic on
- # deciding what these nontrivial things are, so this check is
- # triggered by namespace size only, which works most of the time.
- if (linenum - self.starting_linenum < 10
- and not Match(r'};*\s*(//|/\*).*\bnamespace\b', line)):
- return
-
- # Look for matching comment at end of namespace.
- #
- # Note that we accept C style "/* */" comments for terminating
- # namespaces, so that code that terminate namespaces inside
- # preprocessor macros can be cpplint clean.
- #
- # We also accept stuff like "// end of namespace <name>." with the
- # period at the end.
- #
- # Besides these, we don't accept anything else, otherwise we might
- # get false negatives when existing comment is a substring of the
- # expected namespace.
- if self.name:
- # Named namespace
- if not Match((r'};*\s*(//|/\*).*\bnamespace\s+' + re.escape(self.name) +
- r'[\*/\.\\\s]*$'),
- line):
- error(filename, linenum, 'readability/namespace', 5,
- 'Namespace should be terminated with "// namespace %s"' %
- self.name)
- else:
- # Anonymous namespace
- if not Match(r'};*\s*(//|/\*).*\bnamespace[\*/\.\\\s]*$', line):
- # If "// namespace anonymous" or "// anonymous namespace (more text)",
- # mention "// anonymous namespace" as an acceptable form
- if Match(r'}.*\b(namespace anonymous|anonymous namespace)\b', line):
- error(filename, linenum, 'readability/namespace', 5,
- 'Anonymous namespace should be terminated with "// namespace"'
- ' or "// anonymous namespace"')
- else:
- error(filename, linenum, 'readability/namespace', 5,
- 'Anonymous namespace should be terminated with "// namespace"')
-
-
-class _PreprocessorInfo(object):
- """Stores checkpoints of nesting stacks when #if/#else is seen."""
-
- def __init__(self, stack_before_if):
- # The entire nesting stack before #if
- self.stack_before_if = stack_before_if
-
- # The entire nesting stack up to #else
- self.stack_before_else = []
-
- # Whether we have already seen #else or #elif
- self.seen_else = False
-
-
-class NestingState(object):
- """Holds states related to parsing braces."""
-
- def __init__(self):
- # Stack for tracking all braces. An object is pushed whenever we
- # see a "{", and popped when we see a "}". Only 3 types of
- # objects are possible:
- # - _ClassInfo: a class or struct.
- # - _NamespaceInfo: a namespace.
- # - _BlockInfo: some other type of block.
- self.stack = []
-
- # Top of the previous stack before each Update().
- #
- # Because the nesting_stack is updated at the end of each line, we
- # had to do some convoluted checks to find out what is the current
- # scope at the beginning of the line. This check is simplified by
- # saving the previous top of nesting stack.
- #
- # We could save the full stack, but we only need the top. Copying
- # the full nesting stack would slow down cpplint by ~10%.
- self.previous_stack_top = []
-
- # Stack of _PreprocessorInfo objects.
- self.pp_stack = []
-
- def SeenOpenBrace(self):
- """Check if we have seen the opening brace for the innermost block.
-
- Returns:
- True if we have seen the opening brace, False if the innermost
- block is still expecting an opening brace.
- """
- return (not self.stack) or self.stack[-1].seen_open_brace
-
- def InNamespaceBody(self):
- """Check if we are currently one level inside a namespace body.
-
- Returns:
- True if top of the stack is a namespace block, False otherwise.
- """
- return self.stack and isinstance(self.stack[-1], _NamespaceInfo)
-
- def InExternC(self):
- """Check if we are currently one level inside an 'extern "C"' block.
-
- Returns:
- True if top of the stack is an extern block, False otherwise.
- """
- return self.stack and isinstance(self.stack[-1], _ExternCInfo)
-
- def InClassDeclaration(self):
- """Check if we are currently one level inside a class or struct declaration.
-
- Returns:
- True if top of the stack is a class/struct, False otherwise.
- """
- return self.stack and isinstance(self.stack[-1], _ClassInfo)
-
- def InAsmBlock(self):
- """Check if we are currently one level inside an inline ASM block.
-
- Returns:
- True if the top of the stack is a block containing inline ASM.
- """
- return self.stack and self.stack[-1].inline_asm != _NO_ASM
-
- def InTemplateArgumentList(self, clean_lines, linenum, pos):
- """Check if current position is inside template argument list.
-
- Args:
- clean_lines: A CleansedLines instance containing the file.
- linenum: The number of the line to check.
- pos: position just after the suspected template argument.
- Returns:
- True if (linenum, pos) is inside template arguments.
- """
- while linenum < clean_lines.NumLines():
- # Find the earliest character that might indicate a template argument
- line = clean_lines.elided[linenum]
- match = Match(r'^[^{};=\[\]\.<>]*(.)', line[pos:])
- if not match:
- linenum += 1
- pos = 0
- continue
- token = match.group(1)
- pos += len(match.group(0))
-
- # These things do not look like template argument list:
- # class Suspect {
- # class Suspect x; }
- if token in ('{', '}', ';'): return False
-
- # These things look like template argument list:
- # template <class Suspect>
- # template <class Suspect = default_value>
- # template <class Suspect[]>
- # template <class Suspect...>
- if token in ('>', '=', '[', ']', '.'): return True
-
- # Check if token is an unmatched '<'.
- # If not, move on to the next character.
- if token != '<':
- pos += 1
- if pos >= len(line):
- linenum += 1
- pos = 0
- continue
-
- # We can't be sure if we just find a single '<', and need to
- # find the matching '>'.
- (_, end_line, end_pos) = CloseExpression(clean_lines, linenum, pos - 1)
- if end_pos < 0:
- # Not sure if template argument list or syntax error in file
- return False
- linenum = end_line
- pos = end_pos
- return False
-
- def UpdatePreprocessor(self, line):
- """Update preprocessor stack.
-
- We need to handle preprocessors due to classes like this:
- #ifdef SWIG
- struct ResultDetailsPageElementExtensionPoint {
- #else
- struct ResultDetailsPageElementExtensionPoint : public Extension {
- #endif
-
- We make the following assumptions (good enough for most files):
- - Preprocessor condition evaluates to true from #if up to first
- #else/#elif/#endif.
-
- - Preprocessor condition evaluates to false from #else/#elif up
- to #endif. We still perform lint checks on these lines, but
- these do not affect nesting stack.
-
- Args:
- line: current line to check.
- """
- if Match(r'^\s*#\s*(if|ifdef|ifndef)\b', line):
- # Beginning of #if block, save the nesting stack here. The saved
- # stack will allow us to restore the parsing state in the #else case.
- self.pp_stack.append(_PreprocessorInfo(copy.deepcopy(self.stack)))
- elif Match(r'^\s*#\s*(else|elif)\b', line):
- # Beginning of #else block
- if self.pp_stack:
- if not self.pp_stack[-1].seen_else:
- # This is the first #else or #elif block. Remember the
- # whole nesting stack up to this point. This is what we
- # keep after the #endif.
- self.pp_stack[-1].seen_else = True
- self.pp_stack[-1].stack_before_else = copy.deepcopy(self.stack)
-
- # Restore the stack to how it was before the #if
- self.stack = copy.deepcopy(self.pp_stack[-1].stack_before_if)
- else:
- # TODO(unknown): unexpected #else, issue warning?
- pass
- elif Match(r'^\s*#\s*endif\b', line):
- # End of #if or #else blocks.
- if self.pp_stack:
- # If we saw an #else, we will need to restore the nesting
- # stack to its former state before the #else, otherwise we
- # will just continue from where we left off.
- if self.pp_stack[-1].seen_else:
- # Here we can just use a shallow copy since we are the last
- # reference to it.
- self.stack = self.pp_stack[-1].stack_before_else
- # Drop the corresponding #if
- self.pp_stack.pop()
- else:
- # TODO(unknown): unexpected #endif, issue warning?
- pass
-
- # TODO(unknown): Update() is too long, but we will refactor later.
- def Update(self, filename, clean_lines, linenum, error):
- """Update nesting state with current line.
-
- Args:
- filename: The name of the current file.
- clean_lines: A CleansedLines instance containing the file.
- linenum: The number of the line to check.
- error: The function to call with any errors found.
- """
- line = clean_lines.elided[linenum]
-
- # Remember top of the previous nesting stack.
- #
- # The stack is always pushed/popped and not modified in place, so
- # we can just do a shallow copy instead of copy.deepcopy. Using
- # deepcopy would slow down cpplint by ~28%.
- if self.stack:
- self.previous_stack_top = self.stack[-1]
- else:
- self.previous_stack_top = None
-
- # Update pp_stack
- self.UpdatePreprocessor(line)
-
- # Count parentheses. This is to avoid adding struct arguments to
- # the nesting stack.
- if self.stack:
- inner_block = self.stack[-1]
- depth_change = line.count('(') - line.count(')')
- inner_block.open_parentheses += depth_change
-
- # Also check if we are starting or ending an inline assembly block.
- if inner_block.inline_asm in (_NO_ASM, _END_ASM):
- if (depth_change != 0 and
- inner_block.open_parentheses == 1 and
- _MATCH_ASM.match(line)):
- # Enter assembly block
- inner_block.inline_asm = _INSIDE_ASM
- else:
- # Not entering assembly block. If previous line was _END_ASM,
- # we will now shift to _NO_ASM state.
- inner_block.inline_asm = _NO_ASM
- elif (inner_block.inline_asm == _INSIDE_ASM and
- inner_block.open_parentheses == 0):
- # Exit assembly block
- inner_block.inline_asm = _END_ASM
-
- # Consume namespace declaration at the beginning of the line. Do
- # this in a loop so that we catch same line declarations like this:
- # namespace proto2 { namespace bridge { class MessageSet; } }
- while True:
- # Match start of namespace. The "\b\s*" below catches namespace
- # declarations even if it weren't followed by a whitespace, this
- # is so that we don't confuse our namespace checker. The
- # missing spaces will be flagged by CheckSpacing.
- namespace_decl_match = Match(r'^\s*namespace\b\s*([:\w]+)?(.*)$', line)
- if not namespace_decl_match:
- break
-
- new_namespace = _NamespaceInfo(namespace_decl_match.group(1), linenum)
- self.stack.append(new_namespace)
-
- line = namespace_decl_match.group(2)
- if line.find('{') != -1:
- new_namespace.seen_open_brace = True
- line = line[line.find('{') + 1:]
-
- # Look for a class declaration in whatever is left of the line
- # after parsing namespaces. The regexp accounts for decorated classes
- # such as in:
- # class LOCKABLE API Object {
- # };
- class_decl_match = Match(
- r'^(\s*(?:template\s*<[\w\s<>,:]*>\s*)?'
- r'(class|struct)\s+(?:[A-Z_]+\s+)*(\w+(?:::\w+)*))'
- r'(.*)$', line)
- if (class_decl_match and
- (not self.stack or self.stack[-1].open_parentheses == 0)):
- # We do not want to accept classes that are actually template arguments:
- # template <class Ignore1,
- # class Ignore2 = Default<Args>,
- # template <Args> class Ignore3>
- # void Function() {};
- #
- # To avoid template argument cases, we scan forward and look for
- # an unmatched '>'. If we see one, assume we are inside a
- # template argument list.
- end_declaration = len(class_decl_match.group(1))
- if not self.InTemplateArgumentList(clean_lines, linenum, end_declaration):
- self.stack.append(_ClassInfo(
- class_decl_match.group(3), class_decl_match.group(2),
- clean_lines, linenum))
- line = class_decl_match.group(4)
-
- # If we have not yet seen the opening brace for the innermost block,
- # run checks here.
- if not self.SeenOpenBrace():
- self.stack[-1].CheckBegin(filename, clean_lines, linenum, error)
-
- # Update access control if we are inside a class/struct
- if self.stack and isinstance(self.stack[-1], _ClassInfo):
- classinfo = self.stack[-1]
- access_match = Match(
- r'^(.*)\b(public|private|protected|signals)(\s+(?:slots\s*)?)?'
- r':(?:[^:]|$)',
- line)
- if access_match:
- classinfo.access = access_match.group(2)
-
- # Check that access keywords are indented +1 space. Skip this
- # check if the keywords are not preceded by whitespaces.
- indent = access_match.group(1)
- if (len(indent) != classinfo.class_indent + 1 and
- Match(r'^\s*$', indent)):
- if classinfo.is_struct:
- parent = 'struct ' + classinfo.name
- else:
- parent = 'class ' + classinfo.name
- slots = ''
- if access_match.group(3):
- slots = access_match.group(3)
- error(filename, linenum, 'whitespace/indent', 3,
- '%s%s: should be indented +1 space inside %s' % (
- access_match.group(2), slots, parent))
-
- # Consume braces or semicolons from what's left of the line
- while True:
- # Match first brace, semicolon, or closed parenthesis.
- matched = Match(r'^[^{;)}]*([{;)}])(.*)$', line)
- if not matched:
- break
-
- token = matched.group(1)
- if token == '{':
- # If namespace or class hasn't seen a opening brace yet, mark
- # namespace/class head as complete. Push a new block onto the
- # stack otherwise.
- if not self.SeenOpenBrace():
- self.stack[-1].seen_open_brace = True
- elif Match(r'^extern\s*"[^"]*"\s*\{', line):
- self.stack.append(_ExternCInfo())
- else:
- self.stack.append(_BlockInfo(True))
- if _MATCH_ASM.match(line):
- self.stack[-1].inline_asm = _BLOCK_ASM
-
- elif token == ';' or token == ')':
- # If we haven't seen an opening brace yet, but we already saw
- # a semicolon, this is probably a forward declaration. Pop
- # the stack for these.
- #
- # Similarly, if we haven't seen an opening brace yet, but we
- # already saw a closing parenthesis, then these are probably
- # function arguments with extra "class" or "struct" keywords.
- # Also pop these stack for these.
- if not self.SeenOpenBrace():
- self.stack.pop()
- else: # token == '}'
- # Perform end of block checks and pop the stack.
- if self.stack:
- self.stack[-1].CheckEnd(filename, clean_lines, linenum, error)
- self.stack.pop()
- line = matched.group(2)
-
- def InnermostClass(self):
- """Get class info on the top of the stack.
-
- Returns:
- A _ClassInfo object if we are inside a class, or None otherwise.
- """
- for i in range(len(self.stack), 0, -1):
- classinfo = self.stack[i - 1]
- if isinstance(classinfo, _ClassInfo):
- return classinfo
- return None
-
- def CheckCompletedBlocks(self, filename, error):
- """Checks that all classes and namespaces have been completely parsed.
-
- Call this when all lines in a file have been processed.
- Args:
- filename: The name of the current file.
- error: The function to call with any errors found.
- """
- # Note: This test can result in false positives if #ifdef constructs
- # get in the way of brace matching. See the testBuildClass test in
- # cpplint_unittest.py for an example of this.
- for obj in self.stack:
- if isinstance(obj, _ClassInfo):
- error(filename, obj.starting_linenum, 'build/class', 5,
- 'Failed to find complete declaration of class %s' %
- obj.name)
- elif isinstance(obj, _NamespaceInfo):
- error(filename, obj.starting_linenum, 'build/namespaces', 5,
- 'Failed to find complete declaration of namespace %s' %
- obj.name)
-
-
-def CheckForNonStandardConstructs(filename, clean_lines, linenum,
- nesting_state, error):
- r"""Logs an error if we see certain non-ANSI constructs ignored by gcc-2.
-
- Complain about several constructs which gcc-2 accepts, but which are
- not standard C++. Warning about these in lint is one way to ease the
- transition to new compilers.
- - put storage class first (e.g. "static const" instead of "const static").
- - "%lld" instead of %qd" in printf-type functions.
- - "%1$d" is non-standard in printf-type functions.
- - "\%" is an undefined character escape sequence.
- - text after #endif is not allowed.
- - invalid inner-style forward declaration.
- - >? and <? operators, and their >?= and <?= cousins.
-
- Additionally, check for constructor/destructor style violations and reference
- members, as it is very convenient to do so while checking for
- gcc-2 compliance.
-
- Args:
- filename: The name of the current file.
- clean_lines: A CleansedLines instance containing the file.
- linenum: The number of the line to check.
- nesting_state: A NestingState instance which maintains information about
- the current stack of nested blocks being parsed.
- error: A callable to which errors are reported, which takes 4 arguments:
- filename, line number, error level, and message
- """
-
- # Remove comments from the line, but leave in strings for now.
- line = clean_lines.lines[linenum]
-
- if Search(r'printf\s*\(.*".*%[-+ ]?\d*q', line):
- error(filename, linenum, 'runtime/printf_format', 3,
- '%q in format strings is deprecated. Use %ll instead.')
-
- if Search(r'printf\s*\(.*".*%\d+\$', line):
- error(filename, linenum, 'runtime/printf_format', 2,
- '%N$ formats are unconventional. Try rewriting to avoid them.')
-
- # Remove escaped backslashes before looking for undefined escapes.
- line = line.replace('\\\\', '')
-
- if Search(r'("|\').*\\(%|\[|\(|{)', line):
- error(filename, linenum, 'build/printf_format', 3,
- '%, [, (, and { are undefined character escapes. Unescape them.')
-
- # For the rest, work with both comments and strings removed.
- line = clean_lines.elided[linenum]
-
- if Search(r'\b(const|volatile|void|char|short|int|long'
- r'|float|double|signed|unsigned'
- r'|schar|u?int8|u?int16|u?int32|u?int64)'
- r'\s+(register|static|extern|typedef)\b',
- line):
- error(filename, linenum, 'build/storage_class', 5,
- 'Storage class (static, extern, typedef, etc) should be first.')
-
- if Match(r'\s*#\s*endif\s*[^/\s]+', line):
- error(filename, linenum, 'build/endif_comment', 5,
- 'Uncommented text after #endif is non-standard. Use a comment.')
-
- if Match(r'\s*class\s+(\w+\s*::\s*)+\w+\s*;', line):
- error(filename, linenum, 'build/forward_decl', 5,
- 'Inner-style forward declarations are invalid. Remove this line.')
-
- if Search(r'(\w+|[+-]?\d+(\.\d*)?)\s*(<|>)\?=?\s*(\w+|[+-]?\d+)(\.\d*)?',
- line):
- error(filename, linenum, 'build/deprecated', 3,
- '>? and <? (max and min) operators are non-standard and deprecated.')
-
- if Search(r'^\s*const\s*string\s*&\s*\w+\s*;', line):
- # TODO(unknown): Could it be expanded safely to arbitrary references,
- # without triggering too many false positives? The first
- # attempt triggered 5 warnings for mostly benign code in the regtest, hence
- # the restriction.
- # Here's the original regexp, for the reference:
- # type_name = r'\w+((\s*::\s*\w+)|(\s*<\s*\w+?\s*>))?'
- # r'\s*const\s*' + type_name + '\s*&\s*\w+\s*;'
- error(filename, linenum, 'runtime/member_string_references', 2,
- 'const string& members are dangerous. It is much better to use '
- 'alternatives, such as pointers or simple constants.')
-
- # Everything else in this function operates on class declarations.
- # Return early if the top of the nesting stack is not a class, or if
- # the class head is not completed yet.
- classinfo = nesting_state.InnermostClass()
- if not classinfo or not classinfo.seen_open_brace:
- return
-
- # The class may have been declared with namespace or classname qualifiers.
- # The constructor and destructor will not have those qualifiers.
- base_classname = classinfo.name.split('::')[-1]
-
- # Look for single-argument constructors that aren't marked explicit.
- # Technically a valid construct, but against style. Also look for
- # non-single-argument constructors which are also technically valid, but
- # strongly suggest something is wrong.
- explicit_constructor_match = Match(
- r'\s+(?:inline\s+)?(explicit\s+)?(?:inline\s+)?%s\s*'
- r'\(((?:[^()]|\([^()]*\))*)\)'
- % re.escape(base_classname),
- line)
-
- if explicit_constructor_match:
- is_marked_explicit = explicit_constructor_match.group(1)
-
- if not explicit_constructor_match.group(2):
- constructor_args = []
- else:
- constructor_args = explicit_constructor_match.group(2).split(',')
-
- # collapse arguments so that commas in template parameter lists and function
- # argument parameter lists don't split arguments in two
- i = 0
- while i < len(constructor_args):
- constructor_arg = constructor_args[i]
- while (constructor_arg.count('<') > constructor_arg.count('>') or
- constructor_arg.count('(') > constructor_arg.count(')')):
- constructor_arg += ',' + constructor_args[i + 1]
- del constructor_args[i + 1]
- constructor_args[i] = constructor_arg
- i += 1
-
- defaulted_args = [arg for arg in constructor_args if '=' in arg]
- noarg_constructor = (not constructor_args or # empty arg list
- # 'void' arg specifier
- (len(constructor_args) == 1 and
- constructor_args[0].strip() == 'void'))
- onearg_constructor = ((len(constructor_args) == 1 and # exactly one arg
- not noarg_constructor) or
- # all but at most one arg defaulted
- (len(constructor_args) >= 1 and
- not noarg_constructor and
- len(defaulted_args) >= len(constructor_args) - 1))
- initializer_list_constructor = bool(
- onearg_constructor and
- Search(r'\bstd\s*::\s*initializer_list\b', constructor_args[0]))
- copy_constructor = bool(
- onearg_constructor and
- Match(r'(const\s+)?%s(\s*<[^>]*>)?(\s+const)?\s*(?:<\w+>\s*)?&'
- % re.escape(base_classname), constructor_args[0].strip()))
-
- if (not is_marked_explicit and
- onearg_constructor and
- not initializer_list_constructor and
- not copy_constructor):
- if defaulted_args:
- error(filename, linenum, 'runtime/explicit', 5,
- 'Constructors callable with one argument '
- 'should be marked explicit.')
- else:
- error(filename, linenum, 'runtime/explicit', 5,
- 'Single-parameter constructors should be marked explicit.')
- elif is_marked_explicit and not onearg_constructor:
- if noarg_constructor:
- error(filename, linenum, 'runtime/explicit', 5,
- 'Zero-parameter constructors should not be marked explicit.')
- else:
- error(filename, linenum, 'runtime/explicit', 0,
- 'Constructors that require multiple arguments '
- 'should not be marked explicit.')
-
-
-def CheckSpacingForFunctionCall(filename, clean_lines, linenum, error):
- """Checks for the correctness of various spacing around function calls.
-
- Args:
- filename: The name of the current file.
- clean_lines: A CleansedLines instance containing the file.
- linenum: The number of the line to check.
- error: The function to call with any errors found.
- """
- line = clean_lines.elided[linenum]
-
- # Since function calls often occur inside if/for/while/switch
- # expressions - which have their own, more liberal conventions - we
- # first see if we should be looking inside such an expression for a
- # function call, to which we can apply more strict standards.
- fncall = line # if there's no control flow construct, look at whole line
- for pattern in (r'\bif\s*\((.*)\)\s*{',
- r'\bfor\s*\((.*)\)\s*{',
- r'\bwhile\s*\((.*)\)\s*[{;]',
- r'\bswitch\s*\((.*)\)\s*{'):
- match = Search(pattern, line)
- if match:
- fncall = match.group(1) # look inside the parens for function calls
- break
-
- # Except in if/for/while/switch, there should never be space
- # immediately inside parens (eg "f( 3, 4 )"). We make an exception
- # for nested parens ( (a+b) + c ). Likewise, there should never be
- # a space before a ( when it's a function argument. I assume it's a
- # function argument when the char before the whitespace is legal in
- # a function name (alnum + _) and we're not starting a macro. Also ignore
- # pointers and references to arrays and functions coz they're too tricky:
- # we use a very simple way to recognize these:
- # " (something)(maybe-something)" or
- # " (something)(maybe-something," or
- # " (something)[something]"
- # Note that we assume the contents of [] to be short enough that
- # they'll never need to wrap.
- if ( # Ignore control structures.
- not Search(r'\b(if|for|while|switch|return|new|delete|catch|sizeof)\b',
- fncall) and
- # Ignore pointers/references to functions.
- not Search(r' \([^)]+\)\([^)]*(\)|,$)', fncall) and
- # Ignore pointers/references to arrays.
- not Search(r' \([^)]+\)\[[^\]]+\]', fncall)):
- if Search(r'\w\s*\(\s(?!\s*\\$)', fncall): # a ( used for a fn call
- error(filename, linenum, 'whitespace/parens', 4,
- 'Extra space after ( in function call')
- elif Search(r'\(\s+(?!(\s*\\)|\()', fncall):
- error(filename, linenum, 'whitespace/parens', 2,
- 'Extra space after (')
- if (Search(r'\w\s+\(', fncall) and
- not Search(r'#\s*define|typedef|using\s+\w+\s*=', fncall) and
- not Search(r'\w\s+\((\w+::)*\*\w+\)\(', fncall) and
- not Search(r'\bcase\s+\(', fncall)):
- # TODO(unknown): Space after an operator function seem to be a common
- # error, silence those for now by restricting them to highest verbosity.
- if Search(r'\boperator_*\b', line):
- error(filename, linenum, 'whitespace/parens', 0,
- 'Extra space before ( in function call')
- else:
- error(filename, linenum, 'whitespace/parens', 4,
- 'Extra space before ( in function call')
- # If the ) is followed only by a newline or a { + newline, assume it's
- # part of a control statement (if/while/etc), and don't complain
- if Search(r'[^)]\s+\)\s*[^{\s]', fncall):
- # If the closing parenthesis is preceded by only whitespaces,
- # try to give a more descriptive error message.
- if Search(r'^\s+\)', fncall):
- error(filename, linenum, 'whitespace/parens', 2,
- 'Closing ) should be moved to the previous line')
- else:
- error(filename, linenum, 'whitespace/parens', 2,
- 'Extra space before )')
-
-
-def IsBlankLine(line):
- """Returns true if the given line is blank.
-
- We consider a line to be blank if the line is empty or consists of
- only white spaces.
-
- Args:
- line: A line of a string.
-
- Returns:
- True, if the given line is blank.
- """
- return not line or line.isspace()
-
-
-def CheckForNamespaceIndentation(filename, nesting_state, clean_lines, line,
- error):
- is_namespace_indent_item = (
- len(nesting_state.stack) > 1 and
- nesting_state.stack[-1].check_namespace_indentation and
- isinstance(nesting_state.previous_stack_top, _NamespaceInfo) and
- nesting_state.previous_stack_top == nesting_state.stack[-2])
-
- if ShouldCheckNamespaceIndentation(nesting_state, is_namespace_indent_item,
- clean_lines.elided, line):
- CheckItemIndentationInNamespace(filename, clean_lines.elided,
- line, error)
-
-
-def CheckForFunctionLengths(filename, clean_lines, linenum,
- function_state, error):
- """Reports for long function bodies.
-
- For an overview why this is done, see:
- http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Write_Short_Functions
-
- Uses a simplistic algorithm assuming other style guidelines
- (especially spacing) are followed.
- Only checks unindented functions, so class members are unchecked.
- Trivial bodies are unchecked, so constructors with huge initializer lists
- may be missed.
- Blank/comment lines are not counted so as to avoid encouraging the removal
- of vertical space and comments just to get through a lint check.
- NOLINT *on the last line of a function* disables this check.
-
- Args:
- filename: The name of the current file.
- clean_lines: A CleansedLines instance containing the file.
- linenum: The number of the line to check.
- function_state: Current function name and lines in body so far.
- error: The function to call with any errors found.
- """
- lines = clean_lines.lines
- line = lines[linenum]
- joined_line = ''
-
- starting_func = False
- regexp = r'(\w(\w|::|\*|\&|\s)*)\(' # decls * & space::name( ...
- match_result = Match(regexp, line)
- if match_result:
- # If the name is all caps and underscores, figure it's a macro and
- # ignore it, unless it's TEST or TEST_F.
- function_name = match_result.group(1).split()[-1]
- if function_name == 'TEST' or function_name == 'TEST_F' or (
- not Match(r'[A-Z_]+$', function_name)):
- starting_func = True
-
- if starting_func:
- body_found = False
- for start_linenum in xrange(linenum, clean_lines.NumLines()):
- start_line = lines[start_linenum]
- joined_line += ' ' + start_line.lstrip()
- if Search(r'(;|})', start_line): # Declarations and trivial functions
- body_found = True
- break # ... ignore
- elif Search(r'{', start_line):
- body_found = True
- function = Search(r'((\w|:)*)\(', line).group(1)
- if Match(r'TEST', function): # Handle TEST... macros
- parameter_regexp = Search(r'(\(.*\))', joined_line)
- if parameter_regexp: # Ignore bad syntax
- function += parameter_regexp.group(1)
- else:
- function += '()'
- function_state.Begin(function)
- break
- if not body_found:
- # No body for the function (or evidence of a non-function) was found.
- error(filename, linenum, 'readability/fn_size', 5,
- 'Lint failed to find start of function body.')
- elif Match(r'^\}\s*$', line): # function end
- function_state.Check(error, filename, linenum)
- function_state.End()
- elif not Match(r'^\s*$', line):
- function_state.Count() # Count non-blank/non-comment lines.
-
-
-_RE_PATTERN_TODO = re.compile(r'^//(\s*)TODO(\(.+?\))?:?(\s|$)?')
-
-
-def CheckComment(line, filename, linenum, next_line_start, error):
- """Checks for common mistakes in comments.
-
- Args:
- line: The line in question.
- filename: The name of the current file.
- linenum: The number of the line to check.
- next_line_start: The first non-whitespace column of the next line.
- error: The function to call with any errors found.
- """
- commentpos = line.find('//')
- if commentpos != -1:
- # Check if the // may be in quotes. If so, ignore it
- # Comparisons made explicit for clarity -- pylint: disable=g-explicit-bool-comparison
- if (line.count('"', 0, commentpos) -
- line.count('\\"', 0, commentpos)) % 2 == 0: # not in quotes
- # Allow one space for new scopes, two spaces otherwise:
- if (not (Match(r'^.*{ *//', line) and next_line_start == commentpos) and
- ((commentpos >= 1 and
- line[commentpos-1] not in string.whitespace) or
- (commentpos >= 2 and
- line[commentpos-2] not in string.whitespace))):
- error(filename, linenum, 'whitespace/comments', 2,
- 'At least two spaces is best between code and comments')
-
- # Checks for common mistakes in TODO comments.
- comment = line[commentpos:]
- match = _RE_PATTERN_TODO.match(comment)
- if match:
- # One whitespace is correct; zero whitespace is handled elsewhere.
- leading_whitespace = match.group(1)
- if len(leading_whitespace) > 1:
- error(filename, linenum, 'whitespace/todo', 2,
- 'Too many spaces before TODO')
-
- username = match.group(2)
- if not username:
- error(filename, linenum, 'readability/todo', 2,
- 'Missing username in TODO; it should look like '
- '"// TODO(my_username): Stuff."')
-
- middle_whitespace = match.group(3)
- # Comparisons made explicit for correctness -- pylint: disable=g-explicit-bool-comparison
- if middle_whitespace != ' ' and middle_whitespace != '':
- error(filename, linenum, 'whitespace/todo', 2,
- 'TODO(my_username) should be followed by a space')
-
- # If the comment contains an alphanumeric character, there
- # should be a space somewhere between it and the // unless
- # it's a /// or //! Doxygen comment.
- if (Match(r'//[^ ]*\w', comment) and
- not Match(r'(///|//\!)(\s+|$)', comment)):
- error(filename, linenum, 'whitespace/comments', 4,
- 'Should have a space between // and comment')
-
-
-def CheckAccess(filename, clean_lines, linenum, nesting_state, error):
- """Checks for improper use of DISALLOW* macros.
-
- Args:
- filename: The name of the current file.
- clean_lines: A CleansedLines instance containing the file.
- linenum: The number of the line to check.
- nesting_state: A NestingState instance which maintains information about
- the current stack of nested blocks being parsed.
- error: The function to call with any errors found.
- """
- line = clean_lines.elided[linenum] # get rid of comments and strings
-
- matched = Match((r'\s*(DISALLOW_COPY_AND_ASSIGN|'
- r'DISALLOW_IMPLICIT_CONSTRUCTORS)'), line)
- if not matched:
- return
- if nesting_state.stack and isinstance(nesting_state.stack[-1], _ClassInfo):
- if nesting_state.stack[-1].access != 'private':
- error(filename, linenum, 'readability/constructors', 3,
- '%s must be in the private: section' % matched.group(1))
-
- else:
- # Found DISALLOW* macro outside a class declaration, or perhaps it
- # was used inside a function when it should have been part of the
- # class declaration. We could issue a warning here, but it
- # probably resulted in a compiler error already.
- pass
-
-
-def CheckSpacing(filename, clean_lines, linenum, nesting_state, error):
- """Checks for the correctness of various spacing issues in the code.
-
- Things we check for: spaces around operators, spaces after
- if/for/while/switch, no spaces around parens in function calls, two
- spaces between code and comment, don't start a block with a blank
- line, don't end a function with a blank line, don't add a blank line
- after public/protected/private, don't have too many blank lines in a row.
-
- Args:
- filename: The name of the current file.
- clean_lines: A CleansedLines instance containing the file.
- linenum: The number of the line to check.
- nesting_state: A NestingState instance which maintains information about
- the current stack of nested blocks being parsed.
- error: The function to call with any errors found.
- """
-
- # Don't use "elided" lines here, otherwise we can't check commented lines.
- # Don't want to use "raw" either, because we don't want to check inside C++11
- # raw strings,
- raw = clean_lines.lines_without_raw_strings
- line = raw[linenum]
-
- # Before nixing comments, check if the line is blank for no good
- # reason. This includes the first line after a block is opened, and
- # blank lines at the end of a function (ie, right before a line like '}'
- #
- # Skip all the blank line checks if we are immediately inside a
- # namespace body. In other words, don't issue blank line warnings
- # for this block:
- # namespace {
- #
- # }
- #
- # A warning about missing end of namespace comments will be issued instead.
- #
- # Also skip blank line checks for 'extern "C"' blocks, which are formatted
- # like namespaces.
- if (IsBlankLine(line) and
- not nesting_state.InNamespaceBody() and
- not nesting_state.InExternC()):
- elided = clean_lines.elided
- prev_line = elided[linenum - 1]
- prevbrace = prev_line.rfind('{')
- # TODO(unknown): Don't complain if line before blank line, and line after,
- # both start with alnums and are indented the same amount.
- # This ignores whitespace at the start of a namespace block
- # because those are not usually indented.
- if prevbrace != -1 and prev_line[prevbrace:].find('}') == -1:
- # OK, we have a blank line at the start of a code block. Before we
- # complain, we check if it is an exception to the rule: The previous
- # non-empty line has the parameters of a function header that are indented
- # 4 spaces (because they did not fit in a 80 column line when placed on
- # the same line as the function name). We also check for the case where
- # the previous line is indented 6 spaces, which may happen when the
- # initializers of a constructor do not fit into a 80 column line.
- exception = False
- if Match(r' {6}\w', prev_line): # Initializer list?
- # We are looking for the opening column of initializer list, which
- # should be indented 4 spaces to cause 6 space indentation afterwards.
- search_position = linenum-2
- while (search_position >= 0
- and Match(r' {6}\w', elided[search_position])):
- search_position -= 1
- exception = (search_position >= 0
- and elided[search_position][:5] == ' :')
- else:
- # Search for the function arguments or an initializer list. We use a
- # simple heuristic here: If the line is indented 4 spaces; and we have a
- # closing paren, without the opening paren, followed by an opening brace
- # or colon (for initializer lists) we assume that it is the last line of
- # a function header. If we have a colon indented 4 spaces, it is an
- # initializer list.
- exception = (Match(r' {4}\w[^\(]*\)\s*(const\s*)?(\{\s*$|:)',
- prev_line)
- or Match(r' {4}:', prev_line))
-
- if not exception:
- error(filename, linenum, 'whitespace/blank_line', 2,
- 'Redundant blank line at the start of a code block '
- 'should be deleted.')
- # Ignore blank lines at the end of a block in a long if-else
- # chain, like this:
- # if (condition1) {
- # // Something followed by a blank line
- #
- # } else if (condition2) {
- # // Something else
- # }
- if linenum + 1 < clean_lines.NumLines():
- next_line = raw[linenum + 1]
- if (next_line
- and Match(r'\s*}', next_line)
- and next_line.find('} else ') == -1):
- error(filename, linenum, 'whitespace/blank_line', 3,
- 'Redundant blank line at the end of a code block '
- 'should be deleted.')
-
- matched = Match(r'\s*(public|protected|private):', prev_line)
- if matched:
- error(filename, linenum, 'whitespace/blank_line', 3,
- 'Do not leave a blank line after "%s:"' % matched.group(1))
-
- # Next, check comments
- next_line_start = 0
- if linenum + 1 < clean_lines.NumLines():
- next_line = raw[linenum + 1]
- next_line_start = len(next_line) - len(next_line.lstrip())
- CheckComment(line, filename, linenum, next_line_start, error)
-
- # get rid of comments and strings
- line = clean_lines.elided[linenum]
-
- # You shouldn't have spaces before your brackets, except maybe after
- # 'delete []' or 'return []() {};'
- if Search(r'\w\s+\[', line) and not Search(r'(?:delete|return)\s+\[', line):
- error(filename, linenum, 'whitespace/braces', 5,
- 'Extra space before [')
-
- # In range-based for, we wanted spaces before and after the colon, but
- # not around "::" tokens that might appear.
- if (Search(r'for *\(.*[^:]:[^: ]', line) or
- Search(r'for *\(.*[^: ]:[^:]', line)):
- error(filename, linenum, 'whitespace/forcolon', 2,
- 'Missing space around colon in range-based for loop')
-
-
-def CheckOperatorSpacing(filename, clean_lines, linenum, error):
- """Checks for horizontal spacing around operators.
-
- Args:
- filename: The name of the current file.
- clean_lines: A CleansedLines instance containing the file.
- linenum: The number of the line to check.
- error: The function to call with any errors found.
- """
- line = clean_lines.elided[linenum]
-
- # Don't try to do spacing checks for operator methods. Do this by
- # replacing the troublesome characters with something else,
- # preserving column position for all other characters.
- #
- # The replacement is done repeatedly to avoid false positives from
- # operators that call operators.
- while True:
- match = Match(r'^(.*\boperator\b)(\S+)(\s*\(.*)$', line)
- if match:
- line = match.group(1) + ('_' * len(match.group(2))) + match.group(3)
- else:
- break
-
- # We allow no-spaces around = within an if: "if ( (a=Foo()) == 0 )".
- # Otherwise not. Note we only check for non-spaces on *both* sides;
- # sometimes people put non-spaces on one side when aligning ='s among
- # many lines (not that this is behavior that I approve of...)
- if ((Search(r'[\w.]=', line) or
- Search(r'=[\w.]', line))
- and not Search(r'\b(if|while|for) ', line)
- # Operators taken from [lex.operators] in C++11 standard.
- and not Search(r'(>=|<=|==|!=|&=|\^=|\|=|\+=|\*=|\/=|\%=)', line)
- and not Search(r'operator=', line)):
- error(filename, linenum, 'whitespace/operators', 4,
- 'Missing spaces around =')
-
- # It's ok not to have spaces around binary operators like + - * /, but if
- # there's too little whitespace, we get concerned. It's hard to tell,
- # though, so we punt on this one for now. TODO.
-
- # You should always have whitespace around binary operators.
- #
- # Check <= and >= first to avoid false positives with < and >, then
- # check non-include lines for spacing around < and >.
- #
- # If the operator is followed by a comma, assume it's be used in a
- # macro context and don't do any checks. This avoids false
- # positives.
- #
- # Note that && is not included here. Those are checked separately
- # in CheckRValueReference
- match = Search(r'[^<>=!\s](==|!=|<=|>=|\|\|)[^<>=!\s,;\)]', line)
- if match:
- error(filename, linenum, 'whitespace/operators', 3,
- 'Missing spaces around %s' % match.group(1))
- elif not Match(r'#.*include', line):
- # Look for < that is not surrounded by spaces. This is only
- # triggered if both sides are missing spaces, even though
- # technically should should flag if at least one side is missing a
- # space. This is done to avoid some false positives with shifts.
- match = Match(r'^(.*[^\s<])<[^\s=<,]', line)
- if match:
- (_, _, end_pos) = CloseExpression(
- clean_lines, linenum, len(match.group(1)))
- if end_pos <= -1:
- error(filename, linenum, 'whitespace/operators', 3,
- 'Missing spaces around <')
-
- # Look for > that is not surrounded by spaces. Similar to the
- # above, we only trigger if both sides are missing spaces to avoid
- # false positives with shifts.
- match = Match(r'^(.*[^-\s>])>[^\s=>,]', line)
- if match:
- (_, _, start_pos) = ReverseCloseExpression(
- clean_lines, linenum, len(match.group(1)))
- if start_pos <= -1:
- error(filename, linenum, 'whitespace/operators', 3,
- 'Missing spaces around >')
-
- # We allow no-spaces around << when used like this: 10<<20, but
- # not otherwise (particularly, not when used as streams)
- #
- # We also allow operators following an opening parenthesis, since
- # those tend to be macros that deal with operators.
- match = Search(r'(operator|[^\s(<])(?:L|UL|ULL|l|ul|ull)?<<([^\s,=<])', line)
- if (match and not (match.group(1).isdigit() and match.group(2).isdigit()) and
- not (match.group(1) == 'operator' and match.group(2) == ';')):
- error(filename, linenum, 'whitespace/operators', 3,
- 'Missing spaces around <<')
-
- # We allow no-spaces around >> for almost anything. This is because
- # C++11 allows ">>" to close nested templates, which accounts for
- # most cases when ">>" is not followed by a space.
- #
- # We still warn on ">>" followed by alpha character, because that is
- # likely due to ">>" being used for right shifts, e.g.:
- # value >> alpha
- #
- # When ">>" is used to close templates, the alphanumeric letter that
- # follows would be part of an identifier, and there should still be
- # a space separating the template type and the identifier.
- # type<type<type>> alpha
- match = Search(r'>>[a-zA-Z_]', line)
- if match:
- error(filename, linenum, 'whitespace/operators', 3,
- 'Missing spaces around >>')
-
- # There shouldn't be space around unary operators
- match = Search(r'(!\s|~\s|[\s]--[\s;]|[\s]\+\+[\s;])', line)
- if match:
- error(filename, linenum, 'whitespace/operators', 4,
- 'Extra space for operator %s' % match.group(1))
-
-
-def CheckParenthesisSpacing(filename, clean_lines, linenum, error):
- """Checks for horizontal spacing around parentheses.
-
- Args:
- filename: The name of the current file.
- clean_lines: A CleansedLines instance containing the file.
- linenum: The number of the line to check.
- error: The function to call with any errors found.
- """
- line = clean_lines.elided[linenum]
-
- # No spaces after an if, while, switch, or for
- match = Search(r' (if\(|for\(|while\(|switch\()', line)
- if match:
- error(filename, linenum, 'whitespace/parens', 5,
- 'Missing space before ( in %s' % match.group(1))
-
- # For if/for/while/switch, the left and right parens should be
- # consistent about how many spaces are inside the parens, and
- # there should either be zero or one spaces inside the parens.
- # We don't want: "if ( foo)" or "if ( foo )".
- # Exception: "for ( ; foo; bar)" and "for (foo; bar; )" are allowed.
- match = Search(r'\b(if|for|while|switch)\s*'
- r'\(([ ]*)(.).*[^ ]+([ ]*)\)\s*{\s*$',
- line)
- if match:
- if len(match.group(2)) != len(match.group(4)):
- if not (match.group(3) == ';' and
- len(match.group(2)) == 1 + len(match.group(4)) or
- not match.group(2) and Search(r'\bfor\s*\(.*; \)', line)):
- error(filename, linenum, 'whitespace/parens', 5,
- 'Mismatching spaces inside () in %s' % match.group(1))
- if len(match.group(2)) not in [0, 1]:
- error(filename, linenum, 'whitespace/parens', 5,
- 'Should have zero or one spaces inside ( and ) in %s' %
- match.group(1))
-
-
-def CheckCommaSpacing(filename, clean_lines, linenum, error):
- """Checks for horizontal spacing near commas and semicolons.
-
- Args:
- filename: The name of the current file.
- clean_lines: A CleansedLines instance containing the file.
- linenum: The number of the line to check.
- error: The function to call with any errors found.
- """
- raw = clean_lines.lines_without_raw_strings
- line = clean_lines.elided[linenum]
-
- # You should always have a space after a comma (either as fn arg or operator)
- #
- # This does not apply when the non-space character following the
- # comma is another comma, since the only time when that happens is
- # for empty macro arguments.
- #
- # We run this check in two passes: first pass on elided lines to
- # verify that lines contain missing whitespaces, second pass on raw
- # lines to confirm that those missing whitespaces are not due to
- # elided comments.
- if (Search(r',[^,\s]', ReplaceAll(r'\boperator\s*,\s*\(', 'F(', line)) and
- Search(r',[^,\s]', raw[linenum])):
- error(filename, linenum, 'whitespace/comma', 3,
- 'Missing space after ,')
-
- # You should always have a space after a semicolon
- # except for few corner cases
- # TODO(unknown): clarify if 'if (1) { return 1;}' is requires one more
- # space after ;
- if Search(r';[^\s};\\)/]', line):
- error(filename, linenum, 'whitespace/semicolon', 3,
- 'Missing space after ;')
-
-
-def CheckBracesSpacing(filename, clean_lines, linenum, error):
- """Checks for horizontal spacing near commas.
-
- Args:
- filename: The name of the current file.
- clean_lines: A CleansedLines instance containing the file.
- linenum: The number of the line to check.
- error: The function to call with any errors found.
- """
- line = clean_lines.elided[linenum]
-
- # Except after an opening paren, or after another opening brace (in case of
- # an initializer list, for instance), you should have spaces before your
- # braces. And since you should never have braces at the beginning of a line,
- # this is an easy test.
- match = Match(r'^(.*[^ ({>]){', line)
- if match:
- # Try a bit harder to check for brace initialization. This
- # happens in one of the following forms:
- # Constructor() : initializer_list_{} { ... }
- # Constructor{}.MemberFunction()
- # Type variable{};
- # FunctionCall(type{}, ...);
- # LastArgument(..., type{});
- # LOG(INFO) << type{} << " ...";
- # map_of_type[{...}] = ...;
- # ternary = expr ? new type{} : nullptr;
- # OuterTemplate<InnerTemplateConstructor<Type>{}>
- #
- # We check for the character following the closing brace, and
- # silence the warning if it's one of those listed above, i.e.
- # "{.;,)<>]:".
- #
- # To account for nested initializer list, we allow any number of
- # closing braces up to "{;,)<". We can't simply silence the
- # warning on first sight of closing brace, because that would
- # cause false negatives for things that are not initializer lists.
- # Silence this: But not this:
- # Outer{ if (...) {
- # Inner{...} if (...){ // Missing space before {
- # }; }
- #
- # There is a false negative with this approach if people inserted
- # spurious semicolons, e.g. "if (cond){};", but we will catch the
- # spurious semicolon with a separate check.
- (endline, endlinenum, endpos) = CloseExpression(
- clean_lines, linenum, len(match.group(1)))
- trailing_text = ''
- if endpos > -1:
- trailing_text = endline[endpos:]
- for offset in xrange(endlinenum + 1,
- min(endlinenum + 3, clean_lines.NumLines() - 1)):
- trailing_text += clean_lines.elided[offset]
- if not Match(r'^[\s}]*[{.;,)<>\]:]', trailing_text):
- error(filename, linenum, 'whitespace/braces', 5,
- 'Missing space before {')
-
- # Make sure '} else {' has spaces.
- if Search(r'}else', line):
- error(filename, linenum, 'whitespace/braces', 5,
- 'Missing space before else')
-
- # You shouldn't have a space before a semicolon at the end of the line.
- # There's a special case for "for" since the style guide allows space before
- # the semicolon there.
- if Search(r':\s*;\s*$', line):
- error(filename, linenum, 'whitespace/semicolon', 5,
- 'Semicolon defining empty statement. Use {} instead.')
- elif Search(r'^\s*;\s*$', line):
- error(filename, linenum, 'whitespace/semicolon', 5,
- 'Line contains only semicolon. If this should be an empty statement, '
- 'use {} instead.')
- elif (Search(r'\s+;\s*$', line) and
- not Search(r'\bfor\b', line)):
- error(filename, linenum, 'whitespace/semicolon', 5,
- 'Extra space before last semicolon. If this should be an empty '
- 'statement, use {} instead.')
-
-
-def IsDecltype(clean_lines, linenum, column):
- """Check if the token ending on (linenum, column) is decltype().
-
- Args:
- clean_lines: A CleansedLines instance containing the file.
- linenum: the number of the line to check.
- column: end column of the token to check.
- Returns:
- True if this token is decltype() expression, False otherwise.
- """
- (text, _, start_col) = ReverseCloseExpression(clean_lines, linenum, column)
- if start_col < 0:
- return False
- if Search(r'\bdecltype\s*$', text[0:start_col]):
- return True
- return False
-
-
-def IsTemplateParameterList(clean_lines, linenum, column):
- """Check if the token ending on (linenum, column) is the end of template<>.
-
- Args:
- clean_lines: A CleansedLines instance containing the file.
- linenum: the number of the line to check.
- column: end column of the token to check.
- Returns:
- True if this token is end of a template parameter list, False otherwise.
- """
- (_, startline, startpos) = ReverseCloseExpression(
- clean_lines, linenum, column)
- if (startpos > -1 and
- Search(r'\btemplate\s*$', clean_lines.elided[startline][0:startpos])):
- return True
- return False
-
-
-def IsRValueType(typenames, clean_lines, nesting_state, linenum, column):
- """Check if the token ending on (linenum, column) is a type.
-
- Assumes that text to the right of the column is "&&" or a function
- name.
-
- Args:
- typenames: set of type names from template-argument-list.
- clean_lines: A CleansedLines instance containing the file.
- nesting_state: A NestingState instance which maintains information about
- the current stack of nested blocks being parsed.
- linenum: the number of the line to check.
- column: end column of the token to check.
- Returns:
- True if this token is a type, False if we are not sure.
- """
- prefix = clean_lines.elided[linenum][0:column]
-
- # Get one word to the left. If we failed to do so, this is most
- # likely not a type, since it's unlikely that the type name and "&&"
- # would be split across multiple lines.
- match = Match(r'^(.*)(\b\w+|[>*)&])\s*$', prefix)
- if not match:
- return False
-
- # Check text following the token. If it's "&&>" or "&&," or "&&...", it's
- # most likely a rvalue reference used inside a template.
- suffix = clean_lines.elided[linenum][column:]
- if Match(r'&&\s*(?:[>,]|\.\.\.)', suffix):
- return True
-
- # Check for known types and end of templates:
- # int&& variable
- # vector<int>&& variable
- #
- # Because this function is called recursively, we also need to
- # recognize pointer and reference types:
- # int* Function()
- # int& Function()
- if (match.group(2) in typenames or
- match.group(2) in ['char', 'char16_t', 'char32_t', 'wchar_t', 'bool',
- 'short', 'int', 'long', 'signed', 'unsigned',
- 'float', 'double', 'void', 'auto', '>', '*', '&']):
- return True
-
- # If we see a close parenthesis, look for decltype on the other side.
- # decltype would unambiguously identify a type, anything else is
- # probably a parenthesized expression and not a type.
- if match.group(2) == ')':
- return IsDecltype(
- clean_lines, linenum, len(match.group(1)) + len(match.group(2)) - 1)
-
- # Check for casts and cv-qualifiers.
- # match.group(1) remainder
- # -------------- ---------
- # const_cast< type&&
- # const type&&
- # type const&&
- if Search(r'\b(?:const_cast\s*<|static_cast\s*<|dynamic_cast\s*<|'
- r'reinterpret_cast\s*<|\w+\s)\s*$',
- match.group(1)):
- return True
-
- # Look for a preceding symbol that might help differentiate the context.
- # These are the cases that would be ambiguous:
- # match.group(1) remainder
- # -------------- ---------
- # Call ( expression &&
- # Declaration ( type&&
- # sizeof ( type&&
- # if ( expression &&
- # while ( expression &&
- # for ( type&&
- # for( ; expression &&
- # statement ; type&&
- # block { type&&
- # constructor { expression &&
- start = linenum
- line = match.group(1)
- match_symbol = None
- while start >= 0:
- # We want to skip over identifiers and commas to get to a symbol.
- # Commas are skipped so that we can find the opening parenthesis
- # for function parameter lists.
- match_symbol = Match(r'^(.*)([^\w\s,])[\w\s,]*$', line)
- if match_symbol:
- break
- start -= 1
- line = clean_lines.elided[start]
-
- if not match_symbol:
- # Probably the first statement in the file is an rvalue reference
- return True
-
- if match_symbol.group(2) == '}':
- # Found closing brace, probably an indicate of this:
- # block{} type&&
- return True
-
- if match_symbol.group(2) == ';':
- # Found semicolon, probably one of these:
- # for(; expression &&
- # statement; type&&
-
- # Look for the previous 'for(' in the previous lines.
- before_text = match_symbol.group(1)
- for i in xrange(start - 1, max(start - 6, 0), -1):
- before_text = clean_lines.elided[i] + before_text
- if Search(r'for\s*\([^{};]*$', before_text):
- # This is the condition inside a for-loop
- return False
-
- # Did not find a for-init-statement before this semicolon, so this
- # is probably a new statement and not a condition.
- return True
-
- if match_symbol.group(2) == '{':
- # Found opening brace, probably one of these:
- # block{ type&& = ... ; }
- # constructor{ expression && expression }
-
- # Look for a closing brace or a semicolon. If we see a semicolon
- # first, this is probably a rvalue reference.
- line = clean_lines.elided[start][0:len(match_symbol.group(1)) + 1]
- end = start
- depth = 1
- while True:
- for ch in line:
- if ch == ';':
- return True
- elif ch == '{':
- depth += 1
- elif ch == '}':
- depth -= 1
- if depth == 0:
- return False
- end += 1
- if end >= clean_lines.NumLines():
- break
- line = clean_lines.elided[end]
- # Incomplete program?
- return False
-
- if match_symbol.group(2) == '(':
- # Opening parenthesis. Need to check what's to the left of the
- # parenthesis. Look back one extra line for additional context.
- before_text = match_symbol.group(1)
- if linenum > 1:
- before_text = clean_lines.elided[linenum - 1] + before_text
- before_text = match_symbol.group(1)
-
- # Patterns that are likely to be types:
- # [](type&&
- # for (type&&
- # sizeof(type&&
- # operator=(type&&
- #
- if Search(r'(?:\]|\bfor|\bsizeof|\boperator\s*\S+\s*)\s*$', before_text):
- return True
-
- # Patterns that are likely to be expressions:
- # if (expression &&
- # while (expression &&
- # : initializer(expression &&
- # , initializer(expression &&
- # ( FunctionCall(expression &&
- # + FunctionCall(expression &&
- # + (expression &&
- #
- # The last '+' represents operators such as '+' and '-'.
- if Search(r'(?:\bif|\bwhile|[-+=%^(<!?:,&*]\s*)$', before_text):
- return False
-
- # Something else. Check that tokens to the left look like
- # return_type function_name
- match_func = Match(r'^(.*\S.*)\s+\w(?:\w|::)*(?:<[^<>]*>)?\s*$',
- match_symbol.group(1))
- if match_func:
- # Check for constructors, which don't have return types.
- if Search(r'\b(?:explicit|inline)$', match_func.group(1)):
- return True
- implicit_constructor = Match(r'\s*(\w+)\((?:const\s+)?(\w+)', prefix)
- if (implicit_constructor and
- implicit_constructor.group(1) == implicit_constructor.group(2)):
- return True
- return IsRValueType(typenames, clean_lines, nesting_state, linenum,
- len(match_func.group(1)))
-
- # Nothing before the function name. If this is inside a block scope,
- # this is probably a function call.
- return not (nesting_state.previous_stack_top and
- nesting_state.previous_stack_top.IsBlockInfo())
-
- if match_symbol.group(2) == '>':
- # Possibly a closing bracket, check that what's on the other side
- # looks like the start of a template.
- return IsTemplateParameterList(
- clean_lines, start, len(match_symbol.group(1)))
-
- # Some other symbol, usually something like "a=b&&c". This is most
- # likely not a type.
- return False
-
-
-def IsDeletedOrDefault(clean_lines, linenum):
- """Check if current constructor or operator is deleted or default.
-
- Args:
- clean_lines: A CleansedLines instance containing the file.
- linenum: The number of the line to check.
- Returns:
- True if this is a deleted or default constructor.
- """
- open_paren = clean_lines.elided[linenum].find('(')
- if open_paren < 0:
- return False
- (close_line, _, close_paren) = CloseExpression(
- clean_lines, linenum, open_paren)
- if close_paren < 0:
- return False
- return Match(r'\s*=\s*(?:delete|default)\b', close_line[close_paren:])
-
-
-def IsRValueAllowed(clean_lines, linenum, typenames):
- """Check if RValue reference is allowed on a particular line.
-
- Args:
- clean_lines: A CleansedLines instance containing the file.
- linenum: The number of the line to check.
- typenames: set of type names from template-argument-list.
- Returns:
- True if line is within the region where RValue references are allowed.
- """
- # Allow region marked by PUSH/POP macros
- for i in xrange(linenum, 0, -1):
- line = clean_lines.elided[i]
- if Match(r'GOOGLE_ALLOW_RVALUE_REFERENCES_(?:PUSH|POP)', line):
- if not line.endswith('PUSH'):
- return False
- for j in xrange(linenum, clean_lines.NumLines(), 1):
- line = clean_lines.elided[j]
- if Match(r'GOOGLE_ALLOW_RVALUE_REFERENCES_(?:PUSH|POP)', line):
- return line.endswith('POP')
-
- # Allow operator=
- line = clean_lines.elided[linenum]
- if Search(r'\boperator\s*=\s*\(', line):
- return IsDeletedOrDefault(clean_lines, linenum)
-
- # Allow constructors
- match = Match(r'\s*(?:[\w<>]+::)*([\w<>]+)\s*::\s*([\w<>]+)\s*\(', line)
- if match and match.group(1) == match.group(2):
- return IsDeletedOrDefault(clean_lines, linenum)
- if Search(r'\b(?:explicit|inline)\s+[\w<>]+\s*\(', line):
- return IsDeletedOrDefault(clean_lines, linenum)
-
- if Match(r'\s*[\w<>]+\s*\(', line):
- previous_line = 'ReturnType'
- if linenum > 0:
- previous_line = clean_lines.elided[linenum - 1]
- if Match(r'^\s*$', previous_line) or Search(r'[{}:;]\s*$', previous_line):
- return IsDeletedOrDefault(clean_lines, linenum)
-
- # Reject types not mentioned in template-argument-list
- while line:
- match = Match(r'^.*?(\w+)\s*&&(.*)$', line)
- if not match:
- break
- if match.group(1) not in typenames:
- return False
- line = match.group(2)
-
- # All RValue types that were in template-argument-list should have
- # been removed by now. Those were allowed, assuming that they will
- # be forwarded.
- #
- # If there are no remaining RValue types left (i.e. types that were
- # not found in template-argument-list), flag those as not allowed.
- return line.find('&&') < 0
-
-
-def GetTemplateArgs(clean_lines, linenum):
- """Find list of template arguments associated with this function declaration.
-
- Args:
- clean_lines: A CleansedLines instance containing the file.
- linenum: Line number containing the start of the function declaration,
- usually one line after the end of the template-argument-list.
- Returns:
- Set of type names, or empty set if this does not appear to have
- any template parameters.
- """
- # Find start of function
- func_line = linenum
- while func_line > 0:
- line = clean_lines.elided[func_line]
- if Match(r'^\s*$', line):
- return set()
- if line.find('(') >= 0:
- break
- func_line -= 1
- if func_line == 0:
- return set()
-
- # Collapse template-argument-list into a single string
- argument_list = ''
- match = Match(r'^(\s*template\s*)<', clean_lines.elided[func_line])
- if match:
- # template-argument-list on the same line as function name
- start_col = len(match.group(1))
- _, end_line, end_col = CloseExpression(clean_lines, func_line, start_col)
- if end_col > -1 and end_line == func_line:
- start_col += 1 # Skip the opening bracket
- argument_list = clean_lines.elided[func_line][start_col:end_col]
-
- elif func_line > 1:
- # template-argument-list one line before function name
- match = Match(r'^(.*)>\s*$', clean_lines.elided[func_line - 1])
- if match:
- end_col = len(match.group(1))
- _, start_line, start_col = ReverseCloseExpression(
- clean_lines, func_line - 1, end_col)
- if start_col > -1:
- start_col += 1 # Skip the opening bracket
- while start_line < func_line - 1:
- argument_list += clean_lines.elided[start_line][start_col:]
- start_col = 0
- start_line += 1
- argument_list += clean_lines.elided[func_line - 1][start_col:end_col]
-
- if not argument_list:
- return set()
-
- # Extract type names
- typenames = set()
- while True:
- match = Match(r'^[,\s]*(?:typename|class)(?:\.\.\.)?\s+(\w+)(.*)$',
- argument_list)
- if not match:
- break
- typenames.add(match.group(1))
- argument_list = match.group(2)
- return typenames
-
-
-def CheckRValueReference(filename, clean_lines, linenum, nesting_state, error):
- """Check for rvalue references.
-
- Args:
- filename: The name of the current file.
- clean_lines: A CleansedLines instance containing the file.
- linenum: The number of the line to check.
- nesting_state: A NestingState instance which maintains information about
- the current stack of nested blocks being parsed.
- error: The function to call with any errors found.
- """
- # Find lines missing spaces around &&.
- # TODO(unknown): currently we don't check for rvalue references
- # with spaces surrounding the && to avoid false positives with
- # boolean expressions.
- line = clean_lines.elided[linenum]
- match = Match(r'^(.*\S)&&', line)
- if not match:
- match = Match(r'(.*)&&\S', line)
- if (not match) or '(&&)' in line or Search(r'\boperator\s*$', match.group(1)):
- return
-
- # Either poorly formed && or an rvalue reference, check the context
- # to get a more accurate error message. Mostly we want to determine
- # if what's to the left of "&&" is a type or not.
- typenames = GetTemplateArgs(clean_lines, linenum)
- and_pos = len(match.group(1))
- if IsRValueType(typenames, clean_lines, nesting_state, linenum, and_pos):
- if not IsRValueAllowed(clean_lines, linenum, typenames):
- error(filename, linenum, 'build/c++11', 3,
- 'RValue references are an unapproved C++ feature.')
- else:
- error(filename, linenum, 'whitespace/operators', 3,
- 'Missing spaces around &&')
-
-
-def CheckSectionSpacing(filename, clean_lines, class_info, linenum, error):
- """Checks for additional blank line issues related to sections.
-
- Currently the only thing checked here is blank line before protected/private.
-
- Args:
- filename: The name of the current file.
- clean_lines: A CleansedLines instance containing the file.
- class_info: A _ClassInfo objects.
- linenum: The number of the line to check.
- error: The function to call with any errors found.
- """
- # Skip checks if the class is small, where small means 25 lines or less.
- # 25 lines seems like a good cutoff since that's the usual height of
- # terminals, and any class that can't fit in one screen can't really
- # be considered "small".
- #
- # Also skip checks if we are on the first line. This accounts for
- # classes that look like
- # class Foo { public: ... };
- #
- # If we didn't find the end of the class, last_line would be zero,
- # and the check will be skipped by the first condition.
- if (class_info.last_line - class_info.starting_linenum <= 24 or
- linenum <= class_info.starting_linenum):
- return
-
- matched = Match(r'\s*(public|protected|private):', clean_lines.lines[linenum])
- if matched:
- # Issue warning if the line before public/protected/private was
- # not a blank line, but don't do this if the previous line contains
- # "class" or "struct". This can happen two ways:
- # - We are at the beginning of the class.
- # - We are forward-declaring an inner class that is semantically
- # private, but needed to be public for implementation reasons.
- # Also ignores cases where the previous line ends with a backslash as can be
- # common when defining classes in C macros.
- prev_line = clean_lines.lines[linenum - 1]
- if (not IsBlankLine(prev_line) and
- not Search(r'\b(class|struct)\b', prev_line) and
- not Search(r'\\$', prev_line)):
- # Try a bit harder to find the beginning of the class. This is to
- # account for multi-line base-specifier lists, e.g.:
- # class Derived
- # : public Base {
- end_class_head = class_info.starting_linenum
- for i in range(class_info.starting_linenum, linenum):
- if Search(r'\{\s*$', clean_lines.lines[i]):
- end_class_head = i
- break
- if end_class_head < linenum - 1:
- error(filename, linenum, 'whitespace/blank_line', 3,
- '"%s:" should be preceded by a blank line' % matched.group(1))
-
-
-def GetPreviousNonBlankLine(clean_lines, linenum):
- """Return the most recent non-blank line and its line number.
-
- Args:
- clean_lines: A CleansedLines instance containing the file contents.
- linenum: The number of the line to check.
-
- Returns:
- A tuple with two elements. The first element is the contents of the last
- non-blank line before the current line, or the empty string if this is the
- first non-blank line. The second is the line number of that line, or -1
- if this is the first non-blank line.
- """
-
- prevlinenum = linenum - 1
- while prevlinenum >= 0:
- prevline = clean_lines.elided[prevlinenum]
- if not IsBlankLine(prevline): # if not a blank line...
- return (prevline, prevlinenum)
- prevlinenum -= 1
- return ('', -1)
-
-
-def CheckBraces(filename, clean_lines, linenum, error):
- """Looks for misplaced braces (e.g. at the end of line).
-
- Args:
- filename: The name of the current file.
- clean_lines: A CleansedLines instance containing the file.
- linenum: The number of the line to check.
- error: The function to call with any errors found.
- """
-
- line = clean_lines.elided[linenum] # get rid of comments and strings
-
- if Match(r'\s*{\s*$', line):
- # We allow an open brace to start a line in the case where someone is using
- # braces in a block to explicitly create a new scope, which is commonly used
- # to control the lifetime of stack-allocated variables. Braces are also
- # used for brace initializers inside function calls. We don't detect this
- # perfectly: we just don't complain if the last non-whitespace character on
- # the previous non-blank line is ',', ';', ':', '(', '{', or '}', or if the
- # previous line starts a preprocessor block.
- prevline = GetPreviousNonBlankLine(clean_lines, linenum)[0]
- if (not Search(r'[,;:}{(]\s*$', prevline) and
- not Match(r'\s*#', prevline)):
- error(filename, linenum, 'whitespace/braces', 4,
- '{ should almost always be at the end of the previous line')
-
- # An else clause should be on the same line as the preceding closing brace.
- if Match(r'\s*else\b\s*(?:if\b|\{|$)', line):
- prevline = GetPreviousNonBlankLine(clean_lines, linenum)[0]
- if Match(r'\s*}\s*$', prevline):
- error(filename, linenum, 'whitespace/newline', 4,
- 'An else should appear on the same line as the preceding }')
-
- # If braces come on one side of an else, they should be on both.
- # However, we have to worry about "else if" that spans multiple lines!
- if Search(r'else if\s*\(', line): # could be multi-line if
- brace_on_left = bool(Search(r'}\s*else if\s*\(', line))
- # find the ( after the if
- pos = line.find('else if')
- pos = line.find('(', pos)
- if pos > 0:
- (endline, _, endpos) = CloseExpression(clean_lines, linenum, pos)
- brace_on_right = endline[endpos:].find('{') != -1
- if brace_on_left != brace_on_right: # must be brace after if
- error(filename, linenum, 'readability/braces', 5,
- 'If an else has a brace on one side, it should have it on both')
- elif Search(r'}\s*else[^{]*$', line) or Match(r'[^}]*else\s*{', line):
- error(filename, linenum, 'readability/braces', 5,
- 'If an else has a brace on one side, it should have it on both')
-
- # Likewise, an else should never have the else clause on the same line
- if Search(r'\belse [^\s{]', line) and not Search(r'\belse if\b', line):
- error(filename, linenum, 'whitespace/newline', 4,
- 'Else clause should never be on same line as else (use 2 lines)')
-
- # In the same way, a do/while should never be on one line
- if Match(r'\s*do [^\s{]', line):
- error(filename, linenum, 'whitespace/newline', 4,
- 'do/while clauses should not be on a single line')
-
- # Check single-line if/else bodies. The style guide says 'curly braces are not
- # required for single-line statements'. We additionally allow multi-line,
- # single statements, but we reject anything with more than one semicolon in
- # it. This means that the first semicolon after the if should be at the end of
- # its line, and the line after that should have an indent level equal to or
- # lower than the if. We also check for ambiguous if/else nesting without
- # braces.
- if_else_match = Search(r'\b(if\s*\(|else\b)', line)
- if if_else_match and not Match(r'\s*#', line):
- if_indent = GetIndentLevel(line)
- endline, endlinenum, endpos = line, linenum, if_else_match.end()
- if_match = Search(r'\bif\s*\(', line)
- if if_match:
- # This could be a multiline if condition, so find the end first.
- pos = if_match.end() - 1
- (endline, endlinenum, endpos) = CloseExpression(clean_lines, linenum, pos)
- # Check for an opening brace, either directly after the if or on the next
- # line. If found, this isn't a single-statement conditional.
- if (not Match(r'\s*{', endline[endpos:])
- and not (Match(r'\s*$', endline[endpos:])
- and endlinenum < (len(clean_lines.elided) - 1)
- and Match(r'\s*{', clean_lines.elided[endlinenum + 1]))):
- while (endlinenum < len(clean_lines.elided)
- and ';' not in clean_lines.elided[endlinenum][endpos:]):
- endlinenum += 1
- endpos = 0
- if endlinenum < len(clean_lines.elided):
- endline = clean_lines.elided[endlinenum]
- # We allow a mix of whitespace and closing braces (e.g. for one-liner
- # methods) and a single \ after the semicolon (for macros)
- endpos = endline.find(';')
- if not Match(r';[\s}]*(\\?)$', endline[endpos:]):
- # Semicolon isn't the last character, there's something trailing.
- # Output a warning if the semicolon is not contained inside
- # a lambda expression.
- if not Match(r'^[^{};]*\[[^\[\]]*\][^{}]*\{[^{}]*\}\s*\)*[;,]\s*$',
- endline):
- error(filename, linenum, 'readability/braces', 4,
- 'If/else bodies with multiple statements require braces')
- elif endlinenum < len(clean_lines.elided) - 1:
- # Make sure the next line is dedented
- next_line = clean_lines.elided[endlinenum + 1]
- next_indent = GetIndentLevel(next_line)
- # With ambiguous nested if statements, this will error out on the
- # if that *doesn't* match the else, regardless of whether it's the
- # inner one or outer one.
- if (if_match and Match(r'\s*else\b', next_line)
- and next_indent != if_indent):
- error(filename, linenum, 'readability/braces', 4,
- 'Else clause should be indented at the same level as if. '
- 'Ambiguous nested if/else chains require braces.')
- elif next_indent > if_indent:
- error(filename, linenum, 'readability/braces', 4,
- 'If/else bodies with multiple statements require braces')
-
-
-def CheckTrailingSemicolon(filename, clean_lines, linenum, error):
- """Looks for redundant trailing semicolon.
-
- Args:
- filename: The name of the current file.
- clean_lines: A CleansedLines instance containing the file.
- linenum: The number of the line to check.
- error: The function to call with any errors found.
- """
-
- line = clean_lines.elided[linenum]
-
- # Block bodies should not be followed by a semicolon. Due to C++11
- # brace initialization, there are more places where semicolons are
- # required than not, so we use a whitelist approach to check these
- # rather than a blacklist. These are the places where "};" should
- # be replaced by just "}":
- # 1. Some flavor of block following closing parenthesis:
- # for (;;) {};
- # while (...) {};
- # switch (...) {};
- # Function(...) {};
- # if (...) {};
- # if (...) else if (...) {};
- #
- # 2. else block:
- # if (...) else {};
- #
- # 3. const member function:
- # Function(...) const {};
- #
- # 4. Block following some statement:
- # x = 42;
- # {};
- #
- # 5. Block at the beginning of a function:
- # Function(...) {
- # {};
- # }
- #
- # Note that naively checking for the preceding "{" will also match
- # braces inside multi-dimensional arrays, but this is fine since
- # that expression will not contain semicolons.
- #
- # 6. Block following another block:
- # while (true) {}
- # {};
- #
- # 7. End of namespaces:
- # namespace {};
- #
- # These semicolons seems far more common than other kinds of
- # redundant semicolons, possibly due to people converting classes
- # to namespaces. For now we do not warn for this case.
- #
- # Try matching case 1 first.
- match = Match(r'^(.*\)\s*)\{', line)
- if match:
- # Matched closing parenthesis (case 1). Check the token before the
- # matching opening parenthesis, and don't warn if it looks like a
- # macro. This avoids these false positives:
- # - macro that defines a base class
- # - multi-line macro that defines a base class
- # - macro that defines the whole class-head
- #
- # But we still issue warnings for macros that we know are safe to
- # warn, specifically:
- # - TEST, TEST_F, TEST_P, MATCHER, MATCHER_P
- # - TYPED_TEST
- # - INTERFACE_DEF
- # - EXCLUSIVE_LOCKS_REQUIRED, SHARED_LOCKS_REQUIRED, LOCKS_EXCLUDED:
- #
- # We implement a whitelist of safe macros instead of a blacklist of
- # unsafe macros, even though the latter appears less frequently in
- # google code and would have been easier to implement. This is because
- # the downside for getting the whitelist wrong means some extra
- # semicolons, while the downside for getting the blacklist wrong
- # would result in compile errors.
- #
- # In addition to macros, we also don't want to warn on
- # - Compound literals
- # - Lambdas
- # - alignas specifier with anonymous structs:
- closing_brace_pos = match.group(1).rfind(')')
- opening_parenthesis = ReverseCloseExpression(
- clean_lines, linenum, closing_brace_pos)
- if opening_parenthesis[2] > -1:
- line_prefix = opening_parenthesis[0][0:opening_parenthesis[2]]
- macro = Search(r'\b([A-Z_]+)\s*$', line_prefix)
- func = Match(r'^(.*\])\s*$', line_prefix)
- if ((macro and
- macro.group(1) not in (
- 'TEST', 'TEST_F', 'MATCHER', 'MATCHER_P', 'TYPED_TEST',
- 'EXCLUSIVE_LOCKS_REQUIRED', 'SHARED_LOCKS_REQUIRED',
- 'LOCKS_EXCLUDED', 'INTERFACE_DEF')) or
- (func and not Search(r'\boperator\s*\[\s*\]', func.group(1))) or
- Search(r'\b(?:struct|union)\s+alignas\s*$', line_prefix) or
- Search(r'\s+=\s*$', line_prefix)):
- match = None
- if (match and
- opening_parenthesis[1] > 1 and
- Search(r'\]\s*$', clean_lines.elided[opening_parenthesis[1] - 1])):
- # Multi-line lambda-expression
- match = None
-
- else:
- # Try matching cases 2-3.
- match = Match(r'^(.*(?:else|\)\s*const)\s*)\{', line)
- if not match:
- # Try matching cases 4-6. These are always matched on separate lines.
- #
- # Note that we can't simply concatenate the previous line to the
- # current line and do a single match, otherwise we may output
- # duplicate warnings for the blank line case:
- # if (cond) {
- # // blank line
- # }
- prevline = GetPreviousNonBlankLine(clean_lines, linenum)[0]
- if prevline and Search(r'[;{}]\s*$', prevline):
- match = Match(r'^(\s*)\{', line)
-
- # Check matching closing brace
- if match:
- (endline, endlinenum, endpos) = CloseExpression(
- clean_lines, linenum, len(match.group(1)))
- if endpos > -1 and Match(r'^\s*;', endline[endpos:]):
- # Current {} pair is eligible for semicolon check, and we have found
- # the redundant semicolon, output warning here.
- #
- # Note: because we are scanning forward for opening braces, and
- # outputting warnings for the matching closing brace, if there are
- # nested blocks with trailing semicolons, we will get the error
- # messages in reversed order.
- error(filename, endlinenum, 'readability/braces', 4,
- "You don't need a ; after a }")
-
-
-def CheckEmptyBlockBody(filename, clean_lines, linenum, error):
- """Look for empty loop/conditional body with only a single semicolon.
-
- Args:
- filename: The name of the current file.
- clean_lines: A CleansedLines instance containing the file.
- linenum: The number of the line to check.
- error: The function to call with any errors found.
- """
-
- # Search for loop keywords at the beginning of the line. Because only
- # whitespaces are allowed before the keywords, this will also ignore most
- # do-while-loops, since those lines should start with closing brace.
- #
- # We also check "if" blocks here, since an empty conditional block
- # is likely an error.
- line = clean_lines.elided[linenum]
- matched = Match(r'\s*(for|while|if)\s*\(', line)
- if matched:
- # Find the end of the conditional expression
- (end_line, end_linenum, end_pos) = CloseExpression(
- clean_lines, linenum, line.find('('))
-
- # Output warning if what follows the condition expression is a semicolon.
- # No warning for all other cases, including whitespace or newline, since we
- # have a separate check for semicolons preceded by whitespace.
- if end_pos >= 0 and Match(r';', end_line[end_pos:]):
- if matched.group(1) == 'if':
- error(filename, end_linenum, 'whitespace/empty_conditional_body', 5,
- 'Empty conditional bodies should use {}')
- else:
- error(filename, end_linenum, 'whitespace/empty_loop_body', 5,
- 'Empty loop bodies should use {} or continue')
-
-
-def FindCheckMacro(line):
- """Find a replaceable CHECK-like macro.
-
- Args:
- line: line to search on.
- Returns:
- (macro name, start position), or (None, -1) if no replaceable
- macro is found.
- """
- for macro in _CHECK_MACROS:
- i = line.find(macro)
- if i >= 0:
- # Find opening parenthesis. Do a regular expression match here
- # to make sure that we are matching the expected CHECK macro, as
- # opposed to some other macro that happens to contain the CHECK
- # substring.
- matched = Match(r'^(.*\b' + macro + r'\s*)\(', line)
- if not matched:
- continue
- return (macro, len(matched.group(1)))
- return (None, -1)
-
-
-def CheckCheck(filename, clean_lines, linenum, error):
- """Checks the use of CHECK and EXPECT macros.
-
- Args:
- filename: The name of the current file.
- clean_lines: A CleansedLines instance containing the file.
- linenum: The number of the line to check.
- error: The function to call with any errors found.
- """
-
- # Decide the set of replacement macros that should be suggested
- lines = clean_lines.elided
- (check_macro, start_pos) = FindCheckMacro(lines[linenum])
- if not check_macro:
- return
-
- # Find end of the boolean expression by matching parentheses
- (last_line, end_line, end_pos) = CloseExpression(
- clean_lines, linenum, start_pos)
- if end_pos < 0:
- return
-
- # If the check macro is followed by something other than a
- # semicolon, assume users will log their own custom error messages
- # and don't suggest any replacements.
- if not Match(r'\s*;', last_line[end_pos:]):
- return
-
- if linenum == end_line:
- expression = lines[linenum][start_pos + 1:end_pos - 1]
- else:
- expression = lines[linenum][start_pos + 1:]
- for i in xrange(linenum + 1, end_line):
- expression += lines[i]
- expression += last_line[0:end_pos - 1]
-
- # Parse expression so that we can take parentheses into account.
- # This avoids false positives for inputs like "CHECK((a < 4) == b)",
- # which is not replaceable by CHECK_LE.
- lhs = ''
- rhs = ''
- operator = None
- while expression:
- matched = Match(r'^\s*(<<|<<=|>>|>>=|->\*|->|&&|\|\||'
- r'==|!=|>=|>|<=|<|\()(.*)$', expression)
- if matched:
- token = matched.group(1)
- if token == '(':
- # Parenthesized operand
- expression = matched.group(2)
- (end, _) = FindEndOfExpressionInLine(expression, 0, ['('])
- if end < 0:
- return # Unmatched parenthesis
- lhs += '(' + expression[0:end]
- expression = expression[end:]
- elif token in ('&&', '||'):
- # Logical and/or operators. This means the expression
- # contains more than one term, for example:
- # CHECK(42 < a && a < b);
- #
- # These are not replaceable with CHECK_LE, so bail out early.
- return
- elif token in ('<<', '<<=', '>>', '>>=', '->*', '->'):
- # Non-relational operator
- lhs += token
- expression = matched.group(2)
- else:
- # Relational operator
- operator = token
- rhs = matched.group(2)
- break
- else:
- # Unparenthesized operand. Instead of appending to lhs one character
- # at a time, we do another regular expression match to consume several
- # characters at once if possible. Trivial benchmark shows that this
- # is more efficient when the operands are longer than a single
- # character, which is generally the case.
- matched = Match(r'^([^-=!<>()&|]+)(.*)$', expression)
- if not matched:
- matched = Match(r'^(\s*\S)(.*)$', expression)
- if not matched:
- break
- lhs += matched.group(1)
- expression = matched.group(2)
-
- # Only apply checks if we got all parts of the boolean expression
- if not (lhs and operator and rhs):
- return
-
- # Check that rhs do not contain logical operators. We already know
- # that lhs is fine since the loop above parses out && and ||.
- if rhs.find('&&') > -1 or rhs.find('||') > -1:
- return
-
- # At least one of the operands must be a constant literal. This is
- # to avoid suggesting replacements for unprintable things like
- # CHECK(variable != iterator)
- #
- # The following pattern matches decimal, hex integers, strings, and
- # characters (in that order).
- lhs = lhs.strip()
- rhs = rhs.strip()
- match_constant = r'^([-+]?(\d+|0[xX][0-9a-fA-F]+)[lLuU]{0,3}|".*"|\'.*\')$'
- if Match(match_constant, lhs) or Match(match_constant, rhs):
- # Note: since we know both lhs and rhs, we can provide a more
- # descriptive error message like:
- # Consider using CHECK_EQ(x, 42) instead of CHECK(x == 42)
- # Instead of:
- # Consider using CHECK_EQ instead of CHECK(a == b)
- #
- # We are still keeping the less descriptive message because if lhs
- # or rhs gets long, the error message might become unreadable.
- error(filename, linenum, 'readability/check', 2,
- 'Consider using %s instead of %s(a %s b)' % (
- _CHECK_REPLACEMENT[check_macro][operator],
- check_macro, operator))
-
-
-def CheckAltTokens(filename, clean_lines, linenum, error):
- """Check alternative keywords being used in boolean expressions.
-
- Args:
- filename: The name of the current file.
- clean_lines: A CleansedLines instance containing the file.
- linenum: The number of the line to check.
- error: The function to call with any errors found.
- """
- line = clean_lines.elided[linenum]
-
- # Avoid preprocessor lines
- if Match(r'^\s*#', line):
- return
-
- # Last ditch effort to avoid multi-line comments. This will not help
- # if the comment started before the current line or ended after the
- # current line, but it catches most of the false positives. At least,
- # it provides a way to workaround this warning for people who use
- # multi-line comments in preprocessor macros.
- #
- # TODO(unknown): remove this once cpplint has better support for
- # multi-line comments.
- if line.find('/*') >= 0 or line.find('*/') >= 0:
- return
-
- for match in _ALT_TOKEN_REPLACEMENT_PATTERN.finditer(line):
- error(filename, linenum, 'readability/alt_tokens', 2,
- 'Use operator %s instead of %s' % (
- _ALT_TOKEN_REPLACEMENT[match.group(1)], match.group(1)))
-
-
-def GetLineWidth(line):
- """Determines the width of the line in column positions.
-
- Args:
- line: A string, which may be a Unicode string.
-
- Returns:
- The width of the line in column positions, accounting for Unicode
- combining characters and wide characters.
- """
- if isinstance(line, unicode):
- width = 0
- for uc in unicodedata.normalize('NFC', line):
- if unicodedata.east_asian_width(uc) in ('W', 'F'):
- width += 2
- elif not unicodedata.combining(uc):
- width += 1
- return width
- else:
- return len(line)
-
-
-def CheckStyle(filename, clean_lines, linenum, file_extension, nesting_state,
- error):
- """Checks rules from the 'C++ style rules' section of cppguide.html.
-
- Most of these rules are hard to test (naming, comment style), but we
- do what we can. In particular we check for 2-space indents, line lengths,
- tab usage, spaces inside code, etc.
-
- Args:
- filename: The name of the current file.
- clean_lines: A CleansedLines instance containing the file.
- linenum: The number of the line to check.
- file_extension: The extension (without the dot) of the filename.
- nesting_state: A NestingState instance which maintains information about
- the current stack of nested blocks being parsed.
- error: The function to call with any errors found.
- """
-
- # Don't use "elided" lines here, otherwise we can't check commented lines.
- # Don't want to use "raw" either, because we don't want to check inside C++11
- # raw strings,
- raw_lines = clean_lines.lines_without_raw_strings
- line = raw_lines[linenum]
-
- if line.find('\t') != -1:
- error(filename, linenum, 'whitespace/tab', 1,
- 'Tab found; better to use spaces')
-
- # One or three blank spaces at the beginning of the line is weird; it's
- # hard to reconcile that with 2-space indents.
- # NOTE: here are the conditions rob pike used for his tests. Mine aren't
- # as sophisticated, but it may be worth becoming so: RLENGTH==initial_spaces
- # if(RLENGTH > 20) complain = 0;
- # if(match($0, " +(error|private|public|protected):")) complain = 0;
- # if(match(prev, "&& *$")) complain = 0;
- # if(match(prev, "\\|\\| *$")) complain = 0;
- # if(match(prev, "[\",=><] *$")) complain = 0;
- # if(match($0, " <<")) complain = 0;
- # if(match(prev, " +for \\(")) complain = 0;
- # if(prevodd && match(prevprev, " +for \\(")) complain = 0;
- scope_or_label_pattern = r'\s*\w+\s*:\s*\\?$'
- classinfo = nesting_state.InnermostClass()
- initial_spaces = 0
- cleansed_line = clean_lines.elided[linenum]
- while initial_spaces < len(line) and line[initial_spaces] == ' ':
- initial_spaces += 1
- if line and line[-1].isspace():
- error(filename, linenum, 'whitespace/end_of_line', 4,
- 'Line ends in whitespace. Consider deleting these extra spaces.')
- # There are certain situations we allow one space, notably for
- # section labels, and also lines containing multi-line raw strings.
- elif ((initial_spaces == 1 or initial_spaces == 3) and
- not Match(scope_or_label_pattern, cleansed_line) and
- not (clean_lines.raw_lines[linenum] != line and
- Match(r'^\s*""', line))):
- error(filename, linenum, 'whitespace/indent', 3,
- 'Weird number of spaces at line-start. '
- 'Are you using a 2-space indent?')
-
- # Check if the line is a header guard.
- is_header_guard = False
- if file_extension == 'h':
- cppvar = GetHeaderGuardCPPVariable(filename)
- if (line.startswith('#ifndef %s' % cppvar) or
- line.startswith('#define %s' % cppvar) or
- line.startswith('#endif // %s' % cppvar)):
- is_header_guard = True
- # #include lines and header guards can be long, since there's no clean way to
- # split them.
- #
- # URLs can be long too. It's possible to split these, but it makes them
- # harder to cut&paste.
- #
- # The "$Id:...$" comment may also get very long without it being the
- # developers fault.
- if (not line.startswith('#include') and not is_header_guard and
- not Match(r'^\s*//.*http(s?)://\S*$', line) and
- not Match(r'^// \$Id:.*#[0-9]+ \$$', line)):
- line_width = GetLineWidth(line)
- extended_length = int((_line_length * 1.25))
- if line_width > extended_length:
- error(filename, linenum, 'whitespace/line_length', 4,
- 'Lines should very rarely be longer than %i characters' %
- extended_length)
- elif line_width > _line_length:
- error(filename, linenum, 'whitespace/line_length', 2,
- 'Lines should be <= %i characters long' % _line_length)
-
- if (cleansed_line.count(';') > 1 and
- # for loops are allowed two ;'s (and may run over two lines).
- cleansed_line.find('for') == -1 and
- (GetPreviousNonBlankLine(clean_lines, linenum)[0].find('for') == -1 or
- GetPreviousNonBlankLine(clean_lines, linenum)[0].find(';') != -1) and
- # It's ok to have many commands in a switch case that fits in 1 line
- not ((cleansed_line.find('case ') != -1 or
- cleansed_line.find('default:') != -1) and
- cleansed_line.find('break;') != -1)):
- error(filename, linenum, 'whitespace/newline', 0,
- 'More than one command on the same line')
-
- # Some more style checks
- CheckBraces(filename, clean_lines, linenum, error)
- CheckTrailingSemicolon(filename, clean_lines, linenum, error)
- CheckEmptyBlockBody(filename, clean_lines, linenum, error)
- CheckAccess(filename, clean_lines, linenum, nesting_state, error)
- CheckSpacing(filename, clean_lines, linenum, nesting_state, error)
- CheckOperatorSpacing(filename, clean_lines, linenum, error)
- CheckParenthesisSpacing(filename, clean_lines, linenum, error)
- CheckCommaSpacing(filename, clean_lines, linenum, error)
- CheckBracesSpacing(filename, clean_lines, linenum, error)
- CheckSpacingForFunctionCall(filename, clean_lines, linenum, error)
- CheckRValueReference(filename, clean_lines, linenum, nesting_state, error)
- CheckCheck(filename, clean_lines, linenum, error)
- CheckAltTokens(filename, clean_lines, linenum, error)
- classinfo = nesting_state.InnermostClass()
- if classinfo:
- CheckSectionSpacing(filename, clean_lines, classinfo, linenum, error)
-
-
-_RE_PATTERN_INCLUDE = re.compile(r'^\s*#\s*include\s*([<"])([^>"]*)[>"].*$')
-# Matches the first component of a filename delimited by -s and _s. That is:
-# _RE_FIRST_COMPONENT.match('foo').group(0) == 'foo'
-# _RE_FIRST_COMPONENT.match('foo.cc').group(0) == 'foo'
-# _RE_FIRST_COMPONENT.match('foo-bar_baz.cc').group(0) == 'foo'
-# _RE_FIRST_COMPONENT.match('foo_bar-baz.cc').group(0) == 'foo'
-_RE_FIRST_COMPONENT = re.compile(r'^[^-_.]+')
-
-
-def _DropCommonSuffixes(filename):
- """Drops common suffixes like _test.cc or -inl.h from filename.
-
- For example:
- >>> _DropCommonSuffixes('foo/foo-inl.h')
- 'foo/foo'
- >>> _DropCommonSuffixes('foo/bar/foo.cc')
- 'foo/bar/foo'
- >>> _DropCommonSuffixes('foo/foo_internal.h')
- 'foo/foo'
- >>> _DropCommonSuffixes('foo/foo_unusualinternal.h')
- 'foo/foo_unusualinternal'
-
- Args:
- filename: The input filename.
-
- Returns:
- The filename with the common suffix removed.
- """
- for suffix in ('test.cc', 'regtest.cc', 'unittest.cc',
- 'inl.h', 'impl.h', 'internal.h'):
- if (filename.endswith(suffix) and len(filename) > len(suffix) and
- filename[-len(suffix) - 1] in ('-', '_')):
- return filename[:-len(suffix) - 1]
- return os.path.splitext(filename)[0]
-
-
-def _IsTestFilename(filename):
- """Determines if the given filename has a suffix that identifies it as a test.
-
- Args:
- filename: The input filename.
-
- Returns:
- True if 'filename' looks like a test, False otherwise.
- """
- if (filename.endswith('_test.cc') or
- filename.endswith('_unittest.cc') or
- filename.endswith('_regtest.cc')):
- return True
- else:
- return False
-
-
-def _ClassifyInclude(fileinfo, include, is_system):
- """Figures out what kind of header 'include' is.
-
- Args:
- fileinfo: The current file cpplint is running over. A FileInfo instance.
- include: The path to a #included file.
- is_system: True if the #include used <> rather than "".
-
- Returns:
- One of the _XXX_HEADER constants.
-
- For example:
- >>> _ClassifyInclude(FileInfo('foo/foo.cc'), 'stdio.h', True)
- _C_SYS_HEADER
- >>> _ClassifyInclude(FileInfo('foo/foo.cc'), 'string', True)
- _CPP_SYS_HEADER
- >>> _ClassifyInclude(FileInfo('foo/foo.cc'), 'foo/foo.h', False)
- _LIKELY_MY_HEADER
- >>> _ClassifyInclude(FileInfo('foo/foo_unknown_extension.cc'),
- ... 'bar/foo_other_ext.h', False)
- _POSSIBLE_MY_HEADER
- >>> _ClassifyInclude(FileInfo('foo/foo.cc'), 'foo/bar.h', False)
- _OTHER_HEADER
- """
- # This is a list of all standard c++ header files, except
- # those already checked for above.
- is_cpp_h = include in _CPP_HEADERS
-
- if is_system:
- if is_cpp_h:
- return _CPP_SYS_HEADER
- else:
- return _C_SYS_HEADER
-
- # If the target file and the include we're checking share a
- # basename when we drop common extensions, and the include
- # lives in . , then it's likely to be owned by the target file.
- target_dir, target_base = (
- os.path.split(_DropCommonSuffixes(fileinfo.RepositoryName())))
- include_dir, include_base = os.path.split(_DropCommonSuffixes(include))
- if target_base == include_base and (
- include_dir == target_dir or
- include_dir == os.path.normpath(target_dir + '/../public')):
- return _LIKELY_MY_HEADER
-
- # If the target and include share some initial basename
- # component, it's possible the target is implementing the
- # include, so it's allowed to be first, but we'll never
- # complain if it's not there.
- target_first_component = _RE_FIRST_COMPONENT.match(target_base)
- include_first_component = _RE_FIRST_COMPONENT.match(include_base)
- if (target_first_component and include_first_component and
- target_first_component.group(0) ==
- include_first_component.group(0)):
- return _POSSIBLE_MY_HEADER
-
- return _OTHER_HEADER
-
-
-
-def CheckIncludeLine(filename, clean_lines, linenum, include_state, error):
- """Check rules that are applicable to #include lines.
-
- Strings on #include lines are NOT removed from elided line, to make
- certain tasks easier. However, to prevent false positives, checks
- applicable to #include lines in CheckLanguage must be put here.
-
- Args:
- filename: The name of the current file.
- clean_lines: A CleansedLines instance containing the file.
- linenum: The number of the line to check.
- include_state: An _IncludeState instance in which the headers are inserted.
- error: The function to call with any errors found.
- """
- fileinfo = FileInfo(filename)
- line = clean_lines.lines[linenum]
-
- # "include" should use the new style "foo/bar.h" instead of just "bar.h"
- # Only do this check if the included header follows google naming
- # conventions. If not, assume that it's a 3rd party API that
- # requires special include conventions.
- #
- # We also make an exception for Lua headers, which follow google
- # naming convention but not the include convention.
- match = Match(r'#include\s*"([^/]+\.h)"', line)
- if match and not _THIRD_PARTY_HEADERS_PATTERN.match(match.group(1)):
- error(filename, linenum, 'build/include', 4,
- 'Include the directory when naming .h files')
-
- # we shouldn't include a file more than once. actually, there are a
- # handful of instances where doing so is okay, but in general it's
- # not.
- match = _RE_PATTERN_INCLUDE.search(line)
- if match:
- include = match.group(2)
- is_system = (match.group(1) == '<')
- duplicate_line = include_state.FindHeader(include)
- if duplicate_line >= 0:
- error(filename, linenum, 'build/include', 4,
- '"%s" already included at %s:%s' %
- (include, filename, duplicate_line))
- elif (include.endswith('.cc') and
- os.path.dirname(fileinfo.RepositoryName()) != os.path.dirname(include)):
- error(filename, linenum, 'build/include', 4,
- 'Do not include .cc files from other packages')
- elif not _THIRD_PARTY_HEADERS_PATTERN.match(include):
- include_state.include_list[-1].append((include, linenum))
-
- # We want to ensure that headers appear in the right order:
- # 1) for foo.cc, foo.h (preferred location)
- # 2) c system files
- # 3) cpp system files
- # 4) for foo.cc, foo.h (deprecated location)
- # 5) other google headers
- #
- # We classify each include statement as one of those 5 types
- # using a number of techniques. The include_state object keeps
- # track of the highest type seen, and complains if we see a
- # lower type after that.
- error_message = include_state.CheckNextIncludeOrder(
- _ClassifyInclude(fileinfo, include, is_system))
- if error_message:
- error(filename, linenum, 'build/include_order', 4,
- '%s. Should be: %s.h, c system, c++ system, other.' %
- (error_message, fileinfo.BaseName()))
- canonical_include = include_state.CanonicalizeAlphabeticalOrder(include)
- if not include_state.IsInAlphabeticalOrder(
- clean_lines, linenum, canonical_include):
- error(filename, linenum, 'build/include_alpha', 4,
- 'Include "%s" not in alphabetical order' % include)
- include_state.SetLastHeader(canonical_include)
-
-
-
-def _GetTextInside(text, start_pattern):
- r"""Retrieves all the text between matching open and close parentheses.
-
- Given a string of lines and a regular expression string, retrieve all the text
- following the expression and between opening punctuation symbols like
- (, [, or {, and the matching close-punctuation symbol. This properly nested
- occurrences of the punctuations, so for the text like
- printf(a(), b(c()));
- a call to _GetTextInside(text, r'printf\(') will return 'a(), b(c())'.
- start_pattern must match string having an open punctuation symbol at the end.
-
- Args:
- text: The lines to extract text. Its comments and strings must be elided.
- It can be single line and can span multiple lines.
- start_pattern: The regexp string indicating where to start extracting
- the text.
- Returns:
- The extracted text.
- None if either the opening string or ending punctuation could not be found.
- """
- # TODO(unknown): Audit cpplint.py to see what places could be profitably
- # rewritten to use _GetTextInside (and use inferior regexp matching today).
-
- # Give opening punctuations to get the matching close-punctuations.
- matching_punctuation = {'(': ')', '{': '}', '[': ']'}
- closing_punctuation = set(matching_punctuation.itervalues())
-
- # Find the position to start extracting text.
- match = re.search(start_pattern, text, re.M)
- if not match: # start_pattern not found in text.
- return None
- start_position = match.end(0)
-
- assert start_position > 0, (
- 'start_pattern must ends with an opening punctuation.')
- assert text[start_position - 1] in matching_punctuation, (
- 'start_pattern must ends with an opening punctuation.')
- # Stack of closing punctuations we expect to have in text after position.
- punctuation_stack = [matching_punctuation[text[start_position - 1]]]
- position = start_position
- while punctuation_stack and position < len(text):
- if text[position] == punctuation_stack[-1]:
- punctuation_stack.pop()
- elif text[position] in closing_punctuation:
- # A closing punctuation without matching opening punctuations.
- return None
- elif text[position] in matching_punctuation:
- punctuation_stack.append(matching_punctuation[text[position]])
- position += 1
- if punctuation_stack:
- # Opening punctuations left without matching close-punctuations.
- return None
- # punctuations match.
- return text[start_position:position - 1]
-
-
-# Patterns for matching call-by-reference parameters.
-#
-# Supports nested templates up to 2 levels deep using this messy pattern:
-# < (?: < (?: < [^<>]*
-# >
-# | [^<>] )*
-# >
-# | [^<>] )*
-# >
-_RE_PATTERN_IDENT = r'[_a-zA-Z]\w*' # =~ [[:alpha:]][[:alnum:]]*
-_RE_PATTERN_TYPE = (
- r'(?:const\s+)?(?:typename\s+|class\s+|struct\s+|union\s+|enum\s+)?'
- r'(?:\w|'
- r'\s*<(?:<(?:<[^<>]*>|[^<>])*>|[^<>])*>|'
- r'::)+')
-# A call-by-reference parameter ends with '& identifier'.
-_RE_PATTERN_REF_PARAM = re.compile(
- r'(' + _RE_PATTERN_TYPE + r'(?:\s*(?:\bconst\b|[*]))*\s*'
- r'&\s*' + _RE_PATTERN_IDENT + r')\s*(?:=[^,()]+)?[,)]')
-# A call-by-const-reference parameter either ends with 'const& identifier'
-# or looks like 'const type& identifier' when 'type' is atomic.
-_RE_PATTERN_CONST_REF_PARAM = (
- r'(?:.*\s*\bconst\s*&\s*' + _RE_PATTERN_IDENT +
- r'|const\s+' + _RE_PATTERN_TYPE + r'\s*&\s*' + _RE_PATTERN_IDENT + r')')
-
-
-def CheckLanguage(filename, clean_lines, linenum, file_extension,
- include_state, nesting_state, error):
- """Checks rules from the 'C++ language rules' section of cppguide.html.
-
- Some of these rules are hard to test (function overloading, using
- uint32 inappropriately), but we do the best we can.
-
- Args:
- filename: The name of the current file.
- clean_lines: A CleansedLines instance containing the file.
- linenum: The number of the line to check.
- file_extension: The extension (without the dot) of the filename.
- include_state: An _IncludeState instance in which the headers are inserted.
- nesting_state: A NestingState instance which maintains information about
- the current stack of nested blocks being parsed.
- error: The function to call with any errors found.
- """
- # If the line is empty or consists of entirely a comment, no need to
- # check it.
- line = clean_lines.elided[linenum]
- if not line:
- return
-
- match = _RE_PATTERN_INCLUDE.search(line)
- if match:
- CheckIncludeLine(filename, clean_lines, linenum, include_state, error)
- return
-
- # Reset include state across preprocessor directives. This is meant
- # to silence warnings for conditional includes.
- match = Match(r'^\s*#\s*(if|ifdef|ifndef|elif|else|endif)\b', line)
- if match:
- include_state.ResetSection(match.group(1))
-
- # Make Windows paths like Unix.
- fullname = os.path.abspath(filename).replace('\\', '/')
-
- # Perform other checks now that we are sure that this is not an include line
- CheckCasts(filename, clean_lines, linenum, error)
- CheckGlobalStatic(filename, clean_lines, linenum, error)
- CheckPrintf(filename, clean_lines, linenum, error)
-
- if file_extension == 'h':
- # TODO(unknown): check that 1-arg constructors are explicit.
- # How to tell it's a constructor?
- # (handled in CheckForNonStandardConstructs for now)
- # TODO(unknown): check that classes declare or disable copy/assign
- # (level 1 error)
- pass
-
- # Check if people are using the verboten C basic types. The only exception
- # we regularly allow is "unsigned short port" for port.
- if Search(r'\bshort port\b', line):
- if not Search(r'\bunsigned short port\b', line):
- error(filename, linenum, 'runtime/int', 4,
- 'Use "unsigned short" for ports, not "short"')
- else:
- match = Search(r'\b(short|long(?! +double)|long long)\b', line)
- if match:
- error(filename, linenum, 'runtime/int', 4,
- 'Use int16/int64/etc, rather than the C type %s' % match.group(1))
-
- # Check if some verboten operator overloading is going on
- # TODO(unknown): catch out-of-line unary operator&:
- # class X {};
- # int operator&(const X& x) { return 42; } // unary operator&
- # The trick is it's hard to tell apart from binary operator&:
- # class Y { int operator&(const Y& x) { return 23; } }; // binary operator&
- if Search(r'\boperator\s*&\s*\(\s*\)', line):
- error(filename, linenum, 'runtime/operator', 4,
- 'Unary operator& is dangerous. Do not use it.')
-
- # Check for suspicious usage of "if" like
- # } if (a == b) {
- if Search(r'\}\s*if\s*\(', line):
- error(filename, linenum, 'readability/braces', 4,
- 'Did you mean "else if"? If not, start a new line for "if".')
-
- # Check for potential format string bugs like printf(foo).
- # We constrain the pattern not to pick things like DocidForPrintf(foo).
- # Not perfect but it can catch printf(foo.c_str()) and printf(foo->c_str())
- # TODO(unknown): Catch the following case. Need to change the calling
- # convention of the whole function to process multiple line to handle it.
- # printf(
- # boy_this_is_a_really_long_variable_that_cannot_fit_on_the_prev_line);
- printf_args = _GetTextInside(line, r'(?i)\b(string)?printf\s*\(')
- if printf_args:
- match = Match(r'([\w.\->()]+)$', printf_args)
- if match and match.group(1) != '__VA_ARGS__':
- function_name = re.search(r'\b((?:string)?printf)\s*\(',
- line, re.I).group(1)
- error(filename, linenum, 'runtime/printf', 4,
- 'Potential format string bug. Do %s("%%s", %s) instead.'
- % (function_name, match.group(1)))
-
- # Check for potential memset bugs like memset(buf, sizeof(buf), 0).
- match = Search(r'memset\s*\(([^,]*),\s*([^,]*),\s*0\s*\)', line)
- if match and not Match(r"^''|-?[0-9]+|0x[0-9A-Fa-f]$", match.group(2)):
- error(filename, linenum, 'runtime/memset', 4,
- 'Did you mean "memset(%s, 0, %s)"?'
- % (match.group(1), match.group(2)))
-
- if Search(r'\busing namespace\b', line):
- error(filename, linenum, 'build/namespaces', 5,
- 'Do not use namespace using-directives. '
- 'Use using-declarations instead.')
-
- # Detect variable-length arrays.
- match = Match(r'\s*(.+::)?(\w+) [a-z]\w*\[(.+)];', line)
- if (match and match.group(2) != 'return' and match.group(2) != 'delete' and
- match.group(3).find(']') == -1):
- # Split the size using space and arithmetic operators as delimiters.
- # If any of the resulting tokens are not compile time constants then
- # report the error.
- tokens = re.split(r'\s|\+|\-|\*|\/|<<|>>]', match.group(3))
- is_const = True
- skip_next = False
- for tok in tokens:
- if skip_next:
- skip_next = False
- continue
-
- if Search(r'sizeof\(.+\)', tok): continue
- if Search(r'arraysize\(\w+\)', tok): continue
-
- tok = tok.lstrip('(')
- tok = tok.rstrip(')')
- if not tok: continue
- if Match(r'\d+', tok): continue
- if Match(r'0[xX][0-9a-fA-F]+', tok): continue
- if Match(r'k[A-Z0-9]\w*', tok): continue
- if Match(r'(.+::)?k[A-Z0-9]\w*', tok): continue
- if Match(r'(.+::)?[A-Z][A-Z0-9_]*', tok): continue
- # A catch all for tricky sizeof cases, including 'sizeof expression',
- # 'sizeof(*type)', 'sizeof(const type)', 'sizeof(struct StructName)'
- # requires skipping the next token because we split on ' ' and '*'.
- if tok.startswith('sizeof'):
- skip_next = True
- continue
- is_const = False
- break
- if not is_const:
- error(filename, linenum, 'runtime/arrays', 1,
- 'Do not use variable-length arrays. Use an appropriately named '
- "('k' followed by CamelCase) compile-time constant for the size.")
-
- # Check for use of unnamed namespaces in header files. Registration
- # macros are typically OK, so we allow use of "namespace {" on lines
- # that end with backslashes.
- if (file_extension == 'h'
- and Search(r'\bnamespace\s*{', line)
- and line[-1] != '\\'):
- error(filename, linenum, 'build/namespaces', 4,
- 'Do not use unnamed namespaces in header files. See '
- 'http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml#Namespaces'
- ' for more information.')
-
-
-def CheckGlobalStatic(filename, clean_lines, linenum, error):
- """Check for unsafe global or static objects.
-
- Args:
- filename: The name of the current file.
- clean_lines: A CleansedLines instance containing the file.
- linenum: The number of the line to check.
- error: The function to call with any errors found.
- """
- line = clean_lines.elided[linenum]
-
- # Match two lines at a time to support multiline declarations
- if linenum + 1 < clean_lines.NumLines() and not Search(r'[;({]', line):
- line += clean_lines.elided[linenum + 1].strip()
-
- # Check for people declaring static/global STL strings at the top level.
- # This is dangerous because the C++ language does not guarantee that
- # globals with constructors are initialized before the first access.
- match = Match(
- r'((?:|static +)(?:|const +))string +([a-zA-Z0-9_:]+)\b(.*)',
- line)
-
- # Remove false positives:
- # - String pointers (as opposed to values).
- # string *pointer
- # const string *pointer
- # string const *pointer
- # string *const pointer
- #
- # - Functions and template specializations.
- # string Function<Type>(...
- # string Class<Type>::Method(...
- #
- # - Operators. These are matched separately because operator names
- # cross non-word boundaries, and trying to match both operators
- # and functions at the same time would decrease accuracy of
- # matching identifiers.
- # string Class::operator*()
- if (match and
- not Search(r'\bstring\b(\s+const)?\s*\*\s*(const\s+)?\w', line) and
- not Search(r'\boperator\W', line) and
- not Match(r'\s*(<.*>)?(::[a-zA-Z0-9_]+)*\s*\(([^"]|$)', match.group(3))):
- error(filename, linenum, 'runtime/string', 4,
- 'For a static/global string constant, use a C style string instead: '
- '"%schar %s[]".' %
- (match.group(1), match.group(2)))
-
- if Search(r'\b([A-Za-z0-9_]*_)\(\1\)', line):
- error(filename, linenum, 'runtime/init', 4,
- 'You seem to be initializing a member variable with itself.')
-
-
-def CheckPrintf(filename, clean_lines, linenum, error):
- """Check for printf related issues.
-
- Args:
- filename: The name of the current file.
- clean_lines: A CleansedLines instance containing the file.
- linenum: The number of the line to check.
- error: The function to call with any errors found.
- """
- line = clean_lines.elided[linenum]
-
- # When snprintf is used, the second argument shouldn't be a literal.
- match = Search(r'snprintf\s*\(([^,]*),\s*([0-9]*)\s*,', line)
- if match and match.group(2) != '0':
- # If 2nd arg is zero, snprintf is used to calculate size.
- error(filename, linenum, 'runtime/printf', 3,
- 'If you can, use sizeof(%s) instead of %s as the 2nd arg '
- 'to snprintf.' % (match.group(1), match.group(2)))
-
- # Check if some verboten C functions are being used.
- if Search(r'\bsprintf\s*\(', line):
- error(filename, linenum, 'runtime/printf', 5,
- 'Never use sprintf. Use snprintf instead.')
- match = Search(r'\b(strcpy|strcat)\s*\(', line)
- if match:
- error(filename, linenum, 'runtime/printf', 4,
- 'Almost always, snprintf is better than %s' % match.group(1))
-
-
-def IsDerivedFunction(clean_lines, linenum):
- """Check if current line contains an inherited function.
-
- Args:
- clean_lines: A CleansedLines instance containing the file.
- linenum: The number of the line to check.
- Returns:
- True if current line contains a function with "override"
- virt-specifier.
- """
- # Scan back a few lines for start of current function
- for i in xrange(linenum, max(-1, linenum - 10), -1):
- match = Match(r'^([^()]*\w+)\(', clean_lines.elided[i])
- if match:
- # Look for "override" after the matching closing parenthesis
- line, _, closing_paren = CloseExpression(
- clean_lines, i, len(match.group(1)))
- return (closing_paren >= 0 and
- Search(r'\boverride\b', line[closing_paren:]))
- return False
-
-
-def IsOutOfLineMethodDefinition(clean_lines, linenum):
- """Check if current line contains an out-of-line method definition.
-
- Args:
- clean_lines: A CleansedLines instance containing the file.
- linenum: The number of the line to check.
- Returns:
- True if current line contains an out-of-line method definition.
- """
- # Scan back a few lines for start of current function
- for i in xrange(linenum, max(-1, linenum - 10), -1):
- if Match(r'^([^()]*\w+)\(', clean_lines.elided[i]):
- return Match(r'^[^()]*\w+::\w+\(', clean_lines.elided[i]) is not None
- return False
-
-
-def IsInitializerList(clean_lines, linenum):
- """Check if current line is inside constructor initializer list.
-
- Args:
- clean_lines: A CleansedLines instance containing the file.
- linenum: The number of the line to check.
- Returns:
- True if current line appears to be inside constructor initializer
- list, False otherwise.
- """
- for i in xrange(linenum, 1, -1):
- line = clean_lines.elided[i]
- if i == linenum:
- remove_function_body = Match(r'^(.*)\{\s*$', line)
- if remove_function_body:
- line = remove_function_body.group(1)
-
- if Search(r'\s:\s*\w+[({]', line):
- # A lone colon tend to indicate the start of a constructor
- # initializer list. It could also be a ternary operator, which
- # also tend to appear in constructor initializer lists as
- # opposed to parameter lists.
- return True
- if Search(r'\}\s*,\s*$', line):
- # A closing brace followed by a comma is probably the end of a
- # brace-initialized member in constructor initializer list.
- return True
- if Search(r'[{};]\s*$', line):
- # Found one of the following:
- # - A closing brace or semicolon, probably the end of the previous
- # function.
- # - An opening brace, probably the start of current class or namespace.
- #
- # Current line is probably not inside an initializer list since
- # we saw one of those things without seeing the starting colon.
- return False
-
- # Got to the beginning of the file without seeing the start of
- # constructor initializer list.
- return False
-
-
-def CheckForNonConstReference(filename, clean_lines, linenum,
- nesting_state, error):
- """Check for non-const references.
-
- Separate from CheckLanguage since it scans backwards from current
- line, instead of scanning forward.
-
- Args:
- filename: The name of the current file.
- clean_lines: A CleansedLines instance containing the file.
- linenum: The number of the line to check.
- nesting_state: A NestingState instance which maintains information about
- the current stack of nested blocks being parsed.
- error: The function to call with any errors found.
- """
- # Do nothing if there is no '&' on current line.
- line = clean_lines.elided[linenum]
- if '&' not in line:
- return
-
- # If a function is inherited, current function doesn't have much of
- # a choice, so any non-const references should not be blamed on
- # derived function.
- if IsDerivedFunction(clean_lines, linenum):
- return
-
- # Don't warn on out-of-line method definitions, as we would warn on the
- # in-line declaration, if it isn't marked with 'override'.
- if IsOutOfLineMethodDefinition(clean_lines, linenum):
- return
-
- # Long type names may be broken across multiple lines, usually in one
- # of these forms:
- # LongType
- # ::LongTypeContinued &identifier
- # LongType::
- # LongTypeContinued &identifier
- # LongType<
- # ...>::LongTypeContinued &identifier
- #
- # If we detected a type split across two lines, join the previous
- # line to current line so that we can match const references
- # accordingly.
- #
- # Note that this only scans back one line, since scanning back
- # arbitrary number of lines would be expensive. If you have a type
- # that spans more than 2 lines, please use a typedef.
- if linenum > 1:
- previous = None
- if Match(r'\s*::(?:[\w<>]|::)+\s*&\s*\S', line):
- # previous_line\n + ::current_line
- previous = Search(r'\b((?:const\s*)?(?:[\w<>]|::)+[\w<>])\s*$',
- clean_lines.elided[linenum - 1])
- elif Match(r'\s*[a-zA-Z_]([\w<>]|::)+\s*&\s*\S', line):
- # previous_line::\n + current_line
- previous = Search(r'\b((?:const\s*)?(?:[\w<>]|::)+::)\s*$',
- clean_lines.elided[linenum - 1])
- if previous:
- line = previous.group(1) + line.lstrip()
- else:
- # Check for templated parameter that is split across multiple lines
- endpos = line.rfind('>')
- if endpos > -1:
- (_, startline, startpos) = ReverseCloseExpression(
- clean_lines, linenum, endpos)
- if startpos > -1 and startline < linenum:
- # Found the matching < on an earlier line, collect all
- # pieces up to current line.
- line = ''
- for i in xrange(startline, linenum + 1):
- line += clean_lines.elided[i].strip()
-
- # Check for non-const references in function parameters. A single '&' may
- # found in the following places:
- # inside expression: binary & for bitwise AND
- # inside expression: unary & for taking the address of something
- # inside declarators: reference parameter
- # We will exclude the first two cases by checking that we are not inside a
- # function body, including one that was just introduced by a trailing '{'.
- # TODO(unknown): Doesn't account for 'catch(Exception& e)' [rare].
- if (nesting_state.previous_stack_top and
- not (isinstance(nesting_state.previous_stack_top, _ClassInfo) or
- isinstance(nesting_state.previous_stack_top, _NamespaceInfo))):
- # Not at toplevel, not within a class, and not within a namespace
- return
-
- # Avoid initializer lists. We only need to scan back from the
- # current line for something that starts with ':'.
- #
- # We don't need to check the current line, since the '&' would
- # appear inside the second set of parentheses on the current line as
- # opposed to the first set.
- if linenum > 0:
- for i in xrange(linenum - 1, max(0, linenum - 10), -1):
- previous_line = clean_lines.elided[i]
- if not Search(r'[),]\s*$', previous_line):
- break
- if Match(r'^\s*:\s+\S', previous_line):
- return
-
- # Avoid preprocessors
- if Search(r'\\\s*$', line):
- return
-
- # Avoid constructor initializer lists
- if IsInitializerList(clean_lines, linenum):
- return
-
- # We allow non-const references in a few standard places, like functions
- # called "swap()" or iostream operators like "<<" or ">>". Do not check
- # those function parameters.
- #
- # We also accept & in static_assert, which looks like a function but
- # it's actually a declaration expression.
- whitelisted_functions = (r'(?:[sS]wap(?:<\w:+>)?|'
- r'operator\s*[<>][<>]|'
- r'static_assert|COMPILE_ASSERT'
- r')\s*\(')
- if Search(whitelisted_functions, line):
- return
- elif not Search(r'\S+\([^)]*$', line):
- # Don't see a whitelisted function on this line. Actually we
- # didn't see any function name on this line, so this is likely a
- # multi-line parameter list. Try a bit harder to catch this case.
- for i in xrange(2):
- if (linenum > i and
- Search(whitelisted_functions, clean_lines.elided[linenum - i - 1])):
- return
-
- decls = ReplaceAll(r'{[^}]*}', ' ', line) # exclude function body
- for parameter in re.findall(_RE_PATTERN_REF_PARAM, decls):
- if not Match(_RE_PATTERN_CONST_REF_PARAM, parameter):
- error(filename, linenum, 'runtime/references', 2,
- 'Is this a non-const reference? '
- 'If so, make const or use a pointer: ' +
- ReplaceAll(' *<', '<', parameter))
-
-
-def CheckCasts(filename, clean_lines, linenum, error):
- """Various cast related checks.
-
- Args:
- filename: The name of the current file.
- clean_lines: A CleansedLines instance containing the file.
- linenum: The number of the line to check.
- error: The function to call with any errors found.
- """
- line = clean_lines.elided[linenum]
-
- # Check to see if they're using an conversion function cast.
- # I just try to capture the most common basic types, though there are more.
- # Parameterless conversion functions, such as bool(), are allowed as they are
- # probably a member operator declaration or default constructor.
- match = Search(
- r'(\bnew\s+|\S<\s*(?:const\s+)?)?\b'
- r'(int|float|double|bool|char|int32|uint32|int64|uint64)'
- r'(\([^)].*)', line)
- expecting_function = ExpectingFunctionArgs(clean_lines, linenum)
- if match and not expecting_function:
- matched_type = match.group(2)
-
- # matched_new_or_template is used to silence two false positives:
- # - New operators
- # - Template arguments with function types
- #
- # For template arguments, we match on types immediately following
- # an opening bracket without any spaces. This is a fast way to
- # silence the common case where the function type is the first
- # template argument. False negative with less-than comparison is
- # avoided because those operators are usually followed by a space.
- #
- # function<double(double)> // bracket + no space = false positive
- # value < double(42) // bracket + space = true positive
- matched_new_or_template = match.group(1)
-
- # Avoid arrays by looking for brackets that come after the closing
- # parenthesis.
- if Match(r'\([^()]+\)\s*\[', match.group(3)):
- return
-
- # Other things to ignore:
- # - Function pointers
- # - Casts to pointer types
- # - Placement new
- # - Alias declarations
- matched_funcptr = match.group(3)
- if (matched_new_or_template is None and
- not (matched_funcptr and
- (Match(r'\((?:[^() ]+::\s*\*\s*)?[^() ]+\)\s*\(',
- matched_funcptr) or
- matched_funcptr.startswith('(*)'))) and
- not Match(r'\s*using\s+\S+\s*=\s*' + matched_type, line) and
- not Search(r'new\(\S+\)\s*' + matched_type, line)):
- error(filename, linenum, 'readability/casting', 4,
- 'Using deprecated casting style. '
- 'Use static_cast<%s>(...) instead' %
- matched_type)
-
- if not expecting_function:
- CheckCStyleCast(filename, clean_lines, linenum, 'static_cast',
- r'\((int|float|double|bool|char|u?int(16|32|64))\)', error)
-
- # This doesn't catch all cases. Consider (const char * const)"hello".
- #
- # (char *) "foo" should always be a const_cast (reinterpret_cast won't
- # compile).
- if CheckCStyleCast(filename, clean_lines, linenum, 'const_cast',
- r'\((char\s?\*+\s?)\)\s*"', error):
- pass
- else:
- # Check pointer casts for other than string constants
- CheckCStyleCast(filename, clean_lines, linenum, 'reinterpret_cast',
- r'\((\w+\s?\*+\s?)\)', error)
-
- # In addition, we look for people taking the address of a cast. This
- # is dangerous -- casts can assign to temporaries, so the pointer doesn't
- # point where you think.
- #
- # Some non-identifier character is required before the '&' for the
- # expression to be recognized as a cast. These are casts:
- # expression = &static_cast<int*>(temporary());
- # function(&(int*)(temporary()));
- #
- # This is not a cast:
- # reference_type&(int* function_param);
- match = Search(
- r'(?:[^\w]&\(([^)*][^)]*)\)[\w(])|'
- r'(?:[^\w]&(static|dynamic|down|reinterpret)_cast\b)', line)
- if match:
- # Try a better error message when the & is bound to something
- # dereferenced by the casted pointer, as opposed to the casted
- # pointer itself.
- parenthesis_error = False
- match = Match(r'^(.*&(?:static|dynamic|down|reinterpret)_cast\b)<', line)
- if match:
- _, y1, x1 = CloseExpression(clean_lines, linenum, len(match.group(1)))
- if x1 >= 0 and clean_lines.elided[y1][x1] == '(':
- _, y2, x2 = CloseExpression(clean_lines, y1, x1)
- if x2 >= 0:
- extended_line = clean_lines.elided[y2][x2:]
- if y2 < clean_lines.NumLines() - 1:
- extended_line += clean_lines.elided[y2 + 1]
- if Match(r'\s*(?:->|\[)', extended_line):
- parenthesis_error = True
-
- if parenthesis_error:
- error(filename, linenum, 'readability/casting', 4,
- ('Are you taking an address of something dereferenced '
- 'from a cast? Wrapping the dereferenced expression in '
- 'parentheses will make the binding more obvious'))
- else:
- error(filename, linenum, 'runtime/casting', 4,
- ('Are you taking an address of a cast? '
- 'This is dangerous: could be a temp var. '
- 'Take the address before doing the cast, rather than after'))
-
-
-def CheckCStyleCast(filename, clean_lines, linenum, cast_type, pattern, error):
- """Checks for a C-style cast by looking for the pattern.
-
- Args:
- filename: The name of the current file.
- clean_lines: A CleansedLines instance containing the file.
- linenum: The number of the line to check.
- cast_type: The string for the C++ cast to recommend. This is either
- reinterpret_cast, static_cast, or const_cast, depending.
- pattern: The regular expression used to find C-style casts.
- error: The function to call with any errors found.
-
- Returns:
- True if an error was emitted.
- False otherwise.
- """
- line = clean_lines.elided[linenum]
- match = Search(pattern, line)
- if not match:
- return False
-
- # Exclude lines with keywords that tend to look like casts
- context = line[0:match.start(1) - 1]
- if Match(r'.*\b(?:sizeof|alignof|alignas|[_A-Z][_A-Z0-9]*)\s*$', context):
- return False
-
- # Try expanding current context to see if we one level of
- # parentheses inside a macro.
- if linenum > 0:
- for i in xrange(linenum - 1, max(0, linenum - 5), -1):
- context = clean_lines.elided[i] + context
- if Match(r'.*\b[_A-Z][_A-Z0-9]*\s*\((?:\([^()]*\)|[^()])*$', context):
- return False
-
- # operator++(int) and operator--(int)
- if context.endswith(' operator++') or context.endswith(' operator--'):
- return False
-
- # A single unnamed argument for a function tends to look like old
- # style cast. If we see those, don't issue warnings for deprecated
- # casts, instead issue warnings for unnamed arguments where
- # appropriate.
- #
- # These are things that we want warnings for, since the style guide
- # explicitly require all parameters to be named:
- # Function(int);
- # Function(int) {
- # ConstMember(int) const;
- # ConstMember(int) const {
- # ExceptionMember(int) throw (...);
- # ExceptionMember(int) throw (...) {
- # PureVirtual(int) = 0;
- # [](int) -> bool {
- #
- # These are functions of some sort, where the compiler would be fine
- # if they had named parameters, but people often omit those
- # identifiers to reduce clutter:
- # (FunctionPointer)(int);
- # (FunctionPointer)(int) = value;
- # Function((function_pointer_arg)(int))
- # Function((function_pointer_arg)(int), int param)
- # <TemplateArgument(int)>;
- # <(FunctionPointerTemplateArgument)(int)>;
- remainder = line[match.end(0):]
- if Match(r'^\s*(?:;|const\b|throw\b|final\b|override\b|[=>{),]|->)',
- remainder):
- # Looks like an unnamed parameter.
-
- # Don't warn on any kind of template arguments.
- if Match(r'^\s*>', remainder):
- return False
-
- # Don't warn on assignments to function pointers, but keep warnings for
- # unnamed parameters to pure virtual functions. Note that this pattern
- # will also pass on assignments of "0" to function pointers, but the
- # preferred values for those would be "nullptr" or "NULL".
- matched_zero = Match(r'^\s=\s*(\S+)\s*;', remainder)
- if matched_zero and matched_zero.group(1) != '0':
- return False
-
- # Don't warn on function pointer declarations. For this we need
- # to check what came before the "(type)" string.
- if Match(r'.*\)\s*$', line[0:match.start(0)]):
- return False
-
- # Don't warn if the parameter is named with block comments, e.g.:
- # Function(int /*unused_param*/);
- raw_line = clean_lines.raw_lines[linenum]
- if '/*' in raw_line:
- return False
-
- # Passed all filters, issue warning here.
- error(filename, linenum, 'readability/function', 3,
- 'All parameters should be named in a function')
- return True
-
- # At this point, all that should be left is actual casts.
- error(filename, linenum, 'readability/casting', 4,
- 'Using C-style cast. Use %s<%s>(...) instead' %
- (cast_type, match.group(1)))
-
- return True
-
-
-def ExpectingFunctionArgs(clean_lines, linenum):
- """Checks whether where function type arguments are expected.
-
- Args:
- clean_lines: A CleansedLines instance containing the file.
- linenum: The number of the line to check.
-
- Returns:
- True if the line at 'linenum' is inside something that expects arguments
- of function types.
- """
- line = clean_lines.elided[linenum]
- return (Match(r'^\s*MOCK_(CONST_)?METHOD\d+(_T)?\(', line) or
- (linenum >= 2 and
- (Match(r'^\s*MOCK_(?:CONST_)?METHOD\d+(?:_T)?\((?:\S+,)?\s*$',
- clean_lines.elided[linenum - 1]) or
- Match(r'^\s*MOCK_(?:CONST_)?METHOD\d+(?:_T)?\(\s*$',
- clean_lines.elided[linenum - 2]) or
- Search(r'\bstd::m?function\s*\<\s*$',
- clean_lines.elided[linenum - 1]))))
-
-
-_HEADERS_CONTAINING_TEMPLATES = (
- ('<deque>', ('deque',)),
- ('<functional>', ('unary_function', 'binary_function',
- 'plus', 'minus', 'multiplies', 'divides', 'modulus',
- 'negate',
- 'equal_to', 'not_equal_to', 'greater', 'less',
- 'greater_equal', 'less_equal',
- 'logical_and', 'logical_or', 'logical_not',
- 'unary_negate', 'not1', 'binary_negate', 'not2',
- 'bind1st', 'bind2nd',
- 'pointer_to_unary_function',
- 'pointer_to_binary_function',
- 'ptr_fun',
- 'mem_fun_t', 'mem_fun', 'mem_fun1_t', 'mem_fun1_ref_t',
- 'mem_fun_ref_t',
- 'const_mem_fun_t', 'const_mem_fun1_t',
- 'const_mem_fun_ref_t', 'const_mem_fun1_ref_t',
- 'mem_fun_ref',
- )),
- ('<limits>', ('numeric_limits',)),
- ('<list>', ('list',)),
- ('<map>', ('map', 'multimap',)),
- ('<memory>', ('allocator',)),
- ('<queue>', ('queue', 'priority_queue',)),
- ('<set>', ('set', 'multiset',)),
- ('<stack>', ('stack',)),
- ('<string>', ('char_traits', 'basic_string',)),
- ('<tuple>', ('tuple',)),
- ('<utility>', ('pair',)),
- ('<vector>', ('vector',)),
-
- # gcc extensions.
- # Note: std::hash is their hash, ::hash is our hash
- ('<hash_map>', ('hash_map', 'hash_multimap',)),
- ('<hash_set>', ('hash_set', 'hash_multiset',)),
- ('<slist>', ('slist',)),
- )
-
-_RE_PATTERN_STRING = re.compile(r'\bstring\b')
-
-_re_pattern_algorithm_header = []
-for _template in ('copy', 'max', 'min', 'min_element', 'sort', 'swap',
- 'transform'):
- # Match max<type>(..., ...), max(..., ...), but not foo->max, foo.max or
- # type::max().
- _re_pattern_algorithm_header.append(
- (re.compile(r'[^>.]\b' + _template + r'(<.*?>)?\([^\)]'),
- _template,
- '<algorithm>'))
-
-_re_pattern_templates = []
-for _header, _templates in _HEADERS_CONTAINING_TEMPLATES:
- for _template in _templates:
- _re_pattern_templates.append(
- (re.compile(r'(\<|\b)' + _template + r'\s*\<'),
- _template + '<>',
- _header))
-
-
-def FilesBelongToSameModule(filename_cc, filename_h):
- """Check if these two filenames belong to the same module.
-
- The concept of a 'module' here is a as follows:
- foo.h, foo-inl.h, foo.cc, foo_test.cc and foo_unittest.cc belong to the
- same 'module' if they are in the same directory.
- some/path/public/xyzzy and some/path/internal/xyzzy are also considered
- to belong to the same module here.
-
- If the filename_cc contains a longer path than the filename_h, for example,
- '/absolute/path/to/base/sysinfo.cc', and this file would include
- 'base/sysinfo.h', this function also produces the prefix needed to open the
- header. This is used by the caller of this function to more robustly open the
- header file. We don't have access to the real include paths in this context,
- so we need this guesswork here.
-
- Known bugs: tools/base/bar.cc and base/bar.h belong to the same module
- according to this implementation. Because of this, this function gives
- some false positives. This should be sufficiently rare in practice.
-
- Args:
- filename_cc: is the path for the .cc file
- filename_h: is the path for the header path
-
- Returns:
- Tuple with a bool and a string:
- bool: True if filename_cc and filename_h belong to the same module.
- string: the additional prefix needed to open the header file.
- """
-
- if not filename_cc.endswith('.cc'):
- return (False, '')
- filename_cc = filename_cc[:-len('.cc')]
- if filename_cc.endswith('_unittest'):
- filename_cc = filename_cc[:-len('_unittest')]
- elif filename_cc.endswith('_test'):
- filename_cc = filename_cc[:-len('_test')]
- filename_cc = filename_cc.replace('/public/', '/')
- filename_cc = filename_cc.replace('/internal/', '/')
-
- if not filename_h.endswith('.h'):
- return (False, '')
- filename_h = filename_h[:-len('.h')]
- if filename_h.endswith('-inl'):
- filename_h = filename_h[:-len('-inl')]
- filename_h = filename_h.replace('/public/', '/')
- filename_h = filename_h.replace('/internal/', '/')
-
- files_belong_to_same_module = filename_cc.endswith(filename_h)
- common_path = ''
- if files_belong_to_same_module:
- common_path = filename_cc[:-len(filename_h)]
- return files_belong_to_same_module, common_path
-
-
-def UpdateIncludeState(filename, include_dict, io=codecs):
- """Fill up the include_dict with new includes found from the file.
-
- Args:
- filename: the name of the header to read.
- include_dict: a dictionary in which the headers are inserted.
- io: The io factory to use to read the file. Provided for testability.
-
- Returns:
- True if a header was successfully added. False otherwise.
- """
- headerfile = None
- try:
- headerfile = io.open(filename, 'r', 'utf8', 'replace')
- except IOError:
- return False
- linenum = 0
- for line in headerfile:
- linenum += 1
- clean_line = CleanseComments(line)
- match = _RE_PATTERN_INCLUDE.search(clean_line)
- if match:
- include = match.group(2)
- include_dict.setdefault(include, linenum)
- return True
-
-
-def CheckForIncludeWhatYouUse(filename, clean_lines, include_state, error,
- io=codecs):
- """Reports for missing stl includes.
-
- This function will output warnings to make sure you are including the headers
- necessary for the stl containers and functions that you use. We only give one
- reason to include a header. For example, if you use both equal_to<> and
- less<> in a .h file, only one (the latter in the file) of these will be
- reported as a reason to include the <functional>.
-
- Args:
- filename: The name of the current file.
- clean_lines: A CleansedLines instance containing the file.
- include_state: An _IncludeState instance.
- error: The function to call with any errors found.
- io: The IO factory to use to read the header file. Provided for unittest
- injection.
- """
- required = {} # A map of header name to linenumber and the template entity.
- # Example of required: { '<functional>': (1219, 'less<>') }
-
- for linenum in xrange(clean_lines.NumLines()):
- line = clean_lines.elided[linenum]
- if not line or line[0] == '#':
- continue
-
- # String is special -- it is a non-templatized type in STL.
- matched = _RE_PATTERN_STRING.search(line)
- if matched:
- # Don't warn about strings in non-STL namespaces:
- # (We check only the first match per line; good enough.)
- prefix = line[:matched.start()]
- if prefix.endswith('std::') or not prefix.endswith('::'):
- required['<string>'] = (linenum, 'string')
-
- for pattern, template, header in _re_pattern_algorithm_header:
- if pattern.search(line):
- required[header] = (linenum, template)
-
- # The following function is just a speed up, no semantics are changed.
- if not '<' in line: # Reduces the cpu time usage by skipping lines.
- continue
-
- for pattern, template, header in _re_pattern_templates:
- if pattern.search(line):
- required[header] = (linenum, template)
-
- # The policy is that if you #include something in foo.h you don't need to
- # include it again in foo.cc. Here, we will look at possible includes.
- # Let's flatten the include_state include_list and copy it into a dictionary.
- include_dict = dict([item for sublist in include_state.include_list
- for item in sublist])
-
- # Did we find the header for this file (if any) and successfully load it?
- header_found = False
-
- # Use the absolute path so that matching works properly.
- abs_filename = FileInfo(filename).FullName()
-
- # For Emacs's flymake.
- # If cpplint is invoked from Emacs's flymake, a temporary file is generated
- # by flymake and that file name might end with '_flymake.cc'. In that case,
- # restore original file name here so that the corresponding header file can be
- # found.
- # e.g. If the file name is 'foo_flymake.cc', we should search for 'foo.h'
- # instead of 'foo_flymake.h'
- abs_filename = re.sub(r'_flymake\.cc$', '.cc', abs_filename)
-
- # include_dict is modified during iteration, so we iterate over a copy of
- # the keys.
- header_keys = include_dict.keys()
- for header in header_keys:
- (same_module, common_path) = FilesBelongToSameModule(abs_filename, header)
- fullpath = common_path + header
- if same_module and UpdateIncludeState(fullpath, include_dict, io):
- header_found = True
-
- # If we can't find the header file for a .cc, assume it's because we don't
- # know where to look. In that case we'll give up as we're not sure they
- # didn't include it in the .h file.
- # TODO(unknown): Do a better job of finding .h files so we are confident that
- # not having the .h file means there isn't one.
- if filename.endswith('.cc') and not header_found:
- return
-
- # All the lines have been processed, report the errors found.
- for required_header_unstripped in required:
- template = required[required_header_unstripped][1]
- if required_header_unstripped.strip('<>"') not in include_dict:
- error(filename, required[required_header_unstripped][0],
- 'build/include_what_you_use', 4,
- 'Add #include ' + required_header_unstripped + ' for ' + template)
-
-
-_RE_PATTERN_EXPLICIT_MAKEPAIR = re.compile(r'\bmake_pair\s*<')
-
-
-def CheckMakePairUsesDeduction(filename, clean_lines, linenum, error):
- """Check that make_pair's template arguments are deduced.
-
- G++ 4.6 in C++11 mode fails badly if make_pair's template arguments are
- specified explicitly, and such use isn't intended in any case.
-
- Args:
- filename: The name of the current file.
- clean_lines: A CleansedLines instance containing the file.
- linenum: The number of the line to check.
- error: The function to call with any errors found.
- """
- line = clean_lines.elided[linenum]
- match = _RE_PATTERN_EXPLICIT_MAKEPAIR.search(line)
- if match:
- error(filename, linenum, 'build/explicit_make_pair',
- 4, # 4 = high confidence
- 'For C++11-compatibility, omit template arguments from make_pair'
- ' OR use pair directly OR if appropriate, construct a pair directly')
-
-
-def CheckDefaultLambdaCaptures(filename, clean_lines, linenum, error):
- """Check that default lambda captures are not used.
-
- Args:
- filename: The name of the current file.
- clean_lines: A CleansedLines instance containing the file.
- linenum: The number of the line to check.
- error: The function to call with any errors found.
- """
- line = clean_lines.elided[linenum]
-
- # A lambda introducer specifies a default capture if it starts with "[="
- # or if it starts with "[&" _not_ followed by an identifier.
- match = Match(r'^(.*)\[\s*(?:=|&[^\w])', line)
- if match:
- # Found a potential error, check what comes after the lambda-introducer.
- # If it's not open parenthesis (for lambda-declarator) or open brace
- # (for compound-statement), it's not a lambda.
- line, _, pos = CloseExpression(clean_lines, linenum, len(match.group(1)))
- if pos >= 0 and Match(r'^\s*[{(]', line[pos:]):
- error(filename, linenum, 'build/c++11',
- 4, # 4 = high confidence
- 'Default lambda captures are an unapproved C++ feature.')
-
-
-def CheckRedundantVirtual(filename, clean_lines, linenum, error):
- """Check if line contains a redundant "virtual" function-specifier.
-
- Args:
- filename: The name of the current file.
- clean_lines: A CleansedLines instance containing the file.
- linenum: The number of the line to check.
- error: The function to call with any errors found.
- """
- # Look for "virtual" on current line.
- line = clean_lines.elided[linenum]
- virtual = Match(r'^(.*)(\bvirtual\b)(.*)$', line)
- if not virtual: return
-
- # Ignore "virtual" keywords that are near access-specifiers. These
- # are only used in class base-specifier and do not apply to member
- # functions.
- if (Search(r'\b(public|protected|private)\s+$', virtual.group(1)) or
- Match(r'^\s+(public|protected|private)\b', virtual.group(3))):
- return
-
- # Ignore the "virtual" keyword from virtual base classes. Usually
- # there is a column on the same line in these cases (virtual base
- # classes are rare in google3 because multiple inheritance is rare).
- if Match(r'^.*[^:]:[^:].*$', line): return
-
- # Look for the next opening parenthesis. This is the start of the
- # parameter list (possibly on the next line shortly after virtual).
- # TODO(unknown): doesn't work if there are virtual functions with
- # decltype() or other things that use parentheses, but csearch suggests
- # that this is rare.
- end_col = -1
- end_line = -1
- start_col = len(virtual.group(2))
- for start_line in xrange(linenum, min(linenum + 3, clean_lines.NumLines())):
- line = clean_lines.elided[start_line][start_col:]
- parameter_list = Match(r'^([^(]*)\(', line)
- if parameter_list:
- # Match parentheses to find the end of the parameter list
- (_, end_line, end_col) = CloseExpression(
- clean_lines, start_line, start_col + len(parameter_list.group(1)))
- break
- start_col = 0
-
- if end_col < 0:
- return # Couldn't find end of parameter list, give up
-
- # Look for "override" or "final" after the parameter list
- # (possibly on the next few lines).
- for i in xrange(end_line, min(end_line + 3, clean_lines.NumLines())):
- line = clean_lines.elided[i][end_col:]
- match = Search(r'\b(override|final)\b', line)
- if match:
- error(filename, linenum, 'readability/inheritance', 4,
- ('"virtual" is redundant since function is '
- 'already declared as "%s"' % match.group(1)))
-
- # Set end_col to check whole lines after we are done with the
- # first line.
- end_col = 0
- if Search(r'[^\w]\s*$', line):
- break
-
-
-def CheckRedundantOverrideOrFinal(filename, clean_lines, linenum, error):
- """Check if line contains a redundant "override" or "final" virt-specifier.
-
- Args:
- filename: The name of the current file.
- clean_lines: A CleansedLines instance containing the file.
- linenum: The number of the line to check.
- error: The function to call with any errors found.
- """
- # Look for closing parenthesis nearby. We need one to confirm where
- # the declarator ends and where the virt-specifier starts to avoid
- # false positives.
- line = clean_lines.elided[linenum]
- declarator_end = line.rfind(')')
- if declarator_end >= 0:
- fragment = line[declarator_end:]
- else:
- if linenum > 1 and clean_lines.elided[linenum - 1].rfind(')') >= 0:
- fragment = line
- else:
- return
-
- # Check that at most one of "override" or "final" is present, not both
- if Search(r'\boverride\b', fragment) and Search(r'\bfinal\b', fragment):
- error(filename, linenum, 'readability/inheritance', 4,
- ('"override" is redundant since function is '
- 'already declared as "final"'))
-
-
-
-
-# Returns true if we are at a new block, and it is directly
-# inside of a namespace.
-def IsBlockInNameSpace(nesting_state, is_forward_declaration):
- """Checks that the new block is directly in a namespace.
-
- Args:
- nesting_state: The _NestingState object that contains info about our state.
- is_forward_declaration: If the class is a forward declared class.
- Returns:
- Whether or not the new block is directly in a namespace.
- """
- if is_forward_declaration:
- if len(nesting_state.stack) >= 1 and (
- isinstance(nesting_state.stack[-1], _NamespaceInfo)):
- return True
- else:
- return False
-
- return (len(nesting_state.stack) > 1 and
- nesting_state.stack[-1].check_namespace_indentation and
- isinstance(nesting_state.stack[-2], _NamespaceInfo))
-
-
-def ShouldCheckNamespaceIndentation(nesting_state, is_namespace_indent_item,
- raw_lines_no_comments, linenum):
- """This method determines if we should apply our namespace indentation check.
-
- Args:
- nesting_state: The current nesting state.
- is_namespace_indent_item: If we just put a new class on the stack, True.
- If the top of the stack is not a class, or we did not recently
- add the class, False.
- raw_lines_no_comments: The lines without the comments.
- linenum: The current line number we are processing.
-
- Returns:
- True if we should apply our namespace indentation check. Currently, it
- only works for classes and namespaces inside of a namespace.
- """
-
- is_forward_declaration = IsForwardClassDeclaration(raw_lines_no_comments,
- linenum)
-
- if not (is_namespace_indent_item or is_forward_declaration):
- return False
-
- # If we are in a macro, we do not want to check the namespace indentation.
- if IsMacroDefinition(raw_lines_no_comments, linenum):
- return False
-
- return IsBlockInNameSpace(nesting_state, is_forward_declaration)
-
-
-# Call this method if the line is directly inside of a namespace.
-# If the line above is blank (excluding comments) or the start of
-# an inner namespace, it cannot be indented.
-def CheckItemIndentationInNamespace(filename, raw_lines_no_comments, linenum,
- error):
- line = raw_lines_no_comments[linenum]
- if Match(r'^\s+', line):
- error(filename, linenum, 'runtime/indentation_namespace', 4,
- 'Do not indent within a namespace')
-
-
-def ProcessLine(filename, file_extension, clean_lines, line,
- include_state, function_state, nesting_state, error,
- extra_check_functions=[]):
- """Processes a single line in the file.
-
- Args:
- filename: Filename of the file that is being processed.
- file_extension: The extension (dot not included) of the file.
- clean_lines: An array of strings, each representing a line of the file,
- with comments stripped.
- line: Number of line being processed.
- include_state: An _IncludeState instance in which the headers are inserted.
- function_state: A _FunctionState instance which counts function lines, etc.
- nesting_state: A NestingState instance which maintains information about
- the current stack of nested blocks being parsed.
- error: A callable to which errors are reported, which takes 4 arguments:
- filename, line number, error level, and message
- extra_check_functions: An array of additional check functions that will be
- run on each source line. Each function takes 4
- arguments: filename, clean_lines, line, error
- """
- raw_lines = clean_lines.raw_lines
- ParseNolintSuppressions(filename, raw_lines[line], line, error)
- nesting_state.Update(filename, clean_lines, line, error)
- CheckForNamespaceIndentation(filename, nesting_state, clean_lines, line,
- error)
- if nesting_state.InAsmBlock(): return
- CheckForFunctionLengths(filename, clean_lines, line, function_state, error)
- CheckForMultilineCommentsAndStrings(filename, clean_lines, line, error)
- CheckStyle(filename, clean_lines, line, file_extension, nesting_state, error)
- CheckLanguage(filename, clean_lines, line, file_extension, include_state,
- nesting_state, error)
- CheckForNonConstReference(filename, clean_lines, line, nesting_state, error)
- CheckForNonStandardConstructs(filename, clean_lines, line,
- nesting_state, error)
- CheckVlogArguments(filename, clean_lines, line, error)
- CheckPosixThreading(filename, clean_lines, line, error)
- CheckInvalidIncrement(filename, clean_lines, line, error)
- CheckMakePairUsesDeduction(filename, clean_lines, line, error)
- CheckDefaultLambdaCaptures(filename, clean_lines, line, error)
- CheckRedundantVirtual(filename, clean_lines, line, error)
- CheckRedundantOverrideOrFinal(filename, clean_lines, line, error)
- for check_fn in extra_check_functions:
- check_fn(filename, clean_lines, line, error)
-
-def FlagCxx11Features(filename, clean_lines, linenum, error):
- """Flag those c++11 features that we only allow in certain places.
-
- Args:
- filename: The name of the current file.
- clean_lines: A CleansedLines instance containing the file.
- linenum: The number of the line to check.
- error: The function to call with any errors found.
- """
- line = clean_lines.elided[linenum]
-
- # Flag unapproved C++11 headers.
- include = Match(r'\s*#\s*include\s+[<"]([^<"]+)[">]', line)
- if include and include.group(1) in ('cfenv',
- 'condition_variable',
- 'fenv.h',
- 'future',
- 'mutex',
- 'thread',
- 'chrono',
- 'ratio',
- 'regex',
- 'system_error',
- ):
- error(filename, linenum, 'build/c++11', 5,
- ('<%s> is an unapproved C++11 header.') % include.group(1))
-
- # The only place where we need to worry about C++11 keywords and library
- # features in preprocessor directives is in macro definitions.
- if Match(r'\s*#', line) and not Match(r'\s*#\s*define\b', line): return
-
- # These are classes and free functions. The classes are always
- # mentioned as std::*, but we only catch the free functions if
- # they're not found by ADL. They're alphabetical by header.
- for top_name in (
- # type_traits
- 'alignment_of',
- 'aligned_union',
- ):
- if Search(r'\bstd::%s\b' % top_name, line):
- error(filename, linenum, 'build/c++11', 5,
- ('std::%s is an unapproved C++11 class or function. Send c-style '
- 'an example of where it would make your code more readable, and '
- 'they may let you use it.') % top_name)
-
-
-def ProcessFileData(filename, file_extension, lines, error,
- extra_check_functions=[]):
- """Performs lint checks and reports any errors to the given error function.
-
- Args:
- filename: Filename of the file that is being processed.
- file_extension: The extension (dot not included) of the file.
- lines: An array of strings, each representing a line of the file, with the
- last element being empty if the file is terminated with a newline.
- error: A callable to which errors are reported, which takes 4 arguments:
- filename, line number, error level, and message
- extra_check_functions: An array of additional check functions that will be
- run on each source line. Each function takes 4
- arguments: filename, clean_lines, line, error
- """
- lines = (['// marker so line numbers and indices both start at 1'] + lines +
- ['// marker so line numbers end in a known way'])
-
- include_state = _IncludeState()
- function_state = _FunctionState()
- nesting_state = NestingState()
-
- ResetNolintSuppressions()
-
- CheckForCopyright(filename, lines, error)
-
- RemoveMultiLineComments(filename, lines, error)
- clean_lines = CleansedLines(lines)
-
- if file_extension == 'h':
- CheckForHeaderGuard(filename, clean_lines, error)
-
- for line in xrange(clean_lines.NumLines()):
- ProcessLine(filename, file_extension, clean_lines, line,
- include_state, function_state, nesting_state, error,
- extra_check_functions)
- FlagCxx11Features(filename, clean_lines, line, error)
- nesting_state.CheckCompletedBlocks(filename, error)
-
- CheckForIncludeWhatYouUse(filename, clean_lines, include_state, error)
-
- # Check that the .cc file has included its header if it exists.
- if file_extension == 'cc':
- CheckHeaderFileIncluded(filename, include_state, error)
-
- # We check here rather than inside ProcessLine so that we see raw
- # lines rather than "cleaned" lines.
- CheckForBadCharacters(filename, lines, error)
-
- CheckForNewlineAtEOF(filename, lines, error)
-
-def ProcessConfigOverrides(filename):
- """ Loads the configuration files and processes the config overrides.
-
- Args:
- filename: The name of the file being processed by the linter.
-
- Returns:
- False if the current |filename| should not be processed further.
- """
-
- abs_filename = os.path.abspath(filename)
- cfg_filters = []
- keep_looking = True
- while keep_looking:
- abs_path, base_name = os.path.split(abs_filename)
- if not base_name:
- break # Reached the root directory.
-
- cfg_file = os.path.join(abs_path, "CPPLINT.cfg")
- abs_filename = abs_path
- if not os.path.isfile(cfg_file):
- continue
-
- try:
- with open(cfg_file) as file_handle:
- for line in file_handle:
- line, _, _ = line.partition('#') # Remove comments.
- if not line.strip():
- continue
-
- name, _, val = line.partition('=')
- name = name.strip()
- val = val.strip()
- if name == 'set noparent':
- keep_looking = False
- elif name == 'filter':
- cfg_filters.append(val)
- elif name == 'exclude_files':
- # When matching exclude_files pattern, use the base_name of
- # the current file name or the directory name we are processing.
- # For example, if we are checking for lint errors in /foo/bar/baz.cc
- # and we found the .cfg file at /foo/CPPLINT.cfg, then the config
- # file's "exclude_files" filter is meant to be checked against "bar"
- # and not "baz" nor "bar/baz.cc".
- if base_name:
- pattern = re.compile(val)
- if pattern.match(base_name):
- sys.stderr.write('Ignoring "%s": file excluded by "%s". '
- 'File path component "%s" matches '
- 'pattern "%s"\n' %
- (filename, cfg_file, base_name, val))
- return False
- elif name == 'linelength':
- global _line_length
- try:
- _line_length = int(val)
- except ValueError:
- sys.stderr.write('Line length must be numeric.')
- else:
- sys.stderr.write(
- 'Invalid configuration option (%s) in file %s\n' %
- (name, cfg_file))
-
- except IOError:
- sys.stderr.write(
- "Skipping config file '%s': Can't open for reading\n" % cfg_file)
- keep_looking = False
-
- # Apply all the accumulated filters in reverse order (top-level directory
- # config options having the least priority).
- for filter in reversed(cfg_filters):
- _AddFilters(filter)
-
- return True
-
-
-def ProcessFile(filename, vlevel, extra_check_functions=[]):
- """Does google-lint on a single file.
-
- Args:
- filename: The name of the file to parse.
-
- vlevel: The level of errors to report. Every error of confidence
- >= verbose_level will be reported. 0 is a good default.
-
- extra_check_functions: An array of additional check functions that will be
- run on each source line. Each function takes 4
- arguments: filename, clean_lines, line, error
- """
-
- _SetVerboseLevel(vlevel)
- _BackupFilters()
-
- if not ProcessConfigOverrides(filename):
- _RestoreFilters()
- return
-
- lf_lines = []
- crlf_lines = []
- try:
- # Support the UNIX convention of using "-" for stdin. Note that
- # we are not opening the file with universal newline support
- # (which codecs doesn't support anyway), so the resulting lines do
- # contain trailing '\r' characters if we are reading a file that
- # has CRLF endings.
- # If after the split a trailing '\r' is present, it is removed
- # below.
- if filename == '-':
- lines = codecs.StreamReaderWriter(sys.stdin,
- codecs.getreader('utf8'),
- codecs.getwriter('utf8'),
- 'replace').read().split('\n')
- else:
- lines = codecs.open(filename, 'r', 'utf8', 'replace').read().split('\n')
-
- # Remove trailing '\r'.
- # The -1 accounts for the extra trailing blank line we get from split()
- for linenum in range(len(lines) - 1):
- if lines[linenum].endswith('\r'):
- lines[linenum] = lines[linenum].rstrip('\r')
- crlf_lines.append(linenum + 1)
- else:
- lf_lines.append(linenum + 1)
-
- except IOError:
- sys.stderr.write(
- "Skipping input '%s': Can't open for reading\n" % filename)
- _RestoreFilters()
- return
-
- # Note, if no dot is found, this will give the entire filename as the ext.
- file_extension = filename[filename.rfind('.') + 1:]
-
- # When reading from stdin, the extension is unknown, so no cpplint tests
- # should rely on the extension.
- if filename != '-' and file_extension not in _valid_extensions:
- sys.stderr.write('Ignoring %s; not a valid file name '
- '(%s)\n' % (filename, ', '.join(_valid_extensions)))
- else:
- ProcessFileData(filename, file_extension, lines, Error,
- extra_check_functions)
-
- # If end-of-line sequences are a mix of LF and CR-LF, issue
- # warnings on the lines with CR.
- #
- # Don't issue any warnings if all lines are uniformly LF or CR-LF,
- # since critique can handle these just fine, and the style guide
- # doesn't dictate a particular end of line sequence.
- #
- # We can't depend on os.linesep to determine what the desired
- # end-of-line sequence should be, since that will return the
- # server-side end-of-line sequence.
- if lf_lines and crlf_lines:
- # Warn on every line with CR. An alternative approach might be to
- # check whether the file is mostly CRLF or just LF, and warn on the
- # minority, we bias toward LF here since most tools prefer LF.
- for linenum in crlf_lines:
- Error(filename, linenum, 'whitespace/newline', 1,
- 'Unexpected \\r (^M) found; better to use only \\n')
-
- sys.stderr.write('Done processing %s\n' % filename)
- _RestoreFilters()
-
-
-def PrintUsage(message):
- """Prints a brief usage string and exits, optionally with an error message.
-
- Args:
- message: The optional error message.
- """
- sys.stderr.write(_USAGE)
- if message:
- sys.exit('\nFATAL ERROR: ' + message)
- else:
- sys.exit(1)
-
-
-def PrintCategories():
- """Prints a list of all the error-categories used by error messages.
-
- These are the categories used to filter messages via --filter.
- """
- sys.stderr.write(''.join(' %s\n' % cat for cat in _ERROR_CATEGORIES))
- sys.exit(0)
-
-
-def ParseArguments(args):
- """Parses the command line arguments.
-
- This may set the output format and verbosity level as side-effects.
-
- Args:
- args: The command line arguments:
-
- Returns:
- The list of filenames to lint.
- """
- try:
- (opts, filenames) = getopt.getopt(args, '', ['help', 'output=', 'verbose=',
- 'counting=',
- 'filter=',
- 'root=',
- 'linelength=',
- 'extensions='])
- except getopt.GetoptError:
- PrintUsage('Invalid arguments.')
-
- verbosity = _VerboseLevel()
- output_format = _OutputFormat()
- filters = ''
- counting_style = ''
-
- for (opt, val) in opts:
- if opt == '--help':
- PrintUsage(None)
- elif opt == '--output':
- if val not in ('emacs', 'vs7', 'eclipse'):
- PrintUsage('The only allowed output formats are emacs, vs7 and eclipse.')
- output_format = val
- elif opt == '--verbose':
- verbosity = int(val)
- elif opt == '--filter':
- filters = val
- if not filters:
- PrintCategories()
- elif opt == '--counting':
- if val not in ('total', 'toplevel', 'detailed'):
- PrintUsage('Valid counting options are total, toplevel, and detailed')
- counting_style = val
- elif opt == '--root':
- global _root
- _root = val
- elif opt == '--linelength':
- global _line_length
- try:
- _line_length = int(val)
- except ValueError:
- PrintUsage('Line length must be digits.')
- elif opt == '--extensions':
- global _valid_extensions
- try:
- _valid_extensions = set(val.split(','))
- except ValueError:
- PrintUsage('Extensions must be comma seperated list.')
-
- if not filenames:
- PrintUsage('No files were specified.')
-
- _SetOutputFormat(output_format)
- _SetVerboseLevel(verbosity)
- _SetFilters(filters)
- _SetCountingStyle(counting_style)
-
- return filenames
-
-
-def main():
- filenames = ParseArguments(sys.argv[1:])
-
- # Change stderr to write with replacement characters so we don't die
- # if we try to print something containing non-ASCII characters.
- sys.stderr = codecs.StreamReaderWriter(sys.stderr,
- codecs.getreader('utf8'),
- codecs.getwriter('utf8'),
- 'replace')
-
- _cpplint_state.ResetErrorCounts()
- for filename in filenames:
- ProcessFile(filename, _cpplint_state.verbose_level)
- _cpplint_state.PrintErrorCounts()
- # VR fix - otherwise all cpplint are errors from script launch
- # sys.exit(_cpplint_state.error_count > 0)
- sys.exit(0)
-
-
-if __name__ == '__main__':
- main()
diff --git a/scripts/cpplint_to_cppcheckxml.py b/scripts/cpplint_to_cppcheckxml.py
deleted file mode 100755
index 7a3813c7..00000000
--- a/scripts/cpplint_to_cppcheckxml.py
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/usr/bin/env python
-
-# Convert output from Google's cpplint.py to the cppcheck XML format for
-# consumption by the Jenkins cppcheck plugin.
-
-# Reads from stdin and writes to stderr (to mimic cppcheck)
-
-
-import sys
-import re
-import cgi
-
-def cpplint_score_to_cppcheck_severity(score):
- # I'm making this up
- if score == 1:
- return 'style'
- elif score == 2:
- return 'style'
- elif score == 3:
- return 'warning'
- elif score == 4:
- return 'warning'
- elif score == 5:
- return 'error'
-
-
-def parse():
- # TODO: do this properly, using the xml module.
- # Write header
- sys.stderr.write('''<?xml version="1.0" encoding="UTF-8"?>\n''')
- # VR : sys.stderr.write('''<results>\n''')
- # Add from VR + [
- sys.stderr.write('''<results version="2">\n''')
- sys.stderr.write(''' <cppcheck version="1.63"/>\n''')
- sys.stderr.write(''' <errors>\n''')
- # -]
-
- # Do line-by-line conversion
- r = re.compile('([^:]*):([0-9]*): ([^\[]*)\[([^\]]*)\] \[([0-9]*)\].*')
-
- for l in sys.stdin.readlines():
- m = r.match(l.strip())
- if not m:
- continue
- g = m.groups()
- if len(g) != 5:
- continue
- fname, lineno, msg, label, score = g
- severity = cpplint_score_to_cppcheck_severity(int(score))
- # VR : sys.stderr.write('''<error file="%s" line="%s" id="%s" severity="%s" msg="%s"/>\n'''%(fname, lineno, label, severity, msg))
- # Add from VR + [
- sys.stderr.write(''' <error id="%s" severity="%s" msg="%s">\n'''%(label, severity, cgi.escape(msg,quote=True)))
- sys.stderr.write(''' <location file="%s" line="%s"/>\n'''%(fname, lineno))
- sys.stderr.write(''' </error>\n''')
- # -]
-
- # Write footer
- # Add from VR + [
- sys.stderr.write(''' </errors>\n''')
- # -]
- sys.stderr.write('''</results>\n''')
-
-
-if __name__ == '__main__':
- parse()
-
diff --git a/src/Alpha_complex/concept/SimplicialComplexForAlpha.h b/src/Alpha_complex/concept/SimplicialComplexForAlpha.h
index ba97c802..1c6c3b0c 100644
--- a/src/Alpha_complex/concept/SimplicialComplexForAlpha.h
+++ b/src/Alpha_complex/concept/SimplicialComplexForAlpha.h
@@ -1,23 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef CONCEPT_ALPHA_COMPLEX_SIMPLICIAL_COMPLEX_FOR_ALPHA_H_
diff --git a/src/Alpha_complex/concept/SimplicialComplexForAlpha3d.h b/src/Alpha_complex/concept/SimplicialComplexForAlpha3d.h
index 7acdf105..1dc8c037 100644
--- a/src/Alpha_complex/concept/SimplicialComplexForAlpha3d.h
+++ b/src/Alpha_complex/concept/SimplicialComplexForAlpha3d.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef CONCEPT_ALPHA_COMPLEX_SIMPLICIAL_COMPLEX_FOR_ALPHA_3D_H_
diff --git a/src/Alpha_complex/doc/Intro_alpha_complex.h b/src/Alpha_complex/doc/Intro_alpha_complex.h
index ab7c4794..5b332e47 100644
--- a/src/Alpha_complex/doc/Intro_alpha_complex.h
+++ b/src/Alpha_complex/doc/Intro_alpha_complex.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef DOC_ALPHA_COMPLEX_INTRO_ALPHA_COMPLEX_H_
diff --git a/src/Alpha_complex/example/CMakeLists.txt b/src/Alpha_complex/example/CMakeLists.txt
index c62a220c..b069b443 100644
--- a/src/Alpha_complex/example/CMakeLists.txt
+++ b/src/Alpha_complex/example/CMakeLists.txt
@@ -1,6 +1,6 @@
project(Alpha_complex_examples)
-if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.7.0)
+if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
add_executable ( Alpha_complex_example_from_points Alpha_complex_from_points.cpp )
target_link_libraries(Alpha_complex_example_from_points ${CGAL_LIBRARY})
add_executable ( Alpha_complex_example_from_off Alpha_complex_from_off.cpp )
@@ -26,9 +26,7 @@ if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.7.0)
add_test(Alpha_complex_example_from_off_32_diff_files ${DIFF_PATH}
${CMAKE_CURRENT_BINARY_DIR}/alphaoffreader_result_32.txt ${CMAKE_CURRENT_BINARY_DIR}/alphaoffreader_for_doc_32.txt)
endif()
-endif(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.7.0)
-if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
add_executable ( Alpha_complex_example_weighted_3d_from_points Weighted_alpha_complex_3d_from_points.cpp )
target_link_libraries(Alpha_complex_example_weighted_3d_from_points ${CGAL_LIBRARY})
if (TBB_FOUND)
diff --git a/src/Alpha_complex/include/gudhi/Alpha_complex.h b/src/Alpha_complex/include/gudhi/Alpha_complex.h
index af9f59ea..d5865671 100644
--- a/src/Alpha_complex/include/gudhi/Alpha_complex.h
+++ b/src/Alpha_complex/include/gudhi/Alpha_complex.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef ALPHA_COMPLEX_H_
diff --git a/src/Alpha_complex/include/gudhi/Alpha_complex_3d.h b/src/Alpha_complex/include/gudhi/Alpha_complex_3d.h
index 0bf12b1a..47407b38 100644
--- a/src/Alpha_complex/include/gudhi/Alpha_complex_3d.h
+++ b/src/Alpha_complex/include/gudhi/Alpha_complex_3d.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef ALPHA_COMPLEX_3D_H_
diff --git a/src/Alpha_complex/include/gudhi/Alpha_complex_options.h b/src/Alpha_complex/include/gudhi/Alpha_complex_options.h
index 7a555fa1..bf29039b 100644
--- a/src/Alpha_complex/include/gudhi/Alpha_complex_options.h
+++ b/src/Alpha_complex/include/gudhi/Alpha_complex_options.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef ALPHA_COMPLEX_OPTIONS_H_
diff --git a/src/Alpha_complex/test/Alpha_complex_3d_unit_test.cpp b/src/Alpha_complex/test/Alpha_complex_3d_unit_test.cpp
index ec905d5b..8e4121ae 100644
--- a/src/Alpha_complex/test/Alpha_complex_3d_unit_test.cpp
+++ b/src/Alpha_complex/test/Alpha_complex_3d_unit_test.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#define BOOST_TEST_DYN_LINK
diff --git a/src/Alpha_complex/test/Alpha_complex_unit_test.cpp b/src/Alpha_complex/test/Alpha_complex_unit_test.cpp
index b46b6da5..de0cf471 100644
--- a/src/Alpha_complex/test/Alpha_complex_unit_test.cpp
+++ b/src/Alpha_complex/test/Alpha_complex_unit_test.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#define BOOST_TEST_DYN_LINK
diff --git a/src/Alpha_complex/test/CMakeLists.txt b/src/Alpha_complex/test/CMakeLists.txt
index 7c6bf9aa..ad5b6314 100644
--- a/src/Alpha_complex/test/CMakeLists.txt
+++ b/src/Alpha_complex/test/CMakeLists.txt
@@ -1,7 +1,7 @@
project(Alpha_complex_tests)
include(GUDHI_test_coverage)
-if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.7.0)
+if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
# Do not forget to copy test files in current binary dir
file(COPY "${CMAKE_SOURCE_DIR}/data/points/alphacomplexdoc.off" DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
@@ -14,9 +14,6 @@ if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.7.0)
gudhi_add_coverage_test(Alpha_complex_test_unit)
-endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.7.0)
-
-if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
add_executable ( Alpha_complex_3d_test_unit Alpha_complex_3d_unit_test.cpp )
target_link_libraries(Alpha_complex_3d_test_unit ${CGAL_LIBRARY} ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
add_executable ( Weighted_alpha_complex_3d_test_unit Weighted_alpha_complex_3d_unit_test.cpp )
diff --git a/src/Alpha_complex/test/Periodic_alpha_complex_3d_unit_test.cpp b/src/Alpha_complex/test/Periodic_alpha_complex_3d_unit_test.cpp
index ed4cbff0..4449e5ed 100644
--- a/src/Alpha_complex/test/Periodic_alpha_complex_3d_unit_test.cpp
+++ b/src/Alpha_complex/test/Periodic_alpha_complex_3d_unit_test.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#define BOOST_TEST_DYN_LINK
diff --git a/src/Alpha_complex/test/Weighted_alpha_complex_3d_unit_test.cpp b/src/Alpha_complex/test/Weighted_alpha_complex_3d_unit_test.cpp
index c16b3718..201dbce4 100644
--- a/src/Alpha_complex/test/Weighted_alpha_complex_3d_unit_test.cpp
+++ b/src/Alpha_complex/test/Weighted_alpha_complex_3d_unit_test.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#define BOOST_TEST_DYN_LINK
diff --git a/src/Alpha_complex/test/Weighted_periodic_alpha_complex_3d_unit_test.cpp b/src/Alpha_complex/test/Weighted_periodic_alpha_complex_3d_unit_test.cpp
index e8ac83e5..9d711c41 100644
--- a/src/Alpha_complex/test/Weighted_periodic_alpha_complex_3d_unit_test.cpp
+++ b/src/Alpha_complex/test/Weighted_periodic_alpha_complex_3d_unit_test.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#define BOOST_TEST_DYN_LINK
diff --git a/src/Alpha_complex/utilities/CMakeLists.txt b/src/Alpha_complex/utilities/CMakeLists.txt
index e76edc5f..5295f3cd 100644
--- a/src/Alpha_complex/utilities/CMakeLists.txt
+++ b/src/Alpha_complex/utilities/CMakeLists.txt
@@ -1,6 +1,6 @@
project(Alpha_complex_utilities)
-if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.7.0)
+if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
add_executable (alpha_complex_persistence alpha_complex_persistence.cpp)
target_link_libraries(alpha_complex_persistence ${CGAL_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY})
@@ -12,9 +12,6 @@ if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.7.0)
install(TARGETS alpha_complex_persistence DESTINATION bin)
-endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.7.0)
-
-if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
add_executable(alpha_complex_3d_persistence alpha_complex_3d_persistence.cpp)
target_link_libraries(alpha_complex_3d_persistence ${CGAL_LIBRARY} ${Boost_PROGRAM_OPTIONS_LIBRARY})
if (TBB_FOUND)
diff --git a/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp b/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp
index 09c84eb3..b9991b83 100644
--- a/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp
+++ b/src/Alpha_complex/utilities/alpha_complex_3d_persistence.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <boost/program_options.hpp>
diff --git a/src/Alpha_complex/utilities/alpha_complex_persistence.cpp b/src/Alpha_complex/utilities/alpha_complex_persistence.cpp
index 8e6c40b7..12a8740e 100644
--- a/src/Alpha_complex/utilities/alpha_complex_persistence.cpp
+++ b/src/Alpha_complex/utilities/alpha_complex_persistence.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <boost/program_options.hpp>
diff --git a/src/Bitmap_cubical_complex/doc/Gudhi_Cubical_Complex_doc.h b/src/Bitmap_cubical_complex/doc/Gudhi_Cubical_Complex_doc.h
index 5fa02a5e..237f79ad 100644
--- a/src/Bitmap_cubical_complex/doc/Gudhi_Cubical_Complex_doc.h
+++ b/src/Bitmap_cubical_complex/doc/Gudhi_Cubical_Complex_doc.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
diff --git a/src/Bitmap_cubical_complex/example/Random_bitmap_cubical_complex.cpp b/src/Bitmap_cubical_complex/example/Random_bitmap_cubical_complex.cpp
index 6eb24040..533aec91 100644
--- a/src/Bitmap_cubical_complex/example/Random_bitmap_cubical_complex.cpp
+++ b/src/Bitmap_cubical_complex/example/Random_bitmap_cubical_complex.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
// for persistence algorithm
diff --git a/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex.h b/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex.h
index cc19b8b5..1954eb0c 100644
--- a/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex.h
+++ b/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef BITMAP_CUBICAL_COMPLEX_H_
diff --git a/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex/counter.h b/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex/counter.h
index f82d4cc3..84d53778 100644
--- a/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex/counter.h
+++ b/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex/counter.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef BITMAP_CUBICAL_COMPLEX_COUNTER_H_
diff --git a/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_base.h b/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_base.h
index f5e005b2..a0ad40fc 100644
--- a/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_base.h
+++ b/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_base.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef BITMAP_CUBICAL_COMPLEX_BASE_H_
diff --git a/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_periodic_boundary_conditions_base.h b/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_periodic_boundary_conditions_base.h
index 8c35f590..4afed33c 100644
--- a/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_periodic_boundary_conditions_base.h
+++ b/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_periodic_boundary_conditions_base.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef BITMAP_CUBICAL_COMPLEX_PERIODIC_BOUNDARY_CONDITIONS_BASE_H_
diff --git a/src/Bitmap_cubical_complex/test/Bitmap_test.cpp b/src/Bitmap_cubical_complex/test/Bitmap_test.cpp
index 6a917c25..d3ed75d3 100644
--- a/src/Bitmap_cubical_complex/test/Bitmap_test.cpp
+++ b/src/Bitmap_cubical_complex/test/Bitmap_test.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#define BOOST_TEST_DYN_LINK
diff --git a/src/Bitmap_cubical_complex/utilities/cubical_complex_persistence.cpp b/src/Bitmap_cubical_complex/utilities/cubical_complex_persistence.cpp
index 170aa684..6cf0889f 100644
--- a/src/Bitmap_cubical_complex/utilities/cubical_complex_persistence.cpp
+++ b/src/Bitmap_cubical_complex/utilities/cubical_complex_persistence.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/reader_utils.h>
diff --git a/src/Bitmap_cubical_complex/utilities/periodic_cubical_complex_persistence.cpp b/src/Bitmap_cubical_complex/utilities/periodic_cubical_complex_persistence.cpp
index e9ba5495..700d90f4 100644
--- a/src/Bitmap_cubical_complex/utilities/periodic_cubical_complex_persistence.cpp
+++ b/src/Bitmap_cubical_complex/utilities/periodic_cubical_complex_persistence.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/reader_utils.h>
diff --git a/src/Bottleneck_distance/benchmark/CMakeLists.txt b/src/Bottleneck_distance/benchmark/CMakeLists.txt
index 3105a1d5..77cb013d 100644
--- a/src/Bottleneck_distance/benchmark/CMakeLists.txt
+++ b/src/Bottleneck_distance/benchmark/CMakeLists.txt
@@ -1,8 +1,8 @@
project(Bottleneck_distance_benchmark)
-if (NOT CGAL_VERSION VERSION_LESS 4.8.1)
+if (NOT CGAL_VERSION VERSION_LESS 4.11.0)
add_executable ( bottleneck_chrono bottleneck_chrono.cpp )
if (TBB_FOUND)
target_link_libraries(bottleneck_chrono ${TBB_LIBRARIES})
endif(TBB_FOUND)
-endif(NOT CGAL_VERSION VERSION_LESS 4.8.1)
+endif(NOT CGAL_VERSION VERSION_LESS 4.11.0)
diff --git a/src/Bottleneck_distance/benchmark/bottleneck_chrono.cpp b/src/Bottleneck_distance/benchmark/bottleneck_chrono.cpp
index acafb199..db3c9815 100644
--- a/src/Bottleneck_distance/benchmark/bottleneck_chrono.cpp
+++ b/src/Bottleneck_distance/benchmark/bottleneck_chrono.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Bottleneck.h>
diff --git a/src/Bottleneck_distance/concept/Persistence_diagram.h b/src/Bottleneck_distance/concept/Persistence_diagram.h
index d016faf4..de8021cc 100644
--- a/src/Bottleneck_distance/concept/Persistence_diagram.h
+++ b/src/Bottleneck_distance/concept/Persistence_diagram.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef CONCEPT_BOTTLENECK_DISTANCE_PERSISTENCE_DIAGRAM_H_
diff --git a/src/Bottleneck_distance/doc/Intro_bottleneck_distance.h b/src/Bottleneck_distance/doc/Intro_bottleneck_distance.h
index 7cb0752e..d58392ae 100644
--- a/src/Bottleneck_distance/doc/Intro_bottleneck_distance.h
+++ b/src/Bottleneck_distance/doc/Intro_bottleneck_distance.h
@@ -6,21 +6,9 @@
*
* Copyright (C) 2015 Inria
*
- * Modifications:
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
* - 2019/06 Vincent Rouvreau : Fix #11 - Distance computation shall be better documented.
- *
- * This 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_BOTTLENECK_DISTANCE_INTRO_BOTTLENECK_DISTANCE_H_
diff --git a/src/Bottleneck_distance/example/CMakeLists.txt b/src/Bottleneck_distance/example/CMakeLists.txt
index c6f10127..3d65963a 100644
--- a/src/Bottleneck_distance/example/CMakeLists.txt
+++ b/src/Bottleneck_distance/example/CMakeLists.txt
@@ -1,21 +1,25 @@
project(Bottleneck_distance_examples)
-if (NOT CGAL_VERSION VERSION_LESS 4.8.1)
+if (NOT CGAL_VERSION VERSION_LESS 4.11.0)
add_executable (bottleneck_basic_example bottleneck_basic_example.cpp)
+
+ if (TBB_FOUND)
+ target_link_libraries(bottleneck_basic_example ${TBB_LIBRARIES})
+ endif(TBB_FOUND)
+
+ add_test(NAME Bottleneck_distance_example_basic COMMAND $<TARGET_FILE:bottleneck_basic_example>)
+
+endif (NOT CGAL_VERSION VERSION_LESS 4.11.0)
+
+if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
add_executable (alpha_rips_persistence_bottleneck_distance alpha_rips_persistence_bottleneck_distance.cpp)
target_link_libraries(alpha_rips_persistence_bottleneck_distance ${Boost_PROGRAM_OPTIONS_LIBRARY})
if (TBB_FOUND)
target_link_libraries(alpha_rips_persistence_bottleneck_distance ${TBB_LIBRARIES})
- target_link_libraries(bottleneck_basic_example ${TBB_LIBRARIES})
endif(TBB_FOUND)
- add_test(NAME Bottleneck_distance_example_basic COMMAND $<TARGET_FILE:bottleneck_basic_example>)
add_test(NAME Bottleneck_distance_example_alpha_rips_persistence_bottleneck
COMMAND $<TARGET_FILE:alpha_rips_persistence_bottleneck_distance>
"${CMAKE_SOURCE_DIR}/data/points/tore3D_1307.off" "-r" "0.15" "-m" "0.12" "-d" "3" "-p" "3")
-
- install(TARGETS bottleneck_basic_example DESTINATION bin)
- install(TARGETS alpha_rips_persistence_bottleneck_distance DESTINATION bin)
-
-endif (NOT CGAL_VERSION VERSION_LESS 4.8.1)
+endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
diff --git a/src/Bottleneck_distance/example/alpha_rips_persistence_bottleneck_distance.cpp b/src/Bottleneck_distance/example/alpha_rips_persistence_bottleneck_distance.cpp
index 2db1ef80..c5d66121 100644
--- a/src/Bottleneck_distance/example/alpha_rips_persistence_bottleneck_distance.cpp
+++ b/src/Bottleneck_distance/example/alpha_rips_persistence_bottleneck_distance.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Alpha_complex.h>
diff --git a/src/Bottleneck_distance/include/gudhi/Bottleneck.h b/src/Bottleneck_distance/include/gudhi/Bottleneck.h
index 4ce6cacc..105f1a93 100644
--- a/src/Bottleneck_distance/include/gudhi/Bottleneck.h
+++ b/src/Bottleneck_distance/include/gudhi/Bottleneck.h
@@ -6,21 +6,9 @@
*
* Copyright (C) 2015 Inria
*
- * Modifications:
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
* - 2019/06 Vincent Rouvreau : Fix doxygen warning.
- *
- * This 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 BOTTLENECK_H_
diff --git a/src/Bottleneck_distance/include/gudhi/Graph_matching.h b/src/Bottleneck_distance/include/gudhi/Graph_matching.h
index 313e7d9c..6385ae30 100644
--- a/src/Bottleneck_distance/include/gudhi/Graph_matching.h
+++ b/src/Bottleneck_distance/include/gudhi/Graph_matching.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef GRAPH_MATCHING_H_
diff --git a/src/Bottleneck_distance/include/gudhi/Internal_point.h b/src/Bottleneck_distance/include/gudhi/Internal_point.h
index 7f350f64..9d268af3 100644
--- a/src/Bottleneck_distance/include/gudhi/Internal_point.h
+++ b/src/Bottleneck_distance/include/gudhi/Internal_point.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef INTERNAL_POINT_H_
diff --git a/src/Bottleneck_distance/include/gudhi/Neighbors_finder.h b/src/Bottleneck_distance/include/gudhi/Neighbors_finder.h
index 8c12d353..8a75384c 100644
--- a/src/Bottleneck_distance/include/gudhi/Neighbors_finder.h
+++ b/src/Bottleneck_distance/include/gudhi/Neighbors_finder.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef NEIGHBORS_FINDER_H_
diff --git a/src/Bottleneck_distance/include/gudhi/Persistence_graph.h b/src/Bottleneck_distance/include/gudhi/Persistence_graph.h
index cb163623..3e82a4c9 100644
--- a/src/Bottleneck_distance/include/gudhi/Persistence_graph.h
+++ b/src/Bottleneck_distance/include/gudhi/Persistence_graph.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef PERSISTENCE_GRAPH_H_
diff --git a/src/Bottleneck_distance/test/CMakeLists.txt b/src/Bottleneck_distance/test/CMakeLists.txt
index bb739280..ec2d045f 100644
--- a/src/Bottleneck_distance/test/CMakeLists.txt
+++ b/src/Bottleneck_distance/test/CMakeLists.txt
@@ -1,6 +1,6 @@
project(Bottleneck_distance_tests)
-if (NOT CGAL_VERSION VERSION_LESS 4.8.1)
+if (NOT CGAL_VERSION VERSION_LESS 4.11.0)
include(GUDHI_test_coverage)
add_executable ( Bottleneck_distance_test_unit bottleneck_unit_test.cpp )
@@ -11,4 +11,4 @@ if (NOT CGAL_VERSION VERSION_LESS 4.8.1)
gudhi_add_coverage_test(Bottleneck_distance_test_unit)
-endif (NOT CGAL_VERSION VERSION_LESS 4.8.1)
+endif (NOT CGAL_VERSION VERSION_LESS 4.11.0)
diff --git a/src/Bottleneck_distance/test/bottleneck_unit_test.cpp b/src/Bottleneck_distance/test/bottleneck_unit_test.cpp
index bce88e13..5f20892c 100644
--- a/src/Bottleneck_distance/test/bottleneck_unit_test.cpp
+++ b/src/Bottleneck_distance/test/bottleneck_unit_test.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
diff --git a/src/Bottleneck_distance/utilities/CMakeLists.txt b/src/Bottleneck_distance/utilities/CMakeLists.txt
index 2f35885c..86d74cf5 100644
--- a/src/Bottleneck_distance/utilities/CMakeLists.txt
+++ b/src/Bottleneck_distance/utilities/CMakeLists.txt
@@ -1,6 +1,6 @@
project(Bottleneck_distance_utilities)
-if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1)
+if(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
add_executable (bottleneck_distance bottleneck_distance.cpp)
if (TBB_FOUND)
target_link_libraries(bottleneck_distance ${TBB_LIBRARIES})
@@ -12,4 +12,4 @@ if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1)
install(TARGETS bottleneck_distance DESTINATION bin)
-endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1)
+endif(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
diff --git a/src/Bottleneck_distance/utilities/bottleneck_distance.cpp b/src/Bottleneck_distance/utilities/bottleneck_distance.cpp
index 8f724f95..fc03cb21 100644
--- a/src/Bottleneck_distance/utilities/bottleneck_distance.cpp
+++ b/src/Bottleneck_distance/utilities/bottleneck_distance.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Bottleneck.h>
diff --git a/src/Cech_complex/benchmark/cech_complex_benchmark.cpp b/src/Cech_complex/benchmark/cech_complex_benchmark.cpp
index 86314930..df12e06d 100644
--- a/src/Cech_complex/benchmark/cech_complex_benchmark.cpp
+++ b/src/Cech_complex/benchmark/cech_complex_benchmark.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Points_off_io.h>
diff --git a/src/Cech_complex/concept/SimplicialComplexForCech.h b/src/Cech_complex/concept/SimplicialComplexForCech.h
index 89231eec..00c7df3a 100644
--- a/src/Cech_complex/concept/SimplicialComplexForCech.h
+++ b/src/Cech_complex/concept/SimplicialComplexForCech.h
@@ -1,23 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef CONCEPT_CECH_COMPLEX_SIMPLICIAL_COMPLEX_FOR_CECH_H_
diff --git a/src/Cech_complex/doc/Intro_cech_complex.h b/src/Cech_complex/doc/Intro_cech_complex.h
index 4483bcb9..250c91fa 100644
--- a/src/Cech_complex/doc/Intro_cech_complex.h
+++ b/src/Cech_complex/doc/Intro_cech_complex.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef DOC_CECH_COMPLEX_INTRO_CECH_COMPLEX_H_
diff --git a/src/Cech_complex/example/cech_complex_step_by_step.cpp b/src/Cech_complex/example/cech_complex_step_by_step.cpp
index 6fbbde5b..d9d17b26 100644
--- a/src/Cech_complex/example/cech_complex_step_by_step.cpp
+++ b/src/Cech_complex/example/cech_complex_step_by_step.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/graph_simplicial_complex.h>
diff --git a/src/Cech_complex/include/gudhi/Cech_complex.h b/src/Cech_complex/include/gudhi/Cech_complex.h
index f9b8a269..cc69f35f 100644
--- a/src/Cech_complex/include/gudhi/Cech_complex.h
+++ b/src/Cech_complex/include/gudhi/Cech_complex.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef CECH_COMPLEX_H_
diff --git a/src/Cech_complex/include/gudhi/Cech_complex_blocker.h b/src/Cech_complex/include/gudhi/Cech_complex_blocker.h
index b0d347b1..c0c03bb0 100644
--- a/src/Cech_complex/include/gudhi/Cech_complex_blocker.h
+++ b/src/Cech_complex/include/gudhi/Cech_complex_blocker.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef CECH_COMPLEX_BLOCKER_H_
diff --git a/src/Cech_complex/test/test_cech_complex.cpp b/src/Cech_complex/test/test_cech_complex.cpp
index 9039169c..8df71b15 100644
--- a/src/Cech_complex/test/test_cech_complex.cpp
+++ b/src/Cech_complex/test/test_cech_complex.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#define BOOST_TEST_DYN_LINK
diff --git a/src/Cech_complex/utilities/cech_persistence.cpp b/src/Cech_complex/utilities/cech_persistence.cpp
index 93e92695..78d47a5a 100644
--- a/src/Cech_complex/utilities/cech_persistence.cpp
+++ b/src/Cech_complex/utilities/cech_persistence.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Cech_complex.h>
diff --git a/src/Contraction/example/CMakeLists.txt b/src/Contraction/example/CMakeLists.txt
index 582b7ab8..f0dc885d 100644
--- a/src/Contraction/example/CMakeLists.txt
+++ b/src/Contraction/example/CMakeLists.txt
@@ -1,17 +1,17 @@
project(Contraction_examples)
-add_executable(RipsContraction Rips_contraction.cpp)
+if (NOT CGAL_VERSION VERSION_LESS 4.11.0)
+ add_executable(RipsContraction Rips_contraction.cpp)
-add_executable(GarlandHeckbert Garland_heckbert.cpp)
-target_link_libraries(GarlandHeckbert ${Boost_TIMER_LIBRARY})
+ add_executable(GarlandHeckbert Garland_heckbert.cpp)
+ target_link_libraries(GarlandHeckbert ${Boost_TIMER_LIBRARY})
-add_test(NAME Contraction_example_tore3D_0.2 COMMAND $<TARGET_FILE:RipsContraction>
+ add_test(NAME Contraction_example_tore3D_0.2 COMMAND $<TARGET_FILE:RipsContraction>
"${CMAKE_SOURCE_DIR}/data/points/tore3D_1307.off" "0.2")
-# TODO(DS) : These tests are too long under Windows
-#add_test(NAME Contraction_example_sphere_0.2 COMMAND $<TARGET_FILE:RipsContraction>
-# "${CMAKE_SOURCE_DIR}/data/points/sphere3D_2646.off" "0.2")
-#add_test(NAME Contraction_example_SO3_0.3 COMMAND $<TARGET_FILE:RipsContraction>
-# "${CMAKE_SOURCE_DIR}/data/points/SO3_10000.off" "0.3")
+ # TODO(DS) : These tests are too long under Windows
+ #add_test(NAME Contraction_example_sphere_0.2 COMMAND $<TARGET_FILE:RipsContraction>
+ # "${CMAKE_SOURCE_DIR}/data/points/sphere3D_2646.off" "0.2")
+ #add_test(NAME Contraction_example_SO3_0.3 COMMAND $<TARGET_FILE:RipsContraction>
+ # "${CMAKE_SOURCE_DIR}/data/points/SO3_10000.off" "0.3")
-install(TARGETS RipsContraction DESTINATION bin)
-install(TARGETS GarlandHeckbert DESTINATION bin)
+endif (NOT CGAL_VERSION VERSION_LESS 4.11.0)
diff --git a/src/Contraction/example/Garland_heckbert.cpp b/src/Contraction/example/Garland_heckbert.cpp
index 08dd932e..9c0b5205 100644
--- a/src/Contraction/example/Garland_heckbert.cpp
+++ b/src/Contraction/example/Garland_heckbert.cpp
@@ -1,24 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* 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/>.
- *
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
diff --git a/src/Contraction/example/Garland_heckbert/Error_quadric.h b/src/Contraction/example/Garland_heckbert/Error_quadric.h
index 8bd9b545..49250d7a 100644
--- a/src/Contraction/example/Garland_heckbert/Error_quadric.h
+++ b/src/Contraction/example/Garland_heckbert/Error_quadric.h
@@ -1,24 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* 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/>.
- *
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef GARLAND_HECKBERT_ERROR_QUADRIC_H_
diff --git a/src/Contraction/example/Rips_contraction.cpp b/src/Contraction/example/Rips_contraction.cpp
index 7f9b150a..c41a9d94 100644
--- a/src/Contraction/example/Rips_contraction.cpp
+++ b/src/Contraction/example/Rips_contraction.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Edge_contraction.h>
#include <gudhi/Skeleton_blocker.h>
diff --git a/src/Contraction/include/gudhi/Contraction/CGAL_queue/Modifiable_priority_queue.h b/src/Contraction/include/gudhi/Contraction/CGAL_queue/Modifiable_priority_queue.h
deleted file mode 100644
index 5a55c513..00000000
--- a/src/Contraction/include/gudhi/Contraction/CGAL_queue/Modifiable_priority_queue.h
+++ /dev/null
@@ -1,101 +0,0 @@
-// Copyright (c) 2006-2011 GeometryFactory (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) : Fernando Cacciola <fernando.cacciola@geometryfactory.com>
-//
-#ifndef CONTRACTION_CGAL_QUEUE_MODIFIABLE_PRIORITY_QUEUE_H_
-#define CONTRACTION_CGAL_QUEUE_MODIFIABLE_PRIORITY_QUEUE_H_
-
-#define CGAL_SURFACE_MESH_SIMPLIFICATION_USE_RELAXED_HEAP
-
-#include <boost/optional.hpp>
-#include <boost/pending/relaxed_heap.hpp>
-
-#include <climits> // Neeeded by the following Boost header for CHAR_BIT.
-#include <functional> // for less
-
-namespace CGAL {
-
-template <class IndexedType_, class Compare_ = std::less<IndexedType_>, class ID_ = boost::identity_property_map>
-class Modifiable_priority_queue {
- public:
- typedef Modifiable_priority_queue Self;
-
- typedef IndexedType_ IndexedType;
- typedef Compare_ Compare;
- typedef ID_ ID;
-
- typedef boost::relaxed_heap<IndexedType, Compare, ID> Heap;
- typedef typename Heap::value_type value_type;
- typedef typename Heap::size_type size_type;
-
- typedef bool handle;
-
- public:
- Modifiable_priority_queue(size_type largest_ID, Compare const& c, ID const& id) : mHeap(largest_ID, c, id) { }
-
- handle push(value_type const& v) {
- mHeap.push(v);
- return handle(true);
- }
-
- handle update(value_type const& v, handle h) {
- mHeap.update(v);
- return h;
- }
-
- handle erase(value_type const& v, handle) {
- mHeap.remove(v);
- return null_handle();
- }
-
- value_type top() const {
- return mHeap.top();
- }
-
- void pop() {
- mHeap.pop();
- }
-
- bool empty() const {
- return mHeap.empty();
- }
-
- bool contains(value_type const& v) {
- return mHeap.contains(v);
- }
-
- boost::optional<value_type> extract_top() {
- boost::optional<value_type> r;
- if (!empty()) {
- value_type v = top();
- pop();
- r = boost::optional<value_type>(v);
- }
- return r;
- }
-
- static handle null_handle() {
- return handle(false);
- }
-
- private:
- Heap mHeap;
-};
-
-} // namespace CGAL
-
-#endif // CONTRACTION_CGAL_QUEUE_MODIFIABLE_PRIORITY_QUEUE_H_
diff --git a/src/Contraction/include/gudhi/Contraction/Edge_profile.h b/src/Contraction/include/gudhi/Contraction/Edge_profile.h
index 30b1b80a..0e914de9 100644
--- a/src/Contraction/include/gudhi/Contraction/Edge_profile.h
+++ b/src/Contraction/include/gudhi/Contraction/Edge_profile.h
@@ -1,29 +1,18 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef CONTRACTION_EDGE_PROFILE_H_
#define CONTRACTION_EDGE_PROFILE_H_
#include <ostream>
+#include <cassert>
namespace Gudhi {
diff --git a/src/Contraction/include/gudhi/Contraction/policies/Contraction_visitor.h b/src/Contraction/include/gudhi/Contraction/policies/Contraction_visitor.h
index fa02308b..243bc51c 100644
--- a/src/Contraction/include/gudhi/Contraction/policies/Contraction_visitor.h
+++ b/src/Contraction/include/gudhi/Contraction/policies/Contraction_visitor.h
@@ -1,23 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef CONTRACTION_POLICIES_CONTRACTION_VISITOR_H_
diff --git a/src/Contraction/include/gudhi/Contraction/policies/Cost_policy.h b/src/Contraction/include/gudhi/Contraction/policies/Cost_policy.h
index 04ce36b6..97114794 100644
--- a/src/Contraction/include/gudhi/Contraction/policies/Cost_policy.h
+++ b/src/Contraction/include/gudhi/Contraction/policies/Cost_policy.h
@@ -1,23 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef CONTRACTION_POLICIES_COST_POLICY_H_
diff --git a/src/Contraction/include/gudhi/Contraction/policies/Dummy_valid_contraction.h b/src/Contraction/include/gudhi/Contraction/policies/Dummy_valid_contraction.h
index a5567454..27a4dc7a 100644
--- a/src/Contraction/include/gudhi/Contraction/policies/Dummy_valid_contraction.h
+++ b/src/Contraction/include/gudhi/Contraction/policies/Dummy_valid_contraction.h
@@ -1,23 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef CONTRACTION_POLICIES_DUMMY_VALID_CONTRACTION_H_
diff --git a/src/Contraction/include/gudhi/Contraction/policies/Edge_length_cost.h b/src/Contraction/include/gudhi/Contraction/policies/Edge_length_cost.h
index 1b7a825b..97589385 100644
--- a/src/Contraction/include/gudhi/Contraction/policies/Edge_length_cost.h
+++ b/src/Contraction/include/gudhi/Contraction/policies/Edge_length_cost.h
@@ -1,23 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef CONTRACTION_POLICIES_EDGE_LENGTH_COST_H_
diff --git a/src/Contraction/include/gudhi/Contraction/policies/First_vertex_placement.h b/src/Contraction/include/gudhi/Contraction/policies/First_vertex_placement.h
index 0b9f8775..005b80e0 100644
--- a/src/Contraction/include/gudhi/Contraction/policies/First_vertex_placement.h
+++ b/src/Contraction/include/gudhi/Contraction/policies/First_vertex_placement.h
@@ -1,23 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef CONTRACTION_POLICIES_FIRST_VERTEX_PLACEMENT_H_
diff --git a/src/Contraction/include/gudhi/Contraction/policies/Link_condition_valid_contraction.h b/src/Contraction/include/gudhi/Contraction/policies/Link_condition_valid_contraction.h
index 8c869830..2e7ea481 100644
--- a/src/Contraction/include/gudhi/Contraction/policies/Link_condition_valid_contraction.h
+++ b/src/Contraction/include/gudhi/Contraction/policies/Link_condition_valid_contraction.h
@@ -1,23 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef CONTRACTION_POLICIES_LINK_CONDITION_VALID_CONTRACTION_H_
diff --git a/src/Contraction/include/gudhi/Contraction/policies/Middle_placement.h b/src/Contraction/include/gudhi/Contraction/policies/Middle_placement.h
index 0ba23a35..7dcf708b 100644
--- a/src/Contraction/include/gudhi/Contraction/policies/Middle_placement.h
+++ b/src/Contraction/include/gudhi/Contraction/policies/Middle_placement.h
@@ -1,23 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef CONTRACTION_POLICIES_MIDDLE_PLACEMENT_H_
diff --git a/src/Contraction/include/gudhi/Contraction/policies/Placement_policy.h b/src/Contraction/include/gudhi/Contraction/policies/Placement_policy.h
index 19509fad..5f97d6a7 100644
--- a/src/Contraction/include/gudhi/Contraction/policies/Placement_policy.h
+++ b/src/Contraction/include/gudhi/Contraction/policies/Placement_policy.h
@@ -1,23 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef CONTRACTION_POLICIES_PLACEMENT_POLICY_H_
diff --git a/src/Contraction/include/gudhi/Contraction/policies/Valid_contraction_policy.h b/src/Contraction/include/gudhi/Contraction/policies/Valid_contraction_policy.h
index 8a91f0b5..413c5bd6 100644
--- a/src/Contraction/include/gudhi/Contraction/policies/Valid_contraction_policy.h
+++ b/src/Contraction/include/gudhi/Contraction/policies/Valid_contraction_policy.h
@@ -1,23 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef CONTRACTION_POLICIES_VALID_CONTRACTION_POLICY_H_
diff --git a/src/Contraction/include/gudhi/Edge_contraction.h b/src/Contraction/include/gudhi/Edge_contraction.h
index fcd06996..5cd024bd 100644
--- a/src/Contraction/include/gudhi/Edge_contraction.h
+++ b/src/Contraction/include/gudhi/Edge_contraction.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef EDGE_CONTRACTION_H_
diff --git a/src/Contraction/include/gudhi/Skeleton_blocker_contractor.h b/src/Contraction/include/gudhi/Skeleton_blocker_contractor.h
index 13086161..7a99548d 100644
--- a/src/Contraction/include/gudhi/Skeleton_blocker_contractor.h
+++ b/src/Contraction/include/gudhi/Skeleton_blocker_contractor.h
@@ -6,26 +6,13 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef SKELETON_BLOCKER_CONTRACTOR_H_
#define SKELETON_BLOCKER_CONTRACTOR_H_
-// todo remove the queue to be independent from cgald
-#include <gudhi/Contraction/CGAL_queue/Modifiable_priority_queue.h>
-
#include <gudhi/Contraction/Edge_profile.h>
#include <gudhi/Contraction/policies/Cost_policy.h>
#include <gudhi/Contraction/policies/Edge_length_cost.h>
@@ -39,6 +26,8 @@
#include <gudhi/Skeleton_blocker/Skeleton_blocker_complex_visitor.h>
#include <gudhi/Debug_utils.h>
+// todo remove the queue to be independent from cgald
+#include <CGAL/Modifiable_priority_queue.h>
#include <boost/scoped_array.hpp>
#include <boost/scoped_ptr.hpp>
diff --git a/src/Doxyfile.in b/src/Doxyfile.in
index f80d4505..59f864a0 100644
--- a/src/Doxyfile.in
+++ b/src/Doxyfile.in
@@ -784,8 +784,7 @@ EXCLUDE = data/ \
example/ \
GudhUI/ \
cmake/ \
- src/cython/ \
- include/gudhi_patches/ \
+ cython/ \
README.md
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
diff --git a/src/GudhUI/CMakeLists.txt b/src/GudhUI/CMakeLists.txt
index 0945e758..9b73dcaa 100644
--- a/src/GudhUI/CMakeLists.txt
+++ b/src/GudhUI/CMakeLists.txt
@@ -9,7 +9,7 @@ if (OPENGL_FOUND)
find_package(QGLViewer QUIET)
if ( QGLVIEWER_FOUND)
- if ( CGAL_FOUND AND NOT CGAL_VERSION VERSION_EQUAL 4.8.0)
+ if (NOT CGAL_VERSION VERSION_LESS 4.11.0)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
@@ -38,7 +38,7 @@ if (OPENGL_FOUND)
install(TARGETS GudhUI DESTINATION bin)
set(GUDHI_MODULES ${GUDHI_MODULES} "GudhUI" CACHE INTERNAL "GUDHI_MODULES")
else()
- message("++ GudhUI will not be compiled because CGAL < 4.8.0 or not found")
+ message("++ GudhUI will not be compiled because CGAL < 4.11.0 or not found")
set(GUDHI_MISSING_MODULES ${GUDHI_MISSING_MODULES} "GudhUI" CACHE INTERNAL "GUDHI_MISSING_MODULES")
endif()
else()
diff --git a/src/GudhUI/gui/MainWindow.cpp b/src/GudhUI/gui/MainWindow.cpp
index b11b80e9..05bd42c8 100644
--- a/src/GudhUI/gui/MainWindow.cpp
+++ b/src/GudhUI/gui/MainWindow.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include "MainWindow.h"
diff --git a/src/GudhUI/gui/MainWindow.h b/src/GudhUI/gui/MainWindow.h
index 6076c2ee..d9281e57 100644
--- a/src/GudhUI/gui/MainWindow.h
+++ b/src/GudhUI/gui/MainWindow.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef GUI_MAINWINDOW_H_
diff --git a/src/GudhUI/gui/Menu_edge_contraction.cpp b/src/GudhUI/gui/Menu_edge_contraction.cpp
index 041bdf9e..5a517cef 100644
--- a/src/GudhUI/gui/Menu_edge_contraction.cpp
+++ b/src/GudhUI/gui/Menu_edge_contraction.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef GUI_MENU_EDGE_CONTRACTION_CPP_
diff --git a/src/GudhUI/gui/Menu_edge_contraction.h b/src/GudhUI/gui/Menu_edge_contraction.h
index 0ef7b267..7cbf60ee 100644
--- a/src/GudhUI/gui/Menu_edge_contraction.h
+++ b/src/GudhUI/gui/Menu_edge_contraction.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef GUI_MENU_EDGE_CONTRACTION_H_
diff --git a/src/GudhUI/gui/Menu_k_nearest_neighbors.cpp b/src/GudhUI/gui/Menu_k_nearest_neighbors.cpp
index b1ad15c8..69ed6c56 100644
--- a/src/GudhUI/gui/Menu_k_nearest_neighbors.cpp
+++ b/src/GudhUI/gui/Menu_k_nearest_neighbors.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include "Menu_k_nearest_neighbors.h"
diff --git a/src/GudhUI/gui/Menu_k_nearest_neighbors.h b/src/GudhUI/gui/Menu_k_nearest_neighbors.h
index 56b5b63d..e29ffc0b 100644
--- a/src/GudhUI/gui/Menu_k_nearest_neighbors.h
+++ b/src/GudhUI/gui/Menu_k_nearest_neighbors.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef GUI_MENU_K_NEAREST_NEIGHBORS_H_
diff --git a/src/GudhUI/gui/Menu_persistence.cpp b/src/GudhUI/gui/Menu_persistence.cpp
index ec990559..58556cd1 100644
--- a/src/GudhUI/gui/Menu_persistence.cpp
+++ b/src/GudhUI/gui/Menu_persistence.cpp
@@ -1,24 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* 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/>.
- *
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
diff --git a/src/GudhUI/gui/Menu_persistence.h b/src/GudhUI/gui/Menu_persistence.h
index 32f0c5ca..a4d94636 100644
--- a/src/GudhUI/gui/Menu_persistence.h
+++ b/src/GudhUI/gui/Menu_persistence.h
@@ -1,24 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* 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/>.
- *
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef GUI_MENU_PERSISTENCE_H_
diff --git a/src/GudhUI/gui/Menu_uniform_neighbors.cpp b/src/GudhUI/gui/Menu_uniform_neighbors.cpp
index 7f392b6c..f27a7e12 100644
--- a/src/GudhUI/gui/Menu_uniform_neighbors.cpp
+++ b/src/GudhUI/gui/Menu_uniform_neighbors.cpp
@@ -1,24 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* 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/>.
- *
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include "Menu_uniform_neighbors.h"
diff --git a/src/GudhUI/gui/Menu_uniform_neighbors.h b/src/GudhUI/gui/Menu_uniform_neighbors.h
index 88a3823b..131c8e29 100644
--- a/src/GudhUI/gui/Menu_uniform_neighbors.h
+++ b/src/GudhUI/gui/Menu_uniform_neighbors.h
@@ -1,24 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* 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/>.
- *
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef GUI_MENU_UNIFORM_NEIGHBORS_H_
diff --git a/src/GudhUI/gui/gudhui.cpp b/src/GudhUI/gui/gudhui.cpp
index 2a100fd5..0a7296f6 100644
--- a/src/GudhUI/gui/gudhui.cpp
+++ b/src/GudhUI/gui/gudhui.cpp
@@ -1,24 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* 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/>.
- *
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include "MainWindow.h"
diff --git a/src/GudhUI/model/Complex_typedefs.h b/src/GudhUI/model/Complex_typedefs.h
index 347db1e3..92578111 100644
--- a/src/GudhUI/model/Complex_typedefs.h
+++ b/src/GudhUI/model/Complex_typedefs.h
@@ -1,24 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* 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/>.
- *
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef MODEL_COMPLEX_TYPEDEFS_H_
diff --git a/src/GudhUI/model/Model.h b/src/GudhUI/model/Model.h
index 1d5cc087..dd9bdaab 100644
--- a/src/GudhUI/model/Model.h
+++ b/src/GudhUI/model/Model.h
@@ -1,24 +1,13 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* 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/>.
- *
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
+ * - 2019/07 Vincent Rouvreau: homsimpl (from CHOMP) is no more delivered.
+ * Error message when not previously installed.
*/
#ifndef MODEL_MODEL_H_
@@ -321,8 +310,11 @@ class Model {
void run_chomp() {
save_complex_in_file_for_chomp();
std::cout << "Call CHOMP library\n";
- int returnValue = system("utils/homsimpl chomp.sim");
- std::cout << "CHOMP returns" << returnValue << std::endl;
+ int returnValue = system("homsimpl chomp.sim");
+ if (returnValue != 0) {
+ std::cout << "homsimpl (from CHOMP) failed. Please check it is installed or available in the PATH."
+ << std::endl;
+ }
}
void save_complex_in_file_for_chomp() {
diff --git a/src/GudhUI/utils/Bar_code_persistence.h b/src/GudhUI/utils/Bar_code_persistence.h
index 49c87b3c..cd9b009f 100644
--- a/src/GudhUI/utils/Bar_code_persistence.h
+++ b/src/GudhUI/utils/Bar_code_persistence.h
@@ -1,24 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* 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/>.
- *
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <math.h> // isfinite
diff --git a/src/GudhUI/utils/Critical_points.h b/src/GudhUI/utils/Critical_points.h
index fbd690f8..32fcf32e 100644
--- a/src/GudhUI/utils/Critical_points.h
+++ b/src/GudhUI/utils/Critical_points.h
@@ -1,24 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* 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/>.
- *
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef UTILS_CRITICAL_POINTS_H_
diff --git a/src/GudhUI/utils/Edge_collapsor.h b/src/GudhUI/utils/Edge_collapsor.h
index b3cc7df7..89e032f0 100644
--- a/src/GudhUI/utils/Edge_collapsor.h
+++ b/src/GudhUI/utils/Edge_collapsor.h
@@ -1,24 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* 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/>.
- *
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef UTILS_EDGE_COLLAPSOR_H_
diff --git a/src/GudhUI/utils/Edge_contractor.h b/src/GudhUI/utils/Edge_contractor.h
index 090baabe..0707b186 100644
--- a/src/GudhUI/utils/Edge_contractor.h
+++ b/src/GudhUI/utils/Edge_contractor.h
@@ -1,24 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* 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/>.
- *
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef UTILS_EDGE_CONTRACTOR_H_
diff --git a/src/GudhUI/utils/Furthest_point_epsilon_net.h b/src/GudhUI/utils/Furthest_point_epsilon_net.h
index dbb6661c..6eb71071 100644
--- a/src/GudhUI/utils/Furthest_point_epsilon_net.h
+++ b/src/GudhUI/utils/Furthest_point_epsilon_net.h
@@ -1,24 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* 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/>.
- *
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef UTILS_FURTHEST_POINT_EPSILON_NET_H_
diff --git a/src/GudhUI/utils/Is_manifold.h b/src/GudhUI/utils/Is_manifold.h
index 732df607..276f4332 100644
--- a/src/GudhUI/utils/Is_manifold.h
+++ b/src/GudhUI/utils/Is_manifold.h
@@ -9,19 +9,8 @@
*
* 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/>.
- *
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
diff --git a/src/GudhUI/utils/K_nearest_builder.h b/src/GudhUI/utils/K_nearest_builder.h
index 14851d96..34483e58 100644
--- a/src/GudhUI/utils/K_nearest_builder.h
+++ b/src/GudhUI/utils/K_nearest_builder.h
@@ -1,24 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* 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/>.
- *
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef UTILS_K_NEAREST_BUILDER_H_
diff --git a/src/GudhUI/utils/Lloyd_builder.h b/src/GudhUI/utils/Lloyd_builder.h
index 67595d33..c042564f 100644
--- a/src/GudhUI/utils/Lloyd_builder.h
+++ b/src/GudhUI/utils/Lloyd_builder.h
@@ -1,24 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* 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/>.
- *
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef UTILS_LLOYD_BUILDER_H_
diff --git a/src/GudhUI/utils/MClock.h b/src/GudhUI/utils/MClock.h
index 992f6fa5..54b28211 100644
--- a/src/GudhUI/utils/MClock.h
+++ b/src/GudhUI/utils/MClock.h
@@ -1,24 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* 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/>.
- *
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef UTILS_MCLOCK_H_
diff --git a/src/GudhUI/utils/Persistence_compute.h b/src/GudhUI/utils/Persistence_compute.h
index c8afded9..874f31cf 100644
--- a/src/GudhUI/utils/Persistence_compute.h
+++ b/src/GudhUI/utils/Persistence_compute.h
@@ -1,24 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* 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/>.
- *
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
diff --git a/src/GudhUI/utils/Rips_builder.h b/src/GudhUI/utils/Rips_builder.h
index ed62c1c0..aba1a8e4 100644
--- a/src/GudhUI/utils/Rips_builder.h
+++ b/src/GudhUI/utils/Rips_builder.h
@@ -1,24 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* 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/>.
- *
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef UTILS_RIPS_BUILDER_H_
diff --git a/src/GudhUI/utils/UI_utils.h b/src/GudhUI/utils/UI_utils.h
index 67a02869..571a3cf2 100644
--- a/src/GudhUI/utils/UI_utils.h
+++ b/src/GudhUI/utils/UI_utils.h
@@ -1,24 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* 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/>.
- *
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef UTILS_UI_UTILS_H_
diff --git a/src/GudhUI/utils/Vertex_collapsor.h b/src/GudhUI/utils/Vertex_collapsor.h
index fca57f7d..030e4bb0 100644
--- a/src/GudhUI/utils/Vertex_collapsor.h
+++ b/src/GudhUI/utils/Vertex_collapsor.h
@@ -1,24 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* 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/>.
- *
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef UTILS_VERTEX_COLLAPSOR_H_
diff --git a/src/GudhUI/utils/homsimpl b/src/GudhUI/utils/homsimpl
deleted file mode 100755
index 12227502..00000000
--- a/src/GudhUI/utils/homsimpl
+++ /dev/null
Binary files differ
diff --git a/src/GudhUI/view/Color.h b/src/GudhUI/view/Color.h
index 808dc2d8..791cca51 100644
--- a/src/GudhUI/view/Color.h
+++ b/src/GudhUI/view/Color.h
@@ -1,24 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* 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/>.
- *
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef VIEW_COLOR_H_
diff --git a/src/GudhUI/view/FirstCoordProjector.h b/src/GudhUI/view/FirstCoordProjector.h
index 3f8a6fd9..673485e3 100644
--- a/src/GudhUI/view/FirstCoordProjector.h
+++ b/src/GudhUI/view/FirstCoordProjector.h
@@ -1,24 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* 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/>.
- *
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef VIEW_FIRSTCOORDPROJECTOR_H_
diff --git a/src/GudhUI/view/Projector3D.h b/src/GudhUI/view/Projector3D.h
index a1421f51..574756fd 100644
--- a/src/GudhUI/view/Projector3D.h
+++ b/src/GudhUI/view/Projector3D.h
@@ -1,24 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* 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/>.
- *
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef VIEW_PROJECTOR3D_H_
diff --git a/src/GudhUI/view/View_parameter.h b/src/GudhUI/view/View_parameter.h
index 578a0268..dfd3aa41 100644
--- a/src/GudhUI/view/View_parameter.h
+++ b/src/GudhUI/view/View_parameter.h
@@ -1,24 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* 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/>.
- *
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef VIEW_VIEW_PARAMETER_H_
diff --git a/src/GudhUI/view/Viewer.cpp b/src/GudhUI/view/Viewer.cpp
index 42e35d6c..6b17c833 100644
--- a/src/GudhUI/view/Viewer.cpp
+++ b/src/GudhUI/view/Viewer.cpp
@@ -1,24 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* 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/>.
- *
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include "Viewer.h"
diff --git a/src/GudhUI/view/Viewer.h b/src/GudhUI/view/Viewer.h
index 414044ef..ec165031 100644
--- a/src/GudhUI/view/Viewer.h
+++ b/src/GudhUI/view/Viewer.h
@@ -1,24 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* 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/>.
- *
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef VIEW_VIEWER_H_
diff --git a/src/GudhUI/view/Viewer_instructor.cpp b/src/GudhUI/view/Viewer_instructor.cpp
index a9dc4525..9a0f1cd3 100644
--- a/src/GudhUI/view/Viewer_instructor.cpp
+++ b/src/GudhUI/view/Viewer_instructor.cpp
@@ -1,24 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* 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/>.
- *
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <utility>
diff --git a/src/GudhUI/view/Viewer_instructor.h b/src/GudhUI/view/Viewer_instructor.h
index 4b06acb8..58cbcd31 100644
--- a/src/GudhUI/view/Viewer_instructor.h
+++ b/src/GudhUI/view/Viewer_instructor.h
@@ -1,24 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* 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/>.
- *
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef VIEW_VIEWER_INSTRUCTOR_H_
diff --git a/src/Hasse_complex/include/gudhi/Hasse_complex.h b/src/Hasse_complex/include/gudhi/Hasse_complex.h
index efcaea55..209fd0b9 100644
--- a/src/Hasse_complex/include/gudhi/Hasse_complex.h
+++ b/src/Hasse_complex/include/gudhi/Hasse_complex.h
@@ -1,23 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* Author(s): Clément Maria
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef HASSE_COMPLEX_H_
diff --git a/src/Nerve_GIC/doc/Intro_graph_induced_complex.h b/src/Nerve_GIC/doc/Intro_graph_induced_complex.h
index e72d63dd..d709baec 100644
--- a/src/Nerve_GIC/doc/Intro_graph_induced_complex.h
+++ b/src/Nerve_GIC/doc/Intro_graph_induced_complex.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef DOC_COVER_COMPLEX_INTRO_COVER_COMPLEX_H_
diff --git a/src/Nerve_GIC/example/CMakeLists.txt b/src/Nerve_GIC/example/CMakeLists.txt
index fdecf86e..1667472f 100644
--- a/src/Nerve_GIC/example/CMakeLists.txt
+++ b/src/Nerve_GIC/example/CMakeLists.txt
@@ -1,6 +1,6 @@
project(Nerve_GIC_examples)
-if (NOT CGAL_VERSION VERSION_LESS 4.8.1)
+if (NOT CGAL_VERSION VERSION_LESS 4.11.0)
add_executable ( CoordGIC CoordGIC.cpp )
add_executable ( FuncGIC FuncGIC.cpp )
@@ -25,4 +25,4 @@ if (NOT CGAL_VERSION VERSION_LESS 4.8.1)
install(TARGETS CoordGIC DESTINATION bin)
install(TARGETS FuncGIC DESTINATION bin)
-endif (NOT CGAL_VERSION VERSION_LESS 4.8.1)
+endif (NOT CGAL_VERSION VERSION_LESS 4.11.0)
diff --git a/src/Nerve_GIC/example/CoordGIC.cpp b/src/Nerve_GIC/example/CoordGIC.cpp
index 9889b198..b3a79233 100644
--- a/src/Nerve_GIC/example/CoordGIC.cpp
+++ b/src/Nerve_GIC/example/CoordGIC.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/GIC.h>
diff --git a/src/Nerve_GIC/example/FuncGIC.cpp b/src/Nerve_GIC/example/FuncGIC.cpp
index 1f5de999..2f0b5f2b 100644
--- a/src/Nerve_GIC/example/FuncGIC.cpp
+++ b/src/Nerve_GIC/example/FuncGIC.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/GIC.h>
diff --git a/src/Nerve_GIC/include/gudhi/GIC.h b/src/Nerve_GIC/include/gudhi/GIC.h
index 11bb4e85..d98deeac 100644
--- a/src/Nerve_GIC/include/gudhi/GIC.h
+++ b/src/Nerve_GIC/include/gudhi/GIC.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef GIC_H_
diff --git a/src/Nerve_GIC/test/CMakeLists.txt b/src/Nerve_GIC/test/CMakeLists.txt
index 99263ea0..b89c18a2 100644
--- a/src/Nerve_GIC/test/CMakeLists.txt
+++ b/src/Nerve_GIC/test/CMakeLists.txt
@@ -1,6 +1,6 @@
project(Graph_induced_complex_tests)
-if (NOT CGAL_VERSION VERSION_LESS 4.8.1)
+if (NOT CGAL_VERSION VERSION_LESS 4.11.0)
include(GUDHI_test_coverage)
add_executable ( Nerve_GIC_test_unit test_GIC.cpp )
@@ -13,4 +13,4 @@ if (NOT CGAL_VERSION VERSION_LESS 4.8.1)
gudhi_add_coverage_test(Nerve_GIC_test_unit)
-endif (NOT CGAL_VERSION VERSION_LESS 4.8.1)
+endif (NOT CGAL_VERSION VERSION_LESS 4.11.0)
diff --git a/src/Nerve_GIC/test/test_GIC.cpp b/src/Nerve_GIC/test/test_GIC.cpp
index 0db2cce2..06b3f832 100644
--- a/src/Nerve_GIC/test/test_GIC.cpp
+++ b/src/Nerve_GIC/test/test_GIC.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#define BOOST_TEST_DYN_LINK
diff --git a/src/Nerve_GIC/utilities/CMakeLists.txt b/src/Nerve_GIC/utilities/CMakeLists.txt
index 215f9dfd..65a08d9a 100644
--- a/src/Nerve_GIC/utilities/CMakeLists.txt
+++ b/src/Nerve_GIC/utilities/CMakeLists.txt
@@ -1,6 +1,6 @@
project(Nerve_GIC_examples)
-if (NOT CGAL_VERSION VERSION_LESS 4.8.1)
+if (NOT CGAL_VERSION VERSION_LESS 4.11.0)
add_executable ( Nerve Nerve.cpp )
add_executable ( VoronoiGIC VoronoiGIC.cpp )
@@ -24,4 +24,4 @@ if (NOT CGAL_VERSION VERSION_LESS 4.8.1)
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)
+endif (NOT CGAL_VERSION VERSION_LESS 4.11.0)
diff --git a/src/Nerve_GIC/utilities/KeplerMapperVisuFromTxtFile.py b/src/Nerve_GIC/utilities/KeplerMapperVisuFromTxtFile.py
index 701e7a52..e3101549 100755
--- a/src/Nerve_GIC/utilities/KeplerMapperVisuFromTxtFile.py
+++ b/src/Nerve_GIC/utilities/KeplerMapperVisuFromTxtFile.py
@@ -5,26 +5,14 @@ import numpy as np
from collections import defaultdict
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): Mathieu Carriere
+"""This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ Author(s): Mathieu Carriere
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/>.
+ Modification(s):
+ - YYYY/MM Author: Description of the modification
"""
__author__ = "Mathieu Carriere"
diff --git a/src/Nerve_GIC/utilities/Nerve.cpp b/src/Nerve_GIC/utilities/Nerve.cpp
index 667129e0..ef8e2d7e 100644
--- a/src/Nerve_GIC/utilities/Nerve.cpp
+++ b/src/Nerve_GIC/utilities/Nerve.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/GIC.h>
diff --git a/src/Nerve_GIC/utilities/VoronoiGIC.cpp b/src/Nerve_GIC/utilities/VoronoiGIC.cpp
index 33deca40..fabe35c9 100644
--- a/src/Nerve_GIC/utilities/VoronoiGIC.cpp
+++ b/src/Nerve_GIC/utilities/VoronoiGIC.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/GIC.h>
diff --git a/src/Persistence_representations/concept/Real_valued_topological_data.h b/src/Persistence_representations/concept/Real_valued_topological_data.h
index 22ef6d72..9b29a9bd 100644
--- a/src/Persistence_representations/concept/Real_valued_topological_data.h
+++ b/src/Persistence_representations/concept/Real_valued_topological_data.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef CONCEPT_REAL_VALUED_TOPOLOGICAL_DATA_H_
diff --git a/src/Persistence_representations/concept/Topological_data_with_averages.h b/src/Persistence_representations/concept/Topological_data_with_averages.h
index aa64467f..b1b5ca80 100644
--- a/src/Persistence_representations/concept/Topological_data_with_averages.h
+++ b/src/Persistence_representations/concept/Topological_data_with_averages.h
@@ -7,18 +7,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef CONCEPT_TOPOLOGICAL_DATA_WITH_AVERAGES_H_
diff --git a/src/Persistence_representations/concept/Topological_data_with_distances.h b/src/Persistence_representations/concept/Topological_data_with_distances.h
index c8eb2b34..87c3d158 100644
--- a/src/Persistence_representations/concept/Topological_data_with_distances.h
+++ b/src/Persistence_representations/concept/Topological_data_with_distances.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef CONCEPT_TOPOLOGICAL_DATA_WITH_DISTANCES_H_
diff --git a/src/Persistence_representations/concept/Topological_data_with_scalar_product.h b/src/Persistence_representations/concept/Topological_data_with_scalar_product.h
index 0f08b8c6..063f37ed 100644
--- a/src/Persistence_representations/concept/Topological_data_with_scalar_product.h
+++ b/src/Persistence_representations/concept/Topological_data_with_scalar_product.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef CONCEPT_TOPOLOGICAL_DATA_WITH_SCALAR_PRODUCT_H_
diff --git a/src/Persistence_representations/concept/Vectorized_topological_data.h b/src/Persistence_representations/concept/Vectorized_topological_data.h
index 365105d6..dd1224d2 100644
--- a/src/Persistence_representations/concept/Vectorized_topological_data.h
+++ b/src/Persistence_representations/concept/Vectorized_topological_data.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef CONCEPT_VECTORIZED_TOPOLOGICAL_DATA_H_
diff --git a/src/Persistence_representations/doc/Persistence_representations_doc.h b/src/Persistence_representations/doc/Persistence_representations_doc.h
index 668904c9..111e532b 100644
--- a/src/Persistence_representations/doc/Persistence_representations_doc.h
+++ b/src/Persistence_representations/doc/Persistence_representations_doc.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef DOC_GUDHI_STAT_H_
diff --git a/src/Persistence_representations/example/persistence_heat_maps.cpp b/src/Persistence_representations/example/persistence_heat_maps.cpp
index 45208b68..a7e64bb1 100644
--- a/src/Persistence_representations/example/persistence_heat_maps.cpp
+++ b/src/Persistence_representations/example/persistence_heat_maps.cpp
@@ -9,18 +9,8 @@
* Modifications:
* - 2018/04 MC: Add persistence heat maps computation
*
- * This 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Persistence_heat_maps.h>
diff --git a/src/Persistence_representations/example/persistence_intervals.cpp b/src/Persistence_representations/example/persistence_intervals.cpp
index b5dcf25c..c94f7fe0 100644
--- a/src/Persistence_representations/example/persistence_intervals.cpp
+++ b/src/Persistence_representations/example/persistence_intervals.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Persistence_intervals.h>
diff --git a/src/Persistence_representations/example/persistence_landscape.cpp b/src/Persistence_representations/example/persistence_landscape.cpp
index 27542cf7..70aff546 100644
--- a/src/Persistence_representations/example/persistence_landscape.cpp
+++ b/src/Persistence_representations/example/persistence_landscape.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Persistence_landscape.h>
diff --git a/src/Persistence_representations/example/persistence_landscape_on_grid.cpp b/src/Persistence_representations/example/persistence_landscape_on_grid.cpp
index 0f471a67..7df34ef9 100644
--- a/src/Persistence_representations/example/persistence_landscape_on_grid.cpp
+++ b/src/Persistence_representations/example/persistence_landscape_on_grid.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Persistence_landscape_on_grid.h>
diff --git a/src/Persistence_representations/example/persistence_vectors.cpp b/src/Persistence_representations/example/persistence_vectors.cpp
index 072e530d..d0cf2fc8 100644
--- a/src/Persistence_representations/example/persistence_vectors.cpp
+++ b/src/Persistence_representations/example/persistence_vectors.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Persistence_vectors.h>
diff --git a/src/Persistence_representations/example/sliced_wasserstein.cpp b/src/Persistence_representations/example/sliced_wasserstein.cpp
index 089172a0..6c01c3af 100644
--- a/src/Persistence_representations/example/sliced_wasserstein.cpp
+++ b/src/Persistence_representations/example/sliced_wasserstein.cpp
@@ -6,18 +6,8 @@
*
* Copyright (C) 2018 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Sliced_Wasserstein.h>
diff --git a/src/Persistence_representations/include/gudhi/PSSK.h b/src/Persistence_representations/include/gudhi/PSSK.h
index e1174455..995d0ca2 100644
--- a/src/Persistence_representations/include/gudhi/PSSK.h
+++ b/src/Persistence_representations/include/gudhi/PSSK.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef PSSK_H_
diff --git a/src/Persistence_representations/include/gudhi/Persistence_heat_maps.h b/src/Persistence_representations/include/gudhi/Persistence_heat_maps.h
index a8458bda..12cb04c2 100644
--- a/src/Persistence_representations/include/gudhi/Persistence_heat_maps.h
+++ b/src/Persistence_representations/include/gudhi/Persistence_heat_maps.h
@@ -9,18 +9,8 @@
*
* Copyright (C) 2019 Inria
*
- * This 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef PERSISTENCE_HEAT_MAPS_H_
diff --git a/src/Persistence_representations/include/gudhi/Persistence_intervals.h b/src/Persistence_representations/include/gudhi/Persistence_intervals.h
index 76eac7d7..47953596 100644
--- a/src/Persistence_representations/include/gudhi/Persistence_intervals.h
+++ b/src/Persistence_representations/include/gudhi/Persistence_intervals.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef PERSISTENCE_INTERVALS_H_
diff --git a/src/Persistence_representations/include/gudhi/Persistence_intervals_with_distances.h b/src/Persistence_representations/include/gudhi/Persistence_intervals_with_distances.h
index f48d1a3b..9f605d35 100644
--- a/src/Persistence_representations/include/gudhi/Persistence_intervals_with_distances.h
+++ b/src/Persistence_representations/include/gudhi/Persistence_intervals_with_distances.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef PERSISTENCE_INTERVALS_WITH_DISTANCES_H_
diff --git a/src/Persistence_representations/include/gudhi/Persistence_landscape.h b/src/Persistence_representations/include/gudhi/Persistence_landscape.h
index 9cab0166..f949372b 100644
--- a/src/Persistence_representations/include/gudhi/Persistence_landscape.h
+++ b/src/Persistence_representations/include/gudhi/Persistence_landscape.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef PERSISTENCE_LANDSCAPE_H_
diff --git a/src/Persistence_representations/include/gudhi/Persistence_landscape_on_grid.h b/src/Persistence_representations/include/gudhi/Persistence_landscape_on_grid.h
index fd8a181c..68bce336 100644
--- a/src/Persistence_representations/include/gudhi/Persistence_landscape_on_grid.h
+++ b/src/Persistence_representations/include/gudhi/Persistence_landscape_on_grid.h
@@ -1,25 +1,12 @@
-/** This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* Author(s): Pawel Dlotko
*
* 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/>.
- **/
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
+ */
#ifndef PERSISTENCE_LANDSCAPE_ON_GRID_H_
#define PERSISTENCE_LANDSCAPE_ON_GRID_H_
diff --git a/src/Persistence_representations/include/gudhi/Persistence_vectors.h b/src/Persistence_representations/include/gudhi/Persistence_vectors.h
index 9c04be1d..a8f07b3b 100644
--- a/src/Persistence_representations/include/gudhi/Persistence_vectors.h
+++ b/src/Persistence_representations/include/gudhi/Persistence_vectors.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef PERSISTENCE_VECTORS_H_
diff --git a/src/Persistence_representations/include/gudhi/Sliced_Wasserstein.h b/src/Persistence_representations/include/gudhi/Sliced_Wasserstein.h
index 18165c5f..fbe12422 100644
--- a/src/Persistence_representations/include/gudhi/Sliced_Wasserstein.h
+++ b/src/Persistence_representations/include/gudhi/Sliced_Wasserstein.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef SLICED_WASSERSTEIN_H_
diff --git a/src/Persistence_representations/include/gudhi/common_persistence_representations.h b/src/Persistence_representations/include/gudhi/common_persistence_representations.h
index 6fed019a..488d4529 100644
--- a/src/Persistence_representations/include/gudhi/common_persistence_representations.h
+++ b/src/Persistence_representations/include/gudhi/common_persistence_representations.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef COMMON_PERSISTENCE_REPRESENTATIONS_H_
diff --git a/src/Persistence_representations/include/gudhi/read_persistence_from_file.h b/src/Persistence_representations/include/gudhi/read_persistence_from_file.h
index 4a2b9d68..db21c714 100644
--- a/src/Persistence_representations/include/gudhi/read_persistence_from_file.h
+++ b/src/Persistence_representations/include/gudhi/read_persistence_from_file.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef READ_PERSISTENCE_FROM_FILE_H_
diff --git a/src/Persistence_representations/test/CMakeLists.txt b/src/Persistence_representations/test/CMakeLists.txt
index fb650485..a95880c9 100644
--- a/src/Persistence_representations/test/CMakeLists.txt
+++ b/src/Persistence_representations/test/CMakeLists.txt
@@ -39,14 +39,14 @@ target_link_libraries(kernels_unit ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
gudhi_add_coverage_test(kernels_unit)
-if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1)
- add_executable (Persistence_intervals_with_distances_test_unit persistence_intervals_with_distances_test.cpp )
- target_link_libraries(Persistence_intervals_with_distances_test_unit ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
- if (TBB_FOUND)
- target_link_libraries(Persistence_intervals_with_distances_test_unit ${TBB_LIBRARIES})
- endif(TBB_FOUND)
- gudhi_add_coverage_test(Persistence_intervals_with_distances_test_unit)
-endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1)
+if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
+ add_executable (Persistence_intervals_with_distances_test_unit persistence_intervals_with_distances_test.cpp )
+ target_link_libraries(Persistence_intervals_with_distances_test_unit ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
+ if (TBB_FOUND)
+ target_link_libraries(Persistence_intervals_with_distances_test_unit ${TBB_LIBRARIES})
+ endif(TBB_FOUND)
+ gudhi_add_coverage_test(Persistence_intervals_with_distances_test_unit)
+endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
diff --git a/src/Persistence_representations/test/kernels.cpp b/src/Persistence_representations/test/kernels.cpp
index b8d02d4c..eb27747c 100644
--- a/src/Persistence_representations/test/kernels.cpp
+++ b/src/Persistence_representations/test/kernels.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#define BOOST_TEST_DYN_LINK
diff --git a/src/Persistence_representations/test/persistence_heat_maps_test.cpp b/src/Persistence_representations/test/persistence_heat_maps_test.cpp
index 5fad8051..57e1b4b3 100644
--- a/src/Persistence_representations/test/persistence_heat_maps_test.cpp
+++ b/src/Persistence_representations/test/persistence_heat_maps_test.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#define BOOST_TEST_DYN_LINK
diff --git a/src/Persistence_representations/test/persistence_intervals_test.cpp b/src/Persistence_representations/test/persistence_intervals_test.cpp
index a89db9e3..513e042d 100644
--- a/src/Persistence_representations/test/persistence_intervals_test.cpp
+++ b/src/Persistence_representations/test/persistence_intervals_test.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#define BOOST_TEST_DYN_LINK
diff --git a/src/Persistence_representations/test/persistence_intervals_with_distances_test.cpp b/src/Persistence_representations/test/persistence_intervals_with_distances_test.cpp
index 6ba9a470..3b334533 100644
--- a/src/Persistence_representations/test/persistence_intervals_with_distances_test.cpp
+++ b/src/Persistence_representations/test/persistence_intervals_with_distances_test.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#define BOOST_TEST_DYN_LINK
diff --git a/src/Persistence_representations/test/persistence_lanscapes_on_grid_test.cpp b/src/Persistence_representations/test/persistence_lanscapes_on_grid_test.cpp
index 7eca413b..36e935ac 100644
--- a/src/Persistence_representations/test/persistence_lanscapes_on_grid_test.cpp
+++ b/src/Persistence_representations/test/persistence_lanscapes_on_grid_test.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#define BOOST_TEST_DYN_LINK
diff --git a/src/Persistence_representations/test/persistence_lanscapes_test.cpp b/src/Persistence_representations/test/persistence_lanscapes_test.cpp
index 27ad0987..5b368462 100644
--- a/src/Persistence_representations/test/persistence_lanscapes_test.cpp
+++ b/src/Persistence_representations/test/persistence_lanscapes_test.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#define BOOST_TEST_DYN_LINK
diff --git a/src/Persistence_representations/test/read_persistence_from_file_test.cpp b/src/Persistence_representations/test/read_persistence_from_file_test.cpp
index c3e8cb4e..ac0438d7 100644
--- a/src/Persistence_representations/test/read_persistence_from_file_test.cpp
+++ b/src/Persistence_representations/test/read_persistence_from_file_test.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#define BOOST_TEST_DYN_LINK
diff --git a/src/Persistence_representations/test/vector_representation_test.cpp b/src/Persistence_representations/test/vector_representation_test.cpp
index a6b9314e..9c038727 100644
--- a/src/Persistence_representations/test/vector_representation_test.cpp
+++ b/src/Persistence_representations/test/vector_representation_test.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Persistence_vectors.h>
diff --git a/src/Persistence_representations/utilities/persistence_heat_maps/average_persistence_heat_maps.cpp b/src/Persistence_representations/utilities/persistence_heat_maps/average_persistence_heat_maps.cpp
index 2cbd812b..4edaffdc 100644
--- a/src/Persistence_representations/utilities/persistence_heat_maps/average_persistence_heat_maps.cpp
+++ b/src/Persistence_representations/utilities/persistence_heat_maps/average_persistence_heat_maps.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Persistence_heat_maps.h>
diff --git a/src/Persistence_representations/utilities/persistence_heat_maps/compute_distance_of_persistence_heat_maps.cpp b/src/Persistence_representations/utilities/persistence_heat_maps/compute_distance_of_persistence_heat_maps.cpp
index 14d0db8f..e557e82d 100644
--- a/src/Persistence_representations/utilities/persistence_heat_maps/compute_distance_of_persistence_heat_maps.cpp
+++ b/src/Persistence_representations/utilities/persistence_heat_maps/compute_distance_of_persistence_heat_maps.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Persistence_heat_maps.h>
diff --git a/src/Persistence_representations/utilities/persistence_heat_maps/compute_scalar_product_of_persistence_heat_maps.cpp b/src/Persistence_representations/utilities/persistence_heat_maps/compute_scalar_product_of_persistence_heat_maps.cpp
index 12fceedc..a700724c 100644
--- a/src/Persistence_representations/utilities/persistence_heat_maps/compute_scalar_product_of_persistence_heat_maps.cpp
+++ b/src/Persistence_representations/utilities/persistence_heat_maps/compute_scalar_product_of_persistence_heat_maps.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Persistence_heat_maps.h>
diff --git a/src/Persistence_representations/utilities/persistence_heat_maps/create_p_h_m_weighted_by_arctan_of_their_persistence.cpp b/src/Persistence_representations/utilities/persistence_heat_maps/create_p_h_m_weighted_by_arctan_of_their_persistence.cpp
index 21c553b9..f82a39b0 100644
--- a/src/Persistence_representations/utilities/persistence_heat_maps/create_p_h_m_weighted_by_arctan_of_their_persistence.cpp
+++ b/src/Persistence_representations/utilities/persistence_heat_maps/create_p_h_m_weighted_by_arctan_of_their_persistence.cpp
@@ -1,24 +1,12 @@
-/* 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) 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/>.
-*/
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ * Author(s): Pawel Dlotko
+ *
+ * Copyright (C) 2016 Inria
+ *
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
+ */
#include <gudhi/Persistence_heat_maps.h>
diff --git a/src/Persistence_representations/utilities/persistence_heat_maps/create_p_h_m_weighted_by_distance_from_diagonal.cpp b/src/Persistence_representations/utilities/persistence_heat_maps/create_p_h_m_weighted_by_distance_from_diagonal.cpp
index 99b0bd17..66bf9416 100644
--- a/src/Persistence_representations/utilities/persistence_heat_maps/create_p_h_m_weighted_by_distance_from_diagonal.cpp
+++ b/src/Persistence_representations/utilities/persistence_heat_maps/create_p_h_m_weighted_by_distance_from_diagonal.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Persistence_heat_maps.h>
diff --git a/src/Persistence_representations/utilities/persistence_heat_maps/create_p_h_m_weighted_by_squared_diag_distance.cpp b/src/Persistence_representations/utilities/persistence_heat_maps/create_p_h_m_weighted_by_squared_diag_distance.cpp
index a4b6e458..ac6ec212 100644
--- a/src/Persistence_representations/utilities/persistence_heat_maps/create_p_h_m_weighted_by_squared_diag_distance.cpp
+++ b/src/Persistence_representations/utilities/persistence_heat_maps/create_p_h_m_weighted_by_squared_diag_distance.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Persistence_heat_maps.h>
diff --git a/src/Persistence_representations/utilities/persistence_heat_maps/create_persistence_heat_maps.cpp b/src/Persistence_representations/utilities/persistence_heat_maps/create_persistence_heat_maps.cpp
index 5960a89f..6a3cc2a9 100644
--- a/src/Persistence_representations/utilities/persistence_heat_maps/create_persistence_heat_maps.cpp
+++ b/src/Persistence_representations/utilities/persistence_heat_maps/create_persistence_heat_maps.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Persistence_heat_maps.h>
diff --git a/src/Persistence_representations/utilities/persistence_heat_maps/create_pssk.cpp b/src/Persistence_representations/utilities/persistence_heat_maps/create_pssk.cpp
index 04f33915..40ec56ce 100644
--- a/src/Persistence_representations/utilities/persistence_heat_maps/create_pssk.cpp
+++ b/src/Persistence_representations/utilities/persistence_heat_maps/create_pssk.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/PSSK.h>
diff --git a/src/Persistence_representations/utilities/persistence_heat_maps/plot_persistence_heat_map.cpp b/src/Persistence_representations/utilities/persistence_heat_maps/plot_persistence_heat_map.cpp
index e4402589..d351e3b6 100644
--- a/src/Persistence_representations/utilities/persistence_heat_maps/plot_persistence_heat_map.cpp
+++ b/src/Persistence_representations/utilities/persistence_heat_maps/plot_persistence_heat_map.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Persistence_heat_maps.h>
diff --git a/src/Persistence_representations/utilities/persistence_intervals/CMakeLists.txt b/src/Persistence_representations/utilities/persistence_intervals/CMakeLists.txt
index 649b72cb..a025183e 100644
--- a/src/Persistence_representations/utilities/persistence_intervals/CMakeLists.txt
+++ b/src/Persistence_representations/utilities/persistence_intervals/CMakeLists.txt
@@ -22,7 +22,7 @@ add_test(NAME Persistence_representation_utilities_compute_number_of_dominant_in
install(TARGETS compute_number_of_dominant_intervals DESTINATION bin)
-if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1)
+if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
add_executable ( compute_bottleneck_distance compute_bottleneck_distance.cpp )
if (TBB_FOUND)
target_link_libraries(compute_bottleneck_distance ${TBB_LIBRARIES})
@@ -34,4 +34,4 @@ if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1)
"${CMAKE_CURRENT_BINARY_DIR}/../second.pers")
install(TARGETS compute_bottleneck_distance DESTINATION bin)
-endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1)
+endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
diff --git a/src/Persistence_representations/utilities/persistence_intervals/compute_birth_death_range_in_persistence_diagram.cpp b/src/Persistence_representations/utilities/persistence_intervals/compute_birth_death_range_in_persistence_diagram.cpp
index 3be3de8f..aa051497 100644
--- a/src/Persistence_representations/utilities/persistence_intervals/compute_birth_death_range_in_persistence_diagram.cpp
+++ b/src/Persistence_representations/utilities/persistence_intervals/compute_birth_death_range_in_persistence_diagram.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Persistence_intervals.h>
diff --git a/src/Persistence_representations/utilities/persistence_intervals/compute_bottleneck_distance.cpp b/src/Persistence_representations/utilities/persistence_intervals/compute_bottleneck_distance.cpp
index a6953b98..ca67c74f 100644
--- a/src/Persistence_representations/utilities/persistence_intervals/compute_bottleneck_distance.cpp
+++ b/src/Persistence_representations/utilities/persistence_intervals/compute_bottleneck_distance.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Persistence_intervals_with_distances.h>
diff --git a/src/Persistence_representations/utilities/persistence_intervals/compute_number_of_dominant_intervals.cpp b/src/Persistence_representations/utilities/persistence_intervals/compute_number_of_dominant_intervals.cpp
index 4f052f42..e457c6f4 100644
--- a/src/Persistence_representations/utilities/persistence_intervals/compute_number_of_dominant_intervals.cpp
+++ b/src/Persistence_representations/utilities/persistence_intervals/compute_number_of_dominant_intervals.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Persistence_intervals.h>
diff --git a/src/Persistence_representations/utilities/persistence_intervals/plot_histogram_of_intervals_lengths.cpp b/src/Persistence_representations/utilities/persistence_intervals/plot_histogram_of_intervals_lengths.cpp
index f283971b..b6b35fa1 100644
--- a/src/Persistence_representations/utilities/persistence_intervals/plot_histogram_of_intervals_lengths.cpp
+++ b/src/Persistence_representations/utilities/persistence_intervals/plot_histogram_of_intervals_lengths.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Persistence_intervals.h>
diff --git a/src/Persistence_representations/utilities/persistence_intervals/plot_persistence_Betti_numbers.cpp b/src/Persistence_representations/utilities/persistence_intervals/plot_persistence_Betti_numbers.cpp
index 1cacbcd0..d171d809 100644
--- a/src/Persistence_representations/utilities/persistence_intervals/plot_persistence_Betti_numbers.cpp
+++ b/src/Persistence_representations/utilities/persistence_intervals/plot_persistence_Betti_numbers.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Persistence_intervals.h>
diff --git a/src/Persistence_representations/utilities/persistence_intervals/plot_persistence_intervals.cpp b/src/Persistence_representations/utilities/persistence_intervals/plot_persistence_intervals.cpp
index f92d5782..656958cc 100644
--- a/src/Persistence_representations/utilities/persistence_intervals/plot_persistence_intervals.cpp
+++ b/src/Persistence_representations/utilities/persistence_intervals/plot_persistence_intervals.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Persistence_intervals.h>
diff --git a/src/Persistence_representations/utilities/persistence_landscapes/average_landscapes.cpp b/src/Persistence_representations/utilities/persistence_landscapes/average_landscapes.cpp
index 4048f508..06c61bbf 100644
--- a/src/Persistence_representations/utilities/persistence_landscapes/average_landscapes.cpp
+++ b/src/Persistence_representations/utilities/persistence_landscapes/average_landscapes.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Persistence_landscape.h>
diff --git a/src/Persistence_representations/utilities/persistence_landscapes/compute_distance_of_landscapes.cpp b/src/Persistence_representations/utilities/persistence_landscapes/compute_distance_of_landscapes.cpp
index 253fa273..73d83de2 100644
--- a/src/Persistence_representations/utilities/persistence_landscapes/compute_distance_of_landscapes.cpp
+++ b/src/Persistence_representations/utilities/persistence_landscapes/compute_distance_of_landscapes.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Persistence_landscape.h>
diff --git a/src/Persistence_representations/utilities/persistence_landscapes/compute_scalar_product_of_landscapes.cpp b/src/Persistence_representations/utilities/persistence_landscapes/compute_scalar_product_of_landscapes.cpp
index 11fe2886..313d09f5 100644
--- a/src/Persistence_representations/utilities/persistence_landscapes/compute_scalar_product_of_landscapes.cpp
+++ b/src/Persistence_representations/utilities/persistence_landscapes/compute_scalar_product_of_landscapes.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Persistence_landscape.h>
diff --git a/src/Persistence_representations/utilities/persistence_landscapes/create_landscapes.cpp b/src/Persistence_representations/utilities/persistence_landscapes/create_landscapes.cpp
index 59aad2f3..9ae2e670 100644
--- a/src/Persistence_representations/utilities/persistence_landscapes/create_landscapes.cpp
+++ b/src/Persistence_representations/utilities/persistence_landscapes/create_landscapes.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Persistence_landscape.h>
diff --git a/src/Persistence_representations/utilities/persistence_landscapes/plot_landscapes.cpp b/src/Persistence_representations/utilities/persistence_landscapes/plot_landscapes.cpp
index f32a92a1..5c114f27 100644
--- a/src/Persistence_representations/utilities/persistence_landscapes/plot_landscapes.cpp
+++ b/src/Persistence_representations/utilities/persistence_landscapes/plot_landscapes.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Persistence_landscape.h>
diff --git a/src/Persistence_representations/utilities/persistence_landscapes_on_grid/average_landscapes_on_grid.cpp b/src/Persistence_representations/utilities/persistence_landscapes_on_grid/average_landscapes_on_grid.cpp
index 47102087..14c84d51 100644
--- a/src/Persistence_representations/utilities/persistence_landscapes_on_grid/average_landscapes_on_grid.cpp
+++ b/src/Persistence_representations/utilities/persistence_landscapes_on_grid/average_landscapes_on_grid.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Persistence_landscape_on_grid.h>
diff --git a/src/Persistence_representations/utilities/persistence_landscapes_on_grid/compute_distance_of_landscapes_on_grid.cpp b/src/Persistence_representations/utilities/persistence_landscapes_on_grid/compute_distance_of_landscapes_on_grid.cpp
index 6cf2739d..b732cb82 100644
--- a/src/Persistence_representations/utilities/persistence_landscapes_on_grid/compute_distance_of_landscapes_on_grid.cpp
+++ b/src/Persistence_representations/utilities/persistence_landscapes_on_grid/compute_distance_of_landscapes_on_grid.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Persistence_landscape_on_grid.h>
diff --git a/src/Persistence_representations/utilities/persistence_landscapes_on_grid/compute_scalar_product_of_landscapes_on_grid.cpp b/src/Persistence_representations/utilities/persistence_landscapes_on_grid/compute_scalar_product_of_landscapes_on_grid.cpp
index 9417be6b..91643e2a 100644
--- a/src/Persistence_representations/utilities/persistence_landscapes_on_grid/compute_scalar_product_of_landscapes_on_grid.cpp
+++ b/src/Persistence_representations/utilities/persistence_landscapes_on_grid/compute_scalar_product_of_landscapes_on_grid.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Persistence_landscape_on_grid.h>
diff --git a/src/Persistence_representations/utilities/persistence_landscapes_on_grid/create_landscapes_on_grid.cpp b/src/Persistence_representations/utilities/persistence_landscapes_on_grid/create_landscapes_on_grid.cpp
index 46e229bc..0964eca3 100644
--- a/src/Persistence_representations/utilities/persistence_landscapes_on_grid/create_landscapes_on_grid.cpp
+++ b/src/Persistence_representations/utilities/persistence_landscapes_on_grid/create_landscapes_on_grid.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Persistence_landscape_on_grid.h>
diff --git a/src/Persistence_representations/utilities/persistence_landscapes_on_grid/plot_landscapes_on_grid.cpp b/src/Persistence_representations/utilities/persistence_landscapes_on_grid/plot_landscapes_on_grid.cpp
index 39e438d2..079bd76e 100644
--- a/src/Persistence_representations/utilities/persistence_landscapes_on_grid/plot_landscapes_on_grid.cpp
+++ b/src/Persistence_representations/utilities/persistence_landscapes_on_grid/plot_landscapes_on_grid.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Persistence_landscape_on_grid.h>
diff --git a/src/Persistence_representations/utilities/persistence_vectors/average_persistence_vectors.cpp b/src/Persistence_representations/utilities/persistence_vectors/average_persistence_vectors.cpp
index 45199838..663555a6 100644
--- a/src/Persistence_representations/utilities/persistence_vectors/average_persistence_vectors.cpp
+++ b/src/Persistence_representations/utilities/persistence_vectors/average_persistence_vectors.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Persistence_vectors.h>
diff --git a/src/Persistence_representations/utilities/persistence_vectors/compute_distance_of_persistence_vectors.cpp b/src/Persistence_representations/utilities/persistence_vectors/compute_distance_of_persistence_vectors.cpp
index 0db7dbec..a2e8b226 100644
--- a/src/Persistence_representations/utilities/persistence_vectors/compute_distance_of_persistence_vectors.cpp
+++ b/src/Persistence_representations/utilities/persistence_vectors/compute_distance_of_persistence_vectors.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Persistence_vectors.h>
diff --git a/src/Persistence_representations/utilities/persistence_vectors/compute_scalar_product_of_persistence_vectors.cpp b/src/Persistence_representations/utilities/persistence_vectors/compute_scalar_product_of_persistence_vectors.cpp
index 8e99251b..842c36c4 100644
--- a/src/Persistence_representations/utilities/persistence_vectors/compute_scalar_product_of_persistence_vectors.cpp
+++ b/src/Persistence_representations/utilities/persistence_vectors/compute_scalar_product_of_persistence_vectors.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Persistence_vectors.h>
diff --git a/src/Persistence_representations/utilities/persistence_vectors/create_persistence_vectors.cpp b/src/Persistence_representations/utilities/persistence_vectors/create_persistence_vectors.cpp
index 364284e5..5060ca8b 100644
--- a/src/Persistence_representations/utilities/persistence_vectors/create_persistence_vectors.cpp
+++ b/src/Persistence_representations/utilities/persistence_vectors/create_persistence_vectors.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Persistence_vectors.h>
diff --git a/src/Persistence_representations/utilities/persistence_vectors/plot_persistence_vectors.cpp b/src/Persistence_representations/utilities/persistence_vectors/plot_persistence_vectors.cpp
index 550e47c5..b449be3e 100644
--- a/src/Persistence_representations/utilities/persistence_vectors/plot_persistence_vectors.cpp
+++ b/src/Persistence_representations/utilities/persistence_vectors/plot_persistence_vectors.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Persistence_vectors.h>
diff --git a/src/Persistent_cohomology/benchmark/performance_rips_persistence.cpp b/src/Persistent_cohomology/benchmark/performance_rips_persistence.cpp
index 3b00d7a9..45757002 100644
--- a/src/Persistent_cohomology/benchmark/performance_rips_persistence.cpp
+++ b/src/Persistent_cohomology/benchmark/performance_rips_persistence.cpp
@@ -1,23 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* Author(s): Clément Maria
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Rips_complex.h>
diff --git a/src/Persistent_cohomology/concept/CoefficientField.h b/src/Persistent_cohomology/concept/CoefficientField.h
index 9d066cca..916f49e2 100644
--- a/src/Persistent_cohomology/concept/CoefficientField.h
+++ b/src/Persistent_cohomology/concept/CoefficientField.h
@@ -1,24 +1,12 @@
- /* 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): Clément Maria
- *
- * 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/>.
- */
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ * Author(s): Clément Maria
+ *
+ * Copyright (C) 2014 Inria
+ *
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
+ */
/** \brief Concept describing the requirements for a class to represent
* a field of coefficients to compute persistent homology.
diff --git a/src/Persistent_cohomology/concept/FilteredComplex.h b/src/Persistent_cohomology/concept/FilteredComplex.h
index 7eb01b01..26ac7ac8 100644
--- a/src/Persistent_cohomology/concept/FilteredComplex.h
+++ b/src/Persistent_cohomology/concept/FilteredComplex.h
@@ -1,24 +1,12 @@
- /* 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): Clément Maria
- *
- * 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/>.
- */
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ * Author(s): Clément Maria
+ *
+ * Copyright (C) 2014 Inria
+ *
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
+ */
/** \brief The concept FilteredComplex describes the requirements
* for a type to implement a filtered cell complex, from which
diff --git a/src/Persistent_cohomology/concept/PersistentHomology.h b/src/Persistent_cohomology/concept/PersistentHomology.h
index f9a78763..373832af 100644
--- a/src/Persistent_cohomology/concept/PersistentHomology.h
+++ b/src/Persistent_cohomology/concept/PersistentHomology.h
@@ -1,24 +1,12 @@
- /* 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): Clément Maria
- *
- * 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/>.
- */
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ * Author(s): Clément Maria
+ *
+ * Copyright (C) 2014 Inria
+ *
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
+ */
/** \brief Concept describing the requirements for a class to compute
* persistent homology. */
diff --git a/src/Persistent_cohomology/doc/Intro_persistent_cohomology.h b/src/Persistent_cohomology/doc/Intro_persistent_cohomology.h
index 3d28c93a..6fd19706 100644
--- a/src/Persistent_cohomology/doc/Intro_persistent_cohomology.h
+++ b/src/Persistent_cohomology/doc/Intro_persistent_cohomology.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef DOC_PERSISTENT_COHOMOLOGY_INTRO_PERSISTENT_COHOMOLOGY_H_
diff --git a/src/Persistent_cohomology/example/CMakeLists.txt b/src/Persistent_cohomology/example/CMakeLists.txt
index 0f731519..94ec13c5 100644
--- a/src/Persistent_cohomology/example/CMakeLists.txt
+++ b/src/Persistent_cohomology/example/CMakeLists.txt
@@ -53,17 +53,16 @@ if(GMP_FOUND)
endif(GMPXX_FOUND)
endif(GMP_FOUND)
-if(CGAL_FOUND)
- if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.7.0)
- add_executable(custom_persistence_sort custom_persistence_sort.cpp)
- target_link_libraries(custom_persistence_sort ${CGAL_LIBRARY})
+if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
- if (TBB_FOUND)
- target_link_libraries(custom_persistence_sort ${TBB_LIBRARIES})
- endif(TBB_FOUND)
- add_test(NAME Persistent_cohomology_example_custom_persistence_sort COMMAND $<TARGET_FILE:custom_persistence_sort>)
+ add_executable(custom_persistence_sort custom_persistence_sort.cpp)
+ target_link_libraries(custom_persistence_sort ${CGAL_LIBRARY})
- install(TARGETS custom_persistence_sort DESTINATION bin)
+ if (TBB_FOUND)
+ target_link_libraries(custom_persistence_sort ${TBB_LIBRARIES})
+ endif(TBB_FOUND)
+ add_test(NAME Persistent_cohomology_example_custom_persistence_sort COMMAND $<TARGET_FILE:custom_persistence_sort>)
- endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.7.0)
-endif(CGAL_FOUND)
+ install(TARGETS custom_persistence_sort DESTINATION bin)
+
+endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
diff --git a/src/Persistent_cohomology/example/custom_persistence_sort.cpp b/src/Persistent_cohomology/example/custom_persistence_sort.cpp
index 35366144..b2aed37c 100644
--- a/src/Persistent_cohomology/example/custom_persistence_sort.cpp
+++ b/src/Persistent_cohomology/example/custom_persistence_sort.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <CGAL/Epick_d.h>
diff --git a/src/Persistent_cohomology/example/persistence_from_file.cpp b/src/Persistent_cohomology/example/persistence_from_file.cpp
index 0a05c193..d169cc63 100644
--- a/src/Persistent_cohomology/example/persistence_from_file.cpp
+++ b/src/Persistent_cohomology/example/persistence_from_file.cpp
@@ -1,23 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* Author(s): Vincent Rouvreau
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/reader_utils.h>
diff --git a/src/Persistent_cohomology/example/persistence_from_simple_simplex_tree.cpp b/src/Persistent_cohomology/example/persistence_from_simple_simplex_tree.cpp
index ffccfd86..f95dfeeb 100644
--- a/src/Persistent_cohomology/example/persistence_from_simple_simplex_tree.cpp
+++ b/src/Persistent_cohomology/example/persistence_from_simple_simplex_tree.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/graph_simplicial_complex.h>
diff --git a/src/Persistent_cohomology/example/plain_homology.cpp b/src/Persistent_cohomology/example/plain_homology.cpp
index 1c70ba5d..fbb25cea 100644
--- a/src/Persistent_cohomology/example/plain_homology.cpp
+++ b/src/Persistent_cohomology/example/plain_homology.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Simplex_tree.h>
diff --git a/src/Persistent_cohomology/example/rips_multifield_persistence.cpp b/src/Persistent_cohomology/example/rips_multifield_persistence.cpp
index d6a5bdad..9eb5ccfc 100644
--- a/src/Persistent_cohomology/example/rips_multifield_persistence.cpp
+++ b/src/Persistent_cohomology/example/rips_multifield_persistence.cpp
@@ -1,23 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* Author(s): Clément Maria
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Rips_complex.h>
diff --git a/src/Persistent_cohomology/example/rips_persistence_step_by_step.cpp b/src/Persistent_cohomology/example/rips_persistence_step_by_step.cpp
index 796cfa3a..02db05ec 100644
--- a/src/Persistent_cohomology/example/rips_persistence_step_by_step.cpp
+++ b/src/Persistent_cohomology/example/rips_persistence_step_by_step.cpp
@@ -1,23 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* Author(s): Clément Maria
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/graph_simplicial_complex.h>
diff --git a/src/Persistent_cohomology/example/rips_persistence_via_boundary_matrix.cpp b/src/Persistent_cohomology/example/rips_persistence_via_boundary_matrix.cpp
index 71fc0802..37fa5e93 100644
--- a/src/Persistent_cohomology/example/rips_persistence_via_boundary_matrix.cpp
+++ b/src/Persistent_cohomology/example/rips_persistence_via_boundary_matrix.cpp
@@ -1,23 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* Author(s): Clément Maria, Marc Glisse
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Simplex_tree.h>
diff --git a/src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h b/src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h
index 689a17c0..bee54ded 100644
--- a/src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h
+++ b/src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef PERSISTENT_COHOMOLOGY_H_
diff --git a/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Field_Zp.h b/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Field_Zp.h
index e98b4bb4..0d6c0f82 100644
--- a/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Field_Zp.h
+++ b/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Field_Zp.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef PERSISTENT_COHOMOLOGY_FIELD_ZP_H_
diff --git a/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Multi_field.h b/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Multi_field.h
index 2bae8654..716d91cd 100644
--- a/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Multi_field.h
+++ b/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Multi_field.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef PERSISTENT_COHOMOLOGY_MULTI_FIELD_H_
diff --git a/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Persistent_cohomology_column.h b/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Persistent_cohomology_column.h
index de6c0750..9d7edfe6 100644
--- a/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Persistent_cohomology_column.h
+++ b/src/Persistent_cohomology/include/gudhi/Persistent_cohomology/Persistent_cohomology_column.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef PERSISTENT_COHOMOLOGY_PERSISTENT_COHOMOLOGY_COLUMN_H_
diff --git a/src/Rips_complex/concept/SimplicialComplexForRips.h b/src/Rips_complex/concept/SimplicialComplexForRips.h
index 36ab1b0c..21771dcb 100644
--- a/src/Rips_complex/concept/SimplicialComplexForRips.h
+++ b/src/Rips_complex/concept/SimplicialComplexForRips.h
@@ -1,23 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef CONCEPT_RIPS_COMPLEX_SIMPLICIAL_COMPLEX_FOR_RIPS_H_
diff --git a/src/Rips_complex/doc/Intro_rips_complex.h b/src/Rips_complex/doc/Intro_rips_complex.h
index 97d66fbd..6e5103ac 100644
--- a/src/Rips_complex/doc/Intro_rips_complex.h
+++ b/src/Rips_complex/doc/Intro_rips_complex.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef DOC_RIPS_COMPLEX_INTRO_RIPS_COMPLEX_H_
diff --git a/src/Rips_complex/include/gudhi/Rips_complex.h b/src/Rips_complex/include/gudhi/Rips_complex.h
index ee100867..958abbe2 100644
--- a/src/Rips_complex/include/gudhi/Rips_complex.h
+++ b/src/Rips_complex/include/gudhi/Rips_complex.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef RIPS_COMPLEX_H_
diff --git a/src/Rips_complex/include/gudhi/Sparse_rips_complex.h b/src/Rips_complex/include/gudhi/Sparse_rips_complex.h
index 8df6e387..081a0233 100644
--- a/src/Rips_complex/include/gudhi/Sparse_rips_complex.h
+++ b/src/Rips_complex/include/gudhi/Sparse_rips_complex.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef SPARSE_RIPS_COMPLEX_H_
diff --git a/src/Rips_complex/test/test_rips_complex.cpp b/src/Rips_complex/test/test_rips_complex.cpp
index b8b444c9..cc8745cf 100644
--- a/src/Rips_complex/test/test_rips_complex.cpp
+++ b/src/Rips_complex/test/test_rips_complex.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#define BOOST_TEST_DYN_LINK
diff --git a/src/Rips_complex/utilities/rips_correlation_matrix_persistence.cpp b/src/Rips_complex/utilities/rips_correlation_matrix_persistence.cpp
index 287e8915..f634a2ea 100644
--- a/src/Rips_complex/utilities/rips_correlation_matrix_persistence.cpp
+++ b/src/Rips_complex/utilities/rips_correlation_matrix_persistence.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Rips_complex.h>
diff --git a/src/Rips_complex/utilities/rips_distance_matrix_persistence.cpp b/src/Rips_complex/utilities/rips_distance_matrix_persistence.cpp
index c73152cf..98bc6eba 100644
--- a/src/Rips_complex/utilities/rips_distance_matrix_persistence.cpp
+++ b/src/Rips_complex/utilities/rips_distance_matrix_persistence.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Rips_complex.h>
diff --git a/src/Rips_complex/utilities/rips_persistence.cpp b/src/Rips_complex/utilities/rips_persistence.cpp
index 9410b9c2..a6357847 100644
--- a/src/Rips_complex/utilities/rips_persistence.cpp
+++ b/src/Rips_complex/utilities/rips_persistence.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Rips_complex.h>
diff --git a/src/Rips_complex/utilities/sparse_rips_persistence.cpp b/src/Rips_complex/utilities/sparse_rips_persistence.cpp
index 3840d9f7..a7db4ec6 100644
--- a/src/Rips_complex/utilities/sparse_rips_persistence.cpp
+++ b/src/Rips_complex/utilities/sparse_rips_persistence.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Sparse_rips_complex.h>
diff --git a/src/Simplex_tree/concept/FiltrationValue.h b/src/Simplex_tree/concept/FiltrationValue.h
index f4dcf985..6cf314fa 100644
--- a/src/Simplex_tree/concept/FiltrationValue.h
+++ b/src/Simplex_tree/concept/FiltrationValue.h
@@ -1,24 +1,12 @@
- /* 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): Clément Maria
- *
- * 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/>.
- */
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ * Author(s): Clément Maria
+ *
+ * Copyright (C) 2014 Inria
+ *
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
+ */
/** \brief Value type for a filtration function on a cell complex.
*
diff --git a/src/Simplex_tree/concept/IndexingTag.h b/src/Simplex_tree/concept/IndexingTag.h
index 37e7e294..5ab50f1c 100644
--- a/src/Simplex_tree/concept/IndexingTag.h
+++ b/src/Simplex_tree/concept/IndexingTag.h
@@ -1,24 +1,12 @@
- /* 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): Clément Maria
- *
- * 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/>.
- */
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ * Author(s): Clément Maria
+ *
+ * Copyright (C) 2014 Inria
+ *
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
+ */
/** \brief Concept describing an indexing scheme (see FilteredComplex)
* for applying
diff --git a/src/Simplex_tree/concept/SimplexKey.h b/src/Simplex_tree/concept/SimplexKey.h
index c03f7da1..838fc498 100644
--- a/src/Simplex_tree/concept/SimplexKey.h
+++ b/src/Simplex_tree/concept/SimplexKey.h
@@ -1,24 +1,12 @@
- /* 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): Clément Maria
- *
- * 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/>.
- */
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ * Author(s): Clément Maria
+ *
+ * Copyright (C) 2014 Inria
+ *
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
+ */
/** \brief Key type used as simplex identifier.
*
diff --git a/src/Simplex_tree/concept/SimplexTreeOptions.h b/src/Simplex_tree/concept/SimplexTreeOptions.h
index 6638da26..cee1a890 100644
--- a/src/Simplex_tree/concept/SimplexTreeOptions.h
+++ b/src/Simplex_tree/concept/SimplexTreeOptions.h
@@ -1,24 +1,12 @@
- /* 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) 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/>.
- */
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ * Author(s): Marc Glisse
+ *
+ * Copyright (C) 2015 Inria
+ *
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
+ */
/** \brief Concept of the template parameter for the class `Gudhi::Simplex_tree<SimplexTreeOptions>`.
*
diff --git a/src/Simplex_tree/concept/VertexHandle.h b/src/Simplex_tree/concept/VertexHandle.h
index 9d0642c3..6dd3741b 100644
--- a/src/Simplex_tree/concept/VertexHandle.h
+++ b/src/Simplex_tree/concept/VertexHandle.h
@@ -1,24 +1,12 @@
- /* 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): Clément Maria
- *
- * 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/>.
- */
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ * Author(s): Clément Maria
+ *
+ * Copyright (C) 2014 Inria
+ *
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
+ */
/** \brief Handle type for the vertices of a cell complex.
*
diff --git a/src/Simplex_tree/doc/Intro_simplex_tree.h b/src/Simplex_tree/doc/Intro_simplex_tree.h
index db399489..b01e3e92 100644
--- a/src/Simplex_tree/doc/Intro_simplex_tree.h
+++ b/src/Simplex_tree/doc/Intro_simplex_tree.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef DOC_SIMPLEX_TREE_INTRO_SIMPLEX_TREE_H_
diff --git a/src/Simplex_tree/example/CMakeLists.txt b/src/Simplex_tree/example/CMakeLists.txt
index 857e8518..f99b164c 100644
--- a/src/Simplex_tree/example/CMakeLists.txt
+++ b/src/Simplex_tree/example/CMakeLists.txt
@@ -18,12 +18,8 @@ add_test(NAME Simplex_tree_example_simple_simplex_tree COMMAND $<TARGET_FILE:Sim
add_executable ( Simplex_tree_example_mini_simplex_tree mini_simplex_tree.cpp )
add_test(NAME Simplex_tree_example_mini_simplex_tree COMMAND $<TARGET_FILE:Simplex_tree_example_mini_simplex_tree>)
-install(TARGETS Simplex_tree_example_from_cliques_of_graph DESTINATION bin)
-install(TARGETS Simplex_tree_example_simple_simplex_tree DESTINATION bin)
-install(TARGETS Simplex_tree_example_mini_simplex_tree DESTINATION bin)
-
# An example with Simplex-tree using CGAL alpha_shapes_3
-if(GMP_FOUND AND CGAL_FOUND)
+if(GMP_FOUND AND NOT CGAL_VERSION VERSION_LESS 4.11.0)
add_executable ( Simplex_tree_example_alpha_shapes_3_from_off example_alpha_shapes_3_simplex_tree_from_off_file.cpp )
target_link_libraries(Simplex_tree_example_alpha_shapes_3_from_off ${GMP_LIBRARIES} ${CGAL_LIBRARY})
if (TBB_FOUND)
@@ -32,8 +28,9 @@ if(GMP_FOUND AND CGAL_FOUND)
add_test(NAME Simplex_tree_example_alpha_shapes_3_from_off COMMAND $<TARGET_FILE:Simplex_tree_example_alpha_shapes_3_from_off>
"${CMAKE_SOURCE_DIR}/data/points/bunny_5000.off")
- install(TARGETS Simplex_tree_example_alpha_shapes_3_from_off DESTINATION bin)
+endif()
+if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
add_executable ( Simplex_tree_example_cech_complex_cgal_mini_sphere_3d cech_complex_cgal_mini_sphere_3d.cpp )
target_link_libraries(Simplex_tree_example_cech_complex_cgal_mini_sphere_3d ${Boost_PROGRAM_OPTIONS_LIBRARY} ${CGAL_LIBRARY})
if (TBB_FOUND)
@@ -41,14 +38,11 @@ if(GMP_FOUND AND CGAL_FOUND)
endif()
add_test(NAME Simplex_tree_example_cech_complex_cgal_mini_sphere_3d COMMAND $<TARGET_FILE:Simplex_tree_example_cech_complex_cgal_mini_sphere_3d>
"${CMAKE_SOURCE_DIR}/data/points/tore3D_300.off" -r 0.3 -d 3)
-
- install(TARGETS Simplex_tree_example_alpha_shapes_3_from_off DESTINATION bin)
-endif()
+endif ()
add_executable ( Simplex_tree_example_graph_expansion_with_blocker graph_expansion_with_blocker.cpp )
if (TBB_FOUND)
target_link_libraries(Simplex_tree_example_graph_expansion_with_blocker ${TBB_LIBRARIES})
endif()
-add_test(NAME Simplex_tree_example_graph_expansion_with_blocker COMMAND $<TARGET_FILE:Simplex_tree_example_graph_expansion_with_blocker>)
-install(TARGETS Simplex_tree_example_graph_expansion_with_blocker DESTINATION bin)
+add_test(NAME Simplex_tree_example_graph_expansion_with_blocker COMMAND $<TARGET_FILE:Simplex_tree_example_graph_expansion_with_blocker>)
diff --git a/src/Simplex_tree/example/cech_complex_cgal_mini_sphere_3d.cpp b/src/Simplex_tree/example/cech_complex_cgal_mini_sphere_3d.cpp
index 6bab8adb..fb1a3a4c 100644
--- a/src/Simplex_tree/example/cech_complex_cgal_mini_sphere_3d.cpp
+++ b/src/Simplex_tree/example/cech_complex_cgal_mini_sphere_3d.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/graph_simplicial_complex.h>
diff --git a/src/Simplex_tree/example/example_alpha_shapes_3_simplex_tree_from_off_file.cpp b/src/Simplex_tree/example/example_alpha_shapes_3_simplex_tree_from_off_file.cpp
index 290a9d9b..8803dbb2 100644
--- a/src/Simplex_tree/example/example_alpha_shapes_3_simplex_tree_from_off_file.cpp
+++ b/src/Simplex_tree/example/example_alpha_shapes_3_simplex_tree_from_off_file.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Simplex_tree.h>
diff --git a/src/Simplex_tree/example/graph_expansion_with_blocker.cpp b/src/Simplex_tree/example/graph_expansion_with_blocker.cpp
index f39de31f..34bfd77c 100644
--- a/src/Simplex_tree/example/graph_expansion_with_blocker.cpp
+++ b/src/Simplex_tree/example/graph_expansion_with_blocker.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Simplex_tree.h>
diff --git a/src/Simplex_tree/example/mini_simplex_tree.cpp b/src/Simplex_tree/example/mini_simplex_tree.cpp
index e7c7177f..6370b508 100644
--- a/src/Simplex_tree/example/mini_simplex_tree.cpp
+++ b/src/Simplex_tree/example/mini_simplex_tree.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Simplex_tree.h>
diff --git a/src/Simplex_tree/example/simple_simplex_tree.cpp b/src/Simplex_tree/example/simple_simplex_tree.cpp
index d71b5608..6a0a7fc0 100644
--- a/src/Simplex_tree/example/simple_simplex_tree.cpp
+++ b/src/Simplex_tree/example/simple_simplex_tree.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/graph_simplicial_complex.h>
diff --git a/src/Simplex_tree/example/simplex_tree_from_cliques_of_graph.cpp b/src/Simplex_tree/example/simplex_tree_from_cliques_of_graph.cpp
index 6d70f3d1..eb0282f2 100644
--- a/src/Simplex_tree/example/simplex_tree_from_cliques_of_graph.cpp
+++ b/src/Simplex_tree/example/simplex_tree_from_cliques_of_graph.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/reader_utils.h>
diff --git a/src/Simplex_tree/include/gudhi/Simplex_tree.h b/src/Simplex_tree/include/gudhi/Simplex_tree.h
index f7bb720c..14b27610 100644
--- a/src/Simplex_tree/include/gudhi/Simplex_tree.h
+++ b/src/Simplex_tree/include/gudhi/Simplex_tree.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef SIMPLEX_TREE_H_
diff --git a/src/Simplex_tree/include/gudhi/Simplex_tree/Simplex_tree_iterators.h b/src/Simplex_tree/include/gudhi/Simplex_tree/Simplex_tree_iterators.h
index 02c8bb64..7b6dea0f 100644
--- a/src/Simplex_tree/include/gudhi/Simplex_tree/Simplex_tree_iterators.h
+++ b/src/Simplex_tree/include/gudhi/Simplex_tree/Simplex_tree_iterators.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef SIMPLEX_TREE_SIMPLEX_TREE_ITERATORS_H_
diff --git a/src/Simplex_tree/include/gudhi/Simplex_tree/Simplex_tree_node_explicit_storage.h b/src/Simplex_tree/include/gudhi/Simplex_tree/Simplex_tree_node_explicit_storage.h
index 3a75ec72..26bf0569 100644
--- a/src/Simplex_tree/include/gudhi/Simplex_tree/Simplex_tree_node_explicit_storage.h
+++ b/src/Simplex_tree/include/gudhi/Simplex_tree/Simplex_tree_node_explicit_storage.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef SIMPLEX_TREE_SIMPLEX_TREE_NODE_EXPLICIT_STORAGE_H_
diff --git a/src/Simplex_tree/include/gudhi/Simplex_tree/Simplex_tree_siblings.h b/src/Simplex_tree/include/gudhi/Simplex_tree/Simplex_tree_siblings.h
index ab2ca707..d2b7d8d9 100644
--- a/src/Simplex_tree/include/gudhi/Simplex_tree/Simplex_tree_siblings.h
+++ b/src/Simplex_tree/include/gudhi/Simplex_tree/Simplex_tree_siblings.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef SIMPLEX_TREE_SIMPLEX_TREE_SIBLINGS_H_
diff --git a/src/Simplex_tree/include/gudhi/Simplex_tree/indexing_tag.h b/src/Simplex_tree/include/gudhi/Simplex_tree/indexing_tag.h
index ec4461f3..4df7833c 100644
--- a/src/Simplex_tree/include/gudhi/Simplex_tree/indexing_tag.h
+++ b/src/Simplex_tree/include/gudhi/Simplex_tree/indexing_tag.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef SIMPLEX_TREE_INDEXING_TAG_H_
diff --git a/src/Skeleton_blocker/concept/SkeletonBlockerDS.h b/src/Skeleton_blocker/concept/SkeletonBlockerDS.h
index fd806ff1..52db1766 100644
--- a/src/Skeleton_blocker/concept/SkeletonBlockerDS.h
+++ b/src/Skeleton_blocker/concept/SkeletonBlockerDS.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef CONCEPT_SKELETON_BLOCKER_SKELETONBLOCKERDS_H_
diff --git a/src/Skeleton_blocker/concept/SkeletonBlockerGeometricDS.h b/src/Skeleton_blocker/concept/SkeletonBlockerGeometricDS.h
index d8521343..5987f6fb 100644
--- a/src/Skeleton_blocker/concept/SkeletonBlockerGeometricDS.h
+++ b/src/Skeleton_blocker/concept/SkeletonBlockerGeometricDS.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef CONCEPT_SKELETON_BLOCKER_SKELETONBLOCKERGEOMETRICDS_H_
diff --git a/src/Skeleton_blocker/example/Skeleton_blocker_from_simplices.cpp b/src/Skeleton_blocker/example/Skeleton_blocker_from_simplices.cpp
index f288e39c..486827eb 100644
--- a/src/Skeleton_blocker/example/Skeleton_blocker_from_simplices.cpp
+++ b/src/Skeleton_blocker/example/Skeleton_blocker_from_simplices.cpp
@@ -1,23 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Skeleton_blocker.h>
diff --git a/src/Skeleton_blocker/example/Skeleton_blocker_iteration.cpp b/src/Skeleton_blocker/example/Skeleton_blocker_iteration.cpp
index 4d008450..7f301047 100644
--- a/src/Skeleton_blocker/example/Skeleton_blocker_iteration.cpp
+++ b/src/Skeleton_blocker/example/Skeleton_blocker_iteration.cpp
@@ -1,23 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Skeleton_blocker.h>
diff --git a/src/Skeleton_blocker/example/Skeleton_blocker_link.cpp b/src/Skeleton_blocker/example/Skeleton_blocker_link.cpp
index 2ec72128..e634b656 100644
--- a/src/Skeleton_blocker/example/Skeleton_blocker_link.cpp
+++ b/src/Skeleton_blocker/example/Skeleton_blocker_link.cpp
@@ -1,23 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Skeleton_blocker.h>
diff --git a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker.h b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker.h
index e8b6fde8..169cd3b3 100644
--- a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker.h
+++ b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef SKELETON_BLOCKER_H_
diff --git a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_complex_visitor.h b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_complex_visitor.h
index 6c6a8638..533cc777 100644
--- a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_complex_visitor.h
+++ b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_complex_visitor.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef SKELETON_BLOCKER_SKELETON_BLOCKER_COMPLEX_VISITOR_H_
diff --git a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_link_superior.h b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_link_superior.h
index feab7b3f..c9ebd9ad 100644
--- a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_link_superior.h
+++ b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_link_superior.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef SKELETON_BLOCKER_SKELETON_BLOCKER_LINK_SUPERIOR_H_
diff --git a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_off_io.h b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_off_io.h
index 56009daf..90793843 100644
--- a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_off_io.h
+++ b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_off_io.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef SKELETON_BLOCKER_SKELETON_BLOCKER_OFF_IO_H_
diff --git a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_simple_geometric_traits.h b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_simple_geometric_traits.h
index 22c1668e..3d3d8425 100644
--- a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_simple_geometric_traits.h
+++ b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_simple_geometric_traits.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef SKELETON_BLOCKER_SKELETON_BLOCKER_SIMPLE_GEOMETRIC_TRAITS_H_
diff --git a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_simple_traits.h b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_simple_traits.h
index 144f1fd0..a931ec98 100644
--- a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_simple_traits.h
+++ b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_simple_traits.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef SKELETON_BLOCKER_SKELETON_BLOCKER_SIMPLE_TRAITS_H_
diff --git a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_simplex.h b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_simplex.h
index d7193157..115a3a84 100644
--- a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_simplex.h
+++ b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_simplex.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef SKELETON_BLOCKER_SKELETON_BLOCKER_SIMPLEX_H_
diff --git a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_sub_complex.h b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_sub_complex.h
index dbfb4042..a9e50d11 100644
--- a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_sub_complex.h
+++ b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/Skeleton_blocker_sub_complex.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef SKELETON_BLOCKER_SKELETON_BLOCKER_SUB_COMPLEX_H_
diff --git a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/internal/Top_faces.h b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/internal/Top_faces.h
index f80ca4fe..d2aa59d3 100644
--- a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/internal/Top_faces.h
+++ b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/internal/Top_faces.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef SKELETON_BLOCKER_INTERNAL_TOP_FACES_H_
diff --git a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/internal/Trie.h b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/internal/Trie.h
index 7a5d38eb..a43fa034 100644
--- a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/internal/Trie.h
+++ b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/internal/Trie.h
@@ -1,24 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* 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/>.
- *
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef SKELETON_BLOCKER_INTERNAL_TRIE_H_
diff --git a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_blockers_iterators.h b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_blockers_iterators.h
index 95c5f7ef..66371d0e 100644
--- a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_blockers_iterators.h
+++ b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_blockers_iterators.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef SKELETON_BLOCKER_ITERATORS_SKELETON_BLOCKERS_BLOCKERS_ITERATORS_H_
diff --git a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_edges_iterators.h b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_edges_iterators.h
index 5c725aae..63b963dd 100644
--- a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_edges_iterators.h
+++ b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_edges_iterators.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef SKELETON_BLOCKER_ITERATORS_SKELETON_BLOCKERS_EDGES_ITERATORS_H_
diff --git a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_iterators.h b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_iterators.h
index 8054e64f..7b43e05f 100644
--- a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_iterators.h
+++ b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_iterators.h
@@ -1,24 +1,12 @@
- /* 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/>.
- */
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ * Author(s): David Salinas
+ *
+ * Copyright (C) 2014 Inria
+ *
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
+ */
#ifndef SKELETON_BLOCKER_ITERATORS_SKELETON_BLOCKERS_ITERATORS_H_
#define SKELETON_BLOCKER_ITERATORS_SKELETON_BLOCKERS_ITERATORS_H_
diff --git a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_simplices_iterators.h b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_simplices_iterators.h
index e2024652..1968f43b 100644
--- a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_simplices_iterators.h
+++ b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_simplices_iterators.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef SKELETON_BLOCKER_ITERATORS_SKELETON_BLOCKERS_SIMPLICES_ITERATORS_H_
diff --git a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_triangles_iterators.h b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_triangles_iterators.h
index a834fe1d..ca4d46f6 100644
--- a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_triangles_iterators.h
+++ b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_triangles_iterators.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef SKELETON_BLOCKER_ITERATORS_SKELETON_BLOCKERS_TRIANGLES_ITERATORS_H_
diff --git a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_vertices_iterators.h b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_vertices_iterators.h
index 3a638ae6..81c6e82b 100644
--- a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_vertices_iterators.h
+++ b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker/iterators/Skeleton_blockers_vertices_iterators.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef SKELETON_BLOCKER_ITERATORS_SKELETON_BLOCKERS_VERTICES_ITERATORS_H_
diff --git a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_complex.h b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_complex.h
index addd8104..a8d2420d 100644
--- a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_complex.h
+++ b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_complex.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef SKELETON_BLOCKER_COMPLEX_H_
diff --git a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_geometric_complex.h b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_geometric_complex.h
index 39b88ceb..c7946516 100644
--- a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_geometric_complex.h
+++ b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_geometric_complex.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef SKELETON_BLOCKER_GEOMETRIC_COMPLEX_H_
diff --git a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_link_complex.h b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_link_complex.h
index 428d4e9b..38fd32fd 100644
--- a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_link_complex.h
+++ b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_link_complex.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef SKELETON_BLOCKER_LINK_COMPLEX_H_
diff --git a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_simplifiable_complex.h b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_simplifiable_complex.h
index d5adb39d..f8121fcc 100644
--- a/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_simplifiable_complex.h
+++ b/src/Skeleton_blocker/include/gudhi/Skeleton_blocker_simplifiable_complex.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef SKELETON_BLOCKER_SIMPLIFIABLE_COMPLEX_H_
diff --git a/src/Skeleton_blocker/test/test_skeleton_blocker_complex.cpp b/src/Skeleton_blocker/test/test_skeleton_blocker_complex.cpp
index 9760c74d..8265d763 100644
--- a/src/Skeleton_blocker/test/test_skeleton_blocker_complex.cpp
+++ b/src/Skeleton_blocker/test/test_skeleton_blocker_complex.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <stdio.h>
#include <stdlib.h>
diff --git a/src/Skeleton_blocker/test/test_skeleton_blocker_geometric_complex.cpp b/src/Skeleton_blocker/test/test_skeleton_blocker_geometric_complex.cpp
index f2d3bb27..8cad97a1 100644
--- a/src/Skeleton_blocker/test/test_skeleton_blocker_geometric_complex.cpp
+++ b/src/Skeleton_blocker/test/test_skeleton_blocker_geometric_complex.cpp
@@ -1,23 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <stdio.h>
diff --git a/src/Skeleton_blocker/test/test_skeleton_blocker_simplifiable.cpp b/src/Skeleton_blocker/test/test_skeleton_blocker_simplifiable.cpp
index 1f263c98..b714753d 100644
--- a/src/Skeleton_blocker/test/test_skeleton_blocker_simplifiable.cpp
+++ b/src/Skeleton_blocker/test/test_skeleton_blocker_simplifiable.cpp
@@ -1,23 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <stdio.h>
diff --git a/src/Spatial_searching/doc/Intro_spatial_searching.h b/src/Spatial_searching/doc/Intro_spatial_searching.h
index f387ab2f..5cc458e4 100644
--- a/src/Spatial_searching/doc/Intro_spatial_searching.h
+++ b/src/Spatial_searching/doc/Intro_spatial_searching.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef DOC_SPATIAL_SEARCHING_INTRO_SPATIAL_SEARCHING_H_
diff --git a/src/Spatial_searching/example/CMakeLists.txt b/src/Spatial_searching/example/CMakeLists.txt
index 0f799987..eeb3e85f 100644
--- a/src/Spatial_searching/example/CMakeLists.txt
+++ b/src/Spatial_searching/example/CMakeLists.txt
@@ -1,9 +1,9 @@
project(Spatial_searching_examples)
-if(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1)
+if(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
add_executable( Spatial_searching_example_spatial_searching example_spatial_searching.cpp )
target_link_libraries(Spatial_searching_example_spatial_searching ${CGAL_LIBRARY})
add_test(NAME Spatial_searching_example_spatial_searching
COMMAND $<TARGET_FILE:Spatial_searching_example_spatial_searching>)
install(TARGETS Spatial_searching_example_spatial_searching DESTINATION bin)
-endif(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1)
+endif(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
diff --git a/src/Spatial_searching/include/gudhi/Kd_tree_search.h b/src/Spatial_searching/include/gudhi/Kd_tree_search.h
index ad1054e5..92f3f11b 100644
--- a/src/Spatial_searching/include/gudhi/Kd_tree_search.h
+++ b/src/Spatial_searching/include/gudhi/Kd_tree_search.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef KD_TREE_SEARCH_H_
diff --git a/src/Spatial_searching/test/CMakeLists.txt b/src/Spatial_searching/test/CMakeLists.txt
index b60ab1e3..18f7c6b8 100644
--- a/src/Spatial_searching/test/CMakeLists.txt
+++ b/src/Spatial_searching/test/CMakeLists.txt
@@ -1,6 +1,6 @@
project(Spatial_searching_tests)
-if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1)
+if(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
include(GUDHI_test_coverage)
add_executable( Spatial_searching_test_Kd_tree_search test_Kd_tree_search.cpp )
diff --git a/src/Spatial_searching/test/test_Kd_tree_search.cpp b/src/Spatial_searching/test/test_Kd_tree_search.cpp
index 981a5850..37d7c073 100644
--- a/src/Spatial_searching/test/test_Kd_tree_search.cpp
+++ b/src/Spatial_searching/test/test_Kd_tree_search.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#define BOOST_TEST_DYN_LINK
diff --git a/src/Subsampling/doc/Intro_subsampling.h b/src/Subsampling/doc/Intro_subsampling.h
index d88f6bf6..927e2b72 100644
--- a/src/Subsampling/doc/Intro_subsampling.h
+++ b/src/Subsampling/doc/Intro_subsampling.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef DOC_SUBSAMPLING_INTRO_SUBSAMPLING_H_
diff --git a/src/Subsampling/example/CMakeLists.txt b/src/Subsampling/example/CMakeLists.txt
index f26d107f..28aab103 100644
--- a/src/Subsampling/example/CMakeLists.txt
+++ b/src/Subsampling/example/CMakeLists.txt
@@ -1,6 +1,6 @@
project(Subsampling_examples)
-if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1)
+if(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
add_executable(Subsampling_example_pick_n_random_points example_pick_n_random_points.cpp)
add_executable(Subsampling_example_choose_n_farthest_points example_choose_n_farthest_points.cpp)
add_executable(Subsampling_example_custom_kernel example_custom_kernel.cpp)
@@ -19,4 +19,4 @@ if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1)
install(TARGETS Subsampling_example_custom_kernel DESTINATION bin)
install(TARGETS Subsampling_example_sparsify_point_set DESTINATION bin)
-endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1)
+endif(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
diff --git a/src/Subsampling/include/gudhi/choose_n_farthest_points.h b/src/Subsampling/include/gudhi/choose_n_farthest_points.h
index ab1c4c73..f99df0fa 100644
--- a/src/Subsampling/include/gudhi/choose_n_farthest_points.h
+++ b/src/Subsampling/include/gudhi/choose_n_farthest_points.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef CHOOSE_N_FARTHEST_POINTS_H_
diff --git a/src/Subsampling/include/gudhi/pick_n_random_points.h b/src/Subsampling/include/gudhi/pick_n_random_points.h
index 64821e5d..f7734238 100644
--- a/src/Subsampling/include/gudhi/pick_n_random_points.h
+++ b/src/Subsampling/include/gudhi/pick_n_random_points.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef PICK_N_RANDOM_POINTS_H_
diff --git a/src/Subsampling/include/gudhi/sparsify_point_set.h b/src/Subsampling/include/gudhi/sparsify_point_set.h
index db10e0b1..d39d3906 100644
--- a/src/Subsampling/include/gudhi/sparsify_point_set.h
+++ b/src/Subsampling/include/gudhi/sparsify_point_set.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef SPARSIFY_POINT_SET_H_
diff --git a/src/Subsampling/test/CMakeLists.txt b/src/Subsampling/test/CMakeLists.txt
index 924f0925..cf54788e 100644
--- a/src/Subsampling/test/CMakeLists.txt
+++ b/src/Subsampling/test/CMakeLists.txt
@@ -1,6 +1,6 @@
project(Subsampling_tests)
-if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1)
+if(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
include(GUDHI_test_coverage)
add_executable( Subsampling_test_pick_n_random_points test_pick_n_random_points.cpp )
@@ -15,4 +15,4 @@ if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1)
gudhi_add_coverage_test(Subsampling_test_pick_n_random_points)
gudhi_add_coverage_test(Subsampling_test_choose_n_farthest_points)
gudhi_add_coverage_test(Subsampling_test_sparsify_point_set)
-endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1)
+endif(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
diff --git a/src/Subsampling/test/test_choose_n_farthest_points.cpp b/src/Subsampling/test/test_choose_n_farthest_points.cpp
index 0e0eb29c..7e3dfb21 100644
--- a/src/Subsampling/test/test_choose_n_farthest_points.cpp
+++ b/src/Subsampling/test/test_choose_n_farthest_points.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
// #ifdef _DEBUG
diff --git a/src/Subsampling/test/test_pick_n_random_points.cpp b/src/Subsampling/test/test_pick_n_random_points.cpp
index 4baf4a5d..49138ab4 100644
--- a/src/Subsampling/test/test_pick_n_random_points.cpp
+++ b/src/Subsampling/test/test_pick_n_random_points.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
// #ifdef _DEBUG
diff --git a/src/Subsampling/test/test_sparsify_point_set.cpp b/src/Subsampling/test/test_sparsify_point_set.cpp
index f414dda3..b2a55663 100644
--- a/src/Subsampling/test/test_sparsify_point_set.cpp
+++ b/src/Subsampling/test/test_sparsify_point_set.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#define BOOST_TEST_DYN_LINK
diff --git a/src/Tangential_complex/benchmark/CMakeLists.txt b/src/Tangential_complex/benchmark/CMakeLists.txt
index f136ab27..621b0fd7 100644
--- a/src/Tangential_complex/benchmark/CMakeLists.txt
+++ b/src/Tangential_complex/benchmark/CMakeLists.txt
@@ -1,9 +1,9 @@
project(Tangential_complex_benchmark)
-if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1)
+if(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
add_executable(Tangential_complex_benchmark benchmark_tc.cpp)
target_link_libraries(Tangential_complex_benchmark ${CGAL_LIBRARY})
if (TBB_FOUND)
target_link_libraries(Tangential_complex_benchmark ${TBB_LIBRARIES})
endif(TBB_FOUND)
-endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1)
+endif(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
diff --git a/src/Tangential_complex/benchmark/RIB_exporter.h b/src/Tangential_complex/benchmark/RIB_exporter.h
index 59ca138a..7e8a8ed9 100644
--- a/src/Tangential_complex/benchmark/RIB_exporter.h
+++ b/src/Tangential_complex/benchmark/RIB_exporter.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef GUDHI_TC_RIB_EXPORTER_H
diff --git a/src/Tangential_complex/benchmark/XML_exporter.h b/src/Tangential_complex/benchmark/XML_exporter.h
index 4db5687f..afa67288 100644
--- a/src/Tangential_complex/benchmark/XML_exporter.h
+++ b/src/Tangential_complex/benchmark/XML_exporter.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <string>
diff --git a/src/Tangential_complex/doc/Intro_tangential_complex.h b/src/Tangential_complex/doc/Intro_tangential_complex.h
index 501f4a8b..3bd84aa8 100644
--- a/src/Tangential_complex/doc/Intro_tangential_complex.h
+++ b/src/Tangential_complex/doc/Intro_tangential_complex.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef DOC_TANGENTIAL_COMPLEX_INTRO_TANGENTIAL_COMPLEX_H_
diff --git a/src/Tangential_complex/example/CMakeLists.txt b/src/Tangential_complex/example/CMakeLists.txt
index af0dac51..cb1486a4 100644
--- a/src/Tangential_complex/example/CMakeLists.txt
+++ b/src/Tangential_complex/example/CMakeLists.txt
@@ -1,6 +1,6 @@
project(Tangential_complex_examples)
-if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1)
+if(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
add_executable( Tangential_complex_example_basic example_basic.cpp )
target_link_libraries(Tangential_complex_example_basic ${CGAL_LIBRARY})
add_executable( Tangential_complex_example_with_perturb example_with_perturb.cpp )
@@ -17,4 +17,4 @@ if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1)
install(TARGETS Tangential_complex_example_basic DESTINATION bin)
install(TARGETS Tangential_complex_example_with_perturb DESTINATION bin)
-endif(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1)
+endif(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
diff --git a/src/Tangential_complex/include/gudhi/Tangential_complex.h b/src/Tangential_complex/include/gudhi/Tangential_complex.h
index 4a78127c..7fdd68ee 100644
--- a/src/Tangential_complex/include/gudhi/Tangential_complex.h
+++ b/src/Tangential_complex/include/gudhi/Tangential_complex.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef TANGENTIAL_COMPLEX_H_
diff --git a/src/Tangential_complex/include/gudhi/Tangential_complex/Simplicial_complex.h b/src/Tangential_complex/include/gudhi/Tangential_complex/Simplicial_complex.h
index f79186b0..8f008236 100644
--- a/src/Tangential_complex/include/gudhi/Tangential_complex/Simplicial_complex.h
+++ b/src/Tangential_complex/include/gudhi/Tangential_complex/Simplicial_complex.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef TANGENTIAL_COMPLEX_SIMPLICIAL_COMPLEX_H_
diff --git a/src/Tangential_complex/include/gudhi/Tangential_complex/config.h b/src/Tangential_complex/include/gudhi/Tangential_complex/config.h
index e1af1ea6..6de698ab 100644
--- a/src/Tangential_complex/include/gudhi/Tangential_complex/config.h
+++ b/src/Tangential_complex/include/gudhi/Tangential_complex/config.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef TANGENTIAL_COMPLEX_CONFIG_H_
diff --git a/src/Tangential_complex/include/gudhi/Tangential_complex/utilities.h b/src/Tangential_complex/include/gudhi/Tangential_complex/utilities.h
index 2dd46118..14e71797 100644
--- a/src/Tangential_complex/include/gudhi/Tangential_complex/utilities.h
+++ b/src/Tangential_complex/include/gudhi/Tangential_complex/utilities.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef TANGENTIAL_COMPLEX_UTILITIES_H_
diff --git a/src/Tangential_complex/test/CMakeLists.txt b/src/Tangential_complex/test/CMakeLists.txt
index 902f19af..ae17a286 100644
--- a/src/Tangential_complex/test/CMakeLists.txt
+++ b/src/Tangential_complex/test/CMakeLists.txt
@@ -1,6 +1,6 @@
project(Tangential_complex_tests)
-if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1)
+if(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
include(GUDHI_test_coverage)
add_executable( Tangential_complex_test_TC test_tangential_complex.cpp )
@@ -10,4 +10,4 @@ if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1)
endif()
gudhi_add_coverage_test(Tangential_complex_test_TC)
-endif(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1)
+endif(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
diff --git a/src/Tangential_complex/test/test_tangential_complex.cpp b/src/Tangential_complex/test/test_tangential_complex.cpp
index 103b8b30..94038c29 100644
--- a/src/Tangential_complex/test/test_tangential_complex.cpp
+++ b/src/Tangential_complex/test/test_tangential_complex.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#define BOOST_TEST_DYN_LINK
diff --git a/src/Toplex_map/benchmark/benchmark_tm.cpp b/src/Toplex_map/benchmark/benchmark_tm.cpp
index eedb442b..f132b783 100644
--- a/src/Toplex_map/benchmark/benchmark_tm.cpp
+++ b/src/Toplex_map/benchmark/benchmark_tm.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <iostream>
diff --git a/src/Toplex_map/doc/Intro_Toplex_map.h b/src/Toplex_map/doc/Intro_Toplex_map.h
index a925dc2b..58c22f64 100644
--- a/src/Toplex_map/doc/Intro_Toplex_map.h
+++ b/src/Toplex_map/doc/Intro_Toplex_map.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef DOC_TOPLEX_MAP_INTRO_TOPLEX_MAP_H_
diff --git a/src/Toplex_map/example/simple_toplex_map.cpp b/src/Toplex_map/example/simple_toplex_map.cpp
index e1c12ed6..27ce0fbe 100644
--- a/src/Toplex_map/example/simple_toplex_map.cpp
+++ b/src/Toplex_map/example/simple_toplex_map.cpp
@@ -6,18 +6,8 @@
*
* Copyright (C) 2018
*
- * This 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Toplex_map.h>
diff --git a/src/Toplex_map/include/gudhi/Lazy_toplex_map.h b/src/Toplex_map/include/gudhi/Lazy_toplex_map.h
index d7bccdff..c328e43b 100644
--- a/src/Toplex_map/include/gudhi/Lazy_toplex_map.h
+++ b/src/Toplex_map/include/gudhi/Lazy_toplex_map.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef LAZY_TOPLEX_MAP_H
diff --git a/src/Toplex_map/include/gudhi/Toplex_map.h b/src/Toplex_map/include/gudhi/Toplex_map.h
index 4dc2331f..7deebef7 100644
--- a/src/Toplex_map/include/gudhi/Toplex_map.h
+++ b/src/Toplex_map/include/gudhi/Toplex_map.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef TOPLEX_MAP_H
diff --git a/src/Toplex_map/test/lazy_toplex_map_unit_test.cpp b/src/Toplex_map/test/lazy_toplex_map_unit_test.cpp
index a050cc92..2cca9c46 100644
--- a/src/Toplex_map/test/lazy_toplex_map_unit_test.cpp
+++ b/src/Toplex_map/test/lazy_toplex_map_unit_test.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <iostream>
diff --git a/src/Toplex_map/test/toplex_map_unit_test.cpp b/src/Toplex_map/test/toplex_map_unit_test.cpp
index 2bd27936..c4c37bb3 100644
--- a/src/Toplex_map/test/toplex_map_unit_test.cpp
+++ b/src/Toplex_map/test/toplex_map_unit_test.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <iostream>
diff --git a/src/Witness_complex/concept/SimplicialComplexForWitness.h b/src/Witness_complex/concept/SimplicialComplexForWitness.h
index 8b85f4e4..609b59ae 100644
--- a/src/Witness_complex/concept/SimplicialComplexForWitness.h
+++ b/src/Witness_complex/concept/SimplicialComplexForWitness.h
@@ -1,23 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* Author(s): Siargey Kachanovich
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef CONCEPT_WITNESS_COMPLEX_SIMPLICIAL_COMPLEX_FOR_WITNESS_H_
diff --git a/src/Witness_complex/example/CMakeLists.txt b/src/Witness_complex/example/CMakeLists.txt
index 3d838c0d..5860f3a3 100644
--- a/src/Witness_complex/example/CMakeLists.txt
+++ b/src/Witness_complex/example/CMakeLists.txt
@@ -10,7 +10,7 @@ add_test(NAME Witness_complex_example_nearest_landmark_table
install(TARGETS Witness_complex_example_nearest_landmark_table DESTINATION bin)
# CGAL and Eigen3 are required for Euclidean version of Witness
-if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.6.0)
+if(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
add_executable( Witness_complex_example_off example_witness_complex_off.cpp )
add_executable ( Witness_complex_example_sphere example_witness_complex_sphere.cpp )
@@ -31,4 +31,4 @@ if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.6.0)
install(TARGETS Witness_complex_example_strong_off DESTINATION bin)
-endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.6.0)
+endif(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
diff --git a/src/Witness_complex/example/generators.h b/src/Witness_complex/example/generators.h
index 4b755daa..214cd059 100644
--- a/src/Witness_complex/example/generators.h
+++ b/src/Witness_complex/example/generators.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef GENERATORS_H_
diff --git a/src/Witness_complex/include/gudhi/Active_witness/Active_witness.h b/src/Witness_complex/include/gudhi/Active_witness/Active_witness.h
index 8cb8662b..56b3e808 100644
--- a/src/Witness_complex/include/gudhi/Active_witness/Active_witness.h
+++ b/src/Witness_complex/include/gudhi/Active_witness/Active_witness.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef ACTIVE_WITNESS_ACTIVE_WITNESS_H_
diff --git a/src/Witness_complex/include/gudhi/Active_witness/Active_witness_iterator.h b/src/Witness_complex/include/gudhi/Active_witness/Active_witness_iterator.h
index 10d2ec52..6aa9c0dd 100644
--- a/src/Witness_complex/include/gudhi/Active_witness/Active_witness_iterator.h
+++ b/src/Witness_complex/include/gudhi/Active_witness/Active_witness_iterator.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef ACTIVE_WITNESS_ACTIVE_WITNESS_ITERATOR_H_
diff --git a/src/Witness_complex/include/gudhi/Euclidean_strong_witness_complex.h b/src/Witness_complex/include/gudhi/Euclidean_strong_witness_complex.h
index ea97cd3f..d2bf00ce 100644
--- a/src/Witness_complex/include/gudhi/Euclidean_strong_witness_complex.h
+++ b/src/Witness_complex/include/gudhi/Euclidean_strong_witness_complex.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef EUCLIDEAN_STRONG_WITNESS_COMPLEX_H_
diff --git a/src/Witness_complex/include/gudhi/Euclidean_witness_complex.h b/src/Witness_complex/include/gudhi/Euclidean_witness_complex.h
index 1dacefa5..a4430301 100644
--- a/src/Witness_complex/include/gudhi/Euclidean_witness_complex.h
+++ b/src/Witness_complex/include/gudhi/Euclidean_witness_complex.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef EUCLIDEAN_WITNESS_COMPLEX_H_
diff --git a/src/Witness_complex/include/gudhi/Strong_witness_complex.h b/src/Witness_complex/include/gudhi/Strong_witness_complex.h
index 03d6d2e7..5861ec62 100644
--- a/src/Witness_complex/include/gudhi/Strong_witness_complex.h
+++ b/src/Witness_complex/include/gudhi/Strong_witness_complex.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef STRONG_WITNESS_COMPLEX_H_
diff --git a/src/Witness_complex/include/gudhi/Witness_complex.h b/src/Witness_complex/include/gudhi/Witness_complex.h
index 1f61f8f2..375a79ac 100644
--- a/src/Witness_complex/include/gudhi/Witness_complex.h
+++ b/src/Witness_complex/include/gudhi/Witness_complex.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef WITNESS_COMPLEX_H_
diff --git a/src/Witness_complex/include/gudhi/Witness_complex/all_faces_in.h b/src/Witness_complex/include/gudhi/Witness_complex/all_faces_in.h
index c7b732b9..ae7ad0f3 100644
--- a/src/Witness_complex/include/gudhi/Witness_complex/all_faces_in.h
+++ b/src/Witness_complex/include/gudhi/Witness_complex/all_faces_in.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef WITNESS_COMPLEX_ALL_FACES_IN_H_
diff --git a/src/Witness_complex/test/CMakeLists.txt b/src/Witness_complex/test/CMakeLists.txt
index 58ac60c5..96188e46 100644
--- a/src/Witness_complex/test/CMakeLists.txt
+++ b/src/Witness_complex/test/CMakeLists.txt
@@ -11,7 +11,7 @@ endif(TBB_FOUND)
gudhi_add_coverage_test(Witness_complex_test_simple_witness_complex)
# CGAL and Eigen3 are required for Euclidean version of Witness
-if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.6.0)
+if(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
add_executable ( Witness_complex_test_euclidean_simple_witness_complex test_euclidean_simple_witness_complex.cpp )
target_link_libraries(Witness_complex_test_euclidean_simple_witness_complex ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
if (TBB_FOUND)
@@ -19,4 +19,4 @@ if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.6.0)
endif(TBB_FOUND)
gudhi_add_coverage_test(Witness_complex_test_euclidean_simple_witness_complex)
-endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.6.0)
+endif(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
diff --git a/src/Witness_complex/utilities/CMakeLists.txt b/src/Witness_complex/utilities/CMakeLists.txt
index ce5e29f2..3ee0c2f6 100644
--- a/src/Witness_complex/utilities/CMakeLists.txt
+++ b/src/Witness_complex/utilities/CMakeLists.txt
@@ -1,7 +1,7 @@
project(Witness_complex_utilities)
# CGAL and Eigen3 are required for Euclidean version of Witness
-if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.6.0)
+if(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
add_executable ( Witness_complex_strong_witness_persistence strong_witness_persistence.cpp )
target_link_libraries(Witness_complex_strong_witness_persistence ${Boost_PROGRAM_OPTIONS_LIBRARY})
@@ -24,4 +24,4 @@ if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.6.0)
install(TARGETS Witness_complex_strong_witness_persistence DESTINATION bin)
install(TARGETS Witness_complex_weak_witness_persistence DESTINATION bin)
-endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.6.0)
+endif(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
diff --git a/src/Witness_complex/utilities/strong_witness_persistence.cpp b/src/Witness_complex/utilities/strong_witness_persistence.cpp
index f386e992..a06bb1fa 100644
--- a/src/Witness_complex/utilities/strong_witness_persistence.cpp
+++ b/src/Witness_complex/utilities/strong_witness_persistence.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Simplex_tree.h>
diff --git a/src/Witness_complex/utilities/weak_witness_persistence.cpp b/src/Witness_complex/utilities/weak_witness_persistence.cpp
index ea00cfe7..35d09f95 100644
--- a/src/Witness_complex/utilities/weak_witness_persistence.cpp
+++ b/src/Witness_complex/utilities/weak_witness_persistence.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Simplex_tree.h>
diff --git a/src/cmake/modules/GUDHI_third_party_libraries.cmake b/src/cmake/modules/GUDHI_third_party_libraries.cmake
index 57ea7d14..1dbddfd9 100644
--- a/src/cmake/modules/GUDHI_third_party_libraries.cmake
+++ b/src/cmake/modules/GUDHI_third_party_libraries.cmake
@@ -23,42 +23,16 @@ endif()
# but it implies to use cmake version 3.1 at least.
find_package(CGAL QUIET)
-# Only CGAL versions > 4.4 supports what Gudhi uses from CGAL
-if (CGAL_VERSION VERSION_LESS 4.4.0)
+# Only CGAL versions > 4.11 supports what Gudhi uses from CGAL
+if (CGAL_FOUND AND CGAL_VERSION VERSION_LESS 4.11.0)
message("++ CGAL version ${CGAL_VERSION} is considered too old to be used by Gudhi.")
unset(CGAL_FOUND)
+ unset(CGAL_VERSION)
endif()
+
if(CGAL_FOUND)
message(STATUS "CGAL version: ${CGAL_VERSION}.")
include( ${CGAL_USE_FILE} )
-
- if (NOT CGAL_VERSION VERSION_LESS 4.8.0)
- # HACK to detect CGAL version 4.8.0
- # CGAL version 4.8, 4.8.1 and 4.8.2 are identified as version 4.8.1000)
- # cf. https://github.com/CGAL/cgal/issues/1559
- # Limit the HACK between CGAL versions 4.8 and 4.9 because of file read
- if (NOT CGAL_VERSION VERSION_GREATER 4.9.0)
- foreach(CGAL_INCLUDE_DIR ${CGAL_INCLUDE_DIRS})
- if (EXISTS "${CGAL_INCLUDE_DIR}/CGAL/version.h")
- FILE(READ "${CGAL_INCLUDE_DIR}/CGAL/version.h" contents)
- STRING(REGEX REPLACE "\n" ";" contents "${contents}")
- foreach(Line ${contents})
- if("${Line}" STREQUAL "#define CGAL_VERSION 4.8")
- set(CGAL_VERSION 4.8.0)
- message (">>>>> HACK CGAL version to ${CGAL_VERSION}")
- endif("${Line}" STREQUAL "#define CGAL_VERSION 4.8")
- endforeach(Line ${contents})
- endif (EXISTS "${CGAL_INCLUDE_DIR}/CGAL/version.h")
- endforeach(CGAL_INCLUDE_DIR ${CGAL_INCLUDE_DIRS})
- endif(NOT CGAL_VERSION VERSION_GREATER 4.9.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 ()
- endif()
endif()
option(WITH_GUDHI_USE_TBB "Build with Intel TBB parallelization" ON)
diff --git a/src/cmake/modules/GUDHI_user_version_target.cmake b/src/cmake/modules/GUDHI_user_version_target.cmake
index 2ed48c48..91eee6b5 100644
--- a/src/cmake/modules/GUDHI_user_version_target.cmake
+++ b/src/cmake/modules/GUDHI_user_version_target.cmake
@@ -29,7 +29,7 @@ add_custom_command(TARGET user_version PRE_BUILD COMMAND ${CMAKE_COMMAND} -E
add_custom_command(TARGET user_version PRE_BUILD COMMAND ${CMAKE_COMMAND} -E
copy ${CMAKE_SOURCE_DIR}/README.md ${GUDHI_USER_VERSION_DIR}/README.md)
add_custom_command(TARGET user_version PRE_BUILD COMMAND ${CMAKE_COMMAND} -E
- copy ${CMAKE_SOURCE_DIR}/COPYING ${GUDHI_USER_VERSION_DIR}/COPYING)
+ copy ${CMAKE_SOURCE_DIR}/LICENSE ${GUDHI_USER_VERSION_DIR}/LICENSE)
add_custom_command(TARGET user_version PRE_BUILD COMMAND ${CMAKE_COMMAND} -E
copy ${CMAKE_SOURCE_DIR}/src/CMakeLists.txt ${GUDHI_USER_VERSION_DIR}/CMakeLists.txt)
add_custom_command(TARGET user_version PRE_BUILD COMMAND ${CMAKE_COMMAND} -E
@@ -51,11 +51,8 @@ add_custom_command(TARGET user_version PRE_BUILD COMMAND ${CMAKE_COMMAND} -E
copy_directory ${CMAKE_SOURCE_DIR}/src/GudhUI ${GUDHI_USER_VERSION_DIR}/GudhUI)
set(GUDHI_DIRECTORIES "doc;example;concept;utilities")
-if (CGAL_VERSION VERSION_LESS 4.11.0)
- set(GUDHI_INCLUDE_DIRECTORIES "include/gudhi;include/gudhi_patches")
-else ()
- set(GUDHI_INCLUDE_DIRECTORIES "include/gudhi")
-endif ()
+
+set(GUDHI_INCLUDE_DIRECTORIES "include/gudhi")
foreach(GUDHI_MODULE ${GUDHI_MODULES_FULL_LIST})
foreach(GUDHI_DIRECTORY ${GUDHI_DIRECTORIES})
diff --git a/src/common/benchmark/Graph_simplicial_complex_benchmark.cpp b/src/common/benchmark/Graph_simplicial_complex_benchmark.cpp
index 825d6cb5..a03d1757 100644
--- a/src/common/benchmark/Graph_simplicial_complex_benchmark.cpp
+++ b/src/common/benchmark/Graph_simplicial_complex_benchmark.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/graph_simplicial_complex.h>
diff --git a/src/common/doc/file_formats.h b/src/common/doc/file_formats.h
index 235296d3..4af5d45c 100644
--- a/src/common/doc/file_formats.h
+++ b/src/common/doc/file_formats.h
@@ -1,24 +1,12 @@
-/* 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): Clément Jamin
-*
-* 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/>.
-*/
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ * Author(s): Clément Jamin
+ *
+ * Copyright (C) 2017 Inria
+ *
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
+ */
#ifndef DOC_COMMON_FILE_FORMAT_H_
#define DOC_COMMON_FILE_FORMAT_H_
diff --git a/src/common/doc/footer.html b/src/common/doc/footer.html
index a557922b..4168c6bc 100644
--- a/src/common/doc/footer.html
+++ b/src/common/doc/footer.html
@@ -6,7 +6,7 @@
<!--BEGIN PROJECT_NAME--> $projectname
<!--BEGIN PROJECT_NUMBER-->&#160;Version $projectnumber<!--END PROJECT_NUMBER-->
<!--BEGIN PROJECT_BRIEF-->&#160;-&#160;$projectbrief<!--END PROJECT_BRIEF-->
-<!--BEGIN PROJECT_BRIEF-->&#160;-&#160;Copyright : GPL v3<!--END PROJECT_BRIEF-->
+<!--BEGIN PROJECT_BRIEF-->&#160;-&#160;Copyright : MIT<!--END PROJECT_BRIEF-->
<!--END PROJECT_NAME-->
</td>
<td class="network-entypo">
diff --git a/src/common/doc/installation.h b/src/common/doc/installation.h
index 5d581b08..2629d12c 100644
--- a/src/common/doc/installation.h
+++ b/src/common/doc/installation.h
@@ -64,18 +64,16 @@ make doxygen
* library which provides easy access to efficient and reliable geometric algorithms.
*
* \note There is no need to install CGAL, you can just <CODE>cmake . && make</CODE> CGAL (or even
- * <CODE>cmake -DCGAL_HEADER_ONLY=ON .</CODE> for CGAL version &ge; 4.8.0), thereafter you will be able to compile
+ * <CODE>cmake -DCGAL_HEADER_ONLY=ON .</CODE>), thereafter you will be able to compile
* GUDHI by calling <CODE>cmake -DCGAL_DIR=/your/path/to/CGAL-X.Y .. && make</CODE>
*
- * Having CGAL version 4.4.0 or higher installed is recommended. The procedure to install this library according to
+ * The procedure to install this library according to
* your operating system is detailed here http://doc.cgal.org/latest/Manual/installation.html
*
* The following examples/utilities require the <a target="_blank" href="http://www.cgal.org/">Computational Geometry Algorithms
- * Library</a> (CGAL \cite cgal:eb-15b) and will not be built if CGAL is not installed:
+ * Library</a> (CGAL \cite cgal:eb-15b) and will not be built if CGAL version 4.11.0 or higher is not installed:
* \li <a href="_simplex_tree_2example_alpha_shapes_3_simplex_tree_from_off_file_8cpp-example.html">
* Simplex_tree/example_alpha_shapes_3_simplex_tree_from_off_file.cpp</a>
- *
- * The following examples/utilities require CGAL version &ge; 4.6.0:
* \li <a href="_witness_complex_2strong_witness_persistence_8cpp-example.html">
* Witness_complex/strong_witness_persistence.cpp</a>
* \li <a href="_witness_complex_2weak_witness_persistence_8cpp-example.html">
@@ -86,8 +84,6 @@ make doxygen
* Witness_complex/example_witness_complex_off.cpp</a>
* \li <a href="_witness_complex_2example_witness_complex_sphere_8cpp-example.html">
* Witness_complex/example_witness_complex_sphere.cpp</a>
- *
- * The following example requires CGAL version &ge; 4.7.0:
* \li <a href="_alpha_complex_2_alpha_complex_from_off_8cpp-example.html">
* Alpha_complex/Alpha_complex_from_off.cpp</a>
* \li <a href="_alpha_complex_2_alpha_complex_from_points_8cpp-example.html">
@@ -96,8 +92,6 @@ make doxygen
* Alpha_complex/alpha_complex_persistence.cpp</a>
* \li <a href="_persistent_cohomology_2custom_persistence_sort_8cpp-example.html">
* Persistent_cohomology/custom_persistence_sort.cpp</a>
- *
- * The following example requires CGAL version &ge; 4.8.1:
* \li <a href="_bottleneck_distance_2alpha_rips_persistence_bottleneck_distance_8cpp-example.html">
* Bottleneck_distance/alpha_rips_persistence_bottleneck_distance.cpp.cpp</a>
* \li <a href="_bottleneck_distance_2bottleneck_basic_example_8cpp-example.html">
@@ -126,8 +120,6 @@ make doxygen
* Tangential_complex/example_basic.cpp</a>
* \li <a href="_tangential_complex_2example_with_perturb_8cpp-example.html">
* Tangential_complex/example_with_perturb.cpp</a>
- *
- * The following example requires CGAL version &ge; 4.11.0:
* \li <a href="_alpha_complex_2_weighted_alpha_complex_3d_from_points_8cpp-example.html">
* Alpha_complex/Weighted_alpha_complex_3d_from_points.cpp</a>
* \li <a href="_alpha_complex_2alpha_complex_3d_persistence_8cpp-example.html">
diff --git a/src/common/doc/main_page.md b/src/common/doc/main_page.md
index 98169f82..ea2474be 100644
--- a/src/common/doc/main_page.md
+++ b/src/common/doc/main_page.md
@@ -19,7 +19,7 @@
<td width="15%">
<b>Author:</b> Pawel Dlotko<br>
<b>Introduced in:</b> GUDHI 1.3.0<br>
- <b>Copyright:</b> GPL v3<br>
+ <b>Copyright:</b> MIT<br>
</td>
</tr>
<tr>
@@ -49,10 +49,8 @@
<td width="15%">
<b>Author:</b> Vincent Rouvreau<br>
<b>Introduced in:</b> GUDHI 1.3.0<br>
- <b>Copyright:</b> GPL v3<br>
- <b>Requires:</b> \ref eigen3 and<br>
- \ref cgal &ge; 4.7.0 for Alpha_complex<br>
- \ref cgal &ge; 4.11.0 for Alpha_complex_3d
+ <b>Copyright:</b> MIT [(GPL v3)](../../licensing/)<br>
+ <b>Requires:</b> \ref eigen3 and \ref cgal &ge; 4.11.0
</td>
</tr>
<tr>
@@ -76,7 +74,8 @@
<td width="15%">
<b>Author:</b> Vincent Rouvreau<br>
<b>Introduced in:</b> GUDHI 2.2.0<br>
- <b>Copyright:</b> GPL v3<br>
+ <b>Copyright:</b> MIT [(GPL v3)](../../licensing/)<br>
+ <b>Includes:</b> [Miniball](https://people.inf.ethz.ch/gaertner/subdir/software/miniball.html)<br>
</td>
</tr>
<tr>
@@ -102,7 +101,7 @@
<td width="15%">
<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>
+ <b>Copyright:</b> MIT<br>
</td>
</tr>
<tr>
@@ -126,8 +125,8 @@
<td width="15%">
<b>Author:</b> Siargey Kachanovich<br>
<b>Introduced in:</b> GUDHI 1.3.0<br>
- <b>Copyright:</b> GPL v3<br>
- <b>Euclidean version requires:</b> \ref cgal &ge; 4.6.0 and \ref eigen3
+ <b>Copyright:</b> MIT ([GPL v3](../../licensing/) for Euclidean version)<br>
+ <b>Euclidean version requires:</b> \ref eigen3 and \ref cgal &ge; 4.11.0
</td>
</tr>
<tr>
@@ -152,8 +151,8 @@
<td width="15%">
<b>Author:</b> Mathieu Carri&egrave;re<br>
<b>Introduced in:</b> GUDHI 2.1.0<br>
- <b>Copyright:</b> GPL v3<br>
- <b>Requires:</b> \ref cgal &ge; 4.8.1
+ <b>Copyright:</b> MIT [(GPL v3)](../../licensing/)<br>
+ <b>Requires:</b> \ref cgal &ge; 4.11.0
</td>
</tr>
<tr>
@@ -181,7 +180,7 @@
<td width="15%">
<b>Author:</b> Cl&eacute;ment Maria<br>
<b>Introduced in:</b> GUDHI 1.0.0<br>
- <b>Copyright:</b> GPL v3<br>
+ <b>Copyright:</b> MIT<br>
</td>
</tr>
<tr>
@@ -209,7 +208,7 @@
<td width="15%">
<b>Author:</b> David Salinas<br>
<b>Introduced in:</b> GUDHI 1.1.0<br>
- <b>Copyright:</b> GPL v3<br>
+ <b>Copyright:</b> MIT<br>
</td>
</tr>
<tr>
@@ -234,7 +233,7 @@
<td width="15%">
<b>Author:</b> Fran&ccedil;ois Godi<br>
<b>Introduced in:</b> GUDHI 2.1.0<br>
- <b>Copyright:</b> GPL v3<br>
+ <b>Copyright:</b> MIT<br>
</td>
</tr>
<tr>
@@ -253,17 +252,18 @@
<td width="35%" rowspan=2>
\image html "sphere_contraction_representation.png"
</td>
- <td width="15%">
- <b>Author:</b> David Salinas<br>
- <b>Introduced in:</b> GUDHI 1.1.0<br>
- <b>Copyright:</b> GPL v3<br>
- </td>
<td width="50%">
The purpose of this package is to offer a user-friendly interface for edge contraction simplification of huge
simplicial complexes. It uses the \ref skbl data-structure whose size remains small during simplification of most
used geometrical complexes of topological data analysis such as the Rips or the Delaunay complexes. In practice,
the size of this data-structure is even much lower than the total number of simplices.
</td>
+ <td width="15%">
+ <b>Author:</b> David Salinas<br>
+ <b>Introduced in:</b> GUDHI 1.1.0<br>
+ <b>Copyright:</b> MIT [(LGPL v3)](../../licensing/)<br>
+ <b>Requires:</b> \ref cgal &ge; 4.11.0
+ </td>
</tr>
<tr>
<td colspan=2 height="25">
@@ -294,7 +294,7 @@
<td width="15%">
<b>Author:</b> Cl&eacute;ment Maria<br>
<b>Introduced in:</b> GUDHI 1.0.0<br>
- <b>Copyright:</b> GPL v3<br>
+ <b>Copyright:</b> MIT<br>
</td>
</tr>
<tr>
@@ -323,8 +323,8 @@
<td width="15%">
<b>Author:</b> Cl&eacute;ment Jamin<br>
<b>Introduced in:</b> GUDHI 2.0.0<br>
- <b>Copyright:</b> GPL v3<br>
- <b>Requires:</b> \ref cgal &ge; 4.8.1 and \ref eigen3
+ <b>Copyright:</b> MIT [(GPL v3)](../../licensing/)<br>
+ <b>Requires:</b> \ref eigen3 and \ref cgal &ge; 4.11.0
</td>
</tr>
<tr>
@@ -354,8 +354,8 @@
<td width="15%">
<b>Author:</b> Fran&ccedil;ois Godi<br>
<b>Introduced in:</b> GUDHI 2.0.0<br>
- <b>Copyright:</b> GPL v3<br>
- <b>Requires:</b> \ref cgal &ge; 4.8.1
+ <b>Copyright:</b> MIT [(GPL v3)](../../licensing/)<br>
+ <b>Requires:</b> \ref cgal &ge; 4.11.0
</td>
</tr>
<tr>
@@ -380,7 +380,7 @@
<td width="15%">
<b>Author:</b> Pawel Dlotko<br>
<b>Introduced in:</b> GUDHI 2.1.0<br>
- <b>Copyright:</b> GPL v3<br>
+ <b>Copyright:</b> MIT<br>
</td>
</tr>
<tr>
diff --git a/src/common/example/CMakeLists.txt b/src/common/example/CMakeLists.txt
index 04015cdc..583a0027 100644
--- a/src/common/example/CMakeLists.txt
+++ b/src/common/example/CMakeLists.txt
@@ -6,8 +6,6 @@ file(COPY "${CMAKE_SOURCE_DIR}/data/points/alphacomplexdoc.off" DESTINATION ${CM
add_test(NAME Common_example_vector_double_off_reader COMMAND $<TARGET_FILE:vector_double_off_reader>
"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}/)
@@ -16,21 +14,17 @@ if (DIFF_PATH)
${CMAKE_CURRENT_BINARY_DIR}/vectordoubleoffreader_result.txt ${CMAKE_CURRENT_BINARY_DIR}/alphacomplexdoc.off.txt)
endif()
-if(CGAL_FOUND)
+if(NOT CGAL_VERSION VERSION_LESS 4.11.0)
add_executable ( cgal_3D_off_reader example_CGAL_3D_points_off_reader.cpp )
target_link_libraries(cgal_3D_off_reader ${CGAL_LIBRARY})
add_test(NAME Common_example_vector_cgal_3D_off_reader COMMAND $<TARGET_FILE:cgal_3D_off_reader>
"${CMAKE_SOURCE_DIR}/data/points/tore3D_300.off")
-
- install(TARGETS cgal_3D_off_reader DESTINATION bin)
-
- # need CGAL 4.7 and Eigen3
- if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.7.0)
- add_executable ( cgal_off_reader example_CGAL_points_off_reader.cpp )
- target_link_libraries(cgal_off_reader ${CGAL_LIBRARY})
- add_test(NAME Common_example_vector_cgal_off_reader COMMAND $<TARGET_FILE:cgal_off_reader>
- "${CMAKE_SOURCE_DIR}/data/points/alphacomplexdoc.off")
- install(TARGETS cgal_off_reader DESTINATION bin)
- endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.7.0)
-
endif()
+
+# requires CGAL and Eigen3
+if(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
+ add_executable ( cgal_off_reader example_CGAL_points_off_reader.cpp )
+ target_link_libraries(cgal_off_reader ${CGAL_LIBRARY})
+ add_test(NAME Common_example_vector_cgal_off_reader COMMAND $<TARGET_FILE:cgal_off_reader>
+ "${CMAKE_SOURCE_DIR}/data/points/alphacomplexdoc.off")
+endif(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
diff --git a/src/common/include/gudhi/Clock.h b/src/common/include/gudhi/Clock.h
index cdf18cb2..00ab2f27 100644
--- a/src/common/include/gudhi/Clock.h
+++ b/src/common/include/gudhi/Clock.h
@@ -1,23 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef CLOCK_H_
diff --git a/src/common/include/gudhi/Debug_utils.h b/src/common/include/gudhi/Debug_utils.h
index 3f5cb04f..826cbc3e 100644
--- a/src/common/include/gudhi/Debug_utils.h
+++ b/src/common/include/gudhi/Debug_utils.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef DEBUG_UTILS_H_
#define DEBUG_UTILS_H_
diff --git a/src/common/include/gudhi/Null_output_iterator.h b/src/common/include/gudhi/Null_output_iterator.h
index c700af5f..81309080 100644
--- a/src/common/include/gudhi/Null_output_iterator.h
+++ b/src/common/include/gudhi/Null_output_iterator.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef NULL_OUTPUT_ITERATOR_H_
diff --git a/src/common/include/gudhi/Off_reader.h b/src/common/include/gudhi/Off_reader.h
index fc951fe7..aaff95b8 100644
--- a/src/common/include/gudhi/Off_reader.h
+++ b/src/common/include/gudhi/Off_reader.h
@@ -1,24 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* 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/>.
- *
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
diff --git a/src/common/include/gudhi/Point.h b/src/common/include/gudhi/Point.h
index 345a8465..e85277e9 100644
--- a/src/common/include/gudhi/Point.h
+++ b/src/common/include/gudhi/Point.h
@@ -1,24 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* 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/>.
- *
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef POINT_H_
diff --git a/src/common/include/gudhi/Points_3D_off_io.h b/src/common/include/gudhi/Points_3D_off_io.h
index 704f73a7..2112cc05 100644
--- a/src/common/include/gudhi/Points_3D_off_io.h
+++ b/src/common/include/gudhi/Points_3D_off_io.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef POINTS_3D_OFF_IO_H_
#define POINTS_3D_OFF_IO_H_
diff --git a/src/common/include/gudhi/Points_off_io.h b/src/common/include/gudhi/Points_off_io.h
index 38029658..a0fca77e 100644
--- a/src/common/include/gudhi/Points_off_io.h
+++ b/src/common/include/gudhi/Points_off_io.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef POINTS_OFF_IO_H_
#define POINTS_OFF_IO_H_
diff --git a/src/common/include/gudhi/Simple_object_pool.h b/src/common/include/gudhi/Simple_object_pool.h
index 47283521..164849e1 100644
--- a/src/common/include/gudhi/Simple_object_pool.h
+++ b/src/common/include/gudhi/Simple_object_pool.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef SIMPLE_OBJECT_POOL_H_
diff --git a/src/common/include/gudhi/Unitary_tests_utils.h b/src/common/include/gudhi/Unitary_tests_utils.h
index 22f00212..5ab20af8 100644
--- a/src/common/include/gudhi/Unitary_tests_utils.h
+++ b/src/common/include/gudhi/Unitary_tests_utils.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef UNITARY_TESTS_UTILS_H_
#define UNITARY_TESTS_UTILS_H_
diff --git a/src/common/include/gudhi/allocator.h b/src/common/include/gudhi/allocator.h
index 3de16a49..e828f441 100644
--- a/src/common/include/gudhi/allocator.h
+++ b/src/common/include/gudhi/allocator.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef ALLOCATOR_H_
diff --git a/src/common/include/gudhi/console_color.h b/src/common/include/gudhi/console_color.h
index a493e0d0..7681ae66 100644
--- a/src/common/include/gudhi/console_color.h
+++ b/src/common/include/gudhi/console_color.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef CONSOLE_COLOR_H_
diff --git a/src/common/include/gudhi/distance_functions.h b/src/common/include/gudhi/distance_functions.h
index 5ef12f2e..94cf9ccc 100644
--- a/src/common/include/gudhi/distance_functions.h
+++ b/src/common/include/gudhi/distance_functions.h
@@ -1,23 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* Author(s): Clément Maria
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef DISTANCE_FUNCTIONS_H_
diff --git a/src/common/include/gudhi/graph_simplicial_complex.h b/src/common/include/gudhi/graph_simplicial_complex.h
index 0d81ca71..b8508697 100644
--- a/src/common/include/gudhi/graph_simplicial_complex.h
+++ b/src/common/include/gudhi/graph_simplicial_complex.h
@@ -1,23 +1,11 @@
-/* This file is part of the Gudhi Library. The Gudhi library
- * (Geometric Understanding in Higher Dimensions) is a generic C++
- * library for computational topology.
- *
+/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* Author(s): Clément Maria
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef GRAPH_SIMPLICIAL_COMPLEX_H_
diff --git a/src/common/include/gudhi/random_point_generators.h b/src/common/include/gudhi/random_point_generators.h
index f8107c8b..dbaf0ab1 100644
--- a/src/common/include/gudhi/random_point_generators.h
+++ b/src/common/include/gudhi/random_point_generators.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef RANDOM_POINT_GENERATORS_H_
diff --git a/src/common/include/gudhi/reader_utils.h b/src/common/include/gudhi/reader_utils.h
index 0ee7649d..1365b560 100644
--- a/src/common/include/gudhi/reader_utils.h
+++ b/src/common/include/gudhi/reader_utils.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef READER_UTILS_H_
diff --git a/src/common/include/gudhi/writing_persistence_to_file.h b/src/common/include/gudhi/writing_persistence_to_file.h
index 34448576..c0d4929e 100644
--- a/src/common/include/gudhi/writing_persistence_to_file.h
+++ b/src/common/include/gudhi/writing_persistence_to_file.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef WRITING_PERSISTENCE_TO_FILE_H_
diff --git a/src/common/include/gudhi_patches/Bottleneck_distance_CGAL_patches.txt b/src/common/include/gudhi_patches/Bottleneck_distance_CGAL_patches.txt
deleted file mode 100644
index a588d113..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/Convex_hull.h b/src/common/include/gudhi_patches/CGAL/Convex_hull.h
deleted file mode 100644
index a8f91bf8..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/Delaunay_triangulation.h b/src/common/include/gudhi_patches/CGAL/Delaunay_triangulation.h
deleted file mode 100644
index 071cd184..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/Epeck_d.h b/src/common/include/gudhi_patches/CGAL/Epeck_d.h
deleted file mode 100644
index 52bce84c..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/Epick_d.h b/src/common/include/gudhi_patches/CGAL/Epick_d.h
deleted file mode 100644
index 64438539..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/IO/Triangulation_off_ostream.h b/src/common/include/gudhi_patches/CGAL/IO/Triangulation_off_ostream.h
deleted file mode 100644
index 701f0820..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/Kd_tree.h b/src/common/include/gudhi_patches/CGAL/Kd_tree.h
deleted file mode 100644
index f085b0da..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/Kd_tree_node.h b/src/common/include/gudhi_patches/CGAL/Kd_tree_node.h
deleted file mode 100644
index 909ee260..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_LA_base.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_LA_base.h
deleted file mode 100644
index c13a9801..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_LA_functors.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_LA_functors.h
deleted file mode 100644
index 871c463a..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_base.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_base.h
deleted file mode 100644
index 641bf8ae..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_change_FT.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_change_FT.h
deleted file mode 100644
index e09c72d0..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_complete.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_complete.h
deleted file mode 100644
index ef8921db..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_filter_K.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_filter_K.h
deleted file mode 100644
index 179e97bf..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_filter_NT.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_filter_NT.h
deleted file mode 100644
index c390a55c..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_per_dimension.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_per_dimension.h
deleted file mode 100644
index 179f7319..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_static_filters.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/Cartesian_static_filters.h
deleted file mode 100644
index 693e962a..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/Coaffine.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/Coaffine.h
deleted file mode 100644
index 43015d24..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/Define_kernel_types.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/Define_kernel_types.h
deleted file mode 100644
index 6a40515b..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/Dimension_base.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/Dimension_base.h
deleted file mode 100644
index be875e63..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/Filtered_predicate2.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/Filtered_predicate2.h
deleted file mode 100644
index 1a6a67bc..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/KernelD_converter.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/KernelD_converter.h
deleted file mode 100644
index a8896976..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/Kernel_2_interface.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/Kernel_2_interface.h
deleted file mode 100644
index fa30dff0..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/Kernel_3_interface.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/Kernel_3_interface.h
deleted file mode 100644
index 96076aa8..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/Kernel_d_interface.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/Kernel_d_interface.h
deleted file mode 100644
index dd888005..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/Kernel_object_converter.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/Kernel_object_converter.h
deleted file mode 100644
index 99918ed2..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/LA_eigen/LA.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/LA_eigen/LA.h
deleted file mode 100644
index ddbdc37b..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/LA_eigen/constructors.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/LA_eigen/constructors.h
deleted file mode 100644
index 3636996f..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/Lazy_cartesian.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/Lazy_cartesian.h
deleted file mode 100644
index 9ecc2b63..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/Types/Aff_transformation.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/Types/Aff_transformation.h
deleted file mode 100644
index 6d9f070f..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/Types/Hyperplane.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/Types/Hyperplane.h
deleted file mode 100644
index 14e35b01..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/Types/Iso_box.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/Types/Iso_box.h
deleted file mode 100644
index d053f351..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/Types/Line.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/Types/Line.h
deleted file mode 100644
index 6a09571c..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/Types/Ray.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/Types/Ray.h
deleted file mode 100644
index be845e76..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/Types/Segment.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/Types/Segment.h
deleted file mode 100644
index 38361c2b..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/Types/Sphere.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/Types/Sphere.h
deleted file mode 100644
index 114410b4..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/Types/Weighted_point.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/Types/Weighted_point.h
deleted file mode 100644
index 1caf8701..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/Vector/array.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/Vector/array.h
deleted file mode 100644
index 0ad9bb36..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/Vector/avx4.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/Vector/avx4.h
deleted file mode 100644
index 954a3c1b..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/Vector/determinant_of_iterator_to_points_from_iterator_to_vectors.h b/src/common/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/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/Vector/determinant_of_iterator_to_points_from_points.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/Vector/determinant_of_iterator_to_points_from_points.h
deleted file mode 100644
index 71a31d81..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/Vector/determinant_of_iterator_to_vectors_from_vectors.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/Vector/determinant_of_iterator_to_vectors_from_vectors.h
deleted file mode 100644
index f096d6c7..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/Vector/determinant_of_points_from_vectors.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/Vector/determinant_of_points_from_vectors.h
deleted file mode 100644
index 7ddb73c3..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/Vector/determinant_of_vectors_small_dim.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/Vector/determinant_of_vectors_small_dim.h
deleted file mode 100644
index 64eafe69..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/Vector/determinant_of_vectors_small_dim_internal.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/Vector/determinant_of_vectors_small_dim_internal.h
deleted file mode 100644
index b4856742..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/Vector/mix.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/Vector/mix.h
deleted file mode 100644
index d4cfeeb1..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/Vector/sse2.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/Vector/sse2.h
deleted file mode 100644
index 2a75385c..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/Vector/v2int.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/Vector/v2int.h
deleted file mode 100644
index b85a3734..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/Vector/vector.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/Vector/vector.h
deleted file mode 100644
index f9cc4e3c..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Cartesian_wrap.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Cartesian_wrap.h
deleted file mode 100644
index 44e9aa96..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Hyperplane_d.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Hyperplane_d.h
deleted file mode 100644
index 54fd50bd..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Point_d.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Point_d.h
deleted file mode 100644
index 0718c947..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Ref_count_obj.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Ref_count_obj.h
deleted file mode 100644
index f33e14c0..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Segment_d.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Segment_d.h
deleted file mode 100644
index bfb20a77..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Sphere_d.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Sphere_d.h
deleted file mode 100644
index 87f0c66e..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Vector_d.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Vector_d.h
deleted file mode 100644
index b7d1f0d0..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Weighted_point_d.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/Wrapper/Weighted_point_d.h
deleted file mode 100644
index 877eea21..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/function_objects_cartesian.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/function_objects_cartesian.h
deleted file mode 100644
index 5a132ad2..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/functor_properties.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/functor_properties.h
deleted file mode 100644
index c25c4e2b..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/functor_tags.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/functor_tags.h
deleted file mode 100644
index b8e17886..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/static_int.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/static_int.h
deleted file mode 100644
index 21858804..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/store_kernel.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/store_kernel.h
deleted file mode 100644
index 253e1282..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/NewKernel_d/utils.h b/src/common/include/gudhi_patches/CGAL/NewKernel_d/utils.h
deleted file mode 100644
index 238a2230..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/Orthogonal_incremental_neighbor_search.h b/src/common/include/gudhi_patches/CGAL/Orthogonal_incremental_neighbor_search.h
deleted file mode 100644
index e29ce14f..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/Regular_triangulation.h b/src/common/include/gudhi_patches/CGAL/Regular_triangulation.h
deleted file mode 100644
index 111c6ac9..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/Regular_triangulation_traits_adapter.h b/src/common/include/gudhi_patches/CGAL/Regular_triangulation_traits_adapter.h
deleted file mode 100644
index 78bb95a6..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/TDS_full_cell_default_storage_policy.h b/src/common/include/gudhi_patches/CGAL/TDS_full_cell_default_storage_policy.h
deleted file mode 100644
index 9a6030e5..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/TDS_full_cell_mirror_storage_policy.h b/src/common/include/gudhi_patches/CGAL/TDS_full_cell_mirror_storage_policy.h
deleted file mode 100644
index 095dfe68..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/Triangulation.h b/src/common/include/gudhi_patches/CGAL/Triangulation.h
deleted file mode 100644
index 906df92e..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/Triangulation_data_structure.h b/src/common/include/gudhi_patches/CGAL/Triangulation_data_structure.h
deleted file mode 100644
index 2493c712..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/Triangulation_ds_full_cell.h b/src/common/include/gudhi_patches/CGAL/Triangulation_ds_full_cell.h
deleted file mode 100644
index 541a6a85..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/Triangulation_ds_vertex.h b/src/common/include/gudhi_patches/CGAL/Triangulation_ds_vertex.h
deleted file mode 100644
index 381b97e1..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/Triangulation_face.h b/src/common/include/gudhi_patches/CGAL/Triangulation_face.h
deleted file mode 100644
index bc9c1781..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/Triangulation_full_cell.h b/src/common/include/gudhi_patches/CGAL/Triangulation_full_cell.h
deleted file mode 100644
index a0c5246f..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/Triangulation_vertex.h b/src/common/include/gudhi_patches/CGAL/Triangulation_vertex.h
deleted file mode 100644
index f364717f..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/argument_swaps.h b/src/common/include/gudhi_patches/CGAL/argument_swaps.h
deleted file mode 100644
index aa16f29b..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/determinant_of_vectors.h b/src/common/include/gudhi_patches/CGAL/determinant_of_vectors.h
deleted file mode 100644
index e1bad64e..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/internal/Combination_enumerator.h b/src/common/include/gudhi_patches/CGAL/internal/Combination_enumerator.h
deleted file mode 100644
index f411e827..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/internal/Static_or_dynamic_array.h b/src/common/include/gudhi_patches/CGAL/internal/Static_or_dynamic_array.h
deleted file mode 100644
index ee6195d9..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/internal/Triangulation/Dummy_TDS.h b/src/common/include/gudhi_patches/CGAL/internal/Triangulation/Dummy_TDS.h
deleted file mode 100644
index b3a0ec98..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/internal/Triangulation/Triangulation_ds_iterators.h b/src/common/include/gudhi_patches/CGAL/internal/Triangulation/Triangulation_ds_iterators.h
deleted file mode 100644
index 7e360026..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/internal/Triangulation/utilities.h b/src/common/include/gudhi_patches/CGAL/internal/Triangulation/utilities.h
deleted file mode 100644
index a1ffc775..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/iterator_from_indices.h b/src/common/include/gudhi_patches/CGAL/iterator_from_indices.h
deleted file mode 100644
index 110bb4be..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/transforming_iterator.h b/src/common/include/gudhi_patches/CGAL/transforming_iterator.h
deleted file mode 100644
index 15ea19a5..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/transforming_pair_iterator.h b/src/common/include/gudhi_patches/CGAL/transforming_pair_iterator.h
deleted file mode 100644
index 48dac132..00000000
--- a/src/common/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/src/common/include/gudhi_patches/CGAL/typeset.h b/src/common/include/gudhi_patches/CGAL/typeset.h
deleted file mode 100644
index d4e24281..00000000
--- a/src/common/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/src/common/include/gudhi_patches/Tangential_complex_CGAL_patches.txt b/src/common/include/gudhi_patches/Tangential_complex_CGAL_patches.txt
deleted file mode 100644
index 5b9581a0..00000000
--- a/src/common/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/src/common/test/test_distance_matrix_reader.cpp b/src/common/test/test_distance_matrix_reader.cpp
index 6fee86e2..c25b2f53 100644
--- a/src/common/test/test_distance_matrix_reader.cpp
+++ b/src/common/test/test_distance_matrix_reader.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/reader_utils.h>
diff --git a/src/common/test/test_persistence_intervals_reader.cpp b/src/common/test/test_persistence_intervals_reader.cpp
index b7ece9bd..0d0f515e 100644
--- a/src/common/test/test_persistence_intervals_reader.cpp
+++ b/src/common/test/test_persistence_intervals_reader.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/reader_utils.h>
diff --git a/src/common/test/test_points_off_reader.cpp b/src/common/test/test_points_off_reader.cpp
index e4b76ed7..49fa1ec2 100644
--- a/src/common/test/test_points_off_reader.cpp
+++ b/src/common/test/test_points_off_reader.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/Points_off_io.h>
diff --git a/src/common/utilities/CMakeLists.txt b/src/common/utilities/CMakeLists.txt
index 7f1d1cd7..3dcfe84d 100644
--- a/src/common/utilities/CMakeLists.txt
+++ b/src/common/utilities/CMakeLists.txt
@@ -1,6 +1,6 @@
project(off_file_from_shape_generator)
-if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.6.0)
+if(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
add_executable ( off_file_from_shape_generator off_file_from_shape_generator.cpp )
add_test(NAME off_file_from_shape_generator_on_sphere_1000_3_15.2 COMMAND $<TARGET_FILE:off_file_from_shape_generator>
"on" "sphere" "onSphere.off" "1000" "3" "15.2")
@@ -13,4 +13,4 @@ if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.6.0)
install(TARGETS off_file_from_shape_generator DESTINATION bin)
-endif(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.6.0)
+endif(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
diff --git a/src/common/utilities/off_file_from_shape_generator.cpp b/src/common/utilities/off_file_from_shape_generator.cpp
index 5e3da7f7..eb31e8bc 100644
--- a/src/common/utilities/off_file_from_shape_generator.cpp
+++ b/src/common/utilities/off_file_from_shape_generator.cpp
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#include <gudhi/random_point_generators.h>
diff --git a/src/cython/CMakeLists.txt b/src/cython/CMakeLists.txt
index d4ace20e..509a122e 100644
--- a/src/cython/CMakeLists.txt
+++ b/src/cython/CMakeLists.txt
@@ -91,7 +91,7 @@ if(PYTHONINTERP_FOUND)
set(GUDHI_CYTHON_EXTRA_COMPILE_ARGS "${GUDHI_CYTHON_EXTRA_COMPILE_ARGS}'-DCGAL_EIGEN3_ENABLED', ")
endif (EIGEN3_FOUND)
- if (NOT CGAL_VERSION VERSION_LESS 4.8.1)
+ if (NOT CGAL_VERSION VERSION_LESS 4.11.0)
set(GUDHI_CYTHON_BOTTLENECK_DISTANCE "include '${CMAKE_CURRENT_SOURCE_DIR}/cython/bottleneck_distance.pyx'")
set(GUDHI_CYTHON_MODULES "${GUDHI_CYTHON_MODULES}bottleneck_distance;")
set(GUDHI_CYTHON_NERVE_GIC "include '${CMAKE_CURRENT_SOURCE_DIR}/cython/nerve_gic.pyx'")
@@ -100,7 +100,7 @@ if(PYTHONINTERP_FOUND)
set(GUDHI_CYTHON_MISSING_MODULES "${GUDHI_CYTHON_MISSING_MODULES}bottleneck_distance;")
set(GUDHI_CYTHON_MISSING_MODULES "${GUDHI_CYTHON_MISSING_MODULES}nerve_gic;")
endif ()
- if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1)
+ if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
set(GUDHI_CYTHON_SUBSAMPLING "include '${CMAKE_CURRENT_SOURCE_DIR}/cython/subsampling.pyx'")
set(GUDHI_CYTHON_MODULES "${GUDHI_CYTHON_MODULES}subsampling;")
set(GUDHI_CYTHON_TANGENTIAL_COMPLEX "include '${CMAKE_CURRENT_SOURCE_DIR}/cython/tangential_complex.pyx'")
@@ -109,13 +109,13 @@ if(PYTHONINTERP_FOUND)
set(GUDHI_CYTHON_MISSING_MODULES "${GUDHI_CYTHON_MISSING_MODULES}subsampling;")
set(GUDHI_CYTHON_MISSING_MODULES "${GUDHI_CYTHON_MISSING_MODULES}tangential_complex;")
endif ()
- if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.7.0)
+ if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
set(GUDHI_CYTHON_ALPHA_COMPLEX "include '${CMAKE_CURRENT_SOURCE_DIR}/cython/alpha_complex.pyx'")
set(GUDHI_CYTHON_MODULES "${GUDHI_CYTHON_MODULES}alpha_complex;")
else()
set(GUDHI_CYTHON_MISSING_MODULES "${GUDHI_CYTHON_MISSING_MODULES}alpha_complex;")
endif ()
- if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.6.0)
+ if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
set(GUDHI_CYTHON_EUCLIDEAN_WITNESS_COMPLEX
"include '${CMAKE_CURRENT_SOURCE_DIR}/cython/euclidean_witness_complex.pyx'\ninclude '${CMAKE_CURRENT_SOURCE_DIR}/cython/euclidean_strong_witness_complex.pyx'\n")
set(GUDHI_CYTHON_MODULES "${GUDHI_CYTHON_MODULES}euclidean_witness_complex;")
@@ -224,7 +224,7 @@ if(PYTHONINTERP_FOUND)
install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/setup.py install)")
# Test examples
- if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1)
+ if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
# Bottleneck and Alpha
add_test(NAME alpha_rips_persistence_bottleneck_distance_py_test
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
@@ -259,8 +259,8 @@ if(PYTHONINTERP_FOUND)
# Subsampling
add_gudhi_py_test(test_subsampling)
- endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1)
- if (NOT CGAL_VERSION VERSION_LESS 4.8.1)
+ endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
+ if (NOT CGAL_VERSION VERSION_LESS 4.11.0)
# Bottleneck
add_test(NAME bottleneck_basic_example_py_test
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
@@ -299,9 +299,9 @@ if(PYTHONINTERP_FOUND)
-f human.off -n 700 -v)
add_gudhi_py_test(test_cover_complex)
- endif (NOT CGAL_VERSION VERSION_LESS 4.8.1)
+ endif (NOT CGAL_VERSION VERSION_LESS 4.11.0)
- if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.7.0)
+ if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
# Alpha
add_test(NAME alpha_complex_from_points_example_py_test
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
@@ -318,13 +318,13 @@ if(PYTHONINTERP_FOUND)
add_gudhi_py_test(test_alpha_complex)
- endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.7.0)
+ endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
- if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.6.0)
+ if (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
# Euclidean witness
add_gudhi_py_test(test_euclidean_witness_complex)
- endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.6.0)
+ endif (NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
# Cubical
add_test(NAME periodic_cubical_complex_barcode_persistence_from_perseus_file_example_py_test
@@ -389,7 +389,7 @@ if(PYTHONINTERP_FOUND)
if(MATPLOTLIB_FOUND)
if(NUMPY_FOUND)
if(SCIPY_FOUND)
- if(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1)
+ if(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
set (GUDHI_SPHINX_MESSAGE "Generating API documentation with Sphinx in ${CMAKE_CURRENT_BINARY_DIR}/sphinx/")
# User warning - Sphinx is a static pages generator, and configured to work fine with user_version
# Images and biblio warnings because not found on developper version
@@ -411,10 +411,10 @@ if(PYTHONINTERP_FOUND)
# Set missing or not modules
set(GUDHI_MODULES ${GUDHI_MODULES} "python-documentation" CACHE INTERNAL "GUDHI_MODULES")
- else(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1)
- message("++ Python documentation module will not be compiled because it requires a CGAL with Eigen3 version greater or equal than 4.8.1")
+ else(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
+ message("++ Python documentation module will not be compiled because it requires a Eigen3 and CGAL version >= 4.11.0")
set(GUDHI_MISSING_MODULES ${GUDHI_MISSING_MODULES} "python-documentation" CACHE INTERNAL "GUDHI_MISSING_MODULES")
- endif(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.8.1)
+ endif(NOT CGAL_WITH_EIGEN3_VERSION VERSION_LESS 4.11.0)
else(SCIPY_FOUND)
message("++ Python documentation module will not be compiled because scipy was not found")
set(GUDHI_MISSING_MODULES ${GUDHI_MISSING_MODULES} "python-documentation" CACHE INTERNAL "GUDHI_MISSING_MODULES")
diff --git a/src/cython/cython/alpha_complex.pyx b/src/cython/cython/alpha_complex.pyx
index 4f772e31..26cde0a1 100644
--- a/src/cython/cython/alpha_complex.pyx
+++ b/src/cython/cython/alpha_complex.pyx
@@ -5,26 +5,14 @@ from libcpp.string cimport string
from libcpp cimport bool
import os
-"""This file is part of the Gudhi Library. The Gudhi library
- (Geometric Understanding in Higher Dimensions) is a generic C++
- library for computational topology.
+""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ Author(s): Vincent Rouvreau
- 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
- 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/>.
+ Modification(s):
+ - YYYY/MM Author: Description of the modification
"""
__author__ = "Vincent Rouvreau"
@@ -111,7 +99,9 @@ cdef class AlphaComplex:
def create_simplex_tree(self, max_alpha_square=float('inf')):
"""
:param max_alpha_square: The maximum alpha square threshold the
- simplices shall not exceed. Default is set to infinity.
+ simplices shall not exceed. Default is set to infinity, and
+ there is very little point using anything else since it does
+ not save time.
:type max_alpha_square: float
:returns: A simplex tree created from the Delaunay Triangulation.
:rtype: SimplexTree
diff --git a/src/cython/cython/bottleneck_distance.pyx b/src/cython/cython/bottleneck_distance.pyx
index 76ef81f4..4b378cbc 100644
--- a/src/cython/cython/bottleneck_distance.pyx
+++ b/src/cython/cython/bottleneck_distance.pyx
@@ -3,26 +3,14 @@ from libcpp.vector cimport vector
from libcpp.utility cimport pair
import os
-"""This file is part of the Gudhi Library. The Gudhi library
- (Geometric Understanding in Higher Dimensions) is a generic C++
- library for computational topology.
+""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ Author(s): Vincent Rouvreau
- 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
- 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/>.
+ Modification(s):
+ - YYYY/MM Author: Description of the modification
"""
__author__ = "Vincent Rouvreau"
diff --git a/src/cython/cython/cubical_complex.pyx b/src/cython/cython/cubical_complex.pyx
index 509af6ca..0dc133d1 100644
--- a/src/cython/cython/cubical_complex.pyx
+++ b/src/cython/cython/cubical_complex.pyx
@@ -7,31 +7,19 @@ import os
from numpy import array as np_array
-"""This file is part of the Gudhi Library. The Gudhi library
- (Geometric Understanding in Higher Dimensions) is a generic C++
- library for computational topology.
+""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ Author(s): Vincent Rouvreau
- 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
- 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/>.
+ Modification(s):
+ - YYYY/MM Author: Description of the modification
"""
__author__ = "Vincent Rouvreau"
__copyright__ = "Copyright (C) 2016 Inria"
-__license__ = "GPL v3"
+__license__ = "MIT"
cdef extern from "Cubical_complex_interface.h" namespace "Gudhi":
cdef cppclass Bitmap_cubical_complex_base_interface "Gudhi::Cubical_complex::Cubical_complex_interface<>":
diff --git a/src/cython/cython/euclidean_strong_witness_complex.pyx b/src/cython/cython/euclidean_strong_witness_complex.pyx
index 62b7cf71..26bd8375 100644
--- a/src/cython/cython/euclidean_strong_witness_complex.pyx
+++ b/src/cython/cython/euclidean_strong_witness_complex.pyx
@@ -2,26 +2,14 @@ from cython cimport numeric
from libcpp.vector cimport vector
from libcpp.utility cimport pair
-"""This file is part of the Gudhi Library. The Gudhi library
- (Geometric Understanding in Higher Dimensions) is a generic C++
- library for computational topology.
+""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ Author(s): Vincent Rouvreau
- 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
- 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/>.
+ Modification(s):
+ - YYYY/MM Author: Description of the modification
"""
__author__ = "Vincent Rouvreau"
diff --git a/src/cython/cython/euclidean_witness_complex.pyx b/src/cython/cython/euclidean_witness_complex.pyx
index c10ca73d..e687c6f3 100644
--- a/src/cython/cython/euclidean_witness_complex.pyx
+++ b/src/cython/cython/euclidean_witness_complex.pyx
@@ -2,26 +2,14 @@ from cython cimport numeric
from libcpp.vector cimport vector
from libcpp.utility cimport pair
-"""This file is part of the Gudhi Library. The Gudhi library
- (Geometric Understanding in Higher Dimensions) is a generic C++
- library for computational topology.
+""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ Author(s): Vincent Rouvreau
- 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
- 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/>.
+ Modification(s):
+ - YYYY/MM Author: Description of the modification
"""
__author__ = "Vincent Rouvreau"
diff --git a/src/cython/cython/nerve_gic.pyx b/src/cython/cython/nerve_gic.pyx
index 5f01b379..3c8f1200 100644
--- a/src/cython/cython/nerve_gic.pyx
+++ b/src/cython/cython/nerve_gic.pyx
@@ -5,26 +5,14 @@ from libcpp.string cimport string
from libcpp cimport bool
import os
-"""This file is part of the Gudhi Library. The Gudhi library
- (Geometric Understanding in Higher Dimensions) is a generic C++
- library for computational topology.
+""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ Author(s): Vincent Rouvreau
- Author(s): Vincent Rouvreau
+ Copyright (C) 2018 Inria
- 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/>.
+ Modification(s):
+ - YYYY/MM Author: Description of the modification
"""
__author__ = "Vincent Rouvreau"
diff --git a/src/cython/cython/off_reader.pyx b/src/cython/cython/off_reader.pyx
index b939013f..9efd97ff 100644
--- a/src/cython/cython/off_reader.pyx
+++ b/src/cython/cython/off_reader.pyx
@@ -3,31 +3,19 @@ from libcpp.vector cimport vector
from libcpp.string cimport string
import os
-"""This file is part of the Gudhi Library. The Gudhi library
- (Geometric Understanding in Higher Dimensions) is a generic C++
- library for computational topology.
+""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ Author(s): Vincent Rouvreau
- 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
- 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/>.
+ Modification(s):
+ - YYYY/MM Author: Description of the modification
"""
__author__ = "Vincent Rouvreau"
__copyright__ = "Copyright (C) 2016 Inria"
-__license__ = "GPL v3"
+__license__ = "MIT"
cdef extern from "Off_reader_interface.h" namespace "Gudhi":
vector[vector[double]] read_points_from_OFF_file(string off_file)
diff --git a/src/cython/cython/periodic_cubical_complex.pyx b/src/cython/cython/periodic_cubical_complex.pyx
index 3866f53b..724fadd4 100644
--- a/src/cython/cython/periodic_cubical_complex.pyx
+++ b/src/cython/cython/periodic_cubical_complex.pyx
@@ -7,31 +7,19 @@ import os
from numpy import array as np_array
-"""This file is part of the Gudhi Library. The Gudhi library
- (Geometric Understanding in Higher Dimensions) is a generic C++
- library for computational topology.
+""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ Author(s): Vincent Rouvreau
- Author(s): Vincent Rouvreau
+ Copyright (C) 2016 Inria
- Copyright (C) 2019 Inria
-
- This 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/>.
+ Modification(s):
+ - YYYY/MM Author: Description of the modification
"""
__author__ = "Vincent Rouvreau"
__copyright__ = "Copyright (C) 2016 Inria"
-__license__ = "GPL v3"
+__license__ = "MIT"
cdef extern from "Cubical_complex_interface.h" namespace "Gudhi":
cdef cppclass Periodic_cubical_complex_base_interface "Gudhi::Cubical_complex::Cubical_complex_interface<Gudhi::cubical_complex::Bitmap_cubical_complex_periodic_boundary_conditions_base<double>>":
diff --git a/src/cython/cython/persistence_graphical_tools.py b/src/cython/cython/persistence_graphical_tools.py
index 7bb69840..34803222 100644
--- a/src/cython/cython/persistence_graphical_tools.py
+++ b/src/cython/cython/persistence_graphical_tools.py
@@ -2,33 +2,22 @@ from os import path
from math import isfinite
import numpy as np
-"""This file is part of the Gudhi Library. The Gudhi library
- (Geometric Understanding in Higher Dimensions) is a generic C++
- library for computational topology.
+""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ Author(s): Vincent Rouvreau, Bertrand Michel
- Author(s): Vincent Rouvreau, Bertrand Michel
+ Copyright (C) 2016 Inria
- Copyright (C) 2019 Inria
-
- This 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/>.
+ Modification(s):
+ - YYYY/MM Author: Description of the modification
"""
__author__ = "Vincent Rouvreau, Bertrand Michel"
__copyright__ = "Copyright (C) 2016 Inria"
-__license__ = "GPL v3"
+__license__ = "MIT"
-def __min_birth_max_death(persistence, band=0.):
+
+def __min_birth_max_death(persistence, band=0.0):
"""This function returns (min_birth, max_death) from the persistence.
:param persistence: The persistence to plot.
@@ -41,27 +30,47 @@ def __min_birth_max_death(persistence, band=0.):
max_death = 0
min_birth = persistence[0][1][0]
for interval in reversed(persistence):
- if float(interval[1][1]) != float('inf'):
+ if float(interval[1][1]) != float("inf"):
if float(interval[1][1]) > max_death:
max_death = float(interval[1][1])
if float(interval[1][0]) > max_death:
max_death = float(interval[1][0])
if float(interval[1][0]) < min_birth:
min_birth = float(interval[1][0])
- if band > 0.:
+ if band > 0.0:
max_death += band
return (min_birth, max_death)
+
"""
Only 13 colors for the palette
"""
-palette = ['#ff0000', '#00ff00', '#0000ff', '#00ffff', '#ff00ff', '#ffff00',
- '#000000', '#880000', '#008800', '#000088', '#888800', '#880088',
- '#008888']
-
-def plot_persistence_barcode(persistence=[], persistence_file='', alpha=0.6,
- max_intervals=1000, max_barcodes=1000,
- inf_delta=0.1, legend=False):
+palette = [
+ "#ff0000",
+ "#00ff00",
+ "#0000ff",
+ "#00ffff",
+ "#ff00ff",
+ "#ffff00",
+ "#000000",
+ "#880000",
+ "#008800",
+ "#000088",
+ "#888800",
+ "#880088",
+ "#008888",
+]
+
+
+def plot_persistence_barcode(
+ persistence=[],
+ persistence_file="",
+ alpha=0.6,
+ max_intervals=1000,
+ 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>`.
@@ -90,11 +99,13 @@ def plot_persistence_barcode(persistence=[], persistence_file='', alpha=0.6,
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
- if persistence_file is not '':
+ if persistence_file is not "":
if path.isfile(persistence_file):
# Reset persistence
persistence = []
- diag = read_persistence_intervals_grouped_by_dimension(persistence_file=persistence_file)
+ diag = read_persistence_intervals_grouped_by_dimension(
+ persistence_file=persistence_file
+ )
for key in diag.keys():
for persistence_interval in diag[key]:
persistence.append((key, persistence_interval))
@@ -103,44 +114,62 @@ def plot_persistence_barcode(persistence=[], persistence_file='', alpha=0.6,
return None
if max_barcodes is not 1000:
- print('Deprecated parameter. It has been replaced by max_intervals')
+ print("Deprecated parameter. It has been replaced by max_intervals")
max_intervals = max_barcodes
if max_intervals > 0 and max_intervals < len(persistence):
# Sort by life time, then takes only the max_intervals elements
- persistence = sorted(persistence, key=lambda life_time: life_time[1][1]-life_time[1][0], reverse=True)[:max_intervals]
+ persistence = sorted(
+ persistence,
+ key=lambda life_time: life_time[1][1] - life_time[1][0],
+ reverse=True,
+ )[:max_intervals]
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) * inf_delta)
+ 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
axis_start = min_birth - delta
# Draw horizontal bars in loop
for interval in reversed(persistence):
- if float(interval[1][1]) != float('inf'):
+ if float(interval[1][1]) != float("inf"):
# 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]],
- linewidth=0)
+ plt.barh(
+ ind,
+ (interval[1][1] - interval[1][0]),
+ height=0.8,
+ left=interval[1][0],
+ alpha=alpha,
+ 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]],
- linewidth=0)
+ plt.barh(
+ ind,
+ (infinity - interval[1][0]),
+ height=0.8,
+ left=interval[1][0],
+ alpha=alpha,
+ 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')
+ 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
@@ -148,8 +177,17 @@ def plot_persistence_barcode(persistence=[], persistence_file='', alpha=0.6,
except ImportError:
print("This function is not available, you may be missing matplotlib.")
-def plot_persistence_diagram(persistence=[], persistence_file='', alpha=0.6,
- band=0., max_intervals=1000, max_plots=1000, inf_delta=0.1, legend=False):
+
+def plot_persistence_diagram(
+ persistence=[],
+ persistence_file="",
+ alpha=0.6,
+ band=0.0,
+ max_intervals=1000,
+ 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>`.
@@ -180,11 +218,13 @@ def plot_persistence_diagram(persistence=[], persistence_file='', alpha=0.6,
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
- if persistence_file is not '':
+ if persistence_file is not "":
if path.isfile(persistence_file):
# Reset persistence
persistence = []
- diag = read_persistence_intervals_grouped_by_dimension(persistence_file=persistence_file)
+ diag = read_persistence_intervals_grouped_by_dimension(
+ persistence_file=persistence_file
+ )
for key in diag.keys():
for persistence_interval in diag[key]:
persistence.append((key, persistence_interval))
@@ -193,15 +233,19 @@ def plot_persistence_diagram(persistence=[], persistence_file='', alpha=0.6,
return None
if max_plots is not 1000:
- print('Deprecated parameter. It has been replaced by max_intervals')
+ print("Deprecated parameter. It has been replaced by max_intervals")
max_intervals = max_plots
if max_intervals > 0 and max_intervals < len(persistence):
# Sort by life time, then takes only the max_intervals elements
- persistence = sorted(persistence, key=lambda life_time: life_time[1][1]-life_time[1][0], reverse=True)[:max_intervals]
+ persistence = sorted(
+ persistence,
+ key=lambda life_time: life_time[1][1] - life_time[1][0],
+ reverse=True,
+ )[:max_intervals]
(min_birth, max_death) = __min_birth_max_death(persistence, band)
- delta = ((max_death - min_birth) * inf_delta)
+ delta = (max_death - min_birth) * inf_delta
# Replace infinity values with max_death + delta for diagram to be more
# readable
infinity = max_death + delta
@@ -210,31 +254,41 @@ def plot_persistence_diagram(persistence=[], persistence_file='', alpha=0.6,
# line display of equation : birth = death
x = np.linspace(axis_start, infinity, 1000)
# infinity line and text
- plt.plot(x, x, color='k', linewidth=1.0)
- plt.plot(x, [infinity] * len(x), linewidth=1.0, color='k', alpha=alpha)
- plt.text(axis_start, infinity, r'$\infty$', color='k', alpha=alpha)
+ plt.plot(x, x, color="k", linewidth=1.0)
+ 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 > 0.:
- plt.fill_between(x, x, x+band, alpha=alpha, facecolor='red')
+ if band > 0.0:
+ plt.fill_between(x, x, x + band, alpha=alpha, facecolor="red")
# Draw points in loop
for interval in reversed(persistence):
- if float(interval[1][1]) != float('inf'):
+ if float(interval[1][1]) != float("inf"):
# Finite death case
- plt.scatter(interval[1][0], interval[1][1], alpha=alpha,
- color = palette[interval[0]])
+ plt.scatter(
+ interval[1][0],
+ interval[1][1],
+ alpha=alpha,
+ color=palette[interval[0]],
+ )
else:
# Infinite death case for diagram to be nicer
- plt.scatter(interval[1][0], infinity, alpha=alpha,
- color = palette[interval[0]])
+ plt.scatter(
+ interval[1][0], infinity, alpha=alpha, color=palette[interval[0]]
+ )
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')
+ 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")
# Ends plot on infinity value and starts a little bit before min_birth
plt.axis([axis_start, infinity, axis_start, infinity + delta])
return plt
@@ -242,10 +296,17 @@ def plot_persistence_diagram(persistence=[], persistence_file='', alpha=0.6,
except ImportError:
print("This function is not available, you may be missing matplotlib.")
-def plot_persistence_density(persistence=[], persistence_file='',
- nbins=300, bw_method=None,
- max_intervals=1000, dimension=None,
- cmap=None, legend=False):
+
+def plot_persistence_density(
+ persistence=[],
+ persistence_file="",
+ nbins=300,
+ bw_method=None,
+ max_intervals=1000,
+ dimension=None,
+ cmap=None,
+ legend=False,
+):
"""This function plots the persistence density from persistence
values list or from a :doc:`persistence file <fileformats>`. Be
aware that this function does not distinguish the dimension, it is
@@ -290,39 +351,53 @@ def plot_persistence_density(persistence=[], persistence_file='',
import matplotlib.pyplot as plt
from scipy.stats import kde
- if persistence_file is not '':
+ if persistence_file is not "":
if dimension is None:
# All dimension case
dimension = -1
if path.isfile(persistence_file):
- persistence_dim = read_persistence_intervals_in_dimension(persistence_file=persistence_file,
- only_this_dim=dimension)
+ persistence_dim = read_persistence_intervals_in_dimension(
+ persistence_file=persistence_file, only_this_dim=dimension
+ )
print(persistence_dim)
else:
print("file " + persistence_file + " not found.")
return None
if len(persistence) > 0:
- persistence_dim = np.array([(dim_interval[1][0], dim_interval[1][1]) for dim_interval in persistence if (dim_interval[0] == dimension) or (dimension is None)])
-
- persistence_dim = persistence_dim[np.isfinite(persistence_dim[:,1])]
+ persistence_dim = np.array(
+ [
+ (dim_interval[1][0], dim_interval[1][1])
+ for dim_interval in persistence
+ if (dim_interval[0] == dimension) or (dimension is None)
+ ]
+ )
+
+ persistence_dim = persistence_dim[np.isfinite(persistence_dim[:, 1])]
if max_intervals > 0 and max_intervals < len(persistence_dim):
# Sort by life time, then takes only the max_intervals elements
- persistence_dim = np.array(sorted(persistence_dim,
- key=lambda life_time: life_time[1]-life_time[0],
- reverse=True)[:max_intervals])
+ persistence_dim = np.array(
+ sorted(
+ persistence_dim,
+ key=lambda life_time: life_time[1] - life_time[0],
+ reverse=True,
+ )[:max_intervals]
+ )
# Set as numpy array birth and death (remove undefined values - inf and NaN)
- birth = persistence_dim[:,0]
- death = persistence_dim[:,1]
+ birth = persistence_dim[:, 0]
+ death = persistence_dim[:, 1]
# line display of equation : birth = death
x = np.linspace(death.min(), birth.max(), 1000)
- plt.plot(x, x, color='k', linewidth=1.0)
+ plt.plot(x, x, color="k", linewidth=1.0)
# Evaluate a gaussian kde on a regular grid of nbins x nbins over data extents
- k = kde.gaussian_kde([birth,death], bw_method=bw_method)
- xi, yi = np.mgrid[birth.min():birth.max():nbins*1j, death.min():death.max():nbins*1j]
+ k = kde.gaussian_kde([birth, death], bw_method=bw_method)
+ xi, yi = np.mgrid[
+ birth.min() : birth.max() : nbins * 1j,
+ death.min() : death.max() : nbins * 1j,
+ ]
zi = k(np.vstack([xi.flatten(), yi.flatten()]))
# default cmap value cannot be done at argument definition level as matplotlib is not yet defined.
@@ -334,10 +409,12 @@ def plot_persistence_density(persistence=[], persistence_file='',
if legend:
plt.colorbar()
- plt.title('Persistence density')
- plt.xlabel('Birth')
- plt.ylabel('Death')
+ plt.title("Persistence density")
+ plt.xlabel("Birth")
+ plt.ylabel("Death")
return plt
except ImportError:
- print("This function is not available, you may be missing matplotlib and/or scipy.")
+ print(
+ "This function is not available, you may be missing matplotlib and/or scipy."
+ )
diff --git a/src/cython/cython/reader_utils.pyx b/src/cython/cython/reader_utils.pyx
index 6dde5286..147fae71 100644
--- a/src/cython/cython/reader_utils.pyx
+++ b/src/cython/cython/reader_utils.pyx
@@ -7,31 +7,19 @@ from libcpp.pair cimport pair
from os import path
from numpy import array as np_array
-"""This file is part of the Gudhi Library. The Gudhi library
- (Geometric Understanding in Higher Dimensions) is a generic C++
- library for computational topology.
+""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ Author(s): Vincent Rouvreau
- Author(s): Vincent Rouvreau
+ Copyright (C) 2017 Inria
- Copyright (C) 2019 Inria
-
- This 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/>.
+ Modification(s):
+ - YYYY/MM Author: Description of the modification
"""
__author__ = "Vincent Rouvreau"
__copyright__ = "Copyright (C) 2017 Inria"
-__license__ = "GPL v3"
+__license__ = "MIT"
cdef extern from "Reader_utils_interface.h" namespace "Gudhi":
vector[vector[double]] read_matrix_from_csv_file(string off_file, char separator)
diff --git a/src/cython/cython/rips_complex.pyx b/src/cython/cython/rips_complex.pyx
index 7c83241c..b9a2331f 100644
--- a/src/cython/cython/rips_complex.pyx
+++ b/src/cython/cython/rips_complex.pyx
@@ -5,31 +5,19 @@ from libcpp.string cimport string
from libcpp cimport bool
import os
-"""This file is part of the Gudhi Library. The Gudhi library
- (Geometric Understanding in Higher Dimensions) is a generic C++
- library for computational topology.
+""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ Author(s): Vincent Rouvreau
- 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
- 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/>.
+ Modification(s):
+ - YYYY/MM Author: Description of the modification
"""
__author__ = "Vincent Rouvreau"
__copyright__ = "Copyright (C) 2016 Inria"
-__license__ = "GPL v3"
+__license__ = "MIT"
cdef extern from "Rips_complex_interface.h" namespace "Gudhi":
cdef cppclass Rips_complex_interface "Gudhi::rips_complex::Rips_complex_interface":
diff --git a/src/cython/cython/simplex_tree.pyx b/src/cython/cython/simplex_tree.pyx
index 43bc11c9..8e791c17 100644
--- a/src/cython/cython/simplex_tree.pyx
+++ b/src/cython/cython/simplex_tree.pyx
@@ -6,31 +6,19 @@ from libcpp.string cimport string
from numpy import array as np_array
-"""This file is part of the Gudhi Library. The Gudhi library
- (Geometric Understanding in Higher Dimensions) is a generic C++
- library for computational topology.
+""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ Author(s): Vincent Rouvreau
- Author(s): Vincent Rouvreau
+ Copyright (C) 2016 Inria
- Copyright (C) 2019 Inria
-
- This 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/>.
+ Modification(s):
+ - YYYY/MM Author: Description of the modification
"""
__author__ = "Vincent Rouvreau"
__copyright__ = "Copyright (C) 2016 Inria"
-__license__ = "GPL v3"
+__license__ = "MIT"
cdef extern from "Simplex_tree_interface.h" namespace "Gudhi":
cdef cppclass Simplex_tree_options_full_featured:
diff --git a/src/cython/cython/strong_witness_complex.pyx b/src/cython/cython/strong_witness_complex.pyx
index 4b7bff34..8c155815 100644
--- a/src/cython/cython/strong_witness_complex.pyx
+++ b/src/cython/cython/strong_witness_complex.pyx
@@ -2,31 +2,19 @@ from cython cimport numeric
from libcpp.vector cimport vector
from libcpp.utility cimport pair
-"""This file is part of the Gudhi Library. The Gudhi library
- (Geometric Understanding in Higher Dimensions) is a generic C++
- library for computational topology.
+""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ Author(s): Vincent Rouvreau
- 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
- 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/>.
+ Modification(s):
+ - YYYY/MM Author: Description of the modification
"""
__author__ = "Vincent Rouvreau"
__copyright__ = "Copyright (C) 2016 Inria"
-__license__ = "GPL v3"
+__license__ = "MIT"
cdef extern from "Strong_witness_complex_interface.h" namespace "Gudhi":
cdef cppclass Strong_witness_complex_interface "Gudhi::witness_complex::Strong_witness_complex_interface":
diff --git a/src/cython/cython/subsampling.pyx b/src/cython/cython/subsampling.pyx
index e9d61a37..1135c1fb 100644
--- a/src/cython/cython/subsampling.pyx
+++ b/src/cython/cython/subsampling.pyx
@@ -4,26 +4,14 @@ from libcpp.string cimport string
from libcpp cimport bool
import os
-"""This file is part of the Gudhi Library. The Gudhi library
- (Geometric Understanding in Higher Dimensions) is a generic C++
- library for computational topology.
+""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ Author(s): Vincent Rouvreau
- 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
- 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/>.
+ Modification(s):
+ - YYYY/MM Author: Description of the modification
"""
__author__ = "Vincent Rouvreau"
diff --git a/src/cython/cython/tangential_complex.pyx b/src/cython/cython/tangential_complex.pyx
index 293ef8cb..00a84810 100644
--- a/src/cython/cython/tangential_complex.pyx
+++ b/src/cython/cython/tangential_complex.pyx
@@ -5,26 +5,14 @@ from libcpp.string cimport string
from libcpp cimport bool
import os
-"""This file is part of the Gudhi Library. The Gudhi library
- (Geometric Understanding in Higher Dimensions) is a generic C++
- library for computational topology.
+""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ Author(s): Vincent Rouvreau
- 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
- 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/>.
+ Modification(s):
+ - YYYY/MM Author: Description of the modification
"""
__author__ = "Vincent Rouvreau"
diff --git a/src/cython/cython/witness_complex.pyx b/src/cython/cython/witness_complex.pyx
index b1cce83f..91046f57 100644
--- a/src/cython/cython/witness_complex.pyx
+++ b/src/cython/cython/witness_complex.pyx
@@ -2,31 +2,19 @@ from cython cimport numeric
from libcpp.vector cimport vector
from libcpp.utility cimport pair
-"""This file is part of the Gudhi Library. The Gudhi library
- (Geometric Understanding in Higher Dimensions) is a generic C++
- library for computational topology.
+""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ Author(s): Vincent Rouvreau
- 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
- 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/>.
+ Modification(s):
+ - YYYY/MM Author: Description of the modification
"""
__author__ = "Vincent Rouvreau"
__copyright__ = "Copyright (C) 2016 Inria"
-__license__ = "GPL v3"
+__license__ = "MIT"
cdef extern from "Witness_complex_interface.h" namespace "Gudhi":
cdef cppclass Witness_complex_interface "Gudhi::witness_complex::Witness_complex_interface":
diff --git a/src/cython/doc/alpha_complex_sum.inc b/src/cython/doc/alpha_complex_sum.inc
index 806988bb..9049e654 100644
--- a/src/cython/doc/alpha_complex_sum.inc
+++ b/src/cython/doc/alpha_complex_sum.inc
@@ -1,20 +1,20 @@
.. table::
:widths: 30 50 20
- +----------------------------------------------------------------+------------------------------------------------------------------------+-----------------------------------------------+
- | .. figure:: | Alpha complex is a simplicial complex constructed from the finite | :Author: Vincent Rouvreau |
- | ../../doc/Alpha_complex/alpha_complex_representation.png | cells of a Delaunay Triangulation. | |
- | :alt: Alpha complex representation | | :Introduced in: GUDHI 2.0.0 |
- | :figclass: align-center | The filtration value of each simplex is computed as the square of the | |
- | | circumradius of the simplex if the circumsphere is empty (the simplex | :Copyright: GPL v3 |
- | | is then said to be Gabriel), and as the minimum of the filtration | |
- | | values of the codimension 1 cofaces that make it not Gabriel | :Requires: Eigen3 and CGAL :math:`\geq` 4.7.0 |
- | | otherwise. All simplices that have a filtration value strictly | |
- | | greater than a given alpha squared value are not inserted into the | |
- | | complex. | |
- | | | |
- | | This package requires having CGAL version 4.7 or higher (4.8.1 is | |
- | | advised for better performance). | |
- +----------------------------------------------------------------+------------------------------------------------------------------------+-----------------------------------------------+
- | * :doc:`alpha_complex_user` | * :doc:`alpha_complex_ref` |
- +----------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+
+ +----------------------------------------------------------------+------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
+ | .. figure:: | Alpha complex is a simplicial complex constructed from the finite | :Author: Vincent Rouvreau |
+ | ../../doc/Alpha_complex/alpha_complex_representation.png | cells of a Delaunay Triangulation. | |
+ | :alt: Alpha complex representation | | :Introduced in: GUDHI 2.0.0 |
+ | :figclass: align-center | The filtration value of each simplex is computed as the square of the | |
+ | | circumradius of the simplex if the circumsphere is empty (the simplex | :Copyright: MIT (`GPL v3 </licensing/>`_) |
+ | | is then said to be Gabriel), and as the minimum of the filtration | |
+ | | values of the codimension 1 cofaces that make it not Gabriel | :Requires: `Eigen3 <installation.html#eigen3>`__ and `CGAL <installation.html#cgal>`__ :math:`\geq` 4.11.0 |
+ | | otherwise. All simplices that have a filtration value strictly | |
+ | | greater than a given alpha squared value are not inserted into the | |
+ | | complex. | |
+ | | | |
+ | | This package requires having CGAL version 4.7 or higher (4.8.1 is | |
+ | | advised for better performance). | |
+ +----------------------------------------------------------------+------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
+ | * :doc:`alpha_complex_user` | * :doc:`alpha_complex_ref` |
+ +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
diff --git a/src/cython/doc/bottleneck_distance_sum.inc b/src/cython/doc/bottleneck_distance_sum.inc
index 6840e838..6eb0ac19 100644
--- a/src/cython/doc/bottleneck_distance_sum.inc
+++ b/src/cython/doc/bottleneck_distance_sum.inc
@@ -1,14 +1,14 @@
.. table::
:widths: 30 50 20
- +-----------------------------------------------------------------+----------------------------------------------------------------------+-----------------------------------------------+
- | .. figure:: | Bottleneck distance measures the similarity between two persistence | :Author: François Godi |
- | ../../doc/Bottleneck_distance/perturb_pd.png | diagrams. It's the shortest distance b for which there exists a | |
- | :figclass: align-center | perfect matching between the points of the two diagrams (+ all the | :Introduced in: GUDHI 2.0.0 |
- | | diagonal points) such that any couple of matched points are at | |
- | Bottleneck distance is the length of | distance at most b, where the distance between points is the sup | :Copyright: GPL v3 |
- | the longest edge | norm in :math:`\mathbb{R}^2`. | |
- | | | :Requires: CGAL :math:`\geq` 4.8.0 |
- +-----------------------------------------------------------------+----------------------------------------------------------------------+-----------------------------------------------+
- | * :doc:`bottleneck_distance_user` | |
- +-----------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+
+ +-----------------------------------------------------------------+----------------------------------------------------------------------+------------------------------------------------------------------+
+ | .. figure:: | Bottleneck distance measures the similarity between two persistence | :Author: François Godi |
+ | ../../doc/Bottleneck_distance/perturb_pd.png | diagrams. It's the shortest distance b for which there exists a | |
+ | :figclass: align-center | perfect matching between the points of the two diagrams (+ all the | :Introduced in: GUDHI 2.0.0 |
+ | | diagonal points) such that any couple of matched points are at | |
+ | Bottleneck distance is the length of | distance at most b, where the distance between points is the sup | :Copyright: MIT (`GPL v3 </licensing/>`_) |
+ | the longest edge | norm in :math:`\mathbb{R}^2`. | |
+ | | | :Requires: `CGAL <installation.html#cgal>`__ :math:`\geq` 4.11.0 |
+ +-----------------------------------------------------------------+----------------------------------------------------------------------+------------------------------------------------------------------+
+ | * :doc:`bottleneck_distance_user` | |
+ +-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+
diff --git a/src/cython/doc/conf.py b/src/cython/doc/conf.py
index ce08f679..e4c718c3 100755
--- a/src/cython/doc/conf.py
+++ b/src/cython/doc/conf.py
@@ -62,7 +62,7 @@ import gudhi
# General information about the project.
project = gudhi.__name__
-copyright = gudhi.__copyright__ + ' - ' + gudhi.__license__
+copyright = gudhi.__copyright__ + ' - MIT'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
diff --git a/src/cython/doc/cubical_complex_sum.inc b/src/cython/doc/cubical_complex_sum.inc
index 6dcf8e48..f200e695 100644
--- a/src/cython/doc/cubical_complex_sum.inc
+++ b/src/cython/doc/cubical_complex_sum.inc
@@ -6,7 +6,7 @@
| ../../doc/Bitmap_cubical_complex/Cubical_complex_representation.png | computational mathematics (specially rigorous numerics) and image | |
| :alt: Cubical complex representation | analysis. | :Introduced in: GUDHI 2.0.0 |
| :figclass: align-center | | |
- | | | :Copyright: GPL v3 |
+ | | | :Copyright: MIT |
| | | |
+--------------------------------------------------------------------------+----------------------------------------------------------------------+-----------------------------+
| * :doc:`cubical_complex_user` | * :doc:`cubical_complex_ref` |
diff --git a/src/cython/doc/installation.rst b/src/cython/doc/installation.rst
index 855dea44..02b889d0 100644
--- a/src/cython/doc/installation.rst
+++ b/src/cython/doc/installation.rst
@@ -151,29 +151,18 @@ The :doc:`Alpha complex </alpha_complex_user>`,
C++ library which provides easy access to efficient and reliable geometric
algorithms.
-Having CGAL, the Computational Geometry Algorithms Library, version 4.7.0 or
-higher installed is recommended. The procedure to install this library
+The procedure to install this library
according to your operating system is detailed
`here <http://doc.cgal.org/latest/Manual/installation.html>`_.
-The following examples requires CGAL version ≥ 4.7.0:
+The following examples requires CGAL version ≥ 4.11.0:
.. only:: builder_html
* :download:`alpha_complex_diagram_persistence_from_off_file_example.py <../example/alpha_complex_diagram_persistence_from_off_file_example.py>`
* :download:`alpha_complex_from_points_example.py <../example/alpha_complex_from_points_example.py>`
-
-The following examples requires CGAL version ≥ 4.8.0:
-
-.. only:: builder_html
-
* :download:`bottleneck_basic_example.py <../example/bottleneck_basic_example.py>`
* :download:`tangential_complex_plain_homology_from_off_file_example.py <../example/tangential_complex_plain_homology_from_off_file_example.py>`
-
-The following examples requires CGAL version ≥ 4.8.1:
-
-.. only:: builder_html
-
* :download:`euclidean_strong_witness_complex_diagram_persistence_from_off_file_example.py <../example/euclidean_strong_witness_complex_diagram_persistence_from_off_file_example.py>`
* :download:`euclidean_witness_complex_diagram_persistence_from_off_file_example.py <../example/euclidean_witness_complex_diagram_persistence_from_off_file_example.py>`
diff --git a/src/cython/doc/nerve_gic_complex_sum.inc b/src/cython/doc/nerve_gic_complex_sum.inc
index 0e606fe1..d633c4ff 100644
--- a/src/cython/doc/nerve_gic_complex_sum.inc
+++ b/src/cython/doc/nerve_gic_complex_sum.inc
@@ -1,16 +1,16 @@
.. table::
:widths: 30 50 20
- +----------------------------------------------------------------+------------------------------------------------------------------------+------------------------------------+
- | .. figure:: | Nerves and Graph Induced Complexes are cover complexes, i.e. | :Author: Mathieu Carrière |
- | ../../doc/Nerve_GIC/gicvisu.jpg | simplicial complexes that provably contain topological information | |
- | :alt: Graph Induced Complex of a point cloud. | about the input data. They can be computed with a cover of the data, | :Introduced in: GUDHI 2.3.0 |
- | :figclass: align-center | that comes i.e. from the preimage of a family of intervals covering | |
- | | the image of a scalar-valued function defined on the data. | :Copyright: GPL v3 |
- | | | |
- | | | :Requires: CGAL :math:`\geq` 4.8.1 |
- | | | |
- | | | |
- +----------------------------------------------------------------+------------------------------------------------------------------------+------------------------------------+
- | * :doc:`nerve_gic_complex_user` | * :doc:`nerve_gic_complex_ref` |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+
+ +----------------------------------------------------------------+------------------------------------------------------------------------+------------------------------------------------------------------+
+ | .. figure:: | Nerves and Graph Induced Complexes are cover complexes, i.e. | :Author: Mathieu Carrière |
+ | ../../doc/Nerve_GIC/gicvisu.jpg | simplicial complexes that provably contain topological information | |
+ | :alt: Graph Induced Complex of a point cloud. | about the input data. They can be computed with a cover of the data, | :Introduced in: GUDHI 2.3.0 |
+ | :figclass: align-center | that comes i.e. from the preimage of a family of intervals covering | |
+ | | the image of a scalar-valued function defined on the data. | :Copyright: MIT (`GPL v3 </licensing/>`_) |
+ | | | |
+ | | | :Requires: `CGAL <installation.html#cgal>`__ :math:`\geq` 4.11.0 |
+ | | | |
+ | | | |
+ +----------------------------------------------------------------+------------------------------------------------------------------------+------------------------------------------------------------------+
+ | * :doc:`nerve_gic_complex_user` | * :doc:`nerve_gic_complex_ref` |
+ +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+
diff --git a/src/cython/doc/persistence_graphical_tools_sum.inc b/src/cython/doc/persistence_graphical_tools_sum.inc
index b412de56..0cdf8072 100644
--- a/src/cython/doc/persistence_graphical_tools_sum.inc
+++ b/src/cython/doc/persistence_graphical_tools_sum.inc
@@ -6,7 +6,7 @@
| img/graphical_tools_representation.png | the user to build easily persistence barcode, diagram or density. | |
| | | :Introduced in: GUDHI 2.0.0 |
| | | |
- | | | :Copyright: GPL v3 |
+ | | | :Copyright: MIT |
| | | |
| | | :Requires: matplotlib, numpy and scipy |
+-----------------------------------------------------------------+-----------------------------------------------------------------------+-----------------------------------------------+
diff --git a/src/cython/doc/persistent_cohomology_sum.inc b/src/cython/doc/persistent_cohomology_sum.inc
index 20ca073c..4d7b077e 100644
--- a/src/cython/doc/persistent_cohomology_sum.inc
+++ b/src/cython/doc/persistent_cohomology_sum.inc
@@ -6,7 +6,7 @@
| ../../doc/Persistent_cohomology/3DTorus_poch.png | a sequence of (homology) groups, capturing global topological | |
| :figclass: align-center | features like connected components, holes, cavities, etc. Persistent | :Introduced in: GUDHI 2.0.0 |
| | homology studies the evolution -- birth, life and death -- of these | |
- | Rips Persistent Cohomology on a 3D | features when the topological space is changing. Consequently, the | :Copyright: GPL v3 |
+ | Rips Persistent Cohomology on a 3D | features when the topological space is changing. Consequently, the | :Copyright: MIT |
| Torus | theory is essentially composed of three elements: topological spaces, | |
| | their homology groups and an evolution scheme. | |
| | | |
diff --git a/src/cython/doc/rips_complex_sum.inc b/src/cython/doc/rips_complex_sum.inc
index e8e505e2..857c6893 100644
--- a/src/cython/doc/rips_complex_sum.inc
+++ b/src/cython/doc/rips_complex_sum.inc
@@ -6,7 +6,7 @@
| ../../doc/Rips_complex/rips_complex_representation.png | graph. | |
| :figclass: align-center | | :Introduced in: GUDHI 2.0.0 |
| | The filtration value of each edge is computed from a user-given | |
- | | distance function and is inserted until a user-given threshold | :Copyright: GPL v3 |
+ | | distance function and is inserted until a user-given threshold | :Copyright: MIT |
| | value. | |
| | | |
| | This complex can be built from a point cloud and a distance function, | |
diff --git a/src/cython/doc/simplex_tree_sum.inc b/src/cython/doc/simplex_tree_sum.inc
index 086c69d5..5ba58d2b 100644
--- a/src/cython/doc/simplex_tree_sum.inc
+++ b/src/cython/doc/simplex_tree_sum.inc
@@ -6,7 +6,7 @@
| ../../doc/Simplex_tree/Simplex_tree_representation.png | representing general (filtered) simplicial complexes. | |
| :alt: Simplex tree representation | | :Introduced in: GUDHI 2.0.0 |
| :figclass: align-center | The data structure is described in | |
- | | :cite:`boissonnatmariasimplextreealgorithmica` | :Copyright: GPL v3 |
+ | | :cite:`boissonnatmariasimplextreealgorithmica` | :Copyright: MIT |
| | | |
+----------------------------------------------------------------+------------------------------------------------------------------------+-----------------------------+
| * :doc:`simplex_tree_user` | * :doc:`simplex_tree_ref` |
diff --git a/src/cython/doc/tangential_complex_sum.inc b/src/cython/doc/tangential_complex_sum.inc
index 0f03ffb3..c8bc1177 100644
--- a/src/cython/doc/tangential_complex_sum.inc
+++ b/src/cython/doc/tangential_complex_sum.inc
@@ -1,14 +1,14 @@
.. table::
:widths: 30 50 20
- +----------------------------------------------------------------+------------------------------------------------------------------------+------------------------------------+
- | .. figure:: | A Tangential Delaunay complex is a simplicial complex designed to | :Author: Clément Jamin |
- | ../../doc/Tangential_complex/tc_examples.png | reconstruct a :math:`k`-dimensional manifold embedded in :math:`d`- | |
- | :figclass: align-center | dimensional Euclidean space. The input is a point sample coming from | :Introduced in: GUDHI 2.0.0 |
- | | an unknown manifold. The running time depends only linearly on the | |
- | | extrinsic dimension :math:`d` and exponentially on the intrinsic | :Copyright: GPL v3 |
- | | dimension :math:`k`. | |
- | | | :Requires: CGAL :math:`\geq` 4.8.0 |
- +----------------------------------------------------------------+------------------------------------------------------------------------+------------------------------------+
- | * :doc:`tangential_complex_user` | * :doc:`tangential_complex_ref` |
- +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------+
+ +----------------------------------------------------------------+------------------------------------------------------------------------+------------------------------------------------------------------+
+ | .. figure:: | A Tangential Delaunay complex is a simplicial complex designed to | :Author: Clément Jamin |
+ | ../../doc/Tangential_complex/tc_examples.png | reconstruct a :math:`k`-dimensional manifold embedded in :math:`d`- | |
+ | :figclass: align-center | dimensional Euclidean space. The input is a point sample coming from | :Introduced in: GUDHI 2.0.0 |
+ | | an unknown manifold. The running time depends only linearly on the | |
+ | | extrinsic dimension :math:`d` and exponentially on the intrinsic | :Copyright: MIT (`GPL v3 </licensing/>`_) |
+ | | dimension :math:`k`. | |
+ | | | :Requires: `CGAL <installation.html#cgal>`__ :math:`\geq` 4.11.0 |
+ +----------------------------------------------------------------+------------------------------------------------------------------------+------------------------------------------------------------------+
+ | * :doc:`tangential_complex_user` | * :doc:`tangential_complex_ref` |
+ +----------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+
diff --git a/src/cython/doc/witness_complex_sum.inc b/src/cython/doc/witness_complex_sum.inc
index 49577745..2be8b220 100644
--- a/src/cython/doc/witness_complex_sum.inc
+++ b/src/cython/doc/witness_complex_sum.inc
@@ -1,17 +1,18 @@
.. table::
:widths: 30 50 20
- +-------------------------------------------------------------------+----------------------------------------------------------------------+-----------------------------------------------------------------------------+
- | .. figure:: | Witness complex :math:`Wit(W,L)` is a simplicial complex defined on | :Author: Siargey Kachanovich |
- | ../../doc/Witness_complex/Witness_complex_representation.png | two sets of points in :math:`\mathbb{R}^D`. | |
- | :alt: Witness complex representation | | :Introduced in: GUDHI 2.0.0 |
- | :figclass: align-center | The data structure is described in | |
- | | :cite:`boissonnatmariasimplextreealgorithmica`. | :Copyright: GPL v3 |
- | | | |
- | | | :Requires: Eigen3 and CGAL :math:`\geq` 4.6.0 for Euclidean versions only |
- +-------------------------------------------------------------------+----------------------------------------------------------------------+-----------------------------------------------------------------------------+
- | * :doc:`witness_complex_user` | * :doc:`witness_complex_ref` |
- | | * :doc:`strong_witness_complex_ref` |
- | | * :doc:`euclidean_witness_complex_ref` |
- | | * :doc:`euclidean_strong_witness_complex_ref` |
- +-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+
+ +-------------------------------------------------------------------+----------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
+ | .. figure:: | Witness complex :math:`Wit(W,L)` is a simplicial complex defined on | :Author: Siargey Kachanovich |
+ | ../../doc/Witness_complex/Witness_complex_representation.png | two sets of points in :math:`\mathbb{R}^D`. | |
+ | :alt: Witness complex representation | | :Introduced in: GUDHI 2.0.0 |
+ | :figclass: align-center | The data structure is described in | |
+ | | :cite:`boissonnatmariasimplextreealgorithmica`. | :Copyright: MIT (`GPL v3 </licensing/>`_ for Euclidean versions only) |
+ | | | |
+ | | | :Requires: `Eigen3 <installation.html#eigen3>`__ and `CGAL <installation.html#cgal>`__ :math:`\geq` 4.11.0 for Euclidean versions only |
+ +-------------------------------------------------------------------+----------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
+ | * :doc:`witness_complex_user` | * :doc:`witness_complex_ref` |
+ | | * :doc:`strong_witness_complex_ref` |
+ | | * :doc:`euclidean_witness_complex_ref` |
+ | | * :doc:`euclidean_strong_witness_complex_ref` |
+ +-------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+
diff --git a/src/cython/example/alpha_complex_diagram_persistence_from_off_file_example.py b/src/cython/example/alpha_complex_diagram_persistence_from_off_file_example.py
index 4abe22d4..b8f283b3 100755
--- a/src/cython/example/alpha_complex_diagram_persistence_from_off_file_example.py
+++ b/src/cython/example/alpha_complex_diagram_persistence_from_off_file_example.py
@@ -3,66 +3,62 @@
import gudhi
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.
+""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ Author(s): Vincent Rouvreau
- 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
- 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/>.
+ Modification(s):
+ - YYYY/MM Author: Description of the modification
"""
__author__ = "Vincent Rouvreau"
__copyright__ = "Copyright (C) 2016 Inria"
-__license__ = "GPL v3"
+__license__ = "MIT"
-parser = argparse.ArgumentParser(description='AlphaComplex creation from '
- 'points read in a OFF file.',
- epilog='Example: '
- 'example/alpha_complex_diagram_persistence_from_off_file_example.py '
- '-f ../data/points/tore3D_300.off -a 0.6'
- '- Constructs a alpha complex with the '
- 'points from the given OFF file.')
+parser = argparse.ArgumentParser(
+ description="AlphaComplex creation from " "points read in a OFF file.",
+ epilog="Example: "
+ "example/alpha_complex_diagram_persistence_from_off_file_example.py "
+ "-f ../data/points/tore3D_300.off -a 0.6"
+ "- Constructs a alpha complex with the "
+ "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", type=float, default=0.)
-parser.add_argument('--no-diagram', default=False, action='store_true' , help='Flag for not to display the diagrams')
+parser.add_argument("-b", "--band", type=float, default=0.0)
+parser.add_argument(
+ "--no-diagram",
+ default=False,
+ action="store_true",
+ help="Flag for not to display the diagrams",
+)
args = parser.parse_args()
-with open(args.file, 'r') as f:
+with open(args.file, "r") as f:
first_line = f.readline()
- if (first_line == 'OFF\n') or (first_line == 'nOFF\n'):
+ if (first_line == "OFF\n") or (first_line == "nOFF\n"):
print("#####################################################################")
print("AlphaComplex creation from points read in a OFF file")
-
+
message = "AlphaComplex with max_edge_length=" + repr(args.max_alpha_square)
print(message)
-
+
alpha_complex = gudhi.AlphaComplex(off_file=args.file)
- simplex_tree = alpha_complex.create_simplex_tree(max_alpha_square=args.max_alpha_square)
-
+ simplex_tree = alpha_complex.create_simplex_tree(
+ max_alpha_square=args.max_alpha_square
+ )
+
message = "Number of simplices=" + repr(simplex_tree.num_simplices())
print(message)
-
+
diag = simplex_tree.persistence()
-
+
print("betti_numbers()=")
print(simplex_tree.betti_numbers())
-
+
if args.no_diagram == False:
pplot = gudhi.plot_persistence_diagram(diag, band=args.band)
pplot.show()
diff --git a/src/cython/example/alpha_complex_from_points_example.py b/src/cython/example/alpha_complex_from_points_example.py
index ad73c744..a746998c 100755
--- a/src/cython/example/alpha_complex_from_points_example.py
+++ b/src/cython/example/alpha_complex_from_points_example.py
@@ -2,31 +2,19 @@
from gudhi import AlphaComplex, SimplexTree
-"""This file is part of the Gudhi Library. The Gudhi library
- (Geometric Understanding in Higher Dimensions) is a generic C++
- library for computational topology.
+""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ Author(s): Vincent Rouvreau
- 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
- 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/>.
+ Modification(s):
+ - YYYY/MM Author: Description of the modification
"""
__author__ = "Vincent Rouvreau"
__copyright__ = "Copyright (C) 2016 Inria"
-__license__ = "GPL v3"
+__license__ = "MIT"
print("#####################################################################")
print("AlphaComplex creation from points")
diff --git a/src/cython/example/alpha_rips_persistence_bottleneck_distance.py b/src/cython/example/alpha_rips_persistence_bottleneck_distance.py
index b51fa7a8..086307ee 100755
--- a/src/cython/example/alpha_rips_persistence_bottleneck_distance.py
+++ b/src/cython/example/alpha_rips_persistence_bottleneck_distance.py
@@ -4,47 +4,37 @@ import gudhi
import argparse
import math
-"""This file is part of the Gudhi Library. The Gudhi library
- (Geometric Understanding in Higher Dimensions) is a generic C++
- library for computational topology.
+""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ Author(s): Vincent Rouvreau
- 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
- 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/>.
+ Modification(s):
+ - YYYY/MM Author: Description of the modification
"""
__author__ = "Vincent Rouvreau"
__copyright__ = "Copyright (C) 2016 Inria"
-__license__ = "GPL v3"
-
-parser = argparse.ArgumentParser(description='AlphaComplex and RipsComplex '
- 'persistence creation from points read in '
- 'a OFF file. Bottleneck distance computation'
- ' on each dimension',
- epilog='Example: '
- 'example/alpha_rips_persistence_bottleneck_distance.py '
- '-f ../data/points/tore3D_1307.off -t 0.15 -d 3')
+__license__ = "MIT"
+
+parser = argparse.ArgumentParser(
+ description="AlphaComplex and RipsComplex "
+ "persistence creation from points read in "
+ "a OFF file. Bottleneck distance computation"
+ " on each dimension",
+ epilog="Example: "
+ "example/alpha_rips_persistence_bottleneck_distance.py "
+ "-f ../data/points/tore3D_1307.off -t 0.15 -d 3",
+)
parser.add_argument("-f", "--file", type=str, required=True)
parser.add_argument("-t", "--threshold", type=float, default=0.5)
parser.add_argument("-d", "--max_dimension", type=int, default=1)
args = parser.parse_args()
-with open(args.file, 'r') as f:
+with open(args.file, "r") as f:
first_line = f.readline()
- if (first_line == 'OFF\n') or (first_line == 'nOFF\n'):
+ 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")
@@ -52,8 +42,9 @@ with open(args.file, 'r') as f:
message = "RipsComplex with max_edge_length=" + repr(args.threshold)
print(message)
- rips_complex = gudhi.RipsComplex(points=point_cloud,
- max_edge_length=args.threshold)
+ rips_complex = gudhi.RipsComplex(
+ points=point_cloud, max_edge_length=args.threshold
+ )
rips_stree = rips_complex.create_simplex_tree(max_dimension=args.max_dimension)
@@ -69,7 +60,9 @@ with open(args.file, 'r') as f:
print(message)
alpha_complex = gudhi.AlphaComplex(points=point_cloud)
- alpha_stree = alpha_complex.create_simplex_tree(max_alpha_square=(args.threshold * args.threshold))
+ alpha_stree = alpha_complex.create_simplex_tree(
+ max_alpha_square=(args.threshold * args.threshold)
+ )
message = "Number of simplices=" + repr(alpha_stree.num_simplices())
print(message)
@@ -83,15 +76,26 @@ with open(args.file, 'r') as f:
funcs = [math.sqrt, math.sqrt]
alpha_intervals = []
for interval in alpha_stree.persistence_intervals_in_dimension(dim):
- alpha_intervals.append(map(lambda func,value: func(value), funcs, interval))
+ alpha_intervals.append(
+ map(lambda func, value: func(value), funcs, interval)
+ )
rips_intervals = rips_stree.persistence_intervals_in_dimension(dim)
- bottleneck_distance = gudhi.bottleneck_distance(rips_intervals, alpha_intervals)
- message = "In dimension " + repr(dim) + ", bottleneck distance = " + repr(bottleneck_distance)
+ bottleneck_distance = gudhi.bottleneck_distance(
+ rips_intervals, alpha_intervals
+ )
+ message = (
+ "In dimension "
+ + repr(dim)
+ + ", bottleneck distance = "
+ + repr(bottleneck_distance)
+ )
print(message)
max_b_distance = max(bottleneck_distance, max_b_distance)
- print("================================================================================")
+ print(
+ "================================================================================"
+ )
message = "Bottleneck distance is " + repr(max_b_distance)
print(message)
diff --git a/src/cython/example/bottleneck_basic_example.py b/src/cython/example/bottleneck_basic_example.py
index 287956e7..392d2a6e 100755
--- a/src/cython/example/bottleneck_basic_example.py
+++ b/src/cython/example/bottleneck_basic_example.py
@@ -2,35 +2,23 @@
import gudhi
-"""This file is part of the Gudhi Library. The Gudhi library
- (Geometric Understanding in Higher Dimensions) is a generic C++
- library for computational topology.
+""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ Author(s): Vincent Rouvreau
- 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
- 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/>.
+ Modification(s):
+ - YYYY/MM Author: Description of the modification
"""
__author__ = "Francois Godi, Vincent Rouvreau"
__copyright__ = "Copyright (C) 2016 Inria"
-__license__ = "GPL v3"
+__license__ = "MIT"
-diag1 = [[2.7, 3.7],[9.6, 14.],[34.2, 34.974], [3.,float('Inf')]]
+diag1 = [[2.7, 3.7], [9.6, 14.0], [34.2, 34.974], [3.0, float("Inf")]]
-diag2 = [[2.8, 4.45],[9.5, 14.1],[3.2,float('Inf')]]
+diag2 = [[2.8, 4.45], [9.5, 14.1], [3.2, float("Inf")]]
message = "diag1=" + repr(diag1)
print(message)
@@ -38,9 +26,12 @@ print(message)
message = "diag2=" + repr(diag2)
print(message)
-message = "Bottleneck distance approximation=" + repr(gudhi.bottleneck_distance(diag1, diag2, 0.1))
+message = "Bottleneck distance approximation=" + repr(
+ gudhi.bottleneck_distance(diag1, diag2, 0.1)
+)
print(message)
-message = "Bottleneck distance exact value=" + repr(gudhi.bottleneck_distance(diag1, diag2))
+message = "Bottleneck distance exact value=" + repr(
+ gudhi.bottleneck_distance(diag1, diag2)
+)
print(message)
-
diff --git a/src/cython/example/coordinate_graph_induced_complex.py b/src/cython/example/coordinate_graph_induced_complex.py
index 9e93109a..e32141b4 100755
--- a/src/cython/example/coordinate_graph_induced_complex.py
+++ b/src/cython/example/coordinate_graph_induced_complex.py
@@ -3,50 +3,45 @@
import gudhi
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.
+""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ Author(s): Vincent Rouvreau
- Author(s): Vincent Rouvreau
+ Copyright (C) 2018 Inria
- 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/>.
+ Modification(s):
+ - YYYY/MM Author: Description of the modification
"""
__author__ = "Vincent Rouvreau"
__copyright__ = "Copyright (C) 2018 Inria"
-__license__ = "GPL v3"
+__license__ = "MIT"
-parser = argparse.ArgumentParser(description='Coordinate GIC '
- 'from points read in a OFF file.',
- epilog='Example: '
- 'example/coordinate_graph_induced_complex.py '
- '-f ../data/points/KleinBottle5D.off -c 0 -v'
- '- Constructs the coordinate GIC with the '
- 'points from the given OFF file.')
+parser = argparse.ArgumentParser(
+ description="Coordinate GIC " "from points read in a OFF file.",
+ epilog="Example: "
+ "example/coordinate_graph_induced_complex.py "
+ "-f ../data/points/KleinBottle5D.off -c 0 -v"
+ "- Constructs the coordinate GIC with the "
+ "points from the given OFF file.",
+)
parser.add_argument("-f", "--file", type=str, required=True)
parser.add_argument("-c", "--coordinate", type=int, default=0)
-parser.add_argument("-v", "--verbose", default=False, action='store_true' , help='Flag for program verbosity')
+parser.add_argument(
+ "-v",
+ "--verbose",
+ default=False,
+ action="store_true",
+ help="Flag for program verbosity",
+)
args = parser.parse_args()
nerve_complex = gudhi.CoverComplex()
nerve_complex.set_verbose(args.verbose)
-if (nerve_complex.read_point_cloud(args.file)):
- nerve_complex.set_type('GIC')
+if nerve_complex.read_point_cloud(args.file):
+ nerve_complex.set_type("GIC")
nerve_complex.set_color_from_coordinate(args.coordinate)
nerve_complex.set_function_from_coordinate(args.coordinate)
nerve_complex.set_graph_from_automatic_rips()
@@ -57,12 +52,17 @@ if (nerve_complex.read_point_cloud(args.file)):
nerve_complex.plot_dot()
simplex_tree = nerve_complex.create_simplex_tree()
nerve_complex.compute_PD()
- if (args.verbose):
- print('Iterator on coordinate GIC simplices')
- result_str = 'Coordinate GIC is of dimension ' + \
- repr(simplex_tree.dimension()) + ' - ' + \
- repr(simplex_tree.num_simplices()) + ' simplices - ' + \
- repr(simplex_tree.num_vertices()) + ' vertices.'
+ if args.verbose:
+ print("Iterator on coordinate GIC simplices")
+ result_str = (
+ "Coordinate GIC is of dimension "
+ + repr(simplex_tree.dimension())
+ + " - "
+ + repr(simplex_tree.num_simplices())
+ + " simplices - "
+ + repr(simplex_tree.num_vertices())
+ + " vertices."
+ )
print(result_str)
for filtered_value in simplex_tree.get_filtration():
print(filtered_value[0])
diff --git a/src/cython/example/euclidean_strong_witness_complex_diagram_persistence_from_off_file_example.py b/src/cython/example/euclidean_strong_witness_complex_diagram_persistence_from_off_file_example.py
index 3b29781f..610ba44f 100755
--- a/src/cython/example/euclidean_strong_witness_complex_diagram_persistence_from_off_file_example.py
+++ b/src/cython/example/euclidean_strong_witness_complex_diagram_persistence_from_off_file_example.py
@@ -3,64 +3,68 @@
import gudhi
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.
+""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ Author(s): Vincent Rouvreau
- 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
- 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/>.
+ Modification(s):
+ - YYYY/MM Author: Description of the modification
"""
__author__ = "Vincent Rouvreau"
__copyright__ = "Copyright (C) 2016 Inria"
-__license__ = "GPL v3"
-
-parser = argparse.ArgumentParser(description='EuclideanStrongWitnessComplex creation from '
- 'points read in a OFF file.',
- epilog='Example: '
- 'example/euclidean_strong_witness_complex_diagram_persistence_from_off_file_example.py '
- '-f ../data/points/tore3D_300.off -a 1.0 -n 20 -d 2'
- '- Constructs a strong witness complex with the '
- 'points from the given OFF file.')
+__license__ = "MIT"
+
+parser = argparse.ArgumentParser(
+ description="EuclideanStrongWitnessComplex creation from "
+ "points read in a OFF file.",
+ epilog="Example: "
+ "example/euclidean_strong_witness_complex_diagram_persistence_from_off_file_example.py "
+ "-f ../data/points/tore3D_300.off -a 1.0 -n 20 -d 2"
+ "- Constructs a strong witness complex with the "
+ "points from the given OFF file.",
+)
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", type=float, default=0.)
-parser.add_argument('--no-diagram', default=False, action='store_true' , help='Flag for not to display the diagrams')
+parser.add_argument("-b", "--band", type=float, default=0.0)
+parser.add_argument(
+ "--no-diagram",
+ default=False,
+ action="store_true",
+ help="Flag for not to display the diagrams",
+)
args = parser.parse_args()
-with open(args.file, 'r') as f:
+with open(args.file, "r") as f:
first_line = f.readline()
- if (first_line == 'OFF\n') or (first_line == 'nOFF\n'):
+ if (first_line == "OFF\n") or (first_line == "nOFF\n"):
print("#####################################################################")
print("EuclideanStrongWitnessComplex creation from points read in a OFF file")
witnesses = gudhi.read_off(off_file=args.file)
- landmarks = gudhi.pick_n_random_points(points=witnesses, nb_points=args.number_of_landmarks)
-
- message = "EuclideanStrongWitnessComplex with max_edge_length=" + repr(args.max_alpha_square) + \
- " - Number of landmarks=" + repr(args.number_of_landmarks)
+ landmarks = gudhi.pick_n_random_points(
+ points=witnesses, nb_points=args.number_of_landmarks
+ )
+
+ message = (
+ "EuclideanStrongWitnessComplex with max_edge_length="
+ + repr(args.max_alpha_square)
+ + " - Number of landmarks="
+ + repr(args.number_of_landmarks)
+ )
print(message)
- witness_complex = gudhi.EuclideanStrongWitnessComplex(witnesses=witnesses, landmarks=landmarks)
- simplex_tree = witness_complex.create_simplex_tree(max_alpha_square=args.max_alpha_square,
- limit_dimension=args.limit_dimension)
+ witness_complex = gudhi.EuclideanStrongWitnessComplex(
+ witnesses=witnesses, landmarks=landmarks
+ )
+ simplex_tree = witness_complex.create_simplex_tree(
+ max_alpha_square=args.max_alpha_square, limit_dimension=args.limit_dimension
+ )
message = "Number of simplices=" + repr(simplex_tree.num_simplices())
print(message)
diff --git a/src/cython/example/euclidean_witness_complex_diagram_persistence_from_off_file_example.py b/src/cython/example/euclidean_witness_complex_diagram_persistence_from_off_file_example.py
index db34962d..7587b732 100755
--- a/src/cython/example/euclidean_witness_complex_diagram_persistence_from_off_file_example.py
+++ b/src/cython/example/euclidean_witness_complex_diagram_persistence_from_off_file_example.py
@@ -3,64 +3,67 @@
import gudhi
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.
+""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ Author(s): Vincent Rouvreau
- 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
- 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/>.
+ Modification(s):
+ - YYYY/MM Author: Description of the modification
"""
__author__ = "Vincent Rouvreau"
__copyright__ = "Copyright (C) 2016 Inria"
-__license__ = "GPL v3"
-
-parser = argparse.ArgumentParser(description='EuclideanWitnessComplex creation from '
- 'points read in a OFF file.',
- epilog='Example: '
- 'example/euclidean_witness_complex_diagram_persistence_from_off_file_example.py '
- '-f ../data/points/tore3D_300.off -a 1.0 -n 20 -d 2'
- '- Constructs a weak witness complex with the '
- 'points from the given OFF file.')
+__license__ = "MIT"
+
+parser = argparse.ArgumentParser(
+ description="EuclideanWitnessComplex creation from " "points read in a OFF file.",
+ epilog="Example: "
+ "example/euclidean_witness_complex_diagram_persistence_from_off_file_example.py "
+ "-f ../data/points/tore3D_300.off -a 1.0 -n 20 -d 2"
+ "- Constructs a weak witness complex with the "
+ "points from the given OFF file.",
+)
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", type=float, default=0.)
-parser.add_argument('--no-diagram', default=False, action='store_true' , help='Flag for not to display the diagrams')
+parser.add_argument("-b", "--band", type=float, default=0.0)
+parser.add_argument(
+ "--no-diagram",
+ default=False,
+ action="store_true",
+ help="Flag for not to display the diagrams",
+)
args = parser.parse_args()
-with open(args.file, 'r') as f:
+with open(args.file, "r") as f:
first_line = f.readline()
- if (first_line == 'OFF\n') or (first_line == 'nOFF\n'):
+ if (first_line == "OFF\n") or (first_line == "nOFF\n"):
print("#####################################################################")
print("EuclideanWitnessComplex creation from points read in a OFF file")
witnesses = gudhi.read_off(off_file=args.file)
- landmarks = gudhi.pick_n_random_points(points=witnesses, nb_points=args.number_of_landmarks)
-
- message = "EuclideanWitnessComplex with max_edge_length=" + repr(args.max_alpha_square) + \
- " - Number of landmarks=" + repr(args.number_of_landmarks)
+ landmarks = gudhi.pick_n_random_points(
+ points=witnesses, nb_points=args.number_of_landmarks
+ )
+
+ message = (
+ "EuclideanWitnessComplex with max_edge_length="
+ + repr(args.max_alpha_square)
+ + " - Number of landmarks="
+ + repr(args.number_of_landmarks)
+ )
print(message)
- witness_complex = gudhi.EuclideanWitnessComplex(witnesses=witnesses, landmarks=landmarks)
- simplex_tree = witness_complex.create_simplex_tree(max_alpha_square=args.max_alpha_square,
- limit_dimension=args.limit_dimension)
+ witness_complex = gudhi.EuclideanWitnessComplex(
+ witnesses=witnesses, landmarks=landmarks
+ )
+ simplex_tree = witness_complex.create_simplex_tree(
+ max_alpha_square=args.max_alpha_square, limit_dimension=args.limit_dimension
+ )
message = "Number of simplices=" + repr(simplex_tree.num_simplices())
print(message)
diff --git a/src/cython/example/functional_graph_induced_complex.py b/src/cython/example/functional_graph_induced_complex.py
index 6ad7c2ec..8b645040 100755
--- a/src/cython/example/functional_graph_induced_complex.py
+++ b/src/cython/example/functional_graph_induced_complex.py
@@ -3,51 +3,46 @@
import gudhi
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.
+""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ Author(s): Vincent Rouvreau
- Author(s): Vincent Rouvreau
+ Copyright (C) 2018 Inria
- 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/>.
+ Modification(s):
+ - YYYY/MM Author: Description of the modification
"""
__author__ = "Vincent Rouvreau"
__copyright__ = "Copyright (C) 2018 Inria"
-__license__ = "GPL v3"
+__license__ = "MIT"
-parser = argparse.ArgumentParser(description='Functional GIC '
- 'from points read in a OFF file.',
- epilog='Example: '
- 'example/functional_graph_induced_complex.py '
- '-o ../data/points/COIL_database/lucky_cat.off '
- '-f ../data/points/COIL_database/lucky_cat_PCA1'
- '- Constructs the functional GIC with the '
- 'points from the given OFF and function files.')
+parser = argparse.ArgumentParser(
+ description="Functional GIC " "from points read in a OFF file.",
+ epilog="Example: "
+ "example/functional_graph_induced_complex.py "
+ "-o ../data/points/COIL_database/lucky_cat.off "
+ "-f ../data/points/COIL_database/lucky_cat_PCA1"
+ "- Constructs the functional GIC with the "
+ "points from the given OFF and function files.",
+)
parser.add_argument("-o", "--off-file", type=str, required=True)
parser.add_argument("-f", "--function-file", type=str, required=True)
-parser.add_argument("-v", "--verbose", default=False, action='store_true' , help='Flag for program verbosity')
+parser.add_argument(
+ "-v",
+ "--verbose",
+ default=False,
+ action="store_true",
+ help="Flag for program verbosity",
+)
args = parser.parse_args()
nerve_complex = gudhi.CoverComplex()
nerve_complex.set_verbose(args.verbose)
-if (nerve_complex.read_point_cloud(args.off_file)):
- nerve_complex.set_type('GIC')
+if nerve_complex.read_point_cloud(args.off_file):
+ nerve_complex.set_type("GIC")
nerve_complex.set_color_from_file(args.function_file)
nerve_complex.set_function_from_file(args.function_file)
nerve_complex.set_graph_from_automatic_rips()
@@ -58,12 +53,17 @@ if (nerve_complex.read_point_cloud(args.off_file)):
nerve_complex.plot_dot()
simplex_tree = nerve_complex.create_simplex_tree()
nerve_complex.compute_PD()
- if (args.verbose):
- print('Iterator on functional GIC simplices')
- result_str = 'Functional GIC is of dimension ' + \
- repr(simplex_tree.dimension()) + ' - ' + \
- repr(simplex_tree.num_simplices()) + ' simplices - ' + \
- repr(simplex_tree.num_vertices()) + ' vertices.'
+ if args.verbose:
+ print("Iterator on functional GIC simplices")
+ result_str = (
+ "Functional GIC is of dimension "
+ + repr(simplex_tree.dimension())
+ + " - "
+ + repr(simplex_tree.num_simplices())
+ + " simplices - "
+ + repr(simplex_tree.num_vertices())
+ + " vertices."
+ )
print(result_str)
for filtered_value in simplex_tree.get_filtration():
print(filtered_value[0])
diff --git a/src/cython/example/gudhi_graphical_tools_example.py b/src/cython/example/gudhi_graphical_tools_example.py
index ac3d146c..3b0ca54d 100755
--- a/src/cython/example/gudhi_graphical_tools_example.py
+++ b/src/cython/example/gudhi_graphical_tools_example.py
@@ -2,38 +2,32 @@
import gudhi
-"""This file is part of the Gudhi Library. The Gudhi library
- (Geometric Understanding in Higher Dimensions) is a generic C++
- library for computational topology.
+""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ Author(s): Vincent Rouvreau
- 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
- 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/>.
+ Modification(s):
+ - YYYY/MM Author: Description of the modification
"""
__author__ = "Vincent Rouvreau"
__copyright__ = "Copyright (C) 2016 Inria"
-__license__ = "GPL v3"
+__license__ = "MIT"
print("#####################################################################")
print("Show barcode persistence example")
-persistence = [(2, (1.0, float('inf'))), (1, (1.4142135623730951, float('inf'))),
- (1, (1.4142135623730951, float('inf'))), (0, (0.0, float('inf'))),
- (0, (0.0, 1.0)), (0, (0.0, 1.0)), (0, (0.0, 1.0))]
+persistence = [
+ (2, (1.0, float("inf"))),
+ (1, (1.4142135623730951, float("inf"))),
+ (1, (1.4142135623730951, float("inf"))),
+ (0, (0.0, float("inf"))),
+ (0, (0.0, 1.0)),
+ (0, (0.0, 1.0)),
+ (0, (0.0, 1.0)),
+]
gudhi.plot_persistence_barcode(persistence)
print("#####################################################################")
diff --git a/src/cython/example/nerve_of_a_covering.py b/src/cython/example/nerve_of_a_covering.py
index c5577cb1..3c8e0f90 100755
--- a/src/cython/example/nerve_of_a_covering.py
+++ b/src/cython/example/nerve_of_a_covering.py
@@ -3,52 +3,47 @@
import gudhi
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.
+""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ Author(s): Vincent Rouvreau
- Author(s): Vincent Rouvreau
+ Copyright (C) 2018 Inria
- 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/>.
+ Modification(s):
+ - YYYY/MM Author: Description of the modification
"""
__author__ = "Vincent Rouvreau"
__copyright__ = "Copyright (C) 2018 Inria"
-__license__ = "GPL v3"
+__license__ = "MIT"
-parser = argparse.ArgumentParser(description='Nerve of a covering creation '
- 'from points read in a OFF file.',
- epilog='Example: '
- 'example/nerve_of_a_covering.py '
- '-f ../data/points/human.off -c 2 -r 10 -g 0.3'
- '- Constructs Nerve of a covering with the '
- 'points from the given OFF file.')
+parser = argparse.ArgumentParser(
+ description="Nerve of a covering creation " "from points read in a OFF file.",
+ epilog="Example: "
+ "example/nerve_of_a_covering.py "
+ "-f ../data/points/human.off -c 2 -r 10 -g 0.3"
+ "- Constructs Nerve of a covering with the "
+ "points from the given OFF file.",
+)
parser.add_argument("-f", "--file", type=str, required=True)
parser.add_argument("-c", "--coordinate", type=int, default=0)
parser.add_argument("-r", "--resolution", type=int, default=10)
parser.add_argument("-g", "--gain", type=float, default=0.3)
-parser.add_argument("-v", "--verbose", default=False, action='store_true' , help='Flag for program verbosity')
+parser.add_argument(
+ "-v",
+ "--verbose",
+ default=False,
+ action="store_true",
+ help="Flag for program verbosity",
+)
args = parser.parse_args()
nerve_complex = gudhi.CoverComplex()
nerve_complex.set_verbose(args.verbose)
-if (nerve_complex.read_point_cloud(args.file)):
- nerve_complex.set_type('Nerve')
+if nerve_complex.read_point_cloud(args.file):
+ nerve_complex.set_type("Nerve")
nerve_complex.set_color_from_coordinate(args.coordinate)
nerve_complex.set_function_from_coordinate(args.coordinate)
nerve_complex.set_graph_from_OFF()
@@ -59,12 +54,17 @@ if (nerve_complex.read_point_cloud(args.file)):
nerve_complex.write_info()
simplex_tree = nerve_complex.create_simplex_tree()
nerve_complex.compute_PD()
- if (args.verbose):
- print('Iterator on graph induced complex simplices')
- result_str = 'Nerve is of dimension ' + \
- repr(simplex_tree.dimension()) + ' - ' + \
- repr(simplex_tree.num_simplices()) + ' simplices - ' + \
- repr(simplex_tree.num_vertices()) + ' vertices.'
+ if args.verbose:
+ print("Iterator on graph induced complex simplices")
+ result_str = (
+ "Nerve is of dimension "
+ + repr(simplex_tree.dimension())
+ + " - "
+ + repr(simplex_tree.num_simplices())
+ + " simplices - "
+ + repr(simplex_tree.num_vertices())
+ + " vertices."
+ )
print(result_str)
for filtered_value in simplex_tree.get_filtration():
print(filtered_value[0])
diff --git a/src/cython/example/periodic_cubical_complex_barcode_persistence_from_perseus_file_example.py b/src/cython/example/periodic_cubical_complex_barcode_persistence_from_perseus_file_example.py
index 5f968bf1..9cb855cd 100755
--- a/src/cython/example/periodic_cubical_complex_barcode_persistence_from_perseus_file_example.py
+++ b/src/cython/example/periodic_cubical_complex_barcode_persistence_from_perseus_file_example.py
@@ -3,34 +3,23 @@
import gudhi
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.
+""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ Author(s): Vincent Rouvreau
- 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
- 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/>.
+ Modification(s):
+ - YYYY/MM Author: Description of the modification
"""
__author__ = "Vincent Rouvreau"
__copyright__ = "Copyright (C) 2016 Inria"
-__license__ = "GPL v3"
+__license__ = "MIT"
+
def is_file_perseus(file):
- num_lines = open(file).read().count('\n')
+ num_lines = open(file).read().count("\n")
try:
f = open(file)
num_dim = int(f.readline())
@@ -48,14 +37,21 @@ def is_file_perseus(file):
except ValueError:
return False
-parser = argparse.ArgumentParser(description='Periodic cubical complex from a '
- 'Perseus-style file name.',
- epilog='Example: '
- './periodic_cubical_complex_barcode_persistence_from_perseus_file_example.py'
- ' -f ../data/bitmap/CubicalTwoSphere.txt')
+
+parser = argparse.ArgumentParser(
+ description="Periodic cubical complex from a " "Perseus-style file name.",
+ epilog="Example: "
+ "./periodic_cubical_complex_barcode_persistence_from_perseus_file_example.py"
+ " -f ../data/bitmap/CubicalTwoSphere.txt",
+)
parser.add_argument("-f", "--file", type=str, required=True)
-parser.add_argument('--no-barcode', default=False, action='store_true' , help='Flag for not to display the barcodes')
+parser.add_argument(
+ "--no-barcode",
+ default=False,
+ action="store_true",
+ help="Flag for not to display the barcodes",
+)
args = parser.parse_args()
@@ -65,7 +61,9 @@ if is_file_perseus(args.file):
periodic_cubical_complex = gudhi.PeriodicCubicalComplex(perseus_file=args.file)
print("persistence(homology_coeff_field=3, min_persistence=0)=")
- diag = periodic_cubical_complex.persistence(homology_coeff_field=3, min_persistence=0)
+ diag = periodic_cubical_complex.persistence(
+ homology_coeff_field=3, min_persistence=0
+ )
print(diag)
print("betti_numbers()=")
diff --git a/src/cython/example/random_cubical_complex_persistence_example.py b/src/cython/example/random_cubical_complex_persistence_example.py
index 80ff2452..da0eb177 100755
--- a/src/cython/example/random_cubical_complex_persistence_example.py
+++ b/src/cython/example/random_cubical_complex_persistence_example.py
@@ -7,49 +7,40 @@ import argparse
import operator
-"""This file is part of the Gudhi Library. The Gudhi library
- (Geometric Understanding in Higher Dimensions) is a generic C++
- library for computational topology.
+""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ Author(s): Vincent Rouvreau
- 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
- 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/>.
+ Modification(s):
+ - YYYY/MM Author: Description of the modification
"""
__author__ = "Vincent Rouvreau"
__copyright__ = "Copyright (C) 2016 Inria"
-__license__ = "GPL v3"
-
-parser = argparse.ArgumentParser(description='Random cubical complex.',
- epilog='Example: '
- './random_cubical_complex_persistence_example.py'
- ' 10 10 10 - Constructs a random cubical '
- 'complex in a dimension [10, 10, 10] (aka. '
- '1000 random top dimensional cells).')
-parser.add_argument('dimension', type=int, nargs="*",
- help='Cubical complex dimensions')
+__license__ = "MIT"
+
+parser = argparse.ArgumentParser(
+ description="Random cubical complex.",
+ epilog="Example: "
+ "./random_cubical_complex_persistence_example.py"
+ " 10 10 10 - Constructs a random cubical "
+ "complex in a dimension [10, 10, 10] (aka. "
+ "1000 random top dimensional cells).",
+)
+parser.add_argument("dimension", type=int, nargs="*", help="Cubical complex dimensions")
args = parser.parse_args()
dimension_multiplication = reduce(operator.mul, args.dimension, 1)
-if dimension_multiplication > 1:
+if dimension_multiplication > 1:
print("#####################################################################")
print("CubicalComplex creation")
- cubical_complex = gudhi.CubicalComplex(dimensions=args.dimension,
- top_dimensional_cells = numpy.random.rand(dimension_multiplication))
+ cubical_complex = gudhi.CubicalComplex(
+ dimensions=args.dimension,
+ top_dimensional_cells=numpy.random.rand(dimension_multiplication),
+ )
print("persistence(homology_coeff_field=2, min_persistence=0)=")
print(cubical_complex.persistence(homology_coeff_field=2, min_persistence=0))
diff --git a/src/cython/example/rips_complex_diagram_persistence_from_correlation_matrix_file_example.py b/src/cython/example/rips_complex_diagram_persistence_from_correlation_matrix_file_example.py
index 0c9dfc43..3571580b 100755
--- a/src/cython/example/rips_complex_diagram_persistence_from_correlation_matrix_file_example.py
+++ b/src/cython/example/rips_complex_diagram_persistence_from_correlation_matrix_file_example.py
@@ -4,48 +4,42 @@ 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.
+""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ Author(s): Vincent Rouvreau
- 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
- 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/>.
+ Modification(s):
+ - YYYY/MM Author: Description of the modification
"""
__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.')
+__license__ = "MIT"
+
+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')
+parser.add_argument("-b", "--band", type=float, default=0.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.):
+if not (-1.0 < args.min_edge_correlation < 1.0):
print("Wrong value of the treshold corelation (should be between -1 and 1).")
sys.exit(1)
@@ -60,12 +54,18 @@ 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)
+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)
+distance_matrix = [
+ [1.0 - 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.0 - 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())
@@ -77,7 +77,10 @@ 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))]
+invert_diag = [
+ (diag[pers][0], (1.0 - diag[pers][1][0], 1.0 - 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)
diff --git a/src/cython/example/rips_complex_diagram_persistence_from_distance_matrix_file_example.py b/src/cython/example/rips_complex_diagram_persistence_from_distance_matrix_file_example.py
index 4d2ed577..0b9a9ba9 100755
--- a/src/cython/example/rips_complex_diagram_persistence_from_distance_matrix_file_example.py
+++ b/src/cython/example/rips_complex_diagram_persistence_from_distance_matrix_file_example.py
@@ -3,44 +3,38 @@
import gudhi
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.
+""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ Author(s): Vincent Rouvreau
- 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
- 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/>.
+ Modification(s):
+ - YYYY/MM Author: Description of the modification
"""
__author__ = "Vincent Rouvreau"
__copyright__ = "Copyright (C) 2016 Inria"
-__license__ = "GPL v3"
-
-parser = argparse.ArgumentParser(description='RipsComplex creation from '
- '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 '
- 'distance matrix from the given csv file.')
+__license__ = "MIT"
+
+parser = argparse.ArgumentParser(
+ description="RipsComplex creation from " "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 "
+ "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", type=float, default=0.)
-parser.add_argument('--no-diagram', default=False, action='store_true' , help='Flag for not to display the diagrams')
+parser.add_argument("-b", "--band", type=float, default=0.0)
+parser.add_argument(
+ "--no-diagram",
+ default=False,
+ action="store_true",
+ help="Flag for not to display the diagrams",
+)
args = parser.parse_args()
@@ -51,7 +45,9 @@ message = "RipsComplex with max_edge_length=" + repr(args.max_edge_length)
print(message)
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)
+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())
diff --git a/src/cython/example/rips_complex_diagram_persistence_from_off_file_example.py b/src/cython/example/rips_complex_diagram_persistence_from_off_file_example.py
index d15d5eb0..2b335bba 100755
--- a/src/cython/example/rips_complex_diagram_persistence_from_off_file_example.py
+++ b/src/cython/example/rips_complex_diagram_persistence_from_off_file_example.py
@@ -3,68 +3,66 @@
import gudhi
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.
+""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ Author(s): Vincent Rouvreau
- 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
- 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/>.
+ Modification(s):
+ - YYYY/MM Author: Description of the modification
"""
__author__ = "Vincent Rouvreau"
__copyright__ = "Copyright (C) 2016 Inria"
-__license__ = "GPL v3"
+__license__ = "MIT"
-parser = argparse.ArgumentParser(description='RipsComplex creation from '
- 'points read in a OFF file.',
- epilog='Example: '
- 'example/rips_complex_diagram_persistence_from_off_file_example.py '
- '-f ../data/points/tore3D_300.off -a 0.6'
- '- Constructs a Rips complex with the '
- 'points from the given OFF file.')
+parser = argparse.ArgumentParser(
+ description="RipsComplex creation from " "points read in a OFF file.",
+ epilog="Example: "
+ "example/rips_complex_diagram_persistence_from_off_file_example.py "
+ "-f ../data/points/tore3D_300.off -a 0.6"
+ "- Constructs a Rips complex with the "
+ "points from the given OFF 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", type=float, default=0.)
-parser.add_argument('--no-diagram', default=False, action='store_true' , help='Flag for not to display the diagrams')
+parser.add_argument("-b", "--band", type=float, default=0.0)
+parser.add_argument(
+ "--no-diagram",
+ default=False,
+ action="store_true",
+ help="Flag for not to display the diagrams",
+)
args = parser.parse_args()
-with open(args.file, 'r') as f:
+with open(args.file, "r") as f:
first_line = f.readline()
- if (first_line == 'OFF\n') or (first_line == 'nOFF\n'):
+ if (first_line == "OFF\n") or (first_line == "nOFF\n"):
print("#####################################################################")
print("RipsComplex creation from points read in a OFF file")
-
+
message = "RipsComplex with max_edge_length=" + repr(args.max_edge_length)
print(message)
-
+
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)
-
+ 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())
print(message)
-
+
diag = simplex_tree.persistence()
-
+
print("betti_numbers()=")
print(simplex_tree.betti_numbers())
-
+
if args.no_diagram == False:
pplot = gudhi.plot_persistence_diagram(diag, band=args.band)
pplot.show()
diff --git a/src/cython/example/rips_complex_from_points_example.py b/src/cython/example/rips_complex_from_points_example.py
index ffa9d91f..59d8a261 100755
--- a/src/cython/example/rips_complex_from_points_example.py
+++ b/src/cython/example/rips_complex_from_points_example.py
@@ -2,36 +2,23 @@
import gudhi
-"""This file is part of the Gudhi Library. The Gudhi library
- (Geometric Understanding in Higher Dimensions) is a generic C++
- library for computational topology.
+""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ Author(s): Vincent Rouvreau
- 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
- 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/>.
+ Modification(s):
+ - YYYY/MM Author: Description of the modification
"""
__author__ = "Vincent Rouvreau"
__copyright__ = "Copyright (C) 2016 Inria"
-__license__ = "GPL v3"
+__license__ = "MIT"
print("#####################################################################")
print("RipsComplex creation from points")
-rips = gudhi.RipsComplex(points=[[0, 0], [1, 0], [0, 1], [1, 1]],
- max_edge_length=42)
+rips = gudhi.RipsComplex(points=[[0, 0], [1, 0], [0, 1], [1, 1]], max_edge_length=42)
simplex_tree = rips.create_simplex_tree(max_dimension=1)
diff --git a/src/cython/example/rips_persistence_diagram.py b/src/cython/example/rips_persistence_diagram.py
index 7a6a9f46..f5897d7b 100755
--- a/src/cython/example/rips_persistence_diagram.py
+++ b/src/cython/example/rips_persistence_diagram.py
@@ -2,36 +2,23 @@
import gudhi
-"""This file is part of the Gudhi Library. The Gudhi library
- (Geometric Understanding in Higher Dimensions) is a generic C++
- library for computational topology.
+""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ Author(s): Vincent Rouvreau
- 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
- 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/>.
+ Modification(s):
+ - YYYY/MM Author: Description of the modification
"""
__author__ = "Marc Glisse"
__copyright__ = "Copyright (C) 2016 Inria"
-__license__ = "GPL v3"
+__license__ = "MIT"
print("#####################################################################")
print("RipsComplex creation from points")
-rips = gudhi.RipsComplex(points=[[0, 0], [1, 0], [0, 1], [1, 1]],
- max_edge_length=42)
+rips = gudhi.RipsComplex(points=[[0, 0], [1, 0], [0, 1], [1, 1]], max_edge_length=42)
simplex_tree = rips.create_simplex_tree(max_dimension=1)
diff --git a/src/cython/example/simplex_tree_example.py b/src/cython/example/simplex_tree_example.py
index 28679015..30de00da 100755
--- a/src/cython/example/simplex_tree_example.py
+++ b/src/cython/example/simplex_tree_example.py
@@ -2,31 +2,19 @@
import gudhi
-"""This file is part of the Gudhi Library. The Gudhi library
- (Geometric Understanding in Higher Dimensions) is a generic C++
- library for computational topology.
+""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ Author(s): Vincent Rouvreau
- 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
- 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/>.
+ Modification(s):
+ - YYYY/MM Author: Description of the modification
"""
__author__ = "Vincent Rouvreau"
__copyright__ = "Copyright (C) 2016 Inria"
-__license__ = "GPL v3"
+__license__ = "MIT"
print("#####################################################################")
print("SimplexTree creation from insertion")
diff --git a/src/cython/example/sparse_rips_persistence_diagram.py b/src/cython/example/sparse_rips_persistence_diagram.py
index d58c244c..671d5e34 100755
--- a/src/cython/example/sparse_rips_persistence_diagram.py
+++ b/src/cython/example/sparse_rips_persistence_diagram.py
@@ -2,36 +2,25 @@
import gudhi
-"""This file is part of the Gudhi Library. The Gudhi library
- (Geometric Understanding in Higher Dimensions) is a generic C++
- library for computational topology.
+""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ Author(s): Vincent Rouvreau
- Author(s): Marc Glisse
+ Copyright (C) 2018 Inria
- 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/>.
+ Modification(s):
+ - YYYY/MM Author: Description of the modification
"""
__author__ = "Marc Glisse"
__copyright__ = "Copyright (C) 2018 Inria"
-__license__ = "GPL v3"
+__license__ = "MIT"
print("#####################################################################")
print("Sparse RipsComplex creation from points")
-rips = gudhi.RipsComplex(points=[[0, 0], [0, 0.1], [1, 0], [0, 1], [1, 1]],
- max_edge_length=42, sparse=.5)
+rips = gudhi.RipsComplex(
+ points=[[0, 0], [0, 0.1], [1, 0], [0, 1], [1, 1]], max_edge_length=42, sparse=0.5
+)
simplex_tree = rips.create_simplex_tree(max_dimension=2)
diff --git a/src/cython/example/tangential_complex_plain_homology_from_off_file_example.py b/src/cython/example/tangential_complex_plain_homology_from_off_file_example.py
index 536517d1..456bc9eb 100755
--- a/src/cython/example/tangential_complex_plain_homology_from_off_file_example.py
+++ b/src/cython/example/tangential_complex_plain_homology_from_off_file_example.py
@@ -3,64 +3,58 @@
import gudhi
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.
+""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ Author(s): Vincent Rouvreau
- 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
- 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/>.
+ Modification(s):
+ - YYYY/MM Author: Description of the modification
"""
__author__ = "Vincent Rouvreau"
__copyright__ = "Copyright (C) 2016 Inria"
-__license__ = "GPL v3"
+__license__ = "MIT"
-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 -i 3'
- '- Constructs a tangential complex with the '
- 'points from the given OFF file')
+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 -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("-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')
+parser.add_argument("-b", "--band", type=float, default=0.0)
+parser.add_argument(
+ "--no-diagram",
+ default=False,
+ action="store_true",
+ help="Flag for not to display the diagrams",
+)
args = parser.parse_args()
-with open(args.file, 'r') as f:
+with open(args.file, "r") as f:
first_line = f.readline()
- if (first_line == 'OFF\n') or (first_line == 'nOFF\n'):
+ if (first_line == "OFF\n") or (first_line == "nOFF\n"):
print("#####################################################################")
print("TangentialComplex creation from points read in a OFF file")
-
- tc = gudhi.TangentialComplex(intrisic_dim = args.intrisic_dim, off_file=args.file)
+
+ tc = gudhi.TangentialComplex(intrisic_dim=args.intrisic_dim, off_file=args.file)
tc.compute_tangential_complex()
st = tc.create_simplex_tree()
-
+
message = "Number of simplices=" + repr(st.num_simplices())
print(message)
-
- diag = st.persistence(persistence_dim_max = True)
-
+
+ diag = st.persistence(persistence_dim_max=True)
+
print("betti_numbers()=")
print(st.betti_numbers())
-
+
if args.no_diagram == False:
pplot = gudhi.plot_persistence_diagram(diag, band=args.band)
pplot.show()
diff --git a/src/cython/example/voronoi_graph_induced_complex.py b/src/cython/example/voronoi_graph_induced_complex.py
index 8266a0e4..38be6c92 100755
--- a/src/cython/example/voronoi_graph_induced_complex.py
+++ b/src/cython/example/voronoi_graph_induced_complex.py
@@ -3,50 +3,45 @@
import gudhi
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.
+""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ Author(s): Vincent Rouvreau
- Author(s): Vincent Rouvreau
+ Copyright (C) 2018 Inria
- 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/>.
+ Modification(s):
+ - YYYY/MM Author: Description of the modification
"""
__author__ = "Vincent Rouvreau"
__copyright__ = "Copyright (C) 2018 Inria"
-__license__ = "GPL v3"
+__license__ = "MIT"
-parser = argparse.ArgumentParser(description='Voronoi GIC '
- 'from points read in a OFF file.',
- epilog='Example: '
- 'example/voronoi_graph_induced_complex.py '
- '-f ../data/points/human.off -n 700 -v'
- '- Constructs the Voronoi GIC with the '
- 'points from the given OFF file.')
+parser = argparse.ArgumentParser(
+ description="Voronoi GIC " "from points read in a OFF file.",
+ epilog="Example: "
+ "example/voronoi_graph_induced_complex.py "
+ "-f ../data/points/human.off -n 700 -v"
+ "- Constructs the Voronoi GIC with the "
+ "points from the given OFF file.",
+)
parser.add_argument("-f", "--file", type=str, required=True)
parser.add_argument("-n", "--subsample-nb-points", type=int, default=100)
-parser.add_argument("-v", "--verbose", default=False, action='store_true' , help='Flag for program verbosity')
+parser.add_argument(
+ "-v",
+ "--verbose",
+ default=False,
+ action="store_true",
+ help="Flag for program verbosity",
+)
args = parser.parse_args()
nerve_complex = gudhi.CoverComplex()
nerve_complex.set_verbose(args.verbose)
-if (nerve_complex.read_point_cloud(args.file)):
- nerve_complex.set_type('GIC')
+if nerve_complex.read_point_cloud(args.file):
+ nerve_complex.set_type("GIC")
nerve_complex.set_color_from_coordinate()
nerve_complex.set_graph_from_OFF()
nerve_complex.set_cover_from_Voronoi(args.subsample_nb_points)
@@ -54,12 +49,17 @@ if (nerve_complex.read_point_cloud(args.file)):
nerve_complex.plot_off()
simplex_tree = nerve_complex.create_simplex_tree()
nerve_complex.compute_PD()
- if (args.verbose):
- print('Iterator on graph induced complex simplices')
- result_str = 'Graph induced complex is of dimension ' + \
- repr(simplex_tree.dimension()) + ' - ' + \
- repr(simplex_tree.num_simplices()) + ' simplices - ' + \
- repr(simplex_tree.num_vertices()) + ' vertices.'
+ if args.verbose:
+ print("Iterator on graph induced complex simplices")
+ result_str = (
+ "Graph induced complex is of dimension "
+ + repr(simplex_tree.dimension())
+ + " - "
+ + repr(simplex_tree.num_simplices())
+ + " simplices - "
+ + repr(simplex_tree.num_vertices())
+ + " vertices."
+ )
print(result_str)
for filtered_value in simplex_tree.get_filtration():
print(filtered_value[0])
diff --git a/src/cython/example/witness_complex_from_nearest_landmark_table.py b/src/cython/example/witness_complex_from_nearest_landmark_table.py
index 1b79d9b2..c04a82b2 100755
--- a/src/cython/example/witness_complex_from_nearest_landmark_table.py
+++ b/src/cython/example/witness_complex_from_nearest_landmark_table.py
@@ -2,39 +2,29 @@
from gudhi import StrongWitnessComplex, SimplexTree
-"""This file is part of the Gudhi Library. The Gudhi library
- (Geometric Understanding in Higher Dimensions) is a generic C++
- library for computational topology.
+""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ Author(s): Vincent Rouvreau
- 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
- 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/>.
+ Modification(s):
+ - YYYY/MM Author: Description of the modification
"""
__author__ = "Vincent Rouvreau"
__copyright__ = "Copyright (C) 2016 Inria"
-__license__ = "GPL v3"
+__license__ = "MIT"
print("#####################################################################")
print("WitnessComplex creation from nearest landmark table")
-nearest_landmark_table = [[[0, 0.0], [1, 0.1], [2, 0.2], [3, 0.3], [4, 0.4]],
- [[1, 0.0], [2, 0.1], [3, 0.2], [4, 0.3], [0, 0.4]],
- [[2, 0.0], [3, 0.1], [4, 0.2], [0, 0.3], [1, 0.4]],
- [[3, 0.0], [4, 0.1], [0, 0.2], [1, 0.3], [2, 0.4]],
- [[4, 0.0], [0, 0.1], [1, 0.2], [2, 0.3], [3, 0.4]]]
+nearest_landmark_table = [
+ [[0, 0.0], [1, 0.1], [2, 0.2], [3, 0.3], [4, 0.4]],
+ [[1, 0.0], [2, 0.1], [3, 0.2], [4, 0.3], [0, 0.4]],
+ [[2, 0.0], [3, 0.1], [4, 0.2], [0, 0.3], [1, 0.4]],
+ [[3, 0.0], [4, 0.1], [0, 0.2], [1, 0.3], [2, 0.4]],
+ [[4, 0.0], [0, 0.1], [1, 0.2], [2, 0.3], [3, 0.4]],
+]
witness_complex = StrongWitnessComplex(nearest_landmark_table=nearest_landmark_table)
simplex_tree = witness_complex.create_simplex_tree(max_alpha_square=0.41)
diff --git a/src/cython/gudhi.pyx.in b/src/cython/gudhi.pyx.in
index 0d4b966b..1c380308 100644
--- a/src/cython/gudhi.pyx.in
+++ b/src/cython/gudhi.pyx.in
@@ -1,28 +1,16 @@
-"""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
+"""This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ 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/>.
+ Modification(s):
+ - YYYY/MM Author: Description of the modification
"""
__author__ = "Vincent Rouvreau"
-__copyright__ = "Copyright (C) 2016 Inria"
-__license__ = "GPL v3"
+__copyright__ = "Copyright (C) 2016-2019 Inria"
+__license__ = "https://gudhi.inria.fr/licensing/"
__version__ = "@GUDHI_VERSION@"
# This variable is used by doctest to find files
__root_source_dir__ = "@CMAKE_SOURCE_DIR@"
diff --git a/src/cython/include/Alpha_complex_interface.h b/src/cython/include/Alpha_complex_interface.h
index faa059d1..1199b741 100644
--- a/src/cython/include/Alpha_complex_interface.h
+++ b/src/cython/include/Alpha_complex_interface.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef INCLUDE_ALPHA_COMPLEX_INTERFACE_H_
diff --git a/src/cython/include/Bottleneck_distance_interface.h b/src/cython/include/Bottleneck_distance_interface.h
index 5ad9d77d..22c9a97a 100644
--- a/src/cython/include/Bottleneck_distance_interface.h
+++ b/src/cython/include/Bottleneck_distance_interface.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef INCLUDE_BOTTLENECK_DISTANCE_INTERFACE_H_
diff --git a/src/cython/include/Cubical_complex_interface.h b/src/cython/include/Cubical_complex_interface.h
index 85b717b3..7d32914c 100644
--- a/src/cython/include/Cubical_complex_interface.h
+++ b/src/cython/include/Cubical_complex_interface.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef INCLUDE_CUBICAL_COMPLEX_INTERFACE_H_
diff --git a/src/cython/include/Euclidean_strong_witness_complex_interface.h b/src/cython/include/Euclidean_strong_witness_complex_interface.h
index d86355d6..90bd54ac 100644
--- a/src/cython/include/Euclidean_strong_witness_complex_interface.h
+++ b/src/cython/include/Euclidean_strong_witness_complex_interface.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef INCLUDE_EUCLIDEAN_STRONG_WITNESS_COMPLEX_INTERFACE_H_
diff --git a/src/cython/include/Euclidean_witness_complex_interface.h b/src/cython/include/Euclidean_witness_complex_interface.h
index dc303533..0c01a741 100644
--- a/src/cython/include/Euclidean_witness_complex_interface.h
+++ b/src/cython/include/Euclidean_witness_complex_interface.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef INCLUDE_EUCLIDEAN_WITNESS_COMPLEX_INTERFACE_H_
diff --git a/src/cython/include/Nerve_gic_interface.h b/src/cython/include/Nerve_gic_interface.h
index aa71e2a6..729b39fb 100644
--- a/src/cython/include/Nerve_gic_interface.h
+++ b/src/cython/include/Nerve_gic_interface.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef INCLUDE_NERVE_GIC_INTERFACE_H_
diff --git a/src/cython/include/Off_reader_interface.h b/src/cython/include/Off_reader_interface.h
index f6b14f38..4b3643be 100644
--- a/src/cython/include/Off_reader_interface.h
+++ b/src/cython/include/Off_reader_interface.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef INCLUDE_OFF_READER_INTERFACE_H_
diff --git a/src/cython/include/Persistent_cohomology_interface.h b/src/cython/include/Persistent_cohomology_interface.h
index 8cf71a4e..64e2ddc8 100644
--- a/src/cython/include/Persistent_cohomology_interface.h
+++ b/src/cython/include/Persistent_cohomology_interface.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef INCLUDE_PERSISTENT_COHOMOLOGY_INTERFACE_H_
diff --git a/src/cython/include/Reader_utils_interface.h b/src/cython/include/Reader_utils_interface.h
index 5f7527d9..5bddf9ce 100644
--- a/src/cython/include/Reader_utils_interface.h
+++ b/src/cython/include/Reader_utils_interface.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef INCLUDE_READER_UTILS_INTERFACE_H_
diff --git a/src/cython/include/Rips_complex_interface.h b/src/cython/include/Rips_complex_interface.h
index 40aff299..f818a2ed 100644
--- a/src/cython/include/Rips_complex_interface.h
+++ b/src/cython/include/Rips_complex_interface.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef INCLUDE_RIPS_COMPLEX_INTERFACE_H_
diff --git a/src/cython/include/Simplex_tree_interface.h b/src/cython/include/Simplex_tree_interface.h
index ca98517d..c15a44a5 100644
--- a/src/cython/include/Simplex_tree_interface.h
+++ b/src/cython/include/Simplex_tree_interface.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef INCLUDE_SIMPLEX_TREE_INTERFACE_H_
diff --git a/src/cython/include/Strong_witness_complex_interface.h b/src/cython/include/Strong_witness_complex_interface.h
index 3c72c916..4c333da8 100644
--- a/src/cython/include/Strong_witness_complex_interface.h
+++ b/src/cython/include/Strong_witness_complex_interface.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef INCLUDE_STRONG_WITNESS_COMPLEX_INTERFACE_H_
diff --git a/src/cython/include/Subsampling_interface.h b/src/cython/include/Subsampling_interface.h
index f990da0c..bc390485 100644
--- a/src/cython/include/Subsampling_interface.h
+++ b/src/cython/include/Subsampling_interface.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef INCLUDE_SUBSAMPLING_INTERFACE_H_
diff --git a/src/cython/include/Tangential_complex_interface.h b/src/cython/include/Tangential_complex_interface.h
index c4ddbdbe..7c3f2789 100644
--- a/src/cython/include/Tangential_complex_interface.h
+++ b/src/cython/include/Tangential_complex_interface.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef INCLUDE_TANGENTIAL_COMPLEX_INTERFACE_H_
diff --git a/src/cython/include/Witness_complex_interface.h b/src/cython/include/Witness_complex_interface.h
index 01b372e7..609277d6 100644
--- a/src/cython/include/Witness_complex_interface.h
+++ b/src/cython/include/Witness_complex_interface.h
@@ -6,18 +6,8 @@
*
* 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/>.
+ * Modification(s):
+ * - YYYY/MM Author: Description of the modification
*/
#ifndef INCLUDE_WITNESS_COMPLEX_INTERFACE_H_
diff --git a/src/cython/setup.py.in b/src/cython/setup.py.in
index c66905ac..70c85852 100644
--- a/src/cython/setup.py.in
+++ b/src/cython/setup.py.in
@@ -2,26 +2,14 @@ from distutils.core import setup, Extension
from Cython.Build import cythonize
from numpy import get_include as numpy_get_include
-"""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
+"""This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ Author(s): Vincent Rouvreau
Copyright (C) 2019 Inria
- This 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/>.
+ Modification(s):
+ - YYYY/MM Author: Description of the modification
"""
__author__ = "GUDHI Editorial Board"
diff --git a/src/cython/test/test_alpha_complex.py b/src/cython/test/test_alpha_complex.py
index e97f2530..24f8bf53 100755
--- a/src/cython/test/test_alpha_complex.py
+++ b/src/cython/test/test_alpha_complex.py
@@ -1,36 +1,25 @@
from gudhi import AlphaComplex, SimplexTree
-"""This file is part of the Gudhi Library. The Gudhi library
- (Geometric Understanding in Higher Dimensions) is a generic C++
- library for computational topology.
+""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ Author(s): Vincent Rouvreau
- 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
- 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/>.
+ Modification(s):
+ - YYYY/MM Author: Description of the modification
"""
__author__ = "Vincent Rouvreau"
__copyright__ = "Copyright (C) 2016 Inria"
-__license__ = "GPL v3"
+__license__ = "MIT"
def test_empty_alpha():
- alpha_complex = AlphaComplex(points=[[0,0]])
+ alpha_complex = AlphaComplex(points=[[0, 0]])
assert alpha_complex.__is_defined() == True
+
def test_infinite_alpha():
point_list = [[0, 0], [1, 0], [0, 1], [1, 1]]
alpha_complex = AlphaComplex(points=point_list)
@@ -41,18 +30,28 @@ def test_infinite_alpha():
assert simplex_tree.num_simplices() == 11
assert simplex_tree.num_vertices() == 4
-
- assert simplex_tree.get_filtration() == \
- [([0], 0.0), ([1], 0.0), ([2], 0.0), ([3], 0.0),
- ([0, 1], 0.25), ([0, 2], 0.25), ([1, 3], 0.25),
- ([2, 3], 0.25), ([1, 2], 0.5), ([0, 1, 2], 0.5),
- ([1, 2, 3], 0.5)]
- assert simplex_tree.get_star([0]) == \
- [([0], 0.0), ([0, 1], 0.25), ([0, 1, 2], 0.5),
- ([0, 2], 0.25)]
- assert simplex_tree.get_cofaces([0], 1) == \
- [([0, 1], 0.25), ([0, 2], 0.25)]
-
+
+ assert simplex_tree.get_filtration() == [
+ ([0], 0.0),
+ ([1], 0.0),
+ ([2], 0.0),
+ ([3], 0.0),
+ ([0, 1], 0.25),
+ ([0, 2], 0.25),
+ ([1, 3], 0.25),
+ ([2, 3], 0.25),
+ ([1, 2], 0.5),
+ ([0, 1, 2], 0.5),
+ ([1, 2, 3], 0.5),
+ ]
+ assert simplex_tree.get_star([0]) == [
+ ([0], 0.0),
+ ([0, 1], 0.25),
+ ([0, 1, 2], 0.5),
+ ([0, 2], 0.25),
+ ]
+ assert simplex_tree.get_cofaces([0], 1) == [([0, 1], 0.25), ([0, 2], 0.25)]
+
assert point_list[0] == alpha_complex.get_point(0)
assert point_list[1] == alpha_complex.get_point(1)
assert point_list[2] == alpha_complex.get_point(2)
@@ -60,6 +59,7 @@ def test_infinite_alpha():
assert alpha_complex.get_point(4) == []
assert alpha_complex.get_point(125) == []
+
def test_filtered_alpha():
point_list = [[0, 0], [1, 0], [0, 1], [1, 1]]
filtered_alpha = AlphaComplex(points=point_list)
@@ -76,11 +76,15 @@ def test_filtered_alpha():
assert filtered_alpha.get_point(4) == []
assert filtered_alpha.get_point(125) == []
- assert simplex_tree.get_filtration() == \
- [([0], 0.0), ([1], 0.0), ([2], 0.0), ([3], 0.0),
- ([0, 1], 0.25), ([0, 2], 0.25), ([1, 3], 0.25),
- ([2, 3], 0.25)]
- assert simplex_tree.get_star([0]) == \
- [([0], 0.0), ([0, 1], 0.25), ([0, 2], 0.25)]
- assert simplex_tree.get_cofaces([0], 1) == \
- [([0, 1], 0.25), ([0, 2], 0.25)]
+ assert simplex_tree.get_filtration() == [
+ ([0], 0.0),
+ ([1], 0.0),
+ ([2], 0.0),
+ ([3], 0.0),
+ ([0, 1], 0.25),
+ ([0, 2], 0.25),
+ ([1, 3], 0.25),
+ ([2, 3], 0.25),
+ ]
+ assert simplex_tree.get_star([0]) == [([0], 0.0), ([0, 1], 0.25), ([0, 2], 0.25)]
+ assert simplex_tree.get_cofaces([0], 1) == [([0, 1], 0.25), ([0, 2], 0.25)]
diff --git a/src/cython/test/test_bottleneck_distance.py b/src/cython/test/test_bottleneck_distance.py
index 4eb5848f..f5f019b9 100755
--- a/src/cython/test/test_bottleneck_distance.py
+++ b/src/cython/test/test_bottleneck_distance.py
@@ -1,35 +1,23 @@
import gudhi
-"""This file is part of the Gudhi Library. The Gudhi library
- (Geometric Understanding in Higher Dimensions) is a generic C++
- library for computational topology.
+""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ Author(s): Vincent Rouvreau
- 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
- 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/>.
+ Modification(s):
+ - YYYY/MM Author: Description of the modification
"""
__author__ = "Vincent Rouvreau"
__copyright__ = "Copyright (C) 2016 Inria"
-__license__ = "GPL v3"
+__license__ = "MIT"
def test_basic_bottleneck():
- 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')]]
+ diag1 = [[2.7, 3.7], [9.6, 14.0], [34.2, 34.974], [3.0, float("Inf")]]
+ diag2 = [[2.8, 4.45], [9.5, 14.1], [3.2, float("Inf")]]
- assert(gudhi.bottleneck_distance(diag1, diag2, 0.1) == 0.8081763781405569)
- assert(gudhi.bottleneck_distance(diag1, diag2) == 0.75)
+ assert gudhi.bottleneck_distance(diag1, diag2, 0.1) == 0.8081763781405569
+ assert gudhi.bottleneck_distance(diag1, diag2) == 0.75
diff --git a/src/cython/test/test_cover_complex.py b/src/cython/test/test_cover_complex.py
index 58935264..8cd12272 100755
--- a/src/cython/test/test_cover_complex.py
+++ b/src/cython/test/test_cover_complex.py
@@ -1,30 +1,18 @@
from gudhi import CoverComplex
-"""This file is part of the Gudhi Library. The Gudhi library
- (Geometric Understanding in Higher Dimensions) is a generic C++
- library for computational topology.
+""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ Author(s): Vincent Rouvreau
- Author(s): Vincent Rouvreau
+ Copyright (C) 2018 Inria
- 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/>.
+ Modification(s):
+ - YYYY/MM Author: Description of the modification
"""
__author__ = "Vincent Rouvreau"
__copyright__ = "Copyright (C) 2018 Inria"
-__license__ = "GPL v3"
+__license__ = "MIT"
def test_empty_constructor():
@@ -32,61 +20,66 @@ def test_empty_constructor():
cover = CoverComplex()
assert cover.__is_defined() == True
+
def test_non_existing_file_read():
# Try to open a non existing file
cover = CoverComplex()
- assert (cover.read_point_cloud('pouetpouettralala.toubiloubabdou') == False)
+ assert cover.read_point_cloud("pouetpouettralala.toubiloubabdou") == False
+
def test_files_creation():
# Create test file
- cloud_file = open('cloud', 'w')
- cloud_file.write('nOFF\n3\n3 0 0\n0 0 0\n2 1 0\n4 0 0')
+ cloud_file = open("cloud", "w")
+ cloud_file.write("nOFF\n3\n3 0 0\n0 0 0\n2 1 0\n4 0 0")
cloud_file.close()
- cover_file = open('cover', 'w')
- cover_file.write('1\n2\n3')
+ cover_file = open("cover", "w")
+ cover_file.write("1\n2\n3")
cover_file.close()
- graph_file = open('graph', 'w')
- graph_file.write('0 1\n0 2\n1 2')
+ graph_file = open("graph", "w")
+ graph_file.write("0 1\n0 2\n1 2")
graph_file.close()
+
def test_nerve():
nerve = CoverComplex()
- nerve.set_type('Nerve')
- assert (nerve.read_point_cloud('cloud') == True)
+ nerve.set_type("Nerve")
+ assert nerve.read_point_cloud("cloud") == True
nerve.set_color_from_coordinate()
- nerve.set_graph_from_file('graph')
- nerve.set_cover_from_file('cover')
+ nerve.set_graph_from_file("graph")
+ nerve.set_cover_from_file("cover")
nerve.find_simplices()
stree = nerve.create_simplex_tree()
- assert (stree.num_vertices() == 3)
- assert ((stree.num_simplices() - stree.num_vertices()) == 0)
- assert (stree.dimension() == 0)
+ assert stree.num_vertices() == 3
+ assert (stree.num_simplices() - stree.num_vertices()) == 0
+ assert stree.dimension() == 0
+
def test_graph_induced_complex():
gic = CoverComplex()
- gic.set_type('GIC')
- assert (gic.read_point_cloud('cloud') == True)
+ gic.set_type("GIC")
+ assert gic.read_point_cloud("cloud") == True
gic.set_color_from_coordinate()
- gic.set_graph_from_file('graph')
- gic.set_cover_from_file('cover')
+ gic.set_graph_from_file("graph")
+ gic.set_cover_from_file("cover")
gic.find_simplices()
stree = gic.create_simplex_tree()
- assert (stree.num_vertices() == 3)
- assert ((stree.num_simplices() - stree.num_vertices()) == 4)
- assert (stree.dimension() == 2)
+ assert stree.num_vertices() == 3
+ assert (stree.num_simplices() - stree.num_vertices()) == 4
+ assert stree.dimension() == 2
+
def test_voronoi_graph_induced_complex():
gic = CoverComplex()
- gic.set_type('GIC')
- assert (gic.read_point_cloud('cloud') == True)
+ gic.set_type("GIC")
+ assert gic.read_point_cloud("cloud") == True
gic.set_color_from_coordinate()
- gic.set_graph_from_file('graph')
+ gic.set_graph_from_file("graph")
gic.set_cover_from_Voronoi(2)
gic.find_simplices()
stree = gic.create_simplex_tree()
- assert (stree.num_vertices() == 2)
- assert ((stree.num_simplices() - stree.num_vertices()) == 1)
- assert (stree.dimension() == 1)
+ assert stree.num_vertices() == 2
+ assert (stree.num_simplices() - stree.num_vertices()) == 1
+ assert stree.dimension() == 1
diff --git a/src/cython/test/test_cubical_complex.py b/src/cython/test/test_cubical_complex.py
index 92e591e9..68f54fbe 100755
--- a/src/cython/test/test_cubical_complex.py
+++ b/src/cython/test/test_cubical_complex.py
@@ -1,30 +1,18 @@
from gudhi import CubicalComplex
-"""This file is part of the Gudhi Library. The Gudhi library
- (Geometric Understanding in Higher Dimensions) is a generic C++
- library for computational topology.
+""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ Author(s): Vincent Rouvreau
- 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
- 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/>.
+ Modification(s):
+ - YYYY/MM Author: Description of the modification
"""
__author__ = "Vincent Rouvreau"
__copyright__ = "Copyright (C) 2016 Inria"
-__license__ = "GPL v3"
+__license__ = "MIT"
def test_empty_constructor():
@@ -33,65 +21,78 @@ def test_empty_constructor():
assert cub.__is_defined() == False
assert cub.__is_persistence_defined() == False
+
def test_non_existing_perseus_file_constructor():
# Try to open a non existing file
- cub = CubicalComplex(perseus_file='pouetpouettralala.toubiloubabdou')
+ cub = CubicalComplex(perseus_file="pouetpouettralala.toubiloubabdou")
assert cub.__is_defined() == False
assert cub.__is_persistence_defined() == False
+
def test_dimension_or_perseus_file_constructor():
# Create test file
- test_file = open('CubicalOneSphere.txt', 'w')
- test_file.write('2\n3\n3\n0\n0\n0\n0\n100\n0\n0\n0\n0\n')
+ test_file = open("CubicalOneSphere.txt", "w")
+ test_file.write("2\n3\n3\n0\n0\n0\n0\n100\n0\n0\n0\n0\n")
test_file.close()
# CubicalComplex can be constructed from dimensions and
# top_dimensional_cells OR from a Perseus-style file name.
- cub = CubicalComplex(dimensions=[3, 3],
- top_dimensional_cells = [1,2,3,4,5,6,7,8,9],
- perseus_file='CubicalOneSphere.txt')
+ cub = CubicalComplex(
+ dimensions=[3, 3],
+ top_dimensional_cells=[1, 2, 3, 4, 5, 6, 7, 8, 9],
+ perseus_file="CubicalOneSphere.txt",
+ )
assert cub.__is_defined() == False
assert cub.__is_persistence_defined() == False
- cub = CubicalComplex(top_dimensional_cells = [1,2,3,4,5,6,7,8,9],
- perseus_file='CubicalOneSphere.txt')
+ cub = CubicalComplex(
+ top_dimensional_cells=[1, 2, 3, 4, 5, 6, 7, 8, 9],
+ perseus_file="CubicalOneSphere.txt",
+ )
assert cub.__is_defined() == False
assert cub.__is_persistence_defined() == False
- cub = CubicalComplex(dimensions=[3, 3],
- perseus_file='CubicalOneSphere.txt')
+ cub = CubicalComplex(dimensions=[3, 3], perseus_file="CubicalOneSphere.txt")
assert cub.__is_defined() == False
assert cub.__is_persistence_defined() == False
+
def test_dimension_simple_constructor():
- cub = CubicalComplex(dimensions=[3, 3],
- top_dimensional_cells = [1,2,3,4,5,6,7,8,9])
+ cub = CubicalComplex(
+ dimensions=[3, 3], top_dimensional_cells=[1, 2, 3, 4, 5, 6, 7, 8, 9]
+ )
assert cub.__is_defined() == True
assert cub.__is_persistence_defined() == False
- assert cub.persistence() == [(0, (1.0, float('inf')))]
+ assert cub.persistence() == [(0, (1.0, float("inf")))]
assert cub.__is_persistence_defined() == True
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.])
+ cub = CubicalComplex(
+ dimensions=[3, 3],
+ top_dimensional_cells=[float("inf"), 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 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.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')))]
+ other_cub = CubicalComplex(
+ dimensions=[3, 3],
+ top_dimensional_cells=[1000.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 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')
- test_file.write('2\n3\n3\n0\n0\n0\n0\n100\n0\n0\n0\n0\n')
+ test_file = open("CubicalOneSphere.txt", "w")
+ test_file.write("2\n3\n3\n0\n0\n0\n0\n100\n0\n0\n0\n0\n")
test_file.close()
- cub = CubicalComplex(perseus_file='CubicalOneSphere.txt')
+ cub = CubicalComplex(perseus_file="CubicalOneSphere.txt")
assert cub.__is_defined() == True
assert cub.__is_persistence_defined() == False
- assert cub.persistence() == [(1, (0.0, 100.0)), (0, (0.0, float('inf')))]
+ assert cub.persistence() == [(1, (0.0, 100.0)), (0, (0.0, float("inf")))]
assert cub.__is_persistence_defined() == True
assert cub.betti_numbers() == [1, 0, 0]
assert cub.persistent_betti_numbers(0, 1000) == [1, 0, 0]
diff --git a/src/cython/test/test_euclidean_witness_complex.py b/src/cython/test/test_euclidean_witness_complex.py
index 2f77210a..f5eae5fa 100755
--- a/src/cython/test/test_euclidean_witness_complex.py
+++ b/src/cython/test/test_euclidean_witness_complex.py
@@ -1,61 +1,78 @@
import gudhi
-"""This file is part of the Gudhi Library. The Gudhi library
- (Geometric Understanding in Higher Dimensions) is a generic C++
- library for computational topology.
+""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ Author(s): Vincent Rouvreau
- 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
- 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/>.
+ Modification(s):
+ - YYYY/MM Author: Description of the modification
"""
__author__ = "Vincent Rouvreau"
__copyright__ = "Copyright (C) 2016 Inria"
-__license__ = "GPL v3"
+__license__ = "MIT"
def test_empty_euclidean_witness_complex():
euclidean_witness = gudhi.EuclideanWitnessComplex()
assert euclidean_witness.__is_defined() == False
+
def test_witness_complex():
- point_cloud = [[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]]
+ point_cloud = [
+ [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],
+ ]
landmarks = [[1.0, 1.0], [7.0, 0.0], [4.0, 6.0]]
- euclidean_witness_complex = gudhi.EuclideanWitnessComplex(landmarks=landmarks, witnesses = point_cloud)
+ euclidean_witness_complex = gudhi.EuclideanWitnessComplex(
+ landmarks=landmarks, witnesses=point_cloud
+ )
simplex_tree = euclidean_witness_complex.create_simplex_tree(max_alpha_square=4.1)
assert landmarks[0] == euclidean_witness_complex.get_point(0)
assert landmarks[1] == euclidean_witness_complex.get_point(1)
assert landmarks[2] == euclidean_witness_complex.get_point(2)
- assert simplex_tree.get_filtration() == [([0], 0.0), ([1], 0.0),
- ([0, 1], 0.0), ([2], 0.0), ([0, 2], 0.0), ([1, 2], 0.0),
- ([0, 1, 2], 0.0)]
+ assert simplex_tree.get_filtration() == [
+ ([0], 0.0),
+ ([1], 0.0),
+ ([0, 1], 0.0),
+ ([2], 0.0),
+ ([0, 2], 0.0),
+ ([1, 2], 0.0),
+ ([0, 1, 2], 0.0),
+ ]
+
def test_empty_euclidean_strong_witness_complex():
euclidean_strong_witness = gudhi.EuclideanStrongWitnessComplex()
assert euclidean_strong_witness.__is_defined() == False
+
def test_strong_witness_complex():
- point_cloud = [[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]]
+ point_cloud = [
+ [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],
+ ]
landmarks = [[1.0, 1.0], [7.0, 0.0], [4.0, 6.0]]
- euclidean_strong_witness_complex = gudhi.EuclideanStrongWitnessComplex(landmarks=landmarks, witnesses = point_cloud)
- simplex_tree = euclidean_strong_witness_complex.create_simplex_tree(max_alpha_square=14.9)
+ euclidean_strong_witness_complex = gudhi.EuclideanStrongWitnessComplex(
+ landmarks=landmarks, witnesses=point_cloud
+ )
+ simplex_tree = euclidean_strong_witness_complex.create_simplex_tree(
+ max_alpha_square=14.9
+ )
assert landmarks[0] == euclidean_strong_witness_complex.get_point(0)
assert landmarks[1] == euclidean_strong_witness_complex.get_point(1)
@@ -63,9 +80,16 @@ def test_strong_witness_complex():
assert simplex_tree.get_filtration() == [([0], 0.0), ([1], 0.0), ([2], 0.0)]
- simplex_tree = euclidean_strong_witness_complex.create_simplex_tree(max_alpha_square=100.0)
-
- assert simplex_tree.get_filtration() == [([0], 0.0), ([1], 0.0),
- ([2], 0.0), ([1, 2], 15.0), ([0, 2], 34.0), ([0, 1], 37.0),
- ([0, 1, 2], 37.0)]
-
+ simplex_tree = euclidean_strong_witness_complex.create_simplex_tree(
+ max_alpha_square=100.0
+ )
+
+ assert simplex_tree.get_filtration() == [
+ ([0], 0.0),
+ ([1], 0.0),
+ ([2], 0.0),
+ ([1, 2], 15.0),
+ ([0, 2], 34.0),
+ ([0, 1], 37.0),
+ ([0, 1, 2], 37.0),
+ ]
diff --git a/src/cython/test/test_reader_utils.py b/src/cython/test/test_reader_utils.py
index 36e927b0..4c7b32c2 100755
--- a/src/cython/test/test_reader_utils.py
+++ b/src/cython/test/test_reader_utils.py
@@ -1,89 +1,126 @@
import gudhi
import numpy as np
-"""This file is part of the Gudhi Library. The Gudhi library
- (Geometric Understanding in Higher Dimensions) is a generic C++
- library for computational topology.
+""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ Author(s): Vincent Rouvreau
- 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
- 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/>.
+ Modification(s):
+ - YYYY/MM Author: Description of the modification
"""
__author__ = "Vincent Rouvreau"
__copyright__ = "Copyright (C) 2017 Inria"
-__license__ = "GPL v3"
+__license__ = "MIT"
def test_non_existing_csv_file():
# Try to open a non existing file
- matrix = gudhi.read_lower_triangular_matrix_from_csv_file(csv_file='pouetpouettralala.toubiloubabdou')
+ matrix = gudhi.read_lower_triangular_matrix_from_csv_file(
+ csv_file="pouetpouettralala.toubiloubabdou"
+ )
assert matrix == []
+
def test_full_square_distance_matrix_csv_file():
# Create test file
- test_file = open('full_square_distance_matrix.csv', 'w')
- test_file.write('0;1;2;3;\n1;0;4;5;\n2;4;0;6;\n3;5;6;0;')
+ test_file = open("full_square_distance_matrix.csv", "w")
+ test_file.write("0;1;2;3;\n1;0;4;5;\n2;4;0;6;\n3;5;6;0;")
test_file.close()
- matrix = gudhi.read_lower_triangular_matrix_from_csv_file(csv_file="full_square_distance_matrix.csv")
+ matrix = gudhi.read_lower_triangular_matrix_from_csv_file(
+ csv_file="full_square_distance_matrix.csv"
+ )
assert matrix == [[], [1.0], [2.0, 4.0], [3.0, 5.0, 6.0]]
+
def test_lower_triangular_distance_matrix_csv_file():
# Create test file
- test_file = open('lower_triangular_distance_matrix.csv', 'w')
- test_file.write('\n1,\n2,3,\n4,5,6,\n7,8,9,10,')
+ test_file = open("lower_triangular_distance_matrix.csv", "w")
+ test_file.write("\n1,\n2,3,\n4,5,6,\n7,8,9,10,")
test_file.close()
- matrix = gudhi.read_lower_triangular_matrix_from_csv_file(csv_file="lower_triangular_distance_matrix.csv", separator=",")
+ matrix = gudhi.read_lower_triangular_matrix_from_csv_file(
+ csv_file="lower_triangular_distance_matrix.csv", separator=","
+ )
assert matrix == [[], [1.0], [2.0, 3.0], [4.0, 5.0, 6.0], [7.0, 8.0, 9.0, 10.0]]
+
def test_non_existing_persistence_file():
# Try to open a non existing file
- persistence = gudhi.read_persistence_intervals_grouped_by_dimension(persistence_file='pouetpouettralala.toubiloubabdou')
+ persistence = gudhi.read_persistence_intervals_grouped_by_dimension(
+ persistence_file="pouetpouettralala.toubiloubabdou"
+ )
assert persistence == []
- persistence = gudhi.read_persistence_intervals_in_dimension(persistence_file='pouetpouettralala.toubiloubabdou', only_this_dim=1)
+ persistence = gudhi.read_persistence_intervals_in_dimension(
+ persistence_file="pouetpouettralala.toubiloubabdou", only_this_dim=1
+ )
np.testing.assert_array_equal(persistence, [])
+
def test_read_persistence_intervals_without_dimension():
# Create test file
- test_file = open('persistence_intervals_without_dimension.pers', 'w')
- test_file.write('# Simple persistence diagram without dimension\n2.7 3.7\n9.6 14.\n34.2 34.974\n3. inf')
+ test_file = open("persistence_intervals_without_dimension.pers", "w")
+ test_file.write(
+ "# Simple persistence diagram without dimension\n2.7 3.7\n9.6 14.\n34.2 34.974\n3. inf"
+ )
test_file.close()
- persistence = gudhi.read_persistence_intervals_in_dimension(persistence_file='persistence_intervals_without_dimension.pers')
- np.testing.assert_array_equal(persistence, [(2.7, 3.7), (9.6, 14.), (34.2, 34.974), (3., float('Inf'))])
- persistence = gudhi.read_persistence_intervals_in_dimension(persistence_file='persistence_intervals_without_dimension.pers', only_this_dim=0)
+ persistence = gudhi.read_persistence_intervals_in_dimension(
+ persistence_file="persistence_intervals_without_dimension.pers"
+ )
+ np.testing.assert_array_equal(
+ persistence, [(2.7, 3.7), (9.6, 14.0), (34.2, 34.974), (3.0, float("Inf"))]
+ )
+ persistence = gudhi.read_persistence_intervals_in_dimension(
+ persistence_file="persistence_intervals_without_dimension.pers", only_this_dim=0
+ )
np.testing.assert_array_equal(persistence, [])
- persistence = gudhi.read_persistence_intervals_in_dimension(persistence_file='persistence_intervals_without_dimension.pers', only_this_dim=1)
+ persistence = gudhi.read_persistence_intervals_in_dimension(
+ persistence_file="persistence_intervals_without_dimension.pers", only_this_dim=1
+ )
np.testing.assert_array_equal(persistence, [])
- persistence = gudhi.read_persistence_intervals_grouped_by_dimension(persistence_file='persistence_intervals_without_dimension.pers')
- assert persistence == {-1: [(2.7, 3.7), (9.6, 14.0), (34.2, 34.974), (3.0, float('Inf'))]}
+ persistence = gudhi.read_persistence_intervals_grouped_by_dimension(
+ persistence_file="persistence_intervals_without_dimension.pers"
+ )
+ assert persistence == {
+ -1: [(2.7, 3.7), (9.6, 14.0), (34.2, 34.974), (3.0, float("Inf"))]
+ }
+
def test_read_persistence_intervals_with_dimension():
# Create test file
- test_file = open('persistence_intervals_with_dimension.pers', 'w')
- test_file.write('# Simple persistence diagram with dimension\n0 2.7 3.7\n1 9.6 14.\n3 34.2 34.974\n1 3. inf')
+ test_file = open("persistence_intervals_with_dimension.pers", "w")
+ test_file.write(
+ "# Simple persistence diagram with dimension\n0 2.7 3.7\n1 9.6 14.\n3 34.2 34.974\n1 3. inf"
+ )
test_file.close()
- persistence = gudhi.read_persistence_intervals_in_dimension(persistence_file='persistence_intervals_with_dimension.pers')
- np.testing.assert_array_equal(persistence, [(2.7, 3.7), (9.6, 14.), (34.2, 34.974), (3., float('Inf'))])
- persistence = gudhi.read_persistence_intervals_in_dimension(persistence_file='persistence_intervals_with_dimension.pers', only_this_dim=0)
+ persistence = gudhi.read_persistence_intervals_in_dimension(
+ persistence_file="persistence_intervals_with_dimension.pers"
+ )
+ np.testing.assert_array_equal(
+ persistence, [(2.7, 3.7), (9.6, 14.0), (34.2, 34.974), (3.0, float("Inf"))]
+ )
+ persistence = gudhi.read_persistence_intervals_in_dimension(
+ persistence_file="persistence_intervals_with_dimension.pers", only_this_dim=0
+ )
np.testing.assert_array_equal(persistence, [(2.7, 3.7)])
- persistence = gudhi.read_persistence_intervals_in_dimension(persistence_file='persistence_intervals_with_dimension.pers', only_this_dim=1)
- np.testing.assert_array_equal(persistence, [(9.6, 14.), (3., float('Inf'))])
- persistence = gudhi.read_persistence_intervals_in_dimension(persistence_file='persistence_intervals_with_dimension.pers', only_this_dim=2)
+ persistence = gudhi.read_persistence_intervals_in_dimension(
+ persistence_file="persistence_intervals_with_dimension.pers", only_this_dim=1
+ )
+ np.testing.assert_array_equal(persistence, [(9.6, 14.0), (3.0, float("Inf"))])
+ persistence = gudhi.read_persistence_intervals_in_dimension(
+ persistence_file="persistence_intervals_with_dimension.pers", only_this_dim=2
+ )
np.testing.assert_array_equal(persistence, [])
- persistence = gudhi.read_persistence_intervals_in_dimension(persistence_file='persistence_intervals_with_dimension.pers', only_this_dim=3)
+ persistence = gudhi.read_persistence_intervals_in_dimension(
+ persistence_file="persistence_intervals_with_dimension.pers", only_this_dim=3
+ )
np.testing.assert_array_equal(persistence, [(34.2, 34.974)])
- persistence = gudhi.read_persistence_intervals_grouped_by_dimension(persistence_file='persistence_intervals_with_dimension.pers')
- assert persistence == {0: [(2.7, 3.7)], 1: [(9.6, 14.0), (3.0, float('Inf'))], 3: [(34.2, 34.974)]}
+ persistence = gudhi.read_persistence_intervals_grouped_by_dimension(
+ persistence_file="persistence_intervals_with_dimension.pers"
+ )
+ assert persistence == {
+ 0: [(2.7, 3.7)],
+ 1: [(9.6, 14.0), (3.0, float("Inf"))],
+ 3: [(34.2, 34.974)],
+ }
diff --git a/src/cython/test/test_rips_complex.py b/src/cython/test/test_rips_complex.py
index 05dfcaf7..d55ae22f 100755
--- a/src/cython/test/test_rips_complex.py
+++ b/src/cython/test/test_rips_complex.py
@@ -1,36 +1,25 @@
from gudhi import RipsComplex
from math import sqrt
-"""This file is part of the Gudhi Library. The Gudhi library
- (Geometric Understanding in Higher Dimensions) is a generic C++
- library for computational topology.
+""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ Author(s): Vincent Rouvreau
- 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
- 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/>.
+ Modification(s):
+ - YYYY/MM Author: Description of the modification
"""
__author__ = "Vincent Rouvreau"
__copyright__ = "Copyright (C) 2016 Inria"
-__license__ = "GPL v3"
+__license__ = "MIT"
def test_empty_rips():
rips_complex = RipsComplex()
+
def test_rips_from_points():
point_list = [[0, 0], [1, 0], [0, 1], [1, 1]]
rips_complex = RipsComplex(points=point_list, max_edge_length=42)
@@ -43,17 +32,30 @@ def test_rips_from_points():
assert simplex_tree.num_simplices() == 10
assert simplex_tree.num_vertices() == 4
- assert simplex_tree.get_filtration() == \
- [([0], 0.0), ([1], 0.0), ([2], 0.0), ([3], 0.0),
- ([0, 1], 1.0), ([0, 2], 1.0), ([1, 3], 1.0),
- ([2, 3], 1.0), ([1, 2], 1.4142135623730951),
- ([0, 3], 1.4142135623730951)]
- assert simplex_tree.get_star([0]) == \
- [([0], 0.0), ([0, 1], 1.0), ([0, 2], 1.0),
- ([0, 3], 1.4142135623730951)]
- assert simplex_tree.get_cofaces([0], 1) == \
- [([0, 1], 1.0), ([0, 2], 1.0),
- ([0, 3], 1.4142135623730951)]
+ assert simplex_tree.get_filtration() == [
+ ([0], 0.0),
+ ([1], 0.0),
+ ([2], 0.0),
+ ([3], 0.0),
+ ([0, 1], 1.0),
+ ([0, 2], 1.0),
+ ([1, 3], 1.0),
+ ([2, 3], 1.0),
+ ([1, 2], 1.4142135623730951),
+ ([0, 3], 1.4142135623730951),
+ ]
+ assert simplex_tree.get_star([0]) == [
+ ([0], 0.0),
+ ([0, 1], 1.0),
+ ([0, 2], 1.0),
+ ([0, 3], 1.4142135623730951),
+ ]
+ assert simplex_tree.get_cofaces([0], 1) == [
+ ([0, 1], 1.0),
+ ([0, 2], 1.0),
+ ([0, 3], 1.4142135623730951),
+ ]
+
def test_filtered_rips_from_points():
point_list = [[0, 0], [1, 0], [0, 1], [1, 1]]
@@ -67,10 +69,10 @@ def test_filtered_rips_from_points():
assert simplex_tree.num_simplices() == 8
assert simplex_tree.num_vertices() == 4
+
def test_sparse_filtered_rips_from_points():
point_list = [[0, 0], [1, 0], [0, 1], [1, 1]]
- filtered_rips = RipsComplex(points=point_list, max_edge_length=1.0,
- sparse=.001)
+ filtered_rips = RipsComplex(points=point_list, max_edge_length=1.0, sparse=0.001)
simplex_tree = filtered_rips.create_simplex_tree(max_dimension=1)
@@ -80,13 +82,10 @@ def test_sparse_filtered_rips_from_points():
assert simplex_tree.num_simplices() == 8
assert simplex_tree.num_vertices() == 4
+
def test_rips_from_distance_matrix():
- distance_matrix = [[0],
- [1, 0],
- [1, sqrt(2), 0],
- [sqrt(2), 1, 1, 0]]
- rips_complex = RipsComplex(distance_matrix=distance_matrix,
- max_edge_length=42)
+ distance_matrix = [[0], [1, 0], [1, sqrt(2), 0], [sqrt(2), 1, 1, 0]]
+ rips_complex = RipsComplex(distance_matrix=distance_matrix, max_edge_length=42)
simplex_tree = rips_complex.create_simplex_tree(max_dimension=1)
@@ -96,25 +95,34 @@ def test_rips_from_distance_matrix():
assert simplex_tree.num_simplices() == 10
assert simplex_tree.num_vertices() == 4
- assert simplex_tree.get_filtration() == \
- [([0], 0.0), ([1], 0.0), ([2], 0.0), ([3], 0.0),
- ([0, 1], 1.0), ([0, 2], 1.0), ([1, 3], 1.0),
- ([2, 3], 1.0), ([1, 2], 1.4142135623730951),
- ([0, 3], 1.4142135623730951)]
- assert simplex_tree.get_star([0]) == \
- [([0], 0.0), ([0, 1], 1.0), ([0, 2], 1.0),
- ([0, 3], 1.4142135623730951)]
- assert simplex_tree.get_cofaces([0], 1) == \
- [([0, 1], 1.0), ([0, 2], 1.0),
- ([0, 3], 1.4142135623730951)]
+ assert simplex_tree.get_filtration() == [
+ ([0], 0.0),
+ ([1], 0.0),
+ ([2], 0.0),
+ ([3], 0.0),
+ ([0, 1], 1.0),
+ ([0, 2], 1.0),
+ ([1, 3], 1.0),
+ ([2, 3], 1.0),
+ ([1, 2], 1.4142135623730951),
+ ([0, 3], 1.4142135623730951),
+ ]
+ assert simplex_tree.get_star([0]) == [
+ ([0], 0.0),
+ ([0, 1], 1.0),
+ ([0, 2], 1.0),
+ ([0, 3], 1.4142135623730951),
+ ]
+ assert simplex_tree.get_cofaces([0], 1) == [
+ ([0, 1], 1.0),
+ ([0, 2], 1.0),
+ ([0, 3], 1.4142135623730951),
+ ]
+
def test_filtered_rips_from_distance_matrix():
- distance_matrix = [[0],
- [1, 0],
- [1, sqrt(2), 0],
- [sqrt(2), 1, 1, 0]]
- filtered_rips = RipsComplex(distance_matrix=distance_matrix,
- max_edge_length=1.0)
+ distance_matrix = [[0], [1, 0], [1, sqrt(2), 0], [sqrt(2), 1, 1, 0]]
+ filtered_rips = RipsComplex(distance_matrix=distance_matrix, max_edge_length=1.0)
simplex_tree = filtered_rips.create_simplex_tree(max_dimension=1)
diff --git a/src/cython/test/test_simplex_tree.py b/src/cython/test/test_simplex_tree.py
index cb701c9a..8d8971c1 100755
--- a/src/cython/test/test_simplex_tree.py
+++ b/src/cython/test/test_simplex_tree.py
@@ -1,30 +1,18 @@
from gudhi import SimplexTree
-"""This file is part of the Gudhi Library. The Gudhi library
- (Geometric Understanding in Higher Dimensions) is a generic C++
- library for computational topology.
+""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ Author(s): Vincent Rouvreau
- 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
- 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/>.
+ Modification(s):
+ - YYYY/MM Author: Description of the modification
"""
__author__ = "Vincent Rouvreau"
__copyright__ = "Copyright (C) 2016 Inria"
-__license__ = "GPL v3"
+__license__ = "MIT"
def test_insertion():
@@ -51,7 +39,7 @@ def test_insertion():
assert st.find([0]) == True
assert st.find([1]) == True
assert st.find([2]) == True
- assert st.find([3]) == False
+ assert st.find([3]) == False
assert st.find([0, 3]) == False
assert st.find([1, 3]) == False
assert st.find([2, 3]) == False
@@ -67,21 +55,36 @@ def test_insertion():
assert st.filtration([1]) == 0.0
# skeleton test
- assert st.get_skeleton(2) == \
- [([0, 1, 2], 4.0), ([0, 1], 0.0), ([0, 2], 4.0),
- ([0], 0.0), ([1, 2], 4.0), ([1], 0.0), ([2], 4.0)]
- assert st.get_skeleton(1) == \
- [([0, 1], 0.0), ([0, 2], 4.0), ([0], 0.0),
- ([1, 2], 4.0), ([1], 0.0), ([2], 4.0)]
- assert st.get_skeleton(0) == \
- [([0], 0.0), ([1], 0.0), ([2], 4.0)]
+ assert st.get_skeleton(2) == [
+ ([0, 1, 2], 4.0),
+ ([0, 1], 0.0),
+ ([0, 2], 4.0),
+ ([0], 0.0),
+ ([1, 2], 4.0),
+ ([1], 0.0),
+ ([2], 4.0),
+ ]
+ assert st.get_skeleton(1) == [
+ ([0, 1], 0.0),
+ ([0, 2], 4.0),
+ ([0], 0.0),
+ ([1, 2], 4.0),
+ ([1], 0.0),
+ ([2], 4.0),
+ ]
+ assert st.get_skeleton(0) == [([0], 0.0), ([1], 0.0), ([2], 4.0)]
# remove_maximal_simplex test
assert st.get_cofaces([0, 1, 2], 1) == []
st.remove_maximal_simplex([0, 1, 2])
- assert st.get_skeleton(2) == \
- [([0, 1], 0.0), ([0, 2], 4.0), ([0], 0.0),
- ([1, 2], 4.0), ([1], 0.0), ([2], 4.0)]
+ assert st.get_skeleton(2) == [
+ ([0, 1], 0.0),
+ ([0, 2], 4.0),
+ ([0], 0.0),
+ ([1, 2], 4.0),
+ ([1], 0.0),
+ ([2], 4.0),
+ ]
assert st.find([0, 1, 2]) == False
assert st.find([0, 1]) == True
assert st.find([0, 2]) == True
@@ -90,7 +93,10 @@ def test_insertion():
assert st.find([2]) == True
st.initialize_filtration()
- assert st.persistence(persistence_dim_max = True) == [(1, (4.0, float('inf'))), (0, (0.0, float('inf')))]
+ assert st.persistence(persistence_dim_max=True) == [
+ (1, (4.0, float("inf"))),
+ (0, (0.0, float("inf"))),
+ ]
assert st.__is_persistence_defined() == True
assert st.betti_numbers() == [1, 1]
@@ -100,6 +106,7 @@ def test_insertion():
assert st.persistent_betti_numbers(4.0, 10000.0) == [1, 1]
assert st.persistent_betti_numbers(9999.0, 10000.0) == [1, 1]
+
def test_expansion():
st = SimplexTree()
assert st.__is_defined() == True
@@ -119,21 +126,56 @@ def test_expansion():
assert st.num_vertices() == 7
assert st.num_simplices() == 17
- assert st.get_filtration() == [([2], 0.1), ([3], 0.1), ([2, 3], 0.1),
- ([0], 0.2), ([0, 2], 0.2), ([1], 0.3), ([0, 1], 0.3), ([1, 3], 0.4),
- ([1, 2], 0.5), ([5], 0.6), ([6], 0.6), ([5, 6], 0.6), ([4], 0.7),
- ([2, 4], 0.7), ([0, 3], 0.8), ([4, 6], 0.9), ([3, 6], 1.0)]
+ assert st.get_filtration() == [
+ ([2], 0.1),
+ ([3], 0.1),
+ ([2, 3], 0.1),
+ ([0], 0.2),
+ ([0, 2], 0.2),
+ ([1], 0.3),
+ ([0, 1], 0.3),
+ ([1, 3], 0.4),
+ ([1, 2], 0.5),
+ ([5], 0.6),
+ ([6], 0.6),
+ ([5, 6], 0.6),
+ ([4], 0.7),
+ ([2, 4], 0.7),
+ ([0, 3], 0.8),
+ ([4, 6], 0.9),
+ ([3, 6], 1.0),
+ ]
st.expansion(3)
assert st.num_vertices() == 7
assert st.num_simplices() == 22
st.initialize_filtration()
- assert st.get_filtration() == [([2], 0.1), ([3], 0.1), ([2, 3], 0.1),
- ([0], 0.2), ([0, 2], 0.2), ([1], 0.3), ([0, 1], 0.3), ([1, 3], 0.4),
- ([1, 2], 0.5), ([0, 1, 2], 0.5), ([1, 2, 3], 0.5), ([5], 0.6), ([6], 0.6),
- ([5, 6], 0.6), ([4], 0.7), ([2, 4], 0.7), ([0, 3], 0.8), ([0, 1, 3], 0.8),
- ([0, 2, 3], 0.8), ([0, 1, 2, 3], 0.8), ([4, 6], 0.9), ([3, 6], 1.0)]
+ assert st.get_filtration() == [
+ ([2], 0.1),
+ ([3], 0.1),
+ ([2, 3], 0.1),
+ ([0], 0.2),
+ ([0, 2], 0.2),
+ ([1], 0.3),
+ ([0, 1], 0.3),
+ ([1, 3], 0.4),
+ ([1, 2], 0.5),
+ ([0, 1, 2], 0.5),
+ ([1, 2, 3], 0.5),
+ ([5], 0.6),
+ ([6], 0.6),
+ ([5, 6], 0.6),
+ ([4], 0.7),
+ ([2, 4], 0.7),
+ ([0, 3], 0.8),
+ ([0, 1, 3], 0.8),
+ ([0, 2, 3], 0.8),
+ ([0, 1, 2, 3], 0.8),
+ ([4, 6], 0.9),
+ ([3, 6], 1.0),
+ ]
+
def test_automatic_dimension():
st = SimplexTree()
@@ -141,8 +183,8 @@ def test_automatic_dimension():
assert st.__is_persistence_defined() == False
# insert test
- assert st.insert([0,1,3], filtration=0.5) == True
- assert st.insert([0,1,2], filtration=1.) == True
+ assert st.insert([0, 1, 3], filtration=0.5) == True
+ assert st.insert([0, 1, 2], filtration=1.0) == True
assert st.num_vertices() == 4
assert st.num_simplices() == 11
@@ -162,6 +204,7 @@ def test_automatic_dimension():
assert st.dimension() == 1
assert st.upper_bound_dimension() == 1
+
def test_make_filtration_non_decreasing():
st = SimplexTree()
assert st.__is_defined() == True
@@ -183,25 +226,25 @@ def test_make_filtration_non_decreasing():
# 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);
+ 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);
+ 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.
+ assert st.filtration([0, 1, 6, 7]) == 1.0
+ assert st.filtration([0, 1, 6]) == 1.0
+ assert st.filtration([0, 1]) == 1.0
+ assert st.filtration([0]) == 1.0
+ assert st.filtration([1]) == 1.0
+ assert st.filtration([3, 4, 5]) == 2.0
+ assert st.filtration([3, 4]) == 2.0
+ assert st.filtration([4, 5]) == 2.0
diff --git a/src/cython/test/test_subsampling.py b/src/cython/test/test_subsampling.py
index 96906a6f..c816e203 100755
--- a/src/cython/test/test_subsampling.py
+++ b/src/cython/test/test_subsampling.py
@@ -1,30 +1,18 @@
import gudhi
-"""This file is part of the Gudhi Library. The Gudhi library
- (Geometric Understanding in Higher Dimensions) is a generic C++
- library for computational topology.
+""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ Author(s): Vincent Rouvreau
- 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
- 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/>.
+ Modification(s):
+ - YYYY/MM Author: Description of the modification
"""
__author__ = "Vincent Rouvreau"
__copyright__ = "Copyright (C) 2016 Inria"
-__license__ = "GPL v3"
+__license__ = "MIT"
def test_write_off_file_for_tests():
@@ -40,45 +28,72 @@ def test_write_off_file_for_tests():
file.write("9.0 17.0\n")
file.close()
+
def test_simple_choose_n_farthest_points_with_a_starting_point():
- point_set = [[0,1], [0,0], [1,0], [1,1]]
+ point_set = [[0, 1], [0, 0], [1, 0], [1, 1]]
i = 0
for point in point_set:
# The iteration starts with the given starting point
- sub_set = gudhi.choose_n_farthest_points(points = point_set, nb_points = 1, starting_point = i)
+ sub_set = gudhi.choose_n_farthest_points(
+ points=point_set, nb_points=1, starting_point=i
+ )
assert sub_set[0] == point_set[i]
i = i + 1
# The iteration finds then the farthest
- sub_set = gudhi.choose_n_farthest_points(points = point_set, nb_points = 2, starting_point = 1)
+ sub_set = gudhi.choose_n_farthest_points(
+ points=point_set, nb_points=2, starting_point=1
+ )
assert sub_set[1] == point_set[3]
- sub_set = gudhi.choose_n_farthest_points(points = point_set, nb_points = 2, starting_point = 3)
+ sub_set = gudhi.choose_n_farthest_points(
+ points=point_set, nb_points=2, starting_point=3
+ )
assert sub_set[1] == point_set[1]
- sub_set = gudhi.choose_n_farthest_points(points = point_set, nb_points = 2, starting_point = 0)
+ sub_set = gudhi.choose_n_farthest_points(
+ points=point_set, nb_points=2, starting_point=0
+ )
assert sub_set[1] == point_set[2]
- sub_set = gudhi.choose_n_farthest_points(points = point_set, nb_points = 2, starting_point = 2)
+ sub_set = gudhi.choose_n_farthest_points(
+ points=point_set, nb_points=2, starting_point=2
+ )
assert sub_set[1] == point_set[0]
# Test the limits
- assert gudhi.choose_n_farthest_points(points = [], nb_points = 0, starting_point = 0) == []
- assert gudhi.choose_n_farthest_points(points = [], nb_points = 1, starting_point = 0) == []
- assert gudhi.choose_n_farthest_points(points = [], nb_points = 0, starting_point = 1) == []
- assert gudhi.choose_n_farthest_points(points = [], nb_points = 1, starting_point = 1) == []
+ assert (
+ gudhi.choose_n_farthest_points(points=[], nb_points=0, starting_point=0) == []
+ )
+ assert (
+ gudhi.choose_n_farthest_points(points=[], nb_points=1, starting_point=0) == []
+ )
+ assert (
+ gudhi.choose_n_farthest_points(points=[], nb_points=0, starting_point=1) == []
+ )
+ assert (
+ gudhi.choose_n_farthest_points(points=[], nb_points=1, starting_point=1) == []
+ )
# From off file test
- for i in range (0, 7):
- assert len(gudhi.choose_n_farthest_points(off_file = 'subsample.off', nb_points = i, starting_point = i)) == i
+ for i in range(0, 7):
+ assert (
+ len(
+ gudhi.choose_n_farthest_points(
+ off_file="subsample.off", nb_points=i, starting_point=i
+ )
+ )
+ == i
+ )
+
def test_simple_choose_n_farthest_points_randomed():
- point_set = [[0,1], [0,0], [1,0], [1,1]]
+ point_set = [[0, 1], [0, 0], [1, 0], [1, 1]]
# Test the limits
- assert gudhi.choose_n_farthest_points(points = [], nb_points = 0) == []
- assert gudhi.choose_n_farthest_points(points = [], nb_points = 1) == []
- assert gudhi.choose_n_farthest_points(points = point_set, nb_points = 0) == []
+ assert gudhi.choose_n_farthest_points(points=[], nb_points=0) == []
+ assert gudhi.choose_n_farthest_points(points=[], nb_points=1) == []
+ assert gudhi.choose_n_farthest_points(points=point_set, nb_points=0) == []
# Go furter than point set on purpose
- for iter in range(1,10):
- sub_set = gudhi.choose_n_farthest_points(points = point_set, nb_points = iter)
+ for iter in range(1, 10):
+ sub_set = gudhi.choose_n_farthest_points(points=point_set, nb_points=iter)
for sub in sub_set:
found = False
for point in point_set:
@@ -88,19 +103,23 @@ def test_simple_choose_n_farthest_points_randomed():
assert found == True
# From off file test
- for i in range (0, 7):
- assert len(gudhi.choose_n_farthest_points(off_file = 'subsample.off', nb_points = i)) == i
+ for i in range(0, 7):
+ assert (
+ len(gudhi.choose_n_farthest_points(off_file="subsample.off", nb_points=i))
+ == i
+ )
+
def test_simple_pick_n_random_points():
- point_set = [[0,1], [0,0], [1,0], [1,1]]
+ point_set = [[0, 1], [0, 0], [1, 0], [1, 1]]
# Test the limits
- assert gudhi.pick_n_random_points(points = [], nb_points = 0) == []
- assert gudhi.pick_n_random_points(points = [], nb_points = 1) == []
- assert gudhi.pick_n_random_points(points = point_set, nb_points = 0) == []
+ assert gudhi.pick_n_random_points(points=[], nb_points=0) == []
+ assert gudhi.pick_n_random_points(points=[], nb_points=1) == []
+ assert gudhi.pick_n_random_points(points=point_set, nb_points=0) == []
# Go furter than point set on purpose
- for iter in range(1,10):
- sub_set = gudhi.pick_n_random_points(points = point_set, nb_points = iter)
+ for iter in range(1, 10):
+ sub_set = gudhi.pick_n_random_points(points=point_set, nb_points=iter)
print(5)
for sub in sub_set:
found = False
@@ -111,23 +130,50 @@ def test_simple_pick_n_random_points():
assert found == True
# From off file test
- for i in range (0, 7):
- assert len(gudhi.pick_n_random_points(off_file = 'subsample.off', nb_points = i)) == i
+ for i in range(0, 7):
+ assert (
+ len(gudhi.pick_n_random_points(off_file="subsample.off", nb_points=i)) == i
+ )
+
def test_simple_sparsify_points():
- point_set = [[0,1], [0,0], [1,0], [1,1]]
+ point_set = [[0, 1], [0, 0], [1, 0], [1, 1]]
# Test the limits
# assert gudhi.sparsify_point_set(points = [], min_squared_dist = 0.0) == []
# assert gudhi.sparsify_point_set(points = [], min_squared_dist = 10.0) == []
- assert gudhi.sparsify_point_set(points = point_set, min_squared_dist = 0.0) == point_set
- assert gudhi.sparsify_point_set(points = point_set, min_squared_dist = 1.0) == point_set
- assert gudhi.sparsify_point_set(points = point_set, min_squared_dist = 2.0) == [[0,1], [1,0]]
- assert gudhi.sparsify_point_set(points = point_set, min_squared_dist = 2.01) == [[0,1]]
-
- assert len(gudhi.sparsify_point_set(off_file = 'subsample.off', min_squared_dist = 0.0)) == 7
- assert len(gudhi.sparsify_point_set(off_file = 'subsample.off', min_squared_dist = 30.0)) == 5
- assert len(gudhi.sparsify_point_set(off_file = 'subsample.off', min_squared_dist = 40.0)) == 4
- assert len(gudhi.sparsify_point_set(off_file = 'subsample.off', min_squared_dist = 90.0)) == 3
- assert len(gudhi.sparsify_point_set(off_file = 'subsample.off', min_squared_dist = 100.0)) == 2
- assert len(gudhi.sparsify_point_set(off_file = 'subsample.off', min_squared_dist = 325.0)) == 2
- assert len(gudhi.sparsify_point_set(off_file = 'subsample.off', min_squared_dist = 325.01)) == 1
+ assert gudhi.sparsify_point_set(points=point_set, min_squared_dist=0.0) == point_set
+ assert gudhi.sparsify_point_set(points=point_set, min_squared_dist=1.0) == point_set
+ assert gudhi.sparsify_point_set(points=point_set, min_squared_dist=2.0) == [
+ [0, 1],
+ [1, 0],
+ ]
+ assert gudhi.sparsify_point_set(points=point_set, min_squared_dist=2.01) == [[0, 1]]
+
+ assert (
+ len(gudhi.sparsify_point_set(off_file="subsample.off", min_squared_dist=0.0))
+ == 7
+ )
+ assert (
+ len(gudhi.sparsify_point_set(off_file="subsample.off", min_squared_dist=30.0))
+ == 5
+ )
+ assert (
+ len(gudhi.sparsify_point_set(off_file="subsample.off", min_squared_dist=40.0))
+ == 4
+ )
+ assert (
+ len(gudhi.sparsify_point_set(off_file="subsample.off", min_squared_dist=90.0))
+ == 3
+ )
+ assert (
+ len(gudhi.sparsify_point_set(off_file="subsample.off", min_squared_dist=100.0))
+ == 2
+ )
+ assert (
+ len(gudhi.sparsify_point_set(off_file="subsample.off", min_squared_dist=325.0))
+ == 2
+ )
+ assert (
+ len(gudhi.sparsify_point_set(off_file="subsample.off", min_squared_dist=325.01))
+ == 1
+ )
diff --git a/src/cython/test/test_tangential_complex.py b/src/cython/test/test_tangential_complex.py
index 5c62f278..0f828d8e 100755
--- a/src/cython/test/test_tangential_complex.py
+++ b/src/cython/test/test_tangential_complex.py
@@ -1,35 +1,23 @@
from gudhi import TangentialComplex, SimplexTree
-"""This file is part of the Gudhi Library. The Gudhi library
- (Geometric Understanding in Higher Dimensions) is a generic C++
- library for computational topology.
+""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ Author(s): Vincent Rouvreau
- 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
- 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/>.
+ Modification(s):
+ - YYYY/MM Author: Description of the modification
"""
__author__ = "Vincent Rouvreau"
__copyright__ = "Copyright (C) 2016 Inria"
-__license__ = "GPL v3"
+__license__ = "MIT"
def test_tangential():
point_list = [[0.0, 0.0], [1.0, 0.0], [0.0, 1.0], [1.0, 1.0]]
- tc = TangentialComplex(intrisic_dim = 1, points=point_list)
+ tc = TangentialComplex(intrisic_dim=1, points=point_list)
assert tc.__is_defined() == True
assert tc.num_vertices() == 4
assert tc.num_simplices() == 0
@@ -48,11 +36,17 @@ def test_tangential():
assert st.num_simplices() == 6
assert st.num_vertices() == 4
-
- assert st.get_filtration() == \
- [([0], 0.0), ([1], 0.0), ([2], 0.0), ([0, 2], 0.0), ([3], 0.0), ([1, 3], 0.0)]
+
+ assert st.get_filtration() == [
+ ([0], 0.0),
+ ([1], 0.0),
+ ([2], 0.0),
+ ([0, 2], 0.0),
+ ([3], 0.0),
+ ([1, 3], 0.0),
+ ]
assert st.get_cofaces([0], 1) == [([0, 2], 0.0)]
-
+
assert point_list[0] == tc.get_point(0)
assert point_list[1] == tc.get_point(1)
assert point_list[2] == tc.get_point(2)
diff --git a/src/cython/test/test_witness_complex.py b/src/cython/test/test_witness_complex.py
index bcbc521b..36ced635 100755
--- a/src/cython/test/test_witness_complex.py
+++ b/src/cython/test/test_witness_complex.py
@@ -1,62 +1,62 @@
from gudhi import WitnessComplex, StrongWitnessComplex, SimplexTree
-"""This file is part of the Gudhi Library. The Gudhi library
- (Geometric Understanding in Higher Dimensions) is a generic C++
- library for computational topology.
+""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
+ See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
+ Author(s): Vincent Rouvreau
- 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
- 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/>.
+ Modification(s):
+ - YYYY/MM Author: Description of the modification
"""
__author__ = "Vincent Rouvreau"
__copyright__ = "Copyright (C) 2016 Inria"
-__license__ = "GPL v3"
+__license__ = "MIT"
def test_empty_witness_complex():
witness = WitnessComplex()
assert witness.__is_defined() == False
+
def test_witness_complex():
- nearest_landmark_table = [[[0, 0], [1, 1], [2, 2], [3, 3], [4, 4]],
- [[1, 0], [2, 1], [3, 2], [4, 3], [0, 4]],
- [[2, 0], [3, 1], [4, 2], [0, 3], [1, 4]],
- [[3, 0], [4, 1], [0, 2], [1, 3], [2, 4]],
- [[4, 0], [0, 1], [1, 2], [2, 3], [3, 4]]]
+ nearest_landmark_table = [
+ [[0, 0], [1, 1], [2, 2], [3, 3], [4, 4]],
+ [[1, 0], [2, 1], [3, 2], [4, 3], [0, 4]],
+ [[2, 0], [3, 1], [4, 2], [0, 3], [1, 4]],
+ [[3, 0], [4, 1], [0, 2], [1, 3], [2, 4]],
+ [[4, 0], [0, 1], [1, 2], [2, 3], [3, 4]],
+ ]
witness_complex = WitnessComplex(nearest_landmark_table=nearest_landmark_table)
simplex_tree = witness_complex.create_simplex_tree(max_alpha_square=4.1)
assert simplex_tree.num_vertices() == 5
assert simplex_tree.num_simplices() == 31
- simplex_tree = witness_complex.create_simplex_tree(max_alpha_square=4.1, limit_dimension=2)
+ simplex_tree = witness_complex.create_simplex_tree(
+ max_alpha_square=4.1, limit_dimension=2
+ )
assert simplex_tree.num_vertices() == 5
assert simplex_tree.num_simplices() == 25
-def test_strong_witness_complex():
- nearest_landmark_table = [[[0, 0], [1, 1], [2, 2], [3, 3], [4, 4]],
- [[1, 0], [2, 1], [3, 2], [4, 3], [0, 4]],
- [[2, 0], [3, 1], [4, 2], [0, 3], [1, 4]],
- [[3, 0], [4, 1], [0, 2], [1, 3], [2, 4]],
- [[4, 0], [0, 1], [1, 2], [2, 3], [3, 4]]]
- strong_witness_complex = StrongWitnessComplex(nearest_landmark_table=nearest_landmark_table)
+def test_strong_witness_complex():
+ nearest_landmark_table = [
+ [[0, 0], [1, 1], [2, 2], [3, 3], [4, 4]],
+ [[1, 0], [2, 1], [3, 2], [4, 3], [0, 4]],
+ [[2, 0], [3, 1], [4, 2], [0, 3], [1, 4]],
+ [[3, 0], [4, 1], [0, 2], [1, 3], [2, 4]],
+ [[4, 0], [0, 1], [1, 2], [2, 3], [3, 4]],
+ ]
+
+ strong_witness_complex = StrongWitnessComplex(
+ nearest_landmark_table=nearest_landmark_table
+ )
simplex_tree = strong_witness_complex.create_simplex_tree(max_alpha_square=4.1)
assert simplex_tree.num_vertices() == 5
assert simplex_tree.num_simplices() == 31
- simplex_tree = strong_witness_complex.create_simplex_tree(max_alpha_square=4.1, limit_dimension=2)
+ simplex_tree = strong_witness_complex.create_simplex_tree(
+ max_alpha_square=4.1, limit_dimension=2
+ )
assert simplex_tree.num_vertices() == 5
assert simplex_tree.num_simplices() == 25