diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2012-02-17 19:04:28 -0800 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2012-02-17 19:04:28 -0800 |
commit | 97a2e6f29e473cc9a50ec886f9933a8060d6474e (patch) | |
tree | cd3269ca6bc428e0e4ae18864821c8eb052ae630 /src/misc/vec | |
parent | 5d7c568589a15205d2bfbe534064d9722e52116d (diff) | |
download | abc-97a2e6f29e473cc9a50ec886f9933a8060d6474e.tar.gz abc-97a2e6f29e473cc9a50ec886f9933a8060d6474e.tar.bz2 abc-97a2e6f29e473cc9a50ec886f9933a8060d6474e.zip |
Isomorphism checking code.
Diffstat (limited to 'src/misc/vec')
-rw-r--r-- | src/misc/vec/vecVec.h | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/src/misc/vec/vecVec.h b/src/misc/vec/vecVec.h index e0f18983..8bed4574 100644 --- a/src/misc/vec/vecVec.h +++ b/src/misc/vec/vecVec.h @@ -588,6 +588,67 @@ static inline void Vec_VecSort( Vec_Vec_t * p, int fReverse ) /**Function************************************************************* + Synopsis [Comparison procedure for two integers.] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +static int Vec_VecSortCompare3( Vec_Int_t ** pp1, Vec_Int_t ** pp2 ) +{ + if ( Vec_IntEntry(*pp1,0) < Vec_IntEntry(*pp2,0) ) + return -1; + if ( Vec_IntEntry(*pp1,0) > Vec_IntEntry(*pp2,0) ) + return 1; + return 0; +} + +/**Function************************************************************* + + Synopsis [Comparison procedure for two integers.] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +static int Vec_VecSortCompare4( Vec_Int_t ** pp1, Vec_Int_t ** pp2 ) +{ + if ( Vec_IntEntry(*pp1,0) > Vec_IntEntry(*pp2,0) ) + return -1; + if ( Vec_IntEntry(*pp1,0) < Vec_IntEntry(*pp2,0) ) + return 1; + return 0; +} + +/**Function************************************************************* + + Synopsis [Sorting the entries by their integer value.] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +static inline void Vec_VecSortByFirstInt( Vec_Vec_t * p, int fReverse ) +{ + if ( fReverse ) + qsort( (void *)p->pArray, p->nSize, sizeof(void *), + (int (*)(const void *, const void *)) Vec_VecSortCompare4 ); + else + qsort( (void *)p->pArray, p->nSize, sizeof(void *), + (int (*)(const void *, const void *)) Vec_VecSortCompare3 ); +} + +/**Function************************************************************* + Synopsis [] Description [] |