abc/src/map/if/ifSeq.c
/**Function*************************************************************

  Synopsis    [Performs binary search for the optimal clock period.]

  Description [Assumes that FiMin is infeasible while FiMax is feasible.]
               
  SideEffects []

  SeeAlso     []

***********************************************************************/
Function
Synopsis    [Performs binary search for the optimal clock period.]

Description [Assumes that FiMin is infeasible while FiMax is feasible.]




Function Synopsis [ Performs binary search for the optimal clock period . ] Description [ Assumes that FiMin is infeasible while FiMax is feasible . ]
int If_ManBinarySearch_rec( If_Man_t * p, int FiMin, int FiMax )
{
    assert( FiMin < FiMax );
    if ( FiMin + 1 == FiMax )
        return FiMax;
    p->Period = FiMin + (FiMax - FiMin)/2;
    if ( If_ManBinarySearchPeriod( p ) )
        return If_ManBinarySearch_rec( p, FiMin, p->Period ); 
    else 
        return If_ManBinarySearch_rec( p, p->Period, FiMax ); 
}
int If_ManBinarySearch_rec ( If_Man_t * p , int FiMin , int FiMax ) { assert ( FiMin < FiMax ) ; if ( FiMin + 1 == FiMax ) return FiMax ; p -> Period = FiMin + ( FiMax - FiMin ) / 2 ; if ( If_ManBinarySearchPeriod ( p ) ) return If_ManBinarySearch_rec ( p , FiMin , p -> Period ) ; else return If_ManBinarySearch_rec ( p , p -> Period , FiMax ) ; }
Function
Synopsis    [Performs binary search for the optimal clock period.]
Function Synopsis [ Performs binary search for the optimal clock period . ]
// compute the median // Median is feasible // Median is infeasible