navit  0.5.3-trunk
fib.c File Reference
#include <fib.h>
#include <fibpriv.h>
#include <limits.h>
#include <stdlib.h>
#include <stdio.h>

Macros

#define swap(type, a, b)
 
#define INT_BITS   (sizeof(int) * 8)
 

Functions

static int ceillog2 (unsigned int a)
 
static void fh_deleteel (struct fibheap *h, struct fibheap_el *x)
 
static void fh_initheap (struct fibheap *new)
 
static void fh_destroyheap (struct fibheap *h)
 
struct fibheapfh_makekeyheap ()
 
struct fibheapfh_makeheap ()
 
voidcmp fh_setcmp (struct fibheap *h, voidcmp fnct)
 
void * fh_setneginf (struct fibheap *h, void *data)
 
struct fibheapfh_union (struct fibheap *ha, struct fibheap *hb)
 
void fh_deleteheap (struct fibheap *h)
 
struct fibheap_elfh_insertkey (struct fibheap *h, int key, void *data)
 
int fh_minkey (struct fibheap *h)
 
int fh_replacekey (struct fibheap *h, struct fibheap_el *x, int key)
 
void * fh_replacekeydata (struct fibheap *h, struct fibheap_el *x, int key, void *data)
 
struct fibheap_elfh_insert (struct fibheap *h, void *data)
 
void * fh_min (struct fibheap *h)
 
void * fh_extractmin (struct fibheap *h)
 
void * fh_replacedata (struct fibheap *h, struct fibheap_el *x, void *data)
 
void * fh_delete (struct fibheap *h, struct fibheap_el *x)
 
static struct fibheap_elfh_extractminel (struct fibheap *h)
 
static void fh_insertrootlist (struct fibheap *h, struct fibheap_el *x)
 
static void fh_removerootlist (struct fibheap *h, struct fibheap_el *x)
 
static void fh_consolidate (struct fibheap *h)
 
static void fh_heaplink (struct fibheap *h, struct fibheap_el *y, struct fibheap_el *x)
 
static void fh_cut (struct fibheap *h, struct fibheap_el *x, struct fibheap_el *y)
 
static void fh_cascading_cut (struct fibheap *h, struct fibheap_el *y)
 
static struct fibheap_elfhe_newelem ()
 
static void fhe_initelem (struct fibheap_el *e)
 
static void fhe_insertafter (struct fibheap_el *a, struct fibheap_el *b)
 
static void fhe_insertbefore (struct fibheap_el *a, struct fibheap_el *b)
 
static struct fibheap_elfhe_remove (struct fibheap_el *x)
 
static void fh_checkcons (struct fibheap *h)
 
static int fh_compare (struct fibheap *h, struct fibheap_el *a, struct fibheap_el *b)
 
static int fh_comparedata (struct fibheap *h, int key, void *data, struct fibheap_el *b)
 
static void fh_insertel (struct fibheap *h, struct fibheap_el *x)
 

Macro Definition Documentation

◆ INT_BITS

#define INT_BITS   (sizeof(int) * 8)

◆ swap

#define swap (   type,
  a,
 
)
Value:
do { \
type c; \
c = a; \
a = b; \
b = c; \
} while (0) \
static struct pcoord c
Definition: popup.c:375

Function Documentation

◆ ceillog2()

static int ceillog2 ( unsigned int  a)
static

References INT_BITS.

Referenced by fh_checkcons().

◆ fh_cascading_cut()

static void fh_cascading_cut ( struct fibheap h,
struct fibheap_el y 
)
static

◆ fh_checkcons()

static void fh_checkcons ( struct fibheap h)
static

◆ fh_compare()

static int fh_compare ( struct fibheap h,
struct fibheap_el a,
struct fibheap_el b 
)
static

◆ fh_comparedata()

static int fh_comparedata ( struct fibheap h,
int  key,
void *  data,
struct fibheap_el b 
)
static

◆ fh_consolidate()

◆ fh_cut()

static void fh_cut ( struct fibheap h,
struct fibheap_el x,
struct fibheap_el y 
)
static

◆ fh_delete()

void* fh_delete ( struct fibheap h,
struct fibheap_el x 
)

◆ fh_deleteel()

static void fh_deleteel ( struct fibheap h,
struct fibheap_el x 
)
static

◆ fh_deleteheap()

◆ fh_destroyheap()

static void fh_destroyheap ( struct fibheap h)
static

◆ fh_extractmin()

◆ fh_extractminel()

◆ fh_heaplink()

static void fh_heaplink ( struct fibheap h,
struct fibheap_el y,
struct fibheap_el x 
)
static

◆ fh_initheap()

static void fh_initheap ( struct fibheap new)
static

Referenced by fh_makeheap(), and fh_makekeyheap().

◆ fh_insert()

struct fibheap_el* fh_insert ( struct fibheap h,
void *  data 
)

References data, fh_insertel(), fibheap_el::fhe_data, and fhe_newelem().

Referenced by main().

◆ fh_insertel()

◆ fh_insertkey()

◆ fh_insertrootlist()

static void fh_insertrootlist ( struct fibheap h,
struct fibheap_el x 
)
static

◆ fh_makeheap()

struct fibheap* fh_makeheap ( void  )

References fh_initheap().

Referenced by main().

◆ fh_makekeyheap()

struct fibheap* fh_makekeyheap ( void  )

◆ fh_min()

void* fh_min ( struct fibheap h)

◆ fh_minkey()

int fh_minkey ( struct fibheap h)

References fibheap::fh_min, and fibheap_el::fhe_key.

Referenced by gui_internal_cmd_pois(), and main().

◆ fh_removerootlist()

static void fh_removerootlist ( struct fibheap h,
struct fibheap_el x 
)
static

◆ fh_replacedata()

void* fh_replacedata ( struct fibheap h,
struct fibheap_el x,
void *  data 
)

References data, fh_replacekeydata(), and fibheap_el::fhe_key.

Referenced by fh_delete(), and fh_deleteel().

◆ fh_replacekey()

int fh_replacekey ( struct fibheap h,
struct fibheap_el x,
int  key 
)

◆ fh_replacekeydata()

void* fh_replacekeydata ( struct fibheap h,
struct fibheap_el x,
int  key,
void *  data 
)

◆ fh_setcmp()

voidcmp fh_setcmp ( struct fibheap h,
voidcmp  fnct 
)

References fibheap::fh_cmp_fnct.

Referenced by main().

◆ fh_setneginf()

void* fh_setneginf ( struct fibheap h,
void *  data 
)

References data, and fibheap::fh_neginf.

◆ fh_union()

◆ fhe_initelem()

◆ fhe_insertafter()

static void fhe_insertafter ( struct fibheap_el a,
struct fibheap_el b 
)
static

◆ fhe_insertbefore()

static void fhe_insertbefore ( struct fibheap_el a,
struct fibheap_el b 
)
static

References fhe_insertafter(), and fibheap_el::fhe_left.

Referenced by fh_heaplink().

◆ fhe_newelem()

static struct fibheap_el* fhe_newelem ( void  )
static

References fhe_initelem().

Referenced by fh_insert(), and fh_insertkey().

◆ fhe_remove()

static struct fibheap_el* fhe_remove ( struct fibheap_el x)
static