mpf_dheaps_i.c File Reference

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

Include dependency graph for mpf_dheaps_i.c:

Go to the source code of this file.

Defines

#define mpf_HEAP_D   3
#define mpf_HEAP_DOWN(x)   (((x)*mpf_HEAP_D)+1)
#define mpf_HEAP_UP(x)   (((x)-1)/mpf_HEAP_D)

Functions

static int mpf_dheap_minchild (int x, mpf_ILLdheap *h)
static void mpf_dheap_siftdown (mpf_ILLdheap *h, int i, int x)
static void mpf_dheap_siftup (mpf_ILLdheap *h, int i, int x)
void mpf_ILLutil_dheap_changekey (mpf_ILLdheap *h, int i, mpf_t *newkey)
void mpf_ILLutil_dheap_delete (mpf_ILLdheap *h, int i)
void mpf_ILLutil_dheap_deletemin (mpf_ILLdheap *h, int *i)
void mpf_ILLutil_dheap_findmin (mpf_ILLdheap *h, int *i)
void mpf_ILLutil_dheap_free (mpf_ILLdheap *h)
int mpf_ILLutil_dheap_init (mpf_ILLdheap *h, int k)
int mpf_ILLutil_dheap_insert (mpf_ILLdheap *h, int i)
int mpf_ILLutil_dheap_resize (mpf_ILLdheap *h, int newsize)

Variables

static int TRACE = 0


Define Documentation

#define mpf_HEAP_D   3

Definition at line 110 of file mpf_dheaps_i.c.

Referenced by mpf_dheap_minchild(), and mpf_maxchild().

#define mpf_HEAP_DOWN (  )     (((x)*mpf_HEAP_D)+1)

Definition at line 112 of file mpf_dheaps_i.c.

Referenced by mpf_dheap_minchild().

#define mpf_HEAP_UP (  )     (((x)-1)/mpf_HEAP_D)

Definition at line 111 of file mpf_dheaps_i.c.

Referenced by mpf_dheap_siftup(), and mpf_siftup().


Function Documentation

static int mpf_dheap_minchild ( int  x,
mpf_ILLdheap h 
) [static]

Definition at line 315 of file mpf_dheaps_i.c.

References mpf_ILLdheap::entry, mpf_ILLdheap::key, mpf_HEAP_D, mpf_HEAP_DOWN, and mpf_ILLdheap::size.

Referenced by mpf_dheap_siftdown().

static void mpf_dheap_siftdown ( mpf_ILLdheap h,
int  i,
int  x 
)

Definition at line 295 of file mpf_dheaps_i.c.

References mpf_ILLdheap::entry, mpf_ILLdheap::key, mpf_ILLdheap::loc, and mpf_dheap_minchild().

Referenced by mpf_ILLutil_dheap_changekey(), and mpf_ILLutil_dheap_delete().

Here is the call graph for this function:

static void mpf_dheap_siftup ( mpf_ILLdheap h,
int  i,
int  x 
) [static]

Definition at line 276 of file mpf_dheaps_i.c.

References mpf_ILLdheap::entry, mpf_ILLdheap::key, mpf_ILLdheap::loc, and mpf_HEAP_UP.

Referenced by mpf_ILLutil_dheap_changekey(), mpf_ILLutil_dheap_delete(), and mpf_ILLutil_dheap_insert().

void mpf_ILLutil_dheap_changekey ( mpf_ILLdheap h,
int  i,
mpf_t *  newkey 
)

Definition at line 259 of file mpf_dheaps_i.c.

References mpf_ILLdheap::key, mpf_ILLdheap::loc, mpf_dheap_siftdown(), and mpf_dheap_siftup().

Here is the call graph for this function:

void mpf_ILLutil_dheap_delete ( mpf_ILLdheap h,
int  i 
)

Definition at line 220 of file mpf_dheaps_i.c.

References mpf_ILLdheap::entry, mpf_ILLdheap::key, mpf_ILLdheap::loc, mpf_dheap_siftdown(), mpf_dheap_siftup(), and mpf_ILLdheap::size.

Here is the call graph for this function:

void mpf_ILLutil_dheap_deletemin ( mpf_ILLdheap h,
int *  i 
)

Definition at line 243 of file mpf_dheaps_i.c.

References mpf_ILLdheap::entry, mpf_ILLutil_dheap_delete(), and mpf_ILLdheap::size.

Referenced by mpf_ILLutil_priority_deletemin().

Here is the call graph for this function:

void mpf_ILLutil_dheap_findmin ( mpf_ILLdheap h,
int *  i 
)

Definition at line 195 of file mpf_dheaps_i.c.

References mpf_ILLdheap::entry, and mpf_ILLdheap::size.

void mpf_ILLutil_dheap_free ( mpf_ILLdheap h  ) 

Definition at line 157 of file mpf_dheaps_i.c.

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

int mpf_ILLutil_dheap_init ( mpf_ILLdheap h,
int  k 
)

Definition at line 129 of file mpf_dheaps_i.c.

References mpf_ILLdheap::entry, ILL_RETURN, ILL_SAFE_MALLOC, mpf_ILLdheap::key, mpf_ILLdheap::loc, mpf_ILLutil_dheap_free(), NULL, mpf_ILLdheap::size, and mpf_ILLdheap::total_space.

Here is the call graph for this function:

int mpf_ILLutil_dheap_insert ( mpf_ILLdheap h,
int  i 
)

Definition at line 205 of file mpf_dheaps_i.c.

References mpf_dheap_siftup(), mpf_ILLdheap::size, and mpf_ILLdheap::total_space.

Referenced by mpf_ILLutil_priority_insert().

Here is the call graph for this function:

int mpf_ILLutil_dheap_resize ( mpf_ILLdheap h,
int  newsize 
)

Definition at line 166 of file mpf_dheaps_i.c.

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


Variable Documentation

int TRACE = 0 [static]

Definition at line 108 of file mpf_dheaps_i.c.


Generated on Thu Mar 29 09:41:43 2012 for QSopt_ex by  doxygen 1.4.7