Commit 7601f7fd authored by Simon de Givry's avatar Simon de Givry Committed by Thomas Schiex
Browse files

[code] TRW-S bounds printing as optimality gap

parent f5e379ce
// Cmake generated version
#define Toulbar_VERSION "1.0.0-59-g74566ee-master (1540238654)"
#define Toulbar_VERSION "1.0.0-119-g9e315c2-master-tainted (1540302449)"
......@@ -2838,7 +2838,7 @@ void WCSP::propagateTRWS()
if (ToulBar2::uai)
cout << "TRW-S dual bound: " << std::fixed << std::setprecision(ToulBar2::decimalPoint) << Cost2ADCost(getLb() + ebound) << std::setprecision(DECIMAL_POINT) << " energy: " << -(Cost2LogProb(getLb() + ebound) + ToulBar2::markov_log) << " -- " << Cost2ADCost(getLb() + bestUb) << std::setprecision(DECIMAL_POINT) << " energy: " << -(Cost2LogProb(getLb() + bestUb) + ToulBar2::markov_log) << " (+" << (100 * change) << "%) (accuracy: " << (100.0 * (Cost2ADCost(getLb() + bestUb) - Cost2ADCost(getLb() + ebound)) / (Cost2ADCost(getLb() + bestUb))) << "%) (iter:" << nIteration << ")" << endl;
else
cout << "TRW-S dual bounds: [ " << std::fixed << std::setprecision(ToulBar2::decimalPoint) << Cost2ADCost(getLb() + ebound) << " -- " << Cost2ADCost(getLb() + bestUb) << std::setprecision(DECIMAL_POINT) << " ] (+" << (100 * change) << "%) (accuracy: " << (100.0 * (Cost2ADCost(getLb() + bestUb) - Cost2ADCost(getLb() + ebound)) / (Cost2ADCost(getLb() + bestUb))) << "%) (iter:" << nIteration << ")" << endl;
cout << "TRW-S bounds: [" << std::fixed << std::setprecision(ToulBar2::decimalPoint) << Cost2ADCost(getLb() + ebound) << ", " << Cost2ADCost(getLb() + bestUb) << std::setprecision(DECIMAL_POINT) << "[ (+" << (100 * change) << "%) (accuracy: " << (100.0 * (Cost2ADCost(getLb() + bestUb) - Cost2ADCost(getLb() + ebound)) / (Cost2ADCost(getLb() + bestUb))) << "%) (iter:" << nIteration << ")" << endl;
}
previousEbound = ebound;
}
......
Supports Markdown
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