summaryrefslogtreecommitdiffstats
path: root/src/misc
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2022-06-02 07:47:33 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2022-06-02 07:47:33 -0700
commit94ab17c39e847a2326138068fadfe52c3675f70b (patch)
tree54b21496d40240f75e184536210232d4d106d843 /src/misc
parent5a3e0a1f15cf4299470c81fdf314f22ea2f37fa7 (diff)
downloadabc-94ab17c39e847a2326138068fadfe52c3675f70b.tar.gz
abc-94ab17c39e847a2326138068fadfe52c3675f70b.tar.bz2
abc-94ab17c39e847a2326138068fadfe52c3675f70b.zip
Supporting new resub problem format.
Diffstat (limited to 'src/misc')
-rw-r--r--src/misc/util/utilTruth.h18
-rw-r--r--src/misc/vec/vecInt.h2
2 files changed, 20 insertions, 0 deletions
diff --git a/src/misc/util/utilTruth.h b/src/misc/util/utilTruth.h
index d9efa55f..bc8ac3f0 100644
--- a/src/misc/util/utilTruth.h
+++ b/src/misc/util/utilTruth.h
@@ -1471,6 +1471,24 @@ static inline void Abc_TtPrintBinary( word * pTruth, int nVars )
printf( "%d", Abc_InfoHasBit( (unsigned *)pThis, k ) );
printf( "\n" );
}
+static inline void Abc_TtPrintBinary1( FILE * pFile, word * pTruth, int nVars )
+{
+ word * pThis, * pLimit = pTruth + Abc_TtWordNum(nVars);
+ int k, Limit = Abc_MinInt( 64, (1 << nVars) );
+ assert( nVars >= 2 );
+ for ( pThis = pTruth; pThis < pLimit; pThis++ )
+ for ( k = 0; k < Limit; k++ )
+ fprintf( pFile, "%d", Abc_InfoHasBit( (unsigned *)pThis, k ) );
+}
+static inline void Abc_TtPrintBinary2( FILE * pFile, word * pTruth, int nVars )
+{
+ word * pThis;
+ int k, Limit = Abc_MinInt( 64, (1 << nVars) );
+ assert( nVars >= 2 );
+ for ( pThis = pTruth + Abc_TtWordNum(nVars) - 1; pThis >= pTruth; pThis-- )
+ for ( k = Limit-1; k >= 0; k-- )
+ fprintf( pFile, "%d", Abc_InfoHasBit( (unsigned *)pThis, k ) );
+}
/**Function*************************************************************
diff --git a/src/misc/vec/vecInt.h b/src/misc/vec/vecInt.h
index c15369d2..e4ea6cfe 100644
--- a/src/misc/vec/vecInt.h
+++ b/src/misc/vec/vecInt.h
@@ -61,6 +61,8 @@ struct Vec_Int_t_
for ( i = Start; (i < Stop) && (((Entry) = Vec_IntEntry(vVec, i)), 1); i++ )
#define Vec_IntForEachEntryReverse( vVec, pEntry, i ) \
for ( i = Vec_IntSize(vVec) - 1; (i >= 0) && (((pEntry) = Vec_IntEntry(vVec, i)), 1); i-- )
+#define Vec_IntForEachEntryReverseStart( vVec, pEntry, i, Start ) \
+ for ( i = Start; (i >= 0) && (((pEntry) = Vec_IntEntry(vVec, i)), 1); i-- )
#define Vec_IntForEachEntryTwo( vVec1, vVec2, Entry1, Entry2, i ) \
for ( i = 0; (i < Vec_IntSize(vVec1)) && (((Entry1) = Vec_IntEntry(vVec1, i)), 1) && (((Entry2) = Vec_IntEntry(vVec2, i)), 1); i++ )
#define Vec_IntForEachEntryTwoStart( vVec1, vVec2, Entry1, Entry2, i, Start ) \