30.01.2015 Views

ILOG CPLEX C++ API 9.0 Reference Manual

ILOG CPLEX C++ API 9.0 Reference Manual

ILOG CPLEX C++ API 9.0 Reference Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

IloCplex::HeuristicCallbackI<br />

This method sets the lower bound to lb and the upper bound to ub for the variable var<br />

at the current node. Setting bounds has no effect beyond the scope of the current<br />

invocation of the callback.<br />

protected void setSolution(const IloIntVarArray vars,<br />

const IloNumArray vals,<br />

IloNum obj)<br />

For each variable in the array vars, this method uses the value in the corresponding<br />

element of the array vals to define a heuristic solution to be considered as a new<br />

incumbent.<br />

If the user heuristic was successful in finding a new candidate for an incumbent,<br />

setSolution can be used to pass it over to IloCplex. IloCplex then analyses<br />

the solution and, if it is both feasible and better than the current incumbent, uses it as<br />

the new incumbent. A solution is specified using arrays vars and vals, where<br />

vals[i] specifies the solution value for vars[i].<br />

The parameter obj is used to tell IloCplex the objective value of the injected<br />

solution. This allows IloCplex to skip the computation of that value, but care must<br />

be taken not to provide an incorrect value.<br />

protected void setSolution(const IloIntVarArray vars,<br />

const IloNumArray vals)<br />

For each variable in the array vars, this method uses the value in the corresponding<br />

element of the array vals to define a heuristic solution to be considered as a new<br />

incumbent.<br />

If the user heuristic was successful in finding a new candidate for an incumbent,<br />

setSolution can be used to pass it over to IloCplex. IloCplex then analyses<br />

the solution and, if it is both feasible and better than the current incumbent, uses it as<br />

the new incumbent. A solution is specified using arrays vars and vals, where<br />

vals[i] specifies the solution value for vars[i].<br />

protected void setSolution(const IloNumVarArray vars,<br />

const IloNumArray vals,<br />

IloNum obj)<br />

For each variable in the array vars, this method uses the value in the corresponding<br />

element of the array vals to define a heuristic solution to be considered as a new<br />

incumbent.<br />

If the user heuristic was successful in finding a new candidate for an incumbent,<br />

setSolution can be used to pass it over to IloCplex. IloCplex then analyses<br />

the solution and, if it is both feasible and better than the current incumbent, uses it as<br />

the new incumbent. A solution is specified using arrays vars and vals, where<br />

vals[i] specifies the solution value for vars[i].<br />

<strong>ILOG</strong> <strong>CPLEX</strong> <strong>C++</strong> <strong>API</strong> <strong>9.0</strong> REFERENCE M ANUAL 155

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!