00001
00021 #ifndef __CUT_INT_H__
00022 #define __CUT_INT_H__
00023
00027
00028 #include <stdio.h>
00029 #include "extra.h"
00030 #include "vec.h"
00031 #include "cut.h"
00032 #include "cutList.h"
00033
00037
00041
00042 typedef struct Cut_HashTableStruct_t_ Cut_HashTable_t;
00043
00044 struct Cut_ManStruct_t_
00045 {
00046
00047 Cut_Params_t * pParams;
00048 Vec_Int_t * vFanCounts;
00049 Vec_Int_t * vNodeAttrs;
00050
00051 Vec_Ptr_t * vCutsNew;
00052 Vec_Ptr_t * vCutsOld;
00053 Vec_Ptr_t * vCutsTemp;
00054
00055 Extra_MmFixed_t * pMmCuts;
00056 int EntrySize;
00057 int nTruthWords;
00058
00059 Cut_Cut_t * pReady;
00060 Vec_Ptr_t * vTemp;
00061 int fCompl0;
00062 int fCompl1;
00063 int fSimul;
00064 int nNodeCuts;
00065 Cut_Cut_t * pStore0[2];
00066 Cut_Cut_t * pStore1[2];
00067 Cut_Cut_t * pCompareOld;
00068 Cut_Cut_t * pCompareNew;
00069 unsigned * puTemp[4];
00070
00071 Vec_Int_t * vNodeCuts;
00072 Vec_Int_t * vNodeStarts;
00073 Vec_Int_t * vCutPairs;
00074
00075 Vec_Ptr_t * vCutsMax;
00076 Vec_Int_t * vDelays;
00077 Vec_Int_t * vDelays2;
00078 int nDelayMin;
00079
00080 int nCutsCur;
00081 int nCutsAlloc;
00082 int nCutsDealloc;
00083 int nCutsPeak;
00084 int nCutsTriv;
00085 int nCutsFilter;
00086 int nCutsLimit;
00087 int nNodes;
00088 int nNodesDag;
00089 int nNodesNoCuts;
00090
00091 int timeMerge;
00092 int timeUnion;
00093 int timeTruth;
00094 int timeFilter;
00095 int timeHash;
00096 int timeMap;
00097 };
00098
00099
00100 #define Cut_ListForEachCut( pList, pCut ) \
00101 for ( pCut = pList; \
00102 pCut; \
00103 pCut = pCut->pNext )
00104 #define Cut_ListForEachCutStop( pList, pCut, pStop ) \
00105 for ( pCut = pList; \
00106 pCut != pStop; \
00107 pCut = pCut->pNext )
00108 #define Cut_ListForEachCutSafe( pList, pCut, pCut2 ) \
00109 for ( pCut = pList, \
00110 pCut2 = pCut? pCut->pNext: NULL; \
00111 pCut; \
00112 pCut = pCut2, \
00113 pCut2 = pCut? pCut->pNext: NULL )
00114
00118
00119
00120 static inline unsigned Cut_NodeSign( int Node ) { return (1 << (Node % 31)); }
00121 static inline int Cut_TruthWords( int nVarsMax ) { return nVarsMax <= 5 ? 1 : (1 << (nVarsMax - 5)); }
00122
00126
00127
00128 extern Cut_Cut_t * Cut_CutAlloc( Cut_Man_t * p );
00129 extern void Cut_CutRecycle( Cut_Man_t * p, Cut_Cut_t * pCut );
00130 extern int Cut_CutCompare( Cut_Cut_t * pCut1, Cut_Cut_t * pCut2 );
00131 extern Cut_Cut_t * Cut_CutDupList( Cut_Man_t * p, Cut_Cut_t * pList );
00132 extern void Cut_CutRecycleList( Cut_Man_t * p, Cut_Cut_t * pList );
00133 extern Cut_Cut_t * Cut_CutMergeLists( Cut_Cut_t * pList1, Cut_Cut_t * pList2 );
00134 extern void Cut_CutNumberList( Cut_Cut_t * pList );
00135 extern Cut_Cut_t * Cut_CutCreateTriv( Cut_Man_t * p, int Node );
00136 extern void Cut_CutPrintMerge( Cut_Cut_t * pCut, Cut_Cut_t * pCut0, Cut_Cut_t * pCut1 );
00137
00138 extern Cut_Cut_t * Cut_CutMergeTwo( Cut_Man_t * p, Cut_Cut_t * pCut0, Cut_Cut_t * pCut1 );
00139
00140 extern void Cut_NodeDoComputeCuts( Cut_Man_t * p, Cut_List_t * pSuper, int Node, int fCompl0, int fCompl1, Cut_Cut_t * pList0, Cut_Cut_t * pList1, int fTriv, int TreeCode );
00141 extern int Cut_CutListVerify( Cut_Cut_t * pList );
00142
00143 extern Cut_HashTable_t * Cut_TableStart( int Size );
00144 extern void Cut_TableStop( Cut_HashTable_t * pTable );
00145 extern int Cut_TableLookup( Cut_HashTable_t * pTable, Cut_Cut_t * pCut, int fStore );
00146 extern void Cut_TableClear( Cut_HashTable_t * pTable );
00147 extern int Cut_TableReadTime( Cut_HashTable_t * pTable );
00148
00149 extern void Cut_TruthComputeOld( Cut_Cut_t * pCut, Cut_Cut_t * pCut0, Cut_Cut_t * pCut1, int fCompl0, int fCompl1 );
00150 extern void Cut_TruthCompute( Cut_Man_t * p, Cut_Cut_t * pCut, Cut_Cut_t * pCut0, Cut_Cut_t * pCut1, int fCompl0, int fCompl1 );
00151
00152 #endif
00153
00157