SCIP Doxygen Documentation
 
Loading...
Searching...
No Matches
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-2023 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 */
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 */
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 */
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 */
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 */
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 */
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 */
102const char* SCIPnlhdlrGetName(
103 SCIP_NLHDLR* nlhdlr /**< nonlinear handler */
104);
105
106/** gives description of nonlinear handler, can be NULL */
108const char* SCIPnlhdlrGetDesc(
109 SCIP_NLHDLR* nlhdlr /**< nonlinear handler */
110);
111
112/** gives detection priority of nonlinear handler */
115 SCIP_NLHDLR* nlhdlr /**< nonlinear handler */
116);
117
118/** gives enforcement priority of nonlinear handler */
121 SCIP_NLHDLR* nlhdlr /**< nonlinear handler */
122);
123
124/** returns whether nonlinear handler is enabled */
126SCIP_Bool SCIPnlhdlrIsEnabled(
127 SCIP_NLHDLR* nlhdlr /**< nonlinear handler */
128);
129
130/** gives handler data of nonlinear handler */
133 SCIP_NLHDLR* nlhdlr /**< nonlinear handler */
134);
135
136/** returns whether nonlinear handler implements the interval evaluation callback */
138SCIP_Bool SCIPnlhdlrHasIntEval(
139 SCIP_NLHDLR* nlhdlr /**< nonlinear handler */
140);
141
142/** returns whether nonlinear handler implements the reverse propagation callback */
145 SCIP_NLHDLR* nlhdlr /**< nonlinear handler */
146);
147
148/** returns whether nonlinear handler implements the separation initialization callback */
150SCIP_Bool SCIPnlhdlrHasInitSepa(
151 SCIP_NLHDLR* nlhdlr /**< nonlinear handler */
152);
153
154/** returns whether nonlinear handler implements the separation deinitialization callback */
156SCIP_Bool SCIPnlhdlrHasExitSepa(
157 SCIP_NLHDLR* nlhdlr /**< nonlinear handler */
158);
159
160/** returns whether nonlinear handler implements the enforcement callback */
162SCIP_Bool SCIPnlhdlrHasEnfo(
163 SCIP_NLHDLR* nlhdlr /**< nonlinear handler */
164);
165
166/** returns whether nonlinear handler implements the estimator callback */
168SCIP_Bool SCIPnlhdlrHasEstimate(
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 */
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_ */
common defines and data types used in all packages of SCIP
void SCIPnlhdlrSetInitExit(SCIP_NLHDLR *nlhdlr, SCIP_DECL_NLHDLRINIT((*init)),)
Definition nlhdlr.c:106
const char * SCIPnlhdlrGetDesc(SCIP_NLHDLR *nlhdlr)
Definition nlhdlr.c:160
SCIP_NLHDLRDATA * SCIPnlhdlrGetData(SCIP_NLHDLR *nlhdlr)
Definition nlhdlr.c:200
void SCIPnlhdlrSetFreeExprData(SCIP_NLHDLR *nlhdlr,)
Definition nlhdlr.c:94
SCIP_Bool SCIPnlhdlrHasIntEval(SCIP_NLHDLR *nlhdlr)
Definition nlhdlr.c:210
SCIP_Bool SCIPnlhdlrHasEnfo(SCIP_NLHDLR *nlhdlr)
Definition nlhdlr.c:242
int SCIPnlhdlrGetDetectPriority(SCIP_NLHDLR *nlhdlr)
Definition nlhdlr.c:170
SCIP_Bool SCIPnlhdlrIsEnabled(SCIP_NLHDLR *nlhdlr)
Definition nlhdlr.c:190
SCIP_Bool SCIPnlhdlrHasReverseProp(SCIP_NLHDLR *nlhdlr)
Definition nlhdlr.c:218
const char * SCIPnlhdlrGetName(SCIP_NLHDLR *nlhdlr)
Definition nlhdlr.c:150
SCIP_Bool SCIPnlhdlrHasEstimate(SCIP_NLHDLR *nlhdlr)
Definition nlhdlr.c:250
void SCIPnlhdlrSetSepa(SCIP_NLHDLR *nlhdlr, SCIP_DECL_NLHDLRINITSEPA((*initsepa)), SCIP_DECL_NLHDLRENFO((*enfo)), SCIP_DECL_NLHDLRESTIMATE((*estimate)),)
Definition nlhdlr.c:132
void SCIPnlhdlrSetFreeHdlrData(SCIP_NLHDLR *nlhdlr,)
Definition nlhdlr.c:83
void SCIPnlhdlrSetCopyHdlr(SCIP_NLHDLR *nlhdlr,)
Definition nlhdlr.c:72
SCIP_Bool SCIPnlhdlrHasInitSepa(SCIP_NLHDLR *nlhdlr)
Definition nlhdlr.c:226
int SCIPnlhdlrGetEnfoPriority(SCIP_NLHDLR *nlhdlr)
Definition nlhdlr.c:180
void SCIPnlhdlrSetProp(SCIP_NLHDLR *nlhdlr, SCIP_DECL_NLHDLRINTEVAL((*inteval)),)
Definition nlhdlr.c:119
SCIP_Bool SCIPnlhdlrHasExitSepa(SCIP_NLHDLR *nlhdlr)
Definition nlhdlr.c:234
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)
struct SCIP_NlhdlrData SCIP_NLHDLRDATA
#define SCIP_DECL_NLHDLRCOPYHDLR(x)
Definition type_nlhdlr.h:70
#define SCIP_DECL_NLHDLRINIT(x)
#define SCIP_DECL_NLHDLREXIT(x)
#define SCIP_DECL_NLHDLRFREEEXPRDATA(x)
Definition type_nlhdlr.h:94
#define SCIP_DECL_NLHDLREXITSEPA(x)
#define SCIP_DECL_NLHDLRINITSEPA(x)
#define SCIP_DECL_NLHDLRFREEHDLRDATA(x)
Definition type_nlhdlr.h:82
#define SCIP_DECL_NLHDLRREVERSEPROP(x)
#define SCIP_DECL_NLHDLRENFO(x)
#define SCIP_DECL_NLHDLRINTEVAL(x)
type definitions for SCIP's main datastructure