00001
00019 #include "mvc.h"
00020
00021
00022
00026
00027 static void Mvc_CubePrintBinary( Mvc_Cover_t * pCover, Mvc_Cube_t * pCube );
00028
00032
00044 void Mvc_CoverPrint( Mvc_Cover_t * pCover )
00045 {
00046 Mvc_Cube_t * pCube;
00047 int i;
00048
00049 printf( "The cover contains %d cubes (%d bits and %d words)\n",
00050 pCover->lCubes.nItems, pCover->nBits, pCover->nWords );
00051
00052 Mvc_CoverForEachCube( pCover, pCube )
00053 Mvc_CubePrint( pCover, pCube );
00054
00055 if ( pCover->pLits )
00056 {
00057 for ( i = 0; i < pCover->nBits; i++ )
00058 printf( " %d", pCover->pLits[i] );
00059 printf( "\n" );
00060 }
00061 printf( "End of cover printout\n" );
00062 }
00063
00064
00076 void Mvc_CubePrint( Mvc_Cover_t * pCover, Mvc_Cube_t * pCube )
00077 {
00078 int iBit, Value;
00079
00080
00081 Mvc_CubeForEachBit( pCover, pCube, iBit, Value )
00082 printf( "%c", '0' + Value );
00083 printf( "\n" );
00084 }
00085
00086
00098 void Mvc_CoverPrintBinary( Mvc_Cover_t * pCover )
00099 {
00100 Mvc_Cube_t * pCube;
00101 int i;
00102
00103 printf( "The cover contains %d cubes (%d bits and %d words)\n",
00104 pCover->lCubes.nItems, pCover->nBits, pCover->nWords );
00105
00106 Mvc_CoverForEachCube( pCover, pCube )
00107 Mvc_CubePrintBinary( pCover, pCube );
00108
00109 if ( pCover->pLits )
00110 {
00111 for ( i = 0; i < pCover->nBits; i++ )
00112 printf( " %d", pCover->pLits[i] );
00113 printf( "\n" );
00114 }
00115 printf( "End of cover printout\n" );
00116 }
00117
00118
00130 void Mvc_CubePrintBinary( Mvc_Cover_t * pCover, Mvc_Cube_t * pCube )
00131 {
00132 int iVar, Value;
00133
00134
00135 Mvc_CubeForEachVarValue( pCover, pCube, iVar, Value )
00136 {
00137 assert( Value != 0 );
00138 if ( Value == 3 )
00139 printf( "-" );
00140 else if ( Value == 1 )
00141 printf( "0" );
00142 else
00143 printf( "1" );
00144 }
00145 printf( "\n" );
00146 }
00147
00148 #if 0
00149
00161 void Mvc_CoverPrintMv( Mvc_Data_t * pData, Mvc_Cover_t * pCover )
00162 {
00163 Mvc_Cube_t * pCube;
00164 int i;
00165
00166 printf( "The cover contains %d cubes (%d bits and %d words)\n",
00167 pCover->lCubes.nItems, pCover->nBits, pCover->nWords );
00168
00169 Mvc_CoverForEachCube( pCover, pCube )
00170 Mvc_CubePrintMv( pData, pCover, pCube );
00171
00172 if ( pCover->pLits )
00173 {
00174 for ( i = 0; i < pCover->nBits; i++ )
00175 printf( " %d", pCover->pLits[i] );
00176 printf( "\n" );
00177 }
00178 printf( "End of cover printout\n" );
00179 }
00180
00181
00193 void Mvc_CubePrintMv( Mvc_Data_t * pData, Mvc_Cover_t * pCover, Mvc_Cube_t * pCube )
00194 {
00195 int iLit, iVar;
00196
00197 printf( "Size = %2d ", Mvc_CubeReadSize(pCube) );
00198 iVar = 0;
00199 for ( iLit = 0; iLit < pData->pVm->nValuesIn; iLit++ )
00200 {
00201 if ( iLit == pData->pVm->pValuesFirst[iVar+1] )
00202 {
00203 printf( " " );
00204 iVar++;
00205 }
00206 if ( Mvc_CubeBitValue( pCube, iLit ) )
00207 printf( "%c", '0' + iLit - pData->pVm->pValuesFirst[iVar] );
00208 else
00209 printf( "-" );
00210 }
00211 printf( "\n" );
00212 }
00213
00214 #endif
00215
00219
00220