Skip to content

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

Merged
merged 6 commits into from
Jun 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ Interface changes
- added SCIPsortDownIntIntIntReal()
- SCIPconshdlrSetNeedsCons() to set whether constraint handler callbacks should also be called if there are no constraints
- SCIPpropSetTimingmask() to set timing mask of a propagator
- added C++ interface for expression handlers: src/objscip/objexprhdlr.h

### Changes in preprocessor macros

Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1130,6 +1130,7 @@ OBJSCIPLIBOBJ = objscip/objbenders.o \
objscip/objconshdlr.o \
objscip/objdialog.o \
objscip/objdisp.o \
objscip/objexprhdlr.o \
objscip/objeventhdlr.o \
objscip/objheur.o \
objscip/objmessagehdlr.o \
Expand Down
8 changes: 8 additions & 0 deletions doc/xternal.c
Original file line number Diff line number Diff line change
Expand Up @@ -4244,10 +4244,16 @@
*
* For a complete implementation of an expression handler, take the one for exponential expressions (src/scip/expr_exp.c) as an example.
*
* It is very easy to transfer the C explanation to C++; whenever a function should be implemented using the
* SCIP_DECL_EXPRHDLR... notion, reimplement the corresponding virtual member function of the abstract scip::ObjExprhdlr
* base class.
*
* @section EXPRHDLR_PROPERTIES Properties of an Expression Handler
*
* At the top of the new file `expr_myfunc.c`, you can find the expression handler properties.
* These are given as compiler defines.
* In the C++ wrapper class, you have to provide the expression handler properties by calling the constructor
* of the abstract base class scip::ObjExprhdlr from within your constructor.
* The properties you have to set have the following meaning:
*
* \par EXPRHDLR_NAME: the name of the expression handler.
Expand Down Expand Up @@ -4330,6 +4336,8 @@
* an operational algorithm.
* They are passed to SCIP when the expression handler is created and included in SCIP via SCIPincludeExprhdlr(),
* see @ref EXPRHDLR_INTERFACE.
* In the C++ wrapper class scip::ObjExprhdlr, the fundamental callback methods are virtual abstract member functions.
* You have to implement them in order to be able to construct an object of your expression handler class.
*
* Expression handlers have one fundamental callback, @ref EXPREVAL, that needs to be implemented.
* However, expression handlers with stateful expressions (expressions that have data) need to implement also the
Expand Down
2 changes: 2 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,7 @@ set(objscipsources
objscip/objdialog.cpp
objscip/objdisp.cpp
objscip/objeventhdlr.cpp
objscip/objexprhdlr.cpp
objscip/objheur.cpp
objscip/objiisfinder.cpp
objscip/objmessagehdlr.cpp
Expand Down Expand Up @@ -494,6 +495,7 @@ set(objscipheaders
objscip/objdialog.h
objscip/objdisp.h
objscip/objeventhdlr.h
objscip/objexprhdlr.h
objscip/objheur.h
objscip/objiisfinder.h
objscip/objmessagehdlr.h
Expand Down
Loading