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 2002-2022 Zuse Institute Berlin */
7 /* */
8 /* Licensed under the Apache License, Version 2.0 (the "License"); */
9 /* you may not use this file except in compliance with the License. */
10 /* You may obtain a copy of the License at */
11 /* */
12 /* http://www.apache.org/licenses/LICENSE-2.0 */
13 /* */
14 /* Unless required by applicable law or agreed to in writing, software */
15 /* distributed under the License is distributed on an "AS IS" BASIS, */
16 /* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
17 /* See the License for the specific language governing permissions and */
18 /* limitations under the License. */
19 /* */
20 /* You should have received a copy of the Apache-2.0 license */
21 /* along with SCIP; see the file LICENSE. If not visit scipopt.org. */
22 /* */
23 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
24 
25 /**@file pub_nlhdlr.h
26  * @brief public functions of nonlinear handlers of nonlinear constraints
27  * @ingroup PUBLICCOREAPI
28  * @author Ksenia Bestuzheva
29  * @author Benjamin Mueller
30  * @author Felipe Serrano
31  * @author Stefan Vigerske
32  */
33 
34 #ifndef SCIP_PUB_NLHDLR_H_
35 #define SCIP_PUB_NLHDLR_H_
36 
37 #include "scip/def.h"
38 #include "scip/type_scip.h"
39 #include "scip/type_nlhdlr.h"
40 
41 #ifdef NDEBUG
42 #include "scip/struct_nlhdlr.h"
43 #endif
44 
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48 
49 /**@addtogroup PublicNlhdlrInterfaceMethods
50  * @{
51  */
52 
53 /** sets the copy handler callback of a nonlinear handler */
54 SCIP_EXPORT
56  SCIP_NLHDLR* nlhdlr, /**< nonlinear handler */
57  SCIP_DECL_NLHDLRCOPYHDLR((*copy)) /**< copy callback (can be NULL) */
58 );
59 
60 /** sets the nonlinear handler callback to free the nonlinear handler data */
61 SCIP_EXPORT
63  SCIP_NLHDLR* nlhdlr, /**< nonlinear handler */
64  SCIP_DECL_NLHDLRFREEHDLRDATA((*freehdlrdata)) /**< handler free callback (can be NULL) */
65 );
66 
67 /** sets the nonlinear handler callback to free expression specific data of nonlinear handler */
68 SCIP_EXPORT
70  SCIP_NLHDLR* nlhdlr, /**< nonlinear handler */
71  SCIP_DECL_NLHDLRFREEEXPRDATA((*freeexprdata)) /**< nonlinear handler expression data free callback (can be NULL if data does not need to be freed) */
72 );
73 
74 /** sets the initialization and deinitialization callback of a nonlinear handler */
75 SCIP_EXPORT
77  SCIP_NLHDLR* nlhdlr, /**< nonlinear handler */
78  SCIP_DECL_NLHDLRINIT((*init)), /**< initialization callback (can be NULL) */
79  SCIP_DECL_NLHDLREXIT((*exit)) /**< deinitialization callback (can be NULL) */
80 );
81 
82 /** sets the propagation callbacks of a nonlinear handler */
83 SCIP_EXPORT
85  SCIP_NLHDLR* nlhdlr, /**< nonlinear handler */
86  SCIP_DECL_NLHDLRINTEVAL((*inteval)), /**< interval evaluation callback (can be NULL) */
87  SCIP_DECL_NLHDLRREVERSEPROP((*reverseprop)) /**< reverse propagation callback (can be NULL) */
88 );
89 
90 /** sets the enforcement callbacks of a nonlinear handler */
91 SCIP_EXPORT
93  SCIP_NLHDLR* nlhdlr, /**< nonlinear handler */
94  SCIP_DECL_NLHDLRINITSEPA((*initsepa)), /**< separation initialization callback (can be NULL) */
95  SCIP_DECL_NLHDLRENFO((*enfo)), /**< enforcement callback (can be NULL if estimate is not NULL) */
96  SCIP_DECL_NLHDLRESTIMATE((*estimate)), /**< estimation callback (can be NULL if sepa is not NULL) */
97  SCIP_DECL_NLHDLREXITSEPA((*exitsepa)) /**< separation deinitialization callback (can be NULL) */
98 );
99 
100 /** gives name of nonlinear handler */
101 SCIP_EXPORT
102 const char* SCIPnlhdlrGetName(
103  SCIP_NLHDLR* nlhdlr /**< nonlinear handler */
104 );
105 
106 /** gives description of nonlinear handler, can be NULL */
107 SCIP_EXPORT
108 const char* SCIPnlhdlrGetDesc(
109  SCIP_NLHDLR* nlhdlr /**< nonlinear handler */
110 );
111 
112 /** gives detection priority of nonlinear handler */
113 SCIP_EXPORT
115  SCIP_NLHDLR* nlhdlr /**< nonlinear handler */
116 );
117 
118 /** gives enforcement priority of nonlinear handler */
119 SCIP_EXPORT
121  SCIP_NLHDLR* nlhdlr /**< nonlinear handler */
122 );
123 
124 /** returns whether nonlinear handler is enabled */
125 SCIP_EXPORT
127  SCIP_NLHDLR* nlhdlr /**< nonlinear handler */
128 );
129 
130 /** gives handler data of nonlinear handler */
131 SCIP_EXPORT
133  SCIP_NLHDLR* nlhdlr /**< nonlinear handler */
134 );
135 
136 /** returns whether nonlinear handler implements the interval evaluation callback */
137 SCIP_EXPORT
139  SCIP_NLHDLR* nlhdlr /**< nonlinear handler */
140 );
141 
142 /** returns whether nonlinear handler implements the reverse propagation callback */
143 SCIP_EXPORT
145  SCIP_NLHDLR* nlhdlr /**< nonlinear handler */
146 );
147 
148 /** returns whether nonlinear handler implements the separation initialization callback */
149 SCIP_EXPORT
151  SCIP_NLHDLR* nlhdlr /**< nonlinear handler */
152 );
153 
154 /** returns whether nonlinear handler implements the separation deinitialization callback */
155 SCIP_EXPORT
157  SCIP_NLHDLR* nlhdlr /**< nonlinear handler */
158 );
159 
160 /** returns whether nonlinear handler implements the enforcement callback */
161 SCIP_EXPORT
163  SCIP_NLHDLR* nlhdlr /**< nonlinear handler */
164 );
165 
166 /** returns whether nonlinear handler implements the estimator callback */
167 SCIP_EXPORT
169  SCIP_NLHDLR* nlhdlr /**< nonlinear handler */
170 );
171 
172 /** compares two nonlinear handlers by detection priority
173  *
174  * if handlers have same detection priority, then compare by name
175  */
176 SCIP_DECL_SORTPTRCOMP(SCIPnlhdlrComp);
177 
178 #ifdef NDEBUG
179 /* If NDEBUG is defined, the function calls are overwritten by defines to reduce the number of function calls and
180  * speed up the algorithms.
181  */
182 #define SCIPnlhdlrSetCopyHdlr(nlhdlr, copy) (nlhdlr)->copyhdlr = copy
183 #define SCIPnlhdlrSetFreeHdlrData(nlhdlr, freehdlrdata_) (nlhdlr)->freehdlrdata = freehdlrdata_
184 #define SCIPnlhdlrSetFreeExprData(nlhdlr, freeexprdata_) (nlhdlr)->freeexprdata = freeexprdata_
185 #define SCIPnlhdlrSetInitExit(nlhdlr, init_, exit_) do { (nlhdlr)->init = init_; nlhdlr->exit = exit_; } while (FALSE)
186 #define SCIPnlhdlrSetProp(nlhdlr, inteval_, reverseprop_) do { (nlhdlr)->inteval = inteval_; nlhdlr->reverseprop = reverseprop_; } while (FALSE)
187 #define SCIPnlhdlrSetSepa(nlhdlr, initsepa_, enfo_, estimate_, exitsepa_) do { (nlhdlr)->initsepa = initsepa_; (nlhdlr)->enfo = enfo_; (nlhdlr)->estimate = estimate_; (nlhdlr)->exitsepa = exitsepa_; } while (FALSE);
188 #define SCIPnlhdlrGetName(nlhdlr) (nlhdlr)->name
189 #define SCIPnlhdlrGetDesc(nlhdlr) (nlhdlr)->desc
190 #define SCIPnlhdlrGetDetectPriority(nlhdlr) (nlhdlr)->detectpriority
191 #define SCIPnlhdlrGetEnfoPriority(nlhdlr) (nlhdlr)->enfopriority
192 #define SCIPnlhdlrIsEnabled(nlhdlr) (nlhdlr)->enabled
193 #define SCIPnlhdlrGetData(nlhdlr) (nlhdlr)->data
194 #define SCIPnlhdlrHasIntEval(nlhdlr) ((nlhdlr)->inteval != NULL)
195 #define SCIPnlhdlrHasReverseProp(nlhdlr) ((nlhdlr)->reverseprop != NULL)
196 #define SCIPnlhdlrHasInitSepa(nlhdlr) ((nlhdlr)->initsepa != NULL)
197 #define SCIPnlhdlrHasExitSepa(nlhdlr) ((nlhdlr)->exitsepa != NULL)
198 #define SCIPnlhdlrHasEnfo(nlhdlr) ((nlhdlr)->enfo != NULL)
199 #define SCIPnlhdlrHasEstimate(nlhdlr) ((nlhdlr)->estimate != NULL)
200 #endif
201 
202 /** @} */
203 
204 #ifdef __cplusplus
205 }
206 #endif
207 
208 #endif /* SCIP_PUB_NLHDLR_H_ */
#define SCIP_DECL_NLHDLREXITSEPA(x)
Definition: type_nlhdlr.h:290
SCIP_Bool SCIPnlhdlrIsEnabled(SCIP_NLHDLR *nlhdlr)
Definition: nlhdlr.c:190
#define SCIP_DECL_NLHDLRENFO(x)
Definition: type_nlhdlr.h:353
void SCIPnlhdlrSetFreeExprData(SCIP_NLHDLR *nlhdlr, SCIP_DECL_NLHDLRFREEEXPRDATA((*freeexprdata)))
Definition: nlhdlr.c:94
#define SCIP_DECL_NLHDLRFREEHDLRDATA(x)
Definition: type_nlhdlr.h:82
int SCIPnlhdlrGetDetectPriority(SCIP_NLHDLR *nlhdlr)
Definition: nlhdlr.c:170
SCIP_Bool SCIPnlhdlrHasReverseProp(SCIP_NLHDLR *nlhdlr)
Definition: nlhdlr.c:218
#define SCIP_DECL_NLHDLRFREEEXPRDATA(x)
Definition: type_nlhdlr.h:94
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:83
#define SCIP_DECL_NLHDLRESTIMATE(x)
Definition: type_nlhdlr.h:396
SCIP_Bool SCIPnlhdlrHasExitSepa(SCIP_NLHDLR *nlhdlr)
Definition: nlhdlr.c:234
#define SCIP_DECL_NLHDLRREVERSEPROP(x)
Definition: type_nlhdlr.h:246
type definitions related to nonlinear handlers of nonlinear constraints
#define SCIP_DECL_NLHDLRINTEVAL(x)
Definition: type_nlhdlr.h:222
const char * SCIPnlhdlrGetName(SCIP_NLHDLR *nlhdlr)
Definition: nlhdlr.c:150
SCIP_Bool SCIPnlhdlrHasIntEval(SCIP_NLHDLR *nlhdlr)
Definition: nlhdlr.c:210
#define SCIP_DECL_NLHDLRCOPYHDLR(x)
Definition: type_nlhdlr.h:70
type definitions for SCIP&#39;s main datastructure
const char * SCIPnlhdlrGetDesc(SCIP_NLHDLR *nlhdlr)
Definition: nlhdlr.c:160
void SCIPnlhdlrSetSepa(SCIP_NLHDLR *nlhdlr, SCIP_DECL_NLHDLRINITSEPA((*initsepa)), SCIP_DECL_NLHDLRENFO((*enfo)), SCIP_DECL_NLHDLRESTIMATE((*estimate)), SCIP_DECL_NLHDLREXITSEPA((*exitsepa)))
Definition: nlhdlr.c:132
#define SCIP_Bool
Definition: def.h:93
#define SCIP_DECL_NLHDLRINIT(x)
Definition: type_nlhdlr.h:105
void SCIPnlhdlrSetProp(SCIP_NLHDLR *nlhdlr, SCIP_DECL_NLHDLRINTEVAL((*inteval)), SCIP_DECL_NLHDLRREVERSEPROP((*reverseprop)))
Definition: nlhdlr.c:119
int SCIPnlhdlrGetEnfoPriority(SCIP_NLHDLR *nlhdlr)
Definition: nlhdlr.c:180
#define SCIP_DECL_NLHDLRINITSEPA(x)
Definition: type_nlhdlr.h:270
SCIP_Bool SCIPnlhdlrHasEnfo(SCIP_NLHDLR *nlhdlr)
Definition: nlhdlr.c:242
#define SCIP_DECL_SORTPTRCOMP(x)
Definition: type_misc.h:188
structure definitions related to nonlinear handlers of nonlinear constraints
SCIP_Bool SCIPnlhdlrHasEstimate(SCIP_NLHDLR *nlhdlr)
Definition: nlhdlr.c:250
SCIP_Bool SCIPnlhdlrHasInitSepa(SCIP_NLHDLR *nlhdlr)
Definition: nlhdlr.c:226
SCIP_NLHDLRDATA * SCIPnlhdlrGetData(SCIP_NLHDLR *nlhdlr)
Definition: nlhdlr.c:200
#define SCIP_DECL_NLHDLREXIT(x)
Definition: type_nlhdlr.h:114
struct SCIP_NlhdlrData SCIP_NLHDLRDATA
Definition: type_nlhdlr.h:412
common defines and data types used in all packages of SCIP
void SCIPnlhdlrSetCopyHdlr(SCIP_NLHDLR *nlhdlr, SCIP_DECL_NLHDLRCOPYHDLR((*copy)))
Definition: nlhdlr.c:72