Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  C++ passing parameter to callback error

    Posted 03/08/16 05:20 PM

    Originally posted by: JorisK


    The following code produces a compile error (C++):

    ILOUSERCUTCALLBACK3(ThreeCycleBruteForceCallback, unordered_map<Index3D, IloBoolVar, IndexHash3D, IndexEqual3D>, timeDepSeqVars, unordered_map<Index2D, IloNumVar, IndexHash2D, IndexEqual2D>, precedenceVars, vector<IloExpr>*, cuts){ ... }
    

     

    The error: macro "ILOUSERCUTCALLBACK3" passed 13 arguments, but takes just 7

    So apparently I cannot pass a map like this to the callback? Is there a workaround for this?


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: C++ passing parameter to callback error

    Posted 03/08/16 05:32 PM

    Originally posted by: JorisK


    I found the issue. Apparently you need to typedef those maps:

    typedef unordered_map<Index3D, IloBoolVar, IndexHash3D, IndexEqual3D> timeDepSeqVarsMapType;
    typedef unordered_map<Index2D, IloNumVar, IndexHash2D, IndexEqual2D> precedenceVarsMapType;
    ILOUSERCUTCALLBACK3(ThreeCycleBruteForceCallback, timeDepSeqVarsMapType, timeDepSeqVars, precedenceVarsMapType, precedenceVars, vector<IloExpr>*, cuts)
    

    This compiles correctly.


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: C++ passing parameter to callback error

    Posted 03/09/16 04:48 AM