Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Cplex concert

    Posted 02/24/15 09:03 AM

    Originally posted by: stephK


     

    Hi,

    Purify gives an  " Access violation reading location 0xfffffffffff" at line 6 . I don't know why.

    Any Suggestions ?

    Thanks a lot.

     

           vector<IloModel> model_Bellman_multiple[52];

          vector<IloCplex> cplex_B_multiple[52];

      1    for(int t=0;t<=51;t++)
      2              for(int i=0;i<n;i++)
      3          {
      4             IloModel model(env);
      5            model_Bellman_multiple[t].push_back(model);
      6              cplex_B_multiple[t].push_back(IloCplex(model_Bellman_multiple[t].back()));

                  ......

    }


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Cplex concert

    Posted 02/24/15 09:12 AM

    Originally posted by: Laci Ladanyi


    errr... what is the for loop on line 2, and what is the value of n?


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Cplex concert

    Posted 02/24/15 09:52 AM

    Originally posted by: stephK


    n is equal to 5


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Cplex concert

    Posted 02/24/15 10:08 AM

    Unless you modify 't' in the code you left out this looks correct at first glance. Can you try to split line 6 into multiple statements:

    IloModel m = model_Bellman_multiple[t].back();
    IloCplex cplex(m);
    cplex_B_multiple[t].push_back(cplex);

    And then check what exactly is the statement purify complains about?


    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Cplex concert

    Posted 02/24/15 11:30 AM

    Originally posted by: stephK


     t is unmodified in the loop with n.  Access violation occurs when t=0 and i=0.

    In attached file the purify output.


    #CPLEXOptimizers
    #DecisionOptimization


  • 6.  Re: Cplex concert

    Posted 02/24/15 12:17 PM

    Originally posted by: Laci Ladanyi


    Your image shows that you try to push an IloModel onto cplex_B_multiple[t]. You need to push an IloCplex object to the end of that vector.


    #CPLEXOptimizers
    #DecisionOptimization


  • 7.  Re: Cplex concert

    Posted 02/24/15 12:43 PM

    Originally posted by: Laci Ladanyi


    Never mind... I have missed that there is automatic constructor for IloCplex from IloModel... :-(


    #CPLEXOptimizers
    #DecisionOptimization


  • 8.  Re: Cplex concert

    Posted 02/25/15 12:50 AM

    The only suspicious thing in your code I can see is this line:

    objectif_inf_multiple[t].push_back(IloObjective())

    (there is a missing env argument to the IloObjective constructor) but it looks like you never even get there. Could you provide a minimal example how to reproduce this and post the code here?

    I also wonder why the exception address listed is CpxGoalNCallbackI::main(). Is your code in a callback or in a goal?


    #CPLEXOptimizers
    #DecisionOptimization


  • 9.  Re: Cplex concert

    Posted 02/25/15 09:06 AM

    Originally posted by: stephK


    Thank you very much  for your collaboration. To find better where the problem is, I writed this simple code:

    int main(int argc, char *argv[])
    {
        IloEnv env1;
        IloModel m(env1);
        IloCplex cplex(m);

    In attached file the purify report I obtain.

    ps: code compile et run well without purify.

     

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 10.  Re: Cplex concert

    Posted 03/03/15 02:12 AM

    I stared hard at your code but could not spot any problem. What I find suspicious is that the error report contains a reference to function CpxGoalNCallbackI::main() which is definitely not invoked in that place.

    Could this be a problem with purify itself?


    #CPLEXOptimizers
    #DecisionOptimization