Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New package: Frechet Distance #8284

Open
wants to merge 362 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 132 commits
Commits
Show all changes
362 commits
Select commit Hold shift + click to select a range
7f57547
Add Polyline_traits_3 and add comments where we have to fix things
afabri May 1, 2024
45d4dee
Fix compile errors.
May 2, 2024
348a9cb
Back to 2D
afabri May 1, 2024
dc78a17
Change from where data are read to get ready for the testsuite; type…
afabri May 1, 2024
8a550b8
Deal with examples (ha ha)
afabri May 1, 2024
dcf639f
Remove stub of Polyline_d package.
May 2, 2024
d7f4f4d
Make bichromaticFarthestDistance faster and high-dimensional.
May 2, 2024
a7a23ef
Also use K::dimension everywhere in high_level_predicates.h
May 2, 2024
9b18db8
Remove it later. only needed to learn how to determine features
afabri May 15, 2024
210b447
RealType -> Lambda
afabri May 29, 2024
08beeea
cleanup
afabri May 30, 2024
673efd5
Minimize traits class; parameterize with Curve
afabri Jun 4, 2024
a3662eb
Add doxygen
afabri Jun 4, 2024
9196109
rename traits classes
afabri Jun 4, 2024
a4687d4
less #include
afabri Jun 4, 2024
fcb4a1c
Add dD (not working yet)
afabri Jun 5, 2024
ec56c66
Kernel: Add a BBox class with dimension as parameter
afabri Jun 5, 2024
f519646
fixes for clang
afabri Jun 5, 2024
8dc8330
Remove files that were accidentally added
afabri Jun 12, 2024
fec3910
Add nested typedefs as mentioned in Issue #8256
afabri Jun 12, 2024
87f9366
Improve documentation
afabri Jun 14, 2024
d742cfb
merge master
afabri Jun 14, 2024
ca9b25c
rename thumbnail
sloriot Jun 14, 2024
e8d87e5
license identifier
afabri Jun 14, 2024
27cccc8
Copyright also for GF
afabri Jun 14, 2024
2a17b4d
Add concept
afabri Jun 14, 2024
ae74ef6
Fix SPDX-License-Identifier
afabri Jun 14, 2024
5852607
Rename package, remove default for epsilon
afabri Jun 18, 2024
05b8e19
rename concept
afabri Jun 18, 2024
5b7629f
User Manual, rename tags, add example
afabri Jun 18, 2024
c030c3a
Remove .clang-format file
afabri Jun 18, 2024
bfc7695
typo in example
afabri Jun 18, 2024
0ddf866
shorten license
sloriot Jun 18, 2024
1d1f5e9
compile all examples
sloriot Jun 18, 2024
79f5d10
fix project name
sloriot Jun 18, 2024
172b124
add missing example
sloriot Jun 18, 2024
4cde28c
TWS
sloriot Jun 18, 2024
513f9fe
cleanup
afabri Jun 18, 2024
b32db65
Change package title
afabri Jun 18, 2024
c0d7d47
curve -> polyline
afabri Jun 18, 2024
e183ddd
mention Epick
afabri Jun 18, 2024
a68019f
Fix license file
afabri Jun 18, 2024
effc03c
Add to user manual.
Jun 18, 2024
a3f2b33
drop 'continuous_'
afabri Jun 19, 2024
9f2ef30
Fix path to data for the DS test (which compiles and runs without ass…
afabri Jun 19, 2024
64d5a6e
Add test for a minimal traits (WIP)
afabri Jun 19, 2024
c480984
Add teaser image and credits.
Jun 19, 2024
1838916
Another pass over the user manual.
Jun 19, 2024
60e7fae
check if Kernel provides the nested type
sloriot Jun 19, 2024
2c0ba99
add minimal converter
sloriot Jun 19, 2024
f2c51a8
fix compilation issues detected by g++
sloriot Jun 19, 2024
eee97d7
get rid of filtered tag everywhere
sloriot Jun 19, 2024
82c8584
Rename functions
afabri Jun 19, 2024
793b9d7
Rename functions
afabri Jun 19, 2024
5a930c6
try to please msvc
sloriot Jun 19, 2024
d2d84df
fix
afabri Jun 19, 2024
c5c4fcb
missing renaming
sloriot Jun 19, 2024
e33ef39
fix compilation issues
sloriot Jun 19, 2024
7a03762
Fix two typos in the user manual.
Jun 19, 2024
6638dec
Fix +=; Add first tests
afabri Jun 20, 2024
cf6996b
typo in Epick_d doc
afabri Jun 20, 2024
48d734c
typo in Epick_d doc
afabri Jun 20, 2024
4bc2770
Constructor from a range of pairs of numbers
afabri Jun 20, 2024
8ef1f72
Add missing parameter; (std::min)
afabri Jul 16, 2024
f4371f2
Replace function names and address comments of co-authors
afabri Jul 16, 2024
a278b1a
cleanup
afabri Jul 16, 2024
12e7466
tws
afabri Jul 17, 2024
ebf1b37
replace ...
afabri Jul 17, 2024
28d05e6
Add some words regarding the algorithm to the user manual.
Jul 26, 2024
570433d
Protect min/max for VC++
afabri Aug 13, 2024
0c9cb3d
CGAL_assertion ( uses also 'e')
afabri Aug 13, 2024
d162bcd
Merge branch 'master' into Frechet-dev
afabri Aug 14, 2024
b83bcc4
Merge branch 'master' into Kernel_23-Bbox_d-ign
afabri Aug 14, 2024
2b4dfa0
Merge branch 'Kernel_23-Bbox_d-ign' into Frechet-dev
afabri Aug 14, 2024
160cb3e
Fix header file names
afabri Aug 14, 2024
a432d96
Fix header
afabri Aug 14, 2024
0cc387e
Typo in doc
afabri Aug 14, 2024
68ecd6d
WIP for ConstructBbox (also on purpose CamelCase)
afabri Aug 14, 2024
9ade3d2
WIP: after my conversation with myself on github
afabri Aug 14, 2024
61ae325
Fix template parameter
afabri Aug 15, 2024
08389c7
Add include
afabri Aug 15, 2024
fe7c37b
Stumbling forward, but does still not compile
afabri Aug 19, 2024
63dd907
Add top down
afabri Aug 19, 2024
d2b1ea7
use consistent naming
sloriot Aug 19, 2024
6650de8
WIP: apply the functor
afabri Aug 19, 2024
6d11389
got it working for Epick and #if 0 the block with Epeck as WIP
afabri Aug 19, 2024
7133b28
functor is a construction and not a computation
sloriot Aug 22, 2024
7ab31a8
make it compile
sloriot Aug 22, 2024
316ab90
Clean up
mglisse Aug 22, 2024
ab06574
Merge remote-tracking branch 'cgal/master' into Kernel_23-Bbox_d-ign
afabri Sep 9, 2024
33ebf55
Merge remote-tracking branch 'cgal/master' into Frechet-dev
afabri Sep 9, 2024
5bfb293
fix merge conflict
afabri Sep 9, 2024
5138ed7
Fix the Bbox type for dD
afabri Sep 10, 2024
58e269a
Add FT to Cartesian_base_d
afabri Sep 17, 2024
d97a059
WIP for dD
afabri Sep 17, 2024
a928261
Use Kernel_d_interface; Add temporarily typedf void Point_2/3
afabri Sep 17, 2024
e4abda3
Add typedef C2A C2F; Should be unified
afabri Sep 17, 2024
a35518d
Use functor
afabri Sep 17, 2024
de478da
more functors
afabri Sep 17, 2024
5792bcb
Introduce Curve_base<T,dim>
afabri Sep 17, 2024
b03e9a8
remove temporarily added typedefs
afabri Sep 17, 2024
aa13a0d
remove temporarily added typedefs
afabri Sep 17, 2024
972b99b
add construct vector from 2 points
sloriot Sep 18, 2024
bb02ee2
add converter as template parameter
sloriot Sep 18, 2024
f830b5c
Move converters to Curve_base
afabri Sep 18, 2024
44a0be7
CI fixes
afabri Sep 18, 2024
c0fa690
cleanup
afabri Sep 18, 2024
b506547
Simplify if/else
afabri Sep 18, 2024
73240e0
Add a constexpr
afabri Sep 18, 2024
40491bb
Remove a typename. Does that fix the CI ?
afabri Sep 18, 2024
4c669e6
dependencies
afabri Sep 18, 2024
ec543b0
eigen is needed when using NewKernel_d
sloriot Sep 19, 2024
eea3f20
Fix the order of the parameters
afabri Sep 20, 2024
f13279d
As we changed smaller to larger we have to negate when testing agains…
afabri Sep 20, 2024
c440b83
Access points[] only through fct points(int)
afabri Sep 20, 2024
d6b7e36
Towards proper traits classes
afabri Sep 20, 2024
3969958
Add documentation of the concept of the traits class
afabri Sep 20, 2024
b7cc075
Add Get_exact_kernel.h
afabri Sep 20, 2024
7ef1a76
Document kernel converters
afabri Sep 20, 2024
f5ce958
dim -> dimension (CI)
afabri Sep 20, 2024
fca7d67
Only link with Eigen in the dD case
afabri Sep 20, 2024
88d50eb
Fix Doxyfile.in
afabri Sep 20, 2024
5b48a3c
Filtered_ -> Approximate_
afabri Oct 22, 2024
d65b689
more renaming
afabri Oct 22, 2024
46c0353
fix warnings
sloriot Oct 25, 2024
784ea58
add copy/init from the same type but with the opposite caching strategy
sloriot Oct 25, 2024
48dfdb4
factorize implementation
sloriot Oct 25, 2024
6c9d514
WIP
sloriot Oct 30, 2024
fb689fa
still WIP
sloriot Oct 30, 2024
28db6f3
factorize curve
sloriot Oct 31, 2024
95d810f
start following the concept
sloriot Oct 31, 2024
48b204b
compilation errors
sloriot Oct 31, 2024
e76b975
make it work with SC<ER>
sloriot Oct 31, 2024
6c3b548
always use Interval for prefix_length as it is used in filters
sloriot Nov 6, 2024
7f8d80a
remove sqrt
sloriot Nov 7, 2024
f216e31
doc fixes
sloriot Nov 5, 2024
7f0a121
using functor to iterator over coordinates
sloriot Nov 5, 2024
107ed0f
remove useless abs
sloriot Nov 7, 2024
aa009bc
do not use interval for SC<double>
sloriot Nov 7, 2024
9945425
use traits object functions
sloriot Nov 7, 2024
f0ef1af
avoid exception
sloriot Nov 7, 2024
a13d326
fix EPICK implementation
sloriot Nov 7, 2024
e3458be
missing return type
sloriot Nov 7, 2024
a173749
test all kernels
sloriot Nov 7, 2024
a1cd361
conditional testing
sloriot Nov 7, 2024
e1f5a1b
no need to construct points
sloriot Nov 7, 2024
c2d7402
add filtering for EPECK too
sloriot Nov 14, 2024
b3f420e
add filtering also for Kernel with no filtering
sloriot Nov 14, 2024
5bb5aa9
enable filtering with exact nt with custom traits
sloriot Nov 14, 2024
759fc87
enable filtering for Epick_d
sloriot Nov 14, 2024
0b6b64a
do not change the rounding mode since protector is already created be…
sloriot Nov 15, 2024
efc600e
Merge remote-tracking branch 'cgal/master'
sloriot Nov 15, 2024
d61a3e3
Merge pull request #8611 from sloriot/NT-sqrt_rounding
sloriot Nov 15, 2024
090154d
fix copy/paste issues
sloriot Nov 15, 2024
9a0dd64
clean up
sloriot Nov 15, 2024
6b66736
Fix include for header checks
afabri Nov 16, 2024
b4b3839
Fix dependencies
afabri Nov 16, 2024
a5c694a
fix detection of filtering
sloriot Nov 20, 2024
c00cfed
revert commit d61a3e302d30a6a2a59f20fbab6481a4d01f7d61
sloriot Nov 20, 2024
d2b5e49
Add data for 2D example
afabri Nov 29, 2024
e6eee99
Add data for 3D example
afabri Nov 29, 2024
169df3e
Add two curves to dD examples (we get an assertion)
afabri Dec 6, 2024
53b4c54
uint -> int
sloriot Dec 6, 2024
8931788
more similar curves
afabri Dec 9, 2024
344e4d0
more similar curves
afabri Dec 9, 2024
757f9cd
Assertion if two points are equal
afabri Dec 9, 2024
dd12609
Merge remote-tracking branch 'cgal/master' into Frechet-dev
afabri Dec 9, 2024
b185e16
Add to Changes.md
afabri Dec 9, 2024
7d2b382
Add to Changes.md
afabri Dec 9, 2024
bfe15ae
Add accents
afabri Dec 9, 2024
819e3cf
Add dD example to User Manual
afabri Dec 9, 2024
cbaf3ff
fix anchor
afabri Dec 9, 2024
20bf574
Make sure that we round up in length_of_diagonl()
afabri Dec 9, 2024
e635dec
Add bibtex entry and \cite
afabri Dec 9, 2024
55a3cb5
cleanup
afabri Dec 9, 2024
ddbfcd0
Fix for two identical points. Must be checked with André
afabri Dec 9, 2024
bc3b8db
cleanup
afabri Dec 9, 2024
c8303ae
Prefix bbox types with CGAL::
afabri Dec 9, 2024
7370c94
Revive Frechet_distance_traits.h
afabri Dec 9, 2024
32bef86
Use using in concept
afabri Dec 9, 2024
1a50163
Add classical Alt-Godau Fréchet distance algorithm.
Nov 18, 2024
354786b
WIP: High-dimensional test data creation.
Dec 11, 2024
01e0ab4
Compare fraction instead of id
afabri Dec 11, 2024
3679240
Deal with argc/argv and cleanup
afabri Dec 11, 2024
e279087
untabify
afabri Dec 11, 2024
8ba4e79
clean
afabri Dec 11, 2024
58964ea
fix cmake version
sloriot Dec 11, 2024
fd71a1d
remove example not existing
sloriot Dec 11, 2024
894e742
Fix compile errors.
Dec 11, 2024
dad0b48
Fix bug in the naive Frechet distance algorithm.
Dec 11, 2024
1b1cec4
Clean up Frechet_naive.h
Dec 11, 2024
a3071ba
Clean up and rename classical (prev. "naive") Fréchet algorithm code.
Dec 12, 2024
00c7054
Create goal directed test curves in 3d and 100d.
Dec 12, 2024
21e3a7c
WIP: Add script for query creation and Compute_classical_Frechet_dist…
Dec 12, 2024
23bf4ae
Use Epick_d
afabri Dec 12, 2024
67b2c76
Fix trailing whitespace on generated curves.
Dec 12, 2024
a0abc11
argv[2]
afabri Dec 12, 2024
10e45a7
Fix point format in curve creation and make it deterministic.
Dec 12, 2024
7e8cc90
WIP: Tests for 3 and 100 dimensional data.
Dec 12, 2024
bba4215
Remove TODO.
Dec 12, 2024
6c16278
Remove trailing whitespace.
Dec 12, 2024
3fa7c47
Add functions to class Bbox as they are in Bbox_3
afabri Dec 12, 2024
0ee04ba
Fix in Bbox.h
afabri Dec 13, 2024
f044e4e
read_WKT does not return correct value when opened in binary mode
afabri Dec 13, 2024
7a79cd6
WIP: Add example for closest curve search structure.
afabri Dec 13, 2024
c396a9a
Add converter to wkt format
afabri Dec 13, 2024
a8f8a3e
Fix dilate
afabri Dec 13, 2024
6360f72
Add forcing filtering
afabri Dec 13, 2024
27cf9e7
Fix dimension of FrechetKdTree
afabri Dec 16, 2024
a6eaec0
use cite macro
sloriot Dec 16, 2024
79ecd1b
Make Frechet_distance_test work also for 100-dimensional cases.
Dec 16, 2024
0311b1c
Add some comments after talking to AF.
Dec 16, 2024
23c79d8
Fix for example Spatial_searching_2user_defined_point_and_distance.cpp
afabri Dec 16, 2024
e7e80e5
Use variable
afabri Dec 17, 2024
9b8be5e
Add Cartesian_const_iterator to Bbox
afabri Dec 17, 2024
fc120de
Add Cartesian_const_iterator to Bbox
afabri Dec 17, 2024
bef9494
Missed one this-> :<
afabri Dec 18, 2024
a14fad4
Add constructor from Bbox_2/3
afabri Dec 18, 2024
f37c588
Add operator+(int) and operator-(other)
afabri Dec 18, 2024
e70b88f
Add Compute_squared_distance to traits (todo document in concept, and…
afabri Dec 18, 2024
279a411
WIP: Towards dimension independent FrechetDS
afabri Dec 18, 2024
92aa6c6
WIP before meeting
afabri Dec 18, 2024
2bbb7b2
Implement box in sphere test
afabri Dec 18, 2024
19f8b9c
Address some review points
afabri Dec 19, 2024
201f658
Address some review points
afabri Dec 19, 2024
10be823
Address some review points
afabri Dec 19, 2024
be5bfc2
Address some review points
afabri Dec 20, 2024
e75f05d
also test double + filter
sloriot Dec 20, 2024
45f9985
add missing operator
sloriot Dec 20, 2024
e819ac8
hide force filtering and the traits in NP
sloriot Dec 20, 2024
ef6a2b4
Address some review points
afabri Dec 20, 2024
756fe01
Address some review points
afabri Dec 20, 2024
81488c0
possible solution for default traits
sloriot Dec 20, 2024
c51fac5
advance the iterator
afabri Dec 27, 2024
3189228
Test Cartesian_const_iterator with Concatenate_iterator
afabri Dec 27, 2024
3699067
Fix construction of end iterator
afabri Dec 27, 2024
3273aed
set bound so that some curves ARE closer
afabri Dec 27, 2024
06e6ffa
whitespace
afabri Dec 27, 2024
85c7348
precision -> error_bound
afabri Dec 27, 2024
315668b
Move header to internal
afabri Dec 27, 2024
b03a73e
Remove _ from namespace
afabri Dec 27, 2024
067b6e5
Rename to CGAL::Frechet_distance::Neighbor_search
afabri Dec 27, 2024
1ade912
Document class
afabri Dec 27, 2024
6f86527
rename function
afabri Dec 29, 2024
fa8bec9
Adress errors/warnings in testsuite
afabri Jan 1, 2025
8926fab
Deal with empty curves
afabri Jan 2, 2025
7ecd0ad
fix max
afabri Jan 2, 2025
890b631
Adress warnings/errors with VC++
afabri Jan 3, 2025
99c9193
disambiguate =
sloriot Jan 3, 2025
63214f4
remove debug
sloriot Jan 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions Documentation/doc/Documentation/packages.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
\package_listing{Straight_skeleton_2}
\package_listing{Minkowski_sum_2}
\package_listing{Polyline_simplification_2}
\package_listing{Polyline_distance}
\package_listing{Visibility_2}
\package_listing{Set_movable_separability_2}

Expand Down
2 changes: 1 addition & 1 deletion Documentation/doc/scripts/generate_how_to_cite.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def protect_upper_case(title):
return title.replace("dD","{dD}").replace("2D","{2D}").replace("3D","{3D}").replace("CGAL","{CGAL}").replace("Qt","{Qt}").replace("Boost","{Boost}")

def protect_accentuated_letters(authors):
res=authors.replace("é",r"{\'e}").replace("è",r"{\`e}").replace("É",r"{\'E}").replace("ä",r"{\"a}").replace("ö",r"{\"o}").replace("ñ",r"{\~n}").replace("ã",r"{\~a}").replace("ë",r"{\"e}").replace("ı",r"{\i}").replace("Ş",r"{\c{S}}").replace("ş",r"{\c{s}}").replace("%","").replace("đ",r"{\-d}")
res=authors.replace("é",r"{\'e}").replace("è",r"{\`e}").replace("É",r"{\'E}").replace("ä",r"{\"a}").replace("ö",r"{\"o}").replace("ñ",r"{\~n}").replace("ã",r"{\~a}").replace("ë",r"{\"e}").replace("ı",r"{\i}").replace("Ş",r"{\c{S}}").replace("ş",r"{\c{s}}").replace("%","").replace("đ",r"{\-d}").replace("ü",r"{\"u}")
try:
res.encode('ascii')
except UnicodeEncodeError:
Expand Down
54 changes: 54 additions & 0 deletions Installation/include/CGAL/license/Polyline_distance.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// Copyright (c) 2016 GeometryFactory SARL (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org)
//
// $URL$
// $Id$
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial
//
// Author(s) : Andreas Fabri
//
// Warning: this file is generated, see include/CGAL/license/README.md

#ifndef CGAL_LICENSE_POLYLINE_DISTANCE_H
#define CGAL_LICENSE_POLYLINE_DISTANCE_H

#include <CGAL/config.h>
#include <CGAL/license.h>

#ifdef CGAL_POLYLINE_DISTANCE_COMMERCIAL_LICENSE

# if CGAL_POLYLINE_DISTANCE_COMMERCIAL_LICENSE < CGAL_RELEASE_DATE

# if defined(CGAL_LICENSE_WARNING)

CGAL_pragma_warning("Your commercial license for CGAL does not cover "
"this release of the Polyline Distances package.")
# endif

# ifdef CGAL_LICENSE_ERROR
# error "Your commercial license for CGAL does not cover this release \
of the dD Polyline Distances package. \
You get this error, as you defined CGAL_LICENSE_ERROR."
# endif // CGAL_LICENSE_ERROR

# endif // CGAL_POLYLINE_DISTANCE_COMMERCIAL_LICENSE < CGAL_RELEASE_DATE

#else // no CGAL_POLYLINE_DISTANCE_COMMERCIAL_LICENSE

# if defined(CGAL_LICENSE_WARNING)
CGAL_pragma_warning("\nThe macro CGAL_POLYLINE_DISTANCE_COMMERCIAL_LICENSE is not defined."
"\nYou use the CGAL Polyline Distances package under "
"the terms of the GPLv3+.")
# endif // CGAL_LICENSE_WARNING

# ifdef CGAL_LICENSE_ERROR
# error "The macro CGAL_POLYLINE_DISTANCE_COMMERCIAL_LICENSE is not defined.\
You use the CGAL Polyline Distances package under the terms of \
the GPLv3+. You get this error, as you defined CGAL_LICENSE_ERROR."
# endif // CGAL_LICENSE_ERROR

#endif // no CGAL_POLYLINE_DISTANCE_COMMERCIAL_LICENSE

#endif // CGAL_LICENSE_POLYLINE_DISTANCE_H
6 changes: 6 additions & 0 deletions NewKernel_d/include/CGAL/NewKernel_d/Cartesian_filter_K.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ struct Cartesian_filter_K : public Base_
typedef typename Store_kernel<EK_>::reference_type EK_rt;
EK_rt exact_kernel()const{return sek.kernel();}


// Added to be similar to CGAL::Filtered_kernel
typedef EK Exact_kernel;
enum { Has_filtered_predicates = true };
typedef Boolean_tag<Has_filtered_predicates> Has_filtered_predicates_tag;

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mglisse please review

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I said elsewhere, if that's really all that's needed (there is an example so I assume it compiles and runs, although I am rather surprised), ok.
(I would have mentioned in the comment the name of the package that needs it, but I guess this comment is good enough)

// MSVC is too dumb to perform the empty base optimization.
typedef std::bool_constant<
internal::Do_not_store_kernel<Kernel_base>::value &&
Expand Down
5 changes: 5 additions & 0 deletions NewKernel_d/test/NewKernel_d/Epick_d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,11 @@ static_assert(std::is_same<CGAL::Dimension_tag<3>,Ker3::Dimension>::value);
static_assert(std::is_same<CGAL::Dynamic_dimension_tag,Kerd::Dimension>::value);
static_assert(std::is_same<CGAL::Dimension_tag<2>,CGAL::Ambient_dimension<Ker2::Point_d>::type>::value);
static_assert(std::is_same<CGAL::Dimension_tag<3>,CGAL::Ambient_dimension<Ker3::Point_d,Ker3>::type>::value);

static_assert(Ker2::Has_filtered_predicates_tag::value);
static_assert(Ker3::Has_filtered_predicates_tag::value);
static_assert(Kerd::Has_filtered_predicates_tag::value);

Comment on lines +753 to +757
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mglisse please review

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, we can always modify this if we start testing non-filtered kernels.

int main(){
//Broken with Linear_base_d (output iterator)
//test2<CGAL::Kernel_d_interface<KK> >();
Expand Down
6 changes: 6 additions & 0 deletions Polyline_distance/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
BasedOnStyle: Google
Language: Cpp
IndentWidth: 4
AccessModifierOffset: -4
BreakBeforeBraces: Linux

3 changes: 3 additions & 0 deletions Polyline_distance/doc/Polyline_distance/Doxyfile.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@INCLUDE = ${CGAL_DOC_PACKAGE_DEFAULTS}

PROJECT_NAME = "CGAL ${CGAL_DOC_VERSION} - dD Polyline Distance"
45 changes: 45 additions & 0 deletions Polyline_distance/doc/Polyline_distance/PackageDescription.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/// \defgroup PkgPolylineDistanceRef dD Polyline Distance Reference
/// \defgroup PkgPolylineDistanceConcepts Concepts
/// \ingroup PkgPolylineDistanceRef
/// \defgroup PkgPolylineDistanceFunctions Functions
/// You can add some text here if you want a description at the group level
/// \ingroup PkgPolylineDistanceRef


/*!
\addtogroup PkgPolylineDistanceRef

\cgalPkgDescriptionBegin{dD Polyline Distance,PkgPolylineDistance}
\cgalPkgPicture{pkg-small.png}

\cgalPkgSummaryBegin
\cgalPkgAuthors{André Nusser, Marvin Künnemann, and Karl Bringmann}
\cgalPkgDesc{The package provides ... }
\cgalPkgManuals{Chapter_dD_Polyline_distance,PkgPolylineDistanceRef}
\cgalPkgSummaryEnd

\cgalPkgShortInfoBegin
\cgalPkgSince{6.1}
\cgalPkgDependsOn{\ref PkgSpatialSearchingD}
\cgalPkgBib{cgal:kn-pd}
\cgalPkgLicense{\ref licensesGPL "GPL"}
\cgalPkgShortInfoEnd

\cgalPkgDescriptionEnd

This package ....

\cgalClassifedRefPages

\cgalCRPSection{Concepts}
- `PolylineDistanceTraits`

\cgalCRPSection{Classes}
- `CGAL::Polyline_distance_traits_2`
- `CGAL::Polyline_distance_traits_3`
- `CGAL::Polyline_distance_traits_d`

\cgalCRPSection{Functions}
- `CGAL::continuous_Frechet_distance()`
- `CGAL::continuous_Frechet_distance_less_than()`
*/
29 changes: 29 additions & 0 deletions Polyline_distance/doc/Polyline_distance/Polyline_distance.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
namespace CGAL {
/*!

\mainpage User Manual
\anchor Chapter_dD_Polyline_distance

\cgalAutoToc
\author André Nusser, Marvin Künnemann, and Karl Bringmann

This chapter describes the ...

\section secmydefinitions Definitions

Section on definitions here ...

\section secmyexamples Examples

\subsection myFirstExample First Example

The following example shows ...

\cgalExample{Polyline_distance/Frechet_distance_2.cpp}

\cgalFigureBegin{figRefId,pkg-small.png}
Here you can put the caption
\cgalFigureEnd

*/
} /* namespace CGAL */
6 changes: 6 additions & 0 deletions Polyline_distance/doc/Polyline_distance/dependencies
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Manual
Kernel_23
STL_Extension
Algebraic_foundations
Circulator
Stream_support
3 changes: 3 additions & 0 deletions Polyline_distance/doc/Polyline_distance/examples.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/*!
\example Polyline_distance/Frechet_distance_2.cpp
*/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions Polyline_distance/examples/Polyline_distance/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application.

cmake_minimum_required(VERSION 3.1...3.14)
project( Polyline_distance_Examples )

find_package(CGAL REQUIRED QUIET OPTIONAL_COMPONENTS Core )


find_package(Eigen3 3.1.0 QUIET) #(requires 3.1.0 or greater)
include(CGAL_Eigen3_support)

create_single_source_cgal_program( "Frechet_distance_2.cpp" )

if(TARGET CGAL::Eigen3_support)
create_single_source_cgal_program( "Frechet_distance_d.cpp" )
target_link_libraries(Frechet_distance_d PUBLIC CGAL::Eigen3_support)
endif()
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include <CGAL/Frechet_distance.h>
#include <CGAL/Polyline_distance_traits_2.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>

#include <ostream>

using Kernel = CGAL::Exact_predicates_inexact_constructions_kernel;
using Traits = CGAL::Polyline_distance_traits_2<Kernel>;
using Point = Traits::Point;

int main(int argc, char* argv[])
{
std::vector<Point> A, B;
bool res = CGAL::continuous_Frechet_distance_less_than<Traits>(A, B, 0.001);
std::cout << std::boolalpha << res << std::endl;
return 0;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include <CGAL/Frechet_distance.h>
#include <CGAL/Polyline_distance_traits_d.h>
#include <CGAL/Epick_d.h>

#include <iostream>
#include <vector>

using Kernel = CGAL::Epick_d<CGAL::Dimension_tag<4>>;
using Traits = CGAL::Polyline_distance_traits_d<Kernel>;
using Point = Traits::Point;

int main(int argc, char* argv[])
{
std::vector<Point> A, B;
bool res = CGAL::continuous_Frechet_distance_less_than<Traits>(A, B, 0.001);
return 0;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@


#include <CGAL/Simple_cartesian.h>
#include <CGAL/Exact_rational.h>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>

typedef CGAL::Simple_cartesian<double> SCd;
typedef CGAL::Simple_cartesian<CGAL::Exact_rational> SCrat;

typedef CGAL::Simple_cartesian<CGAL::Interval_nt<false>> SCinterval;

template <typename K>
struct Convert {

static auto get_type() {
if constexpr (K::Has_filtered_predicates_tag::value) {
return typename K::Exact_kernel{};
}
else {
return CGAL::Simple_cartesian<CGAL::Exact_rational>{};
}
}

using Has = decltype(get_type());


using Exact = std::conditional_t < std::is_floating_point_v<typename K::FT>, Has, CGAL::Simple_cartesian<CGAL::Exact_rational>>;

typename Exact::Point_2 exact(const typename K::Point_2& p)
{
if constexpr (typename K::Has_filtered_predicates_tag::value) {
std::cout << "Has_filtered_predicates_tag" << std::endl;
return typename K::C2E()(p);
}

if constexpr (std::is_floating_point<typename K::FT>::type::value) {
std::cout << "is_floating_point but not filtered" << std::endl;
return Exact::Point_2(p.x(), p.y());
}
// We could check if K::FT is an interval and then check that is tight.

// Otherwise we assume that K::FT converts to Rational
return typename Exact::Point_2();

}

SCinterval::Point_2 approx(const typename K::Point_2& p)
{
std::cout << "___________________\n" << typeid(K).name() << std::endl;

if constexpr (typename K::Has_filtered_predicates_tag::value) {
std::cout << "Has_filtered_predicates_tag" << std::endl;
return typename K::C2F()(p);
}

if constexpr (std::is_floating_point<typename K::FT>::type::value) {
std::cout << "is_floating_point but not filtered" << std::endl;
return SCinterval::Point_2(p.x(), p.y());
}
// Neither floating point, nor filtered
return SCinterval::Point_2(CGAL::to_interval(p.x()), CGAL::to_interval(p.y()));

/*
if constexpr (typename K::Has_filtered_predicates_tag::value) {
std::cout << "Has_filtered_predicates_tag" << std::endl;
std::cout << typeid(typename K::Approximate_kernel).name() << std::endl;
std::cout << typeid(typename K::Exact_kernel::FT).name() << std::endl;
std::cout << typeid(typename K::C2F).name() << std::endl;
std::cout << typeid(typename K::C2E).name() << std::endl;
}
std::cout << std::endl;
*/
}



};

int main()
{
SCinterval::Point_2 p;
p = Convert<SCd>().approx(SCd::Point_2(78,12));
p = Convert<SCrat>().approx(SCrat::Point_2(78, 12));
p = Convert<CGAL::Epick>().approx(CGAL::Epick::Point_2(78,12));
p = Convert<CGAL::Epeck>().approx(CGAL::Epeck::Point_2(78,12));


Convert<SCd>::Exact::Point_2 pd = Convert<SCd>().exact(SCd::Point_2(0.3, 12));
Convert<CGAL::Epick>::Exact::Point_2 pepick = Convert<CGAL::Epick>().exact(CGAL::Epick::Point_2(78, 12));
return 0;
}
Loading