Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Watch Cplex variables during debugging

    Posted 07/17/11 10:00 AM

    Originally posted by: Keshavarz


    I want to see the values of the Cplex array variables in the watch window of Visual Studio (while I am debugging). Is it possible? If Yes How?
    Thanks
    Keshavarz
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Watch Cplex variables during debugging

    Posted 07/18/11 01:08 AM

    Originally posted by: SystemAdmin


    Do I understand correctly: You want to see the values of the model variables at the current LP iteration or MIP node? This is not possible.
    What you could do is to register a callback and from that callback use CPXgetx() (in C) or getValues() (in most of the other APIs) to read the variable values. Once you have read them like this it should be easy to view them.
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Watch Cplex variables during debugging

    Posted 07/18/11 02:15 AM

    Originally posted by: Keshavarz


    Thank you for your response.
    No. I do not want to see the value of the model variables. I want to see the values of a IloNumArray that keeps some data that are generated during my program running.
    Thanks,
    Keshavarz
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Watch Cplex variables during debugging

    Posted 07/18/11 02:32 AM

    Originally posted by: SystemAdmin


    It should be possible to view these values. Unfortunately, this is not that straightforward and I am not an expert in debugging with visual studio so I cannot give you step-by-step instructions.
    Here is some information that may help you:
    • IloNumArray is a subclass of IloArray<double>.
    • In an IloArray<T> instance the actual array data is stored in the instance variable _impl. Hence you need to watch the values in _impl.
    • _impl is an instance of IloArrayI that stores the array data in IloArrayI::_data.
    • Accessing individual slots in IloArrayI::_data is a little cryptic. Look at the implementation of the index operator in IloArray<T> in iloenv.h to see how to do that.

    Since this is so cryptic my first reaction would be to use std::vector<double> instead of IloNumArray, if that is possible with reasonable effort.
    #CPLEXOptimizers
    #DecisionOptimization