Originally posted by: SystemAdmin
[zhzhang said:]
Based on Example: Controlling Cuts iloadmipex5.cpp, I implement my CutCallback class as follows:
class polycutI:public IloCplex::CutCallbackI{
IloIntArray cita;
IloNumVarArray x;
IloNumVar z;
public:
IloCplex::CallbackI* duplicateCallback() const{
return (new(getEnv()) polycutI(*this));
}
polycutI(IloIntArray cita1,IloNumVarArray x1,IloNumVar z1):cita(cita1), x(x1), z(z1){}
void main();
};
IloCplex::Callback polycut(IloEnv env,
IloIntArray cita1,
IloNumVarArray x1,
IloNumVar z1)
{
return (IloCplex::Callback(new (env) polycutI(cita1,x1,z1)));
}
void polycutI::main()
{...}
However, it cannot be compiled correctly. Error message:
g++ -c -g -fpic -fexceptions -DNDEBUG -DIL_STD -I/usr/local/cplex110/include -I/usr/local/concert25/include test.cpp
test.cpp: In constructor `polycutI::polycutI(IloIntArray, IloNumVarArray, IloNumVar)':
test.cpp:31: error: no matching function for call to `IloCplex::CutCallbackI::CutCallbackI()'
test.cpp:28: note: candidates are: IloCplex::CutCallbackI::CutCallbackI(const IloCplex::CutCallbackI&)
/usr/local/cplex110/include/ilcplex/ilocplexi.h:2175: note: IloCplex::CutCallbackI::CutCallbackI(IloEnv)
I don't know how to revise my code because it is almost same as the example.
#CPLEXOptimizers#DecisionOptimization