diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2015-06-22 23:05:13 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2015-06-22 23:05:13 -0700 |
commit | 51a646a355c78cf0f4cf104d6316706653b24008 (patch) | |
tree | 4584ce9a96b88d32f110944f76b29ab90bb92a99 /src/misc/vec | |
parent | 327078393947f3c2e0b5548e5fada9ee67ef6134 (diff) | |
download | abc-51a646a355c78cf0f4cf104d6316706653b24008.tar.gz abc-51a646a355c78cf0f4cf104d6316706653b24008.tar.bz2 abc-51a646a355c78cf0f4cf104d6316706653b24008.zip |
Version abc90901
committer: Baruch Sterin <baruchs@gmail.com>
Diffstat (limited to 'src/misc/vec')
-rw-r--r-- | src/misc/vec/vecAtt.h | 4 | ||||
-rw-r--r-- | src/misc/vec/vecInt.h | 38 |
2 files changed, 40 insertions, 2 deletions
diff --git a/src/misc/vec/vecAtt.h b/src/misc/vec/vecAtt.h index 983b7c1c..74379bf6 100644 --- a/src/misc/vec/vecAtt.h +++ b/src/misc/vec/vecAtt.h @@ -18,8 +18,8 @@ ***********************************************************************/ -#ifndef __Vec_Att_H__ -#define __Vec_Att_H__ +#ifndef __VEC_ATT_H__ +#define __VEC_ATT_H__ //////////////////////////////////////////////////////////////////////// /// INCLUDES /// diff --git a/src/misc/vec/vecInt.h b/src/misc/vec/vecInt.h index c3c92f09..966f5ac9 100644 --- a/src/misc/vec/vecInt.h +++ b/src/misc/vec/vecInt.h @@ -313,6 +313,23 @@ static inline int Vec_IntEntry( Vec_Int_t * p, int i ) SeeAlso [] ***********************************************************************/ +static inline int * Vec_IntEntryP( Vec_Int_t * p, int i ) +{ + assert( i >= 0 && i < p->nSize ); + return p->pArray + i; +} + +/**Function************************************************************* + + Synopsis [] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ static inline void Vec_IntWriteEntry( Vec_Int_t * p, int i, int Entry ) { assert( i >= 0 && i < p->nSize ); @@ -764,6 +781,27 @@ static inline void Vec_IntReverseOrder( Vec_Int_t * p ) /**Function************************************************************* + Synopsis [] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +static inline Vec_Int_t * Vec_IntInvert( Vec_Int_t * p ) +{ + Vec_Int_t * vRes; + int Entry, i; + vRes = Vec_IntStart( Vec_IntFindMax(p) + 1 ); + Vec_IntForEachEntry( p, Entry, i ) + Vec_IntWriteEntry( vRes, Entry, i ); + return vRes; +} + +/**Function************************************************************* + Synopsis [Comparison procedure for two integers.] Description [] |