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

Go to the source code of this file.

Data Structures

struct  Hsh_IntObj_t_
 
union  Hsh_IntObjWord_t_
 
struct  Hsh_IntMan_t_
 
struct  Hsh_VecObj_t_
 
struct  Hsh_VecMan_t_
 

Typedefs

typedef
typedefABC_NAMESPACE_HEADER_START
struct Hsh_IntObj_t_ 
Hsh_IntObj_t
 INCLUDES ///. More...
 
typedef union Hsh_IntObjWord_t_ Hsh_IntObjWord_t
 
typedef struct Hsh_IntMan_t_ Hsh_IntMan_t
 
typedef struct Hsh_VecObj_t_ Hsh_VecObj_t
 
typedef struct Hsh_VecMan_t_ Hsh_VecMan_t
 

Functions

static unsigned * Hsh_IntData (Hsh_IntMan_t *p, int iData)
 MACRO DEFINITIONS ///. More...
 
static Hsh_IntObj_tHsh_IntObj (Hsh_IntMan_t *p, int iObj)
 
static word Hsh_IntWord (int iData, int iNext)
 
static Hsh_VecObj_tHsh_VecObj (Hsh_VecMan_t *p, int i)
 
static Hsh_IntMan_tHsh_IntManStart (Vec_Int_t *vData, int nSize, int nEntries)
 FUNCTION DEFINITIONS ///. More...
 
static void Hsh_IntManStop (Hsh_IntMan_t *p)
 
static int Hsh_IntManHash (unsigned *pData, int nSize, int nTableSize)
 
static int * Hsh_IntManLookup (Hsh_IntMan_t *p, unsigned *pData)
 
static int Hsh_IntManAdd (Hsh_IntMan_t *p, int iData)
 
static Vec_Int_tHsh_IntManHashArray (Vec_Int_t *vData, int nSize)
 
static Vec_Int_tHsh_WrdManHashArray (Vec_Wrd_t *vDataW, int nSize)
 
static Hsh_IntMan_tHsh_WrdManHashArrayStart (Vec_Wrd_t *vDataW, int nSize)
 
static void Hsh_IntManHashArrayTest ()
 
static Hsh_VecMan_tHsh_VecManStart (int nEntries)
 
static void Hsh_VecManStop (Hsh_VecMan_t *p)
 
static Vec_Int_tHsh_VecReadEntry (Hsh_VecMan_t *p, int i)
 
static int Hsh_VecSize (Hsh_VecMan_t *p)
 
static int Hsh_VecManHash (Vec_Int_t *vVec, int nTableSize)
 
static int Hsh_VecManAdd (Hsh_VecMan_t *p, Vec_Int_t *vVec)
 
static void Hsh_VecManHashTest ()
 

Typedef Documentation

typedef struct Hsh_IntMan_t_ Hsh_IntMan_t

Definition at line 56 of file vecHsh.h.

typedef typedefABC_NAMESPACE_HEADER_START struct Hsh_IntObj_t_ Hsh_IntObj_t

INCLUDES ///.

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

FileName [vecHsh.h]

SystemName [ABC: Logic synthesis and verification system.]

PackageName [Resizable arrays.]

Synopsis [Hashing vector entries.]

Author [Alan Mishchenko]

Affiliation [UC Berkeley]

Date [Ver. 1.0. Started - June 20, 2005.]

Revision [

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

]PARAMETERS ///BASIC TYPES ///

Definition at line 42 of file vecHsh.h.

Definition at line 49 of file vecHsh.h.

typedef struct Hsh_VecMan_t_ Hsh_VecMan_t

Definition at line 75 of file vecHsh.h.

typedef struct Hsh_VecObj_t_ Hsh_VecObj_t

Definition at line 67 of file vecHsh.h.

Function Documentation

static unsigned* Hsh_IntData ( Hsh_IntMan_t p,
int  iData 
)
inlinestatic

MACRO DEFINITIONS ///.

Definition at line 88 of file vecHsh.h.

