diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2009-03-10 08:01:00 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2009-03-10 08:01:00 -0700 |
commit | 32314347bae6ddcd841a268e797ec4da45726abb (patch) | |
tree | e2e5fd1711f04a06d0da2b8003bc02cb9a5dd446 /src/misc/vec/vecInt.h | |
parent | c03f9b516bed2c06ec2bfc78617eba5fc9a11c32 (diff) | |
download | abc-32314347bae6ddcd841a268e797ec4da45726abb.tar.gz abc-32314347bae6ddcd841a268e797ec4da45726abb.tar.bz2 abc-32314347bae6ddcd841a268e797ec4da45726abb.zip |
Version abc90310
Diffstat (limited to 'src/misc/vec/vecInt.h')
-rw-r--r-- | src/misc/vec/vecInt.h | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/src/misc/vec/vecInt.h b/src/misc/vec/vecInt.h index 0f7a41ab..c3c92f09 100644 --- a/src/misc/vec/vecInt.h +++ b/src/misc/vec/vecInt.h @@ -409,10 +409,9 @@ static inline void Vec_IntFillExtra( Vec_Int_t * p, int nSize, int Fill ) int i; if ( p->nSize >= nSize ) return; - if ( 2 * p->nSize > nSize ) - Vec_IntGrow( p, 2 * nSize ); - else - Vec_IntGrow( p, nSize ); + if ( nSize < 2 * p->nSize ) + nSize = 2 * p->nSize; + Vec_IntGrow( p, nSize ); for ( i = p->nSize; i < nSize; i++ ) p->pArray[i] = Fill; p->nSize = nSize; @@ -743,6 +742,28 @@ static inline int Vec_IntFindMin( Vec_Int_t * p ) /**Function************************************************************* + Synopsis [Reverses the order of entries.] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +static inline void Vec_IntReverseOrder( Vec_Int_t * p ) +{ + int i, Temp; + for ( i = 0; i < p->nSize/2; i++ ) + { + Temp = p->pArray[i]; + p->pArray[i] = p->pArray[p->nSize-1-i]; + p->pArray[p->nSize-1-i] = Temp; + } +} + +/**Function************************************************************* + Synopsis [Comparison procedure for two integers.] Description [] |