summaryrefslogtreecommitdiffstats
path: root/src/misc
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2013-09-15 18:23:49 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2013-09-15 18:23:49 -0700
commitff5d3591d1e7d90199d7395cde9fc6d902ed4b41 (patch)
tree26a2307c387d50bcd1a01e007bfe370ca8a5a9e3 /src/misc
parentd1fed2dd89bc0549655f8375832628b18b35edd9 (diff)
downloadabc-ff5d3591d1e7d90199d7395cde9fc6d902ed4b41.tar.gz
abc-ff5d3591d1e7d90199d7395cde9fc6d902ed4b41.tar.bz2
abc-ff5d3591d1e7d90199d7395cde9fc6d902ed4b41.zip
Infrastructure to support full Liberty format and unitification of library representations.
Diffstat (limited to 'src/misc')
-rw-r--r--src/misc/extra/extraUtilFile.c4
-rw-r--r--src/misc/vec/vecFlt.h20
2 files changed, 22 insertions, 2 deletions
diff --git a/src/misc/extra/extraUtilFile.c b/src/misc/extra/extraUtilFile.c
index 2e1d60f4..d514f862 100644
--- a/src/misc/extra/extraUtilFile.c
+++ b/src/misc/extra/extraUtilFile.c
@@ -551,7 +551,7 @@ void Extra_PrintHex( FILE * pFile, unsigned * pTruth, int nVars )
// write the number into the file
fprintf( pFile, "0x" );
nMints = (1 << nVars);
- nDigits = nMints / 4;
+ nDigits = nMints / 4 + ((nMints % 4) > 0);
for ( k = nDigits - 1; k >= 0; k-- )
{
Digit = ((pTruth[k/8] >> (k * 4)) & 15);
@@ -569,7 +569,7 @@ void Extra_PrintHexReverse( FILE * pFile, unsigned * pTruth, int nVars )
// write the number into the file
fprintf( pFile, "0x" );
nMints = (1 << nVars);
- nDigits = nMints / 4;
+ nDigits = nMints / 4 + ((nMints % 4) > 0);
for ( k = 0; k < nDigits; k++ )
{
Digit = ((pTruth[k/8] >> (k * 4)) & 15);
diff --git a/src/misc/vec/vecFlt.h b/src/misc/vec/vecFlt.h
index 9eb13962..74c620e4 100644
--- a/src/misc/vec/vecFlt.h
+++ b/src/misc/vec/vecFlt.h
@@ -664,6 +664,26 @@ static inline float Vec_FltFindMin( Vec_Flt_t * p )
/**Function*************************************************************
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+static inline void Vec_FltPrint( Vec_Flt_t * vVec )
+{
+ int i; float Entry;
+ printf( "Vector has %d entries: {", Vec_FltSize(vVec) );
+ Vec_FltForEachEntry( vVec, Entry, i )
+ printf( " %f", Entry );
+ printf( " }\n" );
+}
+
+/**Function*************************************************************
+
Synopsis [Comparison procedure for two floats.]
Description []