88 { return (unsigned *)Vec_IntEntryP( p->vData, p->nSize * iData ); }
Vec_Int_t * vData
Definition: vecHsh.h:60
int nSize
Definition: vecHsh.h:59
static int * Vec_IntEntryP(Vec_Int_t *p, int i)
Definition: vecInt.h:417
static int Hsh_IntManAdd ( Hsh_IntMan_t p,
int  iData 
)
inlinestatic

Definition at line 157 of file vecHsh.h.

158 {
159  int i, * pPlace;
160  if ( Vec_WrdSize(p->vObjs) > Vec_IntSize(p->vTable) )
161  {
163  for ( i = 0; i < Vec_WrdSize(p->vObjs); i++ )
164  {
165  pPlace = Vec_IntEntryP( p->vTable, Hsh_IntManHash(Hsh_IntData(p, i), p->nSize, Vec_IntSize(p->vTable)) );
166  Hsh_IntObj(p, i)->iNext = *pPlace; *pPlace = i;
167  }
168  }
169  pPlace = Hsh_IntManLookup( p, Hsh_IntData(p, iData) );
170  if ( *pPlace == -1 )
171  {
172  *pPlace = Vec_WrdSize(p->vObjs);
173  Vec_WrdPush( p->vObjs, Hsh_IntWord(iData, -1) );
174  return Vec_WrdSize(p->vObjs) - 1;
175  }
176  return (word *)Hsh_IntObj(p, *pPlace) - Vec_WrdArray(p->vObjs);
177 }
static int Abc_PrimeCudd(unsigned int p)
Definition: abc_global.h:383
static void Vec_WrdPush(Vec_Wrd_t *p, word Entry)
Definition: vecWrd.h:618
static int Vec_WrdSize(Vec_Wrd_t *p)
Definition: vecWrd.h:336
static int * Hsh_IntManLookup(Hsh_IntMan_t *p, unsigned *pData)
Definition: vecHsh.h:147
static word Hsh_IntWord(int iData, int iNext)
Definition: vecHsh.h:90
unsigned __int64 word
DECLARATIONS ///.
Definition: kitPerm.c:36
static void Vec_IntFill(Vec_Int_t *p, int nSize, int Fill)
Definition: bblif.c:356
Vec_Wrd_t * vObjs
Definition: vecHsh.h:62
static unsigned * Hsh_IntData(Hsh_IntMan_t *p, int iData)
MACRO DEFINITIONS ///.
Definition: vecHsh.h:88
Vec_Int_t * vTable
Definition: vecHsh.h:61
int nSize
Definition: vecHsh.h:59
static Hsh_IntObj_t * Hsh_IntObj(Hsh_IntMan_t *p, int iObj)
Definition: vecHsh.h:89
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
static word * Vec_WrdArray(Vec_Wrd_t *p)
Definition: vecWrd.h:316
static int Hsh_IntManHash(unsigned *pData, int nSize, int nTableSize)
Definition: vecHsh.h:137
static int * Vec_IntEntryP(Vec_Int_t *p, int i)
Definition: vecInt.h:417
static int Hsh_IntManHash ( unsigned *  pData,
int  nSize,
int  nTableSize 
)
inlinestatic

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 137 of file vecHsh.h.

138 {
139  static int s_Primes[7] = { 4177, 5147, 5647, 6343, 7103, 7873, 8147 };
140  unsigned char * pDataC = (unsigned char *)pData;
141  int c, nChars = nSize * 4;
142  unsigned Key = 0;
143  for ( c = 0; c < nChars; c++ )
144  Key += pDataC[c] * s_Primes[c % 7];
145  return (int)(Key % nTableSize);
146 }
static int s_Primes[MAX_PRIMES]
Definition: fxuPair.c:30
static Vec_Int_t* Hsh_IntManHashArray ( Vec_Int_t vData,
int  nSize 
)
inlinestatic

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

Synopsis [Hashes data by value.]

Description [Array vData contains data entries, each of 'nSize' integers. The resulting array contains the indexes of unique data entries.]

SideEffects []

SeeAlso []

Definition at line 191 of file vecHsh.h.

