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-2024 Zuse Institute Berlin (ZIB) */
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
46extern "C" {
47#endif
48
49/**@addtogroup PublicNlhdlrInterfaceMethods
50 * @{
51 */
52
53/** sets the copy handler callback of a nonlinear handler */
54SCIP_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 */
61SCIP_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 */
68SCIP_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 */
75SCIP_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 */
83SCIP_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 */
91SCIP_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/** sets the solution linearization callback of a nonlinear handler */
101SCIP_EXPORT
103 SCIP_NLHDLR* nlhdlr, /**< nonlinear handler */
104 SCIP_DECL_NLHDLRSOLLINEARIZE((*sollinearize)) /**< solution linearization callback */
105);
106
107/** gives name of nonlinear handler */
108SCIP_EXPORT
109const char* SCIPnlhdlrGetName(
110 SCIP_NLHDLR* nlhdlr /**< nonlinear handler */
111);
112
113/** gives description of nonlinear handler, can be NULL */
114SCIP_EXPORT
115const char* SCIPnlhdlrGetDesc(
116 SCIP_NLHDLR* nlhdlr /**< nonlinear handler */
117);
118
119/** gives detection priority of nonlinear handler */
120SCIP_EXPORT
122 SCIP_NLHDLR* nlhdlr /**< nonlinear handler */
123);
124
125/** gives enforcement priority of nonlinear handler */
126SCIP_EXPORT
128 SCIP_NLHDLR* nlhdlr /**< nonlinear handler */
129);
130
131/** returns whether nonlinear handler is enabled */
132SCIP_EXPORT
134 SCIP_NLHDLR* nlhdlr /**< nonlinear handler */
135);
136
137/** gives handler data of nonlinear handler */
138SCIP_EXPORT
140 SCIP_NLHDLR* nlhdlr /**< nonlinear handler */
141);
142
143/** returns whether nonlinear handler implements the interval evaluation callback */
144SCIP_EXPORT
146 SCIP_NLHDLR* nlhdlr /**< nonlinear handler */
147);
148
149/** returns whether nonlinear handler implements the reverse propagation callback */
150SCIP_EXPORT
152 SCIP_NLHDLR* nlhdlr /**< nonlinear handler */
153);
154
155/** returns whether nonlinear handler implements the separation initialization callback */
156SCIP_EXPORT
158 SCIP_NLHDLR* nlhdlr /**< nonlinear handler */
159);
160
161/** returns whether nonlinear handler implements the separation deinitialization callback */
162SCIP_EXPORT
164 SCIP_NLHDLR* nlhdlr /**< nonlinear handler */
165);
166
167/** returns whether nonlinear handler implements the enforcement callback */
168SCIP_EXPORT
170 SCIP_NLHDLR* nlhdlr /**< nonlinear handler */
171);
172
173/** returns whether nonlinear handler implements the estimator callback */
174SCIP_EXPORT
176 SCIP_NLHDLR* nlhdlr /**< nonlinear handler */
177);
178
179/** returns whether nonlinear handler implements the solution linearization callback */
180SCIP_EXPORT
182 SCIP_NLHDLR* nlhdlr /**< nonlinear handler */
183);
184
185/** compares two nonlinear handlers by detection priority
186 *
187 * if handlers have same detection priority, then compare by name
188 */
189SCIP_DECL_SORTPTRCOMP(SCIPnlhdlrComp);
190
191#ifdef NDEBUG
192/* If NDEBUG is defined, the function calls are overwritten by defines to reduce the number of function calls and
193 * speed up the algorithms.
194 */
195#define SCIPnlhdlrSetCopyHdlr(nlhdlr, copy) (nlhdlr)->copyhdlr = copy
196#define SCIPnlhdlrSetFreeHdlrData(nlhdlr, freehdlrdata_) (nlhdlr)->freehdlrdata = freehdlrdata_
197#define SCIPnlhdlrSetFreeExprData(nlhdlr, freeexprdata_) (nlhdlr)->freeexprdata = freeexprdata_
198#define SCIPnlhdlrSetInitExit(nlhdlr, init_, exit_) do { (nlhdlr)->init = init_; nlhdlr->exit = exit_; } while (FALSE)
199#define SCIPnlhdlrSetProp(nlhdlr, inteval_, reverseprop_) do { (nlhdlr)->inteval = inteval_; nlhdlr->reverseprop = reverseprop_; } while (FALSE)
200#define SCIPnlhdlrSetSepa(nlhdlr, initsepa_, enfo_, estimate_, exitsepa_) do { (nlhdlr)->initsepa = initsepa_; (nlhdlr)->enfo = enfo_; (nlhdlr)->estimate = estimate_; (nlhdlr)->exitsepa = exitsepa_; } while (FALSE);
201#define SCIPnlhdlrSetSollinearize(nlhdlr, sollinearize_) (nlhdlr)->sollinearize = sollinearize_
202#define SCIPnlhdlrGetName(nlhdlr) (nlhdlr)->name
203#define SCIPnlhdlrGetDesc(nlhdlr) (nlhdlr)->desc
204#define SCIPnlhdlrGetDetectPriority(nlhdlr) (nlhdlr)->detectpriority
205#define SCIPnlhdlrGetEnfoPriority(nlhdlr) (nlhdlr)->enfopriority
206#define SCIPnlhdlrIsEnabled(nlhdlr) (nlhdlr)->enabled
207#define SCIPnlhdlrGetData(nlhdlr) (nlhdlr)->data
208#define SCIPnlhdlrHasIntEval(nlhdlr) ((nlhdlr)->inteval != NULL)
209#define SCIPnlhdlrHasReverseProp(nlhdlr) ((nlhdlr)->reverseprop != NULL)
210#define SCIPnlhdlrHasInitSepa(nlhdlr) ((nlhdlr)->initsepa != NULL)
211#define SCIPnlhdlrHasExitSepa(nlhdlr) ((nlhdlr)->exitsepa != NULL)
212#define SCIPnlhdlrHasEnfo(nlhdlr) ((nlhdlr)->enfo != NULL)
213#define SCIPnlhdlrHasEstimate(nlhdlr) ((nlhdlr)->estimate != NULL)
214#define SCIPnlhdlrHasSollinearize(nlhdlr) ((nlhdlr)->sollinearize != NULL)
215#endif
216
217/** @} */
218
219#ifdef __cplusplus
220}
221#endif
222
223#endif /* SCIP_PUB_NLHDLR_H_ */
common defines and data types used in all packages of SCIP
#define SCIP_Bool
Definition: def.h:91
void SCIPnlhdlrSetCopyHdlr(SCIP_NLHDLR *nlhdlr, SCIP_DECL_NLHDLRCOPYHDLR((*copy)))
Definition: nlhdlr.c:76
void SCIPnlhdlrSetFreeExprData(SCIP_NLHDLR *nlhdlr, SCIP_DECL_NLHDLRFREEEXPRDATA((*freeexprdata)))
Definition: nlhdlr.c:98
void SCIPnlhdlrSetProp(SCIP_NLHDLR *nlhdlr, SCIP_DECL_NLHDLRINTEVAL((*inteval)), SCIP_DECL_NLHDLRREVERSEPROP((*reverseprop)))
Definition: nlhdlr.c:123
const char * SCIPnlhdlrGetDesc(SCIP_NLHDLR *nlhdlr)
Definition: nlhdlr.c:176
void SCIPnlhdlrSetSollinearize(SCIP_NLHDLR *nlhdlr, SCIP_DECL_NLHDLRSOLLINEARIZE((*sollinearize)))
Definition: nlhdlr.c:154
SCIP_NLHDLRDATA * SCIPnlhdlrGetData(SCIP_NLHDLR *nlhdlr)
Definition: nlhdlr.c:216
SCIP_Bool SCIPnlhdlrHasIntEval(SCIP_NLHDLR *nlhdlr)
Definition: nlhdlr.c:226
SCIP_Bool SCIPnlhdlrHasEnfo(SCIP_NLHDLR *nlhdlr)
Definition: nlhdlr.c:266
int SCIPnlhdlrGetDetectPriority(SCIP_NLHDLR *nlhdlr)
Definition: nlhdlr.c:186
void SCIPnlhdlrSetFreeHdlrData(SCIP_NLHDLR *nlhdlr, SCIP_DECL_NLHDLRFREEHDLRDATA((*freehdlrdata)))
Definition: nlhdlr.c:87
void SCIPnlhdlrSetSepa(SCIP_NLHDLR *nlhdlr, SCIP_DECL_NLHDLRINITSEPA((*initsepa)), SCIP_DECL_NLHDLRENFO((*enfo)), SCIP_DECL_NLHDLRESTIMATE((*estimate)), SCIP_DECL_NLHDLREXITSEPA((*exitsepa)))
Definition: nlhdlr.c:136
SCIP_Bool SCIPnlhdlrIsEnabled(SCIP_NLHDLR *nlhdlr)
Definition: nlhdlr.c:206
SCIP_Bool SCIPnlhdlrHasReverseProp(SCIP_NLHDLR *nlhdlr)
Definition: nlhdlr.c:236
const char * SCIPnlhdlrGetName(SCIP_NLHDLR *nlhdlr)
Definition: nlhdlr.c:166
SCIP_Bool SCIPnlhdlrHasSollinearize(SCIP_NLHDLR *nlhdlr)
Definition: nlhdlr.c:286
SCIP_Bool SCIPnlhdlrHasEstimate(SCIP_NLHDLR *nlhdlr)
Definition: nlhdlr.c:276
SCIP_Bool SCIPnlhdlrHasInitSepa(SCIP_NLHDLR *nlhdlr)
Definition: nlhdlr.c:246
int SCIPnlhdlrGetEnfoPriority(SCIP_NLHDLR *nlhdlr)
Definition: nlhdlr.c:196
SCIP_Bool SCIPnlhdlrHasExitSepa(SCIP_NLHDLR *nlhdlr)
Definition: nlhdlr.c:256
void SCIPnlhdlrSetInitExit(SCIP_NLHDLR *nlhdlr, SCIP_DECL_NLHDLRINIT((*init)), SCIP_DECL_NLHDLREXIT((*exit)))
structure definitions related to nonlinear handlers of nonlinear constraints
#define SCIP_DECL_SORTPTRCOMP(x)
Definition: type_misc.h:188
type definitions related to nonlinear handlers of nonlinear constraints
#define SCIP_DECL_NLHDLRESTIMATE(x)
Definition: type_nlhdlr.h:408
struct SCIP_NlhdlrData SCIP_NLHDLRDATA
Definition: type_nlhdlr.h:452
#define SCIP_DECL_NLHDLRCOPYHDLR(x)
Definition: type_nlhdlr.h:70
#define SCIP_DECL_NLHDLRINIT(x)
Definition: type_nlhdlr.h:105
#define SCIP_DECL_NLHDLRSOLLINEARIZE(x)
Definition: type_nlhdlr.h:439
#define SCIP_DECL_NLHDLREXIT(x)
Definition: type_nlhdlr.h:114
#define SCIP_DECL_NLHDLRFREEEXPRDATA(x)
Definition: type_nlhdlr.h:94
#define SCIP_DECL_NLHDLREXITSEPA(x)
Definition: type_nlhdlr.h:290
#define SCIP_DECL_NLHDLRINITSEPA(x)
Definition: type_nlhdlr.h:270
#define SCIP_DECL_NLHDLRFREEHDLRDATA(x)
Definition: type_nlhdlr.h:82
#define SCIP_DECL_NLHDLRREVERSEPROP(x)
Definition: type_nlhdlr.h:246
#define SCIP_DECL_NLHDLRENFO(x)
Definition: type_nlhdlr.h:362
#define SCIP_DECL_NLHDLRINTEVAL(x)
Definition: type_nlhdlr.h:222
type definitions for SCIP's main datastructure