Scippy

SCIP

Solving Constraint Integer Programs

presol.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 presol.h
26 * @ingroup INTERNALAPI
27 * @brief internal methods for presolvers
28 * @author Tobias Achterberg
29 */
30
31/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
32
33#ifndef __SCIP_PRESOL_H__
34#define __SCIP_PRESOL_H__
35
36
37#include "scip/def.h"
39#include "scip/type_retcode.h"
40#include "scip/type_result.h"
41#include "scip/type_set.h"
42#include "scip/type_presol.h"
43#include "scip/type_message.h"
44#include "scip/pub_presol.h"
45
46#ifdef __cplusplus
47extern "C" {
48#endif
49
50/** copies the given presolver to a new scip */
52 SCIP_PRESOL* presol, /**< presolver */
53 SCIP_SET* set /**< SCIP_SET of SCIP to copy to */
54 );
55
56/** creates a presolver */
58 SCIP_PRESOL** presol, /**< pointer to store presolver */
59 SCIP_SET* set, /**< global SCIP settings */
60 SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
61 BMS_BLKMEM* blkmem, /**< block memory for parameter settings */
62 const char* name, /**< name of presolver */
63 const char* desc, /**< description of presolver */
64 int priority, /**< priority of the presolver (>= 0: before, < 0: after constraint handlers) */
65 int maxrounds, /**< maximal number of presolving rounds the presolver participates in (-1: no limit) */
66 SCIP_PRESOLTIMING timing, /**< timing mask of the presolver */
67 SCIP_DECL_PRESOLCOPY ((*presolcopy)), /**< copy method of presolver or NULL if you don't want to copy your plugin into sub-SCIPs */
68 SCIP_DECL_PRESOLFREE ((*presolfree)), /**< destructor of presolver to free user data (called when SCIP is exiting) */
69 SCIP_DECL_PRESOLINIT ((*presolinit)), /**< initialization method of presolver (called after problem was transformed) */
70 SCIP_DECL_PRESOLEXIT ((*presolexit)), /**< deinitialization method of presolver (called before transformed problem is freed) */
71 SCIP_DECL_PRESOLINITPRE((*presolinitpre)),/**< presolving initialization method of presolver (called when presolving is about to begin) */
72 SCIP_DECL_PRESOLEXITPRE((*presolexitpre)),/**< presolving deinitialization method of presolver (called after presolving has been finished) */
73 SCIP_DECL_PRESOLEXEC ((*presolexec)), /**< execution method of presolver */
74 SCIP_PRESOLDATA* presoldata /**< presolver data */
75 );
76
77/** frees memory of presolver */
79 SCIP_PRESOL** presol, /**< pointer to presolver data structure */
80 SCIP_SET* set /**< global SCIP settings */
81 );
82
83/** initializes presolver */
85 SCIP_PRESOL* presol, /**< presolver */
86 SCIP_SET* set /**< global SCIP settings */
87 );
88
89/** deinitializes presolver */
91 SCIP_PRESOL* presol, /**< presolver */
92 SCIP_SET* set /**< global SCIP settings */
93 );
94
95/** informs presolver that the presolving process is being started */
97 SCIP_PRESOL* presol, /**< presolver */
98 SCIP_SET* set /**< global SCIP settings */
99 );
100
101/** informs presolver that the presolving process is finished */
103 SCIP_PRESOL* presol, /**< presolver */
104 SCIP_SET* set /**< global SCIP settings */
105 );
106
107/** executes presolver */
109 SCIP_PRESOL* presol, /**< presolver */
110 SCIP_SET* set, /**< global SCIP settings */
111 SCIP_PRESOLTIMING timing, /**< current presolving timing */
112 int nrounds, /**< number of presolving rounds already done */
113 int* nfixedvars, /**< pointer to total number of variables fixed of all presolvers */
114 int* naggrvars, /**< pointer to total number of variables aggregated of all presolvers */
115 int* nchgvartypes, /**< pointer to total number of variable type changes of all presolvers */
116 int* nchgbds, /**< pointer to total number of variable bounds tightened of all presolvers */
117 int* naddholes, /**< pointer to total number of domain holes added of all presolvers */
118 int* ndelconss, /**< pointer to total number of deleted constraints of all presolvers */
119 int* naddconss, /**< pointer to total number of added constraints of all presolvers */
120 int* nupgdconss, /**< pointer to total number of upgraded constraints of all presolvers */
121 int* nchgcoefs, /**< pointer to total number of changed coefficients of all presolvers */
122 int* nchgsides, /**< pointer to total number of changed left/right hand sides of all presolvers */
123 SCIP_RESULT* result /**< pointer to store the result of the callback method */
124 );
125
126/** sets priority of presolver */
128 SCIP_PRESOL* presol, /**< presolver */
129 SCIP_SET* set, /**< global SCIP settings */
130 int priority /**< new priority of the presolver */
131 );
132
133/** sets copy method of presolver */
135 SCIP_PRESOL* presol, /**< presolver */
136 SCIP_DECL_PRESOLCOPY ((*presolcopy)) /**< copy method of presolver or NULL if you don't want to copy your plugin into sub-SCIPs */
137 );
138
139/** sets destructor method of presolver */
141 SCIP_PRESOL* presol, /**< presolver */
142 SCIP_DECL_PRESOLFREE ((*presolfree)) /**< destructor of presolver */
143 );
144
145/** sets initialization method of presolver */
147 SCIP_PRESOL* presol, /**< presolver */
148 SCIP_DECL_PRESOLINIT ((*presolinit)) /**< initialize presolver */
149 );
150
151/** sets deinitialization method of presolver */
153 SCIP_PRESOL* presol, /**< presolver */
154 SCIP_DECL_PRESOLEXIT ((*presolexit)) /**< deinitialize presolver */
155 );
156
157/** sets solving process initialization method of presolver */
159 SCIP_PRESOL* presol, /**< presolver */
160 SCIP_DECL_PRESOLINITPRE ((*presolinitpre))/**< solving process initialization method of presolver */
161 );
162
163/** sets solving process deinitialization method of presolver */
165 SCIP_PRESOL* presol, /**< presolver */
166 SCIP_DECL_PRESOLEXITPRE ((*presolexitpre))/**< solving process deinitialization method of presolver */
167 );
168
169/** enables or disables all clocks of \p presol, depending on the value of the flag */
171 SCIP_PRESOL* presol, /**< the presolver for which all clocks should be enabled or disabled */
172 SCIP_Bool enable /**< should the clocks of the presolver be enabled? */
173 );
174
175#ifdef __cplusplus
176}
177#endif
178
179#endif
common defines and data types used in all packages of SCIP
#define SCIP_Bool
Definition: def.h:91
memory allocation routines
struct BMS_BlkMem BMS_BLKMEM
Definition: memory.h:437
void SCIPpresolSetExitpre(SCIP_PRESOL *presol, SCIP_DECL_PRESOLEXITPRE((*presolexitpre)))
Definition: presol.c:588
SCIP_RETCODE SCIPpresolFree(SCIP_PRESOL **presol, SCIP_SET *set)
Definition: presol.c:212
void SCIPpresolEnableOrDisableClocks(SCIP_PRESOL *presol, SCIP_Bool enable)
Definition: presol.c:685
void SCIPpresolSetPriority(SCIP_PRESOL *presol, SCIP_SET *set, int priority)
Definition: presol.c:639
SCIP_RETCODE SCIPpresolExitpre(SCIP_PRESOL *presol, SCIP_SET *set)
Definition: presol.c:364
void SCIPpresolSetExit(SCIP_PRESOL *presol, SCIP_DECL_PRESOLEXIT((*presolexit)))
Definition: presol.c:566
SCIP_RETCODE SCIPpresolExit(SCIP_PRESOL *presol, SCIP_SET *set)
Definition: presol.c:298
void SCIPpresolSetInitpre(SCIP_PRESOL *presol, SCIP_DECL_PRESOLINITPRE((*presolinitpre)))
Definition: presol.c:577
SCIP_RETCODE SCIPpresolCreate(SCIP_PRESOL **presol, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, int priority, int maxrounds, SCIP_PRESOLTIMING timing, SCIP_DECL_PRESOLCOPY((*presolcopy)), SCIP_DECL_PRESOLFREE((*presolfree)), SCIP_DECL_PRESOLINIT((*presolinit)), SCIP_DECL_PRESOLEXIT((*presolexit)), SCIP_DECL_PRESOLINITPRE((*presolinitpre)), SCIP_DECL_PRESOLEXITPRE((*presolexitpre)), SCIP_DECL_PRESOLEXEC((*presolexec)), SCIP_PRESOLDATA *presoldata)
Definition: presol.c:180
void SCIPpresolSetCopy(SCIP_PRESOL *presol, SCIP_DECL_PRESOLCOPY((*presolcopy)))
Definition: presol.c:533
SCIP_RETCODE SCIPpresolInit(SCIP_PRESOL *presol, SCIP_SET *set)
Definition: presol.c:239
SCIP_RETCODE SCIPpresolExec(SCIP_PRESOL *presol, SCIP_SET *set, SCIP_PRESOLTIMING timing, int nrounds, int *nfixedvars, int *naggrvars, int *nchgvartypes, int *nchgbds, int *naddholes, int *ndelconss, int *naddconss, int *nupgdconss, int *nchgcoefs, int *nchgsides, SCIP_RESULT *result)
Definition: presol.c:388
SCIP_RETCODE SCIPpresolCopyInclude(SCIP_PRESOL *presol, SCIP_SET *set)
Definition: presol.c:84
void SCIPpresolSetFree(SCIP_PRESOL *presol, SCIP_DECL_PRESOLFREE((*presolfree)))
Definition: presol.c:544
void SCIPpresolSetInit(SCIP_PRESOL *presol, SCIP_DECL_PRESOLINIT((*presolinit)))
Definition: presol.c:555
SCIP_RETCODE SCIPpresolInitpre(SCIP_PRESOL *presol, SCIP_SET *set)
Definition: presol.c:329
public methods for presolvers
Definition: heur_padm.c:135
type definitions for message output methods
type definitions for presolvers
#define SCIP_DECL_PRESOLCOPY(x)
Definition: type_presol.h:60
struct SCIP_PresolData SCIP_PRESOLDATA
Definition: type_presol.h:51
#define SCIP_DECL_PRESOLFREE(x)
Definition: type_presol.h:68
#define SCIP_DECL_PRESOLINITPRE(x)
Definition: type_presol.h:98
#define SCIP_DECL_PRESOLEXITPRE(x)
Definition: type_presol.h:116
#define SCIP_DECL_PRESOLINIT(x)
Definition: type_presol.h:76
#define SCIP_DECL_PRESOLEXIT(x)
Definition: type_presol.h:84
#define SCIP_DECL_PRESOLEXEC(x)
Definition: type_presol.h:167
result codes for SCIP callback methods
enum SCIP_Result SCIP_RESULT
Definition: type_result.h:61
type definitions for return codes for SCIP methods
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63
type definitions for global SCIP settings
unsigned int SCIP_PRESOLTIMING
Definition: type_timing.h:61