192 {
193  Hsh_IntMan_t * p;
194  Vec_Int_t * vRes = Vec_IntAlloc( 100 );
195  int i, nEntries = Vec_IntSize(vData) / nSize;
196  assert( Vec_IntSize(vData) % nSize == 0 );
197  p = Hsh_IntManStart( vData, nSize, nEntries );
198  for ( i = 0; i < nEntries; i++ )
199  Vec_IntPush( vRes, Hsh_IntManAdd(p, i) );
200  Hsh_IntManStop( p );
201  return vRes;
202 }
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 Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: bblif.c:149
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
static void Hsh_IntManStop(Hsh_IntMan_t *p)
Definition: vecHsh.h:119
static int Hsh_IntManAdd(Hsh_IntMan_t *p, int iData)
Definition: vecHsh.h:157
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
#define assert(ex)
Definition: util_old.h:213
static Hsh_IntMan_t * Hsh_IntManStart(Vec_Int_t *vData, int nSize, int nEntries)
FUNCTION DEFINITIONS ///.
Definition: vecHsh.h:109
static void Hsh_IntManHashArrayTest ( )
inlinestatic

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

Synopsis [Test procedure.]

Description []

SideEffects []

SeeAlso []

Definition at line 251 of file vecHsh.h.

252 {
253  Vec_Int_t * vData = Vec_IntAlloc( 10 );
254  Vec_Int_t * vRes;
255  Vec_IntPush( vData, 12 );
256  Vec_IntPush( vData, 17 );
257  Vec_IntPush( vData, 13 );
258  Vec_IntPush( vData, 12 );
259  Vec_IntPush( vData, 15 );
260  Vec_IntPush( vData, 3 );
261  Vec_IntPush( vData, 16 );
262  Vec_IntPush( vData, 16 );
263  Vec_IntPush( vData, 12 );
264  Vec_IntPush( vData, 17 );
265  Vec_IntPush( vData, 12 );
266  Vec_IntPush( vData, 12 );
267 
268  vRes = Hsh_IntManHashArray( vData, 2 );
269 
270  Vec_IntPrint( vData );
271  Vec_IntPrint( vRes );
272 
273  Vec_IntFree( vData );
274  Vec_IntFree( vRes );
275 }
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
Definition: bblif.c:37
static Vec_Int_t * Hsh_IntManHashArray(Vec_Int_t *vData, int nSize)
Definition: vecHsh.h:191
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: bblif.c:149
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
static void Vec_IntPrint(Vec_Int_t *vVec)
Definition: vecInt.h:1803
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
static int* Hsh_IntManLookup ( Hsh_IntMan_t p,
unsigned *  pData 
)
inlinestatic

Definition at line 147 of file vecHsh.h.

148 {
149  Hsh_IntObj_t * pObj;
150  int * pPlace = Vec_IntEntryP( p->vTable, Hsh_IntManHash(pData, p->nSize, Vec_IntSize(p->vTable)) );
151  for ( ; (pObj = Hsh_IntObj(p, *pPlace)); pPlace = &pObj->iNext )
152  if ( !memcmp( pData, Hsh_IntData(p, pObj->iData), sizeof(int) * p->nSize ) )
153  return pPlace;
154  assert( *pPlace == -1 );
155  return pPlace;
156 }
typedefABC_NAMESPACE_HEADER_START struct Hsh_IntObj_t_ Hsh_IntObj_t
INCLUDES ///.
Definition: vecHsh.h:42
int memcmp()
static unsigned * Hsh_IntData(Hsh_IntMan_t *p, int iData)
MACRO DEFINITIONS ///.
Definition: vecHsh.h:88
Vec_Int_t * vTable
Definition: vecHsh.h:61
int nSize
Definition: vecHsh.h:59
static Hsh_IntObj_t * Hsh_IntObj(Hsh_IntMan_t *p, int iObj)
Definition: vecHsh.h:89
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
static int Hsh_IntManHash(unsigned *pData, int nSize, int nTableSize)
Definition: vecHsh.h:137
#define assert(ex)
Definition: util_old.h:213
static int * Vec_IntEntryP(Vec_Int_t *p, int i)
Definition: vecInt.h:417
static Hsh_IntMan_t* Hsh_IntManStart ( Vec_Int_t vData,
int  nSize,
int  nEntries 
)
inlinestatic

