diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2015-07-21 17:42:49 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2015-07-21 17:42:49 -0700 |
commit | 477ecc172f3d9088bf6ecd21044b9d1c758d7b64 (patch) | |
tree | 188938aa0ebbede3b18c34e60320520ac34f9197 /src/misc/vec/vecInt.h | |
parent | ddda9320ac8ec8daaf968df19f12fa562bcccf1c (diff) | |
download | abc-477ecc172f3d9088bf6ecd21044b9d1c758d7b64.tar.gz abc-477ecc172f3d9088bf6ecd21044b9d1c758d7b64.tar.bz2 abc-477ecc172f3d9088bf6ecd21044b9d1c758d7b64.zip |
Renaming Cba into Bac.
Diffstat (limited to 'src/misc/vec/vecInt.h')
-rw-r--r-- | src/misc/vec/vecInt.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/misc/vec/vecInt.h b/src/misc/vec/vecInt.h index e18b4616..c84fd01c 100644 --- a/src/misc/vec/vecInt.h +++ b/src/misc/vec/vecInt.h @@ -1939,6 +1939,27 @@ static inline void Vec_IntAppendSkip( Vec_Int_t * vVec1, Vec_Int_t * vVec2, int Vec_IntPush( vVec1, Entry ); } +/**Function************************************************************* + + Synopsis [Remapping attributes after objects were duplicated.] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +static inline void Vec_IntRemapArray( Vec_Int_t * vOld2New, Vec_Int_t * vOld, Vec_Int_t * vNew, int nNew ) +{ + int iOld, iNew; + if ( Vec_IntSize(vOld) == 0 ) + return; + Vec_IntFill( vNew, nNew, 0 ); + Vec_IntForEachEntry( vOld2New, iNew, iOld ) + if ( iNew > 0 && iNew < nNew && Vec_IntEntry(vOld, iOld) != 0 ) + Vec_IntWriteEntry( vNew, iNew, Vec_IntEntry(vOld, iOld) ); +} ABC_NAMESPACE_HEADER_END |