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 sepa.h 26 * @ingroup INTERNALAPI 27 * @brief internal methods for separators 28 * @author Tobias Achterberg 29 */ 30 31 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/ 32 33 #ifndef __SCIP_SEPA_H__ 34 #define __SCIP_SEPA_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_stat.h" 43 #include "scip/type_sepastore.h" 44 #include "scip/type_sepa.h" 45 #include "scip/pub_sepa.h" 46 47 #ifdef __cplusplus 48 extern "C" { 49 #endif 50 51 /** copies the given separator to a new scip */ 52 SCIP_RETCODE SCIPsepaCopyInclude( 53 SCIP_SEPA* sepa, /**< separator */ 54 SCIP_SET* set /**< SCIP_SET of SCIP to copy to */ 55 ); 56 57 /** creates a separator */ 58 SCIP_RETCODE SCIPsepaCreate( 59 SCIP_SEPA** sepa, /**< pointer to separator data structure */ 60 SCIP_SET* set, /**< global SCIP settings */ 61 SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */ 62 BMS_BLKMEM* blkmem, /**< block memory for parameter settings */ 63 const char* name, /**< name of separator */ 64 const char* desc, /**< description of separator */ 65 int priority, /**< priority of separator (>= 0: before, < 0: after constraint handlers) */ 66 int freq, /**< frequency for calling separator */ 67 SCIP_Real maxbounddist, /**< maximal relative distance from current node's dual bound to primal bound compared 68 * to best node's dual bound for applying separation */ 69 SCIP_Bool usessubscip, /**< does the separator use a secondary SCIP instance? */ 70 SCIP_Bool delay, /**< should separator be delayed, if other separators found cuts? */ 71 SCIP_DECL_SEPACOPY ((*sepacopy)), /**< copy method of separator or NULL if you don't want to copy your plugin into sub-SCIPs */ 72 SCIP_DECL_SEPAFREE ((*sepafree)), /**< destructor of separator */ 73 SCIP_DECL_SEPAINIT ((*sepainit)), /**< initialize separator */ 74 SCIP_DECL_SEPAEXIT ((*sepaexit)), /**< deinitialize separator */ 75 SCIP_DECL_SEPAINITSOL ((*sepainitsol)), /**< solving process initialization method of separator */ 76 SCIP_DECL_SEPAEXITSOL ((*sepaexitsol)), /**< solving process deinitialization method of separator */ 77 SCIP_DECL_SEPAEXECLP ((*sepaexeclp)), /**< LP solution separation method of separator */ 78 SCIP_DECL_SEPAEXECSOL ((*sepaexecsol)), /**< arbitrary primal solution separation method of separator */ 79 SCIP_SEPADATA* sepadata /**< separator data */ 80 ); 81 82 /** calls destructor and frees memory of separator */ 83 SCIP_RETCODE SCIPsepaFree( 84 SCIP_SEPA** sepa, /**< pointer to separator data structure */ 85 SCIP_SET* set /**< global SCIP settings */ 86 ); 87 88 /** initializes separator */ 89 SCIP_RETCODE SCIPsepaInit( 90 SCIP_SEPA* sepa, /**< separator */ 91 SCIP_SET* set /**< global SCIP settings */ 92 ); 93 94 /** calls exit method of separator */ 95 SCIP_RETCODE SCIPsepaExit( 96 SCIP_SEPA* sepa, /**< separator */ 97 SCIP_SET* set /**< global SCIP settings */ 98 ); 99 100 /** informs separator that the branch and bound process is being started */ 101 SCIP_RETCODE SCIPsepaInitsol( 102 SCIP_SEPA* sepa, /**< separator */ 103 SCIP_SET* set /**< global SCIP settings */ 104 ); 105 106 /** informs separator that the branch and bound process data is being freed */ 107 SCIP_RETCODE SCIPsepaExitsol( 108 SCIP_SEPA* sepa, /**< separator */ 109 SCIP_SET* set /**< global SCIP settings */ 110 ); 111 112 /** calls LP separation method of separator */ 113 SCIP_RETCODE SCIPsepaExecLP( 114 SCIP_SEPA* sepa, /**< separator */ 115 SCIP_SET* set, /**< global SCIP settings */ 116 SCIP_STAT* stat, /**< dynamic problem statistics */ 117 SCIP_SEPASTORE* sepastore, /**< separation storage */ 118 int depth, /**< depth of current node */ 119 SCIP_Real bounddist, /**< current relative distance of local dual bound to global dual bound */ 120 SCIP_Bool allowlocal, /**< should the separator be asked to separate local cuts */ 121 SCIP_Bool execdelayed, /**< execute separator even if it is marked to be delayed */ 122 SCIP_RESULT* result /**< pointer to store the result of the callback method */ 123 ); 124 125 /** calls primal solution separation method of separator */ 126 SCIP_RETCODE SCIPsepaExecSol( 127 SCIP_SEPA* sepa, /**< separator */ 128 SCIP_SET* set, /**< global SCIP settings */ 129 SCIP_STAT* stat, /**< dynamic problem statistics */ 130 SCIP_SEPASTORE* sepastore, /**< separation storage */ 131 SCIP_SOL* sol, /**< primal solution that should be separated */ 132 int depth, /**< depth of current node */ 133 SCIP_Bool allowlocal, /**< should the separator be asked to separate local cuts */ 134 SCIP_Bool execdelayed, /**< execute separator even if it is marked to be delayed */ 135 SCIP_RESULT* result /**< pointer to store the result of the callback method */ 136 ); 137 138 /** sets priority of separator */ 139 void SCIPsepaSetPriority( 140 SCIP_SEPA* sepa, /**< separator */ 141 SCIP_SET* set, /**< global SCIP settings */ 142 int priority /**< new priority of the separator */ 143 ); 144 145 /** sets copy method of separator */ 146 void SCIPsepaSetCopy( 147 SCIP_SEPA* sepa, /**< separator */ 148 SCIP_DECL_SEPACOPY ((*sepacopy)) /**< copy method of separator or NULL if you don't want to copy your plugin into sub-SCIPs */ 149 ); 150 151 /** sets destructor method of separator */ 152 void SCIPsepaSetFree( 153 SCIP_SEPA* sepa, /**< separator */ 154 SCIP_DECL_SEPAFREE ((*sepafree)) /**< destructor of separator */ 155 ); 156 157 /** sets initialization method of separator */ 158 void SCIPsepaSetInit( 159 SCIP_SEPA* sepa, /**< separator */ 160 SCIP_DECL_SEPAINIT ((*sepainit)) /**< initialize separator */ 161 ); 162 163 /** sets deinitialization method of separator */ 164 void SCIPsepaSetExit( 165 SCIP_SEPA* sepa, /**< separator */ 166 SCIP_DECL_SEPAEXIT ((*sepaexit)) /**< deinitialize separator */ 167 ); 168 169 /** sets solving process initialization method of separator */ 170 void SCIPsepaSetInitsol( 171 SCIP_SEPA* sepa, /**< separator */ 172 SCIP_DECL_SEPAINITSOL ((*sepainitsol)) /**< solving process initialization method of separator */ 173 ); 174 175 /** sets solving process deinitialization method of separator */ 176 void SCIPsepaSetExitsol( 177 SCIP_SEPA* sepa, /**< separator */ 178 SCIP_DECL_SEPAEXITSOL ((*sepaexitsol)) /**< solving process deinitialization method of separator */ 179 ); 180 181 /** declares separator to be a parent separator */ 182 void SCIPsepaSetIsParentsepa( 183 SCIP_SEPA* sepa /**< separator */ 184 ); 185 186 /** sets the parent separator */ 187 void SCIPsepaSetParentsepa( 188 SCIP_SEPA* sepa, /**< separator */ 189 SCIP_SEPA* parentsepa /**< parent separator */ 190 ); 191 192 /** enables or disables all clocks of \p sepa, depending on the value of the flag */ 193 void SCIPsepaEnableOrDisableClocks( 194 SCIP_SEPA* sepa, /**< the separator for which all clocks should be enabled or disabled */ 195 SCIP_Bool enable /**< should the clocks of the separator be enabled? */ 196 ); 197 198 /** increase count of applied cuts by one */ 199 void SCIPsepaIncNCutsApplied( 200 SCIP_SEPA* sepa, /**< separator */ 201 SCIP_Bool fromcutpool /**< whether the cuts were added from the cutpool to sepastore */ 202 ); 203 204 /** increase count of found cuts by one */ 205 void SCIPsepaIncNCutsAdded( 206 SCIP_SEPA* sepa, /**< separator */ 207 SCIP_Bool fromcutpool /**< whether the cuts were added from the cutpool to sepastore */ 208 ); 209 210 /** decrease the count of added cuts by one */ 211 void SCIPsepaDecNCutsAdded( 212 SCIP_SEPA* sepa, /**< separator */ 213 SCIP_Bool fromcutpool /**< whether the cuts were added from the cutpool to sepastore */ 214 ); 215 216 /** increase count of found cuts by one */ 217 void SCIPsepaIncNCutsFound( 218 SCIP_SEPA* sepa /**< separator */ 219 ); 220 221 /** increase count of found cuts at current node by one */ 222 void SCIPsepaIncNCutsFoundAtNode( 223 SCIP_SEPA* sepa /**< separator */ 224 ); 225 226 #ifdef __cplusplus 227 } 228 #endif 229 230 #endif 231