FUNCTION DEFINITIONS ///.

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

Synopsis [Hashing data entries composed of nSize integers.]

Description []

SideEffects []

SeeAlso []

Definition at line 109 of file vecHsh.h.

110 {
111  Hsh_IntMan_t * p;
112  p = ABC_CALLOC( Hsh_IntMan_t, 1 );
113  p->nSize = nSize;
114  p->vData = vData;
115  p->vTable = Vec_IntStartFull( Abc_PrimeCudd(nEntries) );
116  p->vObjs = Vec_WrdAlloc( nEntries );
117  return p;
118 }
static int Abc_PrimeCudd(unsigned int p)
Definition: abc_global.h:383
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static Vec_Int_t * Vec_IntStartFull(int nSize)
Definition: vecInt.h:119
Vec_Int_t * vData
Definition: vecHsh.h:60
Vec_Wrd_t * vObjs
Definition: vecHsh.h:62
static Vec_Wrd_t * Vec_WrdAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: vecWrd.h:80
Vec_Int_t * vTable
Definition: vecHsh.h:61
int nSize
Definition: vecHsh.h:59
#define ABC_CALLOC(type, num)
Definition: abc_global.h:230
static void Hsh_IntManStop ( Hsh_IntMan_t p)
inlinestatic

Definition at line 119 of file vecHsh.h.

120 {
121  Vec_IntFree( p->vTable );
122  Vec_WrdFree( p->vObjs );
123  ABC_FREE( p );
124 }
static void Vec_WrdFree(Vec_Wrd_t *p)
Definition: vecWrd.h:260
Vec_Wrd_t * vObjs
Definition: vecHsh.h:62
Vec_Int_t * vTable
Definition: vecHsh.h:61
#define ABC_FREE(obj)
Definition: abc_global.h:232
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
static Hsh_IntObj_t* Hsh_IntObj ( Hsh_IntMan_t p,
int  iObj 
)
inlinestatic

Definition at line 89 of file vecHsh.h.

89 { return iObj == -1 ? NULL : (Hsh_IntObj_t *)Vec_WrdEntryP( p->vObjs, iObj ); }
typedefABC_NAMESPACE_HEADER_START struct Hsh_IntObj_t_ Hsh_IntObj_t
INCLUDES ///.
Definition: vecHsh.h:42
Vec_Wrd_t * vObjs
Definition: vecHsh.h:62
static word * Vec_WrdEntryP(Vec_Wrd_t *p, int i)
Definition: vecWrd.h:401
static word Hsh_IntWord ( int  iData,
int  iNext 
)
inlinestatic

Definition at line 90 of file vecHsh.h.

90 { Hsh_IntObjWord_t Obj = { {iData, iNext} }; return Obj.wWord; }
static int Hsh_VecManAdd ( Hsh_VecMan_t p,
Vec_Int_t vVec 
)
inlinestatic

Definition at line 340 of file vecHsh.h.

