113 int i, CountMax, CountWrite, nCuts, nClasses;
117 nCuts = nClasses = 0;
119 for ( i = 0; i < s_pManRwrExp4->nFuncs; i++ )
121 if ( CountMax < s_pManRwrExp4->pnCounts[i] )
122 CountMax = s_pManRwrExp4->pnCounts[i];
123 nCuts += s_pManRwrExp4->pnCounts[i];
124 if ( s_pManRwrExp4->pnCounts[i] > 0 )
127 printf(
"Number of cuts considered = %8d.\n", nCuts );
128 printf(
"Classes occurring at least once = %8d.\n", nClasses );
130 pDistrib =
ABC_ALLOC(
int, CountMax + 1 );
132 memset( pDistrib, 0,
sizeof(
int)*(CountMax + 1) );
133 for ( i = 0; i < s_pManRwrExp4->nFuncs; i++ )
135 pDistrib[ s_pManRwrExp4->pnCounts[i] ]++;
136 pReprs[ s_pManRwrExp4->pnCounts[i] ] = i;
139 printf(
"Occurence = %6d. Num classes = %4d. \n", 0, 2288-nClasses );
140 for ( i = 1; i <= CountMax; i++ )
143 printf(
"Occurence = %6d. Num classes = %4d. Repr = ", i, pDistrib[i] );
151 pFile = fopen(
"npnclass_stats4.txt",
"w" );
152 for ( i = 0; i < s_pManRwrExp4->nFuncs; i++ )
153 if ( s_pManRwrExp4->pnCounts[i] > 0 )
156 fprintf( pFile,
" %10d\n", s_pManRwrExp4->pnCounts[i] );
161 printf(
"%d classes written into file \"%s\".\n", CountWrite,
"npnclass_stats4.txt" );
225 int i, CountMax, nCuts, Counter;
228 unsigned uTruth, uTruthC;
235 stmm_foreach_item( s_pManRwrExp5->tTableNN, gen, (
char **)&uTruth, (
char **)&Counter )
238 if ( CountMax < Counter )
241 printf(
"Number of cuts considered = %8d.\n", nCuts );
242 printf(
"Classes occurring at least once = %8d.\n",
stmm_count(s_pManRwrExp5->tTableNN) );
243 printf(
"The largest number of occurrence = %8d.\n", CountMax );
246 pDistrib =
ABC_ALLOC(
int, CountMax + 1 );
247 pReprs =
ABC_ALLOC(
unsigned, CountMax + 1 );
248 memset( pDistrib, 0,
sizeof(
int)*(CountMax + 1) );
249 stmm_foreach_item( s_pManRwrExp5->tTableNN, gen, (
char **)&uTruth, (
char **)&Counter )
251 assert( Counter <= CountMax );
252 pDistrib[ Counter ]++;
253 pReprs[ Counter ] = uTruth;
256 for ( i = 1; i <= CountMax; i++ )
259 printf(
"Occurence = %6d. Num classes = %4d. Repr = ", i, pDistrib[i] );
268 vClassesNN = Vec_IntAlloc(
stmm_count(s_pManRwrExp5->tTableNN) );
270 Vec_IntPush( vClassesNN, (
int)uTruth );
271 Vec_IntSortUnsigned( vClassesNN );
274 pFile = fopen(
"nnclass_stats5.txt",
"w" );
277 if ( !
stmm_lookup( s_pManRwrExp5->tTableNN, (
char *)(ABC_PTRUINT_T)uTruth, (
char **)&Counter ) )
282 fprintf( pFile,
" %10d\n", Counter );
285 printf(
"%d classes written into file \"%s\".\n", vClassesNN->nSize,
"nnclass_stats5.txt" );
294 if ( !
stmm_find_or_add( s_pManRwrExp5->tTableNPN, (
char *)(ABC_PTRUINT_T)uTruthC, (
char***)&pCounter ) )
296 if ( !
stmm_lookup( s_pManRwrExp5->tTableNN, (
char *)(ABC_PTRUINT_T)uTruth, (
char **)&Counter ) )
300 (*pCounter) += Counter;
302 printf(
"The numbe of NPN classes = %d.\n",
stmm_count(s_pManRwrExp5->tTableNPN) );
303ABC_PRT(
"Computing NPN classes", Abc_Clock() - clk );
306 vClassesNPN = Vec_IntAlloc(
stmm_count(s_pManRwrExp5->tTableNPN) );
308 Vec_IntPush( vClassesNPN, (
int)uTruth );
309 Vec_IntSortUnsigned( vClassesNPN );
312 pFile = fopen(
"npnclass_stats5.txt",
"w" );
315 if ( !
stmm_lookup( s_pManRwrExp5->tTableNPN, (
char *)(ABC_PTRUINT_T)uTruth, (
char **)&Counter ) )
320 fprintf( pFile,
" %10d\n", Counter );
323 printf(
"%d classes written into file \"%s\".\n", vClassesNPN->nSize,
"npnclass_stats5.txt" );