12.07.2015 Views

ILOG CPLEX 11.0 User's Manual

ILOG CPLEX 11.0 User's Manual

ILOG CPLEX 11.0 User's Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

IloModel object itself and added to the IloModel objects that represent the individualscenarios.Data Management ClassesUsually the data of an optimization problem must be collected before or during the creationof the Concert Technology representation of the model. Though, in principle, modeling doesnot depend on how the data is generated and represented, this task may be facilitated byusing the array or set classes, such as IloNumSet, provided by Concert Technology.For example, objects of class IloNumArray can be used to store numeric data in arrays.Elements of the class IloNumArray can be accessed like elements of standard C++ arrays,but the class also offers a wealth of additional functions. For example, Concert Technologyarrays are extensible; in other words, they transparently adapt to the required size when newelements are added using the method add. Conversely, elements can be removed fromanywhere in the array with the method remove. Concert Technology arrays also providedebugging support when compiled in debug mode by using assert statements to make surethat no element beyond the array bounds is accessed. Input and output operators (that is,operator >) are provided for arrays. For example, the code:IloNumArray data(env, 3, 1.0, 2.0, 3.0);cout data;The example at the end of this chapter (Example: Optimizing the Diet Problem in C++ onpage 65) takes advantage of this function and reads the problem data from a file.Finally, Concert Technology provides the template class IloArray to create arrayclasses for your own type X. This technique can be used to generate multidimensionalarrays. All the functions mentioned here are supported for IloArray classes except forinput/output, which depends on the input and output operator being defined for type X.<strong>ILOG</strong> <strong>CPLEX</strong> <strong>11.0</strong> — USER’ S MANUAL 49

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!