/usr/include/boost/geometry/algorithms
NameSizeModeActions
detail/-0755rm
dispatch/-0755rm
append.hpp114930644editdlrm
area.hpp106570644editdlrm
assign.hpp107090644editdlrm
buffer.hpp86560644editdlrm
centroid.hpp196200644editdlrm
clear.hpp51560644editdlrm
comparable_distance.hpp11070644editdlrm
convert.hpp173270644editdlrm
convex_hull.hpp115890644editdlrm
correct.hpp99560644editdlrm
correct_closure.hpp58620644editdlrm
covered_by.hpp10770644editdlrm
crosses.hpp84780644editdlrm
densify.hpp124720644editdlrm
difference.hpp165910644editdlrm
discrete_frechet_distance.hpp78440644editdlrm
discrete_hausdorff_distance.hpp112810644editdlrm
disjoint.hpp11910644editdlrm
distance.hpp11100644editdlrm
envelope.hpp10210644editdlrm
equals.hpp11960644editdlrm
expand.hpp10730644editdlrm
for_each.hpp98310644editdlrm
intersection.hpp8060644editdlrm
intersects.hpp11450644editdlrm
is_convex.hpp65080644editdlrm
is_empty.hpp48530644editdlrm
is_simple.hpp5750644editdlrm
is_valid.hpp5700644editdlrm
length.hpp93410644editdlrm
line_interpolate.hpp130540644editdlrm
make.hpp51700644editdlrm
not_implemented.hpp38390644editdlrm
num_geometries.hpp35860644editdlrm
num_interior_rings.hpp37560644editdlrm
num_points.hpp55650644editdlrm
num_segments.hpp47750644editdlrm
overlaps.hpp10670644editdlrm
perimeter.hpp72120644editdlrm
point_on_surface.hpp132810644editdlrm
relate.hpp6420644editdlrm
relation.hpp6520644editdlrm
remove_spikes.hpp97530644editdlrm
reverse.hpp43860644editdlrm
simplify.hpp226960644editdlrm
sym_difference.hpp231690644editdlrm
touches.hpp11270644editdlrm
transform.hpp141050644editdlrm
union.hpp213830644editdlrm
unique.hpp46820644editdlrm
validity_failure_type.hpp36840644editdlrm
within.hpp10570644editdlrm
Edit: /usr/include/boost/geometry/algorithms/discrete_frechet_distance.hpp (7844B)
// Boost.Geometry // Copyright (c) 2018 Yaghyavardhan Singh Khangarot, Hyderabad, India. // Contributed and/or modified by Yaghyavardhan Singh Khangarot, // as part of Google Summer of Code 2018 program. // This file was modified by Oracle on 2018. // Modifications copyright (c) 2018 Oracle and/or its affiliates. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle // Use, modification and distribution is subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_GEOMETRY_ALGORITHMS_DISCRETE_FRECHET_DISTANCE_HPP #define BOOST_GEOMETRY_ALGORITHMS_DISCRETE_FRECHET_DISTANCE_HPP #include #ifdef BOOST_GEOMETRY_DEBUG_FRECHET_DISTANCE #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include namespace boost { namespace geometry { #ifndef DOXYGEN_NO_DETAIL namespace detail { namespace discrete_frechet_distance { template class coup_mat { public: coup_mat(size_type1 w, size_type2 h) : m_data(w * h,-1), m_width(w), m_height(h) {} result_type & operator()(size_type1 i, size_type2 j) { BOOST_GEOMETRY_ASSERT(i < m_width && j < m_height); return m_data[j * m_width + i]; } private: std::vector m_data; size_type1 m_width; size_type2 m_height; }; struct linestring_linestring { template static inline typename distance_result < typename point_type::type, typename point_type::type, Strategy >::type apply(Linestring1 const& ls1, Linestring2 const& ls2, Strategy const& strategy) { typedef typename distance_result < typename point_type::type, typename point_type::type, Strategy >::type result_type; typedef typename boost::range_size::type size_type1; typedef typename boost::range_size::type size_type2; boost::geometry::detail::throw_on_empty_input(ls1); boost::geometry::detail::throw_on_empty_input(ls2); size_type1 const a = boost::size(ls1); size_type2 const b = boost::size(ls2); //Coupling Matrix CoupMat(a,b,-1); coup_mat coup_matrix(a,b); result_type const not_feasible = -100; //findin the Coupling Measure for (size_type1 i = 0 ; i < a ; i++ ) { for(size_type2 j=0;j0) coup_matrix(i,j) = (std::max)(coup_matrix(i,j-1), dis); else if(i>0 && j==0) coup_matrix(i,j) = (std::max)(coup_matrix(i-1,j), dis); else if(i>0 && j>0) coup_matrix(i,j) = (std::max)((std::min)(coup_matrix(i,j-1), (std::min)(coup_matrix(i-1,j), coup_matrix(i-1,j-1))), dis); else coup_matrix(i,j) = not_feasible; } } #ifdef BOOST_GEOMETRY_DEBUG_FRECHET_DISTANCE //Print CoupLing Matrix for(size_type i = 0; i ::type, typename Tag2 = typename tag::type > struct discrete_frechet_distance : not_implemented {}; template struct discrete_frechet_distance < Linestring1, Linestring2, linestring_tag, linestring_tag > : detail::discrete_frechet_distance::linestring_linestring {}; } // namespace dispatch #endif // DOXYGEN_NO_DISPATCH /*! \brief Calculate discrete Frechet distance between two geometries (currently works for LineString-LineString) using specified strategy. \ingroup discrete_frechet_distance \tparam Geometry1 \tparam_geometry \tparam Geometry2 \tparam_geometry \tparam Strategy A type fulfilling a DistanceStrategy concept \param geometry1 Input geometry \param geometry2 Input geometry \param strategy Distance strategy to be used to calculate Pt-Pt distance \qbk{distinguish,with strategy} \qbk{[include reference/algorithms/discrete_frechet_distance.qbk]} \qbk{ [heading Available Strategies] \* [link geometry.reference.strategies.strategy_distance_pythagoras Pythagoras (cartesian)] \* [link geometry.reference.strategies.strategy_distance_haversine Haversine (spherical)] [/ \* more (currently extensions): Vincenty\, Andoyer (geographic) ] [heading Example] [discrete_frechet_distance_strategy] [discrete_frechet_distance_strategy_output] } */ template inline typename distance_result < typename point_type::type, typename point_type::type, Strategy >::type discrete_frechet_distance(Geometry1 const& geometry1, Geometry2 const& geometry2, Strategy const& strategy) { return dispatch::discrete_frechet_distance < Geometry1, Geometry2 >::apply(geometry1, geometry2, strategy); } // Algorithm overload using default Pt-Pt distance strategy /*! \brief Calculate discrete Frechet distance between two geometries (currently work for LineString-LineString). \ingroup discrete_frechet_distance \tparam Geometry1 \tparam_geometry \tparam Geometry2 \tparam_geometry \param geometry1 Input geometry \param geometry2 Input geometry \qbk{[include reference/algorithms/discrete_frechet_distance.qbk]} \qbk{ [heading Example] [discrete_frechet_distance] [discrete_frechet_distance_output] } */ template inline typename distance_result < typename point_type::type, typename point_type::type >::type discrete_frechet_distance(Geometry1 const& geometry1, Geometry2 const& geometry2) { typedef typename strategy::distance::services::default_strategy < point_tag, point_tag, typename point_type::type, typename point_type::type >::type strategy_type; return discrete_frechet_distance(geometry1, geometry2, strategy_type()); } }} // namespace boost::geometry #endif // BOOST_GEOMETRY_ALGORITHMS_DISCRETE_FRECHET_DISTANCE_HPP