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_lp.h 26 * @ingroup PUBLICCOREAPI 27 * @brief public methods for the LP relaxation, rows and columns 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_LP_H__ 41 #define __SCIP_SCIP_LP_H__ 42 43 44 #include "lpi/type_lpi.h" 45 #include "scip/def.h" 46 #include "scip/type_cons.h" 47 #include "scip/type_lp.h" 48 #include "scip/type_misc.h" 49 #include "scip/type_retcode.h" 50 #include "scip/type_scip.h" 51 #include "scip/type_sepa.h" 52 #include "scip/type_sol.h" 53 #include "scip/type_var.h" 54 55 #ifdef __cplusplus 56 extern "C" { 57 #endif 58 59 /**@addtogroup PublicLPMethods 60 * 61 * @{ 62 */ 63 64 /** returns, whether the LP was or is to be solved in the current node 65 * 66 * @return whether the LP was or is to be solved in the current node. 67 * 68 * @pre This method can be called if @p scip is in one of the following stages: 69 * - \ref SCIP_STAGE_SOLVING 70 * 71 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 72 */ 73 SCIP_EXPORT 74 SCIP_Bool SCIPhasCurrentNodeLP( 75 SCIP* scip /**< SCIP data structure */ 76 ); 77 78 /** returns, whether the LP of the current node is already constructed 79 * 80 * @return whether the LP of the current node is already constructed. 81 * 82 * @pre This method can be called if @p scip is in one of the following stages: 83 * - \ref SCIP_STAGE_SOLVING 84 * 85 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 86 */ 87 SCIP_EXPORT 88 SCIP_Bool SCIPisLPConstructed( 89 SCIP* scip /**< SCIP data structure */ 90 ); 91 92 /** makes sure that the LP of the current node is loaded and may be accessed through the LP information methods 93 * 94 * @warning Contructing the LP might change the amount of variables known in the transformed problem and therefore also 95 * the variables array of SCIP (returned by SCIPgetVars() and SCIPgetVarsData()), so it might be necessary to 96 * call one of the later method after this one 97 * 98 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 99 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 100 * 101 * @pre This method can be called if @p scip is in one of the following stages: 102 * - \ref SCIP_STAGE_SOLVING 103 * 104 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 105 */ 106 SCIP_EXPORT 107 SCIP_RETCODE SCIPconstructLP( 108 SCIP* scip, /**< SCIP data structure */ 109 SCIP_Bool* cutoff /**< pointer to store whether the node can be cut off */ 110 ); 111 112 /** makes sure that the LP of the current node is flushed 113 * 114 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 115 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 116 * 117 * @pre This method can be called if @p scip is in one of the following stages: 118 * - \ref SCIP_STAGE_SOLVING 119 * 120 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 121 */ 122 SCIP_EXPORT 123 SCIP_RETCODE SCIPflushLP( 124 SCIP* scip /**< SCIP data structure */ 125 ); 126 127 /** gets solution status of current LP 128 * 129 * @return the solution status of current LP. 130 * 131 * @pre This method can be called if @p scip is in one of the following stages: 132 * - \ref SCIP_STAGE_SOLVING 133 * 134 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 135 */ 136 SCIP_EXPORT 137 SCIP_LPSOLSTAT SCIPgetLPSolstat( 138 SCIP* scip /**< SCIP data structure */ 139 ); 140 141 /** returns whether the current LP solution passed the primal feasibility check 142 * 143 * @returns whether the current LP solution passed the primal feasibility check. 144 * 145 * @pre This method can be called if @p scip is in one of the following stages: 146 * - \ref SCIP_STAGE_SOLVING 147 * 148 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 149 */ 150 SCIP_EXPORT 151 SCIP_Bool SCIPisLPPrimalReliable( 152 SCIP* scip /**< SCIP data structure */ 153 ); 154 155 /** returns whether the current LP solution passed the dual feasibility check 156 * 157 * @returns whether the current LP solution passed the dual feasibility check. 158 * 159 * @pre This method can be called if @p scip is in one of the following stages: 160 * - \ref SCIP_STAGE_SOLVING 161 * 162 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 163 */ 164 SCIP_EXPORT 165 SCIP_Bool SCIPisLPDualReliable( 166 SCIP* scip /**< SCIP data structure */ 167 ); 168 169 /** returns whether the current lp is a relaxation of the current problem and its optimal objective value is a local lower bound 170 * 171 * @return whether the current lp is a relaxation of the current problem and its optimal objective value is a local lower bound. 172 * 173 * @pre This method can be called if @p scip is in one of the following stages: 174 * - \ref SCIP_STAGE_SOLVING 175 * 176 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 177 */ 178 SCIP_EXPORT 179 SCIP_Bool SCIPisLPRelax( 180 SCIP* scip /**< SCIP data structure */ 181 ); 182 183 /** gets objective value of current LP (which is the sum of column and loose objective value) 184 * 185 * @return the objective value of current LP (which is the sum of column and loose objective value). 186 * 187 * @pre This method can be called if @p scip is in one of the following stages: 188 * - \ref SCIP_STAGE_SOLVING 189 * 190 * @note This method returns the objective value of the current LP solution, which might be primal or dual infeasible 191 * if a limit was hit during solving. It must not be used as a dual bound if the LP solution status returned by 192 * SCIPgetLPSolstat() is SCIP_LPSOLSTAT_ITERLIMIT or SCIP_LPSOLSTAT_TIMELIMIT. 193 * 194 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 195 */ 196 SCIP_EXPORT 197 SCIP_Real SCIPgetLPObjval( 198 SCIP* scip /**< SCIP data structure */ 199 ); 200 201 /** gets part of objective value of current LP that results from COLUMN variables only 202 * 203 * @return the part of objective value of current LP that results from COLUMN variables only. 204 * 205 * @pre This method can be called if @p scip is in one of the following stages: 206 * - \ref SCIP_STAGE_SOLVING 207 * 208 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 209 */ 210 SCIP_EXPORT 211 SCIP_Real SCIPgetLPColumnObjval( 212 SCIP* scip /**< SCIP data structure */ 213 ); 214 215 /** gets part of objective value of current LP that results from LOOSE variables only 216 * 217 * @return part of objective value of current LP that results from LOOSE variables only. 218 * 219 * @pre This method can be called if @p scip is in one of the following stages: 220 * - \ref SCIP_STAGE_SOLVING 221 * 222 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 223 */ 224 SCIP_EXPORT 225 SCIP_Real SCIPgetLPLooseObjval( 226 SCIP* scip /**< SCIP data structure */ 227 ); 228 229 /** gets the global pseudo objective value; that is all variables set to their best (w.r.t. the objective 230 * function) global bound 231 * 232 * @return the global pseudo objective value; that is all variables set to their best (w.r.t. the objective 233 * function) global bound. 234 * 235 * @pre This method can be called if @p scip is in one of the following stages: 236 * - \ref SCIP_STAGE_INITPRESOLVE 237 * - \ref SCIP_STAGE_PRESOLVING 238 * - \ref SCIP_STAGE_EXITPRESOLVE 239 * - \ref SCIP_STAGE_PRESOLVED 240 * - \ref SCIP_STAGE_INITSOLVE 241 * - \ref SCIP_STAGE_SOLVING 242 * 243 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 244 */ 245 SCIP_EXPORT 246 SCIP_Real SCIPgetGlobalPseudoObjval( 247 SCIP* scip /**< SCIP data structure */ 248 ); 249 250 /** gets the pseudo objective value for the current search node; that is all variables set to their best (w.r.t. the 251 * objective function) local bound 252 * 253 * @return the pseudo objective value for the current search node; that is all variables set to their best (w.r.t. the 254 * objective function) local bound. 255 * 256 * @pre This method can be called if @p scip is in one of the following stages: 257 * - \ref SCIP_STAGE_INITPRESOLVE 258 * - \ref SCIP_STAGE_PRESOLVING 259 * - \ref SCIP_STAGE_EXITPRESOLVE 260 * - \ref SCIP_STAGE_PRESOLVED 261 * - \ref SCIP_STAGE_INITSOLVE 262 * - \ref SCIP_STAGE_SOLVING 263 * 264 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 265 */ 266 SCIP_EXPORT 267 SCIP_Real SCIPgetPseudoObjval( 268 SCIP* scip /**< SCIP data structure */ 269 ); 270 271 /** returns whether the root lp is a relaxation of the problem and its optimal objective value is a global lower bound 272 * 273 * @return whether the root lp is a relaxation of the problem and its optimal objective value is a global lower bound. 274 * 275 * @pre This method can be called if @p scip is in one of the following stages: 276 * - \ref SCIP_STAGE_SOLVING 277 * 278 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 279 */ 280 SCIP_EXPORT 281 SCIP_Bool SCIPisRootLPRelax( 282 SCIP* scip /**< SCIP data structure */ 283 ); 284 285 /** gets the objective value of the root node LP or SCIP_INVALID if the root node LP was not (yet) solved 286 * 287 * @return the objective value of the root node LP or SCIP_INVALID if the root node LP was not (yet) solved. 288 * 289 * @pre This method can be called if @p scip is in one of the following stages: 290 * - \ref SCIP_STAGE_INITPRESOLVE 291 * - \ref SCIP_STAGE_PRESOLVING 292 * - \ref SCIP_STAGE_EXITPRESOLVE 293 * - \ref SCIP_STAGE_SOLVING 294 * 295 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 296 */ 297 SCIP_EXPORT 298 SCIP_Real SCIPgetLPRootObjval( 299 SCIP* scip /**< SCIP data structure */ 300 ); 301 302 /** gets part of the objective value of the root node LP that results from COLUMN variables only; 303 * returns SCIP_INVALID if the root node LP was not (yet) solved 304 * 305 * @return the part of the objective value of the root node LP that results from COLUMN variables only; 306 * or SCIP_INVALID if the root node LP was not (yet) solved. 307 * 308 * @pre This method can be called if @p scip is in one of the following stages: 309 * - \ref SCIP_STAGE_INITPRESOLVE 310 * - \ref SCIP_STAGE_PRESOLVING 311 * - \ref SCIP_STAGE_EXITPRESOLVE 312 * - \ref SCIP_STAGE_SOLVING 313 * 314 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 315 */ 316 SCIP_EXPORT 317 SCIP_Real SCIPgetLPRootColumnObjval( 318 SCIP* scip /**< SCIP data structure */ 319 ); 320 321 /** gets part of the objective value of the root node LP that results from LOOSE variables only; 322 * returns SCIP_INVALID if the root node LP was not (yet) solved 323 * 324 * @return the part of the objective value of the root node LP that results from LOOSE variables only; 325 * or SCIP_INVALID if the root node LP was not (yet) solved. 326 * 327 * @pre This method can be called if @p scip is in one of the following stages: 328 * - \ref SCIP_STAGE_INITPRESOLVE 329 * - \ref SCIP_STAGE_PRESOLVING 330 * - \ref SCIP_STAGE_EXITPRESOLVE 331 * - \ref SCIP_STAGE_SOLVING 332 * 333 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 334 */ 335 SCIP_EXPORT 336 SCIP_Real SCIPgetLPRootLooseObjval( 337 SCIP* scip /**< SCIP data structure */ 338 ); 339 340 /** gets current primal feasibility tolerance of LP */ 341 SCIP_EXPORT 342 SCIP_Real SCIPgetLPFeastol( 343 SCIP* scip /**< SCIP data structure */ 344 ); 345 346 /** sets primal feasibility tolerance of LP */ 347 SCIP_EXPORT 348 void SCIPsetLPFeastol( 349 SCIP* scip, /**< SCIP data structure */ 350 SCIP_Real newfeastol /**< new primal feasibility tolerance for LP */ 351 ); 352 353 /** resets primal feasibility tolerance of LP 354 * 355 * Sets primal feasibility tolerance to min of numerics/lpfeastolfactor * numerics/feastol and relaxfeastol. 356 */ 357 SCIP_EXPORT 358 void SCIPresetLPFeastol( 359 SCIP* scip /**< SCIP data structure */ 360 ); 361 362 /** gets current LP columns along with the current number of LP columns 363 * 364 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 365 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 366 * 367 * @pre This method can be called if @p scip is in one of the following stages: 368 * - \ref SCIP_STAGE_SOLVING 369 * 370 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 371 */ 372 SCIP_EXPORT 373 SCIP_RETCODE SCIPgetLPColsData( 374 SCIP* scip, /**< SCIP data structure */ 375 SCIP_COL*** cols, /**< pointer to store the array of LP columns, or NULL */ 376 int* ncols /**< pointer to store the number of LP columns, or NULL */ 377 ); 378 379 /** gets current LP columns 380 * 381 * @return the current LP columns. 382 * 383 * @pre This method can be called if @p scip is in one of the following stages: 384 * - \ref SCIP_STAGE_SOLVING 385 * 386 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 387 */ 388 SCIP_EXPORT 389 SCIP_COL** SCIPgetLPCols( 390 SCIP* scip /**< SCIP data structure */ 391 ); 392 393 /** gets current number of LP columns 394 * 395 * @return the current number of LP columns. 396 * 397 * @pre This method can be called if @p scip is in one of the following stages: 398 * - \ref SCIP_STAGE_SOLVING 399 * 400 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 401 */ 402 SCIP_EXPORT 403 int SCIPgetNLPCols( 404 SCIP* scip /**< SCIP data structure */ 405 ); 406 407 /** gets current number of unfixed LP columns 408 * 409 * @return the current number of unfixed LP columns. 410 * 411 * @pre This method can be called if @p scip is in one of the following stages: 412 * - \ref SCIP_STAGE_SOLVING 413 * 414 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 415 */ 416 SCIP_EXPORT 417 int SCIPgetNUnfixedLPCols( 418 SCIP* scip /**< SCIP data structure */ 419 ); 420 421 /** gets current LP rows along with the current number of LP rows 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 @p scip is in one of the following stages: 427 * - \ref SCIP_STAGE_SOLVING 428 * 429 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 430 */ 431 SCIP_EXPORT 432 SCIP_RETCODE SCIPgetLPRowsData( 433 SCIP* scip, /**< SCIP data structure */ 434 SCIP_ROW*** rows, /**< pointer to store the array of LP rows, or NULL */ 435 int* nrows /**< pointer to store the number of LP rows, or NULL */ 436 ); 437 438 /** gets current LP rows 439 * 440 * @return the current LP rows. 441 * 442 * @pre This method can be called if @p scip is in one of the following stages: 443 * - \ref SCIP_STAGE_SOLVING 444 * 445 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 446 */ 447 SCIP_EXPORT 448 SCIP_ROW** SCIPgetLPRows( 449 SCIP* scip /**< SCIP data structure */ 450 ); 451 452 /** gets current number of LP rows 453 * 454 * @return the current number of LP rows. 455 * 456 * @pre This method can be called if @p scip is in one of the following stages: 457 * - \ref SCIP_STAGE_SOLVING 458 * 459 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 460 */ 461 SCIP_EXPORT 462 int SCIPgetNLPRows( 463 SCIP* scip /**< SCIP data structure */ 464 ); 465 466 /** returns TRUE iff all columns, i.e. every variable with non-empty column w.r.t. all ever created rows, are present 467 * in the LP, and FALSE, if there are additional already existing columns, that may be added to the LP in pricing 468 * 469 * @return TRUE iff all columns, i.e. every variable with non-empty column w.r.t. all ever created rows, are present 470 * in the LP, and FALSE, if there are additional already existing columns, that may be added to the LP in pricing. 471 * 472 * @pre This method can be called if @p scip is in one of the following stages: 473 * - \ref SCIP_STAGE_SOLVING 474 * 475 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 476 */ 477 SCIP_EXPORT 478 SCIP_Bool SCIPallColsInLP( 479 SCIP* scip /**< SCIP data structure */ 480 ); 481 482 /** returns whether the current LP solution is basic, i.e. is defined by a valid simplex basis 483 * 484 * @return whether the current LP solution is basic, i.e. is defined by a valid simplex basis. 485 * 486 * @pre This method can be called if @p scip is in one of the following stages: 487 * - \ref SCIP_STAGE_SOLVING 488 * 489 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 490 */ 491 SCIP_EXPORT 492 SCIP_Bool SCIPisLPSolBasic( 493 SCIP* scip /**< SCIP data structure */ 494 ); 495 496 /** gets all indices of basic columns and rows: index i >= 0 corresponds to column i, index i < 0 to row -i-1 497 * 498 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 499 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 500 * 501 * @pre This method can be called if @p scip is in one of the following stages: 502 * - \ref SCIP_STAGE_SOLVING 503 * 504 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 505 */ 506 SCIP_EXPORT 507 SCIP_RETCODE SCIPgetLPBasisInd( 508 SCIP* scip, /**< SCIP data structure */ 509 int* basisind /**< pointer to store basis indices ready to keep number of rows entries */ 510 ); 511 512 /** gets a row from the inverse basis matrix B^-1 513 * 514 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 515 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 516 * 517 * @pre This method can be called if @p scip is in one of the following stages: 518 * - \ref SCIP_STAGE_SOLVING 519 * 520 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 521 */ 522 SCIP_EXPORT 523 SCIP_RETCODE SCIPgetLPBInvRow( 524 SCIP* scip, /**< SCIP data structure */ 525 int r, /**< row number */ 526 SCIP_Real* coefs, /**< array to store the coefficients of the row */ 527 int* inds, /**< array to store the non-zero indices, or NULL */ 528 int* ninds /**< pointer to store the number of non-zero indices, or NULL 529 * (-1: if we do not store sparsity informations) */ 530 ); 531 532 /** gets a column from the inverse basis matrix B^-1 533 * 534 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 535 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 536 * 537 * @pre This method can be called if @p scip is in one of the following stages: 538 * - \ref SCIP_STAGE_SOLVING 539 * 540 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 541 */ 542 SCIP_EXPORT 543 SCIP_RETCODE SCIPgetLPBInvCol( 544 SCIP* scip, /**< SCIP data structure */ 545 int c, /**< column number of B^-1; this is NOT the number of the column in the LP 546 * returned by SCIPcolGetLPPos(); you have to call SCIPgetBasisInd() 547 * to get the array which links the B^-1 column numbers to the row and 548 * column numbers of the LP! c must be between 0 and nrows-1, since the 549 * basis has the size nrows * nrows */ 550 SCIP_Real* coefs, /**< array to store the coefficients of the column */ 551 int* inds, /**< array to store the non-zero indices, or NULL */ 552 int* ninds /**< pointer to store the number of non-zero indices, or NULL 553 * (-1: if we do not store sparsity informations) */ 554 ); 555 556 /** gets a row from the product of inverse basis matrix B^-1 and coefficient matrix A (i.e. from B^-1 * A) 557 * 558 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 559 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 560 * 561 * @pre This method can be called if @p scip is in one of the following stages: 562 * - \ref SCIP_STAGE_SOLVING 563 * 564 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 565 */ 566 SCIP_EXPORT 567 SCIP_RETCODE SCIPgetLPBInvARow( 568 SCIP* scip, /**< SCIP data structure */ 569 int r, /**< row number */ 570 SCIP_Real* binvrow, /**< row in B^-1 from prior call to SCIPgetLPBInvRow(), or NULL */ 571 SCIP_Real* coefs, /**< array to store the coefficients of the row */ 572 int* inds, /**< array to store the non-zero indices, or NULL */ 573 int* ninds /**< pointer to store the number of non-zero indices, or NULL 574 * (-1: if we do not store sparsity informations) */ 575 ); 576 577 /** gets a column from the product of inverse basis matrix B^-1 and coefficient matrix A (i.e. from B^-1 * A), 578 * i.e., it computes B^-1 * A_c with A_c being the c'th column of A 579 * 580 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 581 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 582 * 583 * @pre This method can be called if @p scip is in one of the following stages: 584 * - \ref SCIP_STAGE_SOLVING 585 * 586 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 587 */ 588 SCIP_EXPORT 589 SCIP_RETCODE SCIPgetLPBInvACol( 590 SCIP* scip, /**< SCIP data structure */ 591 int c, /**< column number which can be accessed by SCIPcolGetLPPos() */ 592 SCIP_Real* coefs, /**< array to store the coefficients of the column */ 593 int* inds, /**< array to store the non-zero indices, or NULL */ 594 int* ninds /**< pointer to store the number of non-zero indices, or NULL 595 * (-1: if we do not store sparsity informations) */ 596 ); 597 598 /** calculates a weighted sum of all LP rows; for negative weights, the left and right hand side of the corresponding 599 * LP row are swapped in the summation 600 * 601 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 602 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 603 * 604 * @pre This method can be called if @p scip is in one of the following stages: 605 * - \ref SCIP_STAGE_SOLVING 606 * 607 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 608 */ 609 SCIP_EXPORT 610 SCIP_RETCODE SCIPsumLPRows( 611 SCIP* scip, /**< SCIP data structure */ 612 SCIP_Real* weights, /**< row weights in row summation */ 613 SCIP_REALARRAY* sumcoef, /**< array to store sum coefficients indexed by variables' probindex */ 614 SCIP_Real* sumlhs, /**< pointer to store the left hand side of the row summation */ 615 SCIP_Real* sumrhs /**< pointer to store the right hand side of the row summation */ 616 ); 617 618 /** interrupts or disables the interrupt of the currently ongoing lp solve; if the lp is not currently constructed just returns with no effect 619 * 620 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 621 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 622 * 623 * @pre This method can be called if @p scip is in one of the following stages: 624 * - \ref SCIP_STAGE_SOLVING 625 * 626 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 627 */ 628 SCIP_EXPORT 629 SCIP_RETCODE SCIPinterruptLP( 630 SCIP* scip, /**< SCIP data structure */ 631 SCIP_Bool interrupt /**< TRUE if interrupt should be set, FALSE if it should be disabled */ 632 ); 633 634 /** writes current LP to a file 635 * 636 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 637 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 638 * 639 * @pre This method can be called if @p scip is in one of the following stages: 640 * - \ref SCIP_STAGE_SOLVING 641 * 642 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 643 */ 644 SCIP_EXPORT 645 SCIP_RETCODE SCIPwriteLP( 646 SCIP* scip, /**< SCIP data structure */ 647 const char* filename /**< file name */ 648 ); 649 650 /** writes MIP relaxation of the current branch-and-bound node to a file 651 * 652 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 653 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 654 * 655 * @pre This method can be called if @p scip is in one of the following stages: 656 * - \ref SCIP_STAGE_SOLVING 657 * 658 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 659 */ 660 SCIP_EXPORT 661 SCIP_RETCODE SCIPwriteMIP( 662 SCIP* scip, /**< SCIP data structure */ 663 const char* filename, /**< file name */ 664 SCIP_Bool genericnames, /**< should generic names like x_i and row_j be used in order to avoid 665 * troubles with reserved symbols? */ 666 SCIP_Bool origobj, /**< should the original objective function be used? */ 667 SCIP_Bool lazyconss /**< output removable rows as lazy constraints? */ 668 ); 669 670 /** gets the LP interface of SCIP; 671 * with the LPI you can use all of the methods defined in lpi/lpi.h; 672 * 673 * @warning You have to make sure, that the full internal state of the LPI does not change or is recovered completely 674 * after the end of the method that uses the LPI. In particular, if you manipulate the LP or its solution 675 * (e.g. by calling one of the SCIPlpiAdd...() or one of the SCIPlpiSolve...() methods), you have to check in 676 * advance with SCIPlpiWasSolved() whether the LP is currently solved. If this is the case, you have to make 677 * sure, the internal solution status is recovered completely at the end of your method. This can be achieved 678 * by getting the LPI state before applying any LPI manipulations with SCIPlpiGetState() and restoring it 679 * afterwards with SCIPlpiSetState() and SCIPlpiFreeState(). Additionally you have to resolve the LP with the 680 * appropriate SCIPlpiSolve...() call in order to reinstall the internal solution status. 681 * 682 * @warning Make also sure, that all parameter values that you have changed are set back to their original values. 683 * 684 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 685 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 686 * 687 * @pre This method can be called if @p scip is in one of the following stages: 688 * - \ref SCIP_STAGE_TRANSFORMED 689 * - \ref SCIP_STAGE_INITPRESOLVE 690 * - \ref SCIP_STAGE_PRESOLVING 691 * - \ref SCIP_STAGE_EXITPRESOLVE 692 * - \ref SCIP_STAGE_PRESOLVED 693 * - \ref SCIP_STAGE_INITSOLVE 694 * - \ref SCIP_STAGE_SOLVING 695 * - \ref SCIP_STAGE_SOLVED 696 * - \ref SCIP_STAGE_EXITSOLVE 697 * 698 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 699 */ 700 SCIP_EXPORT 701 SCIP_RETCODE SCIPgetLPI( 702 SCIP* scip, /**< SCIP data structure */ 703 SCIP_LPI** lpi /**< pointer to store the LP interface */ 704 ); 705 706 /** Displays quality information about the current LP solution. An LP solution need to be available. Information printed 707 * is subject to what the LP solver supports 708 * 709 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 710 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 711 * 712 * @pre This method can be called if @p scip is in one of the following stages: 713 * - \ref SCIP_STAGE_INIT 714 * - \ref SCIP_STAGE_PROBLEM 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_SOLVING 721 * - \ref SCIP_STAGE_SOLVED 722 * - \ref SCIP_STAGE_FREE 723 * 724 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 725 * 726 * @note The printing process is done via the message handler system. 727 */ 728 SCIP_EXPORT 729 SCIP_RETCODE SCIPprintLPSolutionQuality( 730 SCIP* scip, /**< SCIP data structure */ 731 FILE* file /**< output file (or NULL for standard output) */ 732 ); 733 734 /** compute relative interior point to current LP 735 * @see SCIPlpComputeRelIntPoint 736 * 737 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 738 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 739 * 740 * @pre This method can be called if @p scip is in one of the following stages: 741 * - \ref SCIP_STAGE_TRANSFORMED 742 * - \ref SCIP_STAGE_INITPRESOLVE 743 * - \ref SCIP_STAGE_PRESOLVING 744 * - \ref SCIP_STAGE_EXITPRESOLVE 745 * - \ref SCIP_STAGE_PRESOLVED 746 * - \ref SCIP_STAGE_SOLVING 747 * - \ref SCIP_STAGE_SOLVED 748 * 749 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 750 */ 751 SCIP_EXPORT 752 SCIP_RETCODE SCIPcomputeLPRelIntPoint( 753 SCIP* scip, /**< SCIP data structure */ 754 SCIP_Bool relaxrows, /**< should the rows be relaxed */ 755 SCIP_Bool inclobjcutoff, /**< should a row for the objective cutoff be included */ 756 SCIP_Real timelimit, /**< time limit for LP solver */ 757 int iterlimit, /**< iteration limit for LP solver */ 758 SCIP_SOL** point /**< relative interior point on exit */ 759 ); 760 761 /**@} */ 762 763 /**@addtogroup PublicColumnMethods 764 * 765 * @{ 766 */ 767 768 /** returns the reduced costs of a column in the last (feasible) LP 769 * 770 * @return the reduced costs of a column in the last (feasible) LP 771 * 772 * @pre this method can be called in one of the following stages of the SCIP solving process: 773 * - \ref SCIP_STAGE_SOLVING 774 * - \ref SCIP_STAGE_SOLVED 775 * 776 * @note calling this method in SCIP_STAGE_SOLVED is only recommended to experienced users and should only be called 777 * for pure LP instances (without presolving) 778 * 779 * @note The return value of this method should be used carefully if the dual feasibility check was explictely disabled. 780 */ 781 SCIP_EXPORT 782 SCIP_Real SCIPgetColRedcost( 783 SCIP* scip, /**< SCIP data structure */ 784 SCIP_COL* col /**< LP column */ 785 ); 786 787 /** returns the Farkas coefficient of a column in the last (infeasible) LP 788 * 789 * @return the Farkas coefficient of a column in the last (infeasible) LP 790 * 791 * @pre this method can be called in one of the following stages of the SCIP solving process: 792 * - \ref SCIP_STAGE_SOLVING 793 */ 794 SCIP_EXPORT 795 SCIP_Real SCIPgetColFarkasCoef( 796 SCIP* scip, /**< SCIP data structure */ 797 SCIP_COL* col /**< LP column */ 798 ); 799 800 /** marks a column to be not removable from the LP in the current node 801 * 802 * @pre this method can be called in the following stage of the SCIP solving process: 803 * - \ref SCIP_STAGE_SOLVING 804 */ 805 SCIP_EXPORT 806 void SCIPmarkColNotRemovableLocal( 807 SCIP* scip, /**< SCIP data structure */ 808 SCIP_COL* col /**< LP column */ 809 ); 810 811 /**@} */ 812 813 /**@addtogroup PublicRowMethods 814 * 815 * @{ 816 */ 817 818 /** creates and captures an LP row from a constraint handler 819 * 820 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 821 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 822 * 823 * @pre this method can be called in one of the following stages of the SCIP solving process: 824 * - \ref SCIP_STAGE_INITSOLVE 825 * - \ref SCIP_STAGE_SOLVING 826 */ 827 SCIP_EXPORT 828 SCIP_RETCODE SCIPcreateRowConshdlr( 829 SCIP* scip, /**< SCIP data structure */ 830 SCIP_ROW** row, /**< pointer to row */ 831 SCIP_CONSHDLR* conshdlr, /**< constraint handler that creates the row */ 832 const char* name, /**< name of row */ 833 int len, /**< number of nonzeros in the row */ 834 SCIP_COL** cols, /**< array with columns of row entries */ 835 SCIP_Real* vals, /**< array with coefficients of row entries */ 836 SCIP_Real lhs, /**< left hand side of row */ 837 SCIP_Real rhs, /**< right hand side of row */ 838 SCIP_Bool local, /**< is row only valid locally? */ 839 SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */ 840 SCIP_Bool removable /**< should the row be removed from the LP due to aging or cleanup? */ 841 ); 842 843 /** creates and captures an LP row from a constraint 844 * 845 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 846 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 847 * 848 * @pre this method can be called in one of the following stages of the SCIP solving process: 849 * - \ref SCIP_STAGE_INITSOLVE 850 * - \ref SCIP_STAGE_SOLVING 851 */ 852 SCIP_EXPORT 853 SCIP_RETCODE SCIPcreateRowCons( 854 SCIP* scip, /**< SCIP data structure */ 855 SCIP_ROW** row, /**< pointer to row */ 856 SCIP_CONS* cons, /**< constraint that creates the row */ 857 const char* name, /**< name of row */ 858 int len, /**< number of nonzeros in the row */ 859 SCIP_COL** cols, /**< array with columns of row entries */ 860 SCIP_Real* vals, /**< array with coefficients of row entries */ 861 SCIP_Real lhs, /**< left hand side of row */ 862 SCIP_Real rhs, /**< right hand side of row */ 863 SCIP_Bool local, /**< is row only valid locally? */ 864 SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */ 865 SCIP_Bool removable /**< should the row be removed from the LP due to aging or cleanup? */ 866 ); 867 868 /** creates and captures an LP row from a separator 869 * 870 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 871 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 872 * 873 * @pre this method can be called in one of the following stages of the SCIP solving process: 874 * - \ref SCIP_STAGE_INITSOLVE 875 * - \ref SCIP_STAGE_SOLVING 876 */ 877 SCIP_EXPORT 878 SCIP_RETCODE SCIPcreateRowSepa( 879 SCIP* scip, /**< SCIP data structure */ 880 SCIP_ROW** row, /**< pointer to row */ 881 SCIP_SEPA* sepa, /**< separator that creates the row */ 882 const char* name, /**< name of row */ 883 int len, /**< number of nonzeros in the row */ 884 SCIP_COL** cols, /**< array with columns of row entries */ 885 SCIP_Real* vals, /**< array with coefficients of row entries */ 886 SCIP_Real lhs, /**< left hand side of row */ 887 SCIP_Real rhs, /**< right hand side of row */ 888 SCIP_Bool local, /**< is row only valid locally? */ 889 SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */ 890 SCIP_Bool removable /**< should the row be removed from the LP due to aging or cleanup? */ 891 ); 892 893 /** creates and captures an LP row from an unspecified source 894 * 895 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 896 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 897 * 898 * @pre this method can be called in one of the following stages of the SCIP solving process: 899 * - \ref SCIP_STAGE_INITSOLVE 900 * - \ref SCIP_STAGE_SOLVING 901 */ 902 SCIP_EXPORT 903 SCIP_RETCODE SCIPcreateRowUnspec( 904 SCIP* scip, /**< SCIP data structure */ 905 SCIP_ROW** row, /**< pointer to row */ 906 const char* name, /**< name of row */ 907 int len, /**< number of nonzeros in the row */ 908 SCIP_COL** cols, /**< array with columns of row entries */ 909 SCIP_Real* vals, /**< array with coefficients of row entries */ 910 SCIP_Real lhs, /**< left hand side of row */ 911 SCIP_Real rhs, /**< right hand side of row */ 912 SCIP_Bool local, /**< is row only valid locally? */ 913 SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */ 914 SCIP_Bool removable /**< should the row be removed from the LP due to aging or cleanup? */ 915 ); 916 917 /** creates and captures an LP row 918 * 919 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 920 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 921 * 922 * @pre this method can be called in one of the following stages of the SCIP solving process: 923 * - \ref SCIP_STAGE_INITSOLVE 924 * - \ref SCIP_STAGE_SOLVING 925 * 926 * @deprecated Please use SCIPcreateRowConshdlr() or SCIPcreateRowSepa() when calling from a constraint handler or separator in order 927 * to facilitate correct statistics. If the call is from neither a constraint handler or separator, use SCIPcreateRowUnspec(). 928 */ 929 SCIP_EXPORT 930 SCIP_DEPRECATED 931 SCIP_RETCODE SCIPcreateRow( 932 SCIP* scip, /**< SCIP data structure */ 933 SCIP_ROW** row, /**< pointer to row */ 934 const char* name, /**< name of row */ 935 int len, /**< number of nonzeros in the row */ 936 SCIP_COL** cols, /**< array with columns of row entries */ 937 SCIP_Real* vals, /**< array with coefficients of row entries */ 938 SCIP_Real lhs, /**< left hand side of row */ 939 SCIP_Real rhs, /**< right hand side of row */ 940 SCIP_Bool local, /**< is row only valid locally? */ 941 SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */ 942 SCIP_Bool removable /**< should the row be removed from the LP due to aging or cleanup? */ 943 ); 944 945 /** creates and captures an LP row without any coefficients from a constraint handler 946 * 947 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 948 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 949 * 950 * @pre this method can be called in one of the following stages of the SCIP solving process: 951 * - \ref SCIP_STAGE_INITSOLVE 952 * - \ref SCIP_STAGE_SOLVING 953 */ 954 SCIP_EXPORT 955 SCIP_RETCODE SCIPcreateEmptyRowConshdlr( 956 SCIP* scip, /**< SCIP data structure */ 957 SCIP_ROW** row, /**< pointer to row */ 958 SCIP_CONSHDLR* conshdlr, /**< constraint handler that creates the row */ 959 const char* name, /**< name of row */ 960 SCIP_Real lhs, /**< left hand side of row */ 961 SCIP_Real rhs, /**< right hand side of row */ 962 SCIP_Bool local, /**< is row only valid locally? */ 963 SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */ 964 SCIP_Bool removable /**< should the row be removed from the LP due to aging or cleanup? */ 965 ); 966 967 /** creates and captures an LP row without any coefficients from a constraint 968 * 969 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 970 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 971 * 972 * @pre this method can be called in one of the following stages of the SCIP solving process: 973 * - \ref SCIP_STAGE_INITSOLVE 974 * - \ref SCIP_STAGE_SOLVING 975 */ 976 SCIP_EXPORT 977 SCIP_RETCODE SCIPcreateEmptyRowCons( 978 SCIP* scip, /**< SCIP data structure */ 979 SCIP_ROW** row, /**< pointer to row */ 980 SCIP_CONS* cons, /**< constraint that creates the row */ 981 const char* name, /**< name of row */ 982 SCIP_Real lhs, /**< left hand side of row */ 983 SCIP_Real rhs, /**< right hand side of row */ 984 SCIP_Bool local, /**< is row only valid locally? */ 985 SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */ 986 SCIP_Bool removable /**< should the row be removed from the LP due to aging or cleanup? */ 987 ); 988 989 /** creates and captures an LP row without any coefficients from a separator 990 * 991 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 992 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 993 * 994 * @pre this method can be called in one of the following stages of the SCIP solving process: 995 * - \ref SCIP_STAGE_INITSOLVE 996 * - \ref SCIP_STAGE_SOLVING 997 */ 998 SCIP_EXPORT 999 SCIP_RETCODE SCIPcreateEmptyRowSepa( 1000 SCIP* scip, /**< SCIP data structure */ 1001 SCIP_ROW** row, /**< pointer to row */ 1002 SCIP_SEPA* sepa, /**< separator that creates the row */ 1003 const char* name, /**< name of row */ 1004 SCIP_Real lhs, /**< left hand side of row */ 1005 SCIP_Real rhs, /**< right hand side of row */ 1006 SCIP_Bool local, /**< is row only valid locally? */ 1007 SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */ 1008 SCIP_Bool removable /**< should the row be removed from the LP due to aging or cleanup? */ 1009 ); 1010 1011 /** creates and captures an LP row without any coefficients from an unspecified source 1012 * 1013 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 1014 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 1015 * 1016 * @pre this method can be called in one of the following stages of the SCIP solving process: 1017 * - \ref SCIP_STAGE_INITSOLVE 1018 * - \ref SCIP_STAGE_SOLVING 1019 */ 1020 SCIP_EXPORT 1021 SCIP_RETCODE SCIPcreateEmptyRowUnspec( 1022 SCIP* scip, /**< SCIP data structure */ 1023 SCIP_ROW** row, /**< pointer to row */ 1024 const char* name, /**< name of row */ 1025 SCIP_Real lhs, /**< left hand side of row */ 1026 SCIP_Real rhs, /**< right hand side of row */ 1027 SCIP_Bool local, /**< is row only valid locally? */ 1028 SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */ 1029 SCIP_Bool removable /**< should the row be removed from the LP due to aging or cleanup? */ 1030 ); 1031 1032 /** creates and captures an LP row without any coefficients 1033 * 1034 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 1035 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 1036 * 1037 * @pre this method can be called in one of the following stages of the SCIP solving process: 1038 * - \ref SCIP_STAGE_INITSOLVE 1039 * - \ref SCIP_STAGE_SOLVING 1040 * 1041 * @deprecated Please use SCIPcreateEmptyRowConshdlr() or SCIPcreateEmptyRowSepa() when calling from a constraint handler or separator in order 1042 * to facilitate correct statistics. If the call is from neither a constraint handler or separator, use SCIPcreateEmptyRowUnspec(). 1043 */ 1044 SCIP_EXPORT 1045 SCIP_DEPRECATED 1046 SCIP_RETCODE SCIPcreateEmptyRow( 1047 SCIP* scip, /**< SCIP data structure */ 1048 SCIP_ROW** row, /**< pointer to row */ 1049 const char* name, /**< name of row */ 1050 SCIP_Real lhs, /**< left hand side of row */ 1051 SCIP_Real rhs, /**< right hand side of row */ 1052 SCIP_Bool local, /**< is row only valid locally? */ 1053 SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */ 1054 SCIP_Bool removable /**< should the row be removed from the LP due to aging or cleanup? */ 1055 ); 1056 1057 /** increases usage counter of LP row 1058 * 1059 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 1060 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 1061 * 1062 * @pre this method can be called in one of the following stages of the SCIP solving process: 1063 * - \ref SCIP_STAGE_INITSOLVE 1064 * - \ref SCIP_STAGE_SOLVING 1065 */ 1066 SCIP_EXPORT 1067 SCIP_RETCODE SCIPcaptureRow( 1068 SCIP* scip, /**< SCIP data structure */ 1069 SCIP_ROW* row /**< row to capture */ 1070 ); 1071 1072 /** decreases usage counter of LP row, and frees memory if necessary 1073 * 1074 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 1075 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 1076 * 1077 * @pre this method can be called in one of the following stages of the SCIP solving process: 1078 * - \ref SCIP_STAGE_INITSOLVE 1079 * - \ref SCIP_STAGE_SOLVING 1080 * - \ref SCIP_STAGE_EXITSOLVE 1081 */ 1082 SCIP_EXPORT 1083 SCIP_RETCODE SCIPreleaseRow( 1084 SCIP* scip, /**< SCIP data structure */ 1085 SCIP_ROW** row /**< pointer to LP row */ 1086 ); 1087 1088 /** changes left hand side of LP row 1089 * 1090 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 1091 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 1092 * 1093 * @pre this method can be called in one of the following stages of the SCIP solving process: 1094 * - \ref SCIP_STAGE_INITSOLVE 1095 * - \ref SCIP_STAGE_SOLVING 1096 */ 1097 SCIP_EXPORT 1098 SCIP_RETCODE SCIPchgRowLhs( 1099 SCIP* scip, /**< SCIP data structure */ 1100 SCIP_ROW* row, /**< LP row */ 1101 SCIP_Real lhs /**< new left hand side */ 1102 ); 1103 1104 /** changes right hand side of LP row 1105 * 1106 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 1107 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 1108 * 1109 * @pre this method can be called in one of the following stages of the SCIP solving process: 1110 * - \ref SCIP_STAGE_INITSOLVE 1111 * - \ref SCIP_STAGE_SOLVING 1112 */ 1113 SCIP_EXPORT 1114 SCIP_RETCODE SCIPchgRowRhs( 1115 SCIP* scip, /**< SCIP data structure */ 1116 SCIP_ROW* row, /**< LP row */ 1117 SCIP_Real rhs /**< new right hand side */ 1118 ); 1119 1120 /** informs row, that all subsequent additions of variables to the row should be cached and not directly applied; 1121 * after all additions were applied, SCIPflushRowExtensions() must be called; 1122 * while the caching of row extensions is activated, information methods of the row give invalid results; 1123 * caching should be used, if a row is build with SCIPaddVarToRow() calls variable by variable to increase 1124 * the performance 1125 * 1126 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 1127 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 1128 * 1129 * @pre this method can be called in one of the following stages of the SCIP solving process: 1130 * - \ref SCIP_STAGE_INITSOLVE 1131 * - \ref SCIP_STAGE_SOLVING 1132 */ 1133 SCIP_EXPORT 1134 SCIP_RETCODE SCIPcacheRowExtensions( 1135 SCIP* scip, /**< SCIP data structure */ 1136 SCIP_ROW* row /**< LP row */ 1137 ); 1138 1139 /** flushes all cached row extensions after a call of SCIPcacheRowExtensions() and merges coefficients with 1140 * equal columns into a single coefficient 1141 * 1142 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 1143 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 1144 * 1145 * @pre this method can be called in one of the following stages of the SCIP solving process: 1146 * - \ref SCIP_STAGE_INITSOLVE 1147 * - \ref SCIP_STAGE_SOLVING 1148 */ 1149 SCIP_EXPORT 1150 SCIP_RETCODE SCIPflushRowExtensions( 1151 SCIP* scip, /**< SCIP data structure */ 1152 SCIP_ROW* row /**< LP row */ 1153 ); 1154 1155 /** resolves variable to columns and adds them with the coefficient to the row 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 * @attention If the absolute value of val is below the SCIP epsilon tolerance, the variable will not added. 1161 * 1162 * @pre this method can be called in one of the following stages of the SCIP solving process: 1163 * - \ref SCIP_STAGE_INITSOLVE 1164 * - \ref SCIP_STAGE_SOLVING 1165 * 1166 * @note In case calling this method in the enforcement process of an lp solution, it might be that some variables, 1167 * that were not yet in the LP (e.g. dynamic columns) will change their lp solution value returned by SCIP. 1168 * For example, a variable, which has a negative objective value, that has no column in the lp yet, is in the lp solution 1169 * on its upper bound (variables with status SCIP_VARSTATUS_LOOSE are in an lp solution on it's best bound), but 1170 * creating the column, changes the solution value (variable than has status SCIP_VARSTATUS_COLUMN, and the 1171 * initialization sets the lp solution value) to 0.0. (This leads to the conclusion that, if a constraint was 1172 * violated, the linear relaxation might not be violated anymore.) 1173 * 1174 * @note When several variables are added to a row with the use of this function, performance can be improved by 1175 * calling SCIPcacheRowExtensions() before these additions and SCIPflushRowExtensions() after. 1176 */ 1177 SCIP_EXPORT 1178 SCIP_RETCODE SCIPaddVarToRow( 1179 SCIP* scip, /**< SCIP data structure */ 1180 SCIP_ROW* row, /**< LP row */ 1181 SCIP_VAR* var, /**< problem variable */ 1182 SCIP_Real val /**< value of coefficient */ 1183 ); 1184 1185 /** resolves variables to columns and adds them with the coefficients to the row; 1186 * this method caches the row extensions and flushes them afterwards to gain better performance 1187 * 1188 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 1189 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 1190 * 1191 * @attention If a coefficients absolute value is below the SCIP epsilon tolerance, the variable with its value is not added. 1192 * 1193 * @pre this method can be called in one of the following stages of the SCIP solving process: 1194 * - \ref SCIP_STAGE_INITSOLVE 1195 * - \ref SCIP_STAGE_SOLVING 1196 */ 1197 SCIP_EXPORT 1198 SCIP_RETCODE SCIPaddVarsToRow( 1199 SCIP* scip, /**< SCIP data structure */ 1200 SCIP_ROW* row, /**< LP row */ 1201 int nvars, /**< number of variables to add to the row */ 1202 SCIP_VAR** vars, /**< problem variables to add */ 1203 SCIP_Real* vals /**< values of coefficients */ 1204 ); 1205 1206 /** resolves variables to columns and adds them with the same single coefficient to the row; 1207 * this method caches the row extensions and flushes them afterwards to gain better performance 1208 * 1209 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 1210 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 1211 * 1212 * @attention If the absolute value of val is below the SCIP epsilon tolerance, the variables will not added. 1213 * 1214 * @pre this method can be called in one of the following stages of the SCIP solving process: 1215 * - \ref SCIP_STAGE_INITSOLVE 1216 * - \ref SCIP_STAGE_SOLVING 1217 */ 1218 SCIP_EXPORT 1219 SCIP_RETCODE SCIPaddVarsToRowSameCoef( 1220 SCIP* scip, /**< SCIP data structure */ 1221 SCIP_ROW* row, /**< LP row */ 1222 int nvars, /**< number of variables to add to the row */ 1223 SCIP_VAR** vars, /**< problem variables to add */ 1224 SCIP_Real val /**< unique value of all coefficients */ 1225 ); 1226 1227 /** tries to find a value, such that all row coefficients, if scaled with this value become integral 1228 * 1229 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 1230 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 1231 * 1232 * @pre this method can be called in one of the following stages of the SCIP solving process: 1233 * - \ref SCIP_STAGE_INITSOLVE 1234 * - \ref SCIP_STAGE_SOLVING 1235 */ 1236 SCIP_EXPORT 1237 SCIP_RETCODE SCIPcalcRowIntegralScalar( 1238 SCIP* scip, /**< SCIP data structure */ 1239 SCIP_ROW* row, /**< LP row */ 1240 SCIP_Real mindelta, /**< minimal relative allowed difference of scaled coefficient s*c and integral i */ 1241 SCIP_Real maxdelta, /**< maximal relative allowed difference of scaled coefficient s*c and integral i */ 1242 SCIP_Longint maxdnom, /**< maximal denominator allowed in rational numbers */ 1243 SCIP_Real maxscale, /**< maximal allowed scalar */ 1244 SCIP_Bool usecontvars, /**< should the coefficients of the continuous variables also be made integral? */ 1245 SCIP_Real* intscalar, /**< pointer to store scalar that would make the coefficients integral, or NULL */ 1246 SCIP_Bool* success /**< stores whether returned value is valid */ 1247 ); 1248 1249 /** tries to scale row, s.t. all coefficients (of integer variables) become integral 1250 * 1251 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 1252 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 1253 * 1254 * @pre this method can be called in one of the following stages of the SCIP solving process: 1255 * - \ref SCIP_STAGE_INITSOLVE 1256 * - \ref SCIP_STAGE_SOLVING 1257 */ 1258 SCIP_EXPORT 1259 SCIP_RETCODE SCIPmakeRowIntegral( 1260 SCIP* scip, /**< SCIP data structure */ 1261 SCIP_ROW* row, /**< LP row */ 1262 SCIP_Real mindelta, /**< minimal relative allowed difference of scaled coefficient s*c and integral i */ 1263 SCIP_Real maxdelta, /**< maximal relative allowed difference of scaled coefficient s*c and integral i */ 1264 SCIP_Longint maxdnom, /**< maximal denominator allowed in rational numbers */ 1265 SCIP_Real maxscale, /**< maximal value to scale row with */ 1266 SCIP_Bool usecontvars, /**< should the coefficients of the continuous variables also be made integral? */ 1267 SCIP_Bool* success /**< stores whether row could be made rational */ 1268 ); 1269 1270 /** marks a row to be not removable from the LP in the current node 1271 * 1272 * @pre this method can be called in the following stage of the SCIP solving process: 1273 * - \ref SCIP_STAGE_SOLVING 1274 */ 1275 SCIP_EXPORT 1276 void SCIPmarkRowNotRemovableLocal( 1277 SCIP* scip, /**< SCIP data structure */ 1278 SCIP_ROW* row /**< LP row */ 1279 ); 1280 1281 /** returns number of integral columns in the row 1282 * 1283 * @return number of integral columns in the row 1284 * 1285 * @pre this method can be called in one of the following stages of the SCIP solving process: 1286 * - \ref SCIP_STAGE_INITSOLVE 1287 * - \ref SCIP_STAGE_SOLVING 1288 */ 1289 SCIP_EXPORT 1290 int SCIPgetRowNumIntCols( 1291 SCIP* scip, /**< SCIP data structure */ 1292 SCIP_ROW* row /**< LP row */ 1293 ); 1294 1295 /** returns minimal absolute value of row vector's non-zero coefficients 1296 * 1297 * @return minimal absolute value of row vector's non-zero coefficients 1298 * 1299 * @pre this method can be called in one of the following stages of the SCIP solving process: 1300 * - \ref SCIP_STAGE_INITSOLVE 1301 * - \ref SCIP_STAGE_SOLVING 1302 */ 1303 SCIP_EXPORT 1304 SCIP_Real SCIPgetRowMinCoef( 1305 SCIP* scip, /**< SCIP data structure */ 1306 SCIP_ROW* row /**< LP row */ 1307 ); 1308 1309 /** returns maximal absolute value of row vector's non-zero coefficients 1310 * 1311 * @return maximal absolute value of row vector's non-zero coefficients 1312 * 1313 * @pre this method can be called in one of the following stages of the SCIP solving process: 1314 * - \ref SCIP_STAGE_INITSOLVE 1315 * - \ref SCIP_STAGE_SOLVING 1316 */ 1317 SCIP_EXPORT 1318 SCIP_Real SCIPgetRowMaxCoef( 1319 SCIP* scip, /**< SCIP data structure */ 1320 SCIP_ROW* row /**< LP row */ 1321 ); 1322 1323 /** returns the minimal activity of a row w.r.t. the column's bounds 1324 * 1325 * @return the minimal activity of a row w.r.t. the column's bounds 1326 * 1327 * @pre this method can be called in one of the following stages of the SCIP solving process: 1328 * - \ref SCIP_STAGE_SOLVING 1329 */ 1330 SCIP_EXPORT 1331 SCIP_Real SCIPgetRowMinActivity( 1332 SCIP* scip, /**< SCIP data structure */ 1333 SCIP_ROW* row /**< LP row */ 1334 ); 1335 1336 /** returns the maximal activity of a row w.r.t. the column's bounds 1337 * 1338 * @return the maximal activity of a row w.r.t. the column's bounds 1339 * 1340 * @pre this method can be called in one of the following stages of the SCIP solving process: 1341 * - \ref SCIP_STAGE_SOLVING 1342 */ 1343 SCIP_EXPORT 1344 SCIP_Real SCIPgetRowMaxActivity( 1345 SCIP* scip, /**< SCIP data structure */ 1346 SCIP_ROW* row /**< LP row */ 1347 ); 1348 1349 /** recalculates the activity of a row in the last LP solution 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 in one of the following stages of the SCIP solving process: 1355 * - \ref SCIP_STAGE_SOLVING 1356 */ 1357 SCIP_EXPORT 1358 SCIP_RETCODE SCIPrecalcRowLPActivity( 1359 SCIP* scip, /**< SCIP data structure */ 1360 SCIP_ROW* row /**< LP row */ 1361 ); 1362 1363 /** returns the activity of a row in the last LP solution 1364 * 1365 * @return activity of a row in the last LP solution 1366 * 1367 * @pre this method can be called in one of the following stages of the SCIP solving process: 1368 * - \ref SCIP_STAGE_SOLVING 1369 */ 1370 SCIP_EXPORT 1371 SCIP_Real SCIPgetRowLPActivity( 1372 SCIP* scip, /**< SCIP data structure */ 1373 SCIP_ROW* row /**< LP row */ 1374 ); 1375 1376 /** returns the feasibility of a row in the last LP solution 1377 * 1378 * @return the feasibility of a row in the last LP solution: negative value means infeasibility 1379 * 1380 * @pre this method can be called in one of the following stages of the SCIP solving process: 1381 * - \ref SCIP_STAGE_SOLVING 1382 */ 1383 SCIP_EXPORT 1384 SCIP_Real SCIPgetRowLPFeasibility( 1385 SCIP* scip, /**< SCIP data structure */ 1386 SCIP_ROW* row /**< LP row */ 1387 ); 1388 1389 /** recalculates the activity of a row for the current pseudo solution 1390 * 1391 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 1392 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 1393 * 1394 * @pre this method can be called in one of the following stages of the SCIP solving process: 1395 * - \ref SCIP_STAGE_SOLVING 1396 */ 1397 SCIP_EXPORT 1398 SCIP_RETCODE SCIPrecalcRowPseudoActivity( 1399 SCIP* scip, /**< SCIP data structure */ 1400 SCIP_ROW* row /**< LP row */ 1401 ); 1402 1403 /** returns the activity of a row for the current pseudo solution 1404 * 1405 * @return the activity of a row for the current pseudo solution 1406 * 1407 * @pre this method can be called in one of the following stages of the SCIP solving process: 1408 * - \ref SCIP_STAGE_SOLVING 1409 */ 1410 SCIP_EXPORT 1411 SCIP_Real SCIPgetRowPseudoActivity( 1412 SCIP* scip, /**< SCIP data structure */ 1413 SCIP_ROW* row /**< LP row */ 1414 ); 1415 1416 /** returns the feasibility of a row for the current pseudo solution: negative value means infeasibility 1417 * 1418 * @return the feasibility of a row for the current pseudo solution: negative value means infeasibility 1419 * 1420 * @pre this method can be called in one of the following stages of the SCIP solving process: 1421 * - \ref SCIP_STAGE_SOLVING 1422 */ 1423 SCIP_EXPORT 1424 SCIP_Real SCIPgetRowPseudoFeasibility( 1425 SCIP* scip, /**< SCIP data structure */ 1426 SCIP_ROW* row /**< LP row */ 1427 ); 1428 1429 /** recalculates the activity of a row in the last LP or pseudo solution 1430 * 1431 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 1432 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 1433 * 1434 * @pre this method can be called in one of the following stages of the SCIP solving process: 1435 * - \ref SCIP_STAGE_SOLVING 1436 */ 1437 SCIP_EXPORT 1438 SCIP_RETCODE SCIPrecalcRowActivity( 1439 SCIP* scip, /**< SCIP data structure */ 1440 SCIP_ROW* row /**< LP row */ 1441 ); 1442 1443 /** returns the activity of a row in the last LP or pseudo solution 1444 * 1445 * @return the activity of a row in the last LP or pseudo solution 1446 * 1447 * @pre this method can be called in one of the following stages of the SCIP solving process: 1448 * - \ref SCIP_STAGE_SOLVING 1449 */ 1450 SCIP_EXPORT 1451 SCIP_Real SCIPgetRowActivity( 1452 SCIP* scip, /**< SCIP data structure */ 1453 SCIP_ROW* row /**< LP row */ 1454 ); 1455 1456 /** returns the feasibility of a row in the last LP or pseudo solution 1457 * 1458 * @return the feasibility of a row in the last LP or pseudo solution 1459 * 1460 * @pre this method can be called in one of the following stages of the SCIP solving process: 1461 * - \ref SCIP_STAGE_SOLVING 1462 */ 1463 SCIP_EXPORT 1464 SCIP_Real SCIPgetRowFeasibility( 1465 SCIP* scip, /**< SCIP data structure */ 1466 SCIP_ROW* row /**< LP row */ 1467 ); 1468 1469 /** returns the activity of a row for the given primal solution 1470 * 1471 * @return the activitiy of a row for the given primal solution 1472 * 1473 * @pre this method can be called in one of the following stages of the SCIP solving process: 1474 * - \ref SCIP_STAGE_SOLVING 1475 */ 1476 SCIP_EXPORT 1477 SCIP_Real SCIPgetRowSolActivity( 1478 SCIP* scip, /**< SCIP data structure */ 1479 SCIP_ROW* row, /**< LP row */ 1480 SCIP_SOL* sol /**< primal CIP solution */ 1481 ); 1482 1483 /** returns the feasibility of a row for the given primal solution 1484 * 1485 * @return the feasibility of a row for the given primal solution 1486 * 1487 * @pre this method can be called in one of the following stages of the SCIP solving process: 1488 * - \ref SCIP_STAGE_SOLVING 1489 */ 1490 SCIP_EXPORT 1491 SCIP_Real SCIPgetRowSolFeasibility( 1492 SCIP* scip, /**< SCIP data structure */ 1493 SCIP_ROW* row, /**< LP row */ 1494 SCIP_SOL* sol /**< primal CIP solution */ 1495 ); 1496 1497 /** returns the parallelism of row with objective function 1498 * 1499 * @return 1 is returned if the row is parallel to the objective function and 0 if it is orthogonal 1500 * 1501 * @pre this method can be called in one of the following stages of the SCIP solving process: 1502 * - \ref SCIP_STAGE_SOLVING 1503 */ 1504 SCIP_EXPORT 1505 SCIP_Real SCIPgetRowObjParallelism( 1506 SCIP* scip, /**< SCIP data structure */ 1507 SCIP_ROW* row /**< LP row */ 1508 ); 1509 1510 /** output row to file stream via the message handler system 1511 * 1512 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 1513 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 1514 * 1515 * @pre this method can be called in one of the following stages of the SCIP solving process: 1516 * - \ref SCIP_STAGE_INITSOLVE 1517 * - \ref SCIP_STAGE_SOLVING 1518 * - \ref SCIP_STAGE_SOLVED 1519 * - \ref SCIP_STAGE_EXITSOLVE 1520 */ 1521 SCIP_EXPORT 1522 SCIP_RETCODE SCIPprintRow( 1523 SCIP* scip, /**< SCIP data structure */ 1524 SCIP_ROW* row, /**< LP row */ 1525 FILE* file /**< output file (or NULL for standard output) */ 1526 ); 1527 1528 /**@} */ 1529 1530 /**@addtogroup PublicLPDivingMethods 1531 * 1532 * @{ 1533 */ 1534 1535 /** initiates LP diving, making methods SCIPchgVarObjDive(), SCIPchgVarLbDive(), and SCIPchgVarUbDive() available 1536 * 1537 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 1538 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 1539 * 1540 * @pre This method can be called if @p scip is in one of the following stages: 1541 * - \ref SCIP_STAGE_SOLVING 1542 * 1543 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 1544 * 1545 * @note diving is allowed even if the current LP is not flushed, not solved, or not solved to optimality; be aware 1546 * that solving the (first) diving LP may take longer than expect and that the latter two cases could stem from 1547 * numerical troubles during the last LP solve; because of this, most users will want to call this method only if 1548 * SCIPgetLPSolstat(scip) == SCIP_LPSOLSTAT_OPTIMAL 1549 */ 1550 SCIP_EXPORT 1551 SCIP_RETCODE SCIPstartDive( 1552 SCIP* scip /**< SCIP data structure */ 1553 ); 1554 1555 /** quits LP diving and resets bounds and objective values of columns to the current node's values 1556 * 1557 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 1558 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 1559 * 1560 * @pre This method can be called if @p scip is in one of the following stages: 1561 * - \ref SCIP_STAGE_SOLVING 1562 * 1563 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 1564 */ 1565 SCIP_EXPORT 1566 SCIP_RETCODE SCIPendDive( 1567 SCIP* scip /**< SCIP data structure */ 1568 ); 1569 1570 /** changes cutoffbound in current dive 1571 * 1572 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 1573 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 1574 * 1575 * @pre This method can be called if @p scip is in one of the following stages: 1576 * - \ref SCIP_STAGE_SOLVING 1577 * 1578 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 1579 */ 1580 SCIP_EXPORT 1581 SCIP_RETCODE SCIPchgCutoffboundDive( 1582 SCIP* scip, /**< SCIP data structure */ 1583 SCIP_Real newcutoffbound /**< new cutoffbound */ 1584 ); 1585 1586 /** changes variable's objective value in current dive 1587 * 1588 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 1589 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 1590 * 1591 * @pre This method can be called if @p scip is in one of the following stages: 1592 * - \ref SCIP_STAGE_SOLVING 1593 * 1594 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 1595 */ 1596 SCIP_EXPORT 1597 SCIP_RETCODE SCIPchgVarObjDive( 1598 SCIP* scip, /**< SCIP data structure */ 1599 SCIP_VAR* var, /**< variable to change the objective value for */ 1600 SCIP_Real newobj /**< new objective value */ 1601 ); 1602 1603 /** changes variable's lower bound in current dive 1604 * 1605 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 1606 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 1607 * 1608 * @pre This method can be called if @p scip is in one of the following stages: 1609 * - \ref SCIP_STAGE_SOLVING 1610 * 1611 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 1612 */ 1613 SCIP_EXPORT 1614 SCIP_RETCODE SCIPchgVarLbDive( 1615 SCIP* scip, /**< SCIP data structure */ 1616 SCIP_VAR* var, /**< variable to change the bound for */ 1617 SCIP_Real newbound /**< new value for bound */ 1618 ); 1619 1620 /** changes variable's upper bound in current dive 1621 * 1622 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 1623 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 1624 * 1625 * @pre This method can be called if @p scip is in one of the following stages: 1626 * - \ref SCIP_STAGE_SOLVING 1627 * 1628 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 1629 */ 1630 SCIP_EXPORT 1631 SCIP_RETCODE SCIPchgVarUbDive( 1632 SCIP* scip, /**< SCIP data structure */ 1633 SCIP_VAR* var, /**< variable to change the bound for */ 1634 SCIP_Real newbound /**< new value for bound */ 1635 ); 1636 1637 /** adds a row to the LP in current dive 1638 * 1639 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 1640 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 1641 * 1642 * @pre This method can be called if @p scip is in one of the following stages: 1643 * - \ref SCIP_STAGE_SOLVING 1644 * 1645 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 1646 */ 1647 SCIP_EXPORT 1648 SCIP_RETCODE SCIPaddRowDive( 1649 SCIP* scip, /**< SCIP data structure */ 1650 SCIP_ROW* row /**< row to be added */ 1651 ); 1652 1653 /** changes row lhs in current dive, change will be undone after diving ends, for permanent changes use SCIPchgRowLhs() 1654 * 1655 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 1656 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 1657 * 1658 * @pre This method can be called if @p scip is in one of the following stages: 1659 * - \ref SCIP_STAGE_SOLVING 1660 * 1661 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 1662 */ 1663 SCIP_EXPORT 1664 SCIP_RETCODE SCIPchgRowLhsDive( 1665 SCIP* scip, /**< SCIP data structure */ 1666 SCIP_ROW* row, /**< row to change the lhs for */ 1667 SCIP_Real newlhs /**< new value for lhs */ 1668 ); 1669 1670 /** changes row rhs in current dive, change will be undone after diving ends, for permanent changes use SCIPchgRowRhs() 1671 * 1672 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 1673 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 1674 * 1675 * @pre This method can be called if @p scip is in one of the following stages: 1676 * - \ref SCIP_STAGE_SOLVING 1677 * 1678 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 1679 */ 1680 SCIP_EXPORT 1681 SCIP_RETCODE SCIPchgRowRhsDive( 1682 SCIP* scip, /**< SCIP data structure */ 1683 SCIP_ROW* row, /**< row to change the lhs for */ 1684 SCIP_Real newrhs /**< new value for rhs */ 1685 ); 1686 1687 /** gets variable's objective value in current dive 1688 * 1689 * @return the variable's objective value in current dive. 1690 * 1691 * @pre This method can be called if @p scip is in one of the following stages: 1692 * - \ref SCIP_STAGE_SOLVING 1693 * 1694 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 1695 */ 1696 SCIP_EXPORT 1697 SCIP_Real SCIPgetVarObjDive( 1698 SCIP* scip, /**< SCIP data structure */ 1699 SCIP_VAR* var /**< variable to get the bound for */ 1700 ); 1701 1702 /** gets variable's lower bound in current dive 1703 * 1704 * @return the variable's lower bound in current dive. 1705 * 1706 * @pre This method can be called if @p scip is in one of the following stages: 1707 * - \ref SCIP_STAGE_SOLVING 1708 * 1709 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 1710 */ 1711 SCIP_EXPORT 1712 SCIP_Real SCIPgetVarLbDive( 1713 SCIP* scip, /**< SCIP data structure */ 1714 SCIP_VAR* var /**< variable to get the bound for */ 1715 ); 1716 1717 /** gets variable's upper bound in current dive 1718 * 1719 * @return the variable's upper bound in current dive. 1720 * 1721 * @pre This method can be called if @p scip is in one of the following stages: 1722 * - \ref SCIP_STAGE_SOLVING 1723 * 1724 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 1725 */ 1726 SCIP_EXPORT 1727 SCIP_Real SCIPgetVarUbDive( 1728 SCIP* scip, /**< SCIP data structure */ 1729 SCIP_VAR* var /**< variable to get the bound for */ 1730 ); 1731 /** solves the LP of the current dive; no separation or pricing is applied 1732 * 1733 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref 1734 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes. 1735 * 1736 * @pre This method can be called if @p scip is in one of the following stages: 1737 * - \ref SCIP_STAGE_SOLVING 1738 * 1739 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 1740 * 1741 * @note be aware that the LP solve may take longer than expected if SCIPgetLPSolstat(scip) != SCIP_LPSOLSTAT_OPTIMAL, 1742 * compare the explanation of SCIPstartDive() 1743 */ 1744 SCIP_EXPORT 1745 SCIP_RETCODE SCIPsolveDiveLP( 1746 SCIP* scip, /**< SCIP data structure */ 1747 int itlim, /**< maximal number of LP iterations to perform, or -1 for no limit */ 1748 SCIP_Bool* lperror, /**< pointer to store whether an unresolved LP error occurred */ 1749 SCIP_Bool* cutoff /**< pointer to store whether the diving LP was infeasible or the objective 1750 * limit was reached (or NULL, if not needed) */ 1751 ); 1752 1753 /** returns the number of the node in the current branch and bound run, where the last LP was solved in diving 1754 * or probing mode 1755 * 1756 * @return the number of the node in the current branch and bound run, where the last LP was solved in diving 1757 * or probing mode. 1758 * 1759 * @pre This method can be called if @p scip is in one of the following stages: 1760 * - \ref SCIP_STAGE_TRANSFORMING 1761 * - \ref SCIP_STAGE_TRANSFORMED 1762 * - \ref SCIP_STAGE_INITPRESOLVE 1763 * - \ref SCIP_STAGE_PRESOLVING 1764 * - \ref SCIP_STAGE_EXITPRESOLVE 1765 * - \ref SCIP_STAGE_PRESOLVED 1766 * - \ref SCIP_STAGE_INITSOLVE 1767 * - \ref SCIP_STAGE_SOLVING 1768 * - \ref SCIP_STAGE_SOLVED 1769 * - \ref SCIP_STAGE_EXITSOLVE 1770 * - \ref SCIP_STAGE_FREETRANS 1771 * 1772 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 1773 */ 1774 SCIP_EXPORT 1775 SCIP_Longint SCIPgetLastDivenode( 1776 SCIP* scip /**< SCIP data structure */ 1777 ); 1778 1779 /** returns whether we are in diving mode 1780 * 1781 * @return whether we are in diving mode. 1782 * 1783 * @pre This method can be called if @p scip is in one of the following stages: 1784 * - \ref SCIP_STAGE_TRANSFORMING 1785 * - \ref SCIP_STAGE_TRANSFORMED 1786 * - \ref SCIP_STAGE_INITPRESOLVE 1787 * - \ref SCIP_STAGE_PRESOLVING 1788 * - \ref SCIP_STAGE_EXITPRESOLVE 1789 * - \ref SCIP_STAGE_PRESOLVED 1790 * - \ref SCIP_STAGE_INITSOLVE 1791 * - \ref SCIP_STAGE_SOLVING 1792 * - \ref SCIP_STAGE_SOLVED 1793 * - \ref SCIP_STAGE_EXITSOLVE 1794 * - \ref SCIP_STAGE_FREETRANS 1795 * 1796 * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages. 1797 */ 1798 SCIP_EXPORT 1799 SCIP_Bool SCIPinDive( 1800 SCIP* scip /**< SCIP data structure */ 1801 ); 1802 1803 /** computes two measures for dual degeneracy (dual degeneracy rate and variable-constraint ratio) 1804 * based on the changes applied when reducing the problem to the optimal face 1805 * 1806 * returns the dual degeneracy rate, i.e., the share of nonbasic variables with reduced cost 0 1807 * and the variable-constraint ratio, i.e., the number of unfixed variables in relation to the basis size 1808 */ 1809 SCIP_EXPORT 1810 SCIP_RETCODE SCIPgetLPDualDegeneracy( 1811 SCIP* scip, /**< SCIP data structure */ 1812 SCIP_Real* degeneracy, /**< pointer to store the dual degeneracy rate */ 1813 SCIP_Real* varconsratio /**< pointer to store the variable constraint ratio */ 1814 ); 1815 1816 /**@} */ 1817 1818 #ifdef __cplusplus 1819 } 1820 #endif 1821 1822 #endif 1823