diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2020-05-03 10:32:30 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2020-05-03 10:32:30 -0700 |
commit | d51f798956a9f9fbdd1fc4eeecc483e511b1c3d3 (patch) | |
tree | d38196e861394a3cb9436a438af640e167572c51 /src/misc/vec/vecInt.h | |
parent | 54763e6882fc88d12fadfcd7df1b40d52b8f9beb (diff) | |
download | abc-d51f798956a9f9fbdd1fc4eeecc483e511b1c3d3.tar.gz abc-d51f798956a9f9fbdd1fc4eeecc483e511b1c3d3.tar.bz2 abc-d51f798956a9f9fbdd1fc4eeecc483e511b1c3d3.zip |
Experimental resubstitution.
Diffstat (limited to 'src/misc/vec/vecInt.h')
-rw-r--r-- | src/misc/vec/vecInt.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/misc/vec/vecInt.h b/src/misc/vec/vecInt.h index 514ce455..7125593b 100644 --- a/src/misc/vec/vecInt.h +++ b/src/misc/vec/vecInt.h @@ -1397,6 +1397,14 @@ static inline void Vec_IntSortMulti( Vec_Int_t * p, int nMulti, int fReverse ) qsort( (void *)p->pArray, (size_t)(p->nSize/nMulti), nMulti*sizeof(int), (int (*)(const void *, const void *)) Vec_IntSortCompare1 ); } +static inline int Vec_IntIsSorted( Vec_Int_t * p, int fReverse ) +{ + int i; + for ( i = 1; i < p->nSize; i++ ) + if ( fReverse ? (p->pArray[i-1] < p->pArray[i]) : (p->pArray[i-1] > p->pArray[i]) ) + return 0; + return 1; +} /**Function************************************************************* |