diff options
author | Bruno Schmitt <bruno@oschmitt.com> | 2017-01-25 13:40:31 +0900 |
---|---|---|
committer | Bruno Schmitt <bruno@oschmitt.com> | 2017-01-25 13:40:31 +0900 |
commit | 876eb5a52e67911ccc19d5f732aa9e1c9279fd26 (patch) | |
tree | 4a78999c29676235f613b4e1f8e1d1d0983107ba /src/misc | |
parent | 123b425052636beceaa52e47ea695d35b75fb40a (diff) | |
parent | 51f4dab475af1ffd22d23b5aeb8d7cf243739f75 (diff) | |
download | abc-876eb5a52e67911ccc19d5f732aa9e1c9279fd26.tar.gz abc-876eb5a52e67911ccc19d5f732aa9e1c9279fd26.tar.bz2 abc-876eb5a52e67911ccc19d5f732aa9e1c9279fd26.zip |
Merged alanmi/abc into default
Diffstat (limited to 'src/misc')
-rw-r--r-- | src/misc/util/utilTruth.h | 6 | ||||
-rw-r--r-- | src/misc/vec/vecInt.h | 18 | ||||
-rw-r--r-- | src/misc/vec/vecPtr.h | 2 | ||||
-rw-r--r-- | src/misc/vec/vecWec.h | 29 | ||||
-rw-r--r-- | src/misc/zlib/inflate.c | 2 |
5 files changed, 52 insertions, 5 deletions
diff --git a/src/misc/util/utilTruth.h b/src/misc/util/utilTruth.h index b8a34da7..d77ed64d 100644 --- a/src/misc/util/utilTruth.h +++ b/src/misc/util/utilTruth.h @@ -2612,7 +2612,7 @@ static inline int Abc_TtProcessBiDec( word * pTruth, int nVars, int nSuppLim ) static inline void Abc_TtProcessBiDecTest( word * pTruth, int nVars, int nSuppLim ) { word This, That, pTemp[64]; - int Res, resThis, resThat, nThis, nThat; + int Res, resThis, resThat;//, nThis, nThat; int nWords = Abc_TtWordNum(nVars); Abc_TtCopy( pTemp, pTruth, nWords, 0 ); Res = Abc_TtProcessBiDec( pTemp, nVars, nSuppLim ); @@ -2634,8 +2634,8 @@ static inline void Abc_TtProcessBiDecTest( word * pTruth, int nVars, int nSuppLi // Dau_DsdPrintFromTruth( pTemp, nVars ); - nThis = Abc_TtBitCount16(resThis); - nThat = Abc_TtBitCount16(resThat); + //nThis = Abc_TtBitCount16(resThis); + //nThat = Abc_TtBitCount16(resThat); printf( "Variable sets: " ); Abc_TtPrintVarSet( resThis, nVars ); diff --git a/src/misc/vec/vecInt.h b/src/misc/vec/vecInt.h index f09b8783..d952518f 100644 --- a/src/misc/vec/vecInt.h +++ b/src/misc/vec/vecInt.h @@ -1692,6 +1692,24 @@ static inline int Vec_IntTwoFindCommon( Vec_Int_t * vArr1, Vec_Int_t * vArr2, Ve } return Vec_IntSize(vArr); } +static inline int Vec_IntTwoFindCommonReverse( Vec_Int_t * vArr1, Vec_Int_t * vArr2, Vec_Int_t * vArr ) +{ + int * pBeg1 = vArr1->pArray; + int * pBeg2 = vArr2->pArray; + int * pEnd1 = vArr1->pArray + vArr1->nSize; + int * pEnd2 = vArr2->pArray + vArr2->nSize; + Vec_IntClear( vArr ); + while ( pBeg1 < pEnd1 && pBeg2 < pEnd2 ) + { + if ( *pBeg1 == *pBeg2 ) + Vec_IntPush( vArr, *pBeg1 ), pBeg1++, pBeg2++; + else if ( *pBeg1 > *pBeg2 ) + pBeg1++; + else + pBeg2++; + } + return Vec_IntSize(vArr); +} /**Function************************************************************* diff --git a/src/misc/vec/vecPtr.h b/src/misc/vec/vecPtr.h index 5b40665f..015aa1be 100644 --- a/src/misc/vec/vecPtr.h +++ b/src/misc/vec/vecPtr.h @@ -65,7 +65,7 @@ struct Vec_Ptr_t_ #define Vec_PtrForEachEntryTwo( Type1, vVec1, Type2, vVec2, pEntry1, pEntry2, i ) \ for ( i = 0; (i < Vec_PtrSize(vVec1)) && (((pEntry1) = (Type1)Vec_PtrEntry(vVec1, i)), 1) && (((pEntry2) = (Type2)Vec_PtrEntry(vVec2, i)), 1); i++ ) #define Vec_PtrForEachEntryDouble( Type1, Type2, vVec, Entry1, Entry2, i ) \ - for ( i = 0; (i+1 < Vec_IntSize(vVec)) && (((Entry1) = (Type1)Vec_PtrEntry(vVec, i)), 1) && (((Entry2) = (Type2)Vec_PtrEntry(vVec, i+1)), 1); i += 2 ) + for ( i = 0; (i+1 < Vec_PtrSize(vVec)) && (((Entry1) = (Type1)Vec_PtrEntry(vVec, i)), 1) && (((Entry2) = (Type2)Vec_PtrEntry(vVec, i+1)), 1); i += 2 ) //////////////////////////////////////////////////////////////////////// /// FUNCTION DEFINITIONS /// diff --git a/src/misc/vec/vecWec.h b/src/misc/vec/vecWec.h index e4e92503..c8c89701 100644 --- a/src/misc/vec/vecWec.h +++ b/src/misc/vec/vecWec.h @@ -303,6 +303,23 @@ static inline Vec_Int_t * Vec_WecPushLevel( Vec_Wec_t * p ) ++p->nSize; return Vec_WecEntryLast( p ); } +static inline Vec_Int_t * Vec_WecInsertLevel( Vec_Wec_t * p, int i ) +{ + Vec_Int_t * pTemp; + if ( p->nSize == p->nCap ) + { + if ( p->nCap < 16 ) + Vec_WecGrow( p, 16 ); + else + Vec_WecGrow( p, 2 * p->nCap ); + } + ++p->nSize; + assert( i >= 0 && i < p->nSize ); + for ( pTemp = p->pArray + p->nSize - 2; pTemp >= p->pArray + i; pTemp-- ) + pTemp[1] = pTemp[0]; + Vec_IntZero( p->pArray + i ); + return p->pArray + i; +} /**Function************************************************************* @@ -544,6 +561,18 @@ static inline void Vec_WecPrint( Vec_Wec_t * p, int fSkipSingles ) printf( " }\n" ); } } +static inline void Vec_WecPrintLits( Vec_Wec_t * p ) +{ + Vec_Int_t * vVec; + int i, k, iLit; + Vec_WecForEachLevel( p, vVec, i ) + { + printf( " %4d : %2d {", i, Vec_IntSize(vVec) ); + Vec_IntForEachEntry( vVec, iLit, k ) + printf( " %c%d", Abc_LitIsCompl(iLit) ? '-' : '+', Abc_Lit2Var(iLit) ); + printf( " }\n" ); + } +} /**Function************************************************************* diff --git a/src/misc/zlib/inflate.c b/src/misc/zlib/inflate.c index 449779a9..9fae7045 100644 --- a/src/misc/zlib/inflate.c +++ b/src/misc/zlib/inflate.c @@ -1445,7 +1445,7 @@ long ZEXPORT inflateMark(z_streamp strm) { struct inflate_state FAR *state; - if (strm == Z_NULL || strm->state == Z_NULL) return -1L << 16; + if (strm == Z_NULL || strm->state == Z_NULL) return -(1L << 16); state = (struct inflate_state FAR *)strm->state; return ((long)(state->back) << 16) + (state->mode == COPY ? state->length : |