Graphviz  2.41.20171026.1811
Data Structures | Macros | Functions
closest.c File Reference
#include "kkutils.h"
#include "closest.h"
#include <stdlib.h>
Include dependency graph for closest.c:

Go to the source code of this file.

Data Structures

struct  Pair
 
struct  PairStack
 
struct  PairHeap
 

Macros

#define LT(p, q)   ((p).dist < (q).dist)
 
#define EQ(p, q)   ((p).dist == (q).dist)
 
#define push(s, x)
 
#define pop(s, x)   ((s->top==0) ? FALSE : (s->top--, x = s->data[s->top], TRUE))
 
#define read_top(h, x)   ((s->top==0) ? FALSE : (x = s->data[s->top-1], TRUE))
 
#define sub(h, i)   (h->data[i])
 
#define left(i)   (2*(i))
 
#define right(i)   (2*(i)+1)
 
#define parent(i)   ((i)/2)
 
#define insideHeap(h, i)   ((i)<h->heapSize)
 
#define greaterPriority(h, i, j)   (LT(h->data[i],h->data[j]) || ((EQ(h->data[i],h->data[j])) && (rand()%2)))
 
#define exchange(h, i, j)
 
#define assign(h, i, j)   {h->data[i]=h->data[j]}
 

Functions

void closest_pairs2graph (double *place, int n, int num_pairs, vtx_data **graph)
 

Macro Definition Documentation

#define assign (   h,
  i,
 
)    {h->data[i]=h->data[j]}

Definition at line 98 of file closest.c.

#define EQ (   p,
 
)    ((p).dist == (q).dist)

Definition at line 34 of file closest.c.

#define exchange (   h,
  i,
 
)
Value:
{Pair temp; \
temp=h->data[i]; \
h->data[i]=h->data[j]; \
h->data[j]=temp; \
}
Definition: closest.c:26

Definition at line 93 of file closest.c.

Referenced by build_ranks().

#define greaterPriority (   h,
  i,
 
)    (LT(h->data[i],h->data[j]) || ((EQ(h->data[i],h->data[j])) && (rand()%2)))

Definition at line 90 of file closest.c.

#define insideHeap (   h,
 
)    ((i)<h->heapSize)

Definition at line 89 of file closest.c.

#define left (   i)    (2*(i))

Definition at line 86 of file closest.c.

#define LT (   p,
 
)    ((p).dist < (q).dist)

Definition at line 33 of file closest.c.

#define parent (   i)    ((i)/2)

Definition at line 88 of file closest.c.

Referenced by createBlocktree(), lookup_widget(), and push_obj_state().

#define pop (   s,
 
)    ((s->top==0) ? FALSE : (s->top--, x = s->data[s->top], TRUE))

Definition at line 71 of file closest.c.

#define push (   s,
 
)
Value:
{ \
if (s->top>=s->max_size) { \
s->max_size *= 2; \
s->data = (Pair*) realloc(s->data, s->max_size*sizeof(Pair)); \
} \
s->data[s->top++] = x; \
}
Definition: grammar.c:79
if(aagss+aagstacksize-1<=aagssp)
Definition: grammar.c:1332
Definition: closest.c:26

Definition at line 63 of file closest.c.

#define read_top (   h,
 
)    ((s->top==0) ? FALSE : (x = s->data[s->top-1], TRUE))

Definition at line 73 of file closest.c.

#define right (   i)    (2*(i)+1)

Definition at line 87 of file closest.c.

Referenced by bezier_clip(), dot_concentrate(), heapdown(), and update_bb_bz().

#define sub (   h,
 
)    (h->data[i])

Definition at line 75 of file closest.c.

Referenced by agassociate(), html_string(), xml_string0(), and xml_url_string().

Function Documentation

void closest_pairs2graph ( double *  place,
int  n,
int  num_pairs,
vtx_data **  graph 
)

Definition at line 354 of file closest.c.

References freeStack().

Referenced by iterativePCA_1D().