summaryrefslogtreecommitdiffstats
path: root/src/opt/lpk/lpkAbcUtil.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2007-09-06 08:01:00 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2007-09-06 08:01:00 -0700
commit9be1b076934b0410689c857cd71ef7d21a714b5f (patch)
treec342242ad3c5ea9d35e6e682f9026534ec73fcbe /src/opt/lpk/lpkAbcUtil.c
parentb2470dd3da962026fd874e13c2cf78c10099fe68 (diff)
downloadabc-9be1b076934b0410689c857cd71ef7d21a714b5f.tar.gz
abc-9be1b076934b0410689c857cd71ef7d21a714b5f.tar.bz2
abc-9be1b076934b0410689c857cd71ef7d21a714b5f.zip
Version abc70906
Diffstat (limited to 'src/opt/lpk/lpkAbcUtil.c')
-rw-r--r--src/opt/lpk/lpkAbcUtil.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/opt/lpk/lpkAbcUtil.c b/src/opt/lpk/lpkAbcUtil.c
index 960ebded..681ec092 100644
--- a/src/opt/lpk/lpkAbcUtil.c
+++ b/src/opt/lpk/lpkAbcUtil.c
@@ -139,20 +139,20 @@ Lpk_Fun_t * Lpk_FunDup( Lpk_Fun_t * p, unsigned * pTruth )
***********************************************************************/
void Lpk_FunSuppMinimize( Lpk_Fun_t * p )
{
- int j, k, nVarsNew;
+ int i, k, nVarsNew;
// compress the truth table
if ( p->uSupp == Kit_BitMask(p->nVars) )
return;
// minimize support
nVarsNew = Kit_WordCountOnes(p->uSupp);
Kit_TruthShrink( Lpk_FunTruth(p, 1), Lpk_FunTruth(p, 0), nVarsNew, p->nVars, p->uSupp, 1 );
- for ( j = k = 0; j < (int)p->nVars; j++ )
- if ( p->uSupp & (1 << j) )
- {
- p->pFanins[k] = p->pFanins[j];
- p->pDelays[k] = p->pDelays[j];
- k++;
- }
+ k = 0;
+ Lpk_SuppForEachVar( p->uSupp, i )
+ {
+ p->pFanins[k] = p->pFanins[i];
+ p->pDelays[k] = p->pDelays[i];
+ k++;
+ }
assert( k == nVarsNew );
p->nVars = k;
p->uSupp = Kit_BitMask(p->nVars);