From d51f798956a9f9fbdd1fc4eeecc483e511b1c3d3 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Sun, 3 May 2020 10:32:30 -0700 Subject: Experimental resubstitution. --- src/misc/vec/vecInt.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/misc/vec') 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************************************************************* -- cgit v1.2.3