diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2013-05-03 15:45:50 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2013-05-03 15:45:50 -0700 |
commit | 6a49d1f4c61b9e4a9f135ea46f6c64e90aba0e6c (patch) | |
tree | f009a44326029ab137435401aca9f84a0768ffa9 /src/misc | |
parent | e782bbb8428b3c402a62be8ab84b44223855356a (diff) | |
download | abc-6a49d1f4c61b9e4a9f135ea46f6c64e90aba0e6c.tar.gz abc-6a49d1f4c61b9e4a9f135ea46f6c64e90aba0e6c.tar.bz2 abc-6a49d1f4c61b9e4a9f135ea46f6c64e90aba0e6c.zip |
Reading/writing MiniAIG and several minor changes.
Diffstat (limited to 'src/misc')
-rw-r--r-- | src/misc/vec/vecInt.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/misc/vec/vecInt.h b/src/misc/vec/vecInt.h index 5222ef53..67d9e914 100644 --- a/src/misc/vec/vecInt.h +++ b/src/misc/vec/vecInt.h @@ -1298,6 +1298,25 @@ static inline int Vec_IntTwoCountCommon( Vec_Int_t * vArr1, Vec_Int_t * vArr2 ) } return Counter; } +static inline int Vec_IntTwoFindCommon( 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; + int Counter = 0; + 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************************************************************* |