IBM ILOG Solver User's Manual > Extending the Library > Writing a Constraint: Allocating Frequencies > Writing your own constraint > Using ILOCPCONSTRAINTWRAPPER to wrap constraints |
Using ILOCPCONSTRAINTWRAPPER to wrap constraints |
INDEX
![]() |
You can use the macro ILOCPCONSTRAINTWRAPPER
to wrap an existing instance of IlcConstraint
when you want to use it within Concert Technology model objects.
This macro defines a constraint class named _thisI
with n data members. When n is greater than zero, the types and names of the data members must be supplied as arguments to the macro. Each data member is defined by its type t
i and a name a
i.
In order to use an instance of IlcConstraint
in this way, you need to follow these steps:
IlcConstraint
in an instance of IloConstraint
.
IloSolver
by calling the member function IloSolver::extract
. During extraction, IloSolver::extract
will put back the instance of IloConstraint
.
You must use the following IloCPConstraintI
member functions to force extraction of an extractable or an array of extractables:
void use(const IloSolver solver, const IloExtractable ext)const; void use(const IloSolver solver, const IloExtractableArray extArray)const; |
For more information on wrapping constraints for use with Concert Technology, see the documentation for the macro ILOCPCONSTRAINTWRAPPER
and the class IloCPConstraintI
in the IBM ILOG Solver Reference Manual. The section "Using the constraint wrapper" shows you how to do this for the frequency allocation example.
© Copyright IBM Corp. 1987, 2009. Legal terms. | PREVIOUS NEXT |