#include <stdio.h>
Go to the source code of this file.
Data Structures | |
struct | Vec_Vec_t_ |
Defines | |
#define | Vec_VecForEachLevel(vGlob, vVec, i) for ( i = 0; (i < Vec_VecSize(vGlob)) && (((vVec) = (Vec_Ptr_t*)Vec_VecEntry(vGlob, i)), 1); i++ ) |
#define | Vec_VecForEachLevelStart(vGlob, vVec, i, LevelStart) for ( i = LevelStart; (i < Vec_VecSize(vGlob)) && (((vVec) = (Vec_Ptr_t*)Vec_VecEntry(vGlob, i)), 1); i++ ) |
#define | Vec_VecForEachLevelStartStop(vGlob, vVec, i, LevelStart, LevelStop) for ( i = LevelStart; (i <= LevelStop) && (((vVec) = (Vec_Ptr_t*)Vec_VecEntry(vGlob, i)), 1); i++ ) |
#define | Vec_VecForEachLevelReverse(vGlob, vVec, i) for ( i = Vec_VecSize(vGlob) - 1; (i >= 0) && (((vVec) = (Vec_Ptr_t*)Vec_VecEntry(vGlob, i)), 1); i-- ) |
#define | Vec_VecForEachLevelReverseStartStop(vGlob, vVec, i, LevelStart, LevelStop) for ( i = LevelStart; (i >= LevelStop) && (((vVec) = (Vec_Ptr_t*)Vec_VecEntry(vGlob, i)), 1); i-- ) |
#define | Vec_VecForEachEntry(vGlob, pEntry, i, k) |
#define | Vec_VecForEachEntryLevel(vGlob, pEntry, i, Level) Vec_PtrForEachEntry( Vec_VecEntry(vGlob, Level), pEntry, i ) |
#define | Vec_VecForEachEntryStart(vGlob, pEntry, i, k, LevelStart) |
#define | Vec_VecForEachEntryStartStop(vGlob, pEntry, i, k, LevelStart, LevelStop) |
#define | Vec_VecForEachEntryReverse(vGlob, pEntry, i, k) |
#define | Vec_VecForEachEntryReverseReverse(vGlob, pEntry, i, k) |
#define | Vec_VecForEachEntryReverseStart(vGlob, pEntry, i, k, LevelStart) |
Typedefs | |
typedef struct Vec_Vec_t_ | Vec_Vec_t |
Functions | |
static Vec_Vec_t * | Vec_VecAlloc (int nCap) |
static Vec_Vec_t * | Vec_VecStart (int nSize) |
static void | Vec_VecExpand (Vec_Vec_t *p, int Level) |
static int | Vec_VecSize (Vec_Vec_t *p) |
static void * | Vec_VecEntry (Vec_Vec_t *p, int i) |
static void | Vec_VecFree (Vec_Vec_t *p) |
static int | Vec_VecSizeSize (Vec_Vec_t *p) |
static void | Vec_VecClear (Vec_Vec_t *p) |
static void | Vec_VecPush (Vec_Vec_t *p, int Level, void *Entry) |
static void | Vec_VecPushUnique (Vec_Vec_t *p, int Level, void *Entry) |
static int | Vec_VecSortCompare1 (Vec_Ptr_t **pp1, Vec_Ptr_t **pp2) |
static int | Vec_VecSortCompare2 (Vec_Ptr_t **pp1, Vec_Ptr_t **pp2) |
static void | Vec_VecSort (Vec_Vec_t *p, int fReverse) |
#define Vec_VecForEachEntry | ( | vGlob, | |||
pEntry, | |||||
i, | |||||
k | ) |
for ( i = 0; i < Vec_VecSize(vGlob); i++ ) \ Vec_PtrForEachEntry( Vec_VecEntry(vGlob, i), pEntry, k )
#define Vec_VecForEachEntryLevel | ( | vGlob, | |||
pEntry, | |||||
i, | |||||
Level | ) | Vec_PtrForEachEntry( Vec_VecEntry(vGlob, Level), pEntry, i ) |
#define Vec_VecForEachEntryReverse | ( | vGlob, | |||
pEntry, | |||||
i, | |||||
k | ) |
for ( i = 0; i < Vec_VecSize(vGlob); i++ ) \ Vec_PtrForEachEntryReverse( Vec_VecEntry(vGlob, i), pEntry, k )
#define Vec_VecForEachEntryReverseReverse | ( | vGlob, | |||
pEntry, | |||||
i, | |||||
k | ) |
for ( i = Vec_VecSize(vGlob) - 1; i >= 0; i-- ) \ Vec_PtrForEachEntryReverse( Vec_VecEntry(vGlob, i), pEntry, k )
#define Vec_VecForEachEntryReverseStart | ( | vGlob, | |||
pEntry, | |||||
i, | |||||
k, | |||||
LevelStart | ) |
for ( i = LevelStart; i >= 0; i-- ) \ Vec_PtrForEachEntry( Vec_VecEntry(vGlob, i), pEntry, k )
#define Vec_VecForEachEntryStart | ( | vGlob, | |||
pEntry, | |||||
i, | |||||
k, | |||||
LevelStart | ) |
for ( i = LevelStart; i < Vec_VecSize(vGlob); i++ ) \ Vec_PtrForEachEntry( Vec_VecEntry(vGlob, i), pEntry, k )
#define Vec_VecForEachEntryStartStop | ( | vGlob, | |||
pEntry, | |||||
i, | |||||
k, | |||||
LevelStart, | |||||
LevelStop | ) |
for ( i = LevelStart; i <= LevelStop; i++ ) \ Vec_PtrForEachEntry( Vec_VecEntry(vGlob, i), pEntry, k )
#define Vec_VecForEachLevel | ( | vGlob, | |||
vVec, | |||||
i | ) | for ( i = 0; (i < Vec_VecSize(vGlob)) && (((vVec) = (Vec_Ptr_t*)Vec_VecEntry(vGlob, i)), 1); i++ ) |
#define Vec_VecForEachLevelReverse | ( | vGlob, | |||
vVec, | |||||
i | ) | for ( i = Vec_VecSize(vGlob) - 1; (i >= 0) && (((vVec) = (Vec_Ptr_t*)Vec_VecEntry(vGlob, i)), 1); i-- ) |
#define Vec_VecForEachLevelReverseStartStop | ( | vGlob, | |||
vVec, | |||||
i, | |||||
LevelStart, | |||||
LevelStop | ) | for ( i = LevelStart; (i >= LevelStop) && (((vVec) = (Vec_Ptr_t*)Vec_VecEntry(vGlob, i)), 1); i-- ) |
#define Vec_VecForEachLevelStart | ( | vGlob, | |||
vVec, | |||||
i, | |||||
LevelStart | ) | for ( i = LevelStart; (i < Vec_VecSize(vGlob)) && (((vVec) = (Vec_Ptr_t*)Vec_VecEntry(vGlob, i)), 1); i++ ) |
#define Vec_VecForEachLevelStartStop | ( | vGlob, | |||
vVec, | |||||
i, | |||||
LevelStart, | |||||
LevelStop | ) | for ( i = LevelStart; (i <= LevelStop) && (((vVec) = (Vec_Ptr_t*)Vec_VecEntry(vGlob, i)), 1); i++ ) |
typedef struct Vec_Vec_t_ Vec_Vec_t |
CFile****************************************************************
FileName [vecVec.h]
SystemName [ABC: Logic synthesis and verification system.]
PackageName [Resizable arrays.]
Synopsis [Resizable vector of resizable vectors.]
Author [Alan Mishchenko]
Affiliation [UC Berkeley]
Date [Ver. 1.0. Started - June 20, 2005.]
Revision [
] INCLUDES /// PARAMETERS /// BASIC TYPES ///
static Vec_Vec_t* Vec_VecAlloc | ( | int | nCap | ) | [inline, static] |
FUNCTION DEFINITIONS ///Function*************************************************************
Synopsis [Allocates a vector with the given capacity.]
Description []
SideEffects []
SeeAlso []
static void Vec_VecClear | ( | Vec_Vec_t * | p | ) | [inline, static] |
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Definition at line 239 of file vecVec.h.
00240 { 00241 Vec_Ptr_t * vVec; 00242 int i; 00243 Vec_VecForEachLevel( p, vVec, i ) 00244 Vec_PtrClear( vVec ); 00245 }
static void* Vec_VecEntry | ( | Vec_Vec_t * | p, | |
int | i | |||
) | [inline, static] |
static void Vec_VecExpand | ( | Vec_Vec_t * | p, | |
int | Level | |||
) | [inline, static] |
Function*************************************************************
Synopsis [Allocates a vector with the given capacity.]
Description []
SideEffects []
SeeAlso []
Definition at line 144 of file vecVec.h.
00145 { 00146 int i; 00147 if ( p->nSize >= Level + 1 ) 00148 return; 00149 Vec_PtrGrow( (Vec_Ptr_t *)p, Level + 1 ); 00150 for ( i = p->nSize; i <= Level; i++ ) 00151 p->pArray[i] = Vec_PtrAlloc( 0 ); 00152 p->nSize = Level + 1; 00153 }
static void Vec_VecFree | ( | Vec_Vec_t * | p | ) | [inline, static] |
Function*************************************************************
Synopsis [Frees the vector.]
Description []
SideEffects []
SeeAlso []
Definition at line 199 of file vecVec.h.
00200 { 00201 Vec_Ptr_t * vVec; 00202 int i; 00203 Vec_VecForEachLevel( p, vVec, i ) 00204 Vec_PtrFree( vVec ); 00205 Vec_PtrFree( (Vec_Ptr_t *)p ); 00206 }
static void Vec_VecPush | ( | Vec_Vec_t * | p, | |
int | Level, | |||
void * | Entry | |||
) | [inline, static] |
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Definition at line 258 of file vecVec.h.
00259 { 00260 if ( p->nSize < Level + 1 ) 00261 { 00262 int i; 00263 Vec_PtrGrow( (Vec_Ptr_t *)p, Level + 1 ); 00264 for ( i = p->nSize; i < Level + 1; i++ ) 00265 p->pArray[i] = Vec_PtrAlloc( 0 ); 00266 p->nSize = Level + 1; 00267 } 00268 Vec_PtrPush( (Vec_Ptr_t*)p->pArray[Level], Entry ); 00269 }
static void Vec_VecPushUnique | ( | Vec_Vec_t * | p, | |
int | Level, | |||
void * | Entry | |||
) | [inline, static] |
Function*************************************************************
Synopsis []
Description []
SideEffects []
SeeAlso []
Definition at line 282 of file vecVec.h.
00283 { 00284 if ( p->nSize < Level + 1 ) 00285 Vec_VecPush( p, Level, Entry ); 00286 else 00287 Vec_PtrPushUnique( (Vec_Ptr_t*)p->pArray[Level], Entry ); 00288 }
static int Vec_VecSize | ( | Vec_Vec_t * | p | ) | [inline, static] |
static int Vec_VecSizeSize | ( | Vec_Vec_t * | p | ) | [inline, static] |
Function*************************************************************
Synopsis [Frees the vector of vectors.]
Description []
SideEffects []
SeeAlso []
Definition at line 219 of file vecVec.h.
00220 { 00221 Vec_Ptr_t * vVec; 00222 int i, Counter = 0; 00223 Vec_VecForEachLevel( p, vVec, i ) 00224 Counter += vVec->nSize; 00225 return Counter; 00226 }
static void Vec_VecSort | ( | Vec_Vec_t * | p, | |
int | fReverse | |||
) | [inline, static] |
Function*************************************************************
Synopsis [Sorting the entries by their integer value.]
Description []
SideEffects []
SeeAlso []
Definition at line 341 of file vecVec.h.
00342 { 00343 if ( fReverse ) 00344 qsort( (void *)p->pArray, p->nSize, sizeof(void *), 00345 (int (*)(const void *, const void *)) Vec_VecSortCompare2 ); 00346 else 00347 qsort( (void *)p->pArray, p->nSize, sizeof(void *), 00348 (int (*)(const void *, const void *)) Vec_VecSortCompare1 ); 00349 }
Function*************************************************************
Synopsis [Comparison procedure for two arrays.]
Description []
SideEffects []
SeeAlso []
Definition at line 301 of file vecVec.h.
00302 { 00303 if ( Vec_PtrSize(*pp1) < Vec_PtrSize(*pp2) ) 00304 return -1; 00305 if ( Vec_PtrSize(*pp1) > Vec_PtrSize(*pp2) ) 00306 return 1; 00307 return 0; 00308 }
Function*************************************************************
Synopsis [Comparison procedure for two integers.]
Description []
SideEffects []
SeeAlso []
Definition at line 321 of file vecVec.h.
00322 { 00323 if ( Vec_PtrSize(*pp1) > Vec_PtrSize(*pp2) ) 00324 return -1; 00325 if ( Vec_PtrSize(*pp1) < Vec_PtrSize(*pp2) ) 00326 return 1; 00327 return 0; 00328 }
static Vec_Vec_t* Vec_VecStart | ( | int | nSize | ) | [inline, static] |
Function*************************************************************
Synopsis [Allocates a vector with the given capacity.]
Description []
SideEffects []
SeeAlso []
Definition at line 122 of file vecVec.h.
00123 { 00124 Vec_Vec_t * p; 00125 int i; 00126 p = Vec_VecAlloc( nSize ); 00127 for ( i = 0; i < nSize; i++ ) 00128 p->pArray[i] = Vec_PtrAlloc( 0 ); 00129 p->nSize = nSize; 00130 return p; 00131 }