#include <stdio.h>
Go to the source code of this file.
INCLUDES ///.
CFile****************************************************************
FileName [vecQue.h]
SystemName [ABC: Logic synthesis and verification system.]
PackageName [Resizable arrays.]
Synopsis [Priority queue.]
Author [Alan Mishchenko]
Affiliation [UC Berkeley]
Date [Ver. 1.0. Started - June 20, 2005.]
Revision [
- Id:
- vecQue.h,v 1.00 2005/06/20 00:00:00 alanmi Exp
]PARAMETERS ///BASIC TYPES ///
Definition at line 40 of file vecQue.h.
MACRO DEFINITIONS ///.
FUNCTION DEFINITIONS /// Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Definition at line 71 of file vecQue.h.
typedefABC_NAMESPACE_HEADER_START struct Vec_Que_t_ Vec_Que_t
INCLUDES ///.
#define ABC_CALLOC(type, num)
#define ABC_FALLOC(type, num)
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Definition at line 289 of file vecQue.h.
295 for ( i = 0; i <
p->nSize-1; i++ )
297 for ( ; i <
p->nCap; i++ )
301 for ( i = 0; i <
p->nSize-1; i++ )
302 assert(
p->pHeap[
p->pOrder[i]] == i );
303 for ( i++; i <
p->nCap; i++ )
306 for ( i = 1; i <
p->nSize; i++ )
309 if ( child < p->nSize )
312 if ( child < p->nSize )
static float Vec_QuePrio(Vec_Que_t *p, int v)
Definition at line 110 of file vecQue.h.
114 for ( i = 1; i <
p->nSize; i++ )
116 assert(
p->pHeap[i] >= 0 &&
p->pOrder[
p->pHeap[i]] == i );
117 p->pOrder[
p->pHeap[i]] = -1;
Definition at line 89 of file vecQue.h.
static void Vec_QueFree(Vec_Que_t *p)
static void Vec_QueGrow |
( |
Vec_Que_t * |
p, |
|
|
int |
nCapMin |
|
) |
| |
|
inlinestatic |
Definition at line 100 of file vecQue.h.
102 if (
p->nCap >= nCapMin )
106 memset(
p->pHeap +
p->nCap, 0xff, (nCapMin -
p->nCap) *
sizeof(
int) );
107 memset(
p->pOrder +
p->nCap, 0xff, (nCapMin -
p->nCap) *
sizeof(
int) );
#define ABC_REALLOC(type, obj, num)
static int Vec_QueIsMember |
( |
Vec_Que_t * |
p, |
|
|
int |
v |
|
) |
| |
|
inlinestatic |
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Definition at line 216 of file vecQue.h.
219 return (
int)( v <
p->nCap &&
p->pOrder[v] >= 0 );
static void Vec_QueMoveDown |
( |
Vec_Que_t * |
p, |
|
|
int |
v |
|
) |
| |
|
inlinestatic |
Definition at line 179 of file vecQue.h.
182 int i =
p->pOrder[v];
184 while ( child < p->nSize )
188 assert( child < p->nSize );
191 p->pHeap[i] =
p->pHeap[child];
192 p->pOrder[
p->pHeap[i]] = i;
static float Vec_QuePrio(Vec_Que_t *p, int v)
static int Vec_QueMoveUp |
( |
Vec_Que_t * |
p, |
|
|
int |
v |
|
) |
| |
|
inlinestatic |
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Definition at line 159 of file vecQue.h.
162 int i =
p->pOrder[v];
169 p->pHeap[i] =
p->pHeap[parent];
170 p->pOrder[
p->pHeap[i]] = i;
static float Vec_QuePrio(Vec_Que_t *p, int v)
Definition at line 234 of file vecQue.h.
238 Res =
p->pHeap[1];
p->pOrder[Res] = -1;
239 if ( --
p->nSize == 1 )
244 v =
p->pHeap[
p->nSize];
p->pHeap[
p->nSize] = -1;
245 p->pHeap[1] = v;
p->pOrder[v] = 1;
static void Vec_QueMoveDown(Vec_Que_t *p, int v)
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Definition at line 261 of file vecQue.h.
264 for ( i = k = 1; i <
p->nSize; i += k, k *= 2 )
266 for ( m = 0; m < k; m++ )
267 if ( i+m < p->nSize )
268 printf(
"%-5d",
p->pHeap[i+m] );
270 for ( m = 0; m < k; m++ )
271 if ( i+m < p->nSize )
static float Vec_QuePrio(Vec_Que_t *p, int v)
static float Vec_QuePrio |
( |
Vec_Que_t * |
p, |
|
|
int |
v |
|
) |
| |
|
inlinestatic |
Definition at line 50 of file vecQue.h.
50 {
return *
p->pCostsFlt ? (*
p->pCostsFlt)[v] : v; }
static void Vec_QuePush |
( |
Vec_Que_t * |
p, |
|
|
int |
v |
|
) |
| |
|
inlinestatic |
Definition at line 221 of file vecQue.h.
223 if (
p->nSize >=
p->nCap )
230 p->pOrder[v] =
p->nSize;
231 p->pHeap[
p->nSize++] = v;
static void Vec_QueGrow(Vec_Que_t *p, int nCapMin)
static int Vec_QueMoveUp(Vec_Que_t *p, int v)
static int Abc_MaxInt(int a, int b)
static void Vec_QueSetPriority |
( |
Vec_Que_t * |
p, |
|
|
float ** |
pCosts |
|
) |
| |
|
inlinestatic |
Definition at line 95 of file vecQue.h.
98 p->pCostsFlt = pCosts;
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Definition at line 134 of file vecQue.h.
static void Vec_QueTest |
( |
Vec_Flt_t * |
vCosts | ) |
|
|
inlinestatic |
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Definition at line 328 of file vecQue.h.
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
static void Vec_QueCheck(Vec_Que_t *p)
typedefABC_NAMESPACE_HEADER_START struct Vec_Que_t_ Vec_Que_t
INCLUDES ///.
static int Vec_QuePop(Vec_Que_t *p)
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
static void Vec_IntPush(Vec_Int_t *p, int Entry)
static int Vec_IntSize(Vec_Int_t *p)
static float ** Vec_FltArrayP(Vec_Flt_t *p)
static void Vec_QueFree(Vec_Que_t *p)
static void Vec_IntFree(Vec_Int_t *p)
static int Vec_FltSize(Vec_Flt_t *p)
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
static Vec_Que_t * Vec_QueAlloc(int nCap)
MACRO DEFINITIONS ///.
static void Vec_QuePush(Vec_Que_t *p, int v)
static void Vec_QueSetPriority(Vec_Que_t *p, float **pCosts)
Definition at line 139 of file vecQue.h.
static int Vec_QueSize(Vec_Que_t *p)
static float Vec_QueTopPriority |
( |
Vec_Que_t * |
p | ) |
|
|
inlinestatic |
Definition at line 143 of file vecQue.h.
static int Vec_QueSize(Vec_Que_t *p)
static float Vec_QuePrio(Vec_Que_t *p, int v)
#define ABC_INFINITY
MACRO DEFINITIONS ///.
static void Vec_QueUpdate |
( |
Vec_Que_t * |
p, |
|
|
int |
v |
|
) |
| |
|
inlinestatic |
Definition at line 199 of file vecQue.h.
static int Vec_QueMoveUp(Vec_Que_t *p, int v)
static void Vec_QueMoveDown(Vec_Que_t *p, int v)