341 {
342  Hsh_VecObj_t * pObj;
343  int i, Ent, * pPlace;
344  if ( Vec_IntSize(p->vMap) > Vec_IntSize(p->vTable) )
345  {
347  for ( i = 0; i < Vec_IntSize(p->vMap); i++ )
348  {
350  Hsh_VecObj(p, i)->iNext = *pPlace; *pPlace = i;
351  }
352  }
353  pPlace = Vec_IntEntryP( p->vTable, Hsh_VecManHash(vVec, Vec_IntSize(p->vTable)) );
354  for ( ; (pObj = Hsh_VecObj(p, *pPlace)); pPlace = &pObj->iNext )
355  if ( pObj->nSize == Vec_IntSize(vVec) && !memcmp( pObj->pArray, Vec_IntArray(vVec), sizeof(int) * pObj->nSize ) )
356  return *pPlace;
357  *pPlace = Vec_IntSize(p->vMap);
358  assert( Vec_IntSize(p->vData) % 2 == 0 );
359  Vec_IntPush( p->vMap, Vec_IntSize(p->vData) );
360  Vec_IntPush( p->vData, Vec_IntSize(vVec) );
361  Vec_IntPush( p->vData, -1 );
362  Vec_IntForEachEntry( vVec, Ent, i )
363  Vec_IntPush( p->vData, Ent );
364  if ( Vec_IntSize(vVec) & 1 )
365  Vec_IntPush( p->vData, -1 );
366  return Vec_IntSize(p->vMap) - 1;
367 }
static int * Vec_IntArray(Vec_Int_t *p)
Definition: vecInt.h:328
static int Abc_PrimeCudd(unsigned int p)
Definition: abc_global.h:383
static int Hsh_VecManHash(Vec_Int_t *vVec, int nTableSize)
Definition: vecHsh.h:331
Vec_Int_t * vMap
Definition: vecHsh.h:80
int pArray[0]
Definition: vecHsh.h:72
static void Vec_IntFill(Vec_Int_t *p, int nSize, int Fill)
Definition: bblif.c:356
if(last==0)
Definition: sparse_int.h:34
int memcmp()
static Hsh_VecObj_t * Hsh_VecObj(Hsh_VecMan_t *p, int i)
Definition: vecHsh.h:92
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
Vec_Int_t * vData
Definition: vecHsh.h:79
int iNext
Definition: vecHsh.h:71
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
int nSize
Definition: vecHsh.h:70
Vec_Int_t * vTable
Definition: vecHsh.h:78
#define assert(ex)
Definition: util_old.h:213
static int * Vec_IntEntryP(Vec_Int_t *p, int i)
Definition: vecInt.h:417
static Vec_Int_t * Hsh_VecReadEntry(Hsh_VecMan_t *p, int i)
Definition: vecHsh.h:308
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition: vecInt.h:54
static int Hsh_VecManHash ( Vec_Int_t vVec,
int  nTableSize 
)
inlinestatic

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

Synopsis []

Description []

SideEffects []

SeeAlso []

Definition at line 331 of file vecHsh.h.

332 {
333  static unsigned s_Primes[7] = {4177, 5147, 5647, 6343, 7103, 7873, 8147};
334  unsigned Key = 0;
335  int i, Entry;
336  Vec_IntForEachEntry( vVec, Entry, i )
337  Key += (unsigned)Entry * s_Primes[i % 7];
338  return (int)(Key % nTableSize);
339 }
static int s_Primes[MAX_PRIMES]
Definition: fxuPair.c:30
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
Definition: vecInt.h:54
static void Hsh_VecManHashTest ( )
inlinestatic

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

Synopsis [Test procedure.]

Description []

SideEffects []

SeeAlso []

Definition at line 380 of file vecHsh.h.

381 {
382  Hsh_VecMan_t * p;
383  Vec_Int_t * vTemp;
384  Vec_Int_t * vRes = Vec_IntAlloc( 1000 );
385  int i;
386 
387  p = Hsh_VecManStart( 5 );
388  for ( i = 0; i < 20; i++ )
389  {
390  vTemp = Vec_IntStartNatural( i );
391  Vec_IntPush( vRes, Hsh_VecManAdd( p, vTemp ) );
392  Vec_IntFree( vTemp );
393  }
394  for ( ; i > 0; i-- )
395  {
396  vTemp = Vec_IntStartNatural( i );
397  Vec_IntPush( vRes, Hsh_VecManAdd( p, vTemp ) );
398  Vec_IntFree( vTemp );
399  }
400  Vec_IntPrint( vRes );
401  Vec_IntFree( vRes );
402 
403  Hsh_VecManStop( p );
404 }
static int Hsh_VecManAdd(Hsh_VecMan_t *p, Vec_Int_t *vVec)
Definition: vecHsh.h:340
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 Vec_Int_t * Vec_IntStartNatural(int nSize)
Definition: bblif.c:192
static void Hsh_VecManStop(Hsh_VecMan_t *p)
Definition: vecHsh.h:301
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: bblif.c:149
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
static Hsh_VecMan_t * Hsh_VecManStart(int nEntries)
Definition: vecHsh.h:292
static void Vec_IntPrint(Vec_Int_t *vVec)
Definition: vecInt.h:1803
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
static Hsh_VecMan_t* Hsh_VecManStart ( int  nEntries)
inlinestatic

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

