NO FRAMES

Class IloCplex::Goal

Definition file: ilcplex/ilocplexi.h
Note

This is an advanced class. Advanced classes typically demand a profound understanding of the algorithms used by ILOG CPLEX. Thus they incur a higher risk of incorrect behavior in your application, behavior that can be difficult to debug. Therefore, ILOG encourages you to consider carefully whether you can accomplish the same task by means of other classes instead.

Goals can be used to control the branch & cut search in IloCplex. Goals are implemented in the class IloCplex::GoalI. This is the handle class for CPLEX goals.

Goal objects are reference-counted. This means every instance of IloCplex::GoalI keeps track about how many handle objects refer to it. If this number drops to 0 (zero) the IloCplex::GoalI object is automatically deleted. As a consequence, whenever you deal with a goal, you must keep a handle object around, rather than only a pointer to the implementation object. Otherwise, you risk ending up with a pointer to an implementation object that has already been deleted.

See Goals among the Concepts in this manual. See also goals in the ILOG CPLEX User's Manual.

Constructor and Destructor Summary
public Goal(IloCplex::GoalBaseI * goalI)
public Goal(const Goal & goal)
public Goal()
public Goal(IloConstraint cut)
public Goal(IloConstraintArray cut)
Method Summary
public Goaloperator=(const Goal & goal)
Constructor and Destructor Detail

Goal

public Goal(IloCplex::GoalBaseI * goalI)

Creates a new goal from a pointer to the implementation object.


Goal

public Goal(const Goal & goal)

This is the copy constructor of the goal.


Goal

public Goal()

Creates a 0 goal handle, that is, a goal with a 0 implementation object pointer. This is also referred to as an empty goal.


Goal

public Goal(IloConstraint cut)

Creates a new goal that will add the constraint cut as a local cut to the node where the goal is executed. As a local cut, the constraint will be active only in the subtree rooted at the node where the goal was executed. The lifetime of the constraint passed to a goal is tied to the lifetime of the Goal. That is, the constraint's method end is called when the goal's implementation object is deleted. As a consequence, the method end must not be called for constraints passed to this constructor explicitly.


Goal

public Goal(IloConstraintArray cut)

Creates a new goal that adds the constraints given in the array cut as local cuts to the node where the goal is executed. As local cuts, the constraints will be active only in the subtree rooted at the node where the goal was executed. The lifetime of the constraints and the array passed to a goal is tied to the lifetime of the Goal. That is, the constraint's method end is called when the goal's implementation object is deleted. As a consequence, method end must not be called for the constraints and the array passed to this constructor explicitly.


Method Detail

operator=

public Goal operator=(const Goal & goal)

This is the assignment operator. It increases the reference count of the implementation object of goal. If the invoking handle referred to an implementation object before the assignment operation, its reference count is decreased. If thereby the reference count becomes 0, the implementation object is deleted.