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

[error] bug correction in preprocessing (a contradiction was reporting a false optimal solution)

parent 655f625e
// Cmake generated version
#define Toulbar_VERSION "1.0.1-master-tainted (1544823438)"
#define Toulbar_VERSION "1.0.1-master-tainted (1547114766)"
......@@ -444,6 +444,7 @@ public:
void solution_XML(bool opt = false); ///< \brief output solution in Max-CSP 2008 output format
void solution_UAI(Cost res); ///< \brief output solution in UAI 2008 output format
const Cost getSolutionCost() {return solutionCost;}
const vector<Value>& getSolution(Cost* cost_ptr)
{
if (cost_ptr != NULL)
......
......@@ -1864,8 +1864,8 @@ bool Solver::solve()
} catch (NbSolutionsOut) {
}
// Store::restore(); // see above for Store::store()
endSolve(wcsp->getUb() < initialUpperBound, wcsp->getUb(), !ToulBar2::limited);
return (ToulBar2::isZ || ToulBar2::allSolutions || wcsp->getUb() < initialUpperBound);
endSolve(wcsp->getSolutionCost() < initialUpperBound, wcsp->getSolutionCost(), !ToulBar2::limited);
return (ToulBar2::isZ || ToulBar2::allSolutions || wcsp->getSolutionCost() < initialUpperBound);
}
void Solver::endSolve(bool isSolution, Cost cost, bool isComplete)
......
......@@ -366,6 +366,7 @@ public:
virtual void read_wcnf(const char* fileName) = 0; ///< \brief load problem in (w)cnf format (see http://www.maxsat.udl.cat/08/index.php?disp=requirements)
virtual void read_qpbo(const char* fileName) = 0; ///< \brief load quadratic pseudo-Boolean optimization problem in unconstrained quadratic programming text format (first text line with n, number of variables and m, number of triplets, followed by the m triplets (x,y,cost) describing the sparse symmetric nXn cost matrix with variable indexes such that x <= y and any positive or negative real numbers for costs)
virtual const Cost getSolutionCost() = 0; ///< \brief returns current best solution cost or MAX_COST if no solution found
virtual const vector<Value>& getSolution(Cost* cost_ptr = NULL) = 0; ///< \brief returns current best solution and its cost
virtual void setSolution(Cost cost, TAssign* sol = NULL) = 0; ///< \brief set best solution from current assigned values or from a given assignment (for BTD-like methods)
virtual void printSolution(ostream& os) = 0; ///< \brief prints current best solution
......
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