Synopsis [Hashing integer arrays.]

Description []

SideEffects []

SeeAlso []

Definition at line 292 of file vecHsh.h.

293 {
294  Hsh_VecMan_t * p;
295  p = ABC_CALLOC( Hsh_VecMan_t, 1 );
296  p->vTable = Vec_IntStartFull( Abc_PrimeCudd(nEntries) );
297  p->vData = Vec_IntAlloc( nEntries * 4 );
298  p->vMap = Vec_IntAlloc( nEntries );
299  return p;
300 }
static int Abc_PrimeCudd(unsigned int p)
Definition: abc_global.h:383
static Llb_Mgr_t * p
Definition: llb3Image.c:950
static Vec_Int_t * Vec_IntStartFull(int nSize)
Definition: vecInt.h:119
Vec_Int_t * vMap
Definition: vecHsh.h:80
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: bblif.c:149
Vec_Int_t * vData
Definition: vecHsh.h:79
Vec_Int_t * vTable
Definition: vecHsh.h:78
#define ABC_CALLOC(type, num)
Definition: abc_global.h:230
static void Hsh_VecManStop ( Hsh_VecMan_t p)
inlinestatic

Definition at line 301 of file vecHsh.h.

302 {
303  Vec_IntFree( p->vTable );
304  Vec_IntFree( p->vData );
305  Vec_IntFree( p->vMap );
306  ABC_FREE( p );
307 }
Vec_Int_t * vMap
Definition: vecHsh.h:80
Vec_Int_t * vData
Definition: vecHsh.h:79
Vec_Int_t * vTable
Definition: vecHsh.h:78
#define ABC_FREE(obj)
Definition: abc_global.h:232
static void Vec_IntFree(Vec_Int_t *p)
Definition: bblif.c:235
static Hsh_VecObj_t* Hsh_VecObj ( Hsh_VecMan_t p,
int  i 
)
inlinestatic

Definition at line 92 of file vecHsh.h.

92 { return i == -1 ? NULL : (Hsh_VecObj_t *)Vec_IntEntryP(p->vData, Vec_IntEntry(p->vMap, i)); }
Vec_Int_t * vMap
Definition: vecHsh.h:80
static int Vec_IntEntry(Vec_Int_t *p, int i)
Definition: bblif.c:268
Vec_Int_t * vData
Definition: vecHsh.h:79
static int * Vec_IntEntryP(Vec_Int_t *p, int i)
Definition: vecInt.h:417
static Vec_Int_t* Hsh_VecReadEntry ( Hsh_VecMan_t p,
int  i 
)
inlinestatic

Definition at line 308 of file vecHsh.h.

309 {
310  Hsh_VecObj_t * pObj = Hsh_VecObj( p, i );
311  p->vTemp.nSize = p->vTemp.nCap = pObj->nSize;
312  p->vTemp.pArray = (int*)pObj + 2;
313  return &p->vTemp;
314 }
Vec_Int_t vTemp
Definition: vecHsh.h:81
static Hsh_VecObj_t * Hsh_VecObj(Hsh_VecMan_t *p, int i)
Definition: vecHsh.h:92
int nSize
Definition: vecHsh.h:70
static int Hsh_VecSize ( Hsh_VecMan_t p)
inlinestatic

Definition at line 315 of file vecHsh.h.

316 {
317  return Vec_IntSize(p->vMap);
318 }
Vec_Int_t * vMap
Definition: vecHsh.h:80
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
static Vec_Int_t* Hsh_WrdManHashArray ( Vec_Wrd_t vDataW,
int  nSize 
)
inlinestatic

Definition at line 203 of file vecHsh.h.

