Overview | Group | Tree | Graph | Index | Concepts |
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
IloAnyTernaryPredicate::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,
IloAnyTernaryPredicate
, and an implementation class, such as
IloAnyTernaryPredicateI
, 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
IloAnyTernaryPredicateI
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 IloAnyTernaryPredicate
.
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
IloAnyTernaryPredicate::isTrue
must check) must be three.
See Also:
Constructor and Destructor Summary | |
---|---|
public | IloAnyTernaryPredicate() |
public | IloAnyTernaryPredicate(IloAnyTernaryPredicateI *) |
Method Summary | |
---|---|
public IloAnyTernaryPredicateI * | getImpl() |
public IloBool | isTrue(const IloAny, const IloAny, const IloAny) |
public void | operator=(const IloAnyTernaryPredicate &) |
Constructor and Destructor Detail |
---|
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. Any attempt to access it
before this assignment will throw an exception (an instance of
IloSolver::SolverErrorException
).
This constructor creates a handle object (an instance of the class
IloAnyTernaryPredicate
) from a pointer to an implementation object (an instance
of the implementation class IloAnyTernaryPredicateI
).
Method Detail |
---|
This member function returns a pointer to the implementation object of the invoking handle.
This member function returns IloTrue
if the values val1
,
val2
, and val3
make the invoking ternary predicate valid. It
returns IloFalse
otherwise.
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.