mpq_dheaps_i.c File Reference

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

Include dependency graph for mpq_dheaps_i.c:

Go to the source code of this file.

Defines

#define mpq_HEAP_D   3
#define mpq_HEAP_DOWN(x)   (((x)*mpq_HEAP_D)+1)
#define mpq_HEAP_UP(x)   (((x)-1)/mpq_HEAP_D)

Functions

static int mpq_dheap_minchild (int x, mpq_ILLdheap *h)
static void mpq_dheap_siftdown (mpq_ILLdheap *h, int i, int x)
static void mpq_dheap_siftup (mpq_ILLdheap *h, int i, int x)
void mpq_ILLutil_dheap_changekey (mpq_ILLdheap *h, int i, mpq_t *newkey)
void mpq_ILLutil_dheap_delete (mpq_ILLdheap *h, int i)
void mpq_ILLutil_dheap_deletemin (mpq_ILLdheap *h, int *i)
void mpq_ILLutil_dheap_findmin (mpq_ILLdheap *h, int *i)
void mpq_ILLutil_dheap_free (mpq_ILLdheap *h)
int mpq_ILLutil_dheap_init (mpq_ILLdheap *h, int k)
int mpq_ILLutil_dheap_insert (mpq_ILLdheap *h, int i)
int mpq_ILLutil_dheap_resize (mpq_ILLdheap *h, int newsize)

Variables

static int TRACE = 0


Define Documentation

#define mpq_HEAP_D   3

Definition at line 110 of file mpq_dheaps_i.c.

Referenced by mpq_dheap_minchild(), and mpq_maxchild().

#define mpq_HEAP_DOWN (  )     (((x)*mpq_HEAP_D)+1)

Definition at line 112 of file mpq_dheaps_i.c.

Referenced by mpq_dheap_minchild().

#define mpq_HEAP_UP (  )     (((x)-1)/mpq_HEAP_D)

Definition at line 111 of file mpq_dheaps_i.c.

Referenced by mpq_dheap_siftup(), and mpq_siftup().


Function Documentation

static int mpq_dheap_minchild ( int  x,
mpq_ILLdheap h 
) [static]

Definition at line 315 of file mpq_dheaps_i.c.

References mpq_ILLdheap::entry, mpq_ILLdheap::key, mpq_HEAP_D, mpq_HEAP_DOWN, and mpq_ILLdheap::size.

Referenced by mpq_dheap_siftdown().

static void mpq_dheap_siftdown ( mpq_ILLdheap h,
int  i,
int  x 
)

Definition at line 295 of file mpq_dheaps_i.c.

References mpq_ILLdheap::entry, mpq_ILLdheap::key, mpq_ILLdheap::loc, and mpq_dheap_minchild().

Referenced by mpq_ILLutil_dheap_changekey(), and mpq_ILLutil_dheap_delete().

Here is the call graph for this function:

static void mpq_dheap_siftup ( mpq_ILLdheap h,
int  i,
int  x 
) [static]

Definition at line 276 of file mpq_dheaps_i.c.

References mpq_ILLdheap::entry, mpq_ILLdheap::key, mpq_ILLdheap::loc, and mpq_HEAP_UP.

Referenced by mpq_ILLutil_dheap_changekey(), mpq_ILLutil_dheap_delete(), and mpq_ILLutil_dheap_insert().

void mpq_ILLutil_dheap_changekey ( mpq_ILLdheap h,
int  i,
mpq_t *  newkey 
)

Definition at line 259 of file mpq_dheaps_i.c.

References mpq_ILLdheap::key, mpq_ILLdheap::loc, mpq_dheap_siftdown(), and mpq_dheap_siftup().

Here is the call graph for this function:

void mpq_ILLutil_dheap_delete ( mpq_ILLdheap h,
int  i 
)

Definition at line 220 of file mpq_dheaps_i.c.

References mpq_ILLdheap::entry, mpq_ILLdheap::key, mpq_ILLdheap::loc, mpq_dheap_siftdown(), mpq_dheap_siftup(), and mpq_ILLdheap::size.

Here is the call graph for this function:

void mpq_ILLutil_dheap_deletemin ( mpq_ILLdheap h,
int *  i 
)

Definition at line 243 of file mpq_dheaps_i.c.

References mpq_ILLdheap::entry, mpq_ILLutil_dheap_delete(), and mpq_ILLdheap::size.

Referenced by mpq_ILLutil_priority_deletemin().

Here is the call graph for this function:

void mpq_ILLutil_dheap_findmin ( mpq_ILLdheap h,
int *  i 
)

Definition at line 195 of file mpq_dheaps_i.c.

References mpq_ILLdheap::entry, and mpq_ILLdheap::size.

void mpq_ILLutil_dheap_free ( mpq_ILLdheap h  ) 

Definition at line 157 of file mpq_dheaps_i.c.

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

int mpq_ILLutil_dheap_init ( mpq_ILLdheap h,
int  k 
)

Definition at line 129 of file mpq_dheaps_i.c.

References mpq_ILLdheap::entry, ILL_RETURN, ILL_SAFE_MALLOC, mpq_ILLdheap::key, mpq_ILLdheap::loc, mpq_ILLutil_dheap_free(), NULL, mpq_ILLdheap::size, and mpq_ILLdheap::total_space.

Here is the call graph for this function:

int mpq_ILLutil_dheap_insert ( mpq_ILLdheap h,
int  i 
)

Definition at line 205 of file mpq_dheaps_i.c.

References mpq_dheap_siftup(), mpq_ILLdheap::size, and mpq_ILLdheap::total_space.

Referenced by mpq_ILLutil_priority_insert().

Here is the call graph for this function:

int mpq_ILLutil_dheap_resize ( mpq_ILLdheap h,
int  newsize 
)

Definition at line 166 of file mpq_dheaps_i.c.

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


Variable Documentation

int TRACE = 0 [static]

Definition at line 108 of file mpq_dheaps_i.c.


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