204 {
205  Hsh_IntMan_t * p;
206  Vec_Int_t Data = { 2*Vec_WrdCap(vDataW), 2*Vec_WrdSize(vDataW), (int *)Vec_WrdArray(vDataW) };
207  Vec_Int_t * vData = &Data;
208  Vec_Int_t * vRes = Vec_IntAlloc( 100 );
209  int i, nEntries = Vec_IntSize(vData) / (2*nSize);
210  assert( Vec_IntSize(vData) % (2*nSize) == 0 );
211  p = Hsh_IntManStart( vData, (2*nSize), nEntries );
212  for ( i = 0; i < nEntries; i++ )
213  Vec_IntPush( vRes, Hsh_IntManAdd(p, i) );
214  Hsh_IntManStop( p );
215  return vRes;
216 }
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_WrdCap(Vec_Wrd_t *p)
Definition: vecWrd.h:352
static int Vec_WrdSize(Vec_Wrd_t *p)
Definition: vecWrd.h:336
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: bblif.c:149
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Definition: bblif.c:468
static void Hsh_IntManStop(Hsh_IntMan_t *p)
Definition: vecHsh.h:119
static int Hsh_IntManAdd(Hsh_IntMan_t *p, int iData)
Definition: vecHsh.h:157
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
static word * Vec_WrdArray(Vec_Wrd_t *p)
Definition: vecWrd.h:316
#define assert(ex)
Definition: util_old.h:213
static Hsh_IntMan_t * Hsh_IntManStart(Vec_Int_t *vData, int nSize, int nEntries)
FUNCTION DEFINITIONS ///.
Definition: vecHsh.h:109
static Hsh_IntMan_t* Hsh_WrdManHashArrayStart ( Vec_Wrd_t vDataW,
int  nSize 
)
inlinestatic

Definition at line 217 of file vecHsh.h.

218 {
219  Hsh_IntMan_t * p;
220  int i, nEntries = Vec_WrdSize(vDataW) / nSize;
221  Vec_Int_t * vData = Vec_IntAlloc( 2*Vec_WrdSize(vDataW) );
222  memcpy( Vec_IntArray(vData), Vec_WrdArray(vDataW), sizeof(word)*Vec_WrdSize(vDataW) );
223  vData->nSize = 2*Vec_WrdSize(vDataW);
224 /*
225  for ( i = 0; i < 30; i++ )
226  {
227  extern void Extra_PrintHex( FILE * pFile, unsigned * pTruth, int nVars );
228  Extra_PrintHex( stdout, (unsigned *) Vec_WrdEntryP(vDataW, i), 6 ); printf( " " );
229  Kit_DsdPrintFromTruth( (unsigned *) Vec_WrdEntryP(vDataW, i), 6 ); printf( "\n" );
230  }
231 */
232  assert( Vec_IntSize(vData) % (2*nSize) == 0 );
233  p = Hsh_IntManStart( vData, (2*nSize), nEntries );
234  for ( i = 0; i < nEntries; i++ )
235  Hsh_IntManAdd( p, i );
236  assert( Vec_WrdSize(p->vObjs) == nEntries );
237  return p;
238 }
static int * Vec_IntArray(Vec_Int_t *p)
Definition: vecInt.h:328
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
char * memcpy()
static int Vec_WrdSize(Vec_Wrd_t *p)
Definition: vecWrd.h:336
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
Definition: bblif.c:149
unsigned __int64 word
DECLARATIONS ///.
Definition: kitPerm.c:36
Vec_Wrd_t * vObjs
Definition: vecHsh.h:62
static int Hsh_IntManAdd(Hsh_IntMan_t *p, int iData)
Definition: vecHsh.h:157
static int Vec_IntSize(Vec_Int_t *p)
Definition: bblif.c:252
static word * Vec_WrdArray(Vec_Wrd_t *p)
Definition: vecWrd.h:316
#define assert(ex)
Definition: util_old.h:213
static Hsh_IntMan_t * Hsh_IntManStart(Vec_Int_t *vData, int nSize, int nEntries)
FUNCTION DEFINITIONS ///.
Definition: vecHsh.h:109