GLAMERDOC++
Gravitational Lensing Code Library
Loading...
Searching...
No Matches
Utilities::HilbertCurve Class Reference

Class for calculating the Hilbert curve distance in two dimensions. More...

#include <utilities_slsim.h>

Public Member Functions

 HilbertCurve (PosType x_min, PosType y_min, PosType my_range, PosType smallsize)
 
int xy2d (int x, int y)
 convert (x,y) to d
 
int xy2d (PosType x, PosType y)
 convert (x,y) to d
 
void d2xy (int d, int *x, int *y)
 convert d to (x,y)
 
void d2xy (int d, PosType *x, PosType *y)
 convert d to (x,y)
 

Detailed Description

Class for calculating the Hilbert curve distance in two dimensions.

The Hilbert Curve maps two dimensional positions on a grid into distance in one dimension. The distance d is generally close for points that are near eachother. This allows one to uniquely order points in a two dimensional space. It is useful for matching objects quickly if they are sorted by thier Hilbert distance.

Constructor & Destructor Documentation

◆ HilbertCurve()

Utilities::HilbertCurve::HilbertCurve ( PosType x_min,
PosType y_min,
PosType my_range,
PosType smallsize )
inline
Parameters
x_minx coordinate of lower left corner
y_miny coordinate of lower left corner
my_rangerange in which points will be distributed
smallsizesmallest distance of separation that must give unique Hilbert distances

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