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 scip_prop.h 26 * @ingroup PUBLICCOREAPI 27 * @brief public methods for propagator plugins 28 * @author Tobias Achterberg 29 * @author Timo Berthold 30 * @author Thorsten Koch 31 * @author Alexander Martin 32 * @author Marc Pfetsch 33 * @author Kati Wolter 34 * @author Gregor Hendel 35 * @author Leona Gottwald 36 */ 37 38 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/ 39 40 #ifndef __SCIP_SCIP_PROP_H__ 41 #define __SCIP_SCIP_PROP_H__ 42 43 44 #include "scip/def.h" 45 #include "scip/type_lp.h" 46 #include "scip/type_prop.h" 47 #include "scip/type_result.h" 48 #include "scip/type_retcode.h" 49 #include "scip/type_scip.h" 50 #include "scip/type_timing.h" 51 #include "scip/type_var.h" 52 53 #ifdef __cplusplus 54 extern "C" { 55 #endif 56 57 /**@addtogroup PublicPropagatorMethods 58 * 59 * @{ 60 */ 61 62 /** creates a propagator and includes it in SCIP. 63 * 64 65 * @note method has all propagator callbacks as arguments and is thus changed every time a new 66 * callback is added in future releases; consider using SCIPincludePropBasic() and setter functions 67 * if you seek for a method which is less likely to change in future releases 68 */ 69 SCIP_EXPORT 70 SCIP_RETCODE SCIPincludeProp( 71 SCIP* scip, /**< SCIP data structure */ 72 const char* name, /**< name of propagator */ 73 const char* desc, /**< description of propagator */ 74 int priority, /**< priority of the propagator (>= 0: before, < 0: after constraint handlers) */ 75 int freq, /**< frequency for calling propagator */ 76 SCIP_Bool delay, /**< should propagator be delayed, if other propagators found reductions? */ 77 SCIP_PROPTIMING timingmask, /**< positions in the node solving loop where propagator should be executed */ 78 int presolpriority, /**< presolving priority of the propagator (>= 0: before, < 0: after constraint handlers) */ 79 int presolmaxrounds, /**< maximal number of presolving rounds the propagator participates in (-1: no limit) */ 80 SCIP_PRESOLTIMING presoltiming, /**< timing mask of the propagator's presolving method */ 81 SCIP_DECL_PROPCOPY ((*propcopy)), /**< copy method of propagator or NULL if you don't want to copy your plugin into sub-SCIPs */ 82 SCIP_DECL_PROPFREE ((*propfree)), /**< destructor of propagator */ 83 SCIP_DECL_PROPINIT ((*propinit)), /**< initialize propagator */ 84 SCIP_DECL_PROPEXIT ((*propexit)), /**< deinitialize propagator */ 85 SCIP_DECL_PROPINITPRE ((*propinitpre)), /**< presolving initialization method of propagator */ 86 SCIP_DECL_PROPEXITPRE ((*propexitpre)), /**< presolving deinitialization method of propagator */ 87 SCIP_DECL_PROPINITSOL ((*propinitsol)), /**< solving process initialization method of propagator */ 88 SCIP_DECL_PROPEXITSOL ((*propexitsol)), /**< solving process deinitialization method of propagator */ 89 SCIP_DECL_PROPPRESOL ((*proppresol)), /**< presolving method */ 90 SCIP_DECL_PROPEXEC ((*propexec)), /**< execution method of propagator */ 91 SCIP_DECL_PROPRESPROP ((*propresprop)), /**< propagation conflict resolving method */ 92 SCIP_PROPDATA* propdata /**< propagator data */ 93 ); 94 95 /** creates a propagator and includes it in SCIP. All non-fundamental (or optional) callbacks will be set to NULL. 96 * Optional callbacks can be set via specific setter functions, see SCIPsetPropInit(), SCIPsetPropExit(), 97 * SCIPsetPropCopy(), SCIPsetPropFree(), SCIPsetPropInitsol(), SCIPsetPropExitsol(), 98 * SCIPsetPropInitpre(), SCIPsetPropExitpre(), SCIPsetPropPresol(), and SCIPsetPropResprop(). 99 * 100 * @note if you want to set all callbacks with a single method call, consider using SCIPincludeProp() instead 101 */ 102 SCIP_EXPORT 103 SCIP_RETCODE SCIPincludePropBasic( 104 SCIP* scip, /**< SCIP data structure */ 105 SCIP_PROP** propptr, /**< reference to a propagator pointer, or NULL */ 106 const char* name, /**< name of propagator */ 107 const char* desc, /**< description of propagator */ 108 int priority, /**< priority of the propagator (>= 0: before, < 0: after constraint handlers) */ 109 int freq, /**< frequency for calling propagator */ 110 SCIP_Bool delay, /**< should propagator be delayed, if other propagators found reductions? */ 111 SCIP_PROPTIMING timingmask, /**< positions in the node solving loop where propagators should be executed */ 112 SCIP_DECL_PROPEXEC ((*propexec)), /**< execution method of propagator */ 113 SCIP_PROPDATA* propdata /**< propagator data */ 114 ); 115 116 /** sets copy method of propagator */ 117 SCIP_EXPORT 118 SCIP_RETCODE SCIPsetPropCopy( 119 SCIP* scip, /**< SCIP data structure */ 120 SCIP_PROP* prop, /**< propagator */ 121 SCIP_DECL_PROPCOPY ((*propcopy)) /**< copy method of propagator or NULL if you don't want to copy your plugin into sub-SCIPs */ 122 ); 123 124 /** sets destructor method of propagator */ 125 SCIP_EXPORT 126 SCIP_RETCODE SCIPsetPropFree( 127 SCIP* scip, /**< SCIP data structure */ 128 SCIP_PROP* prop, /**< propagator */ 129 SCIP_DECL_PROPFREE ((*propfree)) /**< destructor of propagator */ 130 ); 131 132 /** sets initialization method of propagator */ 133 SCIP_EXPORT 134 SCIP_RETCODE SCIPsetPropInit( 135 SCIP* scip, /**< SCIP data structure */ 136 SCIP_PROP* prop, /**< propagator */ 137 SCIP_DECL_PROPINIT ((*propinit)) /**< initialize propagator */ 138 ); 139 140 /** sets deinitialization method of propagator */ 141 SCIP_EXPORT 142 SCIP_RETCODE SCIPsetPropExit( 143 SCIP* scip, /**< SCIP data structure */ 144 SCIP_PROP* prop, /**< propagator */ 145 SCIP_DECL_PROPEXIT ((*propexit)) /**< deinitialize propagator */ 146 ); 147 148 /** sets solving process initialization method of propagator */ 149 SCIP_EXPORT 150 SCIP_RETCODE SCIPsetPropInitsol( 151 SCIP* scip, /**< SCIP data structure */ 152 SCIP_PROP* prop, /**< propagator */ 153 SCIP_DECL_PROPINITSOL((*propinitsol)) /**< solving process initialization method of propagator */ 154 ); 155 156 /** sets solving process deinitialization method of propagator */ 157 SCIP_EXPORT 158 SCIP_RETCODE SCIPsetPropExitsol( 159 SCIP* scip, /**< SCIP data structure */ 160 SCIP_PROP* prop, /**< propagator */ 161 SCIP_DECL_PROPEXITSOL ((*propexitsol)) /**< solving process deinitialization method of propagator */ 162 ); 163 164 /** sets preprocessing initialization method of propagator */ 165 SCIP_EXPORT 166 SCIP_RETCODE SCIPsetPropInitpre( 167 SCIP* scip, /**< SCIP data structure */ 168 SCIP_PROP* prop, /**< propagator */ 169 SCIP_DECL_PROPINITPRE((*propinitpre)) /**< preprocessing initialization method of propagator */ 170 ); 171 172 /** sets preprocessing deinitialization method of propagator */ 173 SCIP_EXPORT 174 SCIP_RETCODE SCIPsetPropExitpre( 175 SCIP* scip, /**< SCIP data structure */ 176 SCIP_PROP* prop, /**< propagator */ 177 SCIP_DECL_PROPEXITPRE((*propexitpre)) /**< preprocessing deinitialization method of propagator */ 178 ); 179 180 /** sets presolving method of propagator */ 181 SCIP_EXPORT 182 SCIP_RETCODE SCIPsetPropPresol( 183 SCIP* scip, /**< SCIP data structure */ 184 SCIP_PROP* prop, /**< propagator */ 185 SCIP_DECL_PROPPRESOL((*proppresol)), /**< presolving method of propagator */ 186 int presolpriority, /**< presolving priority of the propagator (>= 0: before, < 0: after constraint handlers) */ 187 int presolmaxrounds, /**< maximal number of presolving rounds the propagator participates in (-1: no limit) */ 188 SCIP_PRESOLTIMING presoltiming /**< timing mask of the propagator's presolving method */ 189 ); 190 191 /** sets propagation conflict resolving callback of propagator */ 192 SCIP_EXPORT 193 SCIP_RETCODE SCIPsetPropResprop( 194 SCIP* scip, /**< SCIP data structure */ 195 SCIP_PROP* prop, /**< propagator */ 196 SCIP_DECL_PROPRESPROP ((*propresprop)) /**< propagation conflict resolving callback */ 197 ); 198 199 /** returns the propagator of the given name, or NULL if not existing */ 200 SCIP_EXPORT 201 SCIP_PROP* SCIPfindProp( 202 SCIP* scip, /**< SCIP data structure */ 203 const char* name /**< name of propagator */ 204 ); 205 206 /** returns the array of currently available propagators */ 207 SCIP_EXPORT 208 SCIP_PROP** SCIPgetProps( 209 SCIP* scip /**< SCIP data structure */ 210 ); 211 212 /** returns the number of currently available propagators */ 213 SCIP_EXPORT 214 int SCIPgetNProps( 215 SCIP* scip /**< SCIP data structure */ 216 ); 217 218 /** sets the priority of a propagator */ 219 SCIP_EXPORT 220 SCIP_RETCODE SCIPsetPropPriority( 221 SCIP* scip, /**< SCIP data structure */ 222 SCIP_PROP* prop, /**< propagator */ 223 int priority /**< new priority of the propagator */ 224 ); 225 226 /** sets the presolving priority of a propagator */ 227 SCIP_EXPORT 228 SCIP_RETCODE SCIPsetPropPresolPriority( 229 SCIP* scip, /**< SCIP data structure */ 230 SCIP_PROP* prop, /**< propagator */ 231 int presolpriority /**< new presol priority of the propagator */ 232 ); 233 234 /** @} */ 235 236 #ifdef __cplusplus 237 } 238 #endif 239 240 #endif 241