Decision Optimization

Decision Optimization

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

 View Only
  • 1.  setnames takes too long

    Posted Mon September 12, 2011 08:21 PM

    Originally posted by: gear


    Hello:
    I'm new to CPLEX. I'm trying to use setnames for about one million variables. And
    it takes for a long time. The code is following:

    IloNumVarArray z(env,1,000,000,-IloInfinity,IloInfinity);
    z.setNames("z");

    I'm wondering if this is normal? Is there some way to speed this up?

    Thanks!
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: setnames takes too long

    Posted Tue September 13, 2011 01:11 PM

    Originally posted by: SystemAdmin


    Thanks for pointing this out. This will be fixed in the next CPLEX release.

    Meanwhile, the only work-around that we know is to set names for all variables manually.

    Tobias
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: setnames takes too long

    Posted Tue September 13, 2011 01:32 PM

    Originally posted by: SystemAdmin


    As you can see in the reference documentation for function setNames() checks for duplicates.
    If you know that you don't have duplicates in the array then you can bypass this test by setting the names manually.
    #CPLEXOptimizers
    #DecisionOptimization