Graphviz 13.1.3~dev.20250829.1031
Loading...
Searching...
No Matches
heap.c File Reference
#include <common/render.h>
#include <stdbool.h>
#include <neatogen/mem.h>
#include <neatogen/hedges.h>
#include <neatogen/heap.h>
#include <util/alloc.h>
Include dependency graph for heap.c:

Go to the source code of this file.

Data Structures

struct  pq
 

Functions

static int clamp (int lower, double v, int upper)
 
static int PQbucket (pq_t *pq, Halfedge *he)
 
static bool gt (double a_y, double a_x, double b_y, double b_x)
 a > b?
 
void PQinsert (pq_t *pq, Halfedge *he, Site *v, double offset)
 
void PQdelete (pq_t *pq, Halfedge *he)
 
bool PQempty (const pq_t *pq)
 
Point PQ_min (pq_t *pq)
 
HalfedgePQextractmin (pq_t *pq)
 
void PQcleanup (pq_t *pq)
 
pq_tPQinitialize (void)
 

Function Documentation

◆ clamp()

static int clamp ( int  lower,
double  v,
int  upper 
)
static

convert a double to an int, between bounds

Parameters
lowerLower bound to limit to
vValue to convert
upperUpper bound to limit to
Returns
A converted value in the range [lower, upper]

Definition at line 32 of file heap.c.

Referenced by PQbucket().

Here is the caller graph for this function:

◆ gt()

static bool gt ( double  a_y,
double  a_x,
double  b_y,
double  b_x 
)
static

Definition at line 53 of file heap.c.

Referenced by PQinsert().

Here is the caller graph for this function:

◆ PQ_min()

Point PQ_min ( pq_t pq)

Definition at line 97 of file heap.c.

References Site::coord, pq::hash, pq::min, NULL, Halfedge::PQnext, Halfedge::vertex, Point::x, Point::y, and Halfedge::ystar.

Referenced by voronoi().

Here is the caller graph for this function:

◆ PQbucket()

static int PQbucket ( pq_t pq,
Halfedge he 
)
static

Definition at line 43 of file heap.c.

References clamp(), pq::hashsize, pq::min, ymax, ymin, and Halfedge::ystar.

Referenced by PQdelete(), and PQinsert().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PQcleanup()

void PQcleanup ( pq_t pq)

Definition at line 115 of file heap.c.

References free(), pq::hash, and NULL.

Referenced by voronoi().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PQdelete()

void PQdelete ( pq_t pq,
Halfedge he 
)

Definition at line 79 of file heap.c.

References pq::count, deref(), pq::hash, last, NULL, PQbucket(), Halfedge::PQnext, and Halfedge::vertex.

Referenced by voronoi().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PQempty()

bool PQempty ( const pq_t pq)

Definition at line 93 of file heap.c.

References pq::count.

Referenced by voronoi().

Here is the caller graph for this function:

◆ PQextractmin()

Halfedge * PQextractmin ( pq_t pq)

Definition at line 108 of file heap.c.

References pq::count, pq::hash, pq::min, and Halfedge::PQnext.

Referenced by voronoi().

Here is the caller graph for this function:

◆ PQinitialize()

pq_t * PQinitialize ( void  )

Definition at line 122 of file heap.c.

References gv_alloc(), gv_calloc(), pq::hash, pq::hashsize, and sqrt_nsites.

Referenced by voronoi().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PQinsert()

void PQinsert ( pq_t pq,
Halfedge he,
Site v,
double  offset 
)

Definition at line 63 of file heap.c.

References Site::coord, pq::count, gt(), pq::hash, last, NULL, PQbucket(), Halfedge::PQnext, ref(), Halfedge::vertex, Point::x, Point::y, and Halfedge::ystar.

Referenced by triPath(), and voronoi().

Here is the call graph for this function:
Here is the caller graph for this function: