Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Storing arrays in node data

    Posted 11/12/14 09:08 AM

    Originally posted by: anahana


    Hi,

    In a branch callback I store two arrays in an instance of IloCplex::MIPCallbackI::NodeData. The first holds the values of the variables at the current node (using getValues()), and the other hods the feasibility status of the variables (using getFeasibilities()). 

    When moving to a node callback and creating an instance of the node data of any node, these two arrays are full of memory garbage. Why?? There is nothing there to use.

    I store all other types of information in the node data, and they are perfectly accessible from node callbacks.

    Regards, 


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Storing arrays in node data

    Posted 11/12/14 09:37 AM

    This is really hard to tell without seeing the code that allocates, initializes and frees those arrays. My guess would be that you are freeing the arrays too early.

    Are you using IloArray<>s or plain C++ arrays? In case your are using IloArray<>s, does the problem persist if you switch to C++ arrays of something like std::vector<>?


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Storing arrays in node data

    Posted 11/13/14 05:26 AM

    Originally posted by: anahana


    I doubled checked the code and I noticed that I am using the .end() method to terminate both arrays upon exiting the branch callback. I assumed since they are attached to nodeData, they will be copied there instead of being linked. This explains why they are only visible in the branch callback. It's working fine now thanks. 

    and to answer your question, I am using IloArray<> type arrays and they are working just fine.


    #CPLEXOptimizers
    #DecisionOptimization