21 #ifndef ABC__sat__bsat__vecSet_h
22 #define ABC__sat__bsat__vecSet_h
96 #define Vec_SetForEachEntry( Type, pVec, nSize, pSet, p, s ) \
97 for ( p = 0; p <= pVec->iPage; p++ ) \
98 for ( s = 2; s < Vec_SetLimit(pVec->pPages[p]) && ((pSet) = (Type)(pVec->pPages[p] + (s))); s += nSize )
119 p->nPageSize = nPageSize;
120 p->uPageMask = (unsigned)((1 << nPageSize) - 1);
121 p->nPagesAlloc = 256;
124 p->pPages[0][0] = ~0;
125 p->pPages[0][1] = ~0;
152 p->pPages[0][0] = ~0;
153 p->pPages[0][1] = ~0;
171 if ( p == NULL )
return;
172 for ( i = 0; i < p->nPagesAlloc; i++ )
178 if ( p == NULL )
return;
197 Mem += p->nPagesAlloc *
sizeof(
void *);
198 Mem +=
sizeof(
word) * (1 << p->nPageSize) * (1 + p->iPage);
216 assert( nWords < (1 << p->nPageSize) );
218 if (
Vec_SetLimit( p->pPages[p->iPage] ) + nWords >= (1 << p->nPageSize) )
220 if ( ++p->iPage == p->nPagesAlloc )
223 memset( p->pPages + p->nPagesAlloc, 0,
sizeof(
word *) * p->nPagesAlloc );
226 if ( p->pPages[p->iPage] == NULL )
227 p->pPages[p->iPage] =
ABC_ALLOC(
word, (1 << p->nPageSize) );
229 p->pPages[p->iPage][1] = ~0;
232 memcpy( p->pPages[p->iPage] +
Vec_SetLimit(p->pPages[p->iPage]), pArray,
sizeof(
int) * nSize );
239 assert( nWords < (1 << p->nPageSize) );
240 if (
Vec_SetLimitS( p->pPages[p->iPageS] ) + nWords >= (1 << p->nPageSize) )
273 for ( i = 0; i <= p->iPage; i++ )
static void Vec_SetShrinkS(Vec_Set_t *p, int h)
static int Vec_SetAppendS(Vec_Set_t *p, int nSize)
static void Vec_SetShrinkLimits(Vec_Set_t *p)
static int Vec_SetIncLimit(word *p, int nWords)
static void Vec_SetWriteLimitS(word *p, int nWords)
static void Vec_SetFree(Vec_Set_t *p)
#define ABC_REALLOC(type, obj, num)
static void Vec_SetAlloc_(Vec_Set_t *p, int nPageSize)
FUNCTION DEFINITIONS ///.
static void Vec_SetWriteEntryNum(Vec_Set_t *p, int i)
static Vec_Set_t * Vec_SetAlloc(int nPageSize)
static int Vec_SetLimit(word *p)
static int Vec_SetHandCurrent(Vec_Set_t *p)
#define ABC_ALLOC(type, num)
static int Vec_SetLimitS(word *p)
static int Vec_SetHandMemory(Vec_Set_t *p, int h)
static word * Vec_SetEntry(Vec_Set_t *p, int h)
static int Vec_SetAppend(Vec_Set_t *p, int *pArray, int nSize)
static int Vec_SetEntryNum(Vec_Set_t *p)
static int Vec_SetWordNum(int nSize)
static void Vec_SetShrink(Vec_Set_t *p, int h)
static int Vec_SetHandShift(Vec_Set_t *p, int h)
unsigned __int64 word
DECLARATIONS ///.
static void Vec_SetFree_(Vec_Set_t *p)
static int Vec_SetHandPage(Vec_Set_t *p, int h)
MACRO DEFINITIONS ///.
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
static int Vec_SetMemory(Vec_Set_t *p)
#define ABC_NAMESPACE_HEADER_END
static void Vec_SetWriteLimit(word *p, int nWords)
static int Vec_SetHandCurrentS(Vec_Set_t *p)
typedefABC_NAMESPACE_HEADER_START struct Vec_Set_t_ Vec_Set_t
INCLUDES ///.
static void Vec_SetRestart(Vec_Set_t *p)
#define ABC_CALLOC(type, num)
static int Vec_SetMemoryS(Vec_Set_t *p)
static double Vec_ReportMemory(Vec_Set_t *p)
static int Vec_SetMemoryAll(Vec_Set_t *p)
static int Vec_SetIncLimitS(word *p, int nWords)