atlas
Public Types | Public Member Functions | List of all members
atlas::util::detail::KDTree_eckit< TreeT, PayloadT, PointT > Class Template Reference
Inheritance diagram for atlas::util::detail::KDTree_eckit< TreeT, PayloadT, PointT >:
Inheritance graph
[legend]
Collaboration diagram for atlas::util::detail::KDTree_eckit< TreeT, PayloadT, PointT >:
Collaboration graph
[legend]

Public Types

using Point = typename Base::Point
 
using Payload = typename Base::Payload
 
using PayloadList = typename Base::PayloadList
 
using Value = typename Base::Value
 
using ValueList = typename Base::ValueList
 
- Public Types inherited from atlas::util::detail::KDTreeBase< PayloadT, PointT >
using Payload = PayloadT
 
using Point = PointT
 
using PayloadList = std::vector< Payload >
 

Public Member Functions

template<typename... Args>
 KDTree_eckit (const Geometry &geometry, Args... args)
 
template<typename... Args>
 KDTree_eckit (Args... args)
 
 KDTree_eckit (const std::shared_ptr< Tree > &tree)
 
 KDTree_eckit (const std::shared_ptr< Tree > &tree, const Geometry &geometry)
 
idx_t size () const override
 
size_t footprint () const override
 
void reserve (idx_t size) override
 Reserve memory for building the kdtree in one shot (optional, at cost of extra memory) Implementation depends in derived classes.
 
void build () override
 Build the kd-tree in one shot, if memory has been reserved, depending on derived class implementation This will need to be called before all search functions like closestPoints(). More...
 
void build (std::vector< Value > &) override
 
void insert (const Value &value) override
 Insert 3D cartesian point (x,y,z) If memory has been reserved with reserve(), insertion will be delayed until build() is called. More...
 
ValueList do_closestPoints (const Point &, size_t k) const override
 Find k nearest neighbours given a 3D cartesian point (x,y,z)
 
Value do_closestPoint (const Point &) const override
 Find nearest neighbour given a 3D cartesian point (x,y,z)
 
ValueList do_closestPointsWithinRadius (const Point &, double radius) const override
 Find all points within a distance of given radius from a given point (x,y,z)
 
const Tree & tree () const
 
- Public Member Functions inherited from atlas::util::detail::KDTreeBase< PayloadT, PointT >
 KDTreeBase (const Geometry &geometry)
 
const Geometrygeometry () const
 
bool empty () const
 
template<typename Point >
void insert (const Point &p, const Payload &payload)
 Insert spherical point (lon,lat) or 3D cartesian point (x,y,z) If memory has been reserved with reserve(), insertion will be delayed until build() is called. More...
 
virtual void insert (const Value &)=0
 Insert Value If memory has been reserved with reserve(), insertion will be delayed until build() is called. More...
 
virtual void build (std::vector< Value > &values)=0
 Build the kd-tree in one shot.
 
template<typename Longitudes , typename Latitudes , typename Payloads >
void build (const Longitudes &longitudes, const Latitudes &latitudes, const Payloads &payloads)
 Build with spherical points (lon,lat) where longitudes, latitudes, and payloads are separate containers. More...
 
template<typename LongitudesIterator , typename LatitudesIterator , typename PayloadsIterator >
void build (const LongitudesIterator &longitudes_begin, const LongitudesIterator &longitudes_end, const LatitudesIterator &latitudes_begin, const LatitudesIterator &latitudes_end, const PayloadsIterator &payloads_begin, const PayloadsIterator &payloads_end)
 Build with spherical points (lon,lat) given separate iterator ranges for longitudes, latitudes, and payloads. More...
 
template<typename Points , typename Payloads >
void build (const Points &points, const Payloads &payloads)
 Build with spherical points (lon,lat) where longitudes, latitudes, and payloads are separate containers. More...
 
template<typename PointIterator , typename PayloadsIterator >
void build (const PointIterator &points_begin, const PointIterator &points_end, const PayloadsIterator &payloads_begin, const PayloadsIterator &payloads_end)
 Build with spherical points (lon,lat) given separate iterator ranges for longitudes, latitudes, and payloads. More...
 
template<typename Point >
ValueList closestPoints (const Point &p, size_t k) const
 Find k nearest neighbours given a 3D cartesian point (x,y,z) or 2D lonlat point(lon,lat)
 
template<typename Point >
Value closestPoint (const Point &p) const
 Find nearest neighbour given a 3D cartesian point (x,y,z)
 
template<typename Point >
ValueList closestPointsWithinRadius (const Point &p, double radius) const
 Find all points within a distance of given radius from a given point (x,y,z)
 

Member Function Documentation

◆ build()

template<typename TreeT , typename PayloadT , typename PointT >
void atlas::util::detail::KDTree_eckit< TreeT, PayloadT, PointT >::build ( )
overridevirtual

Build the kd-tree in one shot, if memory has been reserved, depending on derived class implementation This will need to be called before all search functions like closestPoints().

Reimplemented from atlas::util::detail::KDTreeBase< PayloadT, PointT >.

◆ insert()

template<typename TreeT , typename PayloadT , typename PointT >
void atlas::util::detail::KDTree_eckit< TreeT, PayloadT, PointT >::insert ( const Value &  value)
override

Insert 3D cartesian point (x,y,z) If memory has been reserved with reserve(), insertion will be delayed until build() is called.


The documentation for this class was generated from the following file: