Scippy

SCIP

Solving Constraint Integer Programs

pub_nlhdlr.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of the program and library */
4 /* SCIP --- Solving Constraint Integer Programs */
5 /* */
6 /* Copyright (C) 2002-2022 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SCIP is distributed under the terms of the ZIB Academic License. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SCIP; see the file COPYING. If not visit scipopt.org. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file pub_nlhdlr.h
17  * @brief public functions of nonlinear handlers of nonlinear constraints
18  * @ingroup PUBLICCOREAPI
19  * @author Ksenia Bestuzheva
20  * @author Benjamin Mueller
21  * @author Felipe Serrano
22  * @author Stefan Vigerske
23  */
24 
25 #ifndef SCIP_PUB_NLHDLR_H_
26 #define SCIP_PUB_NLHDLR_H_
27 
28 #include "scip/def.h"
29 #include "scip/type_scip.h"
30 #include "scip/type_nlhdlr.h"
31 
32 #ifdef NDEBUG
33 #include "scip/struct_nlhdlr.h"
34 #endif
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
40 /**@addtogroup PublicNlhdlrInterfaceMethods
41  * @{
42  */
43 
44 /** sets the copy handler callback of a nonlinear handler */
45 SCIP_EXPORT
47  SCIP_NLHDLR* nlhdlr, /**< nonlinear handler */
48  SCIP_DECL_NLHDLRCOPYHDLR((*copy)) /**< copy callback (can be NULL) */
49 );
50 
51 /** sets the nonlinear handler callback to free the nonlinear handler data */
52 SCIP_EXPORT
54  SCIP_NLHDLR* nlhdlr, /**< nonlinear handler */
55  SCIP_DECL_NLHDLRFREEHDLRDATA((*freehdlrdata)) /**< handler free callback (can be NULL) */
56 );
57 
58 /** sets the nonlinear handler callback to free expression specific data of nonlinear handler */
59 SCIP_EXPORT
61  SCIP_NLHDLR* nlhdlr, /**< nonlinear handler */
62  SCIP_DECL_NLHDLRFREEEXPRDATA((*freeexprdata)) /**< nonlinear handler expression data free callback (can be NULL if data does not need to be freed) */
63 );
64 
65 /** sets the initialization and deinitialization callback of a nonlinear handler */
66 SCIP_EXPORT
68  SCIP_NLHDLR* nlhdlr, /**< nonlinear handler */
69  SCIP_DECL_NLHDLRINIT((*init)), /**< initialization callback (can be NULL) */
70  SCIP_DECL_NLHDLREXIT((*exit)) /**< deinitialization callback (can be NULL) */
71 );
72 
73 /** sets the propagation callbacks of a nonlinear handler */
74 SCIP_EXPORT
76  SCIP_NLHDLR* nlhdlr, /**< nonlinear handler */
77  SCIP_DECL_NLHDLRINTEVAL((*inteval)), /**< interval evaluation callback (can be NULL) */
78  SCIP_DECL_NLHDLRREVERSEPROP((*reverseprop)) /**< reverse propagation callback (can be NULL) */
79 );
80 
81 /** sets the enforcement callbacks of a nonlinear handler */
82 SCIP_EXPORT
84  SCIP_NLHDLR* nlhdlr, /**< nonlinear handler */
85  SCIP_DECL_NLHDLRINITSEPA((*initsepa)), /**< separation initialization callback (can be NULL) */
86  SCIP_DECL_NLHDLRENFO((*enfo)), /**< enforcement callback (can be NULL if estimate is not NULL) */
87  SCIP_DECL_NLHDLRESTIMATE((*estimate)), /**< estimation callback (can be NULL if sepa is not NULL) */
88  SCIP_DECL_NLHDLREXITSEPA((*exitsepa)) /**< separation deinitialization callback (can be NULL) */
89 );
90 
91 /** gives name of nonlinear handler */
92 SCIP_EXPORT
93 const char* SCIPnlhdlrGetName(
94  SCIP_NLHDLR* nlhdlr /**< nonlinear handler */
95 );
96 
97 /** gives description of nonlinear handler, can be NULL */
98 SCIP_EXPORT
99 const char* SCIPnlhdlrGetDesc(
100  SCIP_NLHDLR* nlhdlr /**< nonlinear handler */
101 );
102 
103 /** gives detection priority of nonlinear handler */
104 SCIP_EXPORT
106  SCIP_NLHDLR* nlhdlr /**< nonlinear handler */
107 );
108 
109 /** gives enforcement priority of nonlinear handler */
110 SCIP_EXPORT
112  SCIP_NLHDLR* nlhdlr /**< nonlinear handler */
113 );
114 
115 /** returns whether nonlinear handler is enabled */
116 SCIP_EXPORT
118  SCIP_NLHDLR* nlhdlr /**< nonlinear handler */
119 );
120 
121 /** gives handler data of nonlinear handler */
122 SCIP_EXPORT
124  SCIP_NLHDLR* nlhdlr /**< nonlinear handler */
125 );
126 
127 /** returns whether nonlinear handler implements the interval evaluation callback */
128 SCIP_EXPORT
130  SCIP_NLHDLR* nlhdlr /**< nonlinear handler */
131 );
132 
133 /** returns whether nonlinear handler implements the reverse propagation callback */
134 SCIP_EXPORT
136  SCIP_NLHDLR* nlhdlr /**< nonlinear handler */
137 );
138 
139 /** returns whether nonlinear handler implements the separation initialization callback */
140 SCIP_EXPORT
142  SCIP_NLHDLR* nlhdlr /**< nonlinear handler */
143 );
144 
145 /** returns whether nonlinear handler implements the separation deinitialization callback */
146 SCIP_EXPORT
148  SCIP_NLHDLR* nlhdlr /**< nonlinear handler */
149 );
150 
151 /** returns whether nonlinear handler implements the enforcement callback */
152 SCIP_EXPORT
154  SCIP_NLHDLR* nlhdlr /**< nonlinear handler */
155 );
156 
157 /** returns whether nonlinear handler implements the estimator callback */
158 SCIP_EXPORT
160  SCIP_NLHDLR* nlhdlr /**< nonlinear handler */
161 );
162 
163 /** compares two nonlinear handlers by detection priority
164  *
165  * if handlers have same detection priority, then compare by name
166  */
167 SCIP_DECL_SORTPTRCOMP(SCIPnlhdlrComp);
168 
169 #ifdef NDEBUG
170 /* If NDEBUG is defined, the function calls are overwritten by defines to reduce the number of function calls and
171  * speed up the algorithms.
172  */
173 #define SCIPnlhdlrSetCopyHdlr(nlhdlr, copy) (nlhdlr)->copyhdlr = copy
174 #define SCIPnlhdlrSetFreeHdlrData(nlhdlr, freehdlrdata_) (nlhdlr)->freehdlrdata = freehdlrdata_
175 #define SCIPnlhdlrSetFreeExprData(nlhdlr, freeexprdata_) (nlhdlr)->freeexprdata = freeexprdata_
176 #define SCIPnlhdlrSetInitExit(nlhdlr, init_, exit_) do { (nlhdlr)->init = init_; nlhdlr->exit = exit_; } while (FALSE)
177 #define SCIPnlhdlrSetProp(nlhdlr, inteval_, reverseprop_) do { (nlhdlr)->inteval = inteval_; nlhdlr->reverseprop = reverseprop_; } while (FALSE)
178 #define SCIPnlhdlrSetSepa(nlhdlr, initsepa_, enfo_, estimate_, exitsepa_) do { (nlhdlr)->initsepa = initsepa_; (nlhdlr)->enfo = enfo_; (nlhdlr)->estimate = estimate_; (nlhdlr)->exitsepa = exitsepa_; } while (FALSE);
179 #define SCIPnlhdlrGetName(nlhdlr) (nlhdlr)->name
180 #define SCIPnlhdlrGetDesc(nlhdlr) (nlhdlr)->desc
181 #define SCIPnlhdlrGetDetectPriority(nlhdlr) (nlhdlr)->detectpriority
182 #define SCIPnlhdlrGetEnfoPriority(nlhdlr) (nlhdlr)->enfopriority
183 #define SCIPnlhdlrIsEnabled(nlhdlr) (nlhdlr)->enabled
184 #define SCIPnlhdlrGetData(nlhdlr) (nlhdlr)->data
185 #define SCIPnlhdlrHasIntEval(nlhdlr) ((nlhdlr)->inteval != NULL)
186 #define SCIPnlhdlrHasReverseProp(nlhdlr) ((nlhdlr)->reverseprop != NULL)
187 #define SCIPnlhdlrHasInitSepa(nlhdlr) ((nlhdlr)->initsepa != NULL)
188 #define SCIPnlhdlrHasExitSepa(nlhdlr) ((nlhdlr)->exitsepa != NULL)
189 #define SCIPnlhdlrHasEnfo(nlhdlr) ((nlhdlr)->enfo != NULL)
190 #define SCIPnlhdlrHasEstimate(nlhdlr) ((nlhdlr)->estimate != NULL)
191 #endif
192 
193 /** @} */
194 
195 #ifdef __cplusplus
196 }
197 #endif
198 
199 #endif /* SCIP_PUB_NLHDLR_H_ */
#define SCIP_DECL_NLHDLREXITSEPA(x)
Definition: type_nlhdlr.h:281
SCIP_Bool SCIPnlhdlrIsEnabled(SCIP_NLHDLR *nlhdlr)
Definition: nlhdlr.c:181
#define SCIP_DECL_NLHDLRENFO(x)
Definition: type_nlhdlr.h:344
void SCIPnlhdlrSetFreeExprData(SCIP_NLHDLR *nlhdlr, SCIP_DECL_NLHDLRFREEEXPRDATA((*freeexprdata)))
Definition: nlhdlr.c:85
#define SCIP_DECL_NLHDLRFREEHDLRDATA(x)
Definition: type_nlhdlr.h:73
int SCIPnlhdlrGetDetectPriority(SCIP_NLHDLR *nlhdlr)
Definition: nlhdlr.c:161
SCIP_Bool SCIPnlhdlrHasReverseProp(SCIP_NLHDLR *nlhdlr)
Definition: nlhdlr.c:209
#define SCIP_DECL_NLHDLRFREEEXPRDATA(x)
Definition: type_nlhdlr.h:85
void SCIPnlhdlrSetInitExit(SCIP_NLHDLR *nlhdlr, SCIP_DECL_NLHDLRINIT((*init)), SCIP_DECL_NLHDLREXIT((*exit)))
void SCIPnlhdlrSetFreeHdlrData(SCIP_NLHDLR *nlhdlr, SCIP_DECL_NLHDLRFREEHDLRDATA((*freehdlrdata)))
Definition: nlhdlr.c:74
#define SCIP_DECL_NLHDLRESTIMATE(x)
Definition: type_nlhdlr.h:387
SCIP_Bool SCIPnlhdlrHasExitSepa(SCIP_NLHDLR *nlhdlr)
Definition: nlhdlr.c:225
#define SCIP_DECL_NLHDLRREVERSEPROP(x)
Definition: type_nlhdlr.h:237
type definitions related to nonlinear handlers of nonlinear constraints
#define SCIP_DECL_NLHDLRINTEVAL(x)
Definition: type_nlhdlr.h:213
const char * SCIPnlhdlrGetName(SCIP_NLHDLR *nlhdlr)
Definition: nlhdlr.c:141
SCIP_Bool SCIPnlhdlrHasIntEval(SCIP_NLHDLR *nlhdlr)
Definition: nlhdlr.c:201
#define SCIP_DECL_NLHDLRCOPYHDLR(x)
Definition: type_nlhdlr.h:61
type definitions for SCIP&#39;s main datastructure
const char * SCIPnlhdlrGetDesc(SCIP_NLHDLR *nlhdlr)
Definition: nlhdlr.c:151
void SCIPnlhdlrSetSepa(SCIP_NLHDLR *nlhdlr, SCIP_DECL_NLHDLRINITSEPA((*initsepa)), SCIP_DECL_NLHDLRENFO((*enfo)), SCIP_DECL_NLHDLRESTIMATE((*estimate)), SCIP_DECL_NLHDLREXITSEPA((*exitsepa)))
Definition: nlhdlr.c:123
#define SCIP_Bool
Definition: def.h:84
#define SCIP_DECL_NLHDLRINIT(x)
Definition: type_nlhdlr.h:96
void SCIPnlhdlrSetProp(SCIP_NLHDLR *nlhdlr, SCIP_DECL_NLHDLRINTEVAL((*inteval)), SCIP_DECL_NLHDLRREVERSEPROP((*reverseprop)))
Definition: nlhdlr.c:110
int SCIPnlhdlrGetEnfoPriority(SCIP_NLHDLR *nlhdlr)
Definition: nlhdlr.c:171
#define SCIP_DECL_NLHDLRINITSEPA(x)
Definition: type_nlhdlr.h:261
SCIP_Bool SCIPnlhdlrHasEnfo(SCIP_NLHDLR *nlhdlr)
Definition: nlhdlr.c:233
#define SCIP_DECL_SORTPTRCOMP(x)
Definition: type_misc.h:179
structure definitions related to nonlinear handlers of nonlinear constraints
SCIP_Bool SCIPnlhdlrHasEstimate(SCIP_NLHDLR *nlhdlr)
Definition: nlhdlr.c:241
SCIP_Bool SCIPnlhdlrHasInitSepa(SCIP_NLHDLR *nlhdlr)
Definition: nlhdlr.c:217
SCIP_NLHDLRDATA * SCIPnlhdlrGetData(SCIP_NLHDLR *nlhdlr)
Definition: nlhdlr.c:191
#define SCIP_DECL_NLHDLREXIT(x)
Definition: type_nlhdlr.h:105
struct SCIP_NlhdlrData SCIP_NLHDLRDATA
Definition: type_nlhdlr.h:403
common defines and data types used in all packages of SCIP
void SCIPnlhdlrSetCopyHdlr(SCIP_NLHDLR *nlhdlr, SCIP_DECL_NLHDLRCOPYHDLR((*copy)))
Definition: nlhdlr.c:63