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_sol.h 26 * @ingroup PUBLICCOREAPI 27 * @brief public methods for solutions 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_SOL_H__ 41 #define __SCIP_SCIP_SOL_H__ 42 43 44 #include "scip/def.h" 45 #include "scip/type_cons.h" 46 #include "scip/type_heur.h" 47 #include "scip/type_retcode.h" 48 #include "scip/type_scip.h" 49 #include "scip/type_sol.h" 50 #include "scip/type_var.h" 51 52 #ifdef __cplusplus 53 extern "C" { 54 #endif 55 56 /**@addtogroup PublicSolutionMethods 57 * 58 * @{ 59 */ 60 61 /** creates a primal solution, initialized to zero 62 * 63 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 64 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 65 * 66 * @pre This method can be called if SCIP is in one of the following stages: 67 * - \ref SCIP_STAGE_PROBLEM 68 * - \ref SCIP_STAGE_TRANSFORMING 69 * - \ref SCIP_STAGE_TRANSFORMED 70 * - \ref SCIP_STAGE_INITPRESOLVE 71 * - \ref SCIP_STAGE_PRESOLVING 72 * - \ref SCIP_STAGE_EXITPRESOLVE 73 * - \ref SCIP_STAGE_PRESOLVED 74 * - \ref SCIP_STAGE_INITSOLVE 75 * - \ref SCIP_STAGE_SOLVING 76 */ 77 SCIP_EXPORT 78 SCIP_RETCODE SCIPcreateSol( 79 SCIP* scip, /**< SCIP data structure */ 80 SCIP_SOL** sol, /**< pointer to store the solution */ 81 SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */ 82 ); 83 84 /** creates a primal solution, initialized to the current LP solution 85 * 86 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 87 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 88 * 89 * @pre This method can be called if SCIP is in one of the following stages: 90 * - \ref SCIP_STAGE_SOLVING 91 */ 92 SCIP_EXPORT 93 SCIP_RETCODE SCIPcreateLPSol( 94 SCIP* scip, /**< SCIP data structure */ 95 SCIP_SOL** sol, /**< pointer to store the solution */ 96 SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */ 97 ); 98 99 /** creates a primal solution, initialized to the current NLP solution 100 * 101 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 102 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 103 * 104 * @pre This method can be called if SCIP is in one of the following stages: 105 * - \ref SCIP_STAGE_SOLVING 106 */ 107 SCIP_EXPORT 108 SCIP_RETCODE SCIPcreateNLPSol( 109 SCIP* scip, /**< SCIP data structure */ 110 SCIP_SOL** sol, /**< pointer to store the solution */ 111 SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */ 112 ); 113 114 /** creates a primal solution, initialized to the current relaxation solution 115 * 116 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 117 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 118 * 119 * @pre This method can be called if SCIP is in one of the following stages: 120 * - \ref SCIP_STAGE_SOLVING 121 */ 122 SCIP_EXPORT 123 SCIP_RETCODE SCIPcreateRelaxSol( 124 SCIP* scip, /**< SCIP data structure */ 125 SCIP_SOL** sol, /**< pointer to store the solution */ 126 SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */ 127 ); 128 129 /** creates a primal solution, initialized to the current pseudo solution 130 * 131 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 132 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 133 * 134 * @pre This method can be called if SCIP is in one of the following stages: 135 * - \ref SCIP_STAGE_SOLVING 136 */ 137 SCIP_EXPORT 138 SCIP_RETCODE SCIPcreatePseudoSol( 139 SCIP* scip, /**< SCIP data structure */ 140 SCIP_SOL** sol, /**< pointer to store the solution */ 141 SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */ 142 ); 143 144 /** creates a primal solution, initialized to the current LP or pseudo solution, depending on whether the LP was solved 145 * at the current node 146 * 147 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 148 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 149 * 150 * @pre This method can be called if SCIP is in one of the following stages: 151 * - \ref SCIP_STAGE_SOLVING 152 */ 153 SCIP_EXPORT 154 SCIP_RETCODE SCIPcreateCurrentSol( 155 SCIP* scip, /**< SCIP data structure */ 156 SCIP_SOL** sol, /**< pointer to store the solution */ 157 SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */ 158 ); 159 160 /** creates a partial primal solution, initialized to unknown values 161 * 162 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 163 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 164 * 165 * @pre This method can be called if SCIP is in one of the following stages: 166 * - \ref SCIP_STAGE_PROBLEM 167 */ 168 SCIP_EXPORT 169 SCIP_RETCODE SCIPcreatePartialSol( 170 SCIP* scip, /**< SCIP data structure */ 171 SCIP_SOL** sol, /**< pointer to store the solution */ 172 SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */ 173 ); 174 175 /** creates a primal solution, initialized to unknown values 176 * 177 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 178 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 179 * 180 * @pre This method can be called if SCIP is in one of the following stages: 181 * - \ref SCIP_STAGE_TRANSFORMING 182 * - \ref SCIP_STAGE_TRANSFORMED 183 * - \ref SCIP_STAGE_INITPRESOLVE 184 * - \ref SCIP_STAGE_PRESOLVING 185 * - \ref SCIP_STAGE_EXITPRESOLVE 186 * - \ref SCIP_STAGE_PRESOLVED 187 * - \ref SCIP_STAGE_INITSOLVE 188 * - \ref SCIP_STAGE_SOLVING 189 */ 190 SCIP_EXPORT 191 SCIP_RETCODE SCIPcreateUnknownSol( 192 SCIP* scip, /**< SCIP data structure */ 193 SCIP_SOL** sol, /**< pointer to store the solution */ 194 SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */ 195 ); 196 197 /** creates a primal solution living in the original problem space, initialized to zero; 198 * a solution in original space allows to set original variables to values that would be invalid in the 199 * transformed problem due to preprocessing fixings or aggregations 200 * 201 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 202 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 203 * 204 * @pre This method can be called if SCIP is in one of the following stages: 205 * - \ref SCIP_STAGE_PROBLEM 206 * - \ref SCIP_STAGE_TRANSFORMING 207 * - \ref SCIP_STAGE_TRANSFORMED 208 * - \ref SCIP_STAGE_INITPRESOLVE 209 * - \ref SCIP_STAGE_PRESOLVING 210 * - \ref SCIP_STAGE_EXITPRESOLVE 211 * - \ref SCIP_STAGE_PRESOLVED 212 * - \ref SCIP_STAGE_INITSOLVE 213 * - \ref SCIP_STAGE_SOLVING 214 */ 215 SCIP_EXPORT 216 SCIP_RETCODE SCIPcreateOrigSol( 217 SCIP* scip, /**< SCIP data structure */ 218 SCIP_SOL** sol, /**< pointer to store the solution */ 219 SCIP_HEUR* heur /**< heuristic that found the solution (or NULL if it's from the tree) */ 220 ); 221 222 /** creates a copy of a primal solution; note that a copy of a linked solution is also linked and needs to be unlinked 223 * if it should stay unaffected from changes in the LP or pseudo solution 224 * 225 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 226 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 227 * 228 * @pre This method can be called if SCIP is in one of the following stages: 229 * - \ref SCIP_STAGE_PROBLEM 230 * - \ref SCIP_STAGE_TRANSFORMING 231 * - \ref SCIP_STAGE_TRANSFORMED 232 * - \ref SCIP_STAGE_INITPRESOLVE 233 * - \ref SCIP_STAGE_PRESOLVING 234 * - \ref SCIP_STAGE_EXITPRESOLVE 235 * - \ref SCIP_STAGE_PRESOLVED 236 * - \ref SCIP_STAGE_INITSOLVE 237 * - \ref SCIP_STAGE_SOLVING 238 */ 239 SCIP_EXPORT 240 SCIP_RETCODE SCIPcreateSolCopy( 241 SCIP* scip, /**< SCIP data structure */ 242 SCIP_SOL** sol, /**< pointer to store the solution */ 243 SCIP_SOL* sourcesol /**< primal CIP solution to copy */ 244 ); 245 246 /** creates a copy of a solution in the original primal solution space 247 * 248 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 249 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 250 * 251 * @pre This method can be called if SCIP is in one of the following stages: 252 * - \ref SCIP_STAGE_PROBLEM 253 * - \ref SCIP_STAGE_TRANSFORMING 254 * - \ref SCIP_STAGE_TRANSFORMED 255 * - \ref SCIP_STAGE_INITPRESOLVE 256 * - \ref SCIP_STAGE_PRESOLVING 257 * - \ref SCIP_STAGE_EXITPRESOLVE 258 * - \ref SCIP_STAGE_PRESOLVED 259 * - \ref SCIP_STAGE_INITSOLVE 260 * - \ref SCIP_STAGE_SOLVING 261 * - \ref SCIP_STAGE_SOLVED 262 * - \ref SCIP_STAGE_EXITSOLVE 263 * - \ref SCIP_STAGE_FREETRANS 264 */ 265 SCIP_EXPORT 266 SCIP_RETCODE SCIPcreateSolCopyOrig( 267 SCIP* scip, /**< SCIP data structure */ 268 SCIP_SOL** sol, /**< pointer to store the solution */ 269 SCIP_SOL* sourcesol /**< primal CIP solution to copy */ 270 ); 271 272 /** creates a copy of a primal solution, thereby replacing infinite fixings of variables by finite values; 273 * the copy is always defined in the original variable space; 274 * success indicates whether the objective value of the solution was changed by removing infinite values 275 * 276 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 277 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 278 * 279 * @pre This method can be called if SCIP is in one of the following stages: 280 * - \ref SCIP_STAGE_PROBLEM 281 * - \ref SCIP_STAGE_TRANSFORMING 282 * - \ref SCIP_STAGE_TRANSFORMED 283 * - \ref SCIP_STAGE_INITPRESOLVE 284 * - \ref SCIP_STAGE_PRESOLVING 285 * - \ref SCIP_STAGE_EXITPRESOLVE 286 * - \ref SCIP_STAGE_PRESOLVED 287 * - \ref SCIP_STAGE_INITSOLVE 288 * - \ref SCIP_STAGE_SOLVING 289 * - \ref SCIP_STAGE_SOLVED 290 * - \ref SCIP_STAGE_EXITSOLVE 291 */ 292 SCIP_EXPORT 293 SCIP_RETCODE SCIPcreateFiniteSolCopy( 294 SCIP* scip, /**< SCIP data structure */ 295 SCIP_SOL** sol, /**< pointer to store the solution */ 296 SCIP_SOL* sourcesol, /**< primal CIP solution to copy */ 297 SCIP_Bool* success /**< does the finite solution have the same objective value? */ 298 ); 299 300 /** frees primal CIP solution 301 * 302 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 303 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 304 * 305 * @pre This method can be called if SCIP is in one of the following stages: 306 * - \ref SCIP_STAGE_PROBLEM 307 * - \ref SCIP_STAGE_TRANSFORMING 308 * - \ref SCIP_STAGE_TRANSFORMED 309 * - \ref SCIP_STAGE_INITPRESOLVE 310 * - \ref SCIP_STAGE_PRESOLVING 311 * - \ref SCIP_STAGE_EXITPRESOLVE 312 * - \ref SCIP_STAGE_PRESOLVED 313 * - \ref SCIP_STAGE_INITSOLVE 314 * - \ref SCIP_STAGE_SOLVING 315 * - \ref SCIP_STAGE_SOLVED 316 * - \ref SCIP_STAGE_EXITSOLVE 317 * - \ref SCIP_STAGE_FREETRANS 318 */ 319 SCIP_EXPORT 320 SCIP_RETCODE SCIPfreeSol( 321 SCIP* scip, /**< SCIP data structure */ 322 SCIP_SOL** sol /**< pointer to the solution */ 323 ); 324 325 /** links a primal solution to the current LP solution 326 * 327 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 328 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 329 * 330 * @pre This method can be called if SCIP is in one of the following stages: 331 * - \ref SCIP_STAGE_SOLVING 332 */ 333 SCIP_EXPORT 334 SCIP_RETCODE SCIPlinkLPSol( 335 SCIP* scip, /**< SCIP data structure */ 336 SCIP_SOL* sol /**< primal solution */ 337 ); 338 339 /** links a primal solution to the current NLP solution 340 * 341 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 342 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 343 * 344 * @pre This method can be called if SCIP is in one of the following stages: 345 * - \ref SCIP_STAGE_SOLVING 346 */ 347 SCIP_EXPORT 348 SCIP_RETCODE SCIPlinkNLPSol( 349 SCIP* scip, /**< SCIP data structure */ 350 SCIP_SOL* sol /**< primal solution */ 351 ); 352 353 /** links a primal solution to the current relaxation solution 354 * 355 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 356 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 357 * 358 * @pre This method can be called if SCIP is in one of the following stages: 359 * - \ref SCIP_STAGE_SOLVING 360 */ 361 SCIP_EXPORT 362 SCIP_RETCODE SCIPlinkRelaxSol( 363 SCIP* scip, /**< SCIP data structure */ 364 SCIP_SOL* sol /**< primal solution */ 365 ); 366 367 /** links a primal solution to the current pseudo solution 368 * 369 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 370 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 371 * 372 * @pre This method can be called if SCIP is in one of the following stages: 373 * - \ref SCIP_STAGE_PRESOLVING 374 * - \ref SCIP_STAGE_SOLVING 375 */ 376 SCIP_EXPORT 377 SCIP_RETCODE SCIPlinkPseudoSol( 378 SCIP* scip, /**< SCIP data structure */ 379 SCIP_SOL* sol /**< primal solution */ 380 ); 381 382 /** links a primal solution to the current LP or pseudo solution 383 * 384 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 385 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 386 * 387 * @pre This method can be called if SCIP is in one of the following stages: 388 * - \ref SCIP_STAGE_SOLVING 389 */ 390 SCIP_EXPORT 391 SCIP_RETCODE SCIPlinkCurrentSol( 392 SCIP* scip, /**< SCIP data structure */ 393 SCIP_SOL* sol /**< primal solution */ 394 ); 395 396 /** clears a primal solution 397 * 398 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 399 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 400 * 401 * @pre This method can be called if SCIP is in one of the following stages: 402 * - \ref SCIP_STAGE_PROBLEM 403 * - \ref SCIP_STAGE_TRANSFORMING 404 * - \ref SCIP_STAGE_TRANSFORMED 405 * - \ref SCIP_STAGE_INITPRESOLVE 406 * - \ref SCIP_STAGE_PRESOLVING 407 * - \ref SCIP_STAGE_EXITPRESOLVE 408 * - \ref SCIP_STAGE_PRESOLVED 409 * - \ref SCIP_STAGE_INITSOLVE 410 * - \ref SCIP_STAGE_SOLVING 411 * - \ref SCIP_STAGE_SOLVED 412 * - \ref SCIP_STAGE_EXITSOLVE 413 * - \ref SCIP_STAGE_FREETRANS 414 */ 415 SCIP_EXPORT 416 SCIP_RETCODE SCIPclearSol( 417 SCIP* scip, /**< SCIP data structure */ 418 SCIP_SOL* sol /**< primal solution */ 419 ); 420 421 /** stores solution values of variables in solution's own array 422 * 423 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 424 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 425 * 426 * @pre This method can be called if SCIP is in one of the following stages: 427 * - \ref SCIP_STAGE_TRANSFORMING 428 * - \ref SCIP_STAGE_TRANSFORMED 429 * - \ref SCIP_STAGE_PRESOLVING 430 * - \ref SCIP_STAGE_PRESOLVED 431 * - \ref SCIP_STAGE_INITSOLVE 432 * - \ref SCIP_STAGE_SOLVING 433 * - \ref SCIP_STAGE_SOLVED 434 * - \ref SCIP_STAGE_EXITSOLVE 435 * - \ref SCIP_STAGE_FREETRANS 436 */ 437 SCIP_EXPORT 438 SCIP_RETCODE SCIPunlinkSol( 439 SCIP* scip, /**< SCIP data structure */ 440 SCIP_SOL* sol /**< primal solution */ 441 ); 442 443 /** sets value of variable in primal CIP solution 444 * 445 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 446 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 447 * 448 * @pre This method can be called if SCIP is in one of the following stages: 449 * - \ref SCIP_STAGE_PROBLEM 450 * - \ref SCIP_STAGE_TRANSFORMING 451 * - \ref SCIP_STAGE_TRANSFORMED 452 * - \ref SCIP_STAGE_INITPRESOLVE 453 * - \ref SCIP_STAGE_PRESOLVING 454 * - \ref SCIP_STAGE_EXITPRESOLVE 455 * - \ref SCIP_STAGE_PRESOLVED 456 * - \ref SCIP_STAGE_INITSOLVE 457 * - \ref SCIP_STAGE_SOLVING 458 * - \ref SCIP_STAGE_SOLVED 459 * - \ref SCIP_STAGE_EXITSOLVE 460 * - \ref SCIP_STAGE_FREETRANS 461 */ 462 SCIP_EXPORT 463 SCIP_RETCODE SCIPsetSolVal( 464 SCIP* scip, /**< SCIP data structure */ 465 SCIP_SOL* sol, /**< primal solution */ 466 SCIP_VAR* var, /**< variable to add to solution */ 467 SCIP_Real val /**< solution value of variable */ 468 ); 469 470 /** sets values of multiple variables in primal CIP solution 471 * 472 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 473 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 474 * 475 * @pre This method can be called if SCIP is in one of the following stages: 476 * - \ref SCIP_STAGE_PROBLEM 477 * - \ref SCIP_STAGE_TRANSFORMING 478 * - \ref SCIP_STAGE_TRANSFORMED 479 * - \ref SCIP_STAGE_INITPRESOLVE 480 * - \ref SCIP_STAGE_PRESOLVING 481 * - \ref SCIP_STAGE_EXITPRESOLVE 482 * - \ref SCIP_STAGE_PRESOLVED 483 * - \ref SCIP_STAGE_INITSOLVE 484 * - \ref SCIP_STAGE_SOLVING 485 * - \ref SCIP_STAGE_SOLVED 486 * - \ref SCIP_STAGE_EXITSOLVE 487 * - \ref SCIP_STAGE_FREETRANS 488 */ 489 SCIP_EXPORT 490 SCIP_RETCODE SCIPsetSolVals( 491 SCIP* scip, /**< SCIP data structure */ 492 SCIP_SOL* sol, /**< primal solution */ 493 int nvars, /**< number of variables to set solution value for */ 494 SCIP_VAR** vars, /**< array with variables to add to solution */ 495 SCIP_Real* vals /**< array with solution values of variables */ 496 ); 497 498 /** increases value of variable in primal CIP solution 499 * 500 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 501 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 502 * 503 * @pre This method can be called if SCIP is in one of the following stages: 504 * - \ref SCIP_STAGE_PROBLEM 505 * - \ref SCIP_STAGE_TRANSFORMING 506 * - \ref SCIP_STAGE_TRANSFORMED 507 * - \ref SCIP_STAGE_INITPRESOLVE 508 * - \ref SCIP_STAGE_PRESOLVING 509 * - \ref SCIP_STAGE_EXITPRESOLVE 510 * - \ref SCIP_STAGE_PRESOLVED 511 * - \ref SCIP_STAGE_INITSOLVE 512 * - \ref SCIP_STAGE_SOLVING 513 * - \ref SCIP_STAGE_SOLVED 514 * - \ref SCIP_STAGE_EXITSOLVE 515 * - \ref SCIP_STAGE_FREETRANS 516 */ 517 SCIP_EXPORT 518 SCIP_RETCODE SCIPincSolVal( 519 SCIP* scip, /**< SCIP data structure */ 520 SCIP_SOL* sol, /**< primal solution */ 521 SCIP_VAR* var, /**< variable to increase solution value for */ 522 SCIP_Real incval /**< increment for solution value of variable */ 523 ); 524 525 /** returns value of variable in primal CIP solution, or in current LP/pseudo solution 526 * 527 * @return value of variable in primal CIP solution, or in current LP/pseudo solution 528 * 529 * @pre In case the solution pointer @p sol is @b NULL, that means it is asked for the LP or pseudo solution, this method 530 * can only be called if @p scip is in the solving stage \ref SCIP_STAGE_SOLVING. In any other case, this method 531 * can be called if @p scip is in one of the following stages: 532 * - \ref SCIP_STAGE_PROBLEM 533 * - \ref SCIP_STAGE_TRANSFORMING 534 * - \ref SCIP_STAGE_TRANSFORMED 535 * - \ref SCIP_STAGE_INITPRESOLVE 536 * - \ref SCIP_STAGE_PRESOLVING 537 * - \ref SCIP_STAGE_EXITPRESOLVE 538 * - \ref SCIP_STAGE_PRESOLVED 539 * - \ref SCIP_STAGE_INITSOLVE 540 * - \ref SCIP_STAGE_SOLVING 541 * - \ref SCIP_STAGE_SOLVED 542 * - \ref SCIP_STAGE_EXITSOLVE 543 * - \ref SCIP_STAGE_FREETRANS 544 */ 545 SCIP_EXPORT 546 SCIP_Real SCIPgetSolVal( 547 SCIP* scip, /**< SCIP data structure */ 548 SCIP_SOL* sol, /**< primal solution, or NULL for current LP/pseudo solution */ 549 SCIP_VAR* var /**< variable to get value for */ 550 ); 551 552 /** gets values of multiple variables in primal CIP solution 553 * 554 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 555 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 556 * 557 * @pre This method can be called if SCIP is in one of the following stages: 558 * - \ref SCIP_STAGE_PROBLEM 559 * - \ref SCIP_STAGE_TRANSFORMING 560 * - \ref SCIP_STAGE_TRANSFORMED 561 * - \ref SCIP_STAGE_INITPRESOLVE 562 * - \ref SCIP_STAGE_PRESOLVING 563 * - \ref SCIP_STAGE_EXITPRESOLVE 564 * - \ref SCIP_STAGE_PRESOLVED 565 * - \ref SCIP_STAGE_INITSOLVE 566 * - \ref SCIP_STAGE_SOLVING 567 * - \ref SCIP_STAGE_SOLVED 568 * - \ref SCIP_STAGE_EXITSOLVE 569 * - \ref SCIP_STAGE_FREETRANS 570 */ 571 SCIP_EXPORT 572 SCIP_RETCODE SCIPgetSolVals( 573 SCIP* scip, /**< SCIP data structure */ 574 SCIP_SOL* sol, /**< primal solution, or NULL for current LP/pseudo solution */ 575 int nvars, /**< number of variables to get solution value for */ 576 SCIP_VAR** vars, /**< array with variables to get value for */ 577 SCIP_Real* vals /**< array to store solution values of variables */ 578 ); 579 580 /** returns objective value of primal CIP solution w.r.t. original problem, or current LP/pseudo objective value 581 * 582 * @return objective value of primal CIP solution w.r.t. original problem, or current LP/pseudo objective value 583 * 584 * @pre This method can be called if SCIP is in one of the following stages: 585 * - \ref SCIP_STAGE_PROBLEM 586 * - \ref SCIP_STAGE_TRANSFORMING 587 * - \ref SCIP_STAGE_TRANSFORMED 588 * - \ref SCIP_STAGE_INITPRESOLVE 589 * - \ref SCIP_STAGE_PRESOLVING 590 * - \ref SCIP_STAGE_EXITPRESOLVE 591 * - \ref SCIP_STAGE_PRESOLVED 592 * - \ref SCIP_STAGE_INITSOLVE 593 * - \ref SCIP_STAGE_SOLVING 594 * - \ref SCIP_STAGE_SOLVED 595 * - \ref SCIP_STAGE_EXITSOLVE 596 * - \ref SCIP_STAGE_FREETRANS 597 */ 598 SCIP_EXPORT 599 SCIP_Real SCIPgetSolOrigObj( 600 SCIP* scip, /**< SCIP data structure */ 601 SCIP_SOL* sol /**< primal solution, or NULL for current LP/pseudo objective value */ 602 ); 603 604 /** returns transformed objective value of primal CIP solution, or transformed current LP/pseudo objective value 605 * 606 * @return transformed objective value of primal CIP solution, or transformed current LP/pseudo objective value 607 * 608 * @pre This method can be called if SCIP is in one of the following stages: 609 * - \ref SCIP_STAGE_TRANSFORMING 610 * - \ref SCIP_STAGE_TRANSFORMED 611 * - \ref SCIP_STAGE_INITPRESOLVE 612 * - \ref SCIP_STAGE_PRESOLVING 613 * - \ref SCIP_STAGE_EXITPRESOLVE 614 * - \ref SCIP_STAGE_PRESOLVED 615 * - \ref SCIP_STAGE_INITSOLVE 616 * - \ref SCIP_STAGE_SOLVING 617 * - \ref SCIP_STAGE_SOLVED 618 * - \ref SCIP_STAGE_EXITSOLVE 619 * - \ref SCIP_STAGE_FREETRANS 620 */ 621 SCIP_EXPORT 622 SCIP_Real SCIPgetSolTransObj( 623 SCIP* scip, /**< SCIP data structure */ 624 SCIP_SOL* sol /**< primal solution, or NULL for current LP/pseudo objective value */ 625 ); 626 627 /** recomputes the objective value of an original solution, e.g., when transferring solutions 628 * from the solution pool (objective coefficients might have changed in the meantime) 629 * 630 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 631 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 632 * 633 * @pre This method can be called if SCIP is in one of the following stages: 634 * - \ref SCIP_STAGE_PRESOLVING 635 * - \ref SCIP_STAGE_SOLVING 636 * 637 */ 638 SCIP_EXPORT 639 SCIP_RETCODE SCIPrecomputeSolObj( 640 SCIP* scip, 641 SCIP_SOL* sol 642 ); 643 644 /** maps original space objective value into transformed objective value 645 * 646 * @return transformed objective value 647 * 648 * @pre This method can be called if SCIP is in one of the following stages: 649 * - \ref SCIP_STAGE_TRANSFORMING 650 * - \ref SCIP_STAGE_TRANSFORMED 651 * - \ref SCIP_STAGE_INITPRESOLVE 652 * - \ref SCIP_STAGE_PRESOLVING 653 * - \ref SCIP_STAGE_EXITPRESOLVE 654 * - \ref SCIP_STAGE_PRESOLVED 655 * - \ref SCIP_STAGE_INITSOLVE 656 * - \ref SCIP_STAGE_SOLVING 657 * - \ref SCIP_STAGE_SOLVED 658 */ 659 SCIP_EXPORT 660 SCIP_Real SCIPtransformObj( 661 SCIP* scip, /**< SCIP data structure */ 662 SCIP_Real obj /**< original space objective value to transform */ 663 ); 664 665 /** maps transformed objective value into original space 666 * 667 * @return objective value into original space 668 * 669 * @pre This method can be called if SCIP is in one of the following stages: 670 * - \ref SCIP_STAGE_TRANSFORMING 671 * - \ref SCIP_STAGE_TRANSFORMED 672 * - \ref SCIP_STAGE_INITPRESOLVE 673 * - \ref SCIP_STAGE_PRESOLVING 674 * - \ref SCIP_STAGE_EXITPRESOLVE 675 * - \ref SCIP_STAGE_PRESOLVED 676 * - \ref SCIP_STAGE_INITSOLVE 677 * - \ref SCIP_STAGE_SOLVING 678 * - \ref SCIP_STAGE_SOLVED 679 */ 680 SCIP_EXPORT 681 SCIP_Real SCIPretransformObj( 682 SCIP* scip, /**< SCIP data structure */ 683 SCIP_Real obj /**< transformed objective value to retransform in original space */ 684 ); 685 686 /** gets clock time, when this solution was found 687 * 688 * @return clock time, when this solution was found 689 * 690 * @pre This method can be called if SCIP is in one of the following stages: 691 * - \ref SCIP_STAGE_TRANSFORMING 692 * - \ref SCIP_STAGE_TRANSFORMED 693 * - \ref SCIP_STAGE_INITPRESOLVE 694 * - \ref SCIP_STAGE_PRESOLVING 695 * - \ref SCIP_STAGE_EXITPRESOLVE 696 * - \ref SCIP_STAGE_PRESOLVED 697 * - \ref SCIP_STAGE_INITSOLVE 698 * - \ref SCIP_STAGE_SOLVING 699 * - \ref SCIP_STAGE_SOLVED 700 * - \ref SCIP_STAGE_EXITSOLVE 701 * - \ref SCIP_STAGE_FREETRANS 702 */ 703 SCIP_EXPORT 704 SCIP_Real SCIPgetSolTime( 705 SCIP* scip, /**< SCIP data structure */ 706 SCIP_SOL* sol /**< primal solution */ 707 ); 708 709 /** gets branch and bound run number, where this solution was found 710 * 711 * @return branch and bound run number, where this solution was found 712 * 713 * @pre This method can be called if SCIP is in one of the following stages: 714 * - \ref SCIP_STAGE_TRANSFORMING 715 * - \ref SCIP_STAGE_TRANSFORMED 716 * - \ref SCIP_STAGE_INITPRESOLVE 717 * - \ref SCIP_STAGE_PRESOLVING 718 * - \ref SCIP_STAGE_EXITPRESOLVE 719 * - \ref SCIP_STAGE_PRESOLVED 720 * - \ref SCIP_STAGE_INITSOLVE 721 * - \ref SCIP_STAGE_SOLVING 722 * - \ref SCIP_STAGE_SOLVED 723 * - \ref SCIP_STAGE_EXITSOLVE 724 * - \ref SCIP_STAGE_FREETRANS 725 */ 726 SCIP_EXPORT 727 int SCIPgetSolRunnum( 728 SCIP* scip, /**< SCIP data structure */ 729 SCIP_SOL* sol /**< primal solution */ 730 ); 731 732 /** gets node number of the specific branch and bound run, where this solution was found 733 * 734 * @return node number of the specific branch and bound run, where this solution was found 735 * 736 * @pre This method can be called if SCIP is in one of the following stages: 737 * - \ref SCIP_STAGE_TRANSFORMING 738 * - \ref SCIP_STAGE_TRANSFORMED 739 * - \ref SCIP_STAGE_INITPRESOLVE 740 * - \ref SCIP_STAGE_PRESOLVING 741 * - \ref SCIP_STAGE_EXITPRESOLVE 742 * - \ref SCIP_STAGE_PRESOLVED 743 * - \ref SCIP_STAGE_INITSOLVE 744 * - \ref SCIP_STAGE_SOLVING 745 * - \ref SCIP_STAGE_SOLVED 746 * - \ref SCIP_STAGE_EXITSOLVE 747 * - \ref SCIP_STAGE_FREETRANS 748 */ 749 SCIP_EXPORT 750 SCIP_Longint SCIPgetSolNodenum( 751 SCIP* scip, /**< SCIP data structure */ 752 SCIP_SOL* sol /**< primal solution */ 753 ); 754 755 /** gets heuristic, that found this solution (or NULL if it's from the tree) 756 * 757 * @return heuristic, that found this solution (or NULL if it's from the tree) 758 * 759 * @pre This method can be called if SCIP is in one of the following stages: 760 * - \ref SCIP_STAGE_TRANSFORMING 761 * - \ref SCIP_STAGE_TRANSFORMED 762 * - \ref SCIP_STAGE_INITPRESOLVE 763 * - \ref SCIP_STAGE_PRESOLVING 764 * - \ref SCIP_STAGE_EXITPRESOLVE 765 * - \ref SCIP_STAGE_PRESOLVED 766 * - \ref SCIP_STAGE_INITSOLVE 767 * - \ref SCIP_STAGE_SOLVING 768 * - \ref SCIP_STAGE_SOLVED 769 * - \ref SCIP_STAGE_EXITSOLVE 770 * - \ref SCIP_STAGE_FREETRANS 771 */ 772 SCIP_EXPORT 773 SCIP_HEUR* SCIPgetSolHeur( 774 SCIP* scip, /**< SCIP data structure */ 775 SCIP_SOL* sol /**< primal solution */ 776 ); 777 778 /** returns whether two given solutions are exactly equal 779 * 780 * @return returns whether two given solutions are exactly equal 781 * 782 * @pre This method can be called if SCIP is in one of the following stages: 783 * - \ref SCIP_STAGE_PROBLEM 784 * - \ref SCIP_STAGE_TRANSFORMING 785 * - \ref SCIP_STAGE_TRANSFORMED 786 * - \ref SCIP_STAGE_INITPRESOLVE 787 * - \ref SCIP_STAGE_PRESOLVING 788 * - \ref SCIP_STAGE_EXITPRESOLVE 789 * - \ref SCIP_STAGE_PRESOLVED 790 * - \ref SCIP_STAGE_INITSOLVE 791 * - \ref SCIP_STAGE_SOLVING 792 * - \ref SCIP_STAGE_SOLVED 793 * - \ref SCIP_STAGE_EXITSOLVE 794 * - \ref SCIP_STAGE_FREETRANS 795 */ 796 SCIP_EXPORT 797 SCIP_Bool SCIPareSolsEqual( 798 SCIP* scip, /**< SCIP data structure */ 799 SCIP_SOL* sol1, /**< first primal CIP solution */ 800 SCIP_SOL* sol2 /**< second primal CIP solution */ 801 ); 802 803 /** adjusts solution values of implicit integer variables in handed solution. Solution objective value is not 804 * deteriorated by this method. 805 * 806 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 807 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 808 * 809 * @pre This method can be called if SCIP is in one of the following stages: 810 * - \ref SCIP_STAGE_SOLVING 811 */ 812 SCIP_EXPORT 813 SCIP_RETCODE SCIPadjustImplicitSolVals( 814 SCIP* scip, /**< SCIP data structure */ 815 SCIP_SOL* sol, /**< primal CIP solution */ 816 SCIP_Bool uselprows /**< should LP row information be considered for none-objective variables */ 817 ); 818 819 /** outputs non-zero variables of solution in original problem space to the given file stream 820 * 821 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 822 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 823 * 824 * @pre In case the solution pointer @p sol is NULL (askinking for the current LP/pseudo solution), this method can be 825 * called if @p scip is in one of the following stages: 826 * - \ref SCIP_STAGE_PRESOLVING 827 * - \ref SCIP_STAGE_EXITPRESOLVE 828 * - \ref SCIP_STAGE_PRESOLVED 829 * - \ref SCIP_STAGE_INITSOLVE 830 * - \ref SCIP_STAGE_SOLVING 831 * - \ref SCIP_STAGE_SOLVED 832 * - \ref SCIP_STAGE_EXITSOLVE 833 * 834 * @pre In case the solution pointer @p sol is @b not NULL, this method can be called if @p scip is in one of the 835 * following stages: 836 * - \ref SCIP_STAGE_PROBLEM 837 * - \ref SCIP_STAGE_TRANSFORMED 838 * - \ref SCIP_STAGE_INITPRESOLVE 839 * - \ref SCIP_STAGE_PRESOLVING 840 * - \ref SCIP_STAGE_EXITPRESOLVE 841 * - \ref SCIP_STAGE_PRESOLVED 842 * - \ref SCIP_STAGE_INITSOLVE 843 * - \ref SCIP_STAGE_SOLVING 844 * - \ref SCIP_STAGE_SOLVED 845 * - \ref SCIP_STAGE_EXITSOLVE 846 */ 847 SCIP_EXPORT 848 SCIP_RETCODE SCIPprintSol( 849 SCIP* scip, /**< SCIP data structure */ 850 SCIP_SOL* sol, /**< primal solution, or NULL for current LP/pseudo solution */ 851 FILE* file, /**< output file (or NULL for standard output) */ 852 SCIP_Bool printzeros /**< should variables set to zero be printed? */ 853 ); 854 855 /** outputs non-zero variables of solution in transformed problem space to file stream 856 * 857 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 858 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 859 * 860 * @pre This method can be called if SCIP is in one of the following stages: 861 * - \ref SCIP_STAGE_TRANSFORMED 862 * - \ref SCIP_STAGE_INITPRESOLVE 863 * - \ref SCIP_STAGE_PRESOLVING 864 * - \ref SCIP_STAGE_EXITPRESOLVE 865 * - \ref SCIP_STAGE_PRESOLVED 866 * - \ref SCIP_STAGE_INITSOLVE 867 * - \ref SCIP_STAGE_SOLVING 868 * - \ref SCIP_STAGE_SOLVED 869 * - \ref SCIP_STAGE_EXITSOLVE 870 */ 871 SCIP_EXPORT 872 SCIP_RETCODE SCIPprintTransSol( 873 SCIP* scip, /**< SCIP data structure */ 874 SCIP_SOL* sol, /**< primal solution, or NULL for current LP/pseudo solution */ 875 FILE* file, /**< output file (or NULL for standard output) */ 876 SCIP_Bool printzeros /**< should variables set to zero be printed? */ 877 ); 878 879 /** outputs discrete variables of solution in original problem space to the given file stream 880 * 881 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 882 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 883 * 884 * @pre This method can be called if @p scip is in one of the following stages: 885 * - \ref SCIP_STAGE_PROBLEM 886 * - \ref SCIP_STAGE_TRANSFORMED 887 * - \ref SCIP_STAGE_INITPRESOLVE 888 * - \ref SCIP_STAGE_PRESOLVING 889 * - \ref SCIP_STAGE_EXITPRESOLVE 890 * - \ref SCIP_STAGE_PRESOLVED 891 * - \ref SCIP_STAGE_INITSOLVE 892 * - \ref SCIP_STAGE_SOLVING 893 * - \ref SCIP_STAGE_SOLVED 894 * - \ref SCIP_STAGE_EXITSOLVE 895 */ 896 SCIP_EXPORT 897 SCIP_RETCODE SCIPprintMIPStart( 898 SCIP* scip, /**< SCIP data structure */ 899 SCIP_SOL* sol, /**< primal solution */ 900 FILE* file /**< output file (or NULL for standard output) */ 901 ); 902 903 /** returns dual solution value of a constraint */ 904 SCIP_EXPORT 905 SCIP_RETCODE SCIPgetDualSolVal( 906 SCIP* scip, /**< SCIP data structure */ 907 SCIP_CONS* cons, /**< constraint for which the dual solution should be returned */ 908 SCIP_Real* dualsolval, /**< pointer to store the dual solution value */ 909 SCIP_Bool* boundconstraint /**< pointer to store whether the constraint is a bound constraint (or NULL) */ 910 ); 911 912 /** check whether the dual solution is available 913 * 914 * @note This is used when calling \ref SCIPprintDualSol() 915 * 916 * @return is dual solution available? 917 * 918 * @pre This method can be called if SCIP is in one of the following stages: 919 * - \ref SCIP_STAGE_SOLVED 920 */ 921 SCIP_EXPORT 922 SCIP_Bool SCIPisDualSolAvailable( 923 SCIP* scip, /**< SCIP data structure */ 924 SCIP_Bool printreason /**< print warning message if dualsol is not available? */ 925 ); 926 927 /** outputs dual solution from LP solver to file stream 928 * 929 * @note This only works if no presolving has been performed, which can be checked by calling method \ref 930 * SCIPhasPerformedPresolve(). 931 * 932 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 933 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 934 * 935 * @pre This method can be called if SCIP is in one of the following stages: 936 * - \ref SCIP_STAGE_SOLVED 937 */ 938 SCIP_EXPORT 939 SCIP_RETCODE SCIPprintDualSol( 940 SCIP* scip, /**< SCIP data structure */ 941 FILE* file, /**< output file (or NULL for standard output) */ 942 SCIP_Bool printzeros /**< should variables set to zero be printed? */ 943 ); 944 945 946 /** outputs non-zero variables of solution representing a ray in original problem space to file stream 947 * 948 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 949 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 950 * 951 * @pre This method can be called if SCIP is in one of the following stages: 952 * - \ref SCIP_STAGE_PROBLEM 953 * - \ref SCIP_STAGE_TRANSFORMED 954 * - \ref SCIP_STAGE_INITPRESOLVE 955 * - \ref SCIP_STAGE_PRESOLVING 956 * - \ref SCIP_STAGE_EXITPRESOLVE 957 * - \ref SCIP_STAGE_PRESOLVED 958 * - \ref SCIP_STAGE_INITSOLVE 959 * - \ref SCIP_STAGE_SOLVING 960 * - \ref SCIP_STAGE_SOLVED 961 * - \ref SCIP_STAGE_EXITSOLVE 962 */ 963 SCIP_EXPORT 964 SCIP_RETCODE SCIPprintRay( 965 SCIP* scip, /**< SCIP data structure */ 966 SCIP_SOL* sol, /**< primal solution representing ray */ 967 FILE* file, /**< output file (or NULL for standard output) */ 968 SCIP_Bool printzeros /**< should variables set to zero be printed? */ 969 ); 970 971 /** gets number of feasible primal solutions stored in the solution storage in case the problem is transformed; 972 * in case the problem stage is SCIP_STAGE_PROBLEM, the number of solution in the original solution candidate 973 * storage is returned 974 * 975 * @return number of feasible primal solutions stored in the solution storage in case the problem is transformed; or 976 * number of solution in the original solution candidate storage if the problem stage is SCIP_STAGE_PROBLEM 977 * 978 * @pre This method can be called if SCIP is in one of the following stages: 979 * - \ref SCIP_STAGE_PROBLEM 980 * - \ref SCIP_STAGE_TRANSFORMED 981 * - \ref SCIP_STAGE_INITPRESOLVE 982 * - \ref SCIP_STAGE_PRESOLVING 983 * - \ref SCIP_STAGE_EXITPRESOLVE 984 * - \ref SCIP_STAGE_PRESOLVED 985 * - \ref SCIP_STAGE_INITSOLVE 986 * - \ref SCIP_STAGE_SOLVING 987 * - \ref SCIP_STAGE_SOLVED 988 * - \ref SCIP_STAGE_EXITSOLVE 989 */ 990 SCIP_EXPORT 991 int SCIPgetNSols( 992 SCIP* scip /**< SCIP data structure */ 993 ); 994 995 /** gets array of feasible primal solutions stored in the solution storage in case the problem is transformed; in case 996 * if the problem stage is in SCIP_STAGE_PROBLEM, it returns the number array of solution candidate stored 997 * 998 * @return array of feasible primal solutions 999 * 1000 * @pre This method can be called if SCIP is in one of the following stages: 1001 * - \ref SCIP_STAGE_PROBLEM 1002 * - \ref SCIP_STAGE_TRANSFORMED 1003 * - \ref SCIP_STAGE_INITPRESOLVE 1004 * - \ref SCIP_STAGE_PRESOLVING 1005 * - \ref SCIP_STAGE_EXITPRESOLVE 1006 * - \ref SCIP_STAGE_PRESOLVED 1007 * - \ref SCIP_STAGE_INITSOLVE 1008 * - \ref SCIP_STAGE_SOLVING 1009 * - \ref SCIP_STAGE_SOLVED 1010 * - \ref SCIP_STAGE_EXITSOLVE 1011 */ 1012 SCIP_EXPORT 1013 SCIP_SOL** SCIPgetSols( 1014 SCIP* scip /**< SCIP data structure */ 1015 ); 1016 1017 /** gets best feasible primal solution found so far if the problem is transformed; in case the problem is in 1018 * SCIP_STAGE_PROBLEM it returns the best solution candidate, or NULL if no solution has been found or the candidate 1019 * store is empty; 1020 * 1021 * @return best feasible primal solution so far 1022 * 1023 * @pre This method can be called if SCIP is in one of the following stages: 1024 * - \ref SCIP_STAGE_PROBLEM 1025 * - \ref SCIP_STAGE_TRANSFORMED 1026 * - \ref SCIP_STAGE_INITPRESOLVE 1027 * - \ref SCIP_STAGE_PRESOLVING 1028 * - \ref SCIP_STAGE_EXITPRESOLVE 1029 * - \ref SCIP_STAGE_PRESOLVED 1030 * - \ref SCIP_STAGE_INITSOLVE 1031 * - \ref SCIP_STAGE_SOLVING 1032 * - \ref SCIP_STAGE_SOLVED 1033 * - \ref SCIP_STAGE_EXITSOLVE 1034 */ 1035 SCIP_EXPORT 1036 SCIP_SOL* SCIPgetBestSol( 1037 SCIP* scip /**< SCIP data structure */ 1038 ); 1039 1040 /** outputs best feasible primal solution found so far to file stream 1041 * 1042 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 1043 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 1044 * 1045 * @pre This method can be called if SCIP is in one of the following stages: 1046 * - \ref SCIP_STAGE_INIT 1047 * - \ref SCIP_STAGE_PROBLEM 1048 * - \ref SCIP_STAGE_TRANSFORMING 1049 * - \ref SCIP_STAGE_TRANSFORMED 1050 * - \ref SCIP_STAGE_INITPRESOLVE 1051 * - \ref SCIP_STAGE_PRESOLVING 1052 * - \ref SCIP_STAGE_EXITPRESOLVE 1053 * - \ref SCIP_STAGE_PRESOLVED 1054 * - \ref SCIP_STAGE_INITSOLVE 1055 * - \ref SCIP_STAGE_SOLVING 1056 * - \ref SCIP_STAGE_SOLVED 1057 * - \ref SCIP_STAGE_EXITSOLVE 1058 * - \ref SCIP_STAGE_FREE 1059 */ 1060 SCIP_EXPORT 1061 SCIP_RETCODE SCIPprintBestSol( 1062 SCIP* scip, /**< SCIP data structure */ 1063 FILE* file, /**< output file (or NULL for standard output) */ 1064 SCIP_Bool printzeros /**< should variables set to zero be printed? */ 1065 ); 1066 1067 /** outputs best feasible primal solution found so far in transformed variables to file stream 1068 * 1069 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 1070 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 1071 * 1072 * @pre This method can be called if SCIP is in one of the following stages: 1073 * - \ref SCIP_STAGE_INIT 1074 * - \ref SCIP_STAGE_PROBLEM 1075 * - \ref SCIP_STAGE_TRANSFORMING 1076 * - \ref SCIP_STAGE_TRANSFORMED 1077 * - \ref SCIP_STAGE_INITPRESOLVE 1078 * - \ref SCIP_STAGE_PRESOLVING 1079 * - \ref SCIP_STAGE_EXITPRESOLVE 1080 * - \ref SCIP_STAGE_PRESOLVED 1081 * - \ref SCIP_STAGE_INITSOLVE 1082 * - \ref SCIP_STAGE_SOLVING 1083 * - \ref SCIP_STAGE_SOLVED 1084 * - \ref SCIP_STAGE_EXITSOLVE 1085 * - \ref SCIP_STAGE_FREE 1086 */ 1087 SCIP_EXPORT 1088 SCIP_RETCODE SCIPprintBestTransSol( 1089 SCIP* scip, /**< SCIP data structure */ 1090 FILE* file, /**< output file (or NULL for standard output) */ 1091 SCIP_Bool printzeros /**< should variables set to zero be printed? */ 1092 ); 1093 1094 /** try to round given solution 1095 * 1096 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 1097 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 1098 * 1099 * @pre This method can be called if SCIP is in one of the following stages: 1100 * - \ref SCIP_STAGE_SOLVING 1101 */ 1102 SCIP_EXPORT 1103 SCIP_RETCODE SCIProundSol( 1104 SCIP* scip, /**< SCIP data structure */ 1105 SCIP_SOL* sol, /**< primal solution */ 1106 SCIP_Bool* success /**< pointer to store whether rounding was successful */ 1107 ); 1108 1109 /** retransforms solution to original problem space 1110 * 1111 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 1112 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 1113 * 1114 * @pre This method can be called if SCIP is in one of the following stages: 1115 * - \ref SCIP_STAGE_PROBLEM 1116 * - \ref SCIP_STAGE_TRANSFORMING 1117 * - \ref SCIP_STAGE_TRANSFORMED 1118 * - \ref SCIP_STAGE_INITPRESOLVE 1119 * - \ref SCIP_STAGE_PRESOLVING 1120 * - \ref SCIP_STAGE_EXITPRESOLVE 1121 * - \ref SCIP_STAGE_PRESOLVED 1122 * - \ref SCIP_STAGE_INITSOLVE 1123 * - \ref SCIP_STAGE_SOLVING 1124 * - \ref SCIP_STAGE_SOLVED 1125 * - \ref SCIP_STAGE_EXITSOLVE 1126 * - \ref SCIP_STAGE_FREETRANS 1127 */ 1128 SCIP_EXPORT 1129 SCIP_RETCODE SCIPretransformSol( 1130 SCIP* scip, /**< SCIP data structure */ 1131 SCIP_SOL* sol /**< primal CIP solution */ 1132 ); 1133 1134 /** reads a given solution file 1135 * 1136 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 1137 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 1138 * 1139 * @pre This method can be called if SCIP is in one of the following stages: 1140 * - \ref SCIP_STAGE_PROBLEM 1141 * - \ref SCIP_STAGE_TRANSFORMED 1142 * - \ref SCIP_STAGE_INITPRESOLVE 1143 * - \ref SCIP_STAGE_PRESOLVING 1144 * - \ref SCIP_STAGE_EXITPRESOLVE 1145 * - \ref SCIP_STAGE_PRESOLVED 1146 * - \ref SCIP_STAGE_INITSOLVE 1147 * - \ref SCIP_STAGE_SOLVING 1148 */ 1149 SCIP_EXPORT 1150 SCIP_RETCODE SCIPreadSol( 1151 SCIP* scip, /**< SCIP data structure */ 1152 const char* filename /**< name of the input file */ 1153 ); 1154 1155 /** reads a given solution file and store the solution values in the given solution pointer 1156 * 1157 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 1158 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 1159 * 1160 * @pre This method can be called if SCIP is in one of the following stages: 1161 * - \ref SCIP_STAGE_PROBLEM 1162 * - \ref SCIP_STAGE_TRANSFORMED 1163 * - \ref SCIP_STAGE_INITPRESOLVE 1164 * - \ref SCIP_STAGE_PRESOLVING 1165 * - \ref SCIP_STAGE_EXITPRESOLVE 1166 * - \ref SCIP_STAGE_PRESOLVED 1167 * - \ref SCIP_STAGE_INITSOLVE 1168 * - \ref SCIP_STAGE_SOLVING 1169 */ 1170 SCIP_EXPORT 1171 SCIP_RETCODE SCIPreadSolFile( 1172 SCIP* scip, /**< SCIP data structure */ 1173 const char* filename, /**< name of the input file */ 1174 SCIP_SOL* sol, /**< solution pointer */ 1175 SCIP_Bool xml, /**< true, iff the given solution in written in XML */ 1176 SCIP_Bool* partial, /**< pointer to store if the solution is partial */ 1177 SCIP_Bool* error /**< pointer store if an error occured */ 1178 ); 1179 1180 /** adds feasible primal solution to solution storage by copying it 1181 * 1182 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 1183 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 1184 * 1185 * @pre This method can be called if SCIP is in one of the following stages: 1186 * - \ref SCIP_STAGE_PROBLEM 1187 * - \ref SCIP_STAGE_TRANSFORMED 1188 * - \ref SCIP_STAGE_INITPRESOLVE 1189 * - \ref SCIP_STAGE_PRESOLVING 1190 * - \ref SCIP_STAGE_EXITPRESOLVE 1191 * - \ref SCIP_STAGE_PRESOLVED 1192 * - \ref SCIP_STAGE_SOLVING 1193 * - \ref SCIP_STAGE_FREETRANS 1194 * 1195 * @note Do not call during propagation, use heur_trysol instead. 1196 */ 1197 SCIP_EXPORT 1198 SCIP_RETCODE SCIPaddSol( 1199 SCIP* scip, /**< SCIP data structure */ 1200 SCIP_SOL* sol, /**< primal CIP solution */ 1201 SCIP_Bool* stored /**< stores whether given solution was good enough to keep */ 1202 ); 1203 1204 /** adds primal solution to solution storage, frees the solution afterwards 1205 * 1206 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 1207 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 1208 * 1209 * @pre This method can be called if SCIP is in one of the following stages: 1210 * - \ref SCIP_STAGE_PROBLEM 1211 * - \ref SCIP_STAGE_TRANSFORMED 1212 * - \ref SCIP_STAGE_INITPRESOLVE 1213 * - \ref SCIP_STAGE_PRESOLVING 1214 * - \ref SCIP_STAGE_EXITPRESOLVE 1215 * - \ref SCIP_STAGE_PRESOLVED 1216 * - \ref SCIP_STAGE_SOLVING 1217 * - \ref SCIP_STAGE_FREETRANS 1218 * 1219 * @note Do not call during propagation, use heur_trysol instead. 1220 */ 1221 SCIP_EXPORT 1222 SCIP_RETCODE SCIPaddSolFree( 1223 SCIP* scip, /**< SCIP data structure */ 1224 SCIP_SOL** sol, /**< pointer to primal CIP solution; is cleared in function call */ 1225 SCIP_Bool* stored /**< stores whether given solution was good enough to keep */ 1226 ); 1227 1228 /** adds current LP/pseudo solution to solution storage 1229 * 1230 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 1231 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 1232 * 1233 * @pre This method can be called if SCIP is in one of the following stages: 1234 * - \ref SCIP_STAGE_PRESOLVED 1235 * - \ref SCIP_STAGE_SOLVING 1236 */ 1237 SCIP_EXPORT 1238 SCIP_RETCODE SCIPaddCurrentSol( 1239 SCIP* scip, /**< SCIP data structure */ 1240 SCIP_HEUR* heur, /**< heuristic that found the solution */ 1241 SCIP_Bool* stored /**< stores whether given solution was good enough to keep */ 1242 ); 1243 1244 /** checks solution for feasibility; if possible, adds it to storage by copying 1245 * 1246 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 1247 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 1248 * 1249 * @pre This method can be called if SCIP is in one of the following stages: 1250 * - \ref SCIP_STAGE_TRANSFORMED 1251 * - \ref SCIP_STAGE_INITPRESOLVE 1252 * - \ref SCIP_STAGE_PRESOLVING 1253 * - \ref SCIP_STAGE_EXITPRESOLVE 1254 * - \ref SCIP_STAGE_PRESOLVED 1255 * - \ref SCIP_STAGE_SOLVING 1256 * 1257 * @note Do not call during propagation, use heur_trysol instead. 1258 */ 1259 SCIP_EXPORT 1260 SCIP_RETCODE SCIPtrySol( 1261 SCIP* scip, /**< SCIP data structure */ 1262 SCIP_SOL* sol, /**< primal CIP solution */ 1263 SCIP_Bool printreason, /**< Should all reasons of violations be printed? */ 1264 SCIP_Bool completely, /**< Should all violations be checked if printreason is true? */ 1265 SCIP_Bool checkbounds, /**< Should the bounds of the variables be checked? */ 1266 SCIP_Bool checkintegrality, /**< Has integrality to be checked? */ 1267 SCIP_Bool checklprows, /**< Do constraints represented by rows in the current LP have to be checked? */ 1268 SCIP_Bool* stored /**< stores whether given solution was feasible and good enough to keep */ 1269 ); 1270 1271 /** checks primal solution; if feasible, adds it to storage; solution is freed afterwards 1272 * 1273 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 1274 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 1275 * 1276 * @pre This method can be called if SCIP is in one of the following stages: 1277 * - \ref SCIP_STAGE_TRANSFORMED 1278 * - \ref SCIP_STAGE_INITPRESOLVE 1279 * - \ref SCIP_STAGE_PRESOLVING 1280 * - \ref SCIP_STAGE_EXITPRESOLVE 1281 * - \ref SCIP_STAGE_PRESOLVED 1282 * - \ref SCIP_STAGE_SOLVING 1283 * 1284 * @note Do not call during propagation, use heur_trysol instead. 1285 */ 1286 SCIP_EXPORT 1287 SCIP_RETCODE SCIPtrySolFree( 1288 SCIP* scip, /**< SCIP data structure */ 1289 SCIP_SOL** sol, /**< pointer to primal CIP solution; is cleared in function call */ 1290 SCIP_Bool printreason, /**< Should all reasons of violations be printed? */ 1291 SCIP_Bool completely, /**< Should all violations be checked if printreason is true? */ 1292 SCIP_Bool checkbounds, /**< Should the bounds of the variables be checked? */ 1293 SCIP_Bool checkintegrality, /**< Has integrality to be checked? */ 1294 SCIP_Bool checklprows, /**< Do constraints represented by rows in the current LP have to be checked? */ 1295 SCIP_Bool* stored /**< stores whether solution was feasible and good enough to keep */ 1296 ); 1297 1298 /** checks current LP/pseudo solution for feasibility; if possible, adds it to storage 1299 * 1300 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 1301 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 1302 * 1303 * @pre This method can be called if SCIP is in one of the following stages: 1304 * - \ref SCIP_STAGE_PRESOLVED 1305 * - \ref SCIP_STAGE_SOLVING 1306 */ 1307 SCIP_EXPORT 1308 SCIP_RETCODE SCIPtryCurrentSol( 1309 SCIP* scip, /**< SCIP data structure */ 1310 SCIP_HEUR* heur, /**< heuristic that found the solution */ 1311 SCIP_Bool printreason, /**< Should all reasons of violations be printed? */ 1312 SCIP_Bool completely, /**< Should all violations be checked if printreason is true? */ 1313 SCIP_Bool checkintegrality, /**< Has integrality to be checked? */ 1314 SCIP_Bool checklprows, /**< Do constraints represented by rows in the current LP have to be checked? */ 1315 SCIP_Bool* stored /**< stores whether given solution was feasible and good enough to keep */ 1316 ); 1317 1318 /** returns all partial solutions 1319 * 1320 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 1321 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 1322 * 1323 * @pre This method can be called if SCIP is in one of the following stages: 1324 * - \ref SCIP_STAGE_PROBLEM 1325 * - \ref SCIP_STAGE_PRESOLVING 1326 * - \ref SCIP_STAGE_SOLVING 1327 * - \ref SCIP_STAGE_SOLVED 1328 */ 1329 SCIP_EXPORT 1330 SCIP_SOL** SCIPgetPartialSols( 1331 SCIP* scip /**< SCIP data structure */ 1332 ); 1333 1334 /** returns number of partial solutions 1335 * 1336 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 1337 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 1338 * 1339 * @pre This method can be called if SCIP is in one of the following stages: 1340 * - \ref SCIP_STAGE_PROBLEM 1341 * - \ref SCIP_STAGE_PRESOLVING 1342 * - \ref SCIP_STAGE_SOLVING 1343 * - \ref SCIP_STAGE_SOLVED 1344 */ 1345 int SCIPgetNPartialSols( 1346 SCIP* scip /**< SCIP data structure */ 1347 ); 1348 1349 /** checks solution for feasibility without adding it to the solution store 1350 * 1351 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 1352 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 1353 * 1354 * @pre This method can be called if SCIP is in one of the following stages: 1355 * - \ref SCIP_STAGE_PROBLEM 1356 * - \ref SCIP_STAGE_TRANSFORMED 1357 * - \ref SCIP_STAGE_INITPRESOLVE 1358 * - \ref SCIP_STAGE_PRESOLVING 1359 * - \ref SCIP_STAGE_EXITPRESOLVE 1360 * - \ref SCIP_STAGE_PRESOLVED 1361 * - \ref SCIP_STAGE_INITSOLVE 1362 * - \ref SCIP_STAGE_SOLVING 1363 * - \ref SCIP_STAGE_SOLVED 1364 */ 1365 SCIP_EXPORT 1366 SCIP_RETCODE SCIPcheckSol( 1367 SCIP* scip, /**< SCIP data structure */ 1368 SCIP_SOL* sol, /**< primal CIP solution */ 1369 SCIP_Bool printreason, /**< Should all reasons of violations be printed? */ 1370 SCIP_Bool completely, /**< Should all violations be checked if printreason is true? */ 1371 SCIP_Bool checkbounds, /**< Should the bounds of the variables be checked? */ 1372 SCIP_Bool checkintegrality, /**< Has integrality to be checked? */ 1373 SCIP_Bool checklprows, /**< Do constraints represented by rows in the current LP have to be checked? */ 1374 SCIP_Bool* feasible /**< stores whether given solution is feasible */ 1375 ); 1376 1377 /** checks solution for feasibility in original problem without adding it to the solution store; 1378 * this method is used to double check a solution in order to validate the presolving process 1379 * 1380 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 1381 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 1382 * 1383 * @pre This method can be called if SCIP is in one of the following stages: 1384 * - \ref SCIP_STAGE_PROBLEM 1385 * - \ref SCIP_STAGE_TRANSFORMED 1386 * - \ref SCIP_STAGE_INITPRESOLVE 1387 * - \ref SCIP_STAGE_PRESOLVING 1388 * - \ref SCIP_STAGE_EXITPRESOLVE 1389 * - \ref SCIP_STAGE_PRESOLVED 1390 * - \ref SCIP_STAGE_INITSOLVE 1391 * - \ref SCIP_STAGE_SOLVING 1392 * - \ref SCIP_STAGE_SOLVED 1393 */ 1394 SCIP_EXPORT 1395 SCIP_RETCODE SCIPcheckSolOrig( 1396 SCIP* scip, /**< SCIP data structure */ 1397 SCIP_SOL* sol, /**< primal CIP solution */ 1398 SCIP_Bool* feasible, /**< stores whether given solution is feasible */ 1399 SCIP_Bool printreason, /**< should the reason for the violation be printed? */ 1400 SCIP_Bool completely /**< Should all violations be checked if printreason is true? */ 1401 ); 1402 1403 /** update integrality violation of a solution */ 1404 SCIP_EXPORT 1405 void SCIPupdateSolIntegralityViolation( 1406 SCIP* scip, /**< SCIP data structure */ 1407 SCIP_SOL* sol, /**< primal CIP solution */ 1408 SCIP_Real absviol /**< absolute violation */ 1409 ); 1410 1411 /** update bound violation of a solution */ 1412 SCIP_EXPORT 1413 void SCIPupdateSolBoundViolation( 1414 SCIP* scip, /**< SCIP data structure */ 1415 SCIP_SOL* sol, /**< primal CIP solution */ 1416 SCIP_Real absviol, /**< absolute violation */ 1417 SCIP_Real relviol /**< relative violation */ 1418 ); 1419 1420 /** update LP row violation of a solution */ 1421 SCIP_EXPORT 1422 void SCIPupdateSolLPRowViolation( 1423 SCIP* scip, /**< SCIP data structure */ 1424 SCIP_SOL* sol, /**< primal CIP solution */ 1425 SCIP_Real absviol, /**< absolute violation */ 1426 SCIP_Real relviol /**< relative violation */ 1427 ); 1428 1429 /** update constraint violation of a solution */ 1430 SCIP_EXPORT 1431 void SCIPupdateSolConsViolation( 1432 SCIP* scip, /**< SCIP data structure */ 1433 SCIP_SOL* sol, /**< primal CIP solution */ 1434 SCIP_Real absviol, /**< absolute violation */ 1435 SCIP_Real relviol /**< relative violation */ 1436 ); 1437 1438 /** update LP row and constraint violations of a solution */ 1439 SCIP_EXPORT 1440 void SCIPupdateSolLPConsViolation( 1441 SCIP* scip, /**< SCIP data structure */ 1442 SCIP_SOL* sol, /**< primal CIP solution */ 1443 SCIP_Real absviol, /**< absolute violation */ 1444 SCIP_Real relviol /**< relative violation */ 1445 ); 1446 1447 /** allow violation updates */ 1448 SCIP_EXPORT 1449 void SCIPactivateSolViolationUpdates( 1450 SCIP* scip /**< SCIP data structure */ 1451 ); 1452 1453 /** disallow violation updates */ 1454 SCIP_EXPORT 1455 void SCIPdeactivateSolViolationUpdates( 1456 SCIP* scip /**< SCIP data structure */ 1457 ); 1458 1459 /** return whether a primal ray is stored that proves unboundedness of the LP relaxation 1460 * 1461 * @return return whether a primal ray is stored that proves unboundedness of the LP relaxation 1462 * 1463 * @pre This method can be called if SCIP is in one of the following stages: 1464 * - \ref SCIP_STAGE_SOLVING 1465 * - \ref SCIP_STAGE_SOLVED 1466 */ 1467 SCIP_EXPORT 1468 SCIP_Bool SCIPhasPrimalRay( 1469 SCIP* scip /**< SCIP data structure */ 1470 ); 1471 1472 /** gets value of given variable in primal ray causing unboundedness of the LP relaxation; 1473 * should only be called if such a ray is stored (check with SCIPhasPrimalRay()) 1474 * 1475 * @return value of given variable in primal ray causing unboundedness of the LP relaxation 1476 * 1477 * @pre This method can be called if SCIP is in one of the following stages: 1478 * - \ref SCIP_STAGE_SOLVING 1479 * - \ref SCIP_STAGE_SOLVED 1480 */ 1481 SCIP_EXPORT 1482 SCIP_Real SCIPgetPrimalRayVal( 1483 SCIP* scip, /**< SCIP data structure */ 1484 SCIP_VAR* var /**< variable to get value for */ 1485 ); 1486 1487 /** updates the primal ray thats proves unboundedness 1488 * 1489 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 1490 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 1491 * 1492 * @pre This method can be called if @p scip is in one of the following stages: 1493 * - \ref SCIP_STAGE_PRESOLVING 1494 * - \ref SCIP_STAGE_PRESOLVED 1495 * - \ref SCIP_STAGE_SOLVING 1496 * - \ref SCIP_STAGE_SOLVED 1497 * 1498 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 1499 */ 1500 SCIP_EXPORT 1501 SCIP_RETCODE SCIPupdatePrimalRay( 1502 SCIP* scip, /**< SCIP data structure */ 1503 SCIP_SOL* primalray /**< the new primal ray */ 1504 ); 1505 1506 /**@} */ 1507 1508 #ifdef __cplusplus 1509 } 1510 #endif 1511 1512 #endif 1513