NO FRAMES

Class IloIntTernaryPredicate

Definition file: ilconcert/ilotupleset.h

This class makes it possible for you to define ternary predicates operating on arbitrary objects in a model. A predicate is an object with a member function (such as IloIntTernaryPredicate::isTrue) that checks whether or not a property is satisfied by an ordered set of (pointers to) objects. A ternary predicate checks an ordered set of three objects.

Defining a New Class of Predicates

Predicates, like other Concert Technology objects, depend on two classes: a handle class, IloIntTernaryPredicate, and an implementation class, such as IloIntTernaryPredicateI, where an object of the handle class contains a data member (the handle pointer) that points to an object (its implementation object) of an instance of IloIntTernaryPredicateI allocated in a Concert Technology environment. As a Concert Technology user, you will be working primarily with handles.

If you define a new class of predicates yourself, you must define its implementation class together with the corresponding virtual member function isTrue, as well as a member function that returns an instance of the handle class IloIntTernaryPredicate.

Arity

As a developer, you can use predicates in Concert Technology applications to define your own constraints that have not already been predefined in Concert Technology. In that case, the arity of the predicate (that is, the number of constrained variables involved in the predicate, and thus the size of the array that the member function IloIntTernaryPredicate::isTrue must check) must be three.

See Also:

Constructor and Destructor Summary
public IloIntTernaryPredicate()
public IloIntTernaryPredicate(IloIntTernaryPredicateI *)
Method Summary
public IloIntTernaryPredicateI *getImpl()
public IloBoolisTrue(const IloInt, const IloInt, const IloInt)
public voidoperator=(const IloIntTernaryPredicate &)
Constructor and Destructor Detail

IloIntTernaryPredicate

public IloIntTernaryPredicate()

This constructor creates an empty ternary predicate. In other words, the predicate is an empty handle with a null handle pointer. You must assign the elements of the predicate before you attempt to access it, just as you would any other pointer. An attempt to access it before this assignment will throw an exception (an instance of IloSolver::SolverErrorException).


IloIntTernaryPredicate

public IloIntTernaryPredicate(IloIntTernaryPredicateI * impl)

This constructor creates a handle object (an instance of the class IloIntTernaryPredicate) from a pointer to an implementation object (an instance of the implementation class IloIntTernaryPredicateI).


Method Detail

getImpl

public IloIntTernaryPredicateI * getImpl()

This member function returns a pointer to the implementation object of the invoking handle.


isTrue

public IloBool isTrue(const IloInt val1, const IloInt val2, const IloInt val3)

This member function returns IloTrue if the values val1, val2, and val3 make the invoking ternary predicate valid. It returns IloFalse otherwise.


operator=

public void operator=(const IloIntTernaryPredicate & h)

This assignment operator copies h into the invoking predicate by assigning an address to the handle pointer of the invoking object. That address is the location of the implementation object of the argument h. After execution of this operator, both the invoking predicate and h point to the same implementation object.