[SCIP] Help with Constraint Handler
Enrico Calandrini
e.calandrini at studenti.unipi.it
Fri Jan 19 13:18:43 CET 2024
Hi everyone,
first of all thanks a lot for your works!
Now, I write to you because I'm trying to create a new constraint handler in my project. I have read the online documentation about this argument and implemented all the fundamentals callback. Even if the handler is not quite finished, I wanted to check the formal correctness of my work so far trying to include it in the project. However, when I try to compute the code, I get the following error:
/home/something.cpp:342:71: error: invalid new-expression of abstract class type ‘dummy_Conhdlr’
342 | auto conhdlr = new dummy_Conhdlr( scip , this , CutSepPar );
|
In file included from /home/something.cpp:36:
/home/something.h:52:7: note: because the following virtual functions are pure within ‘dummy_Conhdlr’:
52 | class dummy_Conhdlr : public scip::ObjConshdlr
| ^~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/local/include/scip/scip.h:63,
from /home/something.h:39,
from /home/something.cpp:34:
/usr/local/include/objscip/objconshdlr.h:268:12: note: ‘virtual SCIP_RETCODE scip::ObjConshdlr::scip_trans(SCIP*, SCIP_CONSHDLR*, SCIP_CONS*, SCIP_CONS**)’
268 | virtual SCIP_DECL_CONSTRANS(scip_trans) = 0;
If I understand correctly the error, it is saying that I need to implement the scip_trans function, but I don't understand why. I have some constraint data in my handler, but I don't want to change them during the execution, so according to the documentation I should not need to implement it.
Thank you very much in advance for your help!
Best regards,
Enrico
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.zib.de/pipermail/scip/attachments/20240119/5ff4c583/attachment.html>
More information about the Scip
mailing list