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 pub_relax.h 26 * @ingroup PUBLICCOREAPI 27 * @brief public methods for relaxation handlers 28 * @author Tobias Achterberg 29 */ 30 31 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/ 32 33 #ifndef __SCIP_PUB_RELAX_H__ 34 #define __SCIP_PUB_RELAX_H__ 35 36 37 #include "scip/def.h" 38 #include "scip/type_misc.h" 39 #include "scip/type_relax.h" 40 41 #ifdef __cplusplus 42 extern "C" { 43 #endif 44 45 46 /**@addtogroup PublicRelaxatorMethods 47 * 48 * @{ 49 */ 50 51 52 /** compares two relaxation handlers w. r. to their priority */ 53 SCIP_EXPORT 54 SCIP_DECL_SORTPTRCOMP(SCIPrelaxComp); 55 56 /** comparison method for sorting relaxators w.r.t. to their name */ 57 SCIP_EXPORT 58 SCIP_DECL_SORTPTRCOMP(SCIPrelaxCompName); 59 60 /** gets user data of relaxation handler */ 61 SCIP_EXPORT 62 SCIP_RELAXDATA* SCIPrelaxGetData( 63 SCIP_RELAX* relax /**< relaxation handler */ 64 ); 65 66 /** sets user data of relaxation handler; user has to free old data in advance! */ 67 SCIP_EXPORT 68 void SCIPrelaxSetData( 69 SCIP_RELAX* relax, /**< relaxation handler */ 70 SCIP_RELAXDATA* relaxdata /**< new relaxation handler user data */ 71 ); 72 73 /** gets name of relaxation handler */ 74 SCIP_EXPORT 75 const char* SCIPrelaxGetName( 76 SCIP_RELAX* relax /**< relaxation handler */ 77 ); 78 79 /** gets description of relaxation handler */ 80 SCIP_EXPORT 81 const char* SCIPrelaxGetDesc( 82 SCIP_RELAX* relax /**< relaxation handler */ 83 ); 84 85 /** gets priority of relaxation handler */ 86 SCIP_EXPORT 87 int SCIPrelaxGetPriority( 88 SCIP_RELAX* relax /**< relaxation handler */ 89 ); 90 91 /** gets frequency of relaxation handler */ 92 SCIP_EXPORT 93 int SCIPrelaxGetFreq( 94 SCIP_RELAX* relax /**< relaxation handler */ 95 ); 96 97 /** gets time in seconds used in this relaxator for setting up for next stages */ 98 SCIP_EXPORT 99 SCIP_Real SCIPrelaxGetSetupTime( 100 SCIP_RELAX* relax /**< relaxator */ 101 ); 102 103 /** gets time in seconds used in this relaxation handler */ 104 SCIP_EXPORT 105 SCIP_Real SCIPrelaxGetTime( 106 SCIP_RELAX* relax /**< relaxation handler */ 107 ); 108 109 /** gets the total number of times the relaxation handler was called */ 110 SCIP_EXPORT 111 SCIP_Longint SCIPrelaxGetNCalls( 112 SCIP_RELAX* relax /**< relaxation handler */ 113 ); 114 115 /** gets the total number of times the relaxation handler cut off a node */ 116 SCIP_EXPORT 117 SCIP_Longint SCIPrelaxGetNCutoffs( 118 SCIP_RELAX* relax /**< relaxation handler */ 119 ); 120 121 /** gets the total number of times the relaxation handler improved a node's lower bound */ 122 SCIP_EXPORT 123 SCIP_Longint SCIPrelaxGetNImprovedLowerbound( 124 SCIP_RELAX* relax /**< relaxation handler */ 125 ); 126 127 /** gets the time in seconds spent for the execution of the relaxation handler when a node's lower bound could be improved (or a cutoff was found) */ 128 SCIP_EXPORT 129 SCIP_Real SCIPrelaxGetImprovedLowerboundTime( 130 SCIP_RELAX* relax /**< relaxation handler */ 131 ); 132 133 /** gets the total number of times the relaxation handler added constraints */ 134 SCIP_EXPORT 135 SCIP_Longint SCIPrelaxGetNAddedConss( 136 SCIP_RELAX* relax /**< relaxation handler */ 137 ); 138 139 /** gets the total number of times the relaxation handler reduced variable domains */ 140 SCIP_EXPORT 141 SCIP_Longint SCIPrelaxGetNReducedDomains( 142 SCIP_RELAX* relax /**< relaxation handler */ 143 ); 144 145 /** gets the total number of times the relaxation handler separated cutting planes */ 146 SCIP_EXPORT 147 SCIP_Longint SCIPrelaxGetNSeparatedCuts( 148 SCIP_RELAX* relax /**< relaxation handler */ 149 ); 150 151 /** is relaxation handler initialized? */ 152 SCIP_EXPORT 153 SCIP_Bool SCIPrelaxIsInitialized( 154 SCIP_RELAX* relax /**< relaxation handler */ 155 ); 156 157 /** marks the current relaxation unsolved, s.t. the relaxation handler is called again in the next solving round */ 158 SCIP_EXPORT 159 void SCIPrelaxMarkUnsolved( 160 SCIP_RELAX* relax /**< relaxation handler */ 161 ); 162 163 /** @} */ 164 165 #ifdef __cplusplus 166 } 167 #endif 168 169 #endif 170