summaryrefslogtreecommitdiffstats
path: root/src/misc/vec
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2011-04-07 13:49:03 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2011-04-07 13:49:03 -0700
commita28fe0d324b0c096d1f6f2d27f956f4f1625ed9e (patch)
tree5d67bc486c4ad11f2c5127c4a797862f3c57c008 /src/misc/vec
parent1794bd37cddc9ba24b9b1f517ee813e238f62ae4 (diff)
downloadabc-a28fe0d324b0c096d1f6f2d27f956f4f1625ed9e.tar.gz
abc-a28fe0d324b0c096d1f6f2d27f956f4f1625ed9e.tar.bz2
abc-a28fe0d324b0c096d1f6f2d27f956f4f1625ed9e.zip
Unsuccessful attempt to improve PDR and a few minor changes.
Diffstat (limited to 'src/misc/vec')
-rw-r--r--src/misc/vec/vecInt.h26
-rw-r--r--src/misc/vec/vecVec.h28
2 files changed, 40 insertions, 14 deletions
diff --git a/src/misc/vec/vecInt.h b/src/misc/vec/vecInt.h
index 6fcce5c6..318afd35 100644
--- a/src/misc/vec/vecInt.h
+++ b/src/misc/vec/vecInt.h
@@ -1123,6 +1123,32 @@ static inline Vec_Int_t * Vec_IntTwoMerge( Vec_Int_t * vArr1, Vec_Int_t * vArr2
}
+/**Function*************************************************************
+
+ Synopsis [Performs fast mapping for one node.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+static inline void Vec_IntSelectSort( int * pArray, int nSize )
+{
+ int temp, i, j, best_i;
+ for ( i = 0; i < nSize-1; i++ )
+ {
+ best_i = i;
+ for ( j = i+1; j < nSize; j++ )
+ if ( pArray[j] < pArray[best_i] )
+ best_i = j;
+ temp = pArray[i];
+ pArray[i] = pArray[best_i];
+ pArray[best_i] = temp;
+ }
+}
+
ABC_NAMESPACE_HEADER_END
diff --git a/src/misc/vec/vecVec.h b/src/misc/vec/vecVec.h
index e888e4cf..83c334b4 100644
--- a/src/misc/vec/vecVec.h
+++ b/src/misc/vec/vecVec.h
@@ -102,26 +102,26 @@ struct Vec_Vec_t_
Vec_PtrForEachEntry( Type, (Vec_Ptr_t *)Vec_VecEntry(vGlob, i), pEntry, k )
// iteratores through entries
-#define Vec_VecForEachEntryInt( Type, vGlob, Entry, i, k ) \
+#define Vec_VecForEachEntryInt( vGlob, Entry, i, k ) \
for ( i = 0; i < Vec_VecSize(vGlob); i++ ) \
- Vec_IntForEachEntry( Type, (Vec_Int_t *)Vec_VecEntry(vGlob, i), Entry, k )
-#define Vec_VecForEachEntryIntLevel( Type, vGlob, Entry, i, Level ) \
- Vec_IntForEachEntry( Type, (Vec_Int_t *)Vec_VecEntry(vGlob, Level), Entry, i )
-#define Vec_VecForEachEntryIntStart( Type, vGlob, Entry, i, k, LevelStart ) \
+ Vec_IntForEachEntry( (Vec_Int_t *)Vec_VecEntry(vGlob, i), Entry, k )
+#define Vec_VecForEachEntryIntLevel( vGlob, Entry, i, Level ) \
+ Vec_IntForEachEntry( (Vec_Int_t *)Vec_VecEntry(vGlob, Level), Entry, i )
+#define Vec_VecForEachEntryIntStart( vGlob, Entry, i, k, LevelStart ) \
for ( i = LevelStart; i < Vec_VecSize(vGlob); i++ ) \
- Vec_IntForEachEntry( Type, (Vec_Int_t *)Vec_VecEntry(vGlob, i), Entry, k )
-#define Vec_VecForEachEntryIntStartStop( Type, vGlob, Entry, i, k, LevelStart, LevelStop ) \
+ Vec_IntForEachEntry( (Vec_Int_t *)Vec_VecEntry(vGlob, i), Entry, k )
+#define Vec_VecForEachEntryIntStartStop( vGlob, Entry, i, k, LevelStart, LevelStop ) \
for ( i = LevelStart; i < LevelStop; i++ ) \
- Vec_IntForEachEntry( Type, (Vec_Int_t *)Vec_VecEntry(vGlob, i), Entry, k )
-#define Vec_VecForEachEntryIntReverse( Type, vGlob, Entry, i, k ) \
+ Vec_IntForEachEntry( (Vec_Int_t *)Vec_VecEntry(vGlob, i), Entry, k )
+#define Vec_VecForEachEntryIntReverse( vGlob, Entry, i, k ) \
for ( i = 0; i < Vec_VecSize(vGlob); i++ ) \
- Vec_IntForEachEntryReverse( Type, (Vec_Int_t *)Vec_VecEntry(vGlob, i), Entry, k )
-#define Vec_VecForEachEntryIntReverseReverse( Type, vGlob, Entry, i, k ) \
+ Vec_IntForEachEntryReverse( (Vec_Int_t *)Vec_VecEntry(vGlob, i), Entry, k )
+#define Vec_VecForEachEntryIntReverseReverse( vGlob, Entry, i, k ) \
for ( i = Vec_VecSize(vGlob) - 1; i >= 0; i-- ) \
- Vec_IntForEachEntryReverse( Type, (Vec_Int_t *)Vec_VecEntry(vGlob, i), Entry, k )
-#define Vec_VecForEachEntryIntReverseStart( Type, vGlob, Entry, i, k, LevelStart ) \
+ Vec_IntForEachEntryReverse( (Vec_Int_t *)Vec_VecEntry(vGlob, i), Entry, k )
+#define Vec_VecForEachEntryIntReverseStart( vGlob, Entry, i, k, LevelStart ) \
for ( i = LevelStart-1; i >= 0; i-- ) \
- Vec_IntForEachEntry( Type, (Vec_Int_t *)Vec_VecEntry(vGlob, i), Entry, k )
+ Vec_IntForEachEntry( (Vec_Int_t *)Vec_VecEntry(vGlob, i), Entry, k )
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///