abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
vecWec.h File Reference
#include <stdio.h>

Go to the source code of this file.

Data Structures

struct  Vec_Wec_t_
 

Macros

#define Vec_WecForEachLevel(vGlob, vVec, i)   for ( i = 0; (i < Vec_WecSize(vGlob)) && (((vVec) = Vec_WecEntry(vGlob, i)), 1); i++ )
 MACRO DEFINITIONS ///. More...
 
#define Vec_WecForEachLevelVec(vLevels, vGlob, vVec, i)   for ( i = 0; (i < Vec_IntSize(vLevels)) && (((vVec) = Vec_WecEntry(vGlob, Vec_IntEntry(vLevels, i))), 1); i++ )
 
#define Vec_WecForEachLevelStart(vGlob, vVec, i, LevelStart)   for ( i = LevelStart; (i < Vec_WecSize(vGlob)) && (((vVec) = Vec_WecEntry(vGlob, i)), 1); i++ )
 
#define Vec_WecForEachLevelStop(vGlob, vVec, i, LevelStop)   for ( i = 0; (i < LevelStop) && (((vVec) = Vec_WecEntry(vGlob, i)), 1); i++ )
 
#define Vec_WecForEachLevelStartStop(vGlob, vVec, i, LevelStart, LevelStop)   for ( i = LevelStart; (i < LevelStop) && (((vVec) = Vec_WecEntry(vGlob, i)), 1); i++ )
 
#define Vec_WecForEachLevelReverse(vGlob, vVec, i)   for ( i = Vec_WecSize(vGlob)-1; (i >= 0) && (((vVec) = Vec_WecEntry(vGlob, i)), 1); i-- )
 
#define Vec_WecForEachLevelReverseStartStop(vGlob, vVec, i, LevelStart, LevelStop)   for ( i = LevelStart-1; (i >= LevelStop) && (((vVec) = Vec_WecEntry(vGlob, i)), 1); i-- )
 
#define Vec_WecForEachLevelTwo(vGlob1, vGlob2, vVec1, vVec2, i)   for ( i = 0; (i < Vec_WecSize(vGlob1)) && (((vVec1) = Vec_WecEntry(vGlob1, i)), 1) && (((vVec2) = Vec_WecEntry(vGlob2, i)), 1); i++ )
 

Typedefs

typedef
typedefABC_NAMESPACE_HEADER_START
struct Vec_Wec_t_ 
Vec_Wec_t
 INCLUDES ///. More...
 

Functions

static Vec_Wec_tVec_WecAlloc (int nCap)
 FUNCTION DEFINITIONS ///. More...
 
static Vec_Wec_tVec_WecStart (int nSize)
 
static void Vec_WecGrow (Vec_Wec_t *p, int nCapMin)
 
static void Vec_WecInit (Vec_Wec_t *p, int nSize)
 
static Vec_Int_tVec_WecEntry (Vec_Wec_t *p, int i)
 
static Vec_Int_tVec_WecEntryLast (Vec_Wec_t *p)
 
static int Vec_WecEntryEntry (Vec_Wec_t *p, int i, int k)
 
static Vec_Int_tVec_WecArray (Vec_Wec_t *p)
 
static int Vec_WecLevelId (Vec_Wec_t *p, Vec_Int_t *vLevel)
 
static int Vec_WecCap (Vec_Wec_t *p)
 
static int Vec_WecSize (Vec_Wec_t *p)
 
static int Vec_WecLevelSize (Vec_Wec_t *p, int i)
 
static int Vec_WecSizeSize (Vec_Wec_t *p)
 
static int Vec_WecSizeUsed (Vec_Wec_t *p)
 
static int Vec_WecSizeUsedLimits (Vec_Wec_t *p, int iStart, int iStop)
 
static void Vec_WecShrink (Vec_Wec_t *p, int nSizeNew)
 
static void Vec_WecClear (Vec_Wec_t *p)
 
static void Vec_WecPush (Vec_Wec_t *p, int Level, int Entry)
 
static Vec_Int_tVec_WecPushLevel (Vec_Wec_t *p)
 
static double Vec_WecMemory (Vec_Wec_t *p)
 
static void Vec_WecZero (Vec_Wec_t *p)
 
static void Vec_WecErase (Vec_Wec_t *p)
 
static void Vec_WecFree (Vec_Wec_t *p)
 
static void Vec_WecFreeP (Vec_Wec_t **p)
 
static void Vec_WecPushUnique (Vec_Wec_t *p, int Level, int Entry)
 
static Vec_Wec_tVec_WecDup (Vec_Wec_t *p)
 
static int Vec_WecSortCompare1 (Vec_Int_t *p1, Vec_Int_t *p2)
 
