Overview | Group | Tree | Graph | Deprecated | Index | Concepts |
Instances of this class define the context in which the CPLEX generic callback can be invoked.
Method Summary | |
---|---|
public void | abort() const |
public IloRange | addUserCut(IloRange cut, IloCplex::CutManagement cutmanagement, IloBool local) const |
public void | exitCutLoop() const |
public IloNum | getCandidateObjective() const |
public IloNum | getCandidatePoint(IloIntVar const & var) const |
public IloNum | getCandidatePoint(IloNumVar const & var) const |
public void | getCandidatePoint(IloIntVarArray const & vars, IloNumArray & vals) const |
public void | getCandidatePoint(IloNumVarArray const & vars, IloNumArray & vals) const |
public IloNum | getCandidateValue(IloExprArg const & expr) const |
public IloNum | getDoubleInfo(Info::Infos what) const |
public IloEnv | getEnv() const |
public IloNum | getGlobalLB(IloIntVar const & var) const |
public IloNum | getGlobalLB(IloNumVar const & var) const |
public void | getGlobalLB(IloIntVarArray const & vars, IloNumArray & vals) const |
public void | getGlobalLB(IloNumVarArray const & vars, IloNumArray & vals) const |
public IloNum | getGlobalUB(IloIntVar const & var) const |
public IloNum | getGlobalUB(IloNumVar const & var) const |
public void | getGlobalUB(IloIntVarArray const & vars, IloNumArray & vals) const |
public void | getGlobalUB(IloNumVarArray const & vars, IloNumArray & vals) const |
public CPXLONG | getId() const |
public IloNum | getIncumbent(IloIntVar const & var) const |
public IloNum | getIncumbent(IloNumVar const & var) const |
public void | getIncumbent(IloIntVarArray const & vars, IloNumArray & vals) const |
public void | getIncumbent(IloNumVarArray const & vars, IloNumArray & vals) const |
public IloNum | getIncumbentObjective() const |
public IloNum | getIncumbentValue(IloExprArg const & expr) const |
public CPXINT | getIntInfo(Info::Infos what) const |
public IloNum | getLocalLB(IloIntVar const & var) const |
public IloNum | getLocalLB(IloNumVar const & var) const |
public void | getLocalLB(IloIntVarArray const & vars, IloNumArray & vals) const |
public void | getLocalLB(IloNumVarArray const & vars, IloNumArray & vals) const |
public IloNum | getLocalUB(IloIntVar const & var) const |
public IloNum | getLocalUB(IloNumVar const & var) const |
public void | getLocalUB(IloIntVarArray const & vars, IloNumArray & vals) const |
public void | getLocalUB(IloNumVarArray const & vars, IloNumArray & vals) const |
public CPXLONG | getLongInfo(Info::Infos what) const |
public IloNum | getRelaxationObjective() const |
public IloNum | getRelaxationPoint(IloIntVar const & var) const |
public IloNum | getRelaxationPoint(IloNumVar const & var) const |
public void | getRelaxationPoint(IloIntVarArray const & vars, IloNumArray & vals) const |
public void | getRelaxationPoint(IloNumVarArray const & vars, IloNumArray & vals) const |
public IloCplex::CplexStatus | getRelaxationStatus(CPXLONG flags) const |
public IloNum | getRelaxationValue(IloExprArg const & expr) const |
public IloBool | inBranching() const |
public IloBool | inCandidate() const |
public IloBool | inGlobalProgress() const |
public IloBool | inLocalProgress() const |
public IloBool | inRelaxation() const |
public IloBool | inThreadDown() const |
public IloBool | inThreadUp() const |
public IloBool | isCandidatePoint() const |
public IloBool | isCandidateRay() const |
public CPXLONG | makeBranch(IloRangeArray const & constraints, IloNum estimate) const |
public CPXLONG | makeBranch(IloIntVar const & branchVar, IloNum bound, IloCplex::BranchDirection dir, IloNum estimate) const |
public CPXLONG | makeBranch(IloNumVar const & branchVar, IloNum bound, IloCplex::BranchDirection dir, IloNum estimate) const |
public CPXLONG | makeBranch(IloIntVarArray const & vars, IloNumArray const & bounds, IloCplex::BranchDirectionArray const & dirs, IloNum estimate) const |
public CPXLONG | makeBranch(IloNumVarArray const & vars, IloNumArray const & bounds, IloCplex::BranchDirectionArray const & dirs, IloNum estimate) const |
public CPXLONG | makeBranch(IloIntVarArray const & vars, IloNumArray const & bounds, IloCplex::BranchDirectionArray const & dirs, IloRangeArray const & constraints, IloNum estimate) const |
public CPXLONG | makeBranch(IloNumVarArray const & vars, IloNumArray const & bounds, IloCplex::BranchDirectionArray const & dirs, IloRangeArray const & constraints, IloNum estimate) const |
public void | postHeuristicSolution(IloIntVarArray const & vars, IloNumArray const & vals, double obj, SolutionStrategy::Types strat) const |
public void | postHeuristicSolution(IloNumVarArray const & vars, IloNumArray const & vals, double obj, SolutionStrategy::Types strat) const |
public void | pruneCurrentNode() const |
public IloRange | rejectCandidate(IloRange violated=0) const |
public void | rejectCandidate(IloRangeArray const & violated) const |
public IloRange | rejectCandidateLocal(IloRange violated) const |
public void | rejectCandidateLocal(IloRangeArray const & violated) const |
Inner structs |
---|
Context::Id |
Context::Info |
Context::SolutionStrategy |
Method Detail |
---|
This method stops optimization. A call of this method instructs CPLEX to halt optimization as soon as possible after the callback returns.
This method adds a user-defined cut.
The method creates a deep copy of all IloRange
instances
passed to it, so you can invoke the method end
on the ranges after the
method returns.
cut |
The cut to add.
|
cutmanagement |
A value from IloCplex::CutManagement that specifies
how CPLEX should manage the cut.
|
local |
A Boolean value specifying whether this cut is locally or globally valid.
|
cut
. This method asks CPLEX to stop cutting plane separation at the current node.
.This method can be invoked only from the context
IloCplex::Callback::Context::Id::Relaxation
;
it throws an exception when invoked from another context.
This method accesses the objective of the current candidate solution.
This method can be invoked only from the context
IloCplex::Callback::Context::Id::Candidate
;
it throws an exception when invoked from another context.
This method is a convenience wrapper for the method
IloCplex::Callback::getCandidatePoint(IloIntVarArray const&, IloNumArray &)
.
(See the documentation of that method for more detail.)
This method retrieves the candidate solution value for a single variable.
var |
The variable for which to query the value.
|
var
in the current candidate solution. This method is a convenience wrapper for the method
IloCplex::Callback::getCandidatePoint(IloNumVarArray const&, IloNumArray & />
.
(See the documentation of that method for more detail.)
This method retrieves the candidate solution value for a single variable.
var |
The variable for which to query the value.
|
var
in the current candidate solution. This method accesses a candidate solution.
It retrieves the values for vars[start]
, . . . , vars[start+length-1]
in the current candidate and returns them.
This method can be invoked only from the context
IloCplex::Callback::Context::Id::Candidate
and if
IloCplex::Callback::Context:isCandidatePoint()
returns true;
it throws an exception when invoked from another context.
vars |
The variables for which values are to be queried.
|
vals |
Where to store the values for the variables in vars .
|
vals
specifies the value for the i-th variable in vars
.
Note that the method resizes vals
appropriately. This method accesses the candidate solution.
It retrieves the values for vars[start]
, . . . , vars[start+length-1]
in the current candidate and returns them.
This method can be invoked only from the context
IloCplex::Callback::Context::Id::Candidate
and if
IloCplex::Callback::Context::isCandidatePoint()
returns true;
it throws an exception when invoked from another context.
vars |
The variables for which values are to be queried.
|
vals |
Where to store the values for the variables in vars .
|
vals
specifies the value for the i-th variable in vars
.
Note that the method resizes vals
appropriately. This method evaluates expr
with respect to the current candidate solution.
This method can be invoked only in the context
IloCplex::Callback::Context::Id::Candidate
and if
IloCplex::Callback::Context::isCandidatePoint()
returns true.
expr |
The expression to evaluate.
|
expr
with respect to the current candidate solution. This method accesses double-precision valued information.
See the documentation of the Info
struct
for details about what information can be queried.
what |
The information to be queried.
|
This method accesses an instance of
IloEnv
that is valid for use during a callback.
Use the environment object returned by this method (instead of
the global instance of IloEnv
) for everything
that your application does in a callback.
This method is a convenience wrapper for the method
IloCplex::Callback::Context::getGlobalLB(IloIntVarArray const&, IloIntArray &)
.
(See the documentation of that method for more detail.)
This method retrieves the global lower bound for a single variable.
var |
The variable for which to query the local bound.
|
var
. This method is a convenience wrapper for the method
IloCplex::Callback::Context::getGlobalLB(IloNumVarArray const&, IloNumArray &)
.
(See the documentation of that method for more detail.)
This method retrieves the global lower bound for a single variable.
var |
The variable for which to query the local bound.
|
var
. This method accesses the global lower bounds for variables. This methods queries the best known globally valid bounds.
This method cannot be invoked from the context
IloCplex::Callback::Context::Id::ThreadUp
or
IloCplex::Callback::Context::Id::ThreadDown
.
vars |
The variables for which lower bounds should be queried.
|
vals |
Where to store the local bounds for the variables in vars .
|
vals
specifies the global bound for the i-th variable in vars
.
Note that the method resizes vals
appropriately. This method accesses the global lower bounds for variables. This methods queries the best known globally valid bounds.
This method cannot be invoked from the context
IloCplex::Callback::Context::Id::ThreadUp
or
IloCplex::Callback::Context::Id::ThreadDown
.
vars |
The variables for which lower bounds should be queried.
|
vals |
Where to store the local bounds for the variables in vars .
|
vals
specifies the global bound for the i-th variable in vars
.
Note that the method resizes vals
appropriately. This method is a convenience wrapper for the method
IloCplex::Callback::Context::getGlobalUB(IloIntVarArray const&, IloNumArray &)
.
(See the documentation of that method for more detail.)
This method retrieves the global upper bound for a single variable.
var |
The variable for which to query the local bound.
|
var
. This method is a convenience wrapper for the method
IloCplex::Callback::Context::getGlobalUB(IloNumVarArray const&, IloNumArray &)' />
.
(See the documentation of that method for more detail.)
This method retrieves the global upper bound for a single variable.
var |
The variable for which to query the local bound.
|
var
. This method accesses the global upper bounds for variables. This method queries the best known globally valid bounds.
This method cannot be invoked from the context
IloCplex::Callback::Context::Id::ThreadUp
or
IloCplex::Callback::Context::Id::ThreadDown
.
vars |
The variables for which upper bounds should be queried.
|
vals |
Where to store the local bounds for the variables in vars .
|
vals
specifies the global bound for the i-th variable in vars
.
Note that the method resizes vals
appropriately. This method accesses the global upper bounds for variables. This method queries the best known globally valid bounds.
This method cannot be invoked from the context
IloCplex::Callback::Context::Id::ThreadUp
or
IloCplex::Callback::Context::Id::ThreadDown
.
vars |
The variables for which upper bounds should be queried.
|
vals |
Where to store the local bounds for the variables in vars .
|
vals
specifies the global bound for the i-th variable in vars
.
Note that the method resizes vals
appropriately. This method accesses the context in which the corresponding callback was invoked.
IloCplex::Callback::Context::Id
that specifies
the context in which this instance was invoked. This method is a convenience wrapper for the method
IloCplex::Callback::getIncumbent(IloIntVarArray const&, IloNumArray &)
.
(See the documentation of that method for more detail.)
This method retrieves the incumbent solution value for a single variable.
var |
The variable for which to query the value.
|
var
in the current incumbent solution. This method is a convenience wrapper for the method
IloCplex::Callback::getIncumbent(IloNumVarArray const&, IloNumArray &)
.
(See the documentation of that method for more detail.)
This method retrieves the incumbent solution value for a single variable.
var |
The variable for which to query the value.
|
var
in the current incumbent solution. This method accesses the current incumbent solution.
It retrieves the values for vars[start]
, . . . , vars[start+length-1]
in the current incumbent solution and returns them.
The method raises an exception if there is no incumbent solution
available. Use the method
IloCplex::Callback::getIntInfo
with the value Info::Feasible
to check whether an incumbent is available.
vars |
The variables for which incumbent values are to be queried.
|
vals |
Where to store the values for the variables in vars .
|
vals
specifies the value for the i-th variable in vars
.
Note that the method resizes vals
appropriately. This method accesses the current incumbent solution.
It retrieves the values for vars[start]
, . . . , vars[start+length-1]
in the current incumbent solution and returns them.
The method raises an exception if there is no incumbent solution
available. Use the method
IloCplex::Callback::getIntInfo
with the value Info::Feasible
to check whether an incumbent is available.
vars |
The variables for which incumbent values are to be queried.
|
vals |
Where to store the values for the variables in vars .
|
vals
specifies the value for the i-th variable in vars
.
Note that the method resizes vals
appropriately. This method access the objective value for the current incumbent.
This method evaluates expr
with respect to the current incumbent solution.
expr |
The expression to evaluate.
|
expr
with respect to the current incumbent solution. This method accesses 32-bit, signed, integer-valued information.
See the documentation of the Info
struct
for details about what information can be queried.
what |
The information to be queried.
|
This method is a convenience wrapper for the method
IloCplex::Callback::Context::getLocalLB(IloIntVarArray const&, IloIntArray &)
.
(See the documentation of that method for more detail.)
This method retrieves the local lower bound for a single variable.
var |
The variable for which to query the local bound.
|
var
. This method is a convenience wrapper for the method
IloCplex::Callback::Context::getLocalLB(IloNumVarArray const&, IloNumArray &)
.
(See the documentation of that method for more detail.)
This method retrieves the local lower bound for a single variable.
var |
The variable for which to query the local bound.
|
var
. This method accesses the local lower bounds for variables. This methods queries the local bounds that were in place when the current relaxation was computed. These bounds can be tighter than global bounds due to presolve, branching, and other activity.
This method can be invoked only from the context
IloCplex::Callback::Context::Id::Relaxation
;
it throws an exception when invoked from another context.
vars |
The variables for which lower bounds should be queried.
|
vals |
Where to store the local bounds for the variables in vars .
|
vals
specifies the local bound for the i-th variable in vars
.
Note that the method resizes vals
appropriately. This method accesses the local lower bounds for variables. This methods queries the local bounds that were in place when the current relaxation was computed. These bounds can be tighter than global bounds due to presolve, branching, and other activity.
This method can be invoked only from the context
IloCplex::Callback::Context::Id::Relaxation
;
it throws an exception when invoked from another context.
vars |
The variables for which lower bounds should be queried.
|
vals |
Where to store the local bounds for the variables in vars .
|
vals
specifies the local bound for the i-th variable in vars
.
Note that the method resizes vals
appropriately. This method is a convenience wrapper for the method
IloCplex::Callback::Context::getLocalUB(IloIntVarArray const&, IloNumArray &)
.
(See the documentation of that method for more detail.)
This method retrieves the local upper bound for a single variable.
var |
The variable for which to query the local bound.
|
var
. This method is a convenience wrapper for the method
IloCplex::Callback::Context::getLocalUB(IloNumVarArray const&, IloNumArray &)' />
.
(See the documentation of that method for more detail.)
This method retrieves the local upper bound for a single variable.
var |
The variable for which to query the local bound.
|
var
. This method accesses the local upper bounds for variables. This method queries the local bounds that were in place when the current relaxation was computed. These bounds may be tighter than global bounds due to presolve, branching, and other activity.
This method can be invoked only from the context
IloCplex::Callback::Context::Id::Relaxation
;
it throws an exception when invoked from another context.
vars |
The variables for which upper bounds should be queried.
|
vals |
Where to store the local bounds for the variables in vars .
|
vals
specifies the local bound for the i-th variable in vars
.
Note that the method resizes vals
appropriately. This method accesses the local upper bounds for variables. This method queries the local bounds that were in place when the current relaxation was computed. These bounds may be tighter than global bounds due to presolve, branching, and other activity.
This method can be invoked only from the context
IloCplex::Callback::Context::Id::Relaxation
;
it throws an exception when invoked from another context.
vars |
The variables for which upper bounds should be queried.
|
vals |
Where to store the local bounds for the variables in vars .
|
vals
specifies the local bound for the i-th variable in vars
.
Note that the method resizes vals
appropriately. This method accesses 64-bit, signed, integer-valued information.
See the documentation of the Info
struct
for details about what information can be queried.
what |
The information to be queried.
|
This method accesses the objective of the current relaxation.
This method can be invoked only from the context
IloCplex::Callback::Context::Id::Relaxation
or
IloCplex::Callback::Context::Id::Branching
;
it throws an exception when invoked from another context.
This method is a convenience wrapper for the method
IloCplex::Callback::getRelaxationPoint(IloIntVarArray const&, IloNumArray &)
.
(See the documentation of that method for more detail.)
This method retrieves the relaxation solution value for a single variable.
var |
The variable for which to query the value.
|
var
in the current relaxation solution. This method is a convenience wrapper for the method
IloCplex::Callback::getRelaxationPoint(IloNumVarArray const&, IloNumArray &)
.
(See the documentation of that method for more detail.)
This method retrieves the relaxation solution value for a single variable.
var |
The variable for which to query the value.
|
var
in the current relaxation solution. This method accesses the current relaxation.
It retrieves the values for
vars[start]
, . . . , vars[start+length-1]
in the current relaxation and returns them.
This method can be invoked only from the context
IloCplex::Callback::Context::Id::Relaxation
or
IloCplex::Callback::Context::Id::Branching
;
it throws an exception when invoked from another context.
vars |
The variables for which relaxation values are to be queried.
|
vals |
Where to store the values for the variables in vars .
|
vals
will specify the value for the i-th variable in vars
.
Note that the method resizes vals
appropriately. This method accesses the current relaxation.
It retrieves the values for
vars[start]
, . . . , vars[start+length-1]
in the current relaxation and returns them.
This method can be invoked only from the context
IloCplex::Callback::Context::Id::Relaxation
or
IloCplex::Callback::Context::Id::Branching
;
it throws an exception when invoked from another context.
vars |
The variables for which relaxation values are to be queried.
|
vals |
Where to store the values for the variables in vars .
|
vals
will specify the value for the i-th variable in vars
.
Note that the method resizes vals
appropriately. This method accesses the solution status of the current
continous solution.
See the documentation of CPXXcallbackgetrelaxationstatus
in the callable library reference manual for further details.
This method can be invoked only from the context
IloCplex::Callback::Context::Id::Relaxation
or
IloCplex::Callback::Context::Id::Branching
;
it throws an exception when invoked from another context.
CPXXcallbackgetrelaxationstatus
for values that can be passed here.
flags |
See the documentation of
CPXXcallbackgetrelaxationstatus
for values that can be passed here.
|
This method evaluates expr
with respect
to the current relaxation.
This method can be invoked only in the context
IloCplex::Callback::Context::Id::Relaxation
or
IloCplex::Callback::Context::Id::Branching
.
expr |
The expression to evaluate.
|
expr
with respect to the current relaxation. This method tests whether the callback was invoked in the context
IloCplex::Callback::Context::Id::Branching
.
It is a shortcut for
getId() == IloCplex::Callback::Context::Id::Branching
true
if the callback was invoked in the context
IloCplex::Callback::Context::Id::Branching
and
false
otherwise. This method tests whether the callback was invoked in the context
IloCplex::Callback::Context::Id::Candidate
.
It is a shortcut for
getId() == IloCplex::Callback::Context::Id::Candidate
true
if the callback was invoked in the context
IloCplex::Callback::Context::Id::Candidate
and
false
otherwise. This method tests whether the callback was invoked in the context
IloCplex::Callback::Context::Id::GlobalProgress
.
It is a shortcut for
getId() == IloCplex::Callback::Context::Id::GlobalProgress
true
if the callback was invoked in the context
IloCplex::Callback::Context::Id::GlobalProgress
and
false
otherwise. This method tests whether the callback was invoked in the context
IloCplex::Callback::Context::Id::LocalProgres
.
It is a shortcut for
getId() == IloCplex::Callback::Context::Id::LocalProgress
true
if the callback was invoked in the context
IloCplex::Callback::Context::Id::LocalProgress
and
false
otherwise. This method tests whether the callback was invoked in the context
IloCplex::Callback::Context::Id::Relaxation
.
It is a shortcut for
getId() == IloCplex::Callback::Context::Id::Relaxation
true
if the callback was invoked in the context
IloCplex::Callback::Context::Id::Relaxation
and
false
otherwise. This method tests whether the callback was invoked in the context
IloCplex::Callback::Context::Id::ThreadDown
.
It is a shortcut for
getId() == IloCplex::Callback::Context::Id::ThreadDown
true
if the callback was invoked in the context
IloCplex::Callback::Context::Id::ThreadDown
and
false
otherwise. This method tests whether the callback was invoked in the context
IloCplex::Callback::Context::Id::ThreadUp
.
It is a shortcut for
getId() == IloCplex::Callback::Context::Id::ThreadUp
true
if the callback was invoked in the context
IloCplex::Callback::Context::Id::ThreadUp
and
false
otherwise. This method tests whether the callback was invoked in context
IloCplex::Callback::Context::Id::Candidate
with a
candidate feasible point.
If the function returns true, then you can call
IloCplex::Callback::Context::getCandidatePoint()
,
IloCplex::Callback::Context::getCandidateValue()
, and
IloCplex::Callback::Context::getCandidateObjective()
to query the potentially feasible point.
This method tests whether the callback was invoked in context
IloCplex::Callback::Context::Id::Candidate
with an
unbounded ray.
If the function returns true, then you can call
IloCplex::Callback::Context::getCandidateRay()
to query the unbounded ray.
Convenience wrapper for
makeBranch(IloIntVarArray const &, IloNumArray const &, IloCplex::BranchDirectionArray const &, IloRangeArray const &, IloNum)
.
The function creates a branch that is defined only by a set of constraints.
Convenience wrapper for
makeBranch(IloIntVarArray const &, IloNumArray const &, IloCplex::BranchDirectionArray const &, IloRangeArray const &, IloNum)
.
The function creates a branch that is defined by only branching on a single variable.
Convenience wrapper for
makeBranch(IloNumVarArray const &, IloNumArray const &, IloCplex::BranchDirectionArray const &, IloRangeArray const &, IloNum)
.
The function creates a branch that is defined by only branching on a single variable.
Convenience wrapper for
makeBranch(IloIntVarArray const &, IloNumArray const &, IloCplex::BranchDirectionArray const &, IloRangeArray const &, IloNum)
.
The function creates a branch that is defined only by bound changes.
Convenience wrapper for
makeBranch(IloNumVarArray const &, IloNumArray const &, IloCplex::BranchDirectionArray const &, IloRangeArray const &, IloNum)
.
The function creates a branch that is defined only by bound changes.
This method creates a custom branch at the current node.
The method creates the branch as specified by the arguments.
It is fine to branch only on variables (in which case
constraints
can be empty) or only on constraints
(in which case vars
, bounds
,
dirs
can be empty).
This method can be invoked only from the context
IloCplex::Callback::Context::Id::Branching
;
it throws an exception when invoked from another context.
At most two branches can be created at a node.
vars
. The elements in this array must be
in 1-to-1-correspondence with the elements in
vars
.
The elements in this array must be
in 1-to-1-correspondence with the elements in
vars
. If the direction is
IloCplex::BranchUp
then the corresponding
element in bounds
specifies a lower bound
on the corresponding variable in vars
,
otherwise it specifies an upper bound.
of the new child. Often a reasonable choice is the
objective value of the current node's relaxation.
vars |
The variables on which to branch.
|
bounds |
The bounds for branching on the variables in
vars . The elements in this array must be
in 1-to-1-correspondence with the elements in
vars .
|
dirs |
The branching directions for the variables.
The elements in this array must be
in 1-to-1-correspondence with the elements in
vars . If the direction is
IloCplex::BranchUp then the corresponding
element in bounds specifies a lower bound
on the corresponding variable in vars ,
otherwise it specifies an upper bound.
|
constraints |
The constraints on which to branch.
|
estimate |
An estimate for the objective value of the relaxation
of the new child. Often a reasonable choice is the
objective value of the current node's relaxation.
|
IloCplex::Callback::Context::Info:NodeUID
. This method creates a custom branch at the current node.
The method creates the branch as specified by the arguments.
It is fine to branch only on variables (in which case
constraints
can be empty) or only on constraints
(in which case vars
, bounds
,
dirs
can be empty).
This method can be invoked only from the context
IloCplex::Callback::Context::Id::Branching
;
it throws an exception when invoked from another context.
At most two branches can be created at a node.
vars
. The elements in this array must be
in 1-to-1-correspondence with the elements in
vars
.
The elements in this array must be
in 1-to-1-correspondence with the elements in
vars
. If the direction is
IloCplex::BranchUp
then the corresponding
element in bounds
specifies a lower bound
on the corresponding variable in vars
,
otherwise it specifies an upper bound.
of the new child. Often a reasonable choice is the
objective value of the current node's relaxation.
vars |
The variables on which to branch.
|
bounds |
The bounds for branching on the variables in
vars . The elements in this array must be
in 1-to-1-correspondence with the elements in
vars .
|
dirs |
The branching directions for the variables.
The elements in this array must be
in 1-to-1-correspondence with the elements in
vars . If the direction is
IloCplex::BranchUp then the corresponding
element in bounds specifies a lower bound
on the corresponding variable in vars ,
otherwise it specifies an upper bound.
|
constraints |
The constraints on which to branch.
|
estimate |
An estimate for the objective value of the relaxation
of the new child. Often a reasonable choice is the
objective value of the current node's relaxation.
|
IloCplex::Callback::Context::Info:NodeUID
. This method posts a (heuristic) solution to CPLEX. Specifically, the method posts a solution vector to CPLEX. The vector is queued internally. Before CPLEX invokes a heuristic, CPLEX looks at the queue and attempts to create a feasible solution from each vector. This activity can result in new incumbent solutions.
vars |
Variables that constitute the solution to be posted.
|
vals |
Values for variables in vars .
|
obj |
(Estimated) objective value for the new solution.
|
strat |
Strategy for completing partial solutions.
|
This method posts a (heuristic) solution to CPLEX. Specifically, the method posts a solution vector to CPLEX. The vector is queued internally. Before CPLEX invokes a heuristic, CPLEX looks at the queue and attempts to create a feasible solution from each vector. This activity can result in new incumbent solutions.
vars |
Variables that constitute the solution to be posted.
|
vals |
Values for variables in vars .
|
obj |
(Estimated) objective value for the new solution.
|
strat |
Strategy for completing partial solutions.
|
This method prunes the current search tree node.
The node for which the callback was invoked is pruned, no further
children are created from it. Subsequent calls to
makeBranch
for this node are ignored.
This method can be invoked only from the context
IloCplex::Callback::Context::Id::Relaxation
or
IloCplex::Callback::Context::Id::Branching
;
it throws an exception when invoked from another context.
This method rejects the current candidate solution.
This method is a convenience wrapper for the method
IloCplex::Callback::rejectCandidate(IloRangeArray)
.
(See the documentation of that method for more detail.)
The method creates a deep copy of the IloRange
instance
passed to it, so you can invoke the end
method after this
method returns.
null
.
violated |
A constraint that cuts off the candidate solution. This argument
can be null .
|
violated
. This method rejects the current candidate solution.
This method can be invoked only from the context
IloCplex::Callback::Context::Id::Candidate
;
it throws an exception when invoked from another context.
The function creates a deep copy of all IloRange
instances
passed to it, so it is ok to invoke the method end
on those
ranges after the function returns.
null
.
If not null
and not empty, then CPLEX may use
these constraints to cut off further candidate solutions that
it finds. (There is no guarantee that it does so, though.)
These constraints are essentially lazy constraints.
None of the elements in this array is allowed to be an
empty handle (use an empty array to reject without
constraints),
violated |
A potentially empty set of constraints that cut off
the candidate solution. This argument may also be null .
If not null and not empty, then CPLEX may use
these constraints to cut off further candidate solutions that
it finds. (There is no guarantee that it does so, though.)
These constraints are essentially lazy constraints.
None of the elements in this array is allowed to be an
empty handle (use an empty array to reject without
constraints),
|
This method rejects the current candidate solution.
This method is a convenience wrapper for the method
IloCplex::Callback::rejectCandidateLocal(IloRangeArray)
.
(See the documentation of that method for more detail.)
The method creates a deep copy of the IloRange
instance
passed to it, so you can invoke the end
method after this
method returns.
violated |
A constraint that cuts off the candidate solution locally.
|
violated
. This method rejects the current candidate solution.
This method can be invoked only from the context
IloCplex::Callback::Context::Id::Candidate
and only
if the callback was invoked for an integral node
(see CandidateSource
);
it throws an exception when invoked from another context.
The function creates a deep copy of all IloRange
instances
passed to it, so it is ok to invoke the method end
on those
ranges after the function returns.
The passed constraints are not required to be globally valid. CPLEX only assumes them to be valid in the subtree in which the callback was invoked.
The parameter violated
is a potentially empty set of
constraints that cut off the candidate solution. This argument may also
be null
. If not null
and not empty,
then CPLEX may use these constraints to cut off further candidate solutions
that it finds. (There is no guarantee that it does so, though.)
These constraints are essentially lazy constraints.
None of the elements in this array is allowed to be an
empty handle (use an empty array to reject without
constraints). The constraints are not required to be
globally valid. CPLEX only assumes them to be valid
in the subtree in which the callback was invoked.
Inner Struct Detail |
---|
This struct
designates places in which
a CPLEX generic callback can be invoked.
The values defined here specify in which contexts CPLEX can invoke a
callback. They are used in two different ways:
IloCplex::Callback::Function::invoke
to specify in which
context the callback has just been invoked.IloCplex::use(Callback::Function, long)
to
specify in which places CPLEX should invoke the registered callback.For details about the various context values, see the reference manual of the Callable Library (C API).
Important notes about the ThreadDown
context:
ThreadUp
context throws an
exception, then ThreadDown
will not be invoked
on this thread.ThreadDown
. Any exception thrown in this
context will be ignored.Think of ThreadUp
and ThreadDown
as
"constructor" and "destructor": the destructor is invoked only if the
object was fully constructed and is not allowed to throw an exception.
Attribute Summary | |
---|---|
static CPXLONG const | Branching |
static CPXLONG const | Candidate |
static CPXLONG const | GlobalProgress |
static CPXLONG const | LocalProgress |
static CPXLONG const | Relaxation |
static CPXLONG const | ThreadDown |
static CPXLONG const | ThreadUp |
Attribute Detail |
---|
See the documentation of CPX_CALLBACKCONTEXT_BRANCHING
in the reference manual of the Callable Library (C API).
See the documentation of CPX_CALLBACKCONTEXT_CANDIDATE
in the reference manual of the Callable Library (C API).
See the documentation of CPX_CALLBACKCONTEXT_GLOBAL_PROGRESS
in the reference manual of the Callable Library (C API).
See the documentation of CPX_CALLBACKCONTEXT_LOCAL_PROGRESS
in the reference manual of the Callable Library (C API).
See the documentation of CPX_CALLBACKCONTEXT_RELAXATION
in the reference manual of the Callable Library (C API).
See the documentation of CPX_CALLBACKCONTEXT_THREAD_DOWN
in the reference manual of the Callable Library (C API).
See the documentation of CPX_CALLBACKCONTEXT_THREAD_UP
in the reference manual of the Callable Library (C API).
This struct
provides an enum
of
identifiers for the kinds of information that you can
retrieve from a generic callback by invoking one (or more)
of the generic callback informational methods.
Inner Enumeration |
---|
Info::Infos |
Inner Enumeration Detail |
---|
This enum
identifies the kinds of information
that your application can retrieve from a generic callback
by means of the methods
IloCple::Callback::getIntInfo(Info)
,
IloCplex::Callback::getLongInfo(Info)
, or
IloCplex::Callback::getDoubleInfo(Info)
.
See documentation of the enumeration CPXCALLBACKINFO
in
the reference manual of the Callable Library (C API)
for further details about these values.
Fields |
---|
ThreadId = CPXCALLBACKINFO_THREADID |
See CPXCALLBACKINFO_THREADID in the callable library reference manual.
|
NodeCount = CPXCALLBACKINFO_NODECOUNT |
See CPXCALLBACKINFO_NODECOUNT in the callable library reference manual.
|
IterationCount = CPXCALLBACKINFO_ITCOUNT |
See CPXCALLBACKINFO_ITCOUNT in the callable library reference manual.
|
BestSolution = CPXCALLBACKINFO_BEST_SOL |
See CPXCALLBACKINFO_BEST_SOL in the callable library reference manual.
|
BestBound = CPXCALLBACKINFO_BEST_BND |
See CPXCALLBACKINFO_BEST_BND in the callable library reference manual.
|
Threads = CPXCALLBACKINFO_THREADS |
See CPXCALLBACKINFO_THREADS in the callable library reference manual.
|
Feasible = CPXCALLBACKINFO_FEASIBLE |
See CPXCALLBACKINFO_FEASIBLE in the callable library reference manual.
|
Time = CPXCALLBACKINFO_TIME |
See CPXCALLBACKINFO_TIME in the callable library reference manual.
|
DeterministicTime = CPXCALLBACKINFO_DETTIME |
See CPXCALLBACKINFO_DETTIME in the callable library reference manual.
|
NodeUID = CPXCALLBACKINFO_NODEUID |
See CPXCALLBACKINFO_NODEUID in the callable library reference manual.
|
NodeDepth = CPXCALLBACKINFO_NODEDEPTH |
See CPXCALLBACKINFO_NODEDEPTH in the callable library reference manual.
|
CandidateSource = CPXCALLBACKINFO_CANDIDATE_SOURCE |
See CPXCALLBACKINFO_CANDIDATE_SOURCE in the callable library reference manual.
|
Restarts = CPXCALLBACKINFO_RESTARTS AfterCutLoop = CPXCALLBACKINFO_AFTERCUTLOOP |
See CPXCALLBACKINFO_RESTARTS in the callable library reference manual.
|
NodesLeft = CPXCALLBACKINFO_NODESLEFT |
See CPXCALLBACKINFO_NODESLEFT in the callable library reference manual.
|
This struct
defines an enum
that provides identifiers for the
various completion strategies that can be passed to the method
IloCplex::Callback::Context::postHeuristicSolution
.
For more detail, see the documentation of the enumeration
CPXCALLBACKSOLUTIONSTRATEGY
in the reference manual
of the Callable Library (C API) of CPLEX.
Inner Enumeration |
---|
SolutionStrategy::Types |
Inner Enumeration Detail |
---|
This enum
identifies completion strategies
for CPLEX to use with the method
IloCplex::Callback::Context::postHeuristicSolution
.
If you pass a complete solution to this method, that is, the solution specifies a value for every variable in the model, then CPLEX can check the feasibility of that complete solution.
Possibly the arguments that you passed to that method specify only a partial solution. In such a case, CPLEX can attempt to complete the partial solution by means of bound propagation.
For more detail about these completion strategies, see the documentation
of the enumeration CPXCALLBACKSOLUTIONSTRATEGY
in the reference
manual of the Callable Library (C API) of CPLEX.
Fields |
---|
NoCheck = CPXCALLBACKSOLUTION_NOCHECK |
See CPXCALLBACKSOLUTION_NOCHECK in the callable library reference manual.
|
CheckFeasible = CPXCALLBACKSOLUTION_CHECKFEAS |
See CPXCALLBACKSOLUTION_CHECKFEAS in the callable library reference manual.
|
Propagate = CPXCALLBACKSOLUTION_PROPAGATE |
See CPXCALLBACKSOLUTION_PROPAGATE in the callable library reference manual.
|
Solve = CPXCALLBACKSOLUTION_SOLVE |
See CPXCALLBACKSOLUTION_SOLVE in the callable library reference manual.
|