summaryrefslogtreecommitdiffstats
path: root/src/opt/fxu/fxu.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2011-12-15 15:44:56 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2011-12-15 15:44:56 -0800
commit2bb95a97d06b951e04947b0de6a3486127e24427 (patch)
treeda740a4092c2ebd9eeea7e8e90914990e3c31d5f /src/opt/fxu/fxu.c
parentc80c0cc6c9d86032b3776a3aa99995035c78e3cb (diff)
downloadabc-2bb95a97d06b951e04947b0de6a3486127e24427.tar.gz
abc-2bb95a97d06b951e04947b0de6a3486127e24427.tar.bz2
abc-2bb95a97d06b951e04947b0de6a3486127e24427.zip
Adding switch '-W' to fx to control the quality of extracted divisors.
Diffstat (limited to 'src/opt/fxu/fxu.c')
-rw-r--r--src/opt/fxu/fxu.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/opt/fxu/fxu.c b/src/opt/fxu/fxu.c
index 264a7898..95f1c99d 100644
--- a/src/opt/fxu/fxu.c
+++ b/src/opt/fxu/fxu.c
@@ -57,6 +57,7 @@ static int s_MemoryPeak;
***********************************************************************/
int Fxu_FastExtract( Fxu_Data_t * pData )
{
+ int fScrollLines = 1;
Fxu_Matrix * p;
Fxu_Single * pSingle;
Fxu_Double * pDouble;
@@ -81,8 +82,8 @@ int Fxu_FastExtract( Fxu_Data_t * pData )
{
Weight1 = Fxu_HeapSingleReadMaxWeight( p->pHeapSingle );
if ( pData->fVerbose )
- printf( "Div %5d : Best single = %5d.\r", Counter++, Weight1 );
- if ( Weight1 > 0 || (Weight1 == 0 && pData->fUse0) )
+ printf( "Div %5d : Best single = %5d.%s", Counter++, Weight1, fScrollLines?"\n":"\r" );
+ if ( Weight1 > pData->WeightMax || (Weight1 == 0 && pData->fUse0) )
Fxu_UpdateSingle( p );
else
break;
@@ -96,8 +97,8 @@ int Fxu_FastExtract( Fxu_Data_t * pData )
{
Weight2 = Fxu_HeapDoubleReadMaxWeight( p->pHeapDouble );
if ( pData->fVerbose )
- printf( "Div %5d : Best double = %5d.\r", Counter++, Weight2 );
- if ( Weight2 > 0 || (Weight2 == 0 && pData->fUse0) )
+ printf( "Div %5d : Best double = %5d.%s", Counter++, Weight2, fScrollLines?"\n":"\r" );
+ if ( Weight2 > pData->WeightMax || (Weight2 == 0 && pData->fUse0) )
Fxu_UpdateDouble( p );
else
break;
@@ -113,19 +114,19 @@ int Fxu_FastExtract( Fxu_Data_t * pData )
Weight2 = Fxu_HeapDoubleReadMaxWeight( p->pHeapDouble );
if ( pData->fVerbose )
- printf( "Div %5d : Best double = %5d. Best single = %5d.\r", Counter++, Weight2, Weight1 );
+ printf( "Div %5d : Best double = %5d. Best single = %5d.%s", Counter++, Weight2, Weight1, fScrollLines?"\n":"\r" );
//Fxu_Select( p, &pSingle, &pDouble );
if ( Weight1 >= Weight2 )
{
- if ( Weight1 > 0 || (Weight1 == 0 && pData->fUse0) )
+ if ( Weight1 > pData->WeightMax || (Weight1 == 0 && pData->fUse0) )
Fxu_UpdateSingle( p );
else
break;
}
else
{
- if ( Weight2 > 0 || (Weight2 == 0 && pData->fUse0) )
+ if ( Weight2 > pData->WeightMax || (Weight2 == 0 && pData->fUse0) )
Fxu_UpdateDouble( p );
else
break;
@@ -144,10 +145,10 @@ int Fxu_FastExtract( Fxu_Data_t * pData )
// select the best single and double
Weight3 = Fxu_Select( p, &pSingle, &pDouble );
if ( pData->fVerbose )
- printf( "Div %5d : Best double = %5d. Best single = %5d. Best complement = %5d.\r",
- Counter++, Weight2, Weight1, Weight3 );
+ printf( "Div %5d : Best double = %5d. Best single = %5d. Best complement = %5d.%s",
+ Counter++, Weight2, Weight1, Weight3, fScrollLines?"\n":"\r" );
- if ( Weight3 > 0 || (Weight3 == 0 && pData->fUse0) )
+ if ( Weight3 > pData->WeightMax || (Weight3 == 0 && pData->fUse0) )
Fxu_Update( p, pSingle, pDouble );
else
break;