ldbl_dheaps_i.c File Reference

#include "qs_config.h"
#include "ldbl_dheaps_i.h"
#include "allocrus.h"
#include "machdefs.h"
#include "except.h"
#include "trace.h"

Include dependency graph for ldbl_dheaps_i.c:

Go to the source code of this file.

Defines

#define ldbl_HEAP_D   3
#define ldbl_HEAP_DOWN(x)   (((x)*ldbl_HEAP_D)+1)
#define ldbl_HEAP_UP(x)   (((x)-1)/ldbl_HEAP_D)

Functions

static int ldbl_dheap_minchild (int x, ldbl_ILLdheap *h)
static void ldbl_dheap_siftdown (ldbl_ILLdheap *h, int i, int x)
static void ldbl_dheap_siftup (ldbl_ILLdheap *h, int i, int x)
void ldbl_ILLutil_dheap_changekey (ldbl_ILLdheap *h, int i, long double *newkey)
void ldbl_ILLutil_dheap_delete (ldbl_ILLdheap *h, int i)
void ldbl_ILLutil_dheap_deletemin (ldbl_ILLdheap *h, int *i)
void ldbl_ILLutil_dheap_findmin (ldbl_ILLdheap *h, int *i)
void ldbl_ILLutil_dheap_free (ldbl_ILLdheap *h)
int ldbl_ILLutil_dheap_init (ldbl_ILLdheap *h, int k)
int ldbl_ILLutil_dheap_insert (ldbl_ILLdheap *h, int i)
int ldbl_ILLutil_dheap_resize (ldbl_ILLdheap *h, int newsize)

Variables

static int TRACE = 0


Define Documentation

#define ldbl_HEAP_D   3

Definition at line 110 of file ldbl_dheaps_i.c.

Referenced by ldbl_dheap_minchild(), and ldbl_maxchild().

#define ldbl_HEAP_DOWN (  )     (((x)*ldbl_HEAP_D)+1)

Definition at line 112 of file ldbl_dheaps_i.c.

Referenced by ldbl_dheap_minchild().

#define ldbl_HEAP_UP (  )     (((x)-1)/ldbl_HEAP_D)

Definition at line 111 of file ldbl_dheaps_i.c.

Referenced by ldbl_dheap_siftup(), and ldbl_siftup().


Function Documentation

static int ldbl_dheap_minchild ( int  x,
ldbl_ILLdheap h 
) [static]

Definition at line 315 of file ldbl_dheaps_i.c.

References ldbl_ILLdheap::entry, ldbl_ILLdheap::key, ldbl_HEAP_D, ldbl_HEAP_DOWN, and ldbl_ILLdheap::size.

Referenced by ldbl_dheap_siftdown().

static void ldbl_dheap_siftdown ( ldbl_ILLdheap h,
int  i,
int  x 
)

Definition at line 295 of file ldbl_dheaps_i.c.

References ldbl_ILLdheap::entry, ldbl_ILLdheap::key, ldbl_dheap_minchild(), and ldbl_ILLdheap::loc.

Referenced by ldbl_ILLutil_dheap_changekey(), and ldbl_ILLutil_dheap_delete().

Here is the call graph for this function:

static void ldbl_dheap_siftup ( ldbl_ILLdheap h,
int  i,
int  x 
) [static]

Definition at line 276 of file ldbl_dheaps_i.c.

References ldbl_ILLdheap::entry, ldbl_ILLdheap::key, ldbl_HEAP_UP, and ldbl_ILLdheap::loc.

Referenced by ldbl_ILLutil_dheap_changekey(), ldbl_ILLutil_dheap_delete(), and ldbl_ILLutil_dheap_insert().

void ldbl_ILLutil_dheap_changekey ( ldbl_ILLdheap h,
int  i,
long double *  newkey 
)

Definition at line 259 of file ldbl_dheaps_i.c.

References ldbl_ILLdheap::key, ldbl_dheap_siftdown(), ldbl_dheap_siftup(), and ldbl_ILLdheap::loc.

Here is the call graph for this function:

void ldbl_ILLutil_dheap_delete ( ldbl_ILLdheap h,
int  i 
)

Definition at line 220 of file ldbl_dheaps_i.c.

References ldbl_ILLdheap::entry, ldbl_ILLdheap::key, ldbl_dheap_siftdown(), ldbl_dheap_siftup(), ldbl_ILLdheap::loc, and ldbl_ILLdheap::size.

Here is the call graph for this function:

void ldbl_ILLutil_dheap_deletemin ( ldbl_ILLdheap h,
int *  i 
)

Definition at line 243 of file ldbl_dheaps_i.c.

References ldbl_ILLdheap::entry, ldbl_ILLutil_dheap_delete(), and ldbl_ILLdheap::size.

Referenced by ldbl_ILLutil_priority_deletemin().

Here is the call graph for this function:

void ldbl_ILLutil_dheap_findmin ( ldbl_ILLdheap h,
int *  i 
)

Definition at line 195 of file ldbl_dheaps_i.c.

References ldbl_ILLdheap::entry, and ldbl_ILLdheap::size.

void ldbl_ILLutil_dheap_free ( ldbl_ILLdheap h  ) 

Definition at line 157 of file ldbl_dheaps_i.c.

References ldbl_ILLdheap::entry, ILL_IFFREE, ldbl_ILLdheap::key, and ldbl_ILLdheap::loc.

int ldbl_ILLutil_dheap_init ( ldbl_ILLdheap h,
int  k 
)

Definition at line 129 of file ldbl_dheaps_i.c.

References ldbl_ILLdheap::entry, ILL_RETURN, ILL_SAFE_MALLOC, ldbl_ILLdheap::key, ldbl_ILLutil_dheap_free(), ldbl_ILLdheap::loc, NULL, ldbl_ILLdheap::size, and ldbl_ILLdheap::total_space.

Here is the call graph for this function:

int ldbl_ILLutil_dheap_insert ( ldbl_ILLdheap h,
int  i 
)

Definition at line 205 of file ldbl_dheaps_i.c.

References ldbl_dheap_siftup(), ldbl_ILLdheap::size, and ldbl_ILLdheap::total_space.

Referenced by ldbl_ILLutil_priority_insert().

Here is the call graph for this function:

int ldbl_ILLutil_dheap_resize ( ldbl_ILLdheap h,
int  newsize 
)

Definition at line 166 of file ldbl_dheaps_i.c.

References ldbl_ILLdheap::entry, ILL_CLEANUP, ILL_RETURN, ldbl_ILLdheap::key, ldbl_ILLdheap::loc, and ldbl_ILLdheap::total_space.


Variable Documentation

int TRACE = 0 [static]

Definition at line 108 of file ldbl_dheaps_i.c.


Generated on Thu Mar 29 09:39:30 2012 for QSopt_ex by  doxygen 1.4.7