32 if (key1->
x > key2->
x)
34 else if (key1->
x < key2->
x)
36 else if (key1->
y > key2->
y)
38 else if (key1->
y < key2->
y)
72 const pointf pt = {.
x = x, .y = y};
125 offsetof(
mpair, link),
Memory allocation wrappers that exit on failure.
static void * gv_calloc(size_t nmemb, size_t size)
static void * gv_alloc(size_t size)
CDT_API Dtlink_t * dtflatten(Dt_t *)
CDT_API int dtsize(Dt_t *)
CDT_API int dtclose(Dt_t *)
CDT_API Dtmethod_t * Dtoset
ordered set (self-adjusting tree)
CDT_API Dt_t * dtopen(Dtdisc_t *, Dtmethod_t *)
std::unordered_map< std::pair< int, int >, int, PointHash > PointMap
void addPS(PointSet *ps, double x, double y)
static pair * mkPair(pointf p)
static Dtdisc_t intMPairDisc
void insertPS(PointSet *ps, pointf pt)
static void * mkMPair(void *p, Dtdisc_t *disc)
static Dtdisc_t intPairDisc
void clearPM(PointMap *ps)
int insertPM(PointMap *pm, int x, int y, int value)
void freePS(PointSet *ps)
int isInPS(PointSet *ps, double x, double y)
pointf * pointsOf(PointSet *ps)
static int cmppair(void *k1, void *k2)
int inPS(PointSet *ps, pointf pt)
void freePM(PointMap *ps)
point containers PointSet and PointMap