-
Notifications
You must be signed in to change notification settings - Fork 78
Add scip::ObjExprhdlr class to objscip #149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The intent is to be able to use SWIG director classes to implement expression handlers through bindings, in particular, to add support for expression handlers to JSCIP. That needs the C++ class to build upon. src/objscip/objexprhdlr.h, src/objscip/objexprhdlr.cpp: New files. C++ wrapper for expression handlers. The files contain the scip::ObjExprhdlr class and the functions SCIPincludeObjExprhdlr, SCIPfindObjExprhdlr, and SCIPgetObjExprhdlr. src/CMakeLists.txt (objscipsources): Add objscip/objexprhdlr.cpp. (objscipheaders): Add objscip/objexprhdlr.h.
- derive from ObjCloneable: copy doesn't get invalid if exprhdlr cannot be cloned - no need for cassert in objexprhdlr.h - linebreaks closer to SCIP style
- copied text from ObjConshdlr
@kkofler Are you ok with the current changes to your changes? |
Yes, looks good now. Thank you for your improvements to my contribution. |
Thank you for the contribution! |
Unfortunately, now that I am finally far enough with my Java bindings to be able to really test this, I have found an annoying issue, but I am not sure about the proper fix: The problem is: The Java However, the C++ code also tries to directly call /* call include method of expression handler object */
SCIP_CALL( SCIPincludeObjExprhdlr(scip, newobjexprhdlr, TRUE) ); That was not my idea: At least As a result, the expression handler is going to be included twice, with both (duplicate) I tried simply commenting out that Fixing this in the JSCIPOpt Java code is not easy, also because, as I already mentioned, So I am not sure what the proper fix is here. |
The intent is to be able to use SWIG director classes to implement expression handlers through bindings, in particular, to add support for expression handlers to JSCIP. That needs the C++ class to build upon.
src/objscip/objexprhdlr.h, src/objscip/objexprhdlr.cpp: New files. C++ wrapper for expression handlers. The files contain the scip::ObjExprhdlr class and the functions SCIPincludeObjExprhdlr, SCIPfindObjExprhdlr, and SCIPgetObjExprhdlr.
src/CMakeLists.txt (objscipsources): Add objscip/objexprhdlr.cpp.
(objscipheaders): Add objscip/objexprhdlr.h.