Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Retrieve columns

    Posted 05/10/12 12:46 AM

    Originally posted by: stevenluda


    Hi, all,

    Is there a way to print out the columns of nonzero variables(in IP model)? I went through historical posts, it was mentioned (e.g. in this post https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14462382&#14462382) that the only way is to use iterator to go through all constraints to get the coefficients. However, it requires variables to be assigned names when building the model. Am I understanding right? What if the variables are not assigned names (e.g. in cutstock.cpp from the cplex distribution)? Is there a way to retrieve columns in this case?

    Thanks
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Retrieve columns

    Posted 05/10/12 01:17 AM

    Originally posted by: SystemAdmin


    You can use the code in the quoted post and replace getName() by getId().
    Each variable and each range in Concert has a unique id which is returned by IloExtractable::getId() (IloExtractable is a super class of IloNumVar and IloRange).
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Retrieve columns

    Posted 05/10/12 01:04 PM

    Originally posted by: stevenluda


    Great. Thank you for the help.
    #CPLEXOptimizers
    #DecisionOptimization