diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2008-07-21 08:01:00 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2008-07-21 08:01:00 -0700 |
commit | 2c96c8af36446d3b855e07d78975cfad50c2917c (patch) | |
tree | 48ee5197e31ff733106efa4155d492029453b826 /src/misc/vec/vecInt.h | |
parent | de978ced7b754706efaf18ae588e18eb05624faf (diff) | |
download | abc-2c96c8af36446d3b855e07d78975cfad50c2917c.tar.gz abc-2c96c8af36446d3b855e07d78975cfad50c2917c.tar.bz2 abc-2c96c8af36446d3b855e07d78975cfad50c2917c.zip |
Version abc80721
Diffstat (limited to 'src/misc/vec/vecInt.h')
-rw-r--r-- | src/misc/vec/vecInt.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/misc/vec/vecInt.h b/src/misc/vec/vecInt.h index 430b7b63..f20c7cc8 100644 --- a/src/misc/vec/vecInt.h +++ b/src/misc/vec/vecInt.h @@ -658,6 +658,52 @@ static inline int Vec_IntRemove( Vec_Int_t * p, int Entry ) /**Function************************************************************* + Synopsis [Find entry.] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +static inline int Vec_IntFindMax( Vec_Int_t * p ) +{ + int i, Best; + if ( p->nSize == 0 ) + return 0; + Best = p->pArray[0]; + for ( i = 1; i < p->nSize; i++ ) + if ( Best < p->pArray[i] ) + Best = p->pArray[i]; + return Best; +} + +/**Function************************************************************* + + Synopsis [Find entry.] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +static inline int Vec_IntFindMin( Vec_Int_t * p ) +{ + int i, Best; + if ( p->nSize == 0 ) + return 0; + Best = p->pArray[0]; + for ( i = 1; i < p->nSize; i++ ) + if ( Best > p->pArray[i] ) + Best = p->pArray[i]; + return Best; +} + +/**Function************************************************************* + Synopsis [Comparison procedure for two integers.] Description [] |