Commit 2c96c8af by Alan Mishchenko

Version abc80721

parent de978ced
......@@ -2902,6 +2902,10 @@ SOURCE=.\src\aig\aig\aigPartReg.c
# End Source File
# Begin Source File
SOURCE=.\src\aig\aig\aigPartSat.c
# End Source File
# Begin Source File
SOURCE=.\src\aig\aig\aigRepr.c
# End Source File
# Begin Source File
......
......@@ -460,6 +460,7 @@ extern void Aig_ManCutStop( Aig_ManCut_t * p );
/*=== aigDfs.c ==========================================================*/
extern int Aig_ManVerifyTopoOrder( Aig_Man_t * p );
extern Vec_Ptr_t * Aig_ManDfs( Aig_Man_t * p, int fNodesOnly );
extern Vec_Ptr_t * Aig_ManDfsPreorder( Aig_Man_t * p, int fNodesOnly );
extern Vec_Vec_t * Aig_ManLevelize( Aig_Man_t * p );
extern Vec_Ptr_t * Aig_ManDfsNodes( Aig_Man_t * p, Aig_Obj_t ** ppNodes, int nNodes );
extern Vec_Ptr_t * Aig_ManDfsChoices( Aig_Man_t * p );
......
......@@ -166,6 +166,68 @@ Vec_Ptr_t * Aig_ManDfs( Aig_Man_t * p, int fNodesOnly )
/**Function*************************************************************
Synopsis [Collects internal nodes in the DFS order.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void Aig_ManDfsPreorder_rec( Aig_Man_t * p, Aig_Obj_t * pObj, Vec_Ptr_t * vNodes )
{
if ( pObj == NULL )
return;
assert( !Aig_IsComplement(pObj) );
if ( Aig_ObjIsTravIdCurrent(p, pObj) )
return;
Aig_ObjSetTravIdCurrent(p, pObj);
Vec_PtrPush( vNodes, pObj );
if ( p->pEquivs && Aig_ObjEquiv(p, pObj) )
Aig_ManDfs_rec( p, Aig_ObjEquiv(p, pObj), vNodes );
Aig_ManDfsPreorder_rec( p, Aig_ObjFanin0(pObj), vNodes );
Aig_ManDfsPreorder_rec( p, Aig_ObjFanin1(pObj), vNodes );
}
/**Function*************************************************************
Synopsis [Collects objects of the AIG in the DFS order.]
Description [Works with choice nodes.]
SideEffects []
SeeAlso []
***********************************************************************/
Vec_Ptr_t * Aig_ManDfsPreorder( Aig_Man_t * p, int fNodesOnly )
{
Vec_Ptr_t * vNodes;
Aig_Obj_t * pObj;
int i;
Aig_ManIncrementTravId( p );
Aig_ObjSetTravIdCurrent( p, Aig_ManConst1(p) );
// start the array of nodes
vNodes = Vec_PtrAlloc( Aig_ManObjNumMax(p) );
// mark PIs if they should not be collected
if ( fNodesOnly )
Aig_ManForEachPi( p, pObj, i )
Aig_ObjSetTravIdCurrent( p, pObj );
else
Vec_PtrPush( vNodes, Aig_ManConst1(p) );
// collect nodes reachable in the DFS order
Aig_ManForEachPo( p, pObj, i )
Aig_ManDfsPreorder_rec( p, fNodesOnly? Aig_ObjFanin0(pObj): pObj, vNodes );
if ( fNodesOnly )
assert( Vec_PtrSize(vNodes) == Aig_ManNodeNum(p) );
else
assert( Vec_PtrSize(vNodes) == Aig_ManObjNum(p) );
return vNodes;
}
/**Function*************************************************************
Synopsis [Levelizes the nodes.]
Description []
......
......@@ -13,6 +13,7 @@ SRC += src/aig/aig/aigCheck.c \
src/aig/aig/aigOrder.c \
src/aig/aig/aigPart.c \
src/aig/aig/aigPartReg.c \
src/aig/aig/aigPartSat.c \
src/aig/aig/aigRepr.c \
src/aig/aig/aigRet.c \
src/aig/aig/aigRetF.c \
......
......@@ -108,6 +108,10 @@ static inline void Cnf_ObjSetBestCut( Aig_Obj_t * pObj, Cnf_Cut_t * pCut
/// ITERATORS ///
////////////////////////////////////////////////////////////////////////
// iterator over the clauses
#define Cnf_CnfForClause( p, pBeg, pEnd, i ) \
for ( i = 0; i < p->nClauses && (pBeg = p->pClauses[i]) && (pEnd = p->pClauses[i+1]); i++ )
// iterator over leaves of the cut
#define Cnf_CutForEachLeaf( p, pCut, pLeaf, i ) \
for ( i = 0; (i < (int)(pCut)->nFanins) && ((pLeaf) = Aig_ManObj(p, (pCut)->pFanins[i])); i++ )
......@@ -142,7 +146,7 @@ extern void Cnf_DataWriteIntoFile( Cnf_Dat_t * p, char * pFileName, i
extern void * Cnf_DataWriteIntoSolver( Cnf_Dat_t * p, int nFrames, int fInit );
extern int Cnf_DataWriteOrClause( void * pSat, Cnf_Dat_t * pCnf );
extern int Cnf_DataWriteAndClauses( void * p, Cnf_Dat_t * pCnf );
extern void Cnf_DataTranformPolarity( Cnf_Dat_t * pCnf );
extern void Cnf_DataTranformPolarity( Cnf_Dat_t * pCnf, int fTransformPos );
/*=== cnfMap.c ========================================================*/
extern void Cnf_DeriveMapping( Cnf_Man_t * p );
extern int Cnf_ManMapForCnf( Cnf_Man_t * p );
......
......@@ -470,7 +470,7 @@ int Cnf_DataWriteAndClauses( void * p, Cnf_Dat_t * pCnf )
SeeAlso []
***********************************************************************/
void Cnf_DataTranformPolarity( Cnf_Dat_t * pCnf )
void Cnf_DataTranformPolarity( Cnf_Dat_t * pCnf, int fTransformPos )
{
Aig_Obj_t * pObj;
int * pVarToPol;
......@@ -478,8 +478,12 @@ void Cnf_DataTranformPolarity( Cnf_Dat_t * pCnf )
// create map from the variable number to its polarity
pVarToPol = CALLOC( int, pCnf->nVars );
Aig_ManForEachObj( pCnf->pMan, pObj, i )
if ( !Aig_ObjIsPo(pObj) && pCnf->pVarNums[pObj->Id] >= 0 )
{
if ( !fTransformPos && Aig_ObjIsPo(pObj) )
continue;
if ( pCnf->pVarNums[pObj->Id] >= 0 )
pVarToPol[ pCnf->pVarNums[pObj->Id] ] = pObj->fPhase;
}
// transform literals
for ( i = 0; i < pCnf->nLiterals; i++ )
{
......
......@@ -54,7 +54,7 @@ Aig_Man_t * Dar_ManRewriteDefault( Aig_Man_t * pAig )
/**Function*************************************************************
Synopsis [Reproduces script "compress2".]
Synopsis [Reproduces script "rwsat".]
Description []
......
......@@ -55,7 +55,7 @@ int Fra_FraigSat( Aig_Man_t * pMan, sint64 nConfLimit, sint64 nInsLimit, int fFl
// pCnf = Cnf_DeriveSimple( pMan, Aig_ManPoNum(pMan) );
if ( fFlipBits )
Cnf_DataTranformPolarity( pCnf );
Cnf_DataTranformPolarity( pCnf, 0 );
// convert into SAT solver
pSat = Cnf_DataWriteIntoSolver( pCnf, 1, 0 );
......
......@@ -530,7 +530,7 @@ p->timeTrav += clock() - clk2;
pCnf = Cnf_DeriveSimple( p->pManFraig, Aig_ManRegNum(p->pManFraig) );
else
pCnf = Cnf_Derive( p->pManFraig, Aig_ManRegNum(p->pManFraig) );
// Cnf_DataTranformPolarity( pCnf );
// Cnf_DataTranformPolarity( pCnf, 0 );
//Cnf_DataWriteIntoFile( pCnf, "temp.cnf", 1 );
p->pSat = Cnf_DataWriteIntoSolver( pCnf, 1, 0 );
......
......@@ -389,11 +389,11 @@ PRT( "Time", clock() - clkTotal );
clk = clock();
if ( pParSec->fInterpolation && RetValue == -1 && Aig_ManRegNum(pNew) > 0 && Aig_ManPoNum(pNew)-Aig_ManRegNum(pNew) == 1 )
{
extern int Saig_Interpolate( Aig_Man_t * pAig, int nConfLimit, int nFramesMax, int fRewrite, int fTransLoop, int fUseIp, int fCheckInd, int fCheckKstep, int fVerbose, int * pDepth );
extern int Saig_Interpolate( Aig_Man_t * pAig, int nConfLimit, int nFramesMax, int fRewrite, int fTransLoop, int fUsePudlak, int fUseOther, int fUseMiniSat, int fCheckInd, int fCheckKstep, int fVerbose, int * pDepth );
int Depth;
pNew->nTruePis = Aig_ManPiNum(pNew) - Aig_ManRegNum(pNew);
pNew->nTruePos = Aig_ManPoNum(pNew) - Aig_ManRegNum(pNew);
RetValue = Saig_Interpolate( pNew, 5000, 40, 0, 1, 0, 1, 1, pParSec->fVeryVerbose, &Depth );
RetValue = Saig_Interpolate( pNew, 5000, 40, 0, 1, 0, 0, 0, 1, 1, pParSec->fVeryVerbose, &Depth );
if ( pParSec->fVerbose )
{
if ( RetValue == 1 )
......
......@@ -394,7 +394,7 @@ Hop_Obj_t * Hop_Compose( Hop_Man_t * p, Hop_Obj_t * pRoot, Hop_Obj_t * pFunc, in
/**Function*************************************************************
Synopsis [Composes the AIG (pRoot) with the function (pFunc) using PI var (iVar).]
Synopsis [Remaps the AIG (pRoot) to have the given support (uSupp).]
Description []
......@@ -417,7 +417,7 @@ void Hop_Remap_rec( Hop_Man_t * p, Hop_Obj_t * pObj )
/**Function*************************************************************
Synopsis [Composes the AIG (pRoot) with the function (pFunc) using PI var (iVar).]
Synopsis [Remaps the AIG (pRoot) to have the given support (uSupp).]
Description []
......
......@@ -205,7 +205,10 @@ int Mfx_Perform( Nwk_Man_t * pNtk, Mfx_Par_t * pPars, If_Lib_t * pLutLib )
int nTotalNodesBeg = Nwk_ManNodeNum(pNtk);
int nTotalEdgesBeg = Nwk_ManGetTotalFanins(pNtk);
// assert( Nwk_ManCheck( pNtk ) );
// prepare the network for processing
Nwk_ManRemoveDupFanins( pNtk, 0 );
assert( Nwk_ManCheck( pNtk ) );
// check limits on the number of fanins
nFaninMax = Nwk_ManGetFaninMax(pNtk);
if ( pPars->fResub )
......
......@@ -803,6 +803,8 @@ Nwk_Man_t * Ntl_ManExtractNwk( Ntl_Man_t * p, Aig_Man_t * pAig, Tim_Man_t * pMan
pNtk->pManTime = Tim_ManDup( pManTime, 0 );
else
pNtk->pManTime = Tim_ManDup( p->pManTime, 0 );
// Nwk_ManRemoveDupFanins( pNtk, 0 );
// assert( Nwk_ManCheck( pNtk ) );
return pNtk;
}
......
......@@ -301,6 +301,7 @@ extern ABC_DLL void Nwk_ManDumpBlif( Nwk_Man_t * pNtk, char * pFileNa
extern ABC_DLL void Nwk_ManPrintFanioNew( Nwk_Man_t * pNtk );
extern ABC_DLL void Nwk_ManCleanMarks( Nwk_Man_t * pNtk );
extern ABC_DLL void Nwk_ManMinimumBase( Nwk_Man_t * pNtk, int fVerbose );
extern ABC_DLL void Nwk_ManRemoveDupFanins( Nwk_Man_t * pNtk, int fVerbose );
#ifdef __cplusplus
}
......
......@@ -41,7 +41,7 @@
***********************************************************************/
int Nwk_ManCheck( Nwk_Man_t * p )
{
Nwk_Obj_t * pObj;
Nwk_Obj_t * pObj, * pNext;
int i, k, m;
// check if the nodes have duplicated fanins
Nwk_ManForEachNode( p, pObj, i )
......@@ -51,7 +51,6 @@ int Nwk_ManCheck( Nwk_Man_t * p )
if ( pObj->pFanio[k] == pObj->pFanio[m] )
printf( "Node %d has duplicated fanin %d.\n", pObj->Id, pObj->pFanio[k]->Id );
}
/*
// check if all nodes are in the correct fanin/fanout relationship
Nwk_ManForEachObj( p, pObj, i )
{
......@@ -62,7 +61,6 @@ int Nwk_ManCheck( Nwk_Man_t * p )
if ( Nwk_ObjFindFanin( pNext, pObj ) == -1 )
printf( "Nwk_ManCheck(): Object %d has fanout %d which does not have a corresponding fanin.\n", pObj->Id, pNext->Id );
}
*/
return 1;
}
......
......@@ -188,19 +188,25 @@ void Nwk_ObjAddFanin( Nwk_Obj_t * pObj, Nwk_Obj_t * pFanin )
***********************************************************************/
void Nwk_ObjDeleteFanin( Nwk_Obj_t * pObj, Nwk_Obj_t * pFanin )
{
int i, k, Limit;
int i, k, Limit, fFound;
// remove pFanin from the fanin list of pObj
Limit = pObj->nFanins + pObj->nFanouts;
fFound = 0;
for ( k = i = 0; i < Limit; i++ )
if ( pObj->pFanio[i] != pFanin )
if ( fFound || pObj->pFanio[i] != pFanin )
pObj->pFanio[k++] = pObj->pFanio[i];
else
fFound = 1;
assert( i == k + 1 ); // if it fails, likely because of duplicated fanin
pObj->nFanins--;
// remove pObj from the fanout list of pFanin
Limit = pFanin->nFanins + pFanin->nFanouts;
fFound = 0;
for ( k = i = pFanin->nFanins; i < Limit; i++ )
if ( pFanin->pFanio[i] != pObj )
if ( fFound || pFanin->pFanio[i] != pObj )
pFanin->pFanio[k++] = pFanin->pFanio[i];
else
fFound = 1;
assert( i == k + 1 ); // if it fails, likely because of duplicated fanout
pFanin->nFanouts--;
}
......
......@@ -477,19 +477,16 @@ void Nwk_ManCleanMarks( Nwk_Man_t * pMan )
SeeAlso []
***********************************************************************/
void Nwk_ManMinimumBase( Nwk_Man_t * pNtk, int fVerbose )
int Nwk_ManMinimumBaseNode( Nwk_Obj_t * pObj, Vec_Int_t * vTruth, int fVerbose )
{
unsigned * pTruth;
Vec_Int_t * vTruth;
Nwk_Obj_t * pObj, * pFanin, * pObjNew;
int uSupp, nSuppSize, i, k, Counter = 0;
vTruth = Vec_IntAlloc( 1 << 16 );
Nwk_ManForEachNode( pNtk, pObj, i )
{
Nwk_Obj_t * pFanin, * pObjNew;
Nwk_Man_t * pNtk = pObj->pMan;
int uSupp, nSuppSize, k, Counter = 0;
pTruth = Hop_ManConvertAigToTruth( pNtk->pManHop, Hop_Regular(pObj->pFunc), Nwk_ObjFaninNum(pObj), vTruth, 0 );
nSuppSize = Kit_TruthSupportSize(pTruth, Nwk_ObjFaninNum(pObj));
if ( nSuppSize == Nwk_ObjFaninNum(pObj) )
continue;
return 0;
Counter++;
uSupp = Kit_TruthSupport( pTruth, Nwk_ObjFaninNum(pObj) );
// create new node with the given support
......@@ -502,12 +499,94 @@ void Nwk_ManMinimumBase( Nwk_Man_t * pNtk, int fVerbose )
printf( "Reducing node %d fanins from %d to %d.\n",
pObj->Id, Nwk_ObjFaninNum(pObj), Nwk_ObjFaninNum(pObjNew) );
Nwk_ObjReplace( pObj, pObjNew );
}
return 1;
}
/**Function*************************************************************
Synopsis [Minimizes the support of all nodes.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void Nwk_ManMinimumBase( Nwk_Man_t * pNtk, int fVerbose )
{
Vec_Int_t * vTruth;
Nwk_Obj_t * pObj;
int i, Counter = 0;
vTruth = Vec_IntAlloc( 1 << 16 );
Nwk_ManForEachNode( pNtk, pObj, i )
Counter += Nwk_ManMinimumBaseNode( pObj, vTruth, fVerbose );
if ( fVerbose && Counter )
printf( "Support minimization reduced support of %d nodes.\n", Counter );
Vec_IntFree( vTruth );
}
/**Function*************************************************************
Synopsis [Minimizes the support of all nodes.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void Nwk_ManRemoveDupFaninsNode( Nwk_Obj_t * pObj, int iFan0, int iFan1, Vec_Int_t * vTruth )
{
Hop_Man_t * pManHop = pObj->pMan->pManHop;
// Nwk_Obj_t * pFanin0 = pObj->pFanio[iFan0];
// Nwk_Obj_t * pFanin1 = pObj->pFanio[iFan1];
assert( pObj->pFanio[iFan0] == pObj->pFanio[iFan1] );
pObj->pFunc = Hop_Compose( pManHop, pObj->pFunc, Hop_IthVar(pManHop,iFan0), iFan1 );
Nwk_ManMinimumBaseNode( pObj, vTruth, 0 );
}
/**Function*************************************************************
Synopsis [Minimizes the support of all nodes.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
void Nwk_ManRemoveDupFanins( Nwk_Man_t * pNtk, int fVerbose )
{
Vec_Int_t * vTruth;
Nwk_Obj_t * pObj;
int i, k, m, fFound;
// check if the nodes have duplicated fanins
vTruth = Vec_IntAlloc( 1 << 16 );
Nwk_ManForEachNode( pNtk, pObj, i )
{
fFound = 0;
for ( k = 0; k < pObj->nFanins; k++ )
{
for ( m = k + 1; m < pObj->nFanins; m++ )
if ( pObj->pFanio[k] == pObj->pFanio[m] )
{
if ( fVerbose )
printf( "Removing duplicated fanins of node %d (fanins %d and %d).\n",
pObj->Id, pObj->pFanio[k]->Id, pObj->pFanio[m]->Id );
Nwk_ManRemoveDupFaninsNode( pObj, k, m, vTruth );
fFound = 1;
break;
}
if ( fFound )
break;
}
}
Vec_IntFree( vTruth );
}
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///
////////////////////////////////////////////////////////////////////////
......
......@@ -85,7 +85,7 @@ extern Aig_Man_t * Saig_ManHaigRecord( Aig_Man_t * p, int nIters, int nSte
extern void Saig_ManDumpBlif( Aig_Man_t * p, char * pFileName );
extern Aig_Man_t * Saig_ManReadBlif( char * pFileName );
/*=== saigInter.c ==========================================================*/
extern int Saig_Interpolate( Aig_Man_t * pAig, int nConfLimit, int nFramesMax, int fRewrite, int fTransLoop, int fUsePudlak, int fCheckInd, int fCheckKstep, int fVerbose, int * pDepth );
extern int Saig_Interpolate( Aig_Man_t * pAig, int nConfLimit, int nFramesMax, int fRewrite, int fTransLoop, int fUsePudlak, int fUseOther, int fUseMiniSat, int fCheckInd, int fCheckKstep, int fVerbose, int * pDepth );
/*=== saigMiter.c ==========================================================*/
extern Aig_Man_t * Saig_ManCreateMiter( Aig_Man_t * p1, Aig_Man_t * p2, int Oper );
/*=== saigPhase.c ==========================================================*/
......
......@@ -954,7 +954,7 @@ Abc_Ntk_t * Abc_NtkDarToCnf( Abc_Ntk_t * pNtk, char * pFileName )
// derive CNF
pCnf = Cnf_Derive( pMan, 0 );
Cnf_DataTranformPolarity( pCnf );
Cnf_DataTranformPolarity( pCnf, 0 );
/*
// write the network for verification
pManCnf = Cnf_ManRead();
......@@ -983,7 +983,7 @@ Abc_Ntk_t * Abc_NtkDarToCnf( Abc_Ntk_t * pNtk, char * pFileName )
SeeAlso []
***********************************************************************/
int Abc_NtkDSat( Abc_Ntk_t * pNtk, sint64 nConfLimit, sint64 nInsLimit, int fFlipBits, int fAndOuts, int fVerbose )
int Abc_NtkDSat( Abc_Ntk_t * pNtk, sint64 nConfLimit, sint64 nInsLimit, int fAlignPol, int fAndOuts, int fVerbose )
{
Aig_Man_t * pMan;
int RetValue;//, clk = clock();
......@@ -991,7 +991,32 @@ int Abc_NtkDSat( Abc_Ntk_t * pNtk, sint64 nConfLimit, sint64 nInsLimit, int fFli
assert( Abc_NtkLatchNum(pNtk) == 0 );
assert( Abc_NtkPoNum(pNtk) == 1 );
pMan = Abc_NtkToDar( pNtk, 0, 0 );
RetValue = Fra_FraigSat( pMan, nConfLimit, nInsLimit, fFlipBits, fAndOuts, fVerbose );
RetValue = Fra_FraigSat( pMan, nConfLimit, nInsLimit, fAlignPol, fAndOuts, fVerbose );
pNtk->pModel = pMan->pData, pMan->pData = NULL;
Aig_ManStop( pMan );
return RetValue;
}
/**Function*************************************************************
Synopsis [Solves combinational miter using a SAT solver.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
int Abc_NtkPartitionedSat( Abc_Ntk_t * pNtk, int nAlgo, int nPartSize, int nConfPart, int nConfTotal, int fAlignPol, int fSynthesize, int fVerbose )
{
extern int Aig_ManPartitionedSat( Aig_Man_t * pNtk, int nAlgo, int nPartSize, int nConfPart, int nConfTotal, int fAlignPol, int fSynthesize, int fVerbose );
Aig_Man_t * pMan;
int RetValue;//, clk = clock();
assert( Abc_NtkIsStrash(pNtk) );
assert( Abc_NtkLatchNum(pNtk) == 0 );
pMan = Abc_NtkToDar( pNtk, 0, 0 );
RetValue = Aig_ManPartitionedSat( pMan, nAlgo, nPartSize, nConfPart, nConfTotal, fAlignPol, fSynthesize, fVerbose );
pNtk->pModel = pMan->pData, pMan->pData = NULL;
Aig_ManStop( pMan );
return RetValue;
......@@ -1270,7 +1295,7 @@ PRT( "Time", clock() - clk );
SeeAlso []
***********************************************************************/
int Abc_NtkDarBmcInter( Abc_Ntk_t * pNtk, int nConfLimit, int nFramesMax, int fRewrite, int fTransLoop, int fUsePudlak, int fCheckInd, int fCheckKstep, int fVerbose )
int Abc_NtkDarBmcInter( Abc_Ntk_t * pNtk, int nConfLimit, int nFramesMax, int fRewrite, int fTransLoop, int fUsePudlak, int fUseOther, int fUseMiniSat, int fCheckInd, int fCheckKstep, int fVerbose )
{
Aig_Man_t * pMan;
int RetValue, Depth, clk = clock();
......@@ -1282,7 +1307,7 @@ int Abc_NtkDarBmcInter( Abc_Ntk_t * pNtk, int nConfLimit, int nFramesMax, int fR
return -1;
}
assert( pMan->nRegs > 0 );
RetValue = Saig_Interpolate( pMan, nConfLimit, nFramesMax, fRewrite, fTransLoop, fUsePudlak, fCheckInd, fCheckKstep, fVerbose, &Depth );
RetValue = Saig_Interpolate( pMan, nConfLimit, nFramesMax, fRewrite, fTransLoop, fUsePudlak, fUseOther, fUseMiniSat, fCheckInd, fCheckKstep, fVerbose, &Depth );
if ( RetValue == 1 )
printf( "Property proved. " );
else if ( RetValue == 0 )
......
......@@ -658,6 +658,52 @@ static inline int Vec_IntRemove( Vec_Int_t * p, int Entry )
/**Function*************************************************************
Synopsis [Find entry.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
static inline int Vec_IntFindMax( Vec_Int_t * p )
{
int i, Best;
if ( p->nSize == 0 )
return 0;
Best = p->pArray[0];
for ( i = 1; i < p->nSize; i++ )
if ( Best < p->pArray[i] )
Best = p->pArray[i];
return Best;
}
/**Function*************************************************************
Synopsis [Find entry.]
Description []
SideEffects []
SeeAlso []
***********************************************************************/
static inline int Vec_IntFindMin( Vec_Int_t * p )
{
int i, Best;
if ( p->nSize == 0 )
return 0;
Best = p->pArray[0];
for ( i = 1; i < p->nSize; i++ )
if ( Best > p->pArray[i] )
Best = p->pArray[i];
return Best;
}
/**Function*************************************************************
Synopsis [Comparison procedure for two integers.]
Description []
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment