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 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" 38 #include "blockmemshell/memory.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/pub_presol.h" 44 45 #ifdef __cplusplus 46 extern "C" { 47 #endif 48 49 /** copies the given presolver to a new scip */ 50 SCIP_RETCODE SCIPpresolCopyInclude( 51 SCIP_PRESOL* presol, /**< presolver */ 52 SCIP_SET* set /**< SCIP_SET of SCIP to copy to */ 53 ); 54 55 /** creates a presolver */ 56 SCIP_RETCODE SCIPpresolCreate( 57 SCIP_PRESOL** presol, /**< pointer to store presolver */ 58 SCIP_SET* set, /**< global SCIP settings */ 59 SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */ 60 BMS_BLKMEM* blkmem, /**< block memory for parameter settings */ 61 const char* name, /**< name of presolver */ 62 const char* desc, /**< description of presolver */ 63 int priority, /**< priority of the presolver (>= 0: before, < 0: after constraint handlers) */ 64 int maxrounds, /**< maximal number of presolving rounds the presolver participates in (-1: no limit) */ 65 SCIP_PRESOLTIMING timing, /**< timing mask of the presolver */ 66 SCIP_DECL_PRESOLCOPY ((*presolcopy)), /**< copy method of presolver or NULL if you don't want to copy your plugin into sub-SCIPs */ 67 SCIP_DECL_PRESOLFREE ((*presolfree)), /**< destructor of presolver to free user data (called when SCIP is exiting) */ 68 SCIP_DECL_PRESOLINIT ((*presolinit)), /**< initialization method of presolver (called after problem was transformed) */ 69 SCIP_DECL_PRESOLEXIT ((*presolexit)), /**< deinitialization method of presolver (called before transformed problem is freed) */ 70 SCIP_DECL_PRESOLINITPRE((*presolinitpre)),/**< presolving initialization method of presolver (called when presolving is about to begin) */ 71 SCIP_DECL_PRESOLEXITPRE((*presolexitpre)),/**< presolving deinitialization method of presolver (called after presolving has been finished) */ 72 SCIP_DECL_PRESOLEXEC ((*presolexec)), /**< execution method of presolver */ 73 SCIP_PRESOLDATA* presoldata /**< presolver data */ 74 ); 75 76 /** frees memory of presolver */ 77 SCIP_RETCODE SCIPpresolFree( 78 SCIP_PRESOL** presol, /**< pointer to presolver data structure */ 79 SCIP_SET* set /**< global SCIP settings */ 80 ); 81 82 /** initializes presolver */ 83 SCIP_RETCODE SCIPpresolInit( 84 SCIP_PRESOL* presol, /**< presolver */ 85 SCIP_SET* set /**< global SCIP settings */ 86 ); 87 88 /** deinitializes presolver */ 89 SCIP_RETCODE SCIPpresolExit( 90 SCIP_PRESOL* presol, /**< presolver */ 91 SCIP_SET* set /**< global SCIP settings */ 92 ); 93 94 /** informs presolver that the presolving process is being started */ 95 SCIP_RETCODE SCIPpresolInitpre( 96 SCIP_PRESOL* presol, /**< presolver */ 97 SCIP_SET* set /**< global SCIP settings */ 98 ); 99 100 /** informs presolver that the presolving process is finished */ 101 SCIP_RETCODE SCIPpresolExitpre( 102 SCIP_PRESOL* presol, /**< presolver */ 103 SCIP_SET* set /**< global SCIP settings */ 104 ); 105 106 /** executes presolver */ 107 SCIP_RETCODE SCIPpresolExec( 108 SCIP_PRESOL* presol, /**< presolver */ 109 SCIP_SET* set, /**< global SCIP settings */ 110 SCIP_PRESOLTIMING timing, /**< current presolving timing */ 111 int nrounds, /**< number of presolving rounds already done */ 112 int* nfixedvars, /**< pointer to total number of variables fixed of all presolvers */ 113 int* naggrvars, /**< pointer to total number of variables aggregated of all presolvers */ 114 int* nchgvartypes, /**< pointer to total number of variable type changes of all presolvers */ 115 int* nchgbds, /**< pointer to total number of variable bounds tightened of all presolvers */ 116 int* naddholes, /**< pointer to total number of domain holes added of all presolvers */ 117 int* ndelconss, /**< pointer to total number of deleted constraints of all presolvers */ 118 int* naddconss, /**< pointer to total number of added constraints of all presolvers */ 119 int* nupgdconss, /**< pointer to total number of upgraded constraints of all presolvers */ 120 int* nchgcoefs, /**< pointer to total number of changed coefficients of all presolvers */ 121 int* nchgsides, /**< pointer to total number of changed left/right hand sides of all presolvers */ 122 SCIP_RESULT* result /**< pointer to store the result of the callback method */ 123 ); 124 125 /** sets priority of presolver */ 126 void SCIPpresolSetPriority( 127 SCIP_PRESOL* presol, /**< presolver */ 128 SCIP_SET* set, /**< global SCIP settings */ 129 int priority /**< new priority of the presolver */ 130 ); 131 132 /** sets copy method of presolver */ 133 void SCIPpresolSetCopy( 134 SCIP_PRESOL* presol, /**< presolver */ 135 SCIP_DECL_PRESOLCOPY ((*presolcopy)) /**< copy method of presolver or NULL if you don't want to copy your plugin into sub-SCIPs */ 136 ); 137 138 /** sets destructor method of presolver */ 139 void SCIPpresolSetFree( 140 SCIP_PRESOL* presol, /**< presolver */ 141 SCIP_DECL_PRESOLFREE ((*presolfree)) /**< destructor of presolver */ 142 ); 143 144 /** sets initialization method of presolver */ 145 void SCIPpresolSetInit( 146 SCIP_PRESOL* presol, /**< presolver */ 147 SCIP_DECL_PRESOLINIT ((*presolinit)) /**< initialize presolver */ 148 ); 149 150 /** sets deinitialization method of presolver */ 151 void SCIPpresolSetExit( 152 SCIP_PRESOL* presol, /**< presolver */ 153 SCIP_DECL_PRESOLEXIT ((*presolexit)) /**< deinitialize presolver */ 154 ); 155 156 /** sets solving process initialization method of presolver */ 157 void SCIPpresolSetInitpre( 158 SCIP_PRESOL* presol, /**< presolver */ 159 SCIP_DECL_PRESOLINITPRE ((*presolinitpre))/**< solving process initialization method of presolver */ 160 ); 161 162 /** sets solving process deinitialization method of presolver */ 163 void SCIPpresolSetExitpre( 164 SCIP_PRESOL* presol, /**< presolver */ 165 SCIP_DECL_PRESOLEXITPRE ((*presolexitpre))/**< solving process deinitialization method of presolver */ 166 ); 167 168 /** enables or disables all clocks of \p presol, depending on the value of the flag */ 169 void SCIPpresolEnableOrDisableClocks( 170 SCIP_PRESOL* presol, /**< the presolver for which all clocks should be enabled or disabled */ 171 SCIP_Bool enable /**< should the clocks of the presolver be enabled? */ 172 ); 173 174 #ifdef __cplusplus 175 } 176 #endif 177 178 #endif 179