static int Vec_WecSortCompare2 (Vec_Int_t *p1, Vec_Int_t *p2)
 
static void Vec_WecSort (Vec_Wec_t *p, int fReverse)
 
static int Vec_WecSortCompare3 (Vec_Int_t *p1, Vec_Int_t *p2)
 
static int Vec_WecSortCompare4 (Vec_Int_t *p1, Vec_Int_t *p2)
 
static void Vec_WecSortByFirstInt (Vec_Wec_t *p, int fReverse)
 
static int Vec_WecSortCompare5 (Vec_Int_t *p1, Vec_Int_t *p2)
 
static int Vec_WecSortCompare6 (Vec_Int_t *p1, Vec_Int_t *p2)
 
static void Vec_WecSortByLastInt (Vec_Wec_t *p, int fReverse)
 
static void Vec_WecPrint (Vec_Wec_t *p, int fSkipSingles)
 
static Vec_Wec_tVec_WecCreateClasses (Vec_Int_t *vMap)
 
static int Vec_WecCountNonTrivial (Vec_Wec_t *p, int *pnUsed)
 
static Vec_Int_tVec_WecCollectFirsts (Vec_Wec_t *p)
 
static Vec_Ptr_tVec_WecConvertToVecPtr (Vec_Wec_t *p)
 
static int Vec_WecIntHasMark (Vec_Int_t *vVec)
 
static void Vec_WecIntSetMark (Vec_Int_t *vVec)
 
static void Vec_WecIntXorMark (Vec_Int_t *vVec)
 
static void Vec_WecMarkLevels (Vec_Wec_t *vCubes, Vec_Int_t *vLevels)
 
static void Vec_WecUnmarkLevels (Vec_Wec_t *vCubes, Vec_Int_t *vLevels)
 
static void Vec_WecRemoveEmpty (Vec_Wec_t *vCubes)
 

Macro Definition Documentation

#define Vec_WecForEachLevel (   vGlob,
  vVec,
 
)    for ( i = 0; (i < Vec_WecSize(vGlob)) && (((vVec) = Vec_WecEntry(vGlob, i)), 1); i++ )

MACRO DEFINITIONS ///.

Definition at line 55 of file vecWec.h.

#define Vec_WecForEachLevelReverse (   vGlob,
  vVec,
 
)    for ( i = Vec_WecSize(vGlob)-1; (i >= 0) && (((vVec) = Vec_WecEntry(vGlob, i)), 1); i-- )

Definition at line 65 of file vecWec.h.

#define Vec_WecForEachLevelReverseStartStop (   vGlob,
  vVec,
  i,
  LevelStart,
  LevelStop 
)    for ( i = LevelStart-1; (i >= LevelStop) && (((vVec) = Vec_WecEntry(vGlob, i)), 1); i-- )

Definition at line 67 of file vecWec.h.

#define Vec_WecForEachLevelStart (   vGlob,
  vVec,
  i,
  LevelStart 
)    for ( i = LevelStart; (i < Vec_WecSize(vGlob)) && (((vVec) = Vec_WecEntry(vGlob, i)), 1); i++ )

Definition at line 59 of file vecWec.h.

#define Vec_WecForEachLevelStartStop (   vGlob,
  vVec,
  i,
  LevelStart,
  LevelStop 
)    for ( i = LevelStart; (i < LevelStop) && (((vVec) = Vec_WecEntry(vGlob, i)), 1); i++ )

Definition at line 63 of file vecWec.h.

#define Vec_WecForEachLevelStop (   vGlob,
  vVec,
  i,
  LevelStop 
)    for ( i = 0; (i < LevelStop) && (((vVec) = Vec_WecEntry(vGlob, i)), 1); i++ )

Definition at line 61 of file vecWec.h.

#define Vec_WecForEachLevelTwo (   vGlob1,
  vGlob2,
  vVec1,
  vVec2,
 
)    for ( i = 0; (i < Vec_WecSize(vGlob1)) && (((vVec1) = Vec_WecEntry(vGlob1, i)), 1) && (((vVec2) = Vec_WecEntry(vGlob2, i)), 1); i++ )

Definition at line 69 of file vecWec.h.

#define Vec_WecForEachLevelVec (   vLevels,
  vGlob,
  vVec,
 
)    for ( i = 0; (i < Vec_IntSize(vLevels)) && (((vVec) = Vec_WecEntry(vGlob, Vec_IntEntry(vLevels, i))), 1); i++ )

Definition at line 57 of file vecWec.h.

Typedef Documentation

typedef typedefABC_NAMESPACE_HEADER_START struct Vec_Wec_t_ Vec_Wec_t

INCLUDES ///.

CFile****************************************************************

