Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Declaring IloConstraint calling function

    Posted 08/02/11 05:15 AM

    Originally posted by: SystemAdmin


    Hi All,

    I'm using a ILOCPCONSTRAINTWRAPPER1 and i'd like to declare the calling function
    inside a header file.

    ILOCPCONSTRAINTWRAPPER1(IloCheckStopFlagWhenDomain, aSolver, IloIntVar, aVar){
    use (aSolver, aVar);
    return IlcCheckStopFlagWhenDomain (aSolver.getIntVar( aVar));
    }
    and so, i declare:
    extern IloConstraint IloCheckStopFlagWhenDomain (IloEnv aEnv,
    IloIntVar aVar);

    and i use it this way:
    _Model.add (IloCheckStopFlagWhenDomain (_Env, _nReseau));

    but the compilation fails: undefined reference to `IloCheckStopFlagWhenDomain(IloEnv, IloIntVar)

    If i do the same thing with ILOCPGOALWRAPPER, it compiles well.
    Would you know what is wrong ?

    Thank you.
    Cheers.
    #CPOptimizer
    #DecisionOptimization


  • 2.  Re: Declaring IloConstraint calling function

    Posted 08/03/11 02:48 AM

    Originally posted by: SystemAdmin


    Hi,

    for the record

    ILOCPCONSTRAINTWRAPPER generates
    IloCheckStopFlagWhenDomain (IloEnv env,
    IloIntVar aVar,
    const char* name=0);
    and you need to include #include <ilconcert/iloexpression.h>

    Cheers
    #CPOptimizer
    #DecisionOptimization