Skip to content

Commit 51bbcfc

Browse files
committed
Merge branch 'objexprhdlr' into 'master'
add scip::ObjExprhdlr class to objscip See merge request integer/scip!3879
2 parents 10a5add + 2ec4f9e commit 51bbcfc

File tree

7 files changed

+1046
-0
lines changed

7 files changed

+1046
-0
lines changed

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ Interface changes
162162
- added SCIPsortDownIntIntIntReal()
163163
- SCIPconshdlrSetNeedsCons() to set whether constraint handler callbacks should also be called if there are no constraints
164164
- SCIPpropSetTimingmask() to set timing mask of a propagator
165+
- added C++ interface for expression handlers: src/objscip/objexprhdlr.h
165166

166167
### Changes in preprocessor macros
167168

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,6 +1130,7 @@ OBJSCIPLIBOBJ = objscip/objbenders.o \
11301130
objscip/objconshdlr.o \
11311131
objscip/objdialog.o \
11321132
objscip/objdisp.o \
1133+
objscip/objexprhdlr.o \
11331134
objscip/objeventhdlr.o \
11341135
objscip/objheur.o \
11351136
objscip/objmessagehdlr.o \

doc/xternal.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4244,10 +4244,16 @@
42444244
*
42454245
* For a complete implementation of an expression handler, take the one for exponential expressions (src/scip/expr_exp.c) as an example.
42464246
*
4247+
* It is very easy to transfer the C explanation to C++; whenever a function should be implemented using the
4248+
* SCIP_DECL_EXPRHDLR... notion, reimplement the corresponding virtual member function of the abstract scip::ObjExprhdlr
4249+
* base class.
4250+
*
42474251
* @section EXPRHDLR_PROPERTIES Properties of an Expression Handler
42484252
*
42494253
* At the top of the new file `expr_myfunc.c`, you can find the expression handler properties.
42504254
* These are given as compiler defines.
4255+
* In the C++ wrapper class, you have to provide the expression handler properties by calling the constructor
4256+
* of the abstract base class scip::ObjExprhdlr from within your constructor.
42514257
* The properties you have to set have the following meaning:
42524258
*
42534259
* \par EXPRHDLR_NAME: the name of the expression handler.
@@ -4330,6 +4336,8 @@
43304336
* an operational algorithm.
43314337
* They are passed to SCIP when the expression handler is created and included in SCIP via SCIPincludeExprhdlr(),
43324338
* see @ref EXPRHDLR_INTERFACE.
4339+
* In the C++ wrapper class scip::ObjExprhdlr, the fundamental callback methods are virtual abstract member functions.
4340+
* You have to implement them in order to be able to construct an object of your expression handler class.
43334341
*
43344342
* Expression handlers have one fundamental callback, @ref EXPREVAL, that needs to be implemented.
43354343
* However, expression handlers with stateful expressions (expressions that have data) need to implement also the

src/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,7 @@ set(objscipsources
427427
objscip/objdialog.cpp
428428
objscip/objdisp.cpp
429429
objscip/objeventhdlr.cpp
430+
objscip/objexprhdlr.cpp
430431
objscip/objheur.cpp
431432
objscip/objiisfinder.cpp
432433
objscip/objmessagehdlr.cpp
@@ -494,6 +495,7 @@ set(objscipheaders
494495
objscip/objdialog.h
495496
objscip/objdisp.h
496497
objscip/objeventhdlr.h
498+
objscip/objexprhdlr.h
497499
objscip/objheur.h
498500
objscip/objiisfinder.h
499501
objscip/objmessagehdlr.h

0 commit comments

Comments
 (0)