FileName [vecWec.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 [

Id:
vecWec.h,v 1.00 2005/06/20 00:00:00 alanmi Exp

]PARAMETERS ///BASIC TYPES ///

Definition at line 42 of file vecWec.h.

Function Documentation

static Vec_Wec_t* Vec_WecAlloc ( int  nCap)
inlinestatic

FUNCTION DEFINITIONS ///.

Function*************************************************************

Synopsis [Allocates a vector with the given capacity.]

Description []

SideEffects []

SeeAlso []

Definition at line 87 of file vecWec.h.

88 {
89  Vec_Wec_t * p;
90  p = ABC_ALLOC( Vec_Wec_t, 1 );
91  if ( nCap > 0 && nCap < 8 )
92  nCap = 8;
93  p->nSize = 0;
94  p->nCap = nCap;
95  p->pArray = p->nCap? ABC_CALLOC( Vec_Int_t, p->nCap ) : NULL;
96  return p;
97 }
typedefABC_NAMESPACE_HEADER_START struct Vec_Wec_t_ Vec_Wec_t
INCLUDES ///.
Definition: vecWec.h:42
static Llb_Mgr_t * p
Definition: llb3Image.c:950
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
#define ABC_ALLOC(type, num)
Definition: abc_global.h:229
#define ABC_CALLOC(type, num)
Definition: abc_global.h:230
static Vec_Int_t* Vec_WecArray ( Vec_Wec_t p)
inlinestatic

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 168 of file vecWec.h.

169 {
170  return p->pArray;
171 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Vec_WecCap ( Vec_Wec_t p)
inlinestatic

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 189 of file vecWec.h.

190 {
191  return p->nCap;
192 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static void Vec_WecClear ( Vec_Wec_t p)
inlinestatic

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 255 of file vecWec.h.

256 {
257  Vec_Int_t * vVec;
258  int i;
259  Vec_WecForEachLevel( p, vVec, i )
260  Vec_IntClear( vVec );
261  p->nSize = 0;
262 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
#define Vec_WecForEachLevel(vGlob, vVec, i)
MACRO DEFINITIONS ///.
Definition: vecWec.h:55
static void Vec_IntClear(Vec_Int_t *p)
Definition: bblif.c:452
static Vec_Int_t* Vec_WecCollectFirsts ( Vec_Wec_t p)
inlinestatic

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 596 of file vecWec.h.

597 {
598  Vec_Int_t * vFirsts, * vLevel;
599  int i;
600  vFirsts = Vec_IntAlloc( Vec_WecSize(p) );
601  Vec_WecForEachLevel( p, vLevel, i )
602  if ( Vec_IntSize(vLevel) > 0 )
603  Vec_IntPush( vFirsts, Vec_IntEntry(vLevel, 0) );
604  return vFirsts;
605 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
static int Vec_WecSize(Vec_Wec_t *p)
Definition: vecWec.h:193
#define Vec_WecForEachLevel(vGlob, vVec, i)
MACRO DEFINITIONS ///.
Definition: vecWec.h:55
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: bblif.c:149
static int Vec_IntEntry(Vec_Int_t *p, int i)
Definition: bblif.c:268
if(last==0)
Definition: sparse_int.h:34
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
static Vec_Ptr_t* Vec_WecConvertToVecPtr ( Vec_Wec_t p)
inlinestatic

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 618 of file vecWec.h.

619 {
620  Vec_Ptr_t * vCopy;
621  Vec_Int_t * vLevel;
622  int i;
623  vCopy = Vec_PtrAlloc( Vec_WecSize(p) );
624  Vec_WecForEachLevel( p, vLevel, i )
625  Vec_PtrPush( vCopy, Vec_IntDup(vLevel) );
626  return vCopy;
627 }
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
Definition: vecPtr.h:42
static Vec_Int_t * Vec_IntDup(Vec_Int_t *pVec)
Definition: vecInt.h:214
static Llb_Mgr_t * p
Definition: llb3Image.c:950
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
Definition: vecPtr.h:606
static int Vec_WecSize(Vec_Wec_t *p)
Definition: vecWec.h:193
#define Vec_WecForEachLevel(vGlob, vVec, i)
MACRO DEFINITIONS ///.
Definition: vecWec.h:55
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: vecPtr.h:83
static int Vec_WecCountNonTrivial ( Vec_Wec_t p,
int *  pnUsed 
)
inlinestatic

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 570 of file vecWec.h.

571 {
572  Vec_Int_t * vClass;
573  int i, nClasses = 0;
574  *pnUsed = 0;
575  Vec_WecForEachLevel( p, vClass, i )
576  {
577  if ( Vec_IntSize(vClass) < 2 )
578  continue;
579  nClasses++;
580  (*pnUsed) += Vec_IntSize(vClass);
581  }
582  return nClasses;
583 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
#define Vec_WecForEachLevel(vGlob, vVec, i)
MACRO DEFINITIONS ///.
Definition: vecWec.h:55
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
static Vec_Wec_t* Vec_WecCreateClasses ( Vec_Int_t vMap)
inlinestatic

Function*************************************************************

Synopsis [Derives the set of equivalence classes.]

Description []

SideEffects []

SeeAlso []

Definition at line 549 of file vecWec.h.

550 {
551  Vec_Wec_t * vClasses;
552  int i, Entry;
553  vClasses = Vec_WecStart( Vec_IntFindMax(vMap) + 1 );
554  Vec_IntForEachEntry( vMap, Entry, i )
555  Vec_WecPush( vClasses, Entry, i );
556  return vClasses;
557 }
typedefABC_NAMESPACE_HEADER_START struct Vec_Wec_t_ Vec_Wec_t
INCLUDES ///.
Definition: vecWec.h:42
static Vec_Wec_t * Vec_WecStart(int nSize)
Definition: vecWec.h:98
static int Vec_IntFindMax(Vec_Int_t *p)
Definition: vecInt.h:996
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition: vecInt.h:54
static void Vec_WecPush(Vec_Wec_t *p, int Level, int Entry)
Definition: vecWec.h:275
static Vec_Wec_t* Vec_WecDup ( Vec_Wec_t p)
inlinestatic

Function*************************************************************

Synopsis [Frees the vector.]

Description []

SideEffects []

SeeAlso []

Definition at line 388 of file vecWec.h.

389 {
390  Vec_Wec_t * vNew;
391  Vec_Int_t * vVec;
392  int i, k, Entry;
393  vNew = Vec_WecAlloc( Vec_WecSize(p) );
394  Vec_WecForEachLevel( p, vVec, i )
395  Vec_IntForEachEntry( vVec, Entry, k )
396  Vec_WecPush( vNew, i, Entry );
397  return vNew;
398 }
static Vec_Wec_t * Vec_WecAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: vecWec.h:87
typedefABC_NAMESPACE_HEADER_START struct Vec_Wec_t_ Vec_Wec_t
INCLUDES ///.
Definition: vecWec.h:42
static Llb_Mgr_t * p
Definition: llb3Image.c:950
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
static int Vec_WecSize(Vec_Wec_t *p)
Definition: vecWec.h:193
#define Vec_WecForEachLevel(vGlob, vVec, i)
MACRO DEFINITIONS ///.
Definition: vecWec.h:55
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition: vecInt.h:54
static void Vec_WecPush(Vec_Wec_t *p, int Level, int Entry)
Definition: vecWec.h:275
static Vec_Int_t* Vec_WecEntry ( Vec_Wec_t p,
int  i 
)
inlinestatic

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 142 of file vecWec.h.

143 {
144  assert( i >= 0 && i < p->nSize );
145  return p->pArray + i;
146 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
#define assert(ex)
Definition: util_old.h:213
static int Vec_WecEntryEntry ( Vec_Wec_t p,
int  i,
int  k 
)
inlinestatic

Definition at line 152 of file vecWec.h.

153 {
154  return Vec_IntEntry( Vec_WecEntry(p, i), k );
155 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Vec_IntEntry(Vec_Int_t *p, int i)
Definition: bblif.c:268
static Vec_Int_t * Vec_WecEntry(Vec_Wec_t *p, int i)
Definition: vecWec.h:142
static Vec_Int_t* Vec_WecEntryLast ( Vec_Wec_t p)
inlinestatic

Definition at line 147 of file vecWec.h.

148 {
149  assert( p->nSize > 0 );
150  return p->pArray + p->nSize - 1;
151 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
#define assert(ex)
Definition: util_old.h:213
static void Vec_WecErase ( Vec_Wec_t p)
inlinestatic

Definition at line 336 of file vecWec.h.

337 {
338  int i;
339  for ( i = 0; i < p->nCap; i++ )
340  ABC_FREE( p->pArray[i].pArray );
341  ABC_FREE( p->pArray );
342  p->nSize = 0;
343  p->nCap = 0;
344 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
#define ABC_FREE(obj)
Definition: abc_global.h:232
static void Vec_WecFree ( Vec_Wec_t p)
inlinestatic

Definition at line 345 of file vecWec.h.

346 {
347  Vec_WecErase( p );
348  ABC_FREE( p );
349 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static void Vec_WecErase(Vec_Wec_t *p)
Definition: vecWec.h:336
#define ABC_FREE(obj)
Definition: abc_global.h:232
static void Vec_WecFreeP ( Vec_Wec_t **  p)
inlinestatic

Definition at line 350 of file vecWec.h.

351 {
352  if ( *p == NULL )
353  return;
354  Vec_WecFree( *p );
355  *p = NULL;
356 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static void Vec_WecFree(Vec_Wec_t *p)
Definition: vecWec.h:345
static void Vec_WecGrow ( Vec_Wec_t p,
int  nCapMin 
)
inlinestatic

Function*************************************************************

Synopsis [Resizes the vector to the given capacity.]

Description []

SideEffects []

SeeAlso []

Definition at line 117 of file vecWec.h.

118 {
119  if ( p->nCap >= nCapMin )
120  return;
121  p->pArray = ABC_REALLOC( Vec_Int_t, p->pArray, nCapMin );
122  memset( p->pArray + p->nCap, 0, sizeof(Vec_Int_t) * (nCapMin - p->nCap) );
123  p->nCap = nCapMin;
124 }
char * memset()
static Llb_Mgr_t * p
Definition: llb3Image.c:950
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
#define ABC_REALLOC(type, obj, num)
Definition: abc_global.h:233
static void Vec_WecInit ( Vec_Wec_t p,
int  nSize 
)
inlinestatic

Definition at line 125 of file vecWec.h.

126 {
127  Vec_WecGrow( p, nSize );
128  p->nSize = nSize;
129 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static void Vec_WecGrow(Vec_Wec_t *p, int nCapMin)
Definition: vecWec.h:117
static int Vec_WecIntHasMark ( Vec_Int_t vVec)
inlinestatic

Function*************************************************************

Synopsis [Temporary vector marking.]

Description [The vector should be static when the marking is used.]

SideEffects []

SeeAlso []

Definition at line 641 of file vecWec.h.

641 { return (vVec->nCap >> 30) & 1; }
static void Vec_WecIntSetMark ( Vec_Int_t vVec)
inlinestatic

Definition at line 642 of file vecWec.h.

642 { vVec->nCap |= (1<<30); }
static void Vec_WecIntXorMark ( Vec_Int_t vVec)
inlinestatic

Definition at line 643 of file vecWec.h.

643 { vVec->nCap ^= (1<<30); }
static int Vec_WecLevelId ( Vec_Wec_t p,
Vec_Int_t vLevel 
)
inlinestatic

Definition at line 172 of file vecWec.h.

173 {
174  assert( p->pArray <= vLevel && vLevel < p->pArray + p->nSize );
175  return vLevel - p->pArray;
176 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
#define assert(ex)
Definition: util_old.h:213
static int Vec_WecLevelSize ( Vec_Wec_t p,
int  i 
)
inlinestatic

Definition at line 197 of file vecWec.h.

198 {
199  assert( i >= 0 && i < p->nSize );
200  return Vec_IntSize( p->pArray + i );
201 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
#define assert(ex)
Definition: util_old.h:213
static void Vec_WecMarkLevels ( Vec_Wec_t vCubes,
Vec_Int_t vLevels 
)
inlinestatic

Definition at line 644 of file vecWec.h.

645 {
646  Vec_Int_t * vCube;
647  int i;
648  Vec_WecForEachLevelVec( vLevels, vCubes, vCube, i )
649  {
650  assert( !Vec_WecIntHasMark( vCube ) );
651  Vec_WecIntXorMark( vCube );
652  }
653 }
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
#define Vec_WecForEachLevelVec(vLevels, vGlob, vVec, i)
Definition: vecWec.h:57
static void Vec_WecIntXorMark(Vec_Int_t *vVec)
Definition: vecWec.h:643
static int Vec_WecIntHasMark(Vec_Int_t *vVec)
Definition: vecWec.h:641
#define assert(ex)
Definition: util_old.h:213
static double Vec_WecMemory ( Vec_Wec_t p)
inlinestatic

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 308 of file vecWec.h.

309 {
310  int i;
311  double Mem;
312  if ( p == NULL ) return 0.0;
313  Mem = sizeof(Vec_Int_t) * Vec_WecCap(p);
314  for ( i = 0; i < p->nSize; i++ )
315  Mem += sizeof(int) * Vec_IntCap( Vec_WecEntry(p, i) );
316  return Mem;
317 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
static int Vec_WecCap(Vec_Wec_t *p)
Definition: vecWec.h:189
static int Vec_IntCap(Vec_Int_t *p)
Definition: vecInt.h:368
static Vec_Int_t * Vec_WecEntry(Vec_Wec_t *p, int i)
Definition: vecWec.h:142
static void Vec_WecPrint ( Vec_Wec_t p,
int  fSkipSingles 
)
inlinestatic

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 523 of file vecWec.h.

524 {
525  Vec_Int_t * vVec;
526  int i, k, Entry;
527  Vec_WecForEachLevel( p, vVec, i )
528  {
529  if ( fSkipSingles && Vec_IntSize(vVec) == 1 )
530  continue;
531  printf( " %4d : {", i );
532  Vec_IntForEachEntry( vVec, Entry, k )
533  printf( " %d", Entry );
534  printf( " }\n" );
535  }
536 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
#define Vec_WecForEachLevel(vGlob, vVec, i)
MACRO DEFINITIONS ///.
Definition: vecWec.h:55
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition: vecInt.h:54
static void Vec_WecPush ( Vec_Wec_t p,
int  Level,
int  Entry 
)
inlinestatic

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 275 of file vecWec.h.

276 {
277  if ( p->nSize < Level + 1 )
278  {
279  Vec_WecGrow( p, Abc_MaxInt(2*p->nCap, Level + 1) );
280  p->nSize = Level + 1;
281  }
282  Vec_IntPush( Vec_WecEntry(p, Level), Entry );
283 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Abc_MaxInt(int a, int b)
Definition: abc_global.h:238
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
static Vec_Int_t * Vec_WecEntry(Vec_Wec_t *p, int i)
Definition: vecWec.h:142
static void Vec_WecGrow(Vec_Wec_t *p, int nCapMin)
Definition: vecWec.h:117
static Vec_Int_t* Vec_WecPushLevel ( Vec_Wec_t p)
inlinestatic

Definition at line 284 of file vecWec.h.

285 {
286  if ( p->nSize == p->nCap )
287  {
288  if ( p->nCap < 16 )
289  Vec_WecGrow( p, 16 );
290  else
291  Vec_WecGrow( p, 2 * p->nCap );
292  }
293  ++p->nSize;
294  return Vec_WecEntryLast( p );
295 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static Vec_Int_t * Vec_WecEntryLast(Vec_Wec_t *p)
Definition: vecWec.h:147
static void Vec_WecGrow(Vec_Wec_t *p, int nCapMin)
Definition: vecWec.h:117
static void Vec_WecPushUnique ( Vec_Wec_t p,
int  Level,
int  Entry 
)
inlinestatic

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 369 of file vecWec.h.

370 {
371  if ( p->nSize < Level + 1 )
372  Vec_WecPush( p, Level, Entry );
373  else
374  Vec_IntPushUnique( Vec_WecEntry(p, Level), Entry );
375 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static Vec_Int_t * Vec_WecEntry(Vec_Wec_t *p, int i)
Definition: vecWec.h:142
static int Vec_IntPushUnique(Vec_Int_t *p, int Entry)
Definition: vecInt.h:832
static void Vec_WecPush(Vec_Wec_t *p, int Level, int Entry)
Definition: vecWec.h:275
static void Vec_WecRemoveEmpty ( Vec_Wec_t vCubes)
inlinestatic

Function*************************************************************

Synopsis [Removes 0-size vectors.]

Description []

SideEffects []

SeeAlso []

Definition at line 676 of file vecWec.h.

677 {
678  Vec_Int_t * vCube;
679  int i, k = 0;
680  Vec_WecForEachLevel( vCubes, vCube, i )
681  if ( Vec_IntSize(vCube) > 0 )
682  vCubes->pArray[k++] = *vCube;
683  else
684  ABC_FREE( vCube->pArray );
685  for ( i = k; i < Vec_WecSize(vCubes); i++ )
686  Vec_IntZero( Vec_WecEntry(vCubes, i) );
687  Vec_WecShrink( vCubes, k );
688 // Vec_WecSortByFirstInt( vCubes, 0 );
689 }
static void Vec_WecShrink(Vec_Wec_t *p, int nSizeNew)
Definition: vecWec.h:238
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
for(p=first;p->value< newval;p=p->next)
static int Vec_WecSize(Vec_Wec_t *p)
Definition: vecWec.h:193
static void Vec_IntZero(Vec_Int_t *p)
Definition: vecInt.h:260
#define Vec_WecForEachLevel(vGlob, vVec, i)
MACRO DEFINITIONS ///.
Definition: vecWec.h:55
if(last==0)
Definition: sparse_int.h:34
else
Definition: sparse_int.h:55
static Vec_Int_t * Vec_WecEntry(Vec_Wec_t *p, int i)
Definition: vecWec.h:142
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
#define ABC_FREE(obj)
Definition: abc_global.h:232
static void Vec_WecShrink ( Vec_Wec_t p,
int  nSizeNew 
)
inlinestatic

Function*************************************************************

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 238 of file vecWec.h.

239 {
240  assert( p->nSize >= nSizeNew );
241  p->nSize = nSizeNew;
242 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
#define assert(ex)
Definition: util_old.h:213
static int Vec_WecSize ( Vec_Wec_t p)
inlinestatic

Definition at line 193 of file vecWec.h.

194 {
195  return p->nSize;
196 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static int Vec_WecSizeSize ( Vec_Wec_t p)
inlinestatic

Definition at line 202 of file vecWec.h.

203 {
204  Vec_Int_t * vVec;
205  int i, Counter = 0;
206  Vec_WecForEachLevel( p, vVec, i )
207  Counter += Vec_IntSize(vVec);
208  return Counter;
209 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
#define Vec_WecForEachLevel(vGlob, vVec, i)
MACRO DEFINITIONS ///.
Definition: vecWec.h:55
static int Counter
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
static int Vec_WecSizeUsed ( Vec_Wec_t p)
inlinestatic

Definition at line 210 of file vecWec.h.

211 {
212  Vec_Int_t * vVec;
213  int i, Counter = 0;
214  Vec_WecForEachLevel( p, vVec, i )
215  Counter += (int)(Vec_IntSize(vVec) > 0);
216  return Counter;
217 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
#define Vec_WecForEachLevel(vGlob, vVec, i)
MACRO DEFINITIONS ///.
Definition: vecWec.h:55
static int Counter
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
static int Vec_WecSizeUsedLimits ( Vec_Wec_t p,
int  iStart,
int  iStop 
)
inlinestatic

Definition at line 218 of file vecWec.h.

219 {
220  Vec_Int_t * vVec;
221  int i, Counter = 0;
222  Vec_WecForEachLevelStartStop( p, vVec, i, iStart, iStop )
223  Counter += (int)(Vec_IntSize(vVec) > 0);
224  return Counter;
225 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
#define Vec_WecForEachLevelStartStop(vGlob, vVec, i, LevelStart, LevelStop)
Definition: vecWec.h:63
static int Counter
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
static void Vec_WecSort ( Vec_Wec_t p,
int  fReverse 
)
inlinestatic

Definition at line 427 of file vecWec.h.

428 {
429  if ( fReverse )
430  qsort( (void *)p->pArray, p->nSize, sizeof(Vec_Int_t),
431  (int (*)(const void *, const void *)) Vec_WecSortCompare2 );
432  else
433  qsort( (void *)p->pArray, p->nSize, sizeof(Vec_Int_t),
434  (int (*)(const void *, const void *)) Vec_WecSortCompare1 );
435 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
static int Vec_WecSortCompare2(Vec_Int_t *p1, Vec_Int_t *p2)
Definition: vecWec.h:419
static int Vec_WecSortCompare1(Vec_Int_t *p1, Vec_Int_t *p2)
Definition: vecWec.h:411
static void Vec_WecSortByFirstInt ( Vec_Wec_t p,
int  fReverse 
)
inlinestatic

Definition at line 465 of file vecWec.h.

466 {
467  if ( fReverse )
468  qsort( (void *)p->pArray, p->nSize, sizeof(Vec_Int_t),
469  (int (*)(const void *, const void *)) Vec_WecSortCompare4 );
470  else
471  qsort( (void *)p->pArray, p->nSize, sizeof(Vec_Int_t),
472  (int (*)(const void *, const void *)) Vec_WecSortCompare3 );
473 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
static int Vec_WecSortCompare4(Vec_Int_t *p1, Vec_Int_t *p2)
Definition: vecWec.h:457
static int Vec_WecSortCompare3(Vec_Int_t *p1, Vec_Int_t *p2)
Definition: vecWec.h:449
static void Vec_WecSortByLastInt ( Vec_Wec_t p,
int  fReverse 
)
inlinestatic

Definition at line 502 of file vecWec.h.

503 {
504  if ( fReverse )
505  qsort( (void *)p->pArray, p->nSize, sizeof(Vec_Int_t),
506  (int (*)(const void *, const void *)) Vec_WecSortCompare6 );
507  else
508  qsort( (void *)p->pArray, p->nSize, sizeof(Vec_Int_t),
509  (int (*)(const void *, const void *)) Vec_WecSortCompare5 );
510 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
static int Vec_WecSortCompare6(Vec_Int_t *p1, Vec_Int_t *p2)
Definition: vecWec.h:494
static int Vec_WecSortCompare5(Vec_Int_t *p1, Vec_Int_t *p2)
Definition: vecWec.h:486
static int Vec_WecSortCompare1 ( Vec_Int_t p1,
Vec_Int_t p2 
)
static

Function*************************************************************

Synopsis [Sorting by array size.]

Description []

SideEffects []

SeeAlso []

Definition at line 411 of file vecWec.h.

412 {
413  if ( Vec_IntSize(p1) < Vec_IntSize(p2) )
414  return -1;
415  if ( Vec_IntSize(p1) > Vec_IntSize(p2) )
416  return 1;
417  return 0;
418 }
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
static int Vec_WecSortCompare2 ( Vec_Int_t p1,
Vec_Int_t p2 
)
static

Definition at line 419 of file vecWec.h.

420 {
421  if ( Vec_IntSize(p1) > Vec_IntSize(p2) )
422  return -1;
423  if ( Vec_IntSize(p1) < Vec_IntSize(p2) )
424  return 1;
425  return 0;
426 }
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
static int Vec_WecSortCompare3 ( Vec_Int_t p1,
Vec_Int_t p2 
)
static

Function*************************************************************

Synopsis [Sorting by the first entry.]

Description []

SideEffects []

SeeAlso []

Definition at line 449 of file vecWec.h.

450 {
451  if ( Vec_IntEntry(p1,0) < Vec_IntEntry(p2,0) )
452  return -1;
453  if ( Vec_IntEntry(p1,0) > Vec_IntEntry(p2,0) )
454  return 1;
455  return 0;
456 }
static int Vec_IntEntry(Vec_Int_t *p, int i)
Definition: bblif.c:268
static int Vec_WecSortCompare4 ( Vec_Int_t p1,
Vec_Int_t p2 
)
static

Definition at line 457 of file vecWec.h.

458 {
459  if ( Vec_IntEntry(p1,0) > Vec_IntEntry(p2,0) )
460  return -1;
461  if ( Vec_IntEntry(p1,0) < Vec_IntEntry(p2,0) )
462  return 1;
463  return 0;
464 }
static int Vec_IntEntry(Vec_Int_t *p, int i)
Definition: bblif.c:268
static int Vec_WecSortCompare5 ( Vec_Int_t p1,
Vec_Int_t p2 
)
static

Function*************************************************************

Synopsis [Sorting by the last entry.]

Description []

SideEffects []

SeeAlso []

Definition at line 486 of file vecWec.h.

487 {
488  if ( Vec_IntEntryLast(p1) < Vec_IntEntryLast(p2) )
489  return -1;
490  if ( Vec_IntEntryLast(p1) > Vec_IntEntryLast(p2) )
491  return 1;
492  return 0;
493 }
static int Vec_IntEntryLast(Vec_Int_t *p)
Definition: bblif.c:319
static int Vec_WecSortCompare6 ( Vec_Int_t p1,
Vec_Int_t p2 
)
static

Definition at line 494 of file vecWec.h.

495 {
496  if ( Vec_IntEntryLast(p1) > Vec_IntEntryLast(p2) )
497  return -1;
498  if ( Vec_IntEntryLast(p1) < Vec_IntEntryLast(p2) )
499  return 1;
500  return 0;
501 }
static int Vec_IntEntryLast(Vec_Int_t *p)
Definition: bblif.c:319
static Vec_Wec_t* Vec_WecStart ( int  nSize)
inlinestatic

Definition at line 98 of file vecWec.h.

99 {
100  Vec_Wec_t * p;
101  p = Vec_WecAlloc( nSize );
102  p->nSize = nSize;
103  return p;
104 }
static Vec_Wec_t * Vec_WecAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: vecWec.h:87
typedefABC_NAMESPACE_HEADER_START struct Vec_Wec_t_ Vec_Wec_t
INCLUDES ///.
Definition: vecWec.h:42
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static void Vec_WecUnmarkLevels ( Vec_Wec_t vCubes,
Vec_Int_t vLevels 
)
inlinestatic

Definition at line 654 of file vecWec.h.

655 {
656  Vec_Int_t * vCube;
657  int i;
658  Vec_WecForEachLevelVec( vLevels, vCubes, vCube, i )
659  {
660  assert( Vec_WecIntHasMark( vCube ) );
661  Vec_WecIntXorMark( vCube );
662  }
663 }
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
#define Vec_WecForEachLevelVec(vLevels, vGlob, vVec, i)
Definition: vecWec.h:57
static void Vec_WecIntXorMark(Vec_Int_t *vVec)
Definition: vecWec.h:643
static int Vec_WecIntHasMark(Vec_Int_t *vVec)
Definition: vecWec.h:641
#define assert(ex)
Definition: util_old.h:213
static void Vec_WecZero ( Vec_Wec_t p)
inlinestatic

Function*************************************************************

Synopsis [Frees the vector.]

Description []

SideEffects []

SeeAlso []

Definition at line 330 of file vecWec.h.

331 {
332  p->pArray = NULL;
333  p->nSize = 0;
334  p->nCap = 0;
335 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950