Fishnet 2.0.1
Framework for Graph-Based Analysis of GIS Vector Data
Loading...
Searching...
No Matches
NearestNeighbours.hpp File Reference
#include <set>
#include <ranges>
#include <fishnet/Vec2D.hpp>
#include <fishnet/Concepts.hpp>
Include dependency graph for NearestNeighbours.hpp:

Go to the source code of this file.

Namespaces

namespace  fishnet
 
namespace  fishnet::geometry
 

Functions

template<math::Number T>
constexpr Vec2D< T > fishnet::geometry::nearestNeighbour (const Vec2D< T > &query, std::set< Vec2D< T >, LexicographicOrder > const &points) noexcept
 Compute the nearest neighbour for a query point.
 
template<math::Number T>
constexpr std::vector< Vec2D< T > > fishnet::geometry::kNearestNeighbours (const Vec2D< T > &query, std::set< Vec2D< T >, LexicographicOrder > const &points, const size_t k) noexcept
 Compute the k nearest neighours for a query point.
 
template<typename T >
constexpr std::vector< std::pair< Vec2D< T >, std::vector< Vec2D< T > > > > fishnet::geometry::AllKNearestNeighbours (util::forward_range_of< Vec2D< T > > auto const &points, const size_t k) noexcept
 Compute the k nearest neighbours for each point.