IBM ILOG Solver User's Manual > More on Modeling > Using Constrained Floating-Point Variables: Modeling Equations > Using IloGenerateBounds |
Using IloGenerateBounds |
INDEX
![]() |
The function IloGenerateBounds
creates and returns a goal. The goal efficiently reduces the domain of a floating-point variable by propagating any constraints on that variable more than usual. It checks whether the boundaries of the domain of the variable are consistent with all the constraints posted on the variable. If that is not the case, then it reduces an interval around the variable until the boundaries become consistent up to the precision indicated by a precision parameter. If the precision is small, the new domain computed by IloGenerateBounds
will be smaller. However, the smaller the precision, the longer the computation will take. This function works on IloNumVar
variables or IloNumVarArray
arrays of variables. (The type can be either Float
or Int
.)
The following example uses the goal returned by IloGenerateBounds
to search for a solution.
The problem is to find the roots of the following polynomial:
(x + 1)(x + 2)...(x + 20) + 2-23x19
That example can be coded like this:
That program prints all the roots of the equation.
The complete program is available online in the YourSolverHome/examples/src/wilkins.cpp
file.
© Copyright IBM Corp. 1987, 2009. Legal terms. | PREVIOUS NEXT |