summaryrefslogtreecommitdiffstats
path: root/src/opt/cut
diff options
context:
space:
mode:
Diffstat (limited to 'src/opt/cut')
-rw-r--r--src/opt/cut/cut.h1
-rw-r--r--src/opt/cut/cutInt.h1
-rw-r--r--src/opt/cut/cutMan.c5
-rw-r--r--src/opt/cut/cutNode.c7
4 files changed, 11 insertions, 3 deletions
diff --git a/src/opt/cut/cut.h b/src/opt/cut/cut.h
index 0b4c4535..f3a0f743 100644
--- a/src/opt/cut/cut.h
+++ b/src/opt/cut/cut.h
@@ -99,6 +99,7 @@ extern void Cut_NodeWriteCuts( Cut_Man_t * p, int Node, Cut_Cut_t *
extern void Cut_NodeFreeCuts( Cut_Man_t * p, int Node );
extern void Cut_NodeSetComputedAsNew( Cut_Man_t * p, int Node );
extern void Cut_NodeTryDroppingCuts( Cut_Man_t * p, int Node );
+extern void Cut_CutPrint( Cut_Cut_t * pCut );
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
diff --git a/src/opt/cut/cutInt.h b/src/opt/cut/cutInt.h
index da54a188..fe5080b4 100644
--- a/src/opt/cut/cutInt.h
+++ b/src/opt/cut/cutInt.h
@@ -70,6 +70,7 @@ struct Cut_ManStruct_t_
int nCutsPeak;
int nCutsTriv;
int nCutsNode;
+ int nNodes;
// runtime
int timeMerge;
int timeUnion;
diff --git a/src/opt/cut/cutMan.c b/src/opt/cut/cutMan.c
index a96f8173..4ad3a66a 100644
--- a/src/opt/cut/cutMan.c
+++ b/src/opt/cut/cutMan.c
@@ -141,8 +141,9 @@ void Cut_ManPrintStats( Cut_Man_t * p )
printf( "Peak cuts = %8d.\n", p->nCutsPeak );
printf( "Total allocated = %8d.\n", p->nCutsAlloc );
printf( "Total deallocated = %8d.\n", p->nCutsDealloc );
- printf( "The cut size = %3d bytes.\n", p->EntrySize );
- printf( "Peak memory = %.2f Mb.\n", (float)p->nCutsPeak * p->EntrySize / (1<<20) );
+ printf( "Cuts per node = %8.1f\n", ((float)(p->nCutsCur-p->nCutsTriv))/p->nNodes );
+ printf( "The cut size = %8d bytes.\n", p->EntrySize );
+ printf( "Peak memory = %8.2f Mb.\n", (float)p->nCutsPeak * p->EntrySize / (1<<20) );
PRT( "Merge ", p->timeMerge );
PRT( "Union ", p->timeUnion );
PRT( "Hash ", Cut_TableReadTime(p->tTable) );
diff --git a/src/opt/cut/cutNode.c b/src/opt/cut/cutNode.c
index 6ce3b983..8d16ac8a 100644
--- a/src/opt/cut/cutNode.c
+++ b/src/opt/cut/cutNode.c
@@ -65,6 +65,8 @@ static void Cut_CutFilter( Cut_Man_t * p, Cut_Cut_t * pList );
***********************************************************************/
Cut_Cut_t * Cut_NodeReadCuts( Cut_Man_t * p, int Node )
{
+ if ( Node >= p->vCuts->nSize )
+ return NULL;
return Vec_PtrEntry( p->vCuts, Node );
}
@@ -209,6 +211,7 @@ Cut_Cut_t * Cut_NodeComputeCuts( Cut_Man_t * p, int Node, int Node0, int Node1,
}
finish :
// set the list at the node
+ Vec_PtrFillExtra( p->vCuts, Node + 1, NULL );
assert( Cut_NodeReadCuts(p, Node) == NULL );
pList0 = Cut_ListFinish( &SuperList );
Cut_NodeWriteCuts( p, Node, pList0 );
@@ -227,6 +230,7 @@ clk = clock();
if ( p->pParams->fFilter )
Cut_CutFilter( p, pList0 );
p->timeFilter += clock() - clk;
+ p->nNodes++;
return pList0;
}
@@ -387,6 +391,7 @@ clk = clock();
if ( p->pParams->fFilter )
Cut_CutFilter( p, pList );
p->timeFilter += clock() - clk;
+ p->nNodes -= vNodes->nSize - 1;
return pList;
}
@@ -498,7 +503,7 @@ void Cut_NodeTryDroppingCuts( Cut_Man_t * p, int Node )
void Cut_CutPrint( Cut_Cut_t * pCut )
{
int i;
- assert( pCut->nLeaves > 1 );
+ assert( pCut->nLeaves > 0 );
printf( "%d : {", pCut->nLeaves );
for ( i = 0; i < (int)pCut->nLeaves; i++ )
printf( " %d", pCut->pLeaves[i] );