Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  makeBranch and NodeData in CPLEX 11.1

    Posted 07/15/09 11:46 PM

    Originally posted by: SystemAdmin


    [akshayg said:]

    Hi,
    I am having trouble attaching node data to branches using branch callback in Concert Technology. I have the following piece of code

    myNode* downNode = new myNode(getEnv(),T);
    myNode* upNode = new myNode(getEnv(),T+1);
    makeBranch(downcons,getObjValue(),(NodeData*) downNode);
    getEnv().out() << endl << "child1 created.";
    makeBranch(upcons,getObjValue(),(NodeData*) upNode);
    getEnv().out() << " child2 created." << endl;<br />
    <myNode> is my derived class from the Concert base class NodeData.
    class RSD::MIP::myNode : public IloCplex::MIPCallbackI::NodeData
    {
    public:
    const IloInt NumBranchUp;
    IloIntArray NonBranchVar;

    myNode(const IloEnv& env,const IloInt num_br_up);
    ~myNode();

    };

    CPLEX will branch at the root node and it displays that the two children are created. However, it gives a Segmentation fault after the two child nodes are created. I have employed a destructor that calls NonBranchVar.end().

    Any suggestions where the segmentation fault might occur ?
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: makeBranch and NodeData in CPLEX 11.1

    Posted 07/21/09 07:22 PM

    Originally posted by: SystemAdmin


    [prubin said:]

    Can't tell from this much code, but the end() method may be the culprit.  If something uses the node data after you invoke end() on part of it, bad things will happen.
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: makeBranch and NodeData in CPLEX 11.1

    Posted 07/21/09 07:22 PM

    Originally posted by: SystemAdmin


    [akshayg said:]

    Thanks, I could figure out a little bit where the SegFault occurs. I am dereferencing a NULL pointer. Now my issue is : converting the pointer returned by getDataType() of MIPCallbackI::NodeData to an instance of my derived class.

    What is IloAny in Concert Technology ? Is it a void* ?
    #CPLEXOptimizers
    #DecisionOptimization