diff options
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 [] |