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_compr.h 26 * @ingroup PUBLICCOREAPI 27 * @brief public methods for compression 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_COMPR_H__ 41 #define __SCIP_SCIP_COMPR_H__ 42 43 44 #include "scip/def.h" 45 #include "scip/type_compr.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 PublicCompressionMethods 55 * 56 * @{ 57 */ 58 /** creates a tree compression and includes it in SCIP. 59 * 60 * @note method has all compression callbacks as arguments and is thus changed every time a new 61 * callback is added in future releases; consider using SCIPincludeComprBasic() and setter functions 62 * if you seek for a method which is less likely to change in future releases 63 */ 64 SCIP_EXPORT 65 SCIP_RETCODE SCIPincludeCompr( 66 SCIP* scip, /**< SCIP data structure */ 67 const char* name, /**< name of tree compression */ 68 const char* desc, /**< description of tree compression */ 69 int priority, /**< priority of the tree compression */ 70 int minnnodes, /**< minimal number of nodes to call compression */ 71 SCIP_DECL_COMPRCOPY ((*comprcopy)), /**< copy method of tree compression or NULL if you don't want to copy your plugin into sub-SCIPs */ 72 SCIP_DECL_COMPRFREE ((*comprfree)), /**< destructor of tree compression */ 73 SCIP_DECL_COMPRINIT ((*comprinit)), /**< initialize tree compression */ 74 SCIP_DECL_COMPREXIT ((*comprexit)), /**< deinitialize tree compression */ 75 SCIP_DECL_COMPRINITSOL ((*comprinitsol)), /**< solving process initialization method of tree compression */ 76 SCIP_DECL_COMPREXITSOL ((*comprexitsol)), /**< solving process deinitialization method of tree compression */ 77 SCIP_DECL_COMPREXEC ((*comprexec)), /**< execution method of tree compression */ 78 SCIP_COMPRDATA* comprdata /**< tree compression data */ 79 ); 80 81 /** creates a tree compression and includes it in SCIP with its most fundamental callbacks. 82 * All non-fundamental (or optional) callbacks 83 * as, e. g., init and exit callbacks, will be set to NULL. 84 * Optional callbacks can be set via specific setter functions, see SCIPsetComprCopy(), SCIPsetComprFree(), 85 * SCIPsetComprInit(), SCIPsetComprExit(), SCIPsetComprInitsol(), and SCIPsetComprExitsol() 86 * 87 * @note if you want to set all callbacks with a single method call, consider using SCIPincludeCompr() instead 88 */ 89 SCIP_EXPORT 90 SCIP_RETCODE SCIPincludeComprBasic( 91 SCIP* scip, /**< SCIP data structure */ 92 SCIP_COMPR** compr, /**< pointer to tree compression */ 93 const char* name, /**< name of tree compression */ 94 const char* desc, /**< description of tree compression */ 95 int priority, /**< priority of the tree compression */ 96 int minnnodes, /**< minimal number of nodes to call the compression */ 97 SCIP_DECL_COMPREXEC ((*comprexec)), /**< execution method of tree compression */ 98 SCIP_COMPRDATA* comprdata /**< tree compression data */ 99 ); 100 101 /** sets copy method of tree compression */ 102 SCIP_EXPORT 103 SCIP_RETCODE SCIPsetComprCopy( 104 SCIP* scip, /**< SCIP data structure */ 105 SCIP_COMPR* compr, /**< tree compression */ 106 SCIP_DECL_COMPRCOPY ((*comprcopy)) /**< copy method of tree compression or NULL if you don't want to copy your plugin into sub-SCIPs */ 107 ); 108 109 /** sets destructor method of tree compression */ 110 SCIP_EXPORT 111 SCIP_RETCODE SCIPsetComprFree( 112 SCIP* scip, /**< SCIP data structure */ 113 SCIP_COMPR* compr, /**< tree compression */ 114 SCIP_DECL_COMPRFREE ((*comprfree)) /**< destructor of tree compression */ 115 ); 116 117 /** sets initialization method of tree compression */ 118 SCIP_EXPORT 119 SCIP_RETCODE SCIPsetComprInit( 120 SCIP* scip, /**< SCIP data structure */ 121 SCIP_COMPR* compr, /**< tree compression */ 122 SCIP_DECL_COMPRINIT ((*comprinit)) /**< initialize tree compression */ 123 ); 124 125 /** sets deinitialization method of tree compression */ 126 SCIP_EXPORT 127 SCIP_RETCODE SCIPsetComprExit( 128 SCIP* scip, /**< SCIP data structure */ 129 SCIP_COMPR* compr, /**< tree compression */ 130 SCIP_DECL_COMPREXIT ((*comprexit)) /**< deinitialize tree compression */ 131 ); 132 133 /** sets solving process initialization method of tree compression */ 134 SCIP_EXPORT 135 SCIP_RETCODE SCIPsetComprInitsol( 136 SCIP* scip, /**< SCIP data structure */ 137 SCIP_COMPR* compr, /**< tree compression */ 138 SCIP_DECL_COMPRINITSOL ((*comprinitsol)) /**< solving process initialization method of tree compression */ 139 ); 140 141 /** sets solving process deinitialization method of tree compression */ 142 SCIP_EXPORT 143 SCIP_RETCODE SCIPsetComprExitsol( 144 SCIP* scip, /**< SCIP data structure */ 145 SCIP_COMPR* compr, /**< tree compression */ 146 SCIP_DECL_COMPREXITSOL ((*comprexitsol)) /**< solving process deinitialization method of tree compression */ 147 ); 148 149 /** returns the tree compression of the given name, or NULL if not existing */ 150 SCIP_EXPORT 151 SCIP_COMPR* SCIPfindCompr( 152 SCIP* scip, /**< SCIP data structure */ 153 const char* name /**< name of tree compression */ 154 ); 155 156 /** returns the array of currently available tree compression */ 157 SCIP_EXPORT 158 SCIP_COMPR** SCIPgetComprs( 159 SCIP* scip /**< SCIP data structure */ 160 ); 161 162 /** returns the number of currently available tree compression */ 163 SCIP_EXPORT 164 int SCIPgetNCompr( 165 SCIP* scip /**< SCIP data structure */ 166 ); 167 168 /** set the priority of a tree compression method */ 169 SCIP_RETCODE SCIPsetComprPriority( 170 SCIP* scip, /**< SCIP data structure */ 171 SCIP_COMPR* compr, /**< compression */ 172 int priority /**< new priority of the tree compression */ 173 ); 174 175 /** @} */ 176 177 #ifdef __cplusplus 178 } 179 #endif 180 181 #endif 182