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 cutsel.h 26 * @ingroup INTERNALAPI 27 * @brief internal methods for cut selectors 28 * @author Felipe Serrano 29 * @author Mark Turner 30 */ 31 32 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/ 33 34 #ifndef __SCIP_CUTSEL_H__ 35 #define __SCIP_CUTSEL_H__ 36 37 38 #include "scip/def.h" 39 #include "blockmemshell/memory.h" 40 #include "scip/type_retcode.h" 41 #include "scip/type_set.h" 42 #include "scip/pub_cutsel.h" 43 #include "scip/lp.h" 44 45 #ifdef __cplusplus 46 extern "C" { 47 #endif 48 49 /** creates a cut selector */ 50 SCIP_RETCODE SCIPcutselCreate( 51 SCIP_CUTSEL** cutsel, /**< pointer to store cut selector */ 52 SCIP_SET* set, /**< global SCIP settings */ 53 SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */ 54 BMS_BLKMEM* blkmem, /**< block memory for parameter settings */ 55 const char* name, /**< name of cut selector */ 56 const char* desc, /**< description of cut selector */ 57 int priority, /**< priority of the cut selector in standard mode */ 58 SCIP_DECL_CUTSELCOPY ((*cutselcopy)), /**< copy method of cut selector or NULL if you don't want to copy your plugin into sub-SCIPs */ 59 SCIP_DECL_CUTSELFREE ((*cutselfree)), /**< destructor of cut selector */ 60 SCIP_DECL_CUTSELINIT ((*cutselinit)), /**< initialize cut selector */ 61 SCIP_DECL_CUTSELEXIT ((*cutselexit)), /**< deinitialize cut selector */ 62 SCIP_DECL_CUTSELINITSOL((*cutselinitsol)),/**< solving process initialization method of cut selector */ 63 SCIP_DECL_CUTSELEXITSOL((*cutselexitsol)),/**< solving process deinitialization method of cut selector */ 64 SCIP_DECL_CUTSELSELECT((*cutselselect)), /**< cut selection method */ 65 SCIP_CUTSELDATA* cutseldata /**< cut selector data */ 66 ); 67 68 /** enables or disables all clocks of @p cutsel, depending on the value of the flag */ 69 void SCIPcutselEnableOrDisableClocks( 70 SCIP_CUTSEL* cutsel, /**< the cut selector for which all clocks should be enabled or disabled */ 71 SCIP_Bool enable /**< should the clocks of the cut selector be enabled? */ 72 ); 73 74 /** calls cut selectors to select cuts */ 75 SCIP_RETCODE SCIPcutselsSelect( 76 SCIP_SET* set, /**< global SCIP settings */ 77 SCIP_ROW** cuts, /**< array with cuts to select from */ 78 int ncuts, /**< length of cuts */ 79 int nforcedcuts, /**< number of forced cuts at start of given array */ 80 SCIP_Bool root, /**< are we at the root node? */ 81 SCIP_Bool initiallp, /**< is the separation storage currently being filled with the initial LP rows? */ 82 int maxnselectedcuts, /**< maximum number of cuts to be selected */ 83 int* nselectedcuts /**< pointer to return number of selected cuts */ 84 ); 85 86 /** copies the given cut selector to a new scip */ 87 SCIP_RETCODE SCIPcutselCopyInclude( 88 SCIP_CUTSEL* cutsel, /**< cut selector */ 89 SCIP_SET* set /**< SCIP_SET of SCIP to copy to */ 90 ); 91 92 /** sets copy method of cut selector */ 93 void SCIPcutselSetCopy( 94 SCIP_CUTSEL* cutsel, /**< cut selector */ 95 SCIP_DECL_CUTSELCOPY ((*cutselcopy)) /**< copy method of cut selector or NULL if you don't want to copy your plugin into sub-SCIPs */ 96 ); 97 98 /** initializes cut selector */ 99 SCIP_RETCODE SCIPcutselInit( 100 SCIP_CUTSEL* cutsel, /**< cut selector */ 101 SCIP_SET* set /**< global SCIP settings */ 102 ); 103 104 /** deinitializes cut selector */ 105 SCIP_RETCODE SCIPcutselExit( 106 SCIP_CUTSEL* cutsel, /**< cut selector */ 107 SCIP_SET* set /**< global SCIP settings */ 108 ); 109 110 /** frees memory of cut selector */ 111 SCIP_RETCODE SCIPcutselFree( 112 SCIP_CUTSEL** cutsel, /**< pointer to cut selector data structure */ 113 SCIP_SET* set /**< global SCIP settings */ 114 ); 115 116 /** informs cut selector that the branch and bound process is being started */ 117 SCIP_RETCODE SCIPcutselInitsol( 118 SCIP_CUTSEL* cutsel, /**< cut selector */ 119 SCIP_SET* set /**< global SCIP settings */ 120 ); 121 122 /** informs cut selector that the branch and bound process is being started */ 123 SCIP_RETCODE SCIPcutselExitsol( 124 SCIP_CUTSEL* cutsel, /**< cut selector */ 125 SCIP_SET* set /**< global SCIP settings */ 126 ); 127 128 /** sets destructor method of cut selector */ 129 void SCIPcutselSetFree( 130 SCIP_CUTSEL* cutsel, /**< cut selector */ 131 SCIP_DECL_CUTSELFREE ((*cutselfree)) /**< destructor of cut selector */ 132 ); 133 134 /** sets initialization method of cut selector */ 135 void SCIPcutselSetInit( 136 SCIP_CUTSEL* cutsel, /**< cut selector */ 137 SCIP_DECL_CUTSELINIT ((*cutselinit)) /**< initialize cut selector */ 138 ); 139 140 /** sets deinitialization method of cut selector */ 141 void SCIPcutselSetExit( 142 SCIP_CUTSEL* cutsel, /**< cut selector */ 143 SCIP_DECL_CUTSELEXIT ((*cutselexit)) /**< deinitialize cut selector */ 144 ); 145 146 /** sets solving process initialization method of cut selector */ 147 void SCIPcutselSetInitsol( 148 SCIP_CUTSEL* cutsel, /**< cut selector */ 149 SCIP_DECL_CUTSELINITSOL ((*cutselinitsol))/**< solving process initialization method of cut selector */ 150 ); 151 152 /** sets solving process deinitialization method of cut selector */ 153 void SCIPcutselSetExitsol( 154 SCIP_CUTSEL* cutsel, /**< cut selector */ 155 SCIP_DECL_CUTSELEXITSOL ((*cutselexitsol))/**< solving process deinitialization method of cut selector */ 156 ); 157 158 /** sets priority of cut selector */ 159 void SCIPcutselSetPriority( 160 SCIP_CUTSEL* cutsel, /**< cut selector */ 161 SCIP_SET* set, /**< global SCIP settings */ 162 int priority /**< new priority of the cut selector */ 163 ); 164 165 #ifdef __cplusplus 166 } 167 #endif 168 169 #endif 170