Originally posted by: SystemAdmin
Hello again!
In general, for Concert objects (starting with "Ilo") you can usually see their content because delivered header files contain their definitions. It is not the case for CP Optimizer objects (starting with "Ilc") though.
However the case of IloArray is a bit special. IloArray is a template class with only one data member: pointer _impl to non-template class IloArrayI (the "I" stands for implementation). Both these classes are defined in delivered header file concert/include/ilconcert/iloenv.h, so you can see their structure.
Note that IloArrayI is not documented and you should not access this class directly in your code (undocumented classes can change from release to release without any notice). However IloArrayI is what you see in the debugger when you try to look inside an instance of IloArray class. IloArray delegates most of the work to IloArrayI, however IloArrayI does not know the data type of items stored in the array. The role or IloArray is to cast the data to the right type before returning the result to the user.
So, in case of IloArray, debugger cannot show you the content of the array (even if you would have the whole source code). However, some debuggers allow you to call functions and see their results. They can even call functions you define after each step. For example, you can see how yourArray->getSize() is changing. I believe Visual C++ has this ability, however I do not use Visual C++ so I can't give you details (in Linux gdb you can do that using "print" and "display" commands). Also, I do not know whether your debugger will understand
yourArray[1]
or you whether you have to write something like
yourArray.operator[](1)
.
I know it is not very convenient, but I do not know about a better way. Note that just for the purpose of debugging, you can define your own formatting function for IloArray (returning char* for example). Then you can instruct the debugger to re-evaluate this function after each step and this way effectively display the content of the array each time the program is paused.
I hope it helps, Petr
#CPOptimizer#DecisionOptimization