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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

IloCplex::HeuristicCallbackI<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 IloNumVarArray 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 IloBool solve(IloCplex::Algorithm alg)<br />

This method can be used to solve the current node relaxation, usually after some bounds<br />

have been changed using setBounds. By default it uses the dual simplex algorithm,<br />

but this can be overwritten using the optional parameter alg. See the enumeration<br />

IloCplex::Algorithm for a list of the available optimizers.<br />

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

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

Saved successfully!

Ooh no, something went wrong!