-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
lrineau
wants to merge
269
commits into
CGAL:master
Choose a base branch
from
anusser:dev
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 229 commits
Commits
Show all changes
269 commits
Select commit
Hold shift + click to select a range
ff10eb3
Another wip commit for the near neighbors search.
anusser 6e87378
Query DS is now working including tests. Clean-up etc. still necessary.
anusser 5fdc4cc
Clean-up of Fréchet NNs data structure.
anusser 60fcb5e
Use "= default" syntax for back_insert_it.
anusser 4ab63f0
Further clean-up of Fréchet DS and add batch reporting for kd-tree.
anusser be3e40a
Add PolylineTraits_2 class.
anusser 55ddcef
Make intersection into predicate. This commit introduces a segfault!
anusser 0277586
Fix segfault introduced in last commit.
anusser 11e00cd
add TODO
anusser 211e9e3
Add CGAL-like squared distance comparison to predicates.
anusser 78481f3
Continue CGALization
anusser 1d9c677
Copy predicates to _old files.
anusser 274841b
Add some comments and notes.
anusser 821f384
Add first draft of Polyline_d class.
anusser 4adf5ba
Some comments after call with Marvin.
anusser f8524ad
Re-insert outer interval as we need it for robustness of our old code.
81930a9
Fix tests and compilation errors.
9a9dde4
Small changes after meeting with Andreas.
ac4f8d6
Pass after another rough review.
c56a57d
Take out near neighbor code in tests to reduce errors.
7bd03fe
Switched partly to CGAL::Point_2.
d1eb0fe
Switch out distance computation with CGAL::squared_distance.
fc6e599
Clean up.
28d44e2
A version that passes the tests with CPoint having CORE::Expr type.
51fabfb
Change directory in test such that it can be run from build.
b353bd5
Version that works with Sqrt_ext and Rational but very slow
f149567
Add brief license information to the SIGSPATIAL data.
2484d3a
Fix authors and add license headers.
ad109d2
Various fixes so that it compiles with VC++
afabri e95f95a
WIP failing on some curves, that avoids Rational
afabri de15373
Passes the test. But is it faster ?
afabri 5cdc0bb
Use CGAL::is_one()
afabri 6b8d4c3
bug fix
afabri 757a5be
No need for filtering inside Sqrt_extension
afabri 740e1bc
Remove outer intervals.
ca940ee
Use optional<Exact>
afabri 52e37e7
replace std::pow(..2)
afabri 028ea93
Big clean-up removing a lot of unused code.
86c0246
Unify formatting and switch from tabs to spaces using clang-format.
b972252
Add back the near neighbors code. Tests succeed.
db42932
Add namespaces
afabri f3bf44f
Deal with std::min for VC++
afabri 225bb2d
Remove unused types and unused using statements
afabri 72aa1c5
Perform ess arithmetic operations
afabri 80310f1
Subtract instead of adding and finally a negate
afabri bff699d
>=0 -> ! is_negative
afabri 66c6e7d
Make private and add question about static
afabri 387b496
const&
afabri efedd28
Add code to avoid link error (why?). Another const&
afabri 1507571
Change nesting of namespaces/directories
afabri b50d84a
Try to add doc
afabri b217cc5
protected another accentuated letter
sloriot 7a74638
Add empty docxygen headers to classes
afabri 16295b3
Formatting and single TODO comment.
111a9e6
Make functions non-static
afabri 95eabff
Make types different from what is in geometry_basics
afabri d17eb1a
Add comment.
29e4061
Fixes
afabri 656e1dc
Add commment Uncertain where we have to do the right thing
afabri 827f842
Move the formula comment
afabri 82ed699
Throw in some (hopefully correct) certainly(..)
afabri 1ee0d44
Better message
afabri 834e878
More certainly(), but they must be checked
afabri 2a8edd8
Add data member distance_sqr
afabri 0476c20
const& distance_t
afabri b99b57b
Add license check
afabri 37eeade
Resolve all Uncertain comments in filter.h (and one in frechet_light.h)
b82f472
Add some certainly
afabri c28c26d
Handle some Uncertain cases. Two remaining that are more complicated.
e00b0df
less arithmetic
afabri d543109
less arithmetic
afabri ea0473f
less arithmetic
afabri 9b4c13c
less arithmetic
afabri ff52323
Use ! is_negative()
afabri 153493c
delay computation as it is potentially not needed
afabri bb665e1
Use advanced mode of Interval_nt
afabri cb51392
use ! is_negative()
afabri 25e3b4f
cleanup around Curve. put typedefs in smaller scopes; remove typedefs…
afabri 518240d
cleanup
afabri 960d7f0
Remove debug output
afabri bcfe532
Reorganize so that in the next step {approximate,exact)_reals can get…
afabri 758692c
Reorganize for Lambda as well
afabri ec2d780
fix compilation errors and some warnings
sloriot afaf743
Handle wrong implicit assumptions w.r.t. Uncertain in frechet_light.h.
04ca89f
Remove unused using
afabri d869a1d
Templates everywhere (should it better be templated by Curve?)
afabri 171f946
Use is_zero
afabri 258dcb8
Comment unused constructor of Curve
afabri e4027b0
It now works with Simple_cartesian<double>, Epicl, Epeck
afabri 8d76bb6
Extreme_points -> Bbox
afabri ab2b254
Centralize types in the Polyline_traits_2
afabri 7b928fb
Centralize types in the Polyline_traits_2
afabri 9701cc2
Use Traits::Bbox
afabri 7f57547
Add Polyline_traits_3 and add comments where we have to fix things
afabri 45d4dee
Fix compile errors.
348a9cb
Back to 2D
afabri dc78a17
Change from where data are read to get ready for the testsuite; type…
afabri 8a550b8
Deal with examples (ha ha)
afabri dcf639f
Remove stub of Polyline_d package.
d7f4f4d
Make bichromaticFarthestDistance faster and high-dimensional.
a7a23ef
Also use K::dimension everywhere in high_level_predicates.h
9b18db8
Remove it later. only needed to learn how to determine features
afabri 210b447
RealType -> Lambda
afabri 08beeea
cleanup
afabri 673efd5
Minimize traits class; parameterize with Curve
afabri a3662eb
Add doxygen
afabri 9196109
rename traits classes
afabri a4687d4
less #include
afabri fcb4a1c
Add dD (not working yet)
afabri ec56c66
Kernel: Add a BBox class with dimension as parameter
afabri f519646
fixes for clang
afabri 8dc8330
Remove files that were accidentally added
afabri fec3910
Add nested typedefs as mentioned in Issue #8256
afabri 87f9366
Improve documentation
afabri d742cfb
merge master
afabri ca9b25c
rename thumbnail
sloriot e8d87e5
license identifier
afabri 27cccc8
Copyright also for GF
afabri 2a17b4d
Add concept
afabri ae74ef6
Fix SPDX-License-Identifier
afabri 5852607
Rename package, remove default for epsilon
afabri 05b8e19
rename concept
afabri 5b7629f
User Manual, rename tags, add example
afabri c030c3a
Remove .clang-format file
afabri bfc7695
typo in example
afabri 0ddf866
shorten license
sloriot 1d1f5e9
compile all examples
sloriot 79f5d10
fix project name
sloriot 172b124
add missing example
sloriot 4cde28c
TWS
sloriot 513f9fe
cleanup
afabri b32db65
Change package title
afabri c0d7d47
curve -> polyline
afabri e183ddd
mention Epick
afabri a68019f
Fix license file
afabri effc03c
Add to user manual.
a3f2b33
drop 'continuous_'
afabri 9f2ef30
Fix path to data for the DS test (which compiles and runs without ass…
afabri 64d5a6e
Add test for a minimal traits (WIP)
afabri c480984
Add teaser image and credits.
1838916
Another pass over the user manual.
60e7fae
check if Kernel provides the nested type
sloriot 2c0ba99
add minimal converter
sloriot f2c51a8
fix compilation issues detected by g++
sloriot eee97d7
get rid of filtered tag everywhere
sloriot 82c8584
Rename functions
afabri 793b9d7
Rename functions
afabri 5a930c6
try to please msvc
sloriot d2d84df
fix
afabri c5c4fcb
missing renaming
sloriot e33ef39
fix compilation issues
sloriot 7a03762
Fix two typos in the user manual.
6638dec
Fix +=; Add first tests
afabri cf6996b
typo in Epick_d doc
afabri 48d734c
typo in Epick_d doc
afabri 4bc2770
Constructor from a range of pairs of numbers
afabri 8ef1f72
Add missing parameter; (std::min)
afabri f4371f2
Replace function names and address comments of co-authors
afabri a278b1a
cleanup
afabri 12e7466
tws
afabri ebf1b37
replace ...
afabri 28d05e6
Add some words regarding the algorithm to the user manual.
570433d
Protect min/max for VC++
afabri 0c9cb3d
CGAL_assertion ( uses also 'e')
afabri d162bcd
Merge branch 'master' into Frechet-dev
afabri b83bcc4
Merge branch 'master' into Kernel_23-Bbox_d-ign
afabri 2b4dfa0
Merge branch 'Kernel_23-Bbox_d-ign' into Frechet-dev
afabri 160cb3e
Fix header file names
afabri a432d96
Fix header
afabri 0cc387e
Typo in doc
afabri 68ecd6d
WIP for ConstructBbox (also on purpose CamelCase)
afabri 9ade3d2
WIP: after my conversation with myself on github
afabri 61ae325
Fix template parameter
afabri 08389c7
Add include
afabri fe7c37b
Stumbling forward, but does still not compile
afabri 63dd907
Add top down
afabri d2b1ea7
use consistent naming
sloriot 6650de8
WIP: apply the functor
afabri 6d11389
got it working for Epick and #if 0 the block with Epeck as WIP
afabri 7133b28
functor is a construction and not a computation
sloriot 7ab31a8
make it compile
sloriot 316ab90
Clean up
mglisse ab06574
Merge remote-tracking branch 'cgal/master' into Kernel_23-Bbox_d-ign
afabri 33ebf55
Merge remote-tracking branch 'cgal/master' into Frechet-dev
afabri 5bfb293
fix merge conflict
afabri 5138ed7
Fix the Bbox type for dD
afabri 58e269a
Add FT to Cartesian_base_d
afabri d97a059
WIP for dD
afabri a928261
Use Kernel_d_interface; Add temporarily typedf void Point_2/3
afabri e4abda3
Add typedef C2A C2F; Should be unified
afabri a35518d
Use functor
afabri de478da
more functors
afabri 5792bcb
Introduce Curve_base<T,dim>
afabri b03e9a8
remove temporarily added typedefs
afabri aa13a0d
remove temporarily added typedefs
afabri 972b99b
add construct vector from 2 points
sloriot bb02ee2
add converter as template parameter
sloriot f830b5c
Move converters to Curve_base
afabri 44a0be7
CI fixes
afabri c0fa690
cleanup
afabri b506547
Simplify if/else
afabri 73240e0
Add a constexpr
afabri 40491bb
Remove a typename. Does that fix the CI ?
afabri 4c669e6
dependencies
afabri ec543b0
eigen is needed when using NewKernel_d
sloriot eea3f20
Fix the order of the parameters
afabri f13279d
As we changed smaller to larger we have to negate when testing agains…
afabri c440b83
Access points[] only through fct points(int)
afabri d6b7e36
Towards proper traits classes
afabri 3969958
Add documentation of the concept of the traits class
afabri b7cc075
Add Get_exact_kernel.h
afabri 7ef1a76
Document kernel converters
afabri f5ce958
dim -> dimension (CI)
afabri fca7d67
Only link with Eigen in the dD case
afabri 88d50eb
Fix Doxyfile.in
afabri 5b48a3c
Filtered_ -> Approximate_
afabri d65b689
more renaming
afabri 46c0353
fix warnings
sloriot 784ea58
add copy/init from the same type but with the opposite caching strategy
sloriot 48dfdb4
factorize implementation
sloriot 6c9d514
WIP
sloriot fb689fa
still WIP
sloriot 28db6f3
factorize curve
sloriot 95d810f
start following the concept
sloriot 48b204b
compilation errors
sloriot e76b975
make it work with SC<ER>
sloriot 6c3b548
always use Interval for prefix_length as it is used in filters
sloriot 7f8d80a
remove sqrt
sloriot f216e31
doc fixes
sloriot 7f0a121
using functor to iterator over coordinates
sloriot 107ed0f
remove useless abs
sloriot aa009bc
do not use interval for SC<double>
sloriot 9945425
use traits object functions
sloriot f0ef1af
avoid exception
sloriot a13d326
fix EPICK implementation
sloriot e3458be
missing return type
sloriot a173749
test all kernels
sloriot a1cd361
conditional testing
sloriot e1f5a1b
no need to construct points
sloriot c2d7402
add filtering for EPECK too
sloriot b3f420e
add filtering also for Kernel with no filtering
sloriot 5bb5aa9
enable filtering with exact nt with custom traits
sloriot 759fc87
enable filtering for Epick_d
sloriot 0b6b64a
do not change the rounding mode since protector is already created be…
sloriot efc600e
Merge remote-tracking branch 'cgal/master'
sloriot d61a3e3
Merge pull request #8611 from sloriot/NT-sqrt_rounding
sloriot 090154d
fix copy/paste issues
sloriot 9a0dd64
clean up
sloriot 6b66736
Fix include for header checks
afabri b4b3839
Fix dependencies
afabri File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 87 additions & 0 deletions
87
Frechet_distance/doc/Frechet_distance/Concepts/FrechetDistanceTraits.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
/*! | ||
\ingroup PkgFrechetDistanceConcepts | ||
\cgalConcept | ||
|
||
The concept `FrechetDistanceTraits` defines the requirements of the | ||
first template parameter of the functions `CGAL::is_Frechet_distance_larger()` | ||
and `CGAL::approximate_Frechet_distance()`. | ||
|
||
|
||
\cgalHasModelsBegin | ||
\cgalHasModels{CGAL::Frechet_distance_traits_2} | ||
\cgalHasModels{CGAL::Frechet_distance_traits_3} | ||
\cgalHasModels{CGAL::Frechet_distance_traits_d} | ||
\cgalHasModelsEnd | ||
*/ | ||
|
||
class FrechetDistanceTraits { | ||
|
||
public: | ||
/*! a fixed dimension >= 2 */ | ||
const int dimension; | ||
|
||
/*! a fixed dimension >= 2 */ | ||
static constexpr bool is_filtered; | ||
/*! a fixed dimension >= 2 */ | ||
static constexpr bool is_floating_point; | ||
/// \name Types | ||
/// @{ | ||
|
||
/*! The kernel type. If this type has a nested type `Has_filtered_predicates_tag` with `value == true`, | ||
it must have a nested type `Exact_kernel`, and a nested type `C2E` with an `operator()` that converts | ||
a point of `Kernel` to a point of `Exact_kernel`. Otherwise, it must have a nested type `FT` for | ||
which an overload of `to_double()` exists. | ||
*/ | ||
using Kernel = unspecified; | ||
|
||
/*! The point type of `Kernel` corresponding to `dimension` | ||
*/ | ||
using Point = unspecified_type; | ||
|
||
/*! The number type of the filtered kernel. If | ||
*/ | ||
using distance_t = Filtered_kernel::FT; | ||
|
||
/*! The filtered kernel | ||
*/ | ||
using Filtered_kernel = unspecified_type; | ||
|
||
|
||
/*! The point type of the filtered kernel corresponding to `dimension`. | ||
*/ | ||
using Filtered_point = unspecified_type; | ||
|
||
/*! A functor of the filtered kernel for filtered points | ||
*/ | ||
using Construct_bbox = unspecified_type; | ||
|
||
/*! A functor of the filtered kernel for two filtered points | ||
*/ | ||
using Squared_distance = unspecified_type; | ||
|
||
|
||
/*! A functor of the filtered kernel for two filtered points | ||
*/ | ||
using Difference_of_points = unspecified_type; | ||
|
||
|
||
/*! A functor of the filtered kernel the return type of `Difference_of_points` | ||
*/ | ||
using Scaled_vector = unspecified_type; | ||
|
||
|
||
/*! A functor of the filtered kernel the return type of `Scaled_vector` | ||
*/ | ||
using Translated_point = unspecified_type; | ||
|
||
/*! The exact kernel | ||
*/ | ||
using Exact_kernel = unspecified_type; | ||
|
||
/*! The point type of the exact kernel corresponding to `dimension`. | ||
The point type must have `operator[]` returning a number type which can be used as first template parameter of `Sqrt_extension`. | ||
*/ | ||
using Exact_point = unspecified_type; | ||
|
||
/// @} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
84 changes: 84 additions & 0 deletions
84
Frechet_distance/doc/Frechet_distance/Frechet_distance.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
namespace CGAL { | ||
/*! | ||
|
||
\mainpage User Manual | ||
\anchor Chapter_dD_Frechet_distance | ||
|
||
\cgalAutoToc | ||
\authors André Nusser, Marvin Künnemann, and Karl Bringmann | ||
|
||
|
||
<center> | ||
<img src="FrechetTeaser.png" style="max-width:30%;"/> | ||
</center> | ||
|
||
This package provides functions for computing the Fréchet distance of polylines in any dimension under the Euclidean metric. | ||
|
||
\section secFrechetDistanceIntroduction Introdution | ||
|
||
The Fréchet distance is a classical dissimilarity measure between polylines. | ||
Its advantages over other measures is that it both considers the polylines as continuous objects and takes into account the ordering of the points. | ||
Intuitively, the Fréchet distance is commonly explained as follows: Imagine a human walking on one polyline while a dog walks on the other polyline, they are connected by a leash, and they are only allowed to walk forward. The Fréchet distance is the shortest leash length that allows the human and the dog to jointly walk from start to end on their respective trajectories. | ||
|
||
|
||
<!-- | ||
\cgalFigureBegin{figRefId,pdist-pkg-small.png} | ||
Here you can put the caption | ||
\cgalFigureEnd | ||
--> | ||
|
||
The Fréchet distance is a metric. This implies that two polylines have distance zero if and only if they are equal (after removing redundant vertices). | ||
|
||
\section secFrechetDistanceAPI API | ||
|
||
The package provides one function to approximate the Fréchet distance and one function to decide whether the Fréchet distance is at most a given value. | ||
|
||
The function `approximate_Frechet_distance()` computes an approximation of the Fréchet distance between two polylines, up to a given approximation error. It returns an interval that contains the true distance. | ||
The function `is_Frechet_distance_larger()` decides if the Fréchet distance | ||
between two polylines is larger than a given bound. | ||
|
||
Both functions have as template parameter a traits class defining the dimension and the point type. | ||
The traits classes have as template parameter a kernel. This may be a kernel such as `Simple_cartesian` | ||
with a floating point number type, or a filtered kernel such as `Exact_predicates_inexact_constructions_kernel`. | ||
In both cases the result is guaranteed to be correct. | ||
|
||
|
||
\section secFrechetDistanceImplementation Implementation | ||
|
||
Internally all computations are done using interval arithmetic. In case of filter failures | ||
the algorithm switches to the usage of square root extensions. | ||
|
||
The algorithms in this package are an adaption of the implementation of a <a href="https://doi.org/10.4230/LIPIcs.SoCG.2019.17">SoCG</a>/<a href="https://doi.org/10.20382/jocg.v12i1a4">JoCG</a> paper. In particular, the implementation can decide non-difficult cases very fast while for difficult cases it still has the quadratic running time guarantee of the classical Fréchet distance algorithm by Alt and Godau. This is achieved by using fast filtering methods and a divide and conquer algorithm with pruning rules on the free-space diagram. | ||
|
||
|
||
\section secFrechetDistanceExamples Examples | ||
|
||
In the examples we use different kernels to illustrate that the functions | ||
work as well for inexact or exact kernels. | ||
|
||
\subsection subsecFrechetDistanceFirstExample Decision for 2D Polylines | ||
|
||
The following example shows how we can use `is_Frechet_distance_larger()` to decide whether the Fréchet distance between two polylines in the Euclidean plane is at most a given value. | ||
|
||
\cgalExample{Frechet_distance/Frechet_distance_2.cpp} | ||
|
||
\subsection subsecFrechetDistanceSecondExample Distance Computation for 3D Polylines | ||
|
||
The following example shows how we can compute the Fréchet distance up to a given precision on two polylines in 3-dimensional Euclidean space using `approximate_Frechet_distance()`. | ||
|
||
\cgalExample{Frechet_distance/Frechet_distance_3.cpp} | ||
|
||
|
||
\subsection subsecFrechetDistanceImageCredits Image Credits | ||
|
||
The teaser image is a visualization of two data points from the <a href="https://archive.ics.uci.edu/dataset/175/character+trajectories">Character Trajectories</a> data set. | ||
|
||
\subsection subsecFrechetDistanceImplementation Implementation History | ||
|
||
An initial version using floating point arithmetic was developed by the authors | ||
while working at the Max Planck Institute for Informatics in Saarbrücken, Germany. | ||
André Nusser, together with Sebastien Loriot and Andreas Fabri, introduced | ||
the usage of interval arithmetic and square root extensions to alleviate issues stemming from rounding errors and hence ensuring correctness of the computation. | ||
|
||
*/ | ||
} /* namespace CGAL */ |
44 changes: 44 additions & 0 deletions
44
Frechet_distance/doc/Frechet_distance/PackageDescription.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/// \defgroup PkgFrechetDistanceRef dD Frechet Distance Reference | ||
/// \defgroup PkgFrechetDistanceConcepts Concepts | ||
/// \ingroup PkgFrechetDistanceRef | ||
/// \defgroup PkgFrechetDistanceFunctions Functions | ||
/// You can add some text here if you want a description at the group level | ||
/// \ingroup PkgFrechetDistanceRef | ||
|
||
|
||
/*! | ||
\addtogroup PkgFrechetDistanceRef | ||
|
||
\cgalPkgDescriptionBegin{dD Frechet Distance,PkgFrechetDistance} | ||
\cgalPkgPicture{pdist-pkg-small.png} | ||
|
||
\cgalPkgSummaryBegin | ||
\cgalPkgAuthors{André Nusser, Marvin Künnemann, and Karl Bringmann} | ||
\cgalPkgDesc{This package provides functions for computing the Fréchet distance of polylines in any dimension under the Euclidean metric.} | ||
\cgalPkgManuals{Chapter_dD_Frechet_distance,PkgFrechetDistanceRef} | ||
\cgalPkgSummaryEnd | ||
|
||
\cgalPkgShortInfoBegin | ||
\cgalPkgSince{6.1} | ||
\cgalPkgBib{cgal:nkb-fd} | ||
\cgalPkgLicense{\ref licensesGPL "GPL"} | ||
\cgalPkgShortInfoEnd | ||
|
||
\cgalPkgDescriptionEnd | ||
|
||
This package provides functions for computing the Fréchet distance of polylines in any dimension under the Euclidean metric. | ||
|
||
\cgalClassifedRefPages | ||
|
||
\cgalCRPSection{Concepts} | ||
- `FrechetDistanceTraits` | ||
|
||
\cgalCRPSection{Classes} | ||
- `CGAL::Frechet_distance_traits_2` | ||
- `CGAL::Frechet_distance_traits_3` | ||
- `CGAL::Frechet_distance_traits_d` | ||
|
||
\cgalCRPSection{Functions} | ||
- `CGAL::approximate_Frechet_distance()` | ||
- `CGAL::is_Frechet_distance_larger()` | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Manual | ||
Kernel_23 | ||
STL_Extension | ||
Algebraic_foundations | ||
Circulator | ||
Stream_support |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/*! | ||
\example Frechet_distance/Frechet_distance_2.cpp | ||
\example Frechet_distance/Frechet_distance_3.cpp | ||
*/ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# 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( Frechet_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" ) | ||
create_single_source_cgal_program( "Frechet_distance_3.cpp" ) | ||
create_single_source_cgal_program( "Has_filtered_predicates.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) | ||
target_link_libraries(Frechet_distance_2 PUBLIC CGAL::Eigen3_support) | ||
target_link_libraries(Frechet_distance_3 PUBLIC CGAL::Eigen3_support) | ||
endif() |
17 changes: 17 additions & 0 deletions
17
Frechet_distance/examples/Frechet_distance/Frechet_distance_2.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#include <CGAL/Frechet_distance.h> | ||
#include <CGAL/Frechet_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::Frechet_distance_traits_2<Kernel>; | ||
using Point = Traits::Point; | ||
|
||
int main(int argc, char* argv[]) | ||
{ | ||
std::vector<Point> A, B; | ||
bool res = CGAL::is_Frechet_distance_larger<Traits>(A, B, 0.001); | ||
std::cout << std::boolalpha << res << std::endl; | ||
return 0; | ||
} |
17 changes: 17 additions & 0 deletions
17
Frechet_distance/examples/Frechet_distance/Frechet_distance_3.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#include <CGAL/Frechet_distance.h> | ||
#include <CGAL/Frechet_distance_traits_3.h> | ||
#include <CGAL/Simple_cartesian.h> | ||
|
||
#include <ostream> | ||
|
||
using Kernel = CGAL::Simple_cartesian<double>; | ||
using Traits = CGAL::Frechet_distance_traits_3<Kernel>; | ||
using Point = Traits::Point; | ||
|
||
int main(int argc, char* argv[]) | ||
{ | ||
std::vector<Point> A, B; | ||
std::pair<double, double> res = CGAL::approximate_Frechet_distance<Traits>(A, B, 0.000001); | ||
std::cout << "The Frechet distance between the polylines is between " << res.first << " and " << res.second << std::endl; | ||
return 0; | ||
} |
17 changes: 17 additions & 0 deletions
17
Frechet_distance/examples/Frechet_distance/Frechet_distance_d.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#include <CGAL/Frechet_distance.h> | ||
#include <CGAL/Frechet_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::Frechet_distance_traits_d<Kernel>; | ||
using Point = Traits::Point; | ||
|
||
int main(int argc, char* argv[]) | ||
{ | ||
std::vector<Point> A, B; | ||
bool res = CGAL::is_Frechet_distance_larger<Traits>(A, B, 0.001); | ||
return 0; | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If
? something missing?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better look at it once I ask for review. Sorry for these WIP commits.