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_relax.h 26 * @ingroup PUBLICCOREAPI 27 * @brief public methods for relaxator 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_RELAX_H__ 41 #define __SCIP_SCIP_RELAX_H__ 42 43 44 #include "scip/def.h" 45 #include "scip/type_relax.h" 46 #include "scip/type_result.h" 47 #include "scip/type_retcode.h" 48 #include "scip/type_scip.h" 49 50 #ifdef __cplusplus 51 extern "C" { 52 #endif 53 54 /**@addtogroup PublicRelaxatorMethods 55 * 56 * @{ 57 */ 58 59 /** creates a relaxation handler and includes it in SCIP 60 * 61 * @note method has all relaxation handler callbacks as arguments and is thus changed every time a new 62 * callback is added 63 * in future releases; consider using SCIPincludeRelaxBasic() and setter functions 64 * if you seek for a method which is less likely to change in future releases 65 */ 66 SCIP_EXPORT 67 SCIP_RETCODE SCIPincludeRelax( 68 SCIP* scip, /**< SCIP data structure */ 69 const char* name, /**< name of relaxation handler */ 70 const char* desc, /**< description of relaxation handler */ 71 int priority, /**< priority of the relaxation handler (negative: after LP, non-negative: before LP) */ 72 int freq, /**< frequency for calling relaxation handler */ 73 SCIP_DECL_RELAXCOPY ((*relaxcopy)), /**< copy method of relaxation handler or NULL if you don't want to copy your plugin into sub-SCIPs */ 74 SCIP_DECL_RELAXFREE ((*relaxfree)), /**< destructor of relaxation handler */ 75 SCIP_DECL_RELAXINIT ((*relaxinit)), /**< initialize relaxation handler */ 76 SCIP_DECL_RELAXEXIT ((*relaxexit)), /**< deinitialize relaxation handler */ 77 SCIP_DECL_RELAXINITSOL((*relaxinitsol)), /**< solving process initialization method of relaxation handler */ 78 SCIP_DECL_RELAXEXITSOL((*relaxexitsol)), /**< solving process deinitialization method of relaxation handler */ 79 SCIP_DECL_RELAXEXEC ((*relaxexec)), /**< execution method of relaxation handler */ 80 SCIP_RELAXDATA* relaxdata /**< relaxation handler data */ 81 ); 82 83 /** creates a relaxation handler and includes it in SCIP. All non fundamental 84 * (or optional) callbacks as, e.g., init and exit callbacks, will be set to NULL. 85 * Optional callbacks can be set via specific setter functions, see SCIPsetRelaxInit(), SCIPsetRelaxExit(), 86 * SCIPsetRelaxCopy(), SCIPsetRelaxFree(), SCIPsetRelaxInitsol(), and SCIPsetRelaxExitsol() 87 * 88 * @note if you want to set all callbacks with a single method call, consider using SCIPincludeRelax() instead 89 */ 90 SCIP_EXPORT 91 SCIP_RETCODE SCIPincludeRelaxBasic( 92 SCIP* scip, /**< SCIP data structure */ 93 SCIP_RELAX** relaxptr, /**< reference to relaxation pointer, or NULL */ 94 const char* name, /**< name of relaxation handler */ 95 const char* desc, /**< description of relaxation handler */ 96 int priority, /**< priority of the relaxation handler (negative: after LP, non-negative: before LP) */ 97 int freq, /**< frequency for calling relaxation handler */ 98 SCIP_DECL_RELAXEXEC ((*relaxexec)), /**< execution method of relaxation handler */ 99 SCIP_RELAXDATA* relaxdata /**< relaxation handler data */ 100 ); 101 102 /** sets copy method of relaxation handler */ 103 SCIP_EXPORT 104 SCIP_RETCODE SCIPsetRelaxCopy( 105 SCIP* scip, /**< SCIP data structure */ 106 SCIP_RELAX* relax, /**< relaxation handler */ 107 SCIP_DECL_RELAXCOPY ((*relaxcopy)) /**< copy method of relaxation handler or NULL if you don't want to copy your plugin into sub-SCIPs */ 108 ); 109 110 /** sets destructor method of relaxation handler */ 111 SCIP_EXPORT 112 SCIP_RETCODE SCIPsetRelaxFree( 113 SCIP* scip, /**< SCIP data structure */ 114 SCIP_RELAX* relax, /**< relaxation handler */ 115 SCIP_DECL_RELAXFREE ((*relaxfree)) /**< destructor of relaxation handler */ 116 ); 117 118 /** sets initialization method of relaxation handler */ 119 SCIP_EXPORT 120 SCIP_RETCODE SCIPsetRelaxInit( 121 SCIP* scip, /**< SCIP data structure */ 122 SCIP_RELAX* relax, /**< relaxation handler */ 123 SCIP_DECL_RELAXINIT ((*relaxinit)) /**< initialize relaxation handler */ 124 ); 125 126 /** sets deinitialization method of relaxation handler */ 127 SCIP_EXPORT 128 SCIP_RETCODE SCIPsetRelaxExit( 129 SCIP* scip, /**< SCIP data structure */ 130 SCIP_RELAX* relax, /**< relaxation handler */ 131 SCIP_DECL_RELAXEXIT ((*relaxexit)) /**< deinitialize relaxation handler */ 132 ); 133 134 /** sets solving process initialization method of relaxation handler */ 135 SCIP_EXPORT 136 SCIP_RETCODE SCIPsetRelaxInitsol( 137 SCIP* scip, /**< SCIP data structure */ 138 SCIP_RELAX* relax, /**< relaxation handler */ 139 SCIP_DECL_RELAXINITSOL((*relaxinitsol)) /**< solving process initialization method of relaxation handler */ 140 ); 141 142 /** sets solving process deinitialization method of relaxation handler */ 143 SCIP_EXPORT 144 SCIP_RETCODE SCIPsetRelaxExitsol( 145 SCIP* scip, /**< SCIP data structure */ 146 SCIP_RELAX* relax, /**< relaxation handler */ 147 SCIP_DECL_RELAXEXITSOL((*relaxexitsol)) /**< solving process deinitialization method of relaxation handler */ 148 ); 149 150 /** returns the relaxation handler of the given name, or NULL if not existing */ 151 SCIP_EXPORT 152 SCIP_RELAX* SCIPfindRelax( 153 SCIP* scip, /**< SCIP data structure */ 154 const char* name /**< name of relaxation handler */ 155 ); 156 157 /** returns the array of currently available relaxation handlers */ 158 SCIP_EXPORT 159 SCIP_RELAX** SCIPgetRelaxs( 160 SCIP* scip /**< SCIP data structure */ 161 ); 162 163 /** returns the number of currently available relaxation handlers */ 164 SCIP_EXPORT 165 int SCIPgetNRelaxs( 166 SCIP* scip /**< SCIP data structure */ 167 ); 168 169 /** sets the priority of a relaxation handler*/ 170 SCIP_EXPORT 171 SCIP_RETCODE SCIPsetRelaxPriority( 172 SCIP* scip, /**< SCIP data structure */ 173 SCIP_RELAX* relax, /**< relaxation handler */ 174 int priority /**< new priority of the relaxation handler */ 175 ); 176 177 /** @} */ 178 179 #ifdef __cplusplus 180 } 181 #endif 182 183 #endif 184