Scippy

    SCIP

    Solving Constraint Integer Programs

    scip_prob.c
    Go to the documentation of this file.
    1/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
    2/* */
    3/* This file is part of the program and library */
    4/* SCIP --- Solving Constraint Integer Programs */
    5/* */
    6/* Copyright (c) 2002-2025 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_prob.c
    26 * @ingroup OTHER_CFILES
    27 * @brief public methods for global and local (sub)problems
    28 * @author Tobias Achterberg
    29 * @author Timo Berthold
    30 * @author Gerald Gamrath
    31 * @author Leona Gottwald
    32 * @author Stefan Heinz
    33 * @author Gregor Hendel
    34 * @author Thorsten Koch
    35 * @author Alexander Martin
    36 * @author Marc Pfetsch
    37 * @author Michael Winkler
    38 * @author Kati Wolter
    39 *
    40 * @todo check all SCIP_STAGE_* switches, and include the new stages TRANSFORMED and INITSOLVE
    41 */
    42
    43/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
    44
    46#include "scip/benders.h"
    47#include "scip/clock.h"
    48#include "scip/concurrent.h"
    49#include "scip/conflictstore.h"
    50#include "scip/cons.h"
    51#include "scip/dcmp.h"
    52#include "scip/debug.h"
    53#include "scip/lp.h"
    54#include "scip/pricer.h"
    55#include "scip/pricestore.h"
    56#include "scip/primal.h"
    57#include "scip/prob.h"
    58#include "scip/pub_cons.h"
    59#include "scip/pub_event.h"
    60#include "scip/pub_message.h"
    61#include "scip/pub_misc.h"
    62#include "scip/pub_reader.h"
    63#include "scip/pub_sol.h"
    64#include "scip/pub_tree.h"
    65#include "scip/pub_var.h"
    66#include "scip/reader.h"
    67#include "scip/reopt.h"
    68#include "scip/scip_cons.h"
    69#include "scip/scip_exact.h"
    70#include "scip/scip_general.h"
    71#include "scip/scip_mem.h"
    72#include "scip/scip_message.h"
    73#include "scip/scip_numerics.h"
    74#include "scip/scip_param.h"
    75#include "scip/scip_prob.h"
    77#include "scip/scip_sol.h"
    78#include "scip/scip_solve.h"
    80#include "scip/scip_timing.h"
    81#include "scip/scip_tree.h"
    82#include "scip/scip_var.h"
    83#include "scip/set.h"
    84#include "scip/stat.h"
    85#include "scip/struct_cons.h"
    86#include "scip/struct_lp.h"
    87#include "scip/struct_mem.h"
    88#include "scip/struct_primal.h"
    89#include "scip/struct_prob.h"
    90#include "scip/struct_scip.h"
    91#include "scip/struct_set.h"
    92#include "scip/struct_stat.h"
    93#include "scip/struct_var.h"
    94#include "scip/syncstore.h"
    95#include "scip/tree.h"
    96#include <stdio.h>
    97#include <string.h>
    98
    99/** creates empty problem and initializes all solving data structures (the objective sense is set to MINIMIZE)
    100 * If the problem type requires the use of variable pricers, these pricers should be added to the problem with calls
    101 * to SCIPactivatePricer(). These pricers are automatically deactivated, when the problem is freed.
    102 *
    103 * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
    104 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
    105 *
    106 * @pre This method can be called if @p scip is in one of the following stages:
    107 * - \ref SCIP_STAGE_INIT
    108 * - \ref SCIP_STAGE_PROBLEM
    109 * - \ref SCIP_STAGE_TRANSFORMED
    110 * - \ref SCIP_STAGE_PRESOLVING
    111 * - \ref SCIP_STAGE_PRESOLVED
    112 * - \ref SCIP_STAGE_SOLVING
    113 * - \ref SCIP_STAGE_SOLVED
    114 * - \ref SCIP_STAGE_FREE
    115 *
    116 * @post After calling this method, \SCIP reaches the following stage:
    117 * - \ref SCIP_STAGE_PROBLEM
    118 */
    120 SCIP* scip, /**< SCIP data structure */
    121 const char* name, /**< problem name */
    122 SCIP_DECL_PROBDELORIG ((*probdelorig)), /**< frees user data of original problem */
    123 SCIP_DECL_PROBTRANS ((*probtrans)), /**< creates user data of transformed problem by transforming original user data */
    124 SCIP_DECL_PROBDELTRANS((*probdeltrans)), /**< frees user data of transformed problem */
    125 SCIP_DECL_PROBINITSOL ((*probinitsol)), /**< solving process initialization method of transformed data */
    126 SCIP_DECL_PROBEXITSOL ((*probexitsol)), /**< solving process deinitialization method of transformed data */
    127 SCIP_DECL_PROBCOPY ((*probcopy)), /**< copies user data if you want to copy it to a subscip, or NULL */
    128 SCIP_PROBDATA* probdata /**< user problem data set by the reader */
    129 )
    130{
    132
    133 /* free old problem */
    135 assert(scip->set->stage == SCIP_STAGE_INIT);
    136
    137 /* switch stage to PROBLEM */
    138 scip->set->stage = SCIP_STAGE_PROBLEM;
    139
    140 SCIP_CALL( SCIPstatCreate(&scip->stat, scip->mem->probmem, scip->set, NULL, NULL, scip->messagehdlr) );
    141
    142 SCIP_CALL( SCIPprobCreate(&scip->origprob, scip->mem->probmem, scip->set, name,
    143 probdelorig, probtrans, probdeltrans, probinitsol, probexitsol, probcopy, probdata, FALSE) );
    144
    145 /* create solution pool for original solution candidates */
    146 SCIP_CALL( SCIPprimalCreate(&scip->origprimal) );
    147
    148 /* create conflict pool for storing conflict constraints */
    149 SCIP_CALL( SCIPconflictstoreCreate(&scip->conflictstore, scip->set) );
    150
    151 /* initialize reoptimization structure, if needed */
    152 SCIP_CALL( SCIPenableReoptimization(scip, scip->set->reopt_enable) );
    153
    155
    156 return SCIP_OKAY;
    157}
    158
    159/** creates empty problem and initializes all solving data structures (the objective sense is set to MINIMIZE)
    160 * all callback methods will be set to NULL and can be set afterwards, if needed, via SCIPsetProbDelorig(),
    161 * SCIPsetProbTrans(), SCIPsetProbDeltrans(), SCIPsetProbInitsol(), SCIPsetProbExitsol(), and
    162 * SCIPsetProbCopy()
    163 * If the problem type requires the use of variable pricers, these pricers should be added to the problem with calls
    164 * to SCIPactivatePricer(). These pricers are automatically deactivated, when the problem is freed.
    165 *
    166 * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
    167 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
    168 *
    169 * @pre This method can be called if @p scip is in one of the following stages:
    170 * - \ref SCIP_STAGE_INIT
    171 * - \ref SCIP_STAGE_PROBLEM
    172 * - \ref SCIP_STAGE_TRANSFORMED
    173 * - \ref SCIP_STAGE_PRESOLVING
    174 * - \ref SCIP_STAGE_PRESOLVED
    175 * - \ref SCIP_STAGE_SOLVING
    176 * - \ref SCIP_STAGE_SOLVED
    177 * - \ref SCIP_STAGE_FREE
    178 *
    179 * @post After calling this method, \SCIP reaches the following stage:
    180 * - \ref SCIP_STAGE_PROBLEM
    181 */
    183 SCIP* scip, /**< SCIP data structure */
    184 const char* name /**< problem name */
    185 )
    186{
    187 SCIP_CALL( SCIPcheckStage(scip, "SCIPcreateProbBasic", TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE) );
    188
    190
    191 return SCIP_OKAY;
    192}
    193
    194/** sets callback to free user data of original problem
    195 *
    196 * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
    197 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
    198 *
    199 * @pre This method can be called if @p scip is in one of the following stages:
    200 * - \ref SCIP_STAGE_PROBLEM
    201 */
    203 SCIP* scip, /**< SCIP data structure */
    204 SCIP_DECL_PROBDELORIG ((*probdelorig)) /**< frees user data of original problem */
    205 )
    206{
    207 assert(scip != NULL);
    209
    210 SCIPprobSetDelorig(scip->origprob, probdelorig);
    211
    212 return SCIP_OKAY;
    213}
    214
    215/** sets callback to create user data of transformed problem by transforming original user data
    216 *
    217 * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
    218 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
    219 *
    220 * @pre This method can be called if @p scip is in one of the following stages:
    221 * - \ref SCIP_STAGE_PROBLEM
    222 */
    224 SCIP* scip, /**< SCIP data structure */
    225 SCIP_DECL_PROBTRANS ((*probtrans)) /**< creates user data of transformed problem by transforming original user data */
    226 )
    227{
    228 assert(scip != NULL);
    230
    231 SCIPprobSetTrans(scip->origprob, probtrans);
    232
    233 return SCIP_OKAY;
    234}
    235
    236/** sets callback to free user data of transformed problem
    237 *
    238 * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
    239 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
    240 *
    241 * @pre This method can be called if @p scip is in one of the following stages:
    242 * - \ref SCIP_STAGE_PROBLEM
    243 */
    245 SCIP* scip, /**< SCIP data structure */
    246 SCIP_DECL_PROBDELTRANS((*probdeltrans)) /**< frees user data of transformed problem */
    247 )
    248{
    249 assert(scip != NULL);
    251
    252 SCIPprobSetDeltrans(scip->origprob, probdeltrans);
    253
    254 return SCIP_OKAY;
    255}
    256
    257/** sets solving process initialization callback of transformed data
    258 *
    259 * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
    260 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
    261 *
    262 * @pre This method can be called if @p scip is in one of the following stages:
    263 * - \ref SCIP_STAGE_PROBLEM
    264 */
    266 SCIP* scip, /**< SCIP data structure */
    267 SCIP_DECL_PROBINITSOL ((*probinitsol)) /**< solving process initialization method of transformed data */
    268 )
    269{
    270 assert(scip != NULL);
    271
    273
    274 SCIPprobSetInitsol(scip->origprob, probinitsol);
    275
    276 return SCIP_OKAY;
    277}
    278
    279/** sets solving process deinitialization callback of transformed data
    280 *
    281 * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
    282 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
    283 *
    284 * @pre This method can be called if @p scip is in one of the following stages:
    285 * - \ref SCIP_STAGE_PROBLEM
    286 */
    288 SCIP* scip, /**< SCIP data structure */
    289 SCIP_DECL_PROBEXITSOL ((*probexitsol)) /**< solving process deinitialization method of transformed data */
    290 )
    291{
    292 assert(scip != NULL);
    294
    295 SCIPprobSetExitsol(scip->origprob, probexitsol);
    296
    297 return SCIP_OKAY;
    298}
    299
    300/** sets callback to copy user data to a subscip
    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 @p scip is in one of the following stages:
    306 * - \ref SCIP_STAGE_PROBLEM
    307 */
    309 SCIP* scip, /**< SCIP data structure */
    310 SCIP_DECL_PROBCOPY ((*probcopy)) /**< copies user data if you want to copy it to a subscip, or NULL */
    311 )
    312{
    313 assert(scip != NULL);
    315
    316 SCIPprobSetCopy(scip->origprob, probcopy);
    317
    318 return SCIP_OKAY;
    319}
    320
    321/** reads problem from file and initializes all solving data structures
    322 *
    323 * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
    324 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
    325 *
    326 * @pre This method can be called if @p scip is in one of the following stages:
    327 * - \ref SCIP_STAGE_INIT
    328 * - \ref SCIP_STAGE_PROBLEM
    329 * - \ref SCIP_STAGE_TRANSFORMED
    330 * - \ref SCIP_STAGE_INITPRESOLVE
    331 * - \ref SCIP_STAGE_PRESOLVING
    332 * - \ref SCIP_STAGE_EXITPRESOLVE
    333 * - \ref SCIP_STAGE_PRESOLVED
    334 * - \ref SCIP_STAGE_SOLVING
    335 * - \ref SCIP_STAGE_EXITSOLVE
    336 *
    337 * @post After the method was called, \SCIP is in one of the following stages:
    338 * - \ref SCIP_STAGE_INIT if reading failed (usually, when a SCIP_READERROR occurs)
    339 * - \ref SCIP_STAGE_PROBLEM if the problem file was successfully read
    340 */
    342 SCIP* scip, /**< SCIP data structure */
    343 const char* filename, /**< problem file name */
    344 const char* extension /**< extension of the desired file reader,
    345 * or NULL if file extension should be used */
    346 )
    347{
    348 SCIP_RETCODE retcode;
    349 SCIP_RESULT result;
    350 SCIP_Bool usevartable;
    351 SCIP_Bool useconstable;
    352 int i;
    353 char* tmpfilename;
    354 char* fileextension;
    355
    356 assert(scip != NULL);
    357 assert(filename != NULL);
    358
    360
    361 SCIP_CALL( SCIPgetBoolParam(scip, "misc/usevartable", &usevartable) );
    362 SCIP_CALL( SCIPgetBoolParam(scip, "misc/useconstable", &useconstable) );
    363
    364 if( !usevartable || !useconstable )
    365 {
    366 SCIPerrorMessage("Cannot read problem if vartable or constable is disabled. Make sure parameters 'misc/usevartable' and 'misc/useconstable' are set to TRUE.\n");
    367 return SCIP_READERROR;
    368 }
    369
    370 /* try all readers until one could read the file */
    371 result = SCIP_DIDNOTRUN;
    372
    373 /* copy filename */
    374 SCIP_CALL( SCIPduplicateBufferArray(scip, &tmpfilename, filename, (int)strlen(filename)+1) );
    375
    376 fileextension = NULL;
    377 if( extension == NULL )
    378 {
    379 /* get extension from filename */
    380 SCIPsplitFilename(tmpfilename, NULL, NULL, &fileextension, NULL);
    381 }
    382
    383 for( i = 0; i < scip->set->nreaders && result == SCIP_DIDNOTRUN; ++i )
    384 {
    385 retcode = SCIPreaderRead(scip->set->readers[i], scip->set, filename,
    386 extension != NULL ? extension : fileextension, &result);
    387
    388 /* check for reader errors */
    389 if( retcode == SCIP_NOFILE || retcode == SCIP_READERROR )
    390 goto TERMINATE;
    391 SCIP_CALL( retcode );
    392 }
    393
    394 switch( result )
    395 {
    396 case SCIP_DIDNOTRUN:
    397 retcode = SCIP_PLUGINNOTFOUND;
    398 break;
    399 case SCIP_SUCCESS:
    400 if( scip->origprob != NULL )
    401 {
    402 SCIP_Real readingtime;
    403
    404 SCIPmessagePrintVerbInfo(scip->messagehdlr, scip->set->disp_verblevel, SCIP_VERBLEVEL_NORMAL,
    405 "original problem has %d variables (%d bin, %d int, %d cont) and %d constraints\n",
    406 scip->origprob->nvars, scip->origprob->nbinvars + scip->origprob->nbinimplvars, scip->origprob->nintvars
    407 + scip->origprob->nintimplvars, scip->origprob->ncontvars + scip->origprob->ncontimplvars,
    408 scip->origprob->nconss);
    409
    410 if( scip->origprob->nbinimplvars > 0 || scip->origprob->nintimplvars > 0 || scip->origprob->ncontimplvars > 0 )
    411 SCIPmessagePrintVerbInfo(scip->messagehdlr, scip->set->disp_verblevel, SCIP_VERBLEVEL_NORMAL,
    412 "original problem has %d implied integral variables (%d bin, %d int, %d cont)\n",
    413 SCIPprobGetNImplVars(scip->origprob), scip->origprob->nbinimplvars, scip->origprob->nintimplvars,
    414 scip->origprob->ncontimplvars);
    415
    416 /* in full verbose mode we will also print the number of constraints per constraint handler */
    417 if( scip->set->disp_verblevel == SCIP_VERBLEVEL_FULL )
    418 {
    419 int* nconss;
    420 int c;
    421 int h;
    422
    423 SCIP_CALL( SCIPallocClearBufferArray(scip, &nconss, scip->set->nconshdlrs) );
    424
    425 /* loop over all constraints and constraint-handlers to count for each type the amount of original
    426 * constraints
    427 */
    428 for( c = scip->origprob->nconss - 1; c >= 0; --c )
    429 {
    430 for( h = scip->set->nconshdlrs - 1; h >= 0; --h )
    431 {
    432 if( scip->origprob->conss[c]->conshdlr == scip->set->conshdlrs[h] )
    433 {
    434 ++(nconss[h]);
    435 break;
    436 }
    437 }
    438 /* constraint handler should be found */
    439 assert(h >= 0);
    440 }
    441
    442 /* loop over all constraints handlers for printing the number of original constraints */
    443 for( h = 0; h < scip->set->nconshdlrs; ++h )
    444 {
    445 if( nconss[h] > 0 )
    446 {
    447 SCIPmessagePrintVerbInfo(scip->messagehdlr, scip->set->disp_verblevel, SCIP_VERBLEVEL_FULL,
    448 "%7d constraints of type <%s>\n", nconss[h], SCIPconshdlrGetName(scip->set->conshdlrs[h]));
    449 }
    450 }
    451
    452 SCIPfreeBufferArray(scip, &nconss);
    453 }
    454
    455 /* in case the permutation seed is different to 0, permute the original problem */
    456 if( scip->set->random_permutationseed > 0 )
    457 {
    458 SCIP_Bool permuteconss;
    459 SCIP_Bool permutevars;
    460 int permutationseed;
    461
    462 permuteconss = scip->set->random_permuteconss;
    463 permutevars = scip->set->random_permutevars;
    464 permutationseed = scip->set->random_permutationseed;
    465
    466 SCIP_CALL( SCIPpermuteProb(scip, (unsigned int)permutationseed, permuteconss,
    467 permutevars, permutevars, permutevars, permutevars, permutevars, permutevars) );
    468 }
    469
    470 /* get reading time */
    471 readingtime = SCIPgetReadingTime(scip);
    472
    473 /* display timing statistics */
    474 SCIPmessagePrintVerbInfo(scip->messagehdlr, scip->set->disp_verblevel, SCIP_VERBLEVEL_FULL,
    475 "Reading Time: %.2f\n", readingtime);
    476
    477 /* add reading time to solving time, if requested */
    478 if( scip->set->time_reading )
    479 SCIPclockSetTime(scip->stat->solvingtime, readingtime);
    480 }
    481 retcode = SCIP_OKAY;
    482 break;
    483 default:
    484 assert(i < scip->set->nreaders);
    485 SCIPerrorMessage("invalid result code <%d> from reader <%s> reading file <%s>\n",
    486 result, SCIPreaderGetName(scip->set->readers[i]), filename);
    487 retcode = SCIP_READERROR;
    488 } /*lint !e788*/
    489
    490 TERMINATE:
    491 /* free buffer array */
    492 SCIPfreeBufferArray(scip, &tmpfilename);
    493
    494 return retcode;
    495}
    496
    497/** outputs problem to file stream */
    498static
    500 SCIP* scip, /**< SCIP data structure */
    501 SCIP_PROB* prob, /**< problem data */
    502 FILE* file, /**< output file (or NULL for standard output) */
    503 const char* filename, /**< name of output file, or NULL if not available */
    504 const char* extension, /**< file format (or NULL for default CIP format) */
    505 SCIP_Bool genericnames /**< using generic variable and constraint names? */
    506 )
    507{
    508 SCIP_RESULT result;
    509 int i;
    510 assert(scip != NULL);
    511 assert(prob != NULL);
    512
    513 /* try all readers until one could read the file */
    514 result = SCIP_DIDNOTRUN;
    515 for( i = 0; i < scip->set->nreaders && result == SCIP_DIDNOTRUN; ++i )
    516 {
    517 SCIP_RETCODE retcode;
    518
    519 if( extension != NULL )
    520 retcode = SCIPreaderWrite(scip->set->readers[i], prob, scip->set, scip->messagehdlr, file, filename, extension, genericnames, &result);
    521 else
    522 retcode = SCIPreaderWrite(scip->set->readers[i], prob, scip->set, scip->messagehdlr, file, filename, "cip", genericnames, &result);
    523
    524 /* check for reader errors */
    525 if( retcode == SCIP_WRITEERROR )
    526 return retcode;
    527
    528 SCIP_CALL( retcode );
    529 }
    530
    531 switch( result )
    532 {
    533 case SCIP_DIDNOTRUN:
    534 return SCIP_PLUGINNOTFOUND;
    535
    536 case SCIP_SUCCESS:
    537 return SCIP_OKAY;
    538
    539 default:
    540 assert(i < scip->set->nreaders);
    541 SCIPerrorMessage("invalid result code <%d> from reader <%s> writing <%s> format\n",
    542 result, SCIPreaderGetName(scip->set->readers[i]), extension);
    543 return SCIP_READERROR;
    544 } /*lint !e788*/
    545}
    546
    547/** write original or transformed problem */
    548static
    550 SCIP* scip, /**< SCIP data structure */
    551 const char* filename, /**< output file (or NULL for standard output) */
    552 const char* extension, /**< extension of the desired file reader,
    553 * or NULL if file extension should be used */
    554 SCIP_Bool transformed, /**< output the transformed problem? */
    555 SCIP_Bool genericnames /**< using generic variable and constraint names? */
    556 )
    557{
    558 SCIP_RETCODE retcode;
    559 char* tmpfilename;
    560 char* fileextension;
    561 char* compression;
    562 FILE* file;
    563
    564 assert(scip != NULL );
    565
    566 fileextension = NULL;
    567 compression = NULL;
    568 file = NULL;
    569 tmpfilename = NULL;
    570
    571 if( filename != NULL && filename[0] != '\0' )
    572 {
    573 file = fopen(filename, "w");
    574 if( file == NULL )
    575 {
    576 SCIPerrorMessage("cannot create file <%s> for writing\n", filename);
    577 SCIPprintSysError(filename);
    579 }
    580
    581 /* get extension from filename,
    582 * if an error occurred, close the file before returning */
    583 if( BMSduplicateMemoryArray(&tmpfilename, filename, strlen(filename)+1) == NULL )
    584 {
    585 (void) fclose(file);
    586 SCIPerrorMessage("Error <%d> in function call\n", SCIP_NOMEMORY);
    587 return SCIP_NOMEMORY;
    588 }
    589
    590 SCIPsplitFilename(tmpfilename, NULL, NULL, &fileextension, &compression);
    591
    592 if( compression != NULL )
    593 {
    594 SCIPmessagePrintWarning(scip->messagehdlr, "currently it is not possible to write files with any compression\n");
    595 BMSfreeMemoryArray(&tmpfilename);
    596 (void) fclose(file);
    598 }
    599
    600 if( extension == NULL && fileextension == NULL )
    601 {
    602 SCIPmessagePrintWarning(scip->messagehdlr, "filename <%s> has no file extension, select default <cip> format for writing\n", filename);
    603 }
    604 }
    605
    606 retcode = printProblem(scip, transformed ? scip->transprob : scip->origprob, file, filename, extension != NULL ? extension : fileextension, genericnames);
    607
    608 if( tmpfilename != NULL )
    609 {
    610 assert(filename != NULL);
    611 assert(file != NULL);
    612
    613 BMSfreeMemoryArray(&tmpfilename);
    614
    615 if( fclose(file) != 0 )
    616 {
    617 SCIPerrorMessage("An error occurred while closing file <%s>\n", filename);
    619 }
    620 }
    621
    622 /* check for write errors */
    623 if( retcode == SCIP_WRITEERROR || retcode == SCIP_PLUGINNOTFOUND )
    624 return retcode;
    625 else
    626 {
    627 SCIP_CALL( retcode );
    628 }
    629
    630 return SCIP_OKAY;
    631}
    632
    633/** outputs original problem to file stream
    634 *
    635 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
    636 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
    637 *
    638 * @pre This method can be called if SCIP is in one of the following stages:
    639 * - \ref SCIP_STAGE_PROBLEM
    640 * - \ref SCIP_STAGE_TRANSFORMING
    641 * - \ref SCIP_STAGE_TRANSFORMED
    642 * - \ref SCIP_STAGE_INITPRESOLVE
    643 * - \ref SCIP_STAGE_PRESOLVING
    644 * - \ref SCIP_STAGE_EXITPRESOLVE
    645 * - \ref SCIP_STAGE_PRESOLVED
    646 * - \ref SCIP_STAGE_INITSOLVE
    647 * - \ref SCIP_STAGE_SOLVING
    648 * - \ref SCIP_STAGE_SOLVED
    649 * - \ref SCIP_STAGE_EXITSOLVE
    650 * - \ref SCIP_STAGE_FREETRANS
    651 */
    653 SCIP* scip, /**< SCIP data structure */
    654 FILE* file, /**< output file (or NULL for standard output) */
    655 const char* extension, /**< file format (or NULL for default CIP format)*/
    656 SCIP_Bool genericnames /**< using generic variable and constraint names? */
    657 )
    658{
    659 SCIP_RETCODE retcode;
    660
    661 SCIP_CALL( SCIPcheckStage(scip, "SCIPprintOrigProblem", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
    662
    663 assert(scip != NULL);
    664 assert( scip->origprob != NULL );
    665
    666 retcode = printProblem(scip, scip->origprob, file, NULL, extension, genericnames);
    667
    668 /* check for write errors */
    669 if( retcode == SCIP_WRITEERROR || retcode == SCIP_PLUGINNOTFOUND )
    670 return retcode;
    671 else
    672 {
    673 SCIP_CALL( retcode );
    674 }
    675
    676 return SCIP_OKAY;
    677}
    678
    679/** outputs transformed problem of the current node to file stream
    680 *
    681 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
    682 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
    683 *
    684 * @pre This method can be called if SCIP is in one of the following stages:
    685 * - \ref SCIP_STAGE_TRANSFORMED
    686 * - \ref SCIP_STAGE_INITPRESOLVE
    687 * - \ref SCIP_STAGE_PRESOLVING
    688 * - \ref SCIP_STAGE_EXITPRESOLVE
    689 * - \ref SCIP_STAGE_PRESOLVED
    690 * - \ref SCIP_STAGE_INITSOLVE
    691 * - \ref SCIP_STAGE_SOLVING
    692 * - \ref SCIP_STAGE_SOLVED
    693 * - \ref SCIP_STAGE_EXITSOLVE
    694 * - \ref SCIP_STAGE_FREETRANS
    695 */
    697 SCIP* scip, /**< SCIP data structure */
    698 FILE* file, /**< output file (or NULL for standard output) */
    699 const char* extension, /**< file format (or NULL for default CIP format)*/
    700 SCIP_Bool genericnames /**< using generic variable and constraint names? */
    701 )
    702{
    703 SCIP_RETCODE retcode;
    704
    705 SCIP_CALL( SCIPcheckStage(scip, "SCIPprintTransProblem", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
    706
    707 assert(scip != NULL);
    708 assert(scip->transprob != NULL );
    709
    710 retcode = printProblem(scip, scip->transprob, file, NULL, extension, genericnames);
    711
    712 /* check for write errors */
    713 if( retcode == SCIP_WRITEERROR || retcode == SCIP_PLUGINNOTFOUND )
    714 return retcode;
    715 else
    716 {
    717 SCIP_CALL( retcode );
    718 }
    719
    720 return SCIP_OKAY;
    721}
    722
    723/** writes original problem to file
    724 *
    725 * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
    726 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
    727 *
    728 * @pre This method can be called if @p scip is in one of the following stages:
    729 * - \ref SCIP_STAGE_PROBLEM
    730 * - \ref SCIP_STAGE_TRANSFORMING
    731 * - \ref SCIP_STAGE_TRANSFORMED
    732 * - \ref SCIP_STAGE_INITPRESOLVE
    733 * - \ref SCIP_STAGE_PRESOLVING
    734 * - \ref SCIP_STAGE_EXITPRESOLVE
    735 * - \ref SCIP_STAGE_PRESOLVED
    736 * - \ref SCIP_STAGE_INITSOLVE
    737 * - \ref SCIP_STAGE_SOLVING
    738 * - \ref SCIP_STAGE_SOLVED
    739 * - \ref SCIP_STAGE_EXITSOLVE
    740 * - \ref SCIP_STAGE_FREETRANS
    741 */
    743 SCIP* scip, /**< SCIP data structure */
    744 const char* filename, /**< output file (or NULL for standard output) */
    745 const char* extension, /**< extension of the desired file reader,
    746 * or NULL if file extension should be used */
    747 SCIP_Bool genericnames /**< using generic variable and constraint names? */
    748 )
    749{
    750 SCIP_RETCODE retcode;
    751
    752 SCIP_CALL( SCIPcheckStage(scip, "SCIPwriteOrigProblem", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
    753
    754 assert( scip != NULL );
    755 assert( scip->origprob != NULL );
    756
    757 retcode = writeProblem(scip, filename, extension, FALSE, genericnames);
    758
    759 /* check for write errors */
    760 if( retcode == SCIP_FILECREATEERROR || retcode == SCIP_WRITEERROR || retcode == SCIP_PLUGINNOTFOUND )
    761 return retcode;
    762 else
    763 {
    764 SCIP_CALL( retcode );
    765 }
    766
    767 return SCIP_OKAY;
    768}
    769
    770/** writes transformed problem which are valid in the current node to file
    771 *
    772 * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
    773 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
    774 *
    775 * @pre This method can be called if @p scip is in one of the following stages:
    776 * - \ref SCIP_STAGE_TRANSFORMED
    777 * - \ref SCIP_STAGE_INITPRESOLVE
    778 * - \ref SCIP_STAGE_PRESOLVING
    779 * - \ref SCIP_STAGE_EXITPRESOLVE
    780 * - \ref SCIP_STAGE_PRESOLVED
    781 * - \ref SCIP_STAGE_INITSOLVE
    782 * - \ref SCIP_STAGE_SOLVING
    783 * - \ref SCIP_STAGE_SOLVED
    784 * - \ref SCIP_STAGE_EXITSOLVE
    785 *
    786 * @note If you want the write all constraints (including the once which are redundant for example), you need to set
    787 * the parameter <write/allconss> to TRUE
    788 */
    790 SCIP* scip, /**< SCIP data structure */
    791 const char* filename, /**< output file (or NULL for standard output) */
    792 const char* extension, /**< extension of the desired file reader,
    793 * or NULL if file extension should be used */
    794 SCIP_Bool genericnames /**< using generic variable and constraint names? */
    795 )
    796{
    797 SCIP_RETCODE retcode;
    798
    799 SCIP_CALL( SCIPcheckStage(scip, "SCIPwriteTransProblem", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
    800
    801 assert( scip != NULL );
    802 assert( scip->transprob != NULL );
    803
    804 retcode = writeProblem(scip, filename, extension, TRUE, genericnames);
    805
    806 /* check for write errors */
    807 if( retcode == SCIP_FILECREATEERROR || retcode == SCIP_WRITEERROR || retcode == SCIP_PLUGINNOTFOUND )
    808 return retcode;
    809 else
    810 {
    811 SCIP_CALL( retcode );
    812 }
    813
    814 return SCIP_OKAY;
    815}
    816
    817/** frees problem and solution process data
    818 *
    819 * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
    820 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
    821 *
    822 * @pre This method can be called if @p scip is in one of the following stages:
    823 * - \ref SCIP_STAGE_INIT
    824 * - \ref SCIP_STAGE_PROBLEM
    825 * - \ref SCIP_STAGE_TRANSFORMED
    826 * - \ref SCIP_STAGE_PRESOLVING
    827 * - \ref SCIP_STAGE_PRESOLVED
    828 * - \ref SCIP_STAGE_SOLVING
    829 * - \ref SCIP_STAGE_SOLVED
    830 * - \ref SCIP_STAGE_FREE
    831 *
    832 * @post After this method was called, SCIP is in the following stage:
    833 * - \ref SCIP_STAGE_INIT
    834 */
    836 SCIP* scip /**< SCIP data structure */
    837 )
    838{
    839 SCIP_Bool transsolorig;
    840
    842
    843 /* if we free the problem, we do not have to transfer transformed solutions to the original space, so temporarily disable it */
    844 transsolorig = scip->set->misc_transsolsorig;
    845 scip->set->misc_transsolsorig = FALSE;
    846
    848 /* for some reason the free transform can generate events caught in the globalbnd eventhander
    849 * which requires the concurrent so it must be freed afterwards this happened o instance fiber
    850 */
    852
    853 assert(scip->set->stage == SCIP_STAGE_INIT || scip->set->stage == SCIP_STAGE_PROBLEM);
    854 scip->set->misc_transsolsorig = transsolorig;
    855
    856 if( scip->set->stage == SCIP_STAGE_PROBLEM )
    857 {
    858 int i;
    859
    860 /* free concsolvers and deinitialize the syncstore */
    861 if( scip->set->nconcsolvers > 0 )
    862 {
    863 assert(SCIPsyncstoreIsInitialized(scip->syncstore));
    864
    866 SCIP_CALL( SCIPsyncstoreExit(scip->syncstore) );
    867 }
    868
    869 /* deactivate all pricers */
    870 for( i = scip->set->nactivepricers-1; i >= 0; --i )
    871 {
    872 SCIP_CALL( SCIPpricerDeactivate(scip->set->pricers[i], scip->set) );
    873 }
    874 assert(scip->set->nactivepricers == 0);
    875
    876 /* deactivate all Benders' decomposition */
    877 for( i = scip->set->nactivebenders-1; i >= 0; --i )
    878 {
    879 SCIP_CALL( SCIPbendersDeactivate(scip->set->benders[i], scip->set) );
    880 }
    881 assert(scip->set->nactivebenders == 0);
    882
    883 /* free all debug data */
    885
    886 /* free original primal solution candidate pool, original problem and problem statistics data structures */
    887 if( scip->reopt != NULL )
    888 {
    889 SCIP_CALL( SCIPreoptFree(&scip->reopt, scip->set, scip->origprimal, scip->mem->probmem) );
    890 }
    891 SCIPdecompstoreFree(&scip->decompstore, SCIPblkmem(scip));
    892 SCIP_CALL( SCIPconflictstoreFree(&scip->conflictstore, scip->mem->probmem, scip->set, scip->stat, scip->reopt) );
    893 SCIP_CALL( SCIPprimalFree(&scip->origprimal, scip->mem->probmem) );
    894 SCIP_CALL( SCIPprobFree(&scip->origprob, scip->messagehdlr, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->lp) );
    895 SCIP_CALL( SCIPstatFree(&scip->stat, scip->mem->probmem) );
    896
    897 /* readers */
    898 for( i = 0; i < scip->set->nreaders; ++i )
    899 {
    900 SCIP_CALL( SCIPreaderResetReadingTime(scip->set->readers[i]) );
    901 }
    902
    903 /* switch stage to INIT */
    904 scip->set->stage = SCIP_STAGE_INIT;
    905 }
    906 assert(scip->set->stage == SCIP_STAGE_INIT);
    907
    908 return SCIP_OKAY;
    909}
    910
    911/** permutes parts of the problem data structure
    912 *
    913 * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
    914 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
    915 *
    916 * @pre This method can be called if @p scip is in one of the following stages:
    917 * - \ref SCIP_STAGE_PROBLEM
    918 * - \ref SCIP_STAGE_TRANSFORMED
    919 *
    920 * @todo This need to be changed to use the new random number generator implemented in random.c
    921 */
    923 SCIP* scip, /**< SCIP data structure */
    924 unsigned int randseed, /**< seed value for random generator */
    925 SCIP_Bool permuteconss, /**< should the list of constraints in each constraint handler be permuted? */
    926 SCIP_Bool permutebinvars, /**< should the list of binary variables be permuted? */
    927 SCIP_Bool permuteintvars, /**< should the list of integer variables be permuted? */
    928 SCIP_Bool permutebinimplvars, /**< should the list of binary implied integral vars be permuted? */
    929 SCIP_Bool permuteintimplvars, /**< should the list of integer implied integral vars be permuted? */
    930 SCIP_Bool permutecontimplvars, /**< should the list of continuous implied integral vars be permuted? */
    931 SCIP_Bool permutecontvars /**< should the list of continuous variables be permuted? */
    932 )
    933{
    934 SCIP_VAR** vars;
    935 SCIP_CONSHDLR** conshdlrs;
    936 SCIP_RANDNUMGEN* randnumgen;
    937 SCIP_Bool permuted;
    938 int nconshdlrs;
    939 int nvars;
    940 int intstart;
    941 int binimplstart;
    942 int intimplstart;
    943 int contimplstart;
    944 int contstart;
    945 int j;
    946
    947 assert(scip != NULL);
    949
    950 vars = SCIPgetVars(scip);
    951 nvars = SCIPgetNVars(scip);
    952 assert(vars != NULL || nvars == 0);
    953
    954 intstart = SCIPgetNBinVars(scip);
    955 binimplstart = intstart + SCIPgetNIntVars(scip);
    956 intimplstart = binimplstart + SCIPgetNBinImplVars(scip);
    957 contimplstart = intimplstart + SCIPgetNIntImplVars(scip);
    958 contstart = contimplstart + SCIPgetNContImplVars(scip);
    959 assert(nvars == contstart + SCIPgetNContVars(scip));
    960
    961 conshdlrs = SCIPgetConshdlrs(scip);
    962 nconshdlrs = SCIPgetNConshdlrs(scip);
    963 assert(conshdlrs != NULL || nconshdlrs == 0);
    964
    965 /* create a random number generator */
    966 SCIP_CALL( SCIPcreateRandom(scip, &randnumgen, randseed, TRUE) );
    967
    968 /* The constraint handler should not be permuted since they are called w.r.t. to certain properties; besides
    969 * that the "conshdlrs" array should stay in the order as it is since this array is used to copy the plugins for
    970 * sub-SCIPs and contains the dependencies between the constraint handlers; for example the linear constraint
    971 * handler stays in front of all constraint handler which can upgrade a linear constraint (such as logicor,
    972 * setppc, and knapsack).
    973 */
    974
    975 permuted = FALSE;
    976
    977 /* for each constraint handler, permute its constraints */
    978 if( permuteconss )
    979 {
    980 int i;
    981
    982 /* we must only permute active constraints */
    983 if( SCIPisTransformed(scip) && !SCIPprobIsPermuted(scip->transprob) )
    984 {
    985 /* loop over all constraint handlers */
    986 for( i = 0; i < nconshdlrs; ++i )
    987 {
    988 SCIP_CONS** conss;
    989 int nconss;
    990
    991 conss = SCIPconshdlrGetConss(conshdlrs[i]);
    992 nconss = SCIPconshdlrGetNActiveConss(conshdlrs[i]);
    993
    994 assert(nconss == 0 || conss != NULL);
    995
    996 SCIPrandomPermuteArray(randnumgen, (void**)conss, 0, nconss);
    997
    998 /* readjust the mapping of constraints to array positions */
    999 for( j = 0; j < nconss; ++j )
    1000 conss[j]->consspos = j;
    1001
    1002 permuted = TRUE;
    1003 }
    1004 }
    1005 else if( !SCIPisTransformed(scip) && !SCIPprobIsPermuted(scip->origprob) )
    1006 {
    1007 SCIP_CONS** conss = scip->origprob->conss;
    1008 int nconss = scip->origprob->nconss;
    1009
    1010 SCIPrandomPermuteArray(randnumgen, (void**)conss, 0, nconss);
    1011
    1012 for( j = 0; j < nconss; ++j )
    1013 {
    1014 assert(conss[j]->consspos == -1);
    1015 conss[j]->addarraypos = j;
    1016 }
    1017
    1018 permuted = TRUE;
    1019 }
    1020 }
    1021
    1022 /* permute binary variables */
    1023 if( permutebinvars && !SCIPprobIsPermuted(scip->origprob) )
    1024 {
    1025 SCIPrandomPermuteArray(randnumgen, (void**)vars, 0, intstart);
    1026
    1027 /* readjust the mapping of variables to array positions */
    1028 for( j = 0; j < intstart; ++j )
    1029 vars[j]->probindex = j;
    1030
    1031 permuted = TRUE;
    1032 }
    1033
    1034 /* permute integer variables */
    1035 if( permuteintvars && !SCIPprobIsPermuted(scip->origprob) )
    1036 {
    1037 SCIPrandomPermuteArray(randnumgen, (void**)vars, intstart, binimplstart);
    1038
    1039 /* readjust the mapping of variables to array positions */
    1040 for( j = intstart; j < binimplstart; ++j )
    1041 vars[j]->probindex = j;
    1042
    1043 permuted = TRUE;
    1044 }
    1045
    1046 /* permute binary implied integral variables */
    1047 if( permutebinimplvars && !SCIPprobIsPermuted(scip->origprob) )
    1048 {
    1049 SCIPrandomPermuteArray(randnumgen, (void**)vars, binimplstart, intimplstart);
    1050
    1051 /* readjust the mapping of variables to array positions */
    1052 for( j = binimplstart; j < intimplstart; ++j )
    1053 vars[j]->probindex = j;
    1054
    1055 permuted = TRUE;
    1056 }
    1057
    1058 /* permute integer implied integral variables */
    1059 if( permuteintimplvars && !SCIPprobIsPermuted(scip->origprob) )
    1060 {
    1061 SCIPrandomPermuteArray(randnumgen, (void**)vars, intimplstart, contimplstart);
    1062
    1063 /* readjust the mapping of variables to array positions */
    1064 for( j = intimplstart; j < contimplstart; ++j )
    1065 vars[j]->probindex = j;
    1066
    1067 permuted = TRUE;
    1068 }
    1069
    1070 /* permute continuous implied integral variables */
    1071 if( permutecontimplvars && !SCIPprobIsPermuted(scip->origprob) )
    1072 {
    1073 SCIPrandomPermuteArray(randnumgen, (void**)vars, contimplstart, contstart);
    1074
    1075 /* readjust the mapping of variables to array positions */
    1076 for( j = contimplstart; j < contstart; ++j )
    1077 vars[j]->probindex = j;
    1078
    1079 permuted = TRUE;
    1080 }
    1081
    1082 /* permute continuous variables */
    1083 if( permutecontvars && !SCIPprobIsPermuted(scip->origprob) )
    1084 {
    1085 SCIPrandomPermuteArray(randnumgen, (void**)vars, contstart, nvars);
    1086
    1087 /* readjust the mapping of variables to array positions */
    1088 for( j = contstart; j < nvars; ++j )
    1089 vars[j]->probindex = j;
    1090
    1091 permuted = TRUE;
    1092 }
    1093
    1094 if( permuted && SCIPisTransformed(scip) )
    1095 {
    1096 assert(!SCIPprobIsPermuted(scip->transprob));
    1097
    1098 /* mark tranformed problem as permuted */
    1099 SCIPprobMarkPermuted(scip->transprob);
    1100
    1101 SCIPmessagePrintVerbInfo(scip->messagehdlr, scip->set->disp_verblevel, SCIP_VERBLEVEL_HIGH,
    1102 "permute transformed problem using random seed %u\n", randseed);
    1103 }
    1104 else if( permuted && !SCIPisTransformed(scip) )
    1105 {
    1106 assert(!SCIPprobIsPermuted(scip->origprob));
    1107
    1108 /* mark original problem as permuted */
    1109 SCIPprobMarkPermuted(scip->origprob);
    1110
    1111 SCIPmessagePrintVerbInfo(scip->messagehdlr, scip->set->disp_verblevel, SCIP_VERBLEVEL_HIGH,
    1112 "permute original problem using random seed %u\n", randseed);
    1113 }
    1114
    1115 /* free random number generator */
    1116 SCIPfreeRandom(scip, &randnumgen);
    1117
    1118 return SCIP_OKAY;
    1119}
    1120
    1121/** gets user problem data
    1122 *
    1123 * @return a SCIP_PROBDATA pointer, or NULL if no problem data was allocated
    1124 *
    1125 * @pre This method can be called if @p scip is in one of the following stages:
    1126 * - \ref SCIP_STAGE_PROBLEM
    1127 * - \ref SCIP_STAGE_TRANSFORMING
    1128 * - \ref SCIP_STAGE_TRANSFORMED
    1129 * - \ref SCIP_STAGE_INITPRESOLVE
    1130 * - \ref SCIP_STAGE_PRESOLVING
    1131 * - \ref SCIP_STAGE_EXITPRESOLVE
    1132 * - \ref SCIP_STAGE_PRESOLVED
    1133 * - \ref SCIP_STAGE_INITSOLVE
    1134 * - \ref SCIP_STAGE_SOLVING
    1135 * - \ref SCIP_STAGE_SOLVED
    1136 * - \ref SCIP_STAGE_EXITSOLVE
    1137 * - \ref SCIP_STAGE_FREETRANS
    1138 */
    1140 SCIP* scip /**< SCIP data structure */
    1141 )
    1142{
    1144
    1145 switch( scip->set->stage )
    1146 {
    1147 case SCIP_STAGE_PROBLEM:
    1148 return SCIPprobGetData(scip->origprob);
    1149
    1157 case SCIP_STAGE_SOLVING:
    1158 case SCIP_STAGE_SOLVED:
    1161 return SCIPprobGetData(scip->transprob);
    1162
    1163 default:
    1164 SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
    1165 SCIPABORT();
    1166 return NULL; /*lint !e527*/
    1167 } /*lint !e788*/
    1168}
    1169
    1170/** sets user problem data
    1171 *
    1172 * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
    1173 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
    1174 *
    1175 * @pre This method can be called if @p scip is in one of the following stages:
    1176 * - \ref SCIP_STAGE_PROBLEM
    1177 * - \ref SCIP_STAGE_TRANSFORMING
    1178 * - \ref SCIP_STAGE_TRANSFORMED
    1179 * - \ref SCIP_STAGE_INITPRESOLVE
    1180 * - \ref SCIP_STAGE_PRESOLVING
    1181 * - \ref SCIP_STAGE_EXITPRESOLVE
    1182 * - \ref SCIP_STAGE_PRESOLVED
    1183 * - \ref SCIP_STAGE_INITSOLVE
    1184 * - \ref SCIP_STAGE_SOLVING
    1185 * - \ref SCIP_STAGE_SOLVED
    1186 * - \ref SCIP_STAGE_EXITSOLVE
    1187 * - \ref SCIP_STAGE_FREETRANS
    1188 */
    1190 SCIP* scip, /**< SCIP data structure */
    1191 SCIP_PROBDATA* probdata /**< user problem data to use */
    1192 )
    1193{
    1194 SCIP_CALL( SCIPcheckStage(scip, "SCIPsetProbData", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
    1195
    1196 switch( scip->set->stage )
    1197 {
    1198 case SCIP_STAGE_PROBLEM:
    1199 SCIPprobSetData(scip->origprob, probdata);
    1200 return SCIP_OKAY;
    1201
    1209 case SCIP_STAGE_SOLVING:
    1210 case SCIP_STAGE_SOLVED:
    1213 SCIPprobSetData(scip->transprob, probdata);
    1214 return SCIP_OKAY;
    1215
    1216 case SCIP_STAGE_INIT:
    1217 case SCIP_STAGE_FREE:
    1218 default:
    1219 SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
    1220 return SCIP_INVALIDCALL;
    1221 }
    1222}
    1223
    1224/** returns name of the current problem instance
    1225 *
    1226 * @return name of the current problem instance
    1227 *
    1228 * @pre This method can be called if @p scip is in one of the following stages:
    1229 * - \ref SCIP_STAGE_PROBLEM
    1230 * - \ref SCIP_STAGE_TRANSFORMING
    1231 * - \ref SCIP_STAGE_TRANSFORMED
    1232 * - \ref SCIP_STAGE_INITPRESOLVE
    1233 * - \ref SCIP_STAGE_PRESOLVING
    1234 * - \ref SCIP_STAGE_EXITPRESOLVE
    1235 * - \ref SCIP_STAGE_PRESOLVED
    1236 * - \ref SCIP_STAGE_INITSOLVE
    1237 * - \ref SCIP_STAGE_SOLVING
    1238 * - \ref SCIP_STAGE_SOLVED
    1239 * - \ref SCIP_STAGE_EXITSOLVE
    1240 * - \ref SCIP_STAGE_FREETRANS
    1241 */
    1243 SCIP* scip /**< SCIP data structure */
    1244 )
    1245{
    1247
    1248 return SCIPprobGetName(scip->origprob);
    1249}
    1250
    1251/** sets name of the current problem instance
    1252 *
    1253 * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
    1254 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
    1255 *
    1256 * @pre This method can be called if @p scip is in one of the following stages:
    1257 * - \ref SCIP_STAGE_PROBLEM
    1258 * - \ref SCIP_STAGE_TRANSFORMING
    1259 * - \ref SCIP_STAGE_TRANSFORMED
    1260 * - \ref SCIP_STAGE_INITPRESOLVE
    1261 * - \ref SCIP_STAGE_PRESOLVING
    1262 * - \ref SCIP_STAGE_EXITPRESOLVE
    1263 * - \ref SCIP_STAGE_PRESOLVED
    1264 * - \ref SCIP_STAGE_INITSOLVE
    1265 * - \ref SCIP_STAGE_SOLVING
    1266 * - \ref SCIP_STAGE_SOLVED
    1267 * - \ref SCIP_STAGE_EXITSOLVE
    1268 * - \ref SCIP_STAGE_FREETRANS
    1269 */
    1271 SCIP* scip, /**< SCIP data structure */
    1272 const char* name /**< name to be set */
    1273 )
    1274{
    1275 SCIP_CALL( SCIPcheckStage(scip, "SCIPsetProbName", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
    1276
    1277 return SCIPprobSetName(scip->origprob, name);
    1278}
    1279
    1280/** changes the objective function of the original problem.
    1281 *
    1282 * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
    1283 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
    1284 *
    1285 * @pre This method can be called if @p scip is in one of the following stages:
    1286 * - \ref SCIP_STAGE_PROBLEM
    1287 * - \ref SCIP_STAGE_PRESOLVED
    1288 *
    1289 * @note This method should be only used to change the objective function during two reoptimization runs and is only
    1290 * recommended to an experienced user.
    1291 *
    1292 * @note All variables not given in \p vars array are assumed to have an objective coefficient of zero.
    1293 */
    1295 SCIP* scip, /**< SCIP data structure */
    1296 SCIP_OBJSENSE objsense, /**< new objective function */
    1297 SCIP_VAR** vars, /**< original problem variables */
    1298 SCIP_Real* coefs, /**< objective coefficients */
    1299 int nvars /**< variables in vars array */
    1300 )
    1301{
    1302 SCIP_VAR** origvars;
    1303 int norigvars;
    1304 int i;
    1305
    1306 SCIP_CALL( SCIPcheckStage(scip, "SCIPchgReoptObjective", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
    1307
    1308 assert(nvars == 0 || vars != NULL);
    1309 assert(nvars == 0 || coefs != NULL);
    1310
    1311 origvars = scip->origprob->vars;
    1312 norigvars = scip->origprob->nvars;
    1313
    1314#ifdef SCIP_MORE_DEBUG
    1315 SCIPdebugMsg(scip, "objective function need to be set:\n");
    1316 for( i = 0; i < nvars; i++ )
    1317 {
    1318 if( !SCIPisZero(scip, coefs[i]) )
    1319 SCIPdebugMsg(scip, "%s%g <%s> ", SCIPisPositive(scip, coefs[i]) ? "+" : "", coefs[i], SCIPvarGetName(vars[i]));
    1320 }
    1321 SCIPdebugMsg(scip, "\n");
    1322#endif
    1323
    1324 /* Set all coefficients of original variables to 0, since we will add the new objective coefficients later. */
    1325 for( i = 0; i < norigvars; i++ )
    1326 {
    1327 SCIP_CALL( SCIPchgVarObj(scip, origvars[i], 0.0) );
    1328 }
    1329
    1330 if( scip->set->stage >= SCIP_STAGE_TRANSFORMED )
    1331 {
    1332 /* In order to avoid numerical troubles, also explicitly set all transformed objective coefficients to 0. */
    1333 for( i = 0; i < scip->transprob->nvars; i++ )
    1334 {
    1335 SCIP_CALL( SCIPchgVarObj(scip, scip->transprob->vars[i], 0.0) );
    1336 }
    1337 }
    1338
    1339 /* reset objective data of original problem */
    1340 scip->origprob->objscale = 1.0;
    1341 scip->origprob->objsense = objsense;
    1342 scip->origprob->objoffset = 0.0;
    1343 scip->origprob->objisintegral = FALSE;
    1344
    1345 if( scip->set->stage >= SCIP_STAGE_TRANSFORMED )
    1346 {
    1347 /* reset objective data of transformed problem */
    1348 scip->transprob->objscale = 1.0;
    1349 scip->transprob->objsense = objsense;
    1350 scip->transprob->objoffset = 0.0;
    1351 scip->transprob->objisintegral = FALSE;
    1352 }
    1353
    1354 /* set new objective values */
    1355 for( i = 0; i < nvars; ++i )
    1356 {
    1357 if( !SCIPvarIsOriginal(vars[i]) )
    1358 {
    1359 SCIPerrorMessage("Cannot handle variable <%s> (status: %d) in SCIPchgReoptObjective().\n",
    1360 SCIPvarGetName(vars[i]), SCIPvarGetStatus(vars[i]));
    1361 return SCIP_INVALIDDATA;
    1362 }
    1363
    1364 /* Add coefficients because this gets transferred to the transformed problem (the coefficients were set to 0 above). */
    1365 SCIP_CALL( SCIPaddVarObj(scip, vars[i], coefs[i]) );
    1366 }
    1367
    1368#ifdef SCIP_MORE_DEBUG
    1369 SCIPdebugMsg(scip, "new objective function:\n");
    1370 for( i = 0; i < norigvars; i++ )
    1371 {
    1372 SCIP_Real objval = SCIPvarGetObj(origvars[i]);
    1373 if( !SCIPisZero(scip, objval) )
    1374 SCIPdebugMsg(scip, "%s%g <%s> ", SCIPisPositive(scip, objval) ? "+" : "", objval, SCIPvarGetName(origvars[i]));
    1375 }
    1376 SCIPdebugMsg(scip, "\n");
    1377#endif
    1378
    1379 return SCIP_OKAY;
    1380}
    1381
    1382/** returns objective sense of original problem
    1383 *
    1384 * @return objective sense of original problem
    1385 *
    1386 * @pre This method can be called if @p scip is in one of the following stages:
    1387 * - \ref SCIP_STAGE_PROBLEM
    1388 * - \ref SCIP_STAGE_TRANSFORMING
    1389 * - \ref SCIP_STAGE_TRANSFORMED
    1390 * - \ref SCIP_STAGE_INITPRESOLVE
    1391 * - \ref SCIP_STAGE_PRESOLVING
    1392 * - \ref SCIP_STAGE_EXITPRESOLVE
    1393 * - \ref SCIP_STAGE_PRESOLVED
    1394 * - \ref SCIP_STAGE_INITSOLVE
    1395 * - \ref SCIP_STAGE_SOLVING
    1396 * - \ref SCIP_STAGE_SOLVED
    1397 * - \ref SCIP_STAGE_EXITSOLVE
    1398 * - \ref SCIP_STAGE_FREETRANS
    1399 */
    1401 SCIP* scip /**< SCIP data structure */
    1402 )
    1403{
    1405
    1406 return scip->origprob->objsense;
    1407}
    1408
    1409/** sets objective sense of problem
    1410 *
    1411 * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
    1412 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
    1413 *
    1414 * @pre This method can be called if @p scip is in one of the following stages:
    1415 * - \ref SCIP_STAGE_PROBLEM
    1416 */
    1418 SCIP* scip, /**< SCIP data structure */
    1419 SCIP_OBJSENSE objsense /**< new objective sense */
    1420 )
    1421{
    1423
    1424 if( objsense != SCIP_OBJSENSE_MAXIMIZE && objsense != SCIP_OBJSENSE_MINIMIZE )
    1425 {
    1426 SCIPerrorMessage("invalid objective sense\n");
    1427 return SCIP_INVALIDDATA;
    1428 }
    1429
    1430 SCIPprobSetObjsense(scip->origprob, objsense);
    1431
    1432 return SCIP_OKAY;
    1433}
    1434
    1435/** adds offset of objective function
    1436 *
    1437 * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
    1438 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
    1439 *
    1440 * @pre This method can be called if @p scip is in one of the following stages:
    1441 * - \ref SCIP_STAGE_PRESOLVING
    1442 */
    1444 SCIP* scip, /**< SCIP data structure */
    1445 SCIP_Real addval /**< value to add to objective offset */
    1446 )
    1447{
    1449
    1450 SCIPprobAddObjoffset(scip->transprob, addval);
    1451 SCIP_CALL( SCIPprimalUpdateObjoffset(scip->primal, SCIPblkmem(scip), scip->set, scip->stat, scip->eventqueue,
    1452 scip->eventfilter, scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp) );
    1453
    1454 return SCIP_OKAY;
    1455}
    1456
    1457/** adds offset of objective function to original problem and to all existing solution in original space
    1458 *
    1459 * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
    1460 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
    1461 *
    1462 * @pre This method can be called if @p scip is in one of the following stages:
    1463 * - \ref SCIP_STAGE_PROBLEM
    1464 */
    1466 SCIP* scip, /**< SCIP data structure */
    1467 SCIP_RATIONAL* addval /**< value to add to objective offset */
    1468 )
    1469{
    1470 SCIP_CALL( SCIPcheckStage(scip, "SCIPaddOrigObjoffsetExact", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
    1471
    1472 SCIPprobAddObjoffsetExact(scip->origprob, addval);
    1473 SCIPprimalAddOrigObjoffsetExact(scip->origprimal, scip->set, addval);
    1474
    1475 return SCIP_OKAY;
    1476}
    1477
    1478/** adds offset of objective function to original problem and to all existing solution in original space
    1479 *
    1480 * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
    1481 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
    1482 *
    1483 * @pre This method can be called if @p scip is in one of the following stages:
    1484 * - \ref SCIP_STAGE_PROBLEM
    1485 */
    1487 SCIP* scip, /**< SCIP data structure */
    1488 SCIP_Real addval /**< value to add to objective offset */
    1489 )
    1490{
    1491 SCIP_CALL( SCIPcheckStage(scip, "SCIPaddOrigObjoffset", FALSE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE) );
    1492
    1493 if( SCIPisExact(scip) )
    1494 {
    1495 SCIP_RATIONAL* addvalexact;
    1496
    1498
    1499 SCIPrationalSetReal(addvalexact, addval);
    1500 SCIP_CALL( SCIPaddOrigObjoffsetExact(scip, addvalexact) );
    1501
    1502 SCIPrationalFreeBuffer(SCIPbuffer(scip), &addvalexact);
    1503
    1504 return SCIP_OKAY;
    1505 }
    1506
    1507 SCIPprobAddObjoffset(scip->origprob, addval);
    1508 SCIPprimalAddOrigObjoffset(scip->origprimal, scip->set, addval);
    1509
    1510 return SCIP_OKAY;
    1511}
    1512
    1513/** returns the objective offset of the original problem
    1514 *
    1515 * @return the objective offset of the original problem
    1516 *
    1517 * @pre This method can be called if @p scip is in one of the following stages:
    1518 * - \ref SCIP_STAGE_PROBLEM
    1519 * - \ref SCIP_STAGE_TRANSFORMING
    1520 * - \ref SCIP_STAGE_TRANSFORMED
    1521 * - \ref SCIP_STAGE_INITPRESOLVE
    1522 * - \ref SCIP_STAGE_PRESOLVING
    1523 * - \ref SCIP_STAGE_EXITPRESOLVE
    1524 * - \ref SCIP_STAGE_PRESOLVED
    1525 * - \ref SCIP_STAGE_INITSOLVE
    1526 * - \ref SCIP_STAGE_SOLVING
    1527 * - \ref SCIP_STAGE_SOLVED
    1528 */
    1530 SCIP* scip /**< SCIP data structure */
    1531 )
    1532{
    1533 SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetOrigObjoffset", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
    1534
    1535 return scip->origprob->objoffset;
    1536}
    1537
    1538/** returns the exact objective offset of the original problem
    1539 *
    1540 * DO NOT MODIFY THE POINTER RETURNED BY THIS METHOD
    1541 *
    1542 * @return the exact objective offset of the original problem
    1543 *
    1544 * @pre This method can be called if @p scip is in one of the following stages:
    1545 * - \ref SCIP_STAGE_PROBLEM
    1546 * - \ref SCIP_STAGE_TRANSFORMING
    1547 * - \ref SCIP_STAGE_TRANSFORMED
    1548 * - \ref SCIP_STAGE_INITPRESOLVE
    1549 * - \ref SCIP_STAGE_PRESOLVING
    1550 * - \ref SCIP_STAGE_EXITPRESOLVE
    1551 * - \ref SCIP_STAGE_PRESOLVED
    1552 * - \ref SCIP_STAGE_INITSOLVE
    1553 * - \ref SCIP_STAGE_SOLVING
    1554 * - \ref SCIP_STAGE_SOLVED
    1555 */
    1557 SCIP* scip /**< SCIP data structure */
    1558 )
    1559{
    1560 SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetOrigObjoffsetExact", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
    1561
    1562 assert(SCIPisExact(scip));
    1563
    1564 return scip->origprob->objoffsetexact;
    1565}
    1566
    1567/** returns the objective scale of the original problem
    1568 *
    1569 * @return the objective scale of the original problem
    1570 *
    1571 * @pre This method can be called if @p scip is in one of the following stages:
    1572 * - \ref SCIP_STAGE_PROBLEM
    1573 * - \ref SCIP_STAGE_TRANSFORMING
    1574 * - \ref SCIP_STAGE_TRANSFORMED
    1575 * - \ref SCIP_STAGE_INITPRESOLVE
    1576 * - \ref SCIP_STAGE_PRESOLVING
    1577 * - \ref SCIP_STAGE_EXITPRESOLVE
    1578 * - \ref SCIP_STAGE_PRESOLVED
    1579 * - \ref SCIP_STAGE_INITSOLVE
    1580 * - \ref SCIP_STAGE_SOLVING
    1581 * - \ref SCIP_STAGE_SOLVED
    1582 */
    1584 SCIP* scip /**< SCIP data structure */
    1585 )
    1586{
    1587 SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetOrigObjscale", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
    1588
    1589 return scip->origprob->objscale;
    1590}
    1591
    1592/** returns the objective offset of the transformed problem
    1593 *
    1594 * @return the objective offset of the transformed problem
    1595 *
    1596 * @pre This method can be called if @p scip is in one of the following stages:
    1597 * - \ref SCIP_STAGE_TRANSFORMED
    1598 * - \ref SCIP_STAGE_INITPRESOLVE
    1599 * - \ref SCIP_STAGE_PRESOLVING
    1600 * - \ref SCIP_STAGE_EXITPRESOLVE
    1601 * - \ref SCIP_STAGE_PRESOLVED
    1602 * - \ref SCIP_STAGE_INITSOLVE
    1603 * - \ref SCIP_STAGE_SOLVING
    1604 * - \ref SCIP_STAGE_SOLVED
    1605 */
    1607 SCIP* scip /**< SCIP data structure */
    1608 )
    1609{
    1610 SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetTransObjoffset", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
    1611
    1612 return scip->transprob->objoffset;
    1613}
    1614
    1615/** returns the objective scale of the transformed problem
    1616 *
    1617 * @return the objective scale of the transformed problem
    1618 *
    1619 * @pre This method can be called if @p scip is in one of the following stages:
    1620 * - \ref SCIP_STAGE_TRANSFORMED
    1621 * - \ref SCIP_STAGE_INITPRESOLVE
    1622 * - \ref SCIP_STAGE_PRESOLVING
    1623 * - \ref SCIP_STAGE_EXITPRESOLVE
    1624 * - \ref SCIP_STAGE_PRESOLVED
    1625 * - \ref SCIP_STAGE_INITSOLVE
    1626 * - \ref SCIP_STAGE_SOLVING
    1627 * - \ref SCIP_STAGE_SOLVED
    1628 */
    1630 SCIP* scip /**< SCIP data structure */
    1631 )
    1632{
    1633 SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetTransObjscale", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
    1634
    1635 return scip->transprob->objscale;
    1636}
    1637
    1638/** sets limit on objective function, such that only solutions better than this limit are accepted
    1639 *
    1640 * @note SCIP will only look for solutions with a strictly better objective value, thus, e.g., prune
    1641 * all branch-and-bound nodes with dual bound equal or worse to the objective limit.
    1642 * However, SCIP will also collect solutions with objective value worse than the objective limit and
    1643 * use them to run improvement heuristics on them.
    1644 * @note If SCIP can prove that there exists no solution with a strictly better objective value, the solving status
    1645 * will normally be infeasible (the objective limit is interpreted as part of the problem).
    1646 * The only exception is that by chance, SCIP found a solution with the same objective value and thus
    1647 * proved the optimality of this solution, resulting in solution status optimal.
    1648 *
    1649 * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
    1650 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
    1651 *
    1652 * @pre This method can be called if @p scip is in one of the following stages:
    1653 * - \ref SCIP_STAGE_PROBLEM
    1654 * - \ref SCIP_STAGE_TRANSFORMED
    1655 * - \ref SCIP_STAGE_INITPRESOLVE
    1656 * - \ref SCIP_STAGE_PRESOLVING
    1657 * - \ref SCIP_STAGE_EXITPRESOLVE
    1658 * - \ref SCIP_STAGE_PRESOLVED
    1659 * - \ref SCIP_STAGE_SOLVING
    1660 */
    1662 SCIP* scip, /**< SCIP data structure */
    1663 SCIP_Real objlimit /**< new primal objective limit */
    1664 )
    1665{
    1666 SCIP_Real oldobjlimit;
    1667
    1668 SCIP_CALL( SCIPcheckStage(scip, "SCIPsetObjlimit", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
    1669
    1670 switch( scip->set->stage )
    1671 {
    1672 case SCIP_STAGE_PROBLEM:
    1673 SCIPprobSetObjlim(scip->origprob, objlimit);
    1674 break;
    1676 oldobjlimit = SCIPprobGetObjlim(scip->origprob, scip->set);
    1677 assert(oldobjlimit == SCIPprobGetObjlim(scip->transprob, scip->set)); /*lint !e777*/
    1678 if( SCIPtransformObj(scip, objlimit) > SCIPprobInternObjval(scip->transprob, scip->origprob, scip->set, oldobjlimit) && ! scip->set->reopt_enable)
    1679 {
    1680 SCIPerrorMessage("cannot relax objective limit from %.15g to %.15g in presolved stage.\n", oldobjlimit, objlimit);
    1681 return SCIP_INVALIDDATA;
    1682 }
    1683 SCIPprobSetObjlim(scip->origprob, objlimit);
    1684 SCIPprobSetObjlim(scip->transprob, objlimit);
    1685 SCIP_CALL( SCIPprimalUpdateObjlimit(scip->primal, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue,
    1686 scip->eventfilter, scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp) );
    1687 break;
    1688
    1693 case SCIP_STAGE_SOLVING:
    1694 oldobjlimit = SCIPprobGetObjlim(scip->origprob, scip->set);
    1695 assert(oldobjlimit == SCIPprobGetObjlim(scip->transprob, scip->set)); /*lint !e777*/
    1696 if( SCIPtransformObj(scip, objlimit) > SCIPprobInternObjval(scip->transprob, scip->origprob, scip->set, oldobjlimit) )
    1697 {
    1698 SCIPerrorMessage("cannot relax objective limit from %.15g to %.15g after problem was transformed.\n", oldobjlimit, objlimit);
    1699 return SCIP_INVALIDDATA;
    1700 }
    1701 SCIPprobSetObjlim(scip->origprob, objlimit);
    1702 SCIPprobSetObjlim(scip->transprob, objlimit);
    1703 SCIP_CALL( SCIPprimalUpdateObjlimit(scip->primal, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue,
    1704 scip->eventfilter, scip->transprob, scip->origprob, scip->tree, scip->reopt, scip->lp) );
    1705 break;
    1706
    1707 default:
    1708 SCIPerrorMessage("method is not callable in SCIP stage <%d>\n", scip->set->stage);
    1709 return SCIP_INVALIDCALL;
    1710 } /*lint !e788*/
    1711
    1712 return SCIP_OKAY;
    1713}
    1714
    1715/** returns current limit on objective function
    1716 *
    1717 * @return the current objective limit of the original problem
    1718 *
    1719 * @pre This method can be called if @p scip is in one of the following stages:
    1720 * - \ref SCIP_STAGE_PROBLEM
    1721 * - \ref SCIP_STAGE_TRANSFORMING
    1722 * - \ref SCIP_STAGE_TRANSFORMED
    1723 * - \ref SCIP_STAGE_INITPRESOLVE
    1724 * - \ref SCIP_STAGE_PRESOLVING
    1725 * - \ref SCIP_STAGE_EXITPRESOLVE
    1726 * - \ref SCIP_STAGE_PRESOLVED
    1727 * - \ref SCIP_STAGE_INITSOLVE
    1728 * - \ref SCIP_STAGE_SOLVING
    1729 * - \ref SCIP_STAGE_SOLVED
    1730 */
    1732 SCIP* scip /**< SCIP data structure */
    1733 )
    1734{
    1736
    1737 return SCIPprobGetObjlim(scip->origprob, scip->set);
    1738}
    1739
    1740/** informs SCIP, that the objective value is always integral in every feasible solution
    1741 *
    1742 * @return \ref SCIP_OKAY is returned if everything worked. otherwise a suitable error code is passed. see \ref
    1743 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
    1744 *
    1745 * @pre This method can be called if @p scip is in one of the following stages:
    1746 * - \ref SCIP_STAGE_PROBLEM
    1747 * - \ref SCIP_STAGE_TRANSFORMING
    1748 * - \ref SCIP_STAGE_INITPRESOLVE
    1749 * - \ref SCIP_STAGE_EXITPRESOLVE
    1750 * - \ref SCIP_STAGE_SOLVING
    1751 *
    1752 * @note This function should be used to inform SCIP that the objective function is integral, helping to improve the
    1753 * performance. This is useful when using column generation. If no column generation (pricing) is used, SCIP
    1754 * automatically detects whether the objective function is integral or can be scaled to be integral. However, in
    1755 * any case, the user has to make sure that no variable is added during the solving process that destroys this
    1756 * property.
    1757 */
    1759 SCIP* scip /**< SCIP data structure */
    1760 )
    1761{
    1762 SCIP_CALL( SCIPcheckStage(scip, "SCIPsetObjIntegral", FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
    1763
    1764 switch( scip->set->stage )
    1765 {
    1766 case SCIP_STAGE_PROBLEM:
    1767 SCIPprobSetObjIntegral(scip->origprob);
    1768 return SCIP_OKAY;
    1769
    1773 case SCIP_STAGE_SOLVING:
    1774 SCIPprobSetObjIntegral(scip->transprob);
    1775 return SCIP_OKAY;
    1776
    1777 default:
    1778 SCIPerrorMessage("method is not callable in SCIP stage <%d>\n", scip->set->stage);
    1779 return SCIP_INVALIDCALL;
    1780 } /*lint !e788*/
    1781}
    1782
    1783/** returns whether the objective value is known to be integral in every feasible solution
    1784 *
    1785 * @return TRUE, if objective value is known to be always integral, otherwise FALSE
    1786 *
    1787 * @pre This method can be called if @p scip is in one of the following stages:
    1788 * - \ref SCIP_STAGE_PROBLEM
    1789 * - \ref SCIP_STAGE_TRANSFORMING
    1790 * - \ref SCIP_STAGE_INITPRESOLVE
    1791 * - \ref SCIP_STAGE_PRESOLVING
    1792 * - \ref SCIP_STAGE_EXITPRESOLVE
    1793 * - \ref SCIP_STAGE_PRESOLVED
    1794 * - \ref SCIP_STAGE_SOLVING
    1795 *
    1796 * @note If no pricing is performed, SCIP automatically detects whether the objective function is integral or can be
    1797 * scaled to be integral, helping to improve performance. This function returns the result. Otherwise
    1798 * SCIPsetObjIntegral() can be used to inform SCIP. However, in any case, the user has to make sure that no
    1799 * variable is added during the solving process that destroys this property.
    1800 */
    1802 SCIP* scip /**< SCIP data structure */
    1803 )
    1804{
    1805 int v;
    1806
    1808
    1809 switch( scip->set->stage )
    1810 {
    1811 case SCIP_STAGE_PROBLEM:
    1812 /* if the user explicitly added the information that there is an integral objective, return TRUE */
    1813 if( SCIPprobIsObjIntegral(scip->origprob) )
    1814 return TRUE;
    1815
    1816 /* if there exist unknown variables, we cannot conclude that the objective value is always integral */
    1817 if ( scip->set->nactivepricers != 0 )
    1818 return FALSE;
    1819
    1820 /* if the objective value offset is fractional, the value itself is possibly fractional */
    1821 if ( ! SCIPisIntegral(scip, scip->origprob->objoffset) )
    1822 return FALSE;
    1823
    1824 /* scan through the variables */
    1825 for (v = 0; v < scip->origprob->nvars; ++v)
    1826 {
    1827 SCIP_Real obj;
    1828
    1829 /* get objective value of variable */
    1830 obj = SCIPvarGetObj(scip->origprob->vars[v]);
    1831
    1832 /* check, if objective value is non-zero */
    1833 if ( ! SCIPisZero(scip, obj) )
    1834 {
    1835 /* if variable's objective value is fractional, the problem's objective value may also be fractional */
    1836 if ( ! SCIPisIntegral(scip, obj) )
    1837 break;
    1838
    1839 /* if variable with non-zero objective value is continuous, the problem's objective value may be fractional */
    1840 if ( !SCIPvarIsIntegral(scip->origprob->vars[v]) )
    1841 break;
    1842 }
    1843 }
    1844
    1845 /* we do not store the result, since we assume that the original problem might be changed */
    1846 if ( v == scip->origprob->nvars )
    1847 return TRUE;
    1848 return FALSE;
    1849
    1855 case SCIP_STAGE_SOLVING:
    1856 return SCIPprobIsObjIntegral(scip->transprob);
    1857
    1858 default:
    1859 SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
    1860 SCIPABORT();
    1861 return FALSE; /*lint !e527*/
    1862 } /*lint !e788*/
    1863}
    1864
    1865/** returns the Euclidean norm of the objective function vector (available only for transformed problem)
    1866 *
    1867 * @return the Euclidean norm of the transformed objective function vector
    1868 *
    1869 * @pre This method can be called if @p scip is in one of the following stages:
    1870 * - \ref SCIP_STAGE_TRANSFORMED
    1871 * - \ref SCIP_STAGE_INITPRESOLVE
    1872 * - \ref SCIP_STAGE_PRESOLVING
    1873 * - \ref SCIP_STAGE_EXITPRESOLVE
    1874 * - \ref SCIP_STAGE_PRESOLVED
    1875 * - \ref SCIP_STAGE_INITSOLVE
    1876 * - \ref SCIP_STAGE_SOLVING
    1877 * - \ref SCIP_STAGE_SOLVED
    1878 * - \ref SCIP_STAGE_EXITSOLVE
    1879 */
    1881 SCIP* scip /**< SCIP data structure */
    1882 )
    1883{
    1885
    1886 if( scip->lp->objsqrnormunreliable )
    1888 assert(!scip->lp->objsqrnormunreliable);
    1889
    1890 return SCIPlpGetObjNorm(scip->lp);
    1891}
    1892
    1893/** adds variable to the problem
    1894 *
    1895 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
    1896 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
    1897 *
    1898 * @pre This method can be called if @p scip is in one of the following stages:
    1899 * - \ref SCIP_STAGE_PROBLEM
    1900 * - \ref SCIP_STAGE_TRANSFORMING
    1901 * - \ref SCIP_STAGE_INITPRESOLVE
    1902 * - \ref SCIP_STAGE_PRESOLVING
    1903 * - \ref SCIP_STAGE_EXITPRESOLVE
    1904 * - \ref SCIP_STAGE_PRESOLVED
    1905 * - \ref SCIP_STAGE_SOLVING
    1906 */
    1908 SCIP* scip, /**< SCIP data structure */
    1909 SCIP_VAR* var /**< variable to add */
    1910 )
    1911{
    1913
    1914 /* avoid inserting the same variable twice */
    1915 if( SCIPvarGetProbindex(var) != -1 )
    1916 return SCIP_OKAY;
    1917
    1918 /* insert the negation variable x instead of the negated variable x' in x' = offset - x */
    1920 {
    1921 assert(SCIPvarGetNegationVar(var) != NULL);
    1923 return SCIP_OKAY;
    1924 }
    1925
    1926 /* exact variable data should be available if and only if exact solving is turned on */
    1927 if( SCIPisExact(scip) && !SCIPvarIsExact(var) )
    1928 {
    1929 SCIPerrorMessage("cannot add variable without exact data while exact solving is enabled\n");
    1930 return SCIP_INVALIDDATA;
    1931 }
    1932 else if( !SCIPisExact(scip) && SCIPvarIsExact(var) )
    1933 {
    1934 SCIPerrorMessage("cannot add variable with exact data while exact solving is disabled\n");
    1935 return SCIP_INVALIDDATA;
    1936 }
    1937
    1938 switch( scip->set->stage )
    1939 {
    1940 case SCIP_STAGE_PROBLEM:
    1942 {
    1943 SCIPerrorMessage("cannot add transformed variables to original problem\n");
    1944 return SCIP_INVALIDDATA;
    1945 }
    1946 SCIP_CALL( SCIPprobAddVar(scip->origprob, scip->mem->probmem, scip->set, scip->lp, scip->branchcand,
    1947 scip->eventqueue, scip->eventfilter, var) );
    1948 return SCIP_OKAY;
    1949
    1955 case SCIP_STAGE_SOLVING:
    1956 /* check variable's status */
    1958 {
    1959 SCIPerrorMessage("cannot add original variables to transformed problem\n");
    1960 return SCIP_INVALIDDATA;
    1961 }
    1963 {
    1964 SCIPerrorMessage("cannot add fixed or aggregated variables to transformed problem\n");
    1965 return SCIP_INVALIDDATA;
    1966 }
    1967 SCIP_CALL( SCIPprobAddVar(scip->transprob, scip->mem->probmem, scip->set, scip->lp,
    1968 scip->branchcand, scip->eventqueue, scip->eventfilter, var) );
    1969 return SCIP_OKAY;
    1970
    1971 default:
    1972 SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
    1973 return SCIP_INVALIDCALL;
    1974 } /*lint !e788*/
    1975}
    1976
    1977/** adds variable to the problem and uses it as pricing candidate to enter the LP
    1978 *
    1979 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
    1980 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
    1981 *
    1982 * @pre This method can only be called if @p scip is in stage \ref SCIP_STAGE_SOLVING
    1983 */
    1985 SCIP* scip, /**< SCIP data structure */
    1986 SCIP_VAR* var, /**< variable to add */
    1987 SCIP_Real score /**< pricing score of variable (the larger, the better the variable) */
    1988 )
    1989{
    1991
    1992 /* insert the negation variable x instead of the negated variable x' in x' = offset - x */
    1994 {
    1995 assert(SCIPvarGetNegationVar(var) != NULL);
    1997 return SCIP_OKAY;
    1998 }
    1999
    2000 /* add variable to problem if not yet inserted */
    2001 if( SCIPvarGetProbindex(var) == -1 )
    2002 {
    2003 /* check variable's status */
    2005 {
    2006 SCIPerrorMessage("cannot add original variables to transformed problem\n");
    2007 return SCIP_INVALIDDATA;
    2008 }
    2010 {
    2011 SCIPerrorMessage("cannot add fixed or aggregated variables to transformed problem\n");
    2012 return SCIP_INVALIDDATA;
    2013 }
    2014 SCIP_CALL( SCIPprobAddVar(scip->transprob, scip->mem->probmem, scip->set, scip->lp,
    2015 scip->branchcand, scip->eventqueue, scip->eventfilter, var) );
    2016 }
    2017
    2018 /* add variable to pricing storage */
    2019 SCIP_CALL( SCIPpricestoreAddVar(scip->pricestore, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp, var, score,
    2020 (SCIPtreeGetCurrentDepth(scip->tree) == 0)) );
    2021
    2022 return SCIP_OKAY;
    2023}
    2024
    2025/** removes variable from the problem
    2026 *
    2027 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
    2028 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
    2029 *
    2030 * @warning The variable is not deleted from the constraints when in SCIP_STAGE_PROBLEM. In this stage, it is the
    2031 * user's responsibility to ensure the variable has been removed from all constraints or the constraints
    2032 * deleted.
    2033 *
    2034 * @pre This method can be called if @p scip is in one of the following stages:
    2035 * - \ref SCIP_STAGE_PROBLEM
    2036 * - \ref SCIP_STAGE_TRANSFORMING
    2037 * - \ref SCIP_STAGE_TRANSFORMED
    2038 * - \ref SCIP_STAGE_PRESOLVING
    2039 * - \ref SCIP_STAGE_FREETRANS
    2040 */
    2042 SCIP* scip, /**< SCIP data structure */
    2043 SCIP_VAR* var, /**< variable to delete */
    2044 SCIP_Bool* deleted /**< pointer to store whether marking variable to be deleted was successful */
    2045 )
    2046{
    2047 assert(scip != NULL);
    2048 assert(var != NULL);
    2049 assert(deleted != NULL);
    2050
    2052
    2053 switch( scip->set->stage )
    2054 {
    2055 case SCIP_STAGE_PROBLEM:
    2057 {
    2058 SCIPerrorMessage("cannot remove transformed variables from original problem\n");
    2059 return SCIP_INVALIDDATA;
    2060 }
    2061 SCIP_CALL( SCIPprobDelVar(scip->origprob, scip->mem->probmem, scip->set, scip->eventqueue, var, deleted) );
    2062
    2063 /* delete the variables from the problems that were marked to be deleted */
    2064 SCIP_CALL( SCIPprobPerformVarDeletions(scip->origprob, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->cliquetable, scip->lp, scip->branchcand) );
    2065
    2066 return SCIP_OKAY;
    2067
    2071 /* check variable's status */
    2073 {
    2074 SCIPerrorMessage("cannot remove original variables from transformed problem\n");
    2075 return SCIP_INVALIDDATA;
    2076 }
    2078 {
    2079 SCIPerrorMessage("cannot remove fixed or aggregated variables from transformed problem\n");
    2080 return SCIP_INVALIDDATA;
    2081 }
    2082
    2083 SCIP_CALL( SCIPprobDelVar(scip->transprob, scip->mem->probmem, scip->set, scip->eventqueue, var, deleted) );
    2084
    2085 return SCIP_OKAY;
    2087 /* in FREETRANS stage, we don't need to remove the variable, because the transformed problem is freed anyways */
    2088 *deleted = FALSE;
    2089
    2090 return SCIP_OKAY;
    2091 default:
    2092 SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
    2093 return SCIP_INVALIDCALL;
    2094 } /*lint !e788*/
    2095}
    2096
    2097/** gets variables of the problem along with the numbers of different variable types; data may become invalid after
    2098 * calls to SCIPchgVarType(), SCIPfixVar(), SCIPaggregateVars(), and SCIPmultiaggregateVar()
    2099 *
    2100 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
    2101 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
    2102 *
    2103 * @pre This method can be called if @p scip is in one of the following stages:
    2104 * - \ref SCIP_STAGE_PROBLEM
    2105 * - \ref SCIP_STAGE_TRANSFORMED
    2106 * - \ref SCIP_STAGE_INITPRESOLVE
    2107 * - \ref SCIP_STAGE_PRESOLVING
    2108 * - \ref SCIP_STAGE_EXITPRESOLVE
    2109 * - \ref SCIP_STAGE_PRESOLVED
    2110 * - \ref SCIP_STAGE_INITSOLVE
    2111 * - \ref SCIP_STAGE_SOLVING
    2112 * - \ref SCIP_STAGE_SOLVED
    2113 * - \ref SCIP_STAGE_EXITSOLVE
    2114 */
    2116 SCIP* scip, /**< SCIP data structure */
    2117 SCIP_VAR*** vars, /**< pointer to store variables array or NULL if not needed */
    2118 int* nvars, /**< pointer to store number of variables or NULL if not needed */
    2119 int* nbinvars, /**< pointer to store number of binary variables or NULL if not needed */
    2120 int* nintvars, /**< pointer to store number of integer variables or NULL if not needed */
    2121 int* nimplvars, /**< pointer to store number of implied integral vars or NULL if not needed */
    2122 int* ncontvars /**< pointer to store number of continuous variables or NULL if not needed */
    2123 )
    2124{
    2125 SCIP_CALL( SCIPcheckStage(scip, "SCIPgetVarsData", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
    2126
    2127 switch( scip->set->stage )
    2128 {
    2129 case SCIP_STAGE_PROBLEM:
    2130 if( vars != NULL )
    2131 *vars = scip->origprob->vars;
    2132 if( nvars != NULL )
    2133 *nvars = scip->origprob->nvars;
    2134 if( nbinvars != NULL )
    2135 *nbinvars = scip->origprob->nbinvars;
    2136 if( nintvars != NULL )
    2137 *nintvars = scip->origprob->nintvars;
    2138 if( nimplvars != NULL )
    2139 *nimplvars = SCIPprobGetNImplVars(scip->origprob);
    2140 if( ncontvars != NULL )
    2141 *ncontvars = scip->origprob->ncontvars;
    2142 return SCIP_OKAY;
    2143
    2150 case SCIP_STAGE_SOLVING:
    2151 case SCIP_STAGE_SOLVED:
    2153 if( vars != NULL )
    2154 *vars = scip->transprob->vars;
    2155 if( nvars != NULL )
    2156 *nvars = scip->transprob->nvars;
    2157 if( nbinvars != NULL )
    2158 *nbinvars = scip->transprob->nbinvars;
    2159 if( nintvars != NULL )
    2160 *nintvars = scip->transprob->nintvars;
    2161 if( nimplvars != NULL )
    2162 *nimplvars = SCIPprobGetNImplVars(scip->transprob);
    2163 if( ncontvars != NULL )
    2164 *ncontvars = scip->transprob->ncontvars;
    2165 return SCIP_OKAY;
    2166
    2167 default:
    2168 SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
    2169 return SCIP_INVALIDCALL;
    2170 } /*lint !e788*/
    2171}
    2172
    2173/** gets array with active problem variables
    2174 *
    2175 * @return array with active problem variables
    2176 *
    2177 * @note Variables in the array are grouped in following order:
    2178 * - binaries
    2179 * - integers
    2180 * - implied integral binaries
    2181 * - implied integral integers
    2182 * - implied integral continuous
    2183 * - continuous
    2184 *
    2185 * @warning Modifying a variable status (e.g. with SCIPfixVar(), SCIPaggregateVars(), and SCIPmultiaggregateVar())
    2186 * or a variable type (e.g. with SCIPchgVarType() and SCIPchgVarImplType())
    2187 * may invalidate or resort the data array.
    2188 *
    2189 * @pre This method can be called if @p scip is in one of the following stages:
    2190 * - \ref SCIP_STAGE_PROBLEM
    2191 * - \ref SCIP_STAGE_TRANSFORMED
    2192 * - \ref SCIP_STAGE_INITPRESOLVE
    2193 * - \ref SCIP_STAGE_PRESOLVING
    2194 * - \ref SCIP_STAGE_EXITPRESOLVE
    2195 * - \ref SCIP_STAGE_PRESOLVED
    2196 * - \ref SCIP_STAGE_INITSOLVE
    2197 * - \ref SCIP_STAGE_SOLVING
    2198 * - \ref SCIP_STAGE_SOLVED
    2199 * - \ref SCIP_STAGE_EXITSOLVE
    2200 */
    2202 SCIP* scip /**< SCIP data structure */
    2203 )
    2204{
    2206
    2207 switch( scip->set->stage )
    2208 {
    2209 case SCIP_STAGE_PROBLEM:
    2210 return scip->origprob->vars;
    2211
    2218 case SCIP_STAGE_SOLVING:
    2219 case SCIP_STAGE_SOLVED:
    2221 return scip->transprob->vars;
    2222
    2223 default:
    2224 SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
    2225 SCIPABORT();
    2226 return NULL; /*lint !e527*/
    2227 } /*lint !e788*/
    2228}
    2229
    2230/** gets number of active problem variables
    2231 *
    2232 * @return the number of active problem variables
    2233 *
    2234 * @pre This method can be called if @p scip is in one of the following stages:
    2235 * - \ref SCIP_STAGE_PROBLEM
    2236 * - \ref SCIP_STAGE_TRANSFORMED
    2237 * - \ref SCIP_STAGE_INITPRESOLVE
    2238 * - \ref SCIP_STAGE_PRESOLVING
    2239 * - \ref SCIP_STAGE_EXITPRESOLVE
    2240 * - \ref SCIP_STAGE_PRESOLVED
    2241 * - \ref SCIP_STAGE_INITSOLVE
    2242 * - \ref SCIP_STAGE_SOLVING
    2243 * - \ref SCIP_STAGE_SOLVED
    2244 * - \ref SCIP_STAGE_EXITSOLVE
    2245 */
    2247 SCIP* scip /**< SCIP data structure */
    2248 )
    2249{
    2251
    2252 switch( scip->set->stage )
    2253 {
    2254 case SCIP_STAGE_PROBLEM:
    2255 return scip->origprob->nvars;
    2256
    2263 case SCIP_STAGE_SOLVING:
    2264 case SCIP_STAGE_SOLVED:
    2266 return scip->transprob->nvars;
    2267
    2268 default:
    2269 SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
    2270 SCIPABORT();
    2271 return 0; /*lint !e527*/
    2272 } /*lint !e788*/
    2273}
    2274
    2275/** gets number of binary active problem variables
    2276 *
    2277 * @return the number of binary active problem variables
    2278 *
    2279 * @note This function does not count binary variables which are implied integral.
    2280 *
    2281 * @pre This method can be called if @p scip is in one of the following stages:
    2282 * - \ref SCIP_STAGE_PROBLEM
    2283 * - \ref SCIP_STAGE_TRANSFORMED
    2284 * - \ref SCIP_STAGE_INITPRESOLVE
    2285 * - \ref SCIP_STAGE_PRESOLVING
    2286 * - \ref SCIP_STAGE_EXITPRESOLVE
    2287 * - \ref SCIP_STAGE_PRESOLVED
    2288 * - \ref SCIP_STAGE_INITSOLVE
    2289 * - \ref SCIP_STAGE_SOLVING
    2290 * - \ref SCIP_STAGE_SOLVED
    2291 * - \ref SCIP_STAGE_EXITSOLVE
    2292 */
    2294 SCIP* scip /**< SCIP data structure */
    2295 )
    2296{
    2298
    2299 switch( scip->set->stage )
    2300 {
    2301 case SCIP_STAGE_PROBLEM:
    2302 return scip->origprob->nbinvars;
    2303
    2310 case SCIP_STAGE_SOLVING:
    2311 case SCIP_STAGE_SOLVED:
    2313 return scip->transprob->nbinvars;
    2314
    2315 default:
    2316 SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
    2317 SCIPABORT();
    2318 return 0; /*lint !e527*/
    2319 } /*lint !e788*/
    2320}
    2321
    2322/** gets number of integer active problem variables
    2323 *
    2324 * @return the number of integer active problem variables
    2325 *
    2326 * @note This function does not count integer variables which are implied integral.
    2327 *
    2328 * @pre This method can be called if @p scip is in one of the following stages:
    2329 * - \ref SCIP_STAGE_PROBLEM
    2330 * - \ref SCIP_STAGE_TRANSFORMED
    2331 * - \ref SCIP_STAGE_INITPRESOLVE
    2332 * - \ref SCIP_STAGE_PRESOLVING
    2333 * - \ref SCIP_STAGE_EXITPRESOLVE
    2334 * - \ref SCIP_STAGE_PRESOLVED
    2335 * - \ref SCIP_STAGE_INITSOLVE
    2336 * - \ref SCIP_STAGE_SOLVING
    2337 * - \ref SCIP_STAGE_SOLVED
    2338 * - \ref SCIP_STAGE_EXITSOLVE
    2339 */
    2341 SCIP* scip /**< SCIP data structure */
    2342 )
    2343{
    2345
    2346 switch( scip->set->stage )
    2347 {
    2348 case SCIP_STAGE_PROBLEM:
    2349 return scip->origprob->nintvars;
    2350
    2357 case SCIP_STAGE_SOLVING:
    2358 case SCIP_STAGE_SOLVED:
    2360 return scip->transprob->nintvars;
    2361
    2362 default:
    2363 SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
    2364 SCIPABORT();
    2365 return 0; /*lint !e527*/
    2366 } /*lint !e788*/
    2367}
    2368
    2369/** gets number of implied integral active problem variables
    2370 *
    2371 * @return the number of implied integral active problem variables
    2372 *
    2373 * @note This function counts binary, integer, and continuous variables which are implied integral.
    2374 *
    2375 * @pre This method can be called if @p scip is in one of the following stages:
    2376 * - \ref SCIP_STAGE_PROBLEM
    2377 * - \ref SCIP_STAGE_TRANSFORMED
    2378 * - \ref SCIP_STAGE_INITPRESOLVE
    2379 * - \ref SCIP_STAGE_PRESOLVING
    2380 * - \ref SCIP_STAGE_EXITPRESOLVE
    2381 * - \ref SCIP_STAGE_PRESOLVED
    2382 * - \ref SCIP_STAGE_INITSOLVE
    2383 * - \ref SCIP_STAGE_SOLVING
    2384 * - \ref SCIP_STAGE_SOLVED
    2385 * - \ref SCIP_STAGE_EXITSOLVE
    2386 */
    2388 SCIP* scip /**< SCIP data structure */
    2389 )
    2390{
    2392
    2393 switch( scip->set->stage )
    2394 {
    2395 case SCIP_STAGE_PROBLEM:
    2396 return SCIPprobGetNImplVars(scip->origprob);
    2397
    2404 case SCIP_STAGE_SOLVING:
    2405 case SCIP_STAGE_SOLVED:
    2407 return SCIPprobGetNImplVars(scip->transprob);
    2408
    2409 default:
    2410 SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
    2411 SCIPABORT();
    2412 return 0; /*lint !e527*/
    2413 } /*lint !e788*/
    2414}
    2415
    2416/** gets number of binary implied integral active problem variables
    2417 *
    2418 * @return the number of binary implied integral active problem variables
    2419 *
    2420 * @pre This method can be called if @p scip is in one of the following stages:
    2421 * - \ref SCIP_STAGE_PROBLEM
    2422 * - \ref SCIP_STAGE_TRANSFORMED
    2423 * - \ref SCIP_STAGE_INITPRESOLVE
    2424 * - \ref SCIP_STAGE_PRESOLVING
    2425 * - \ref SCIP_STAGE_EXITPRESOLVE
    2426 * - \ref SCIP_STAGE_PRESOLVED
    2427 * - \ref SCIP_STAGE_INITSOLVE
    2428 * - \ref SCIP_STAGE_SOLVING
    2429 * - \ref SCIP_STAGE_SOLVED
    2430 * - \ref SCIP_STAGE_EXITSOLVE
    2431 */
    2433 SCIP* scip /**< SCIP data structure */
    2434 )
    2435{
    2436 SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNBinImplVars", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
    2437
    2438 switch( scip->set->stage )
    2439 {
    2440 case SCIP_STAGE_PROBLEM:
    2441 return scip->origprob->nbinimplvars;
    2442
    2449 case SCIP_STAGE_SOLVING:
    2450 case SCIP_STAGE_SOLVED:
    2452 return scip->transprob->nbinimplvars;
    2453
    2454 default:
    2455 SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
    2456 SCIPABORT();
    2457 return 0; /*lint !e527*/
    2458 } /*lint !e788*/
    2459}
    2460
    2461/** gets number of integer implied integral active problem variables
    2462 *
    2463 * @return the number of integer implied integral active problem variables
    2464 *
    2465 * @pre This method can be called if @p scip is in one of the following stages:
    2466 * - \ref SCIP_STAGE_PROBLEM
    2467 * - \ref SCIP_STAGE_TRANSFORMED
    2468 * - \ref SCIP_STAGE_INITPRESOLVE
    2469 * - \ref SCIP_STAGE_PRESOLVING
    2470 * - \ref SCIP_STAGE_EXITPRESOLVE
    2471 * - \ref SCIP_STAGE_PRESOLVED
    2472 * - \ref SCIP_STAGE_INITSOLVE
    2473 * - \ref SCIP_STAGE_SOLVING
    2474 * - \ref SCIP_STAGE_SOLVED
    2475 * - \ref SCIP_STAGE_EXITSOLVE
    2476 */
    2478 SCIP* scip /**< SCIP data structure */
    2479 )
    2480{
    2481 SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNIntImplVars", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
    2482
    2483 switch( scip->set->stage )
    2484 {
    2485 case SCIP_STAGE_PROBLEM:
    2486 return scip->origprob->nintimplvars;
    2487
    2494 case SCIP_STAGE_SOLVING:
    2495 case SCIP_STAGE_SOLVED:
    2497 return scip->transprob->nintimplvars;
    2498
    2499 default:
    2500 SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
    2501 SCIPABORT();
    2502 return 0; /*lint !e527*/
    2503 } /*lint !e788*/
    2504}
    2505
    2506/** gets number of continuous implied integral active problem variables
    2507 *
    2508 * @return the number of continuous implied integral active problem variables
    2509 *
    2510 * @pre This method can be called if @p scip is in one of the following stages:
    2511 * - \ref SCIP_STAGE_PROBLEM
    2512 * - \ref SCIP_STAGE_TRANSFORMED
    2513 * - \ref SCIP_STAGE_INITPRESOLVE
    2514 * - \ref SCIP_STAGE_PRESOLVING
    2515 * - \ref SCIP_STAGE_EXITPRESOLVE
    2516 * - \ref SCIP_STAGE_PRESOLVED
    2517 * - \ref SCIP_STAGE_INITSOLVE
    2518 * - \ref SCIP_STAGE_SOLVING
    2519 * - \ref SCIP_STAGE_SOLVED
    2520 * - \ref SCIP_STAGE_EXITSOLVE
    2521 */
    2523 SCIP* scip /**< SCIP data structure */
    2524 )
    2525{
    2526 SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNContImplVars", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
    2527
    2528 switch( scip->set->stage )
    2529 {
    2530 case SCIP_STAGE_PROBLEM:
    2531 return scip->origprob->ncontimplvars;
    2532
    2539 case SCIP_STAGE_SOLVING:
    2540 case SCIP_STAGE_SOLVED:
    2542 return scip->transprob->ncontimplvars;
    2543
    2544 default:
    2545 SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
    2546 SCIPABORT();
    2547 return 0; /*lint !e527*/
    2548 } /*lint !e788*/
    2549}
    2550
    2551/** gets number of continuous active problem variables
    2552 *
    2553 * @return the number of continuous active problem variables
    2554 *
    2555 * @note This function does not count continuous variables which are implied integral.
    2556 *
    2557 * @pre This method can be called if @p scip is in one of the following stages:
    2558 * - \ref SCIP_STAGE_PROBLEM
    2559 * - \ref SCIP_STAGE_TRANSFORMED
    2560 * - \ref SCIP_STAGE_INITPRESOLVE
    2561 * - \ref SCIP_STAGE_PRESOLVING
    2562 * - \ref SCIP_STAGE_EXITPRESOLVE
    2563 * - \ref SCIP_STAGE_PRESOLVED
    2564 * - \ref SCIP_STAGE_INITSOLVE
    2565 * - \ref SCIP_STAGE_SOLVING
    2566 * - \ref SCIP_STAGE_SOLVED
    2567 * - \ref SCIP_STAGE_EXITSOLVE
    2568 */
    2570 SCIP* scip /**< SCIP data structure */
    2571 )
    2572{
    2574
    2575 switch( scip->set->stage )
    2576 {
    2577 case SCIP_STAGE_PROBLEM:
    2578 return scip->origprob->ncontvars;
    2579
    2586 case SCIP_STAGE_SOLVING:
    2587 case SCIP_STAGE_SOLVED:
    2589 return scip->transprob->ncontvars;
    2590
    2591 default:
    2592 SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
    2593 SCIPABORT();
    2594 return 0; /*lint !e527*/
    2595 } /*lint !e788*/
    2596}
    2597
    2598/** gets number of active problem variables with a non-zero objective coefficient
    2599 *
    2600 * @note In case of the original problem the number of variables is counted. In case of the transformed problem the
    2601 * number of variables is just returned since it is stored internally
    2602 *
    2603 * @return the number of active problem variables with a non-zero objective coefficient
    2604 *
    2605 * @pre This method can be called if @p scip is in one of the following stages:
    2606 * - \ref SCIP_STAGE_PROBLEM
    2607 * - \ref SCIP_STAGE_TRANSFORMED
    2608 * - \ref SCIP_STAGE_INITPRESOLVE
    2609 * - \ref SCIP_STAGE_PRESOLVING
    2610 * - \ref SCIP_STAGE_EXITPRESOLVE
    2611 * - \ref SCIP_STAGE_PRESOLVED
    2612 * - \ref SCIP_STAGE_INITSOLVE
    2613 * - \ref SCIP_STAGE_SOLVING
    2614 * - \ref SCIP_STAGE_SOLVED
    2615 */
    2617 SCIP* scip /**< SCIP data structure */
    2618 )
    2619{
    2621
    2622 switch( scip->set->stage )
    2623 {
    2624 case SCIP_STAGE_PROBLEM:
    2625 return SCIPprobGetNObjVars(scip->origprob, scip->set);
    2626
    2633 case SCIP_STAGE_SOLVING:
    2634 case SCIP_STAGE_SOLVED:
    2635 return SCIPprobGetNObjVars(scip->transprob, scip->set);
    2636
    2637 default:
    2638 SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
    2639 SCIPABORT();
    2640 return 0; /*lint !e527*/
    2641 } /*lint !e788*/
    2642}
    2643
    2644
    2645/** gets array with fixed and aggregated problem variables; data may become invalid after
    2646 * calls to SCIPfixVar(), SCIPaggregateVars(), and SCIPmultiaggregateVar()
    2647 *
    2648 * @return an array with fixed and aggregated problem variables; data may become invalid after
    2649 * calls to SCIPfixVar(), SCIPaggregateVars(), and SCIPmultiaggregateVar()
    2650 *
    2651 * @pre This method can be called if @p scip is in one of the following stages:
    2652 * - \ref SCIP_STAGE_PROBLEM
    2653 * - \ref SCIP_STAGE_TRANSFORMED
    2654 * - \ref SCIP_STAGE_INITPRESOLVE
    2655 * - \ref SCIP_STAGE_PRESOLVING
    2656 * - \ref SCIP_STAGE_EXITPRESOLVE
    2657 * - \ref SCIP_STAGE_PRESOLVED
    2658 * - \ref SCIP_STAGE_INITSOLVE
    2659 * - \ref SCIP_STAGE_SOLVING
    2660 * - \ref SCIP_STAGE_SOLVED
    2661 */
    2663 SCIP* scip /**< SCIP data structure */
    2664 )
    2665{
    2667
    2668 switch( scip->set->stage )
    2669 {
    2670 case SCIP_STAGE_PROBLEM:
    2671 return NULL;
    2672
    2679 case SCIP_STAGE_SOLVING:
    2680 case SCIP_STAGE_SOLVED:
    2681 return scip->transprob->fixedvars;
    2682
    2683 default:
    2684 SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
    2685 SCIPABORT();
    2686 return NULL; /*lint !e527*/
    2687 } /*lint !e788*/
    2688}
    2689
    2690/** gets number of fixed or aggregated problem variables
    2691 *
    2692 * @return the number of fixed or aggregated problem variables
    2693 *
    2694 * @pre This method can be called if @p scip is in one of the following stages:
    2695 * - \ref SCIP_STAGE_PROBLEM
    2696 * - \ref SCIP_STAGE_TRANSFORMED
    2697 * - \ref SCIP_STAGE_INITPRESOLVE
    2698 * - \ref SCIP_STAGE_PRESOLVING
    2699 * - \ref SCIP_STAGE_EXITPRESOLVE
    2700 * - \ref SCIP_STAGE_PRESOLVED
    2701 * - \ref SCIP_STAGE_INITSOLVE
    2702 * - \ref SCIP_STAGE_SOLVING
    2703 * - \ref SCIP_STAGE_SOLVED
    2704 */
    2706 SCIP* scip /**< SCIP data structure */
    2707 )
    2708{
    2710
    2711 switch( scip->set->stage )
    2712 {
    2713 case SCIP_STAGE_PROBLEM:
    2714 return 0;
    2715
    2722 case SCIP_STAGE_SOLVING:
    2723 case SCIP_STAGE_SOLVED:
    2724 return scip->transprob->nfixedvars;
    2725
    2726 default:
    2727 SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
    2728 SCIPABORT();
    2729 return 0; /*lint !e527*/
    2730 } /*lint !e788*/
    2731}
    2732
    2733/** gets variables of the original problem along with the numbers of different variable types; data may become invalid
    2734 * after a call to SCIPchgVarType()
    2735 *
    2736 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
    2737 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
    2738 *
    2739 * @pre This method can be called if @p scip is in one of the following stages:
    2740 * - \ref SCIP_STAGE_PROBLEM
    2741 * - \ref SCIP_STAGE_TRANSFORMING
    2742 * - \ref SCIP_STAGE_TRANSFORMED
    2743 * - \ref SCIP_STAGE_INITPRESOLVE
    2744 * - \ref SCIP_STAGE_PRESOLVING
    2745 * - \ref SCIP_STAGE_EXITPRESOLVE
    2746 * - \ref SCIP_STAGE_PRESOLVED
    2747 * - \ref SCIP_STAGE_INITSOLVE
    2748 * - \ref SCIP_STAGE_SOLVING
    2749 * - \ref SCIP_STAGE_SOLVED
    2750 * - \ref SCIP_STAGE_EXITSOLVE
    2751 * - \ref SCIP_STAGE_FREETRANS
    2752 */
    2754 SCIP* scip, /**< SCIP data structure */
    2755 SCIP_VAR*** vars, /**< pointer to store variables array or NULL if not needed */
    2756 int* nvars, /**< pointer to store number of variables or NULL if not needed */
    2757 int* nbinvars, /**< pointer to store number of binary variables or NULL if not needed */
    2758 int* nintvars, /**< pointer to store number of integer variables or NULL if not needed */
    2759 int* nimplvars, /**< pointer to store number of implied integral vars or NULL if not needed */
    2760 int* ncontvars /**< pointer to store number of continuous variables or NULL if not needed */
    2761 )
    2762{
    2763 SCIP_CALL( SCIPcheckStage(scip, "SCIPgetOrigVarsData", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
    2764
    2765 if( vars != NULL )
    2766 *vars = scip->origprob->vars;
    2767 if( nvars != NULL )
    2768 *nvars = scip->origprob->nvars;
    2769 if( nbinvars != NULL )
    2770 *nbinvars = scip->origprob->nbinvars;
    2771 if( nintvars != NULL )
    2772 *nintvars = scip->origprob->nintvars;
    2773 if( nimplvars != NULL )
    2774 *nimplvars = SCIPprobGetNImplVars(scip->origprob);
    2775 if( ncontvars != NULL )
    2776 *ncontvars = scip->origprob->ncontvars;
    2777
    2778 return SCIP_OKAY;
    2779}
    2780
    2781/** gets array with original problem variables
    2782 *
    2783 * @return array with original problem variables
    2784 *
    2785 * @note Variables in the array are grouped in following order:
    2786 * - binaries
    2787 * - integers
    2788 * - implied integral binaries
    2789 * - implied integral integers
    2790 * - implied integral continuous
    2791 * - continuous
    2792 *
    2793 * @warning Modifying the variable number (e.g. with SCIPaddVar() and SCIPdelVar())
    2794 * or a variable type (e.g. with SCIPchgVarType() and SCIPchgVarImplType())
    2795 * may invalidate or resort the data array.
    2796 *
    2797 * @pre This method can be called if @p scip is in one of the following stages:
    2798 * - \ref SCIP_STAGE_PROBLEM
    2799 * - \ref SCIP_STAGE_TRANSFORMING
    2800 * - \ref SCIP_STAGE_TRANSFORMED
    2801 * - \ref SCIP_STAGE_INITPRESOLVE
    2802 * - \ref SCIP_STAGE_PRESOLVING
    2803 * - \ref SCIP_STAGE_EXITPRESOLVE
    2804 * - \ref SCIP_STAGE_PRESOLVED
    2805 * - \ref SCIP_STAGE_INITSOLVE
    2806 * - \ref SCIP_STAGE_SOLVING
    2807 * - \ref SCIP_STAGE_SOLVED
    2808 * - \ref SCIP_STAGE_EXITSOLVE
    2809 * - \ref SCIP_STAGE_FREETRANS
    2810 */
    2812 SCIP* scip /**< SCIP data structure */
    2813 )
    2814{
    2816
    2817 return scip->origprob->vars;
    2818}
    2819
    2820/** gets number of original problem variables
    2821 *
    2822 * @return the number of original problem variables
    2823 *
    2824 * @pre This method can be called if @p scip is in one of the following stages:
    2825 * - \ref SCIP_STAGE_PROBLEM
    2826 * - \ref SCIP_STAGE_TRANSFORMING
    2827 * - \ref SCIP_STAGE_TRANSFORMED
    2828 * - \ref SCIP_STAGE_INITPRESOLVE
    2829 * - \ref SCIP_STAGE_PRESOLVING
    2830 * - \ref SCIP_STAGE_EXITPRESOLVE
    2831 * - \ref SCIP_STAGE_PRESOLVED
    2832 * - \ref SCIP_STAGE_INITSOLVE
    2833 * - \ref SCIP_STAGE_SOLVING
    2834 * - \ref SCIP_STAGE_SOLVED
    2835 * - \ref SCIP_STAGE_EXITSOLVE
    2836 * - \ref SCIP_STAGE_FREETRANS
    2837 */
    2839 SCIP* scip /**< SCIP data structure */
    2840 )
    2841{
    2842 SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNOrigVars", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
    2843
    2844 return scip->origprob->nvars;
    2845}
    2846
    2847/** gets number of binary variables in the original problem
    2848 *
    2849 * @return the number of binary variables in the original problem
    2850 *
    2851 * @note This function does not count binary variables which are implied integral.
    2852 *
    2853 * @pre This method can be called if @p scip is in one of the following stages:
    2854 * - \ref SCIP_STAGE_PROBLEM
    2855 * - \ref SCIP_STAGE_TRANSFORMING
    2856 * - \ref SCIP_STAGE_TRANSFORMED
    2857 * - \ref SCIP_STAGE_INITPRESOLVE
    2858 * - \ref SCIP_STAGE_PRESOLVING
    2859 * - \ref SCIP_STAGE_EXITPRESOLVE
    2860 * - \ref SCIP_STAGE_PRESOLVED
    2861 * - \ref SCIP_STAGE_INITSOLVE
    2862 * - \ref SCIP_STAGE_SOLVING
    2863 * - \ref SCIP_STAGE_SOLVED
    2864 * - \ref SCIP_STAGE_EXITSOLVE
    2865 * - \ref SCIP_STAGE_FREETRANS
    2866 */
    2868 SCIP* scip /**< SCIP data structure */
    2869 )
    2870{
    2871 SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNOrigBinVars", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
    2872
    2873 return scip->origprob->nbinvars;
    2874}
    2875
    2876/** gets the number of integer variables in the original problem
    2877 *
    2878 * @return the number of integer variables in the original problem
    2879 *
    2880 * @note This function does not count integer variables which are implied integral.
    2881 *
    2882 * @pre This method can be called if @p scip is in one of the following stages:
    2883 * - \ref SCIP_STAGE_PROBLEM
    2884 * - \ref SCIP_STAGE_TRANSFORMING
    2885 * - \ref SCIP_STAGE_TRANSFORMED
    2886 * - \ref SCIP_STAGE_INITPRESOLVE
    2887 * - \ref SCIP_STAGE_PRESOLVING
    2888 * - \ref SCIP_STAGE_EXITPRESOLVE
    2889 * - \ref SCIP_STAGE_PRESOLVED
    2890 * - \ref SCIP_STAGE_INITSOLVE
    2891 * - \ref SCIP_STAGE_SOLVING
    2892 * - \ref SCIP_STAGE_SOLVED
    2893 * - \ref SCIP_STAGE_EXITSOLVE
    2894 * - \ref SCIP_STAGE_FREETRANS
    2895 */
    2897 SCIP* scip /**< SCIP data structure */
    2898 )
    2899{
    2900 SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNOrigIntVars", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
    2901
    2902 return scip->origprob->nintvars;
    2903}
    2904
    2905/** gets number of implied integral variables in the original problem
    2906 *
    2907 * @return the number of implied integral variables in the original problem
    2908 *
    2909 * @note This function counts binary, integer, and continuous variables which are implied integral.
    2910 *
    2911 * @pre This method can be called if @p scip is in one of the following stages:
    2912 * - \ref SCIP_STAGE_PROBLEM
    2913 * - \ref SCIP_STAGE_TRANSFORMING
    2914 * - \ref SCIP_STAGE_TRANSFORMED
    2915 * - \ref SCIP_STAGE_INITPRESOLVE
    2916 * - \ref SCIP_STAGE_PRESOLVING
    2917 * - \ref SCIP_STAGE_EXITPRESOLVE
    2918 * - \ref SCIP_STAGE_PRESOLVED
    2919 * - \ref SCIP_STAGE_INITSOLVE
    2920 * - \ref SCIP_STAGE_SOLVING
    2921 * - \ref SCIP_STAGE_SOLVED
    2922 * - \ref SCIP_STAGE_EXITSOLVE
    2923 * - \ref SCIP_STAGE_FREETRANS
    2924 */
    2926 SCIP* scip /**< SCIP data structure */
    2927 )
    2928{
    2929 SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNOrigImplVars", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
    2930
    2931 return SCIPprobGetNImplVars(scip->origprob);
    2932}
    2933
    2934/** gets number of binary implied integral variables in the original problem
    2935 *
    2936 * @return the number of binary implied integral variables in the original problem
    2937 *
    2938 * @pre This method can be called if @p scip is in one of the following stages:
    2939 * - \ref SCIP_STAGE_PROBLEM
    2940 * - \ref SCIP_STAGE_TRANSFORMING
    2941 * - \ref SCIP_STAGE_TRANSFORMED
    2942 * - \ref SCIP_STAGE_INITPRESOLVE
    2943 * - \ref SCIP_STAGE_PRESOLVING
    2944 * - \ref SCIP_STAGE_EXITPRESOLVE
    2945 * - \ref SCIP_STAGE_PRESOLVED
    2946 * - \ref SCIP_STAGE_INITSOLVE
    2947 * - \ref SCIP_STAGE_SOLVING
    2948 * - \ref SCIP_STAGE_SOLVED
    2949 * - \ref SCIP_STAGE_EXITSOLVE
    2950 * - \ref SCIP_STAGE_FREETRANS
    2951 */
    2953 SCIP* scip /**< SCIP data structure */
    2954 )
    2955{
    2956 SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNOrigBinImplVars", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
    2957
    2958 return scip->origprob->nbinimplvars;
    2959}
    2960
    2961/** gets number of integer implied integral variables in the original problem
    2962 *
    2963 * @return the number of integer implied integral variables in the original problem
    2964 *
    2965 * @pre This method can be called if @p scip is in one of the following stages:
    2966 * - \ref SCIP_STAGE_PROBLEM
    2967 * - \ref SCIP_STAGE_TRANSFORMING
    2968 * - \ref SCIP_STAGE_TRANSFORMED
    2969 * - \ref SCIP_STAGE_INITPRESOLVE
    2970 * - \ref SCIP_STAGE_PRESOLVING
    2971 * - \ref SCIP_STAGE_EXITPRESOLVE
    2972 * - \ref SCIP_STAGE_PRESOLVED
    2973 * - \ref SCIP_STAGE_INITSOLVE
    2974 * - \ref SCIP_STAGE_SOLVING
    2975 * - \ref SCIP_STAGE_SOLVED
    2976 * - \ref SCIP_STAGE_EXITSOLVE
    2977 * - \ref SCIP_STAGE_FREETRANS
    2978 */
    2980 SCIP* scip /**< SCIP data structure */
    2981 )
    2982{
    2983 SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNOrigIntImplVars", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
    2984
    2985 return scip->origprob->nintimplvars;
    2986}
    2987
    2988/** gets number of continuous implied integral variables in the original problem
    2989 *
    2990 * @return the number of continuous implied integral variables in the original problem
    2991 *
    2992 * @pre This method can be called if @p scip is in one of the following stages:
    2993 * - \ref SCIP_STAGE_PROBLEM
    2994 * - \ref SCIP_STAGE_TRANSFORMING
    2995 * - \ref SCIP_STAGE_TRANSFORMED
    2996 * - \ref SCIP_STAGE_INITPRESOLVE
    2997 * - \ref SCIP_STAGE_PRESOLVING
    2998 * - \ref SCIP_STAGE_EXITPRESOLVE
    2999 * - \ref SCIP_STAGE_PRESOLVED
    3000 * - \ref SCIP_STAGE_INITSOLVE
    3001 * - \ref SCIP_STAGE_SOLVING
    3002 * - \ref SCIP_STAGE_SOLVED
    3003 * - \ref SCIP_STAGE_EXITSOLVE
    3004 * - \ref SCIP_STAGE_FREETRANS
    3005 */
    3007 SCIP* scip /**< SCIP data structure */
    3008 )
    3009{
    3010 SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNOrigContImplVars", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
    3011
    3012 return scip->origprob->ncontimplvars;
    3013}
    3014
    3015/** gets number of continuous variables in the original problem
    3016 *
    3017 * @return the number of continuous variables in the original problem
    3018 *
    3019 * @note This function does not count continuous variables which are implied integral.
    3020 *
    3021 * @pre This method can be called if @p scip is in one of the following stages:
    3022 * - \ref SCIP_STAGE_PROBLEM
    3023 * - \ref SCIP_STAGE_TRANSFORMING
    3024 * - \ref SCIP_STAGE_TRANSFORMED
    3025 * - \ref SCIP_STAGE_INITPRESOLVE
    3026 * - \ref SCIP_STAGE_PRESOLVING
    3027 * - \ref SCIP_STAGE_EXITPRESOLVE
    3028 * - \ref SCIP_STAGE_PRESOLVED
    3029 * - \ref SCIP_STAGE_INITSOLVE
    3030 * - \ref SCIP_STAGE_SOLVING
    3031 * - \ref SCIP_STAGE_SOLVED
    3032 * - \ref SCIP_STAGE_EXITSOLVE
    3033 * - \ref SCIP_STAGE_FREETRANS
    3034 */
    3036 SCIP* scip /**< SCIP data structure */
    3037 )
    3038{
    3039 SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNOrigContVars", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
    3040
    3041 return scip->origprob->ncontvars;
    3042}
    3043
    3044/** gets number of all problem variables created during creation and solving of problem;
    3045 * this includes also variables that were deleted in the meantime
    3046 *
    3047 * @return the number of all problem variables created during creation and solving of problem;
    3048 * this includes also variables that were deleted in the meantime
    3049 *
    3050 * @pre This method can be called if @p scip is in one of the following stages:
    3051 * - \ref SCIP_STAGE_PROBLEM
    3052 * - \ref SCIP_STAGE_TRANSFORMING
    3053 * - \ref SCIP_STAGE_TRANSFORMED
    3054 * - \ref SCIP_STAGE_INITPRESOLVE
    3055 * - \ref SCIP_STAGE_PRESOLVING
    3056 * - \ref SCIP_STAGE_EXITPRESOLVE
    3057 * - \ref SCIP_STAGE_PRESOLVED
    3058 * - \ref SCIP_STAGE_INITSOLVE
    3059 * - \ref SCIP_STAGE_SOLVING
    3060 * - \ref SCIP_STAGE_SOLVED
    3061 * - \ref SCIP_STAGE_EXITSOLVE
    3062 * - \ref SCIP_STAGE_FREETRANS
    3063 */
    3065 SCIP* scip /**< SCIP data structure */
    3066 )
    3067{
    3068 SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNTotalVars", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
    3069
    3070 assert(scip->stat != NULL);
    3071
    3072 switch( scip->set->stage )
    3073 {
    3074 case SCIP_STAGE_PROBLEM:
    3082 case SCIP_STAGE_SOLVING:
    3083 case SCIP_STAGE_SOLVED:
    3086 return scip->stat->nvaridx;
    3087
    3088 default:
    3089 SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
    3090 SCIPABORT();
    3091 return 0; /*lint !e527*/
    3092 } /*lint !e788*/
    3093}
    3094
    3095/** gets variables of the original or transformed problem along with the numbers of different variable types;
    3096 * the returned problem space (original or transformed) corresponds to the given solution;
    3097 * data may become invalid after calls to SCIPchgVarType(), SCIPfixVar(), SCIPaggregateVars(), and
    3098 * SCIPmultiaggregateVar()
    3099 *
    3100 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
    3101 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
    3102 *
    3103 * @pre This method can be called if @p scip is in one of the following stages:
    3104 * - \ref SCIP_STAGE_PROBLEM
    3105 * - \ref SCIP_STAGE_TRANSFORMED
    3106 * - \ref SCIP_STAGE_INITPRESOLVE
    3107 * - \ref SCIP_STAGE_PRESOLVING
    3108 * - \ref SCIP_STAGE_EXITPRESOLVE
    3109 * - \ref SCIP_STAGE_PRESOLVED
    3110 * - \ref SCIP_STAGE_INITSOLVE
    3111 * - \ref SCIP_STAGE_SOLVING
    3112 * - \ref SCIP_STAGE_SOLVED
    3113 */
    3115 SCIP* scip, /**< SCIP data structure */
    3116 SCIP_SOL* sol, /**< primal solution that selects the problem space, NULL for current solution */
    3117 SCIP_VAR*** vars, /**< pointer to store variables array or NULL if not needed */
    3118 int* nvars, /**< pointer to store number of variables or NULL if not needed */
    3119 int* nbinvars, /**< pointer to store number of binary variables or NULL if not needed */
    3120 int* nintvars, /**< pointer to store number of integer variables or NULL if not needed */
    3121 int* nbinimplvars, /**< pointer to store number of binary implied integral vars or NULL if not needed */
    3122 int* nintimplvars, /**< pointer to store number of integer implied integral vars or NULL if not needed */
    3123 int* ncontimplvars, /**< pointer to store number of continuous implied integral vars or NULL if not needed */
    3124 int* ncontvars /**< pointer to store number of continuous variables or NULL if not needed */
    3125 )
    3126{
    3127 SCIP_CALL( SCIPcheckStage(scip, "SCIPgetSolVarsData", FALSE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE) );
    3128
    3129 if( scip->set->stage == SCIP_STAGE_PROBLEM || (sol != NULL && SCIPsolIsOriginal(sol)) )
    3130 {
    3131 if( vars != NULL )
    3132 *vars = scip->origprob->vars;
    3133 if( nvars != NULL )
    3134 *nvars = scip->origprob->nvars;
    3135 if( nbinvars != NULL )
    3136 *nbinvars = scip->origprob->nbinvars;
    3137 if( nintvars != NULL )
    3138 *nintvars = scip->origprob->nintvars;
    3139 if( nbinimplvars != NULL )
    3140 *nbinimplvars = scip->origprob->nbinimplvars;
    3141 if( nintimplvars != NULL )
    3142 *nintimplvars = scip->origprob->nintimplvars;
    3143 if( ncontimplvars != NULL )
    3144 *ncontimplvars = scip->origprob->ncontimplvars;
    3145 if( ncontvars != NULL )
    3146 *ncontvars = scip->origprob->ncontvars;
    3147 }
    3148 else
    3149 {
    3150 if( vars != NULL )
    3151 *vars = scip->transprob->vars;
    3152 if( nvars != NULL )
    3153 *nvars = scip->transprob->nvars;
    3154 if( nbinvars != NULL )
    3155 *nbinvars = scip->transprob->nbinvars;
    3156 if( nintvars != NULL )
    3157 *nintvars = scip->transprob->nintvars;
    3158 if( nbinimplvars != NULL )
    3159 *nbinimplvars = scip->transprob->nbinimplvars;
    3160 if( nintimplvars != NULL )
    3161 *nintimplvars = scip->transprob->nintimplvars;
    3162 if( ncontimplvars != NULL )
    3163 *ncontimplvars = scip->transprob->ncontimplvars;
    3164 if( ncontvars != NULL )
    3165 *ncontvars = scip->transprob->ncontvars;
    3166 }
    3167
    3168 return SCIP_OKAY;
    3169}
    3170
    3171/** returns variable of given name in the problem, or NULL if not existing
    3172 *
    3173 * @return variable of given name in the problem, or NULL if not existing
    3174 *
    3175 * @pre This method can be called if @p scip is in one of the following stages:
    3176 * - \ref SCIP_STAGE_PROBLEM
    3177 * - \ref SCIP_STAGE_TRANSFORMING
    3178 * - \ref SCIP_STAGE_TRANSFORMED
    3179 * - \ref SCIP_STAGE_INITPRESOLVE
    3180 * - \ref SCIP_STAGE_PRESOLVING
    3181 * - \ref SCIP_STAGE_EXITPRESOLVE
    3182 * - \ref SCIP_STAGE_PRESOLVED
    3183 * - \ref SCIP_STAGE_INITSOLVE
    3184 * - \ref SCIP_STAGE_SOLVING
    3185 * - \ref SCIP_STAGE_SOLVED
    3186 * - \ref SCIP_STAGE_EXITSOLVE
    3187 * - \ref SCIP_STAGE_FREETRANS
    3188 */
    3190 SCIP* scip, /**< SCIP data structure */
    3191 const char* name /**< name of variable to find */
    3192 )
    3193{
    3194 SCIP_VAR* var;
    3195
    3196 assert(name != NULL);
    3197
    3199
    3200 switch( scip->set->stage )
    3201 {
    3202 case SCIP_STAGE_PROBLEM:
    3203 return SCIPprobFindVar(scip->origprob, name);
    3204
    3212 case SCIP_STAGE_SOLVING:
    3213 case SCIP_STAGE_SOLVED:
    3216 var = SCIPprobFindVar(scip->transprob, name);
    3217 if( var == NULL )
    3218 return SCIPprobFindVar(scip->origprob, name);
    3219 else
    3220 return var;
    3221
    3222 default:
    3223 SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
    3224 SCIPABORT();
    3225 return NULL; /*lint !e527*/
    3226 } /*lint !e788*/
    3227}
    3228
    3229/** returns TRUE iff all potential variables exist in the problem, and FALSE, if there may be additional variables,
    3230 * that will be added in pricing and improve the objective value
    3231 *
    3232 * @return TRUE, if all potential variables exist in the problem; FALSE, otherwise
    3233 *
    3234 * @pre This method can be called if @p scip is in one of the following stages:
    3235 * - \ref SCIP_STAGE_TRANSFORMING
    3236 * - \ref SCIP_STAGE_TRANSFORMED
    3237 * - \ref SCIP_STAGE_INITPRESOLVE
    3238 * - \ref SCIP_STAGE_PRESOLVING
    3239 * - \ref SCIP_STAGE_EXITPRESOLVE
    3240 * - \ref SCIP_STAGE_PRESOLVED
    3241 * - \ref SCIP_STAGE_INITSOLVE
    3242 * - \ref SCIP_STAGE_SOLVING
    3243 * - \ref SCIP_STAGE_SOLVED
    3244 * - \ref SCIP_STAGE_EXITSOLVE
    3245 * - \ref SCIP_STAGE_FREETRANS
    3246 */
    3248 SCIP* scip /**< SCIP data structure */
    3249 )
    3250{
    3251 SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPallVarsInProb", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
    3252
    3253 return (scip->set->nactivepricers == 0);
    3254}
    3255
    3256/** adds constraint to the problem; if constraint is only valid locally, it is added to the local subproblem of the
    3257 * current node (and all of its subnodes); otherwise it is added to the global problem;
    3258 * if a local constraint is added at the root node, it is automatically upgraded into a global constraint
    3259 *
    3260 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
    3261 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
    3262 *
    3263 * @pre This method can be called if @p scip is in one of the following stages:
    3264 * - \ref SCIP_STAGE_PROBLEM
    3265 * - \ref SCIP_STAGE_TRANSFORMED
    3266 * - \ref SCIP_STAGE_INITPRESOLVE
    3267 * - \ref SCIP_STAGE_PRESOLVING
    3268 * - \ref SCIP_STAGE_EXITPRESOLVE
    3269 * - \ref SCIP_STAGE_PRESOLVED
    3270 * - \ref SCIP_STAGE_INITSOLVE
    3271 * - \ref SCIP_STAGE_SOLVING
    3272 * - \ref SCIP_STAGE_EXITSOLVE
    3273 */
    3275 SCIP* scip, /**< SCIP data structure */
    3276 SCIP_CONS* cons /**< constraint to add */
    3277 )
    3278{
    3279 SCIP_Bool isconsexact;
    3280
    3281 assert(cons != NULL);
    3282
    3284
    3285 /* exact constraints should be added if and only if exact solving is turned on */
    3286 isconsexact = SCIPconshdlrIsExact((SCIPconsGetHdlr(cons)));
    3287 if( SCIPisExact(scip) && !isconsexact )
    3288 {
    3289 SCIPerrorMessage("cannot add inexact constraint while exact solving is enabled\n");
    3290 return SCIP_INVALIDDATA;
    3291 }
    3292 else if( !SCIPisExact(scip) && isconsexact )
    3293 {
    3294 SCIPerrorMessage("cannot add exact constraint while exact solving is disabled\n");
    3295 return SCIP_INVALIDDATA;
    3296 }
    3297
    3298 switch( scip->set->stage )
    3299 {
    3300 case SCIP_STAGE_PROBLEM:
    3301 {
    3302 SCIP_CALL( SCIPprobAddCons(scip->origprob, scip->set, scip->stat, cons) );
    3303
    3304 if( scip->set->reopt_enable )
    3305 {
    3306 SCIP_CALL( SCIPreoptAddCons(scip->reopt, scip->set, scip->mem->probmem, cons) );
    3307 }
    3308 }
    3309 return SCIP_OKAY;
    3310
    3312 SCIP_CALL( SCIPprobAddCons(scip->transprob, scip->set, scip->stat, cons) );
    3313 return SCIP_OKAY;
    3314
    3320 case SCIP_STAGE_SOLVING:
    3321 assert( SCIPtreeGetCurrentDepth(scip->tree) >= 0 || scip->set->stage == SCIP_STAGE_PRESOLVED
    3322 || scip->set->stage == SCIP_STAGE_INITSOLVE );
    3324 SCIPconsSetLocal(cons, FALSE);
    3325 if( SCIPconsIsGlobal(cons) )
    3326 {
    3327 SCIP_CALL( SCIPprobAddCons(scip->transprob, scip->set, scip->stat, cons) );
    3328 }
    3329 else
    3330 {
    3332 SCIP_CALL( SCIPnodeAddCons(SCIPtreeGetCurrentNode(scip->tree), scip->mem->probmem, scip->set, scip->stat,
    3333 scip->tree, cons) );
    3334 }
    3335 return SCIP_OKAY;
    3336
    3338 SCIP_CALL( SCIPprobAddCons(scip->transprob, scip->set, scip->stat, cons) );
    3339 return SCIP_OKAY;
    3340
    3341 default:
    3342 SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
    3343 return SCIP_INVALIDCALL;
    3344 } /*lint !e788*/
    3345}
    3346
    3347/** adds constraint to the problem and upgrades conflict in the conflict store; if oldcons is valid globally, newcons
    3348 * is added to the global problem; otherwise it is added to the local subproblem of the current node
    3349 *
    3350 * @note must only be called once for both constraints
    3351 *
    3352 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
    3353 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
    3354 *
    3355 * @pre this method can be called if @p scip is in one of the following stages:
    3356 * - \ref SCIP_STAGE_PROBLEM
    3357 * - \ref SCIP_STAGE_TRANSFORMED
    3358 * - \ref SCIP_STAGE_INITPRESOLVE
    3359 * - \ref SCIP_STAGE_PRESOLVING
    3360 * - \ref SCIP_STAGE_EXITPRESOLVE
    3361 * - \ref SCIP_STAGE_PRESOLVED
    3362 * - \ref SCIP_STAGE_INITSOLVE
    3363 * - \ref SCIP_STAGE_SOLVING
    3364 * - \ref SCIP_STAGE_EXITSOLVE
    3365 *
    3366 * @note this method will release the upgraded constraint
    3367 */
    3369 SCIP* scip, /**< SCIP data structure */
    3370 SCIP_CONS* oldcons, /**< underlying constraint to upgrade */
    3371 SCIP_CONS** newcons /**< upgraded constraint to add */
    3372 )
    3373{
    3374 assert(scip != NULL);
    3375 assert(scip->mem != NULL);
    3376 assert(oldcons != NULL);
    3377 assert(newcons != NULL);
    3378 assert(*newcons != NULL);
    3379 assert(SCIPconsGetNUpgradeLocks(oldcons) == 0);
    3380 assert(SCIPconsIsGlobal(oldcons) || SCIPconsGetValidDepth(oldcons) == SCIPconsGetActiveDepth(oldcons));
    3381
    3382 /* add problem constraint */
    3383 if( SCIPconsIsGlobal(oldcons) )
    3384 {
    3385 SCIP_CALL( SCIPaddCons(scip, *newcons) );
    3386 }
    3387 else
    3388 {
    3389 SCIP_CALL( SCIPaddConsLocal(scip, *newcons, NULL) );
    3390 }
    3391
    3392 /* upgrade conflict constraint */
    3393 if( SCIPconsIsConflict(oldcons) )
    3394 {
    3395 SCIP_CALL( SCIPconflictstoreUpgradeConflict(scip->conflictstore, scip->mem->probmem, scip->set,
    3396 oldcons, *newcons) );
    3397 }
    3398
    3399 /* release upgraded constraint */
    3400 SCIP_CALL( SCIPreleaseCons(scip, newcons) );
    3401
    3402 return SCIP_OKAY;
    3403}
    3404
    3405/** globally removes constraint from all subproblems; removes constraint from the constraint set change data of the
    3406 * node, where it was added, or from the problem, if it was a problem constraint
    3407 *
    3408 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
    3409 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
    3410 *
    3411 * @pre This method can be called if @p scip is in one of the following stages:
    3412 * - \ref SCIP_STAGE_PROBLEM
    3413 * - \ref SCIP_STAGE_INITPRESOLVE
    3414 * - \ref SCIP_STAGE_PRESOLVING
    3415 * - \ref SCIP_STAGE_EXITPRESOLVE
    3416 * - \ref SCIP_STAGE_INITSOLVE
    3417 * - \ref SCIP_STAGE_SOLVING
    3418 * - \ref SCIP_STAGE_EXITSOLVE
    3419 */
    3421 SCIP* scip, /**< SCIP data structure */
    3422 SCIP_CONS* cons /**< constraint to delete */
    3423 )
    3424{
    3425 assert(cons != NULL);
    3426
    3428
    3429 switch( scip->set->stage )
    3430 {
    3431 case SCIP_STAGE_PROBLEM:
    3432 assert(cons->addconssetchg == NULL);
    3433 SCIP_CALL( SCIPconsDelete(cons, scip->mem->probmem, scip->set, scip->stat, scip->origprob, scip->reopt) );
    3434 return SCIP_OKAY;
    3435
    3436 /* only added constraints can be removed in (de-)initialization process of presolving, otherwise the reduction
    3437 * might be wrong
    3438 */
    3442 assert(SCIPconsIsAdded(cons));
    3443 /*lint -fallthrough*/
    3444
    3447 case SCIP_STAGE_SOLVING:
    3449 SCIP_CALL( SCIPconsDelete(cons, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->reopt) );
    3450 return SCIP_OKAY;
    3451
    3452 default:
    3453 SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
    3454 return SCIP_INVALIDCALL;
    3455 } /*lint !e788*/
    3456}
    3457
    3458/** returns original constraint of given name in the problem, or NULL if not existing
    3459 *
    3460 * @return original constraint of given name in the problem, or NULL if not existing
    3461 *
    3462 * @pre This method can be called if @p scip is in one of the following stages:
    3463 * - \ref SCIP_STAGE_PROBLEM
    3464 * - \ref SCIP_STAGE_TRANSFORMING
    3465 * - \ref SCIP_STAGE_TRANSFORMED
    3466 * - \ref SCIP_STAGE_INITPRESOLVE
    3467 * - \ref SCIP_STAGE_PRESOLVING
    3468 * - \ref SCIP_STAGE_EXITPRESOLVE
    3469 * - \ref SCIP_STAGE_PRESOLVED
    3470 * - \ref SCIP_STAGE_INITSOLVE
    3471 * - \ref SCIP_STAGE_SOLVING
    3472 * - \ref SCIP_STAGE_SOLVED
    3473 * - \ref SCIP_STAGE_EXITSOLVE
    3474 * - \ref SCIP_STAGE_FREETRANS
    3475 */
    3477 SCIP* scip, /**< SCIP data structure */
    3478 const char* name /**< name of constraint to find */
    3479 )
    3480{
    3481 assert(name != NULL);
    3482
    3483 SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPfindOrigCons", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
    3484
    3485 switch( scip->set->stage )
    3486 {
    3487 case SCIP_STAGE_PROBLEM:
    3494 case SCIP_STAGE_SOLVING:
    3495 case SCIP_STAGE_SOLVED:
    3498 return SCIPprobFindCons(scip->origprob, name);
    3499
    3500 default:
    3501 SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
    3502 SCIPABORT();
    3503 return NULL; /*lint !e527*/
    3504 } /*lint !e788*/
    3505}
    3506
    3507/** returns constraint of given name in the problem, or NULL if not existing
    3508 *
    3509 * @return constraint of given name in the problem, or NULL if not existing
    3510 *
    3511 * @pre This method can be called if @p scip is in one of the following stages:
    3512 * - \ref SCIP_STAGE_PROBLEM
    3513 * - \ref SCIP_STAGE_TRANSFORMING
    3514 * - \ref SCIP_STAGE_TRANSFORMED
    3515 * - \ref SCIP_STAGE_INITPRESOLVE
    3516 * - \ref SCIP_STAGE_PRESOLVING
    3517 * - \ref SCIP_STAGE_EXITPRESOLVE
    3518 * - \ref SCIP_STAGE_PRESOLVED
    3519 * - \ref SCIP_STAGE_INITSOLVE
    3520 * - \ref SCIP_STAGE_SOLVING
    3521 * - \ref SCIP_STAGE_SOLVED
    3522 * - \ref SCIP_STAGE_EXITSOLVE
    3523 * - \ref SCIP_STAGE_FREETRANS
    3524 */
    3526 SCIP* scip, /**< SCIP data structure */
    3527 const char* name /**< name of constraint to find */
    3528 )
    3529{
    3530 SCIP_CONS* cons;
    3531
    3532 assert(name != NULL);
    3533
    3535
    3536 switch( scip->set->stage )
    3537 {
    3538 case SCIP_STAGE_PROBLEM:
    3539 return SCIPprobFindCons(scip->origprob, name);
    3540
    3547 case SCIP_STAGE_SOLVING:
    3548 case SCIP_STAGE_SOLVED:
    3551 cons = SCIPprobFindCons(scip->transprob, name);
    3552 if( cons == NULL )
    3553 return SCIPprobFindCons(scip->origprob, name);
    3554 else
    3555 return cons;
    3556
    3557 default:
    3558 SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
    3559 SCIPABORT();
    3560 return NULL; /*lint !e527*/
    3561 } /*lint !e788*/
    3562}
    3563
    3564/** gets number of upgraded constraints
    3565 *
    3566 * @return number of upgraded constraints
    3567 *
    3568 * @pre This method can be called if @p scip is in one of the following stages:
    3569 * - \ref SCIP_STAGE_PROBLEM
    3570 * - \ref SCIP_STAGE_TRANSFORMED
    3571 * - \ref SCIP_STAGE_INITPRESOLVE
    3572 * - \ref SCIP_STAGE_PRESOLVING
    3573 * - \ref SCIP_STAGE_PRESOLVED
    3574 * - \ref SCIP_STAGE_EXITPRESOLVE
    3575 * - \ref SCIP_STAGE_SOLVING
    3576 * - \ref SCIP_STAGE_SOLVED
    3577 */
    3579 SCIP* scip /**< SCIP data structure */
    3580 )
    3581{
    3583
    3584 switch( scip->set->stage )
    3585 {
    3586 case SCIP_STAGE_PROBLEM:
    3587 return 0;
    3588
    3594 case SCIP_STAGE_SOLVING:
    3595 case SCIP_STAGE_SOLVED:
    3596 return scip->stat->npresolupgdconss;
    3597
    3598 default:
    3599 SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
    3600 SCIPABORT();
    3601 return 0; /*lint !e527*/
    3602 } /*lint !e788*/
    3603}
    3604
    3605/** gets total number of globally valid constraints currently in the problem
    3606 *
    3607 * @return total number of globally valid constraints currently in the problem
    3608 *
    3609 * @pre This method can be called if @p scip is in one of the following stages:
    3610 * - \ref SCIP_STAGE_PROBLEM
    3611 * - \ref SCIP_STAGE_TRANSFORMED
    3612 * - \ref SCIP_STAGE_INITPRESOLVE
    3613 * - \ref SCIP_STAGE_PRESOLVING
    3614 * - \ref SCIP_STAGE_EXITPRESOLVE
    3615 * - \ref SCIP_STAGE_PRESOLVED
    3616 * - \ref SCIP_STAGE_INITSOLVE
    3617 * - \ref SCIP_STAGE_SOLVING
    3618 * - \ref SCIP_STAGE_SOLVED
    3619 */
    3621 SCIP* scip /**< SCIP data structure */
    3622 )
    3623{
    3625
    3626 switch( scip->set->stage )
    3627 {
    3628 case SCIP_STAGE_PROBLEM:
    3629 return scip->origprob->nconss;
    3630
    3637 case SCIP_STAGE_SOLVING:
    3638 case SCIP_STAGE_SOLVED:
    3639 return scip->transprob->nconss;
    3640
    3641 default:
    3642 SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
    3643 SCIPABORT();
    3644 return 0; /*lint !e527*/
    3645 } /*lint !e788*/
    3646}
    3647
    3648/** gets array of globally valid constraints currently in the problem
    3649 *
    3650 * @return array of globally valid constraints currently in the problem
    3651 *
    3652 * @pre This method can be called if @p scip is in one of the following stages:
    3653 * - \ref SCIP_STAGE_PROBLEM
    3654 * - \ref SCIP_STAGE_TRANSFORMED
    3655 * - \ref SCIP_STAGE_INITPRESOLVE
    3656 * - \ref SCIP_STAGE_PRESOLVING
    3657 * - \ref SCIP_STAGE_EXITPRESOLVE
    3658 * - \ref SCIP_STAGE_PRESOLVED
    3659 * - \ref SCIP_STAGE_INITSOLVE
    3660 * - \ref SCIP_STAGE_SOLVING
    3661 * - \ref SCIP_STAGE_SOLVED
    3662 *
    3663 * @warning If your are using the method SCIPaddCons(), it can happen that the internal constraint array (which is
    3664 * accessed via this method) gets resized. This can invalid the pointer which is returned by this method.
    3665 */
    3667 SCIP* scip /**< SCIP data structure */
    3668 )
    3669{
    3671
    3672 switch( scip->set->stage )
    3673 {
    3674 case SCIP_STAGE_PROBLEM:
    3675 return scip->origprob->conss;
    3676
    3683 case SCIP_STAGE_SOLVING:
    3684 case SCIP_STAGE_SOLVED:
    3685 return scip->transprob->conss;
    3686
    3687 default:
    3688 SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
    3689 SCIPABORT();
    3690 return NULL; /*lint !e527*/
    3691 } /*lint !e788*/
    3692}
    3693
    3694/** gets total number of constraints in the original problem
    3695 *
    3696 * @return total number of constraints in the original problem
    3697 *
    3698 * @pre This method can be called if @p scip is in one of the following stages:
    3699 * - \ref SCIP_STAGE_PROBLEM
    3700 * - \ref SCIP_STAGE_TRANSFORMING
    3701 * - \ref SCIP_STAGE_TRANSFORMED
    3702 * - \ref SCIP_STAGE_INITPRESOLVE
    3703 * - \ref SCIP_STAGE_PRESOLVING
    3704 * - \ref SCIP_STAGE_EXITPRESOLVE
    3705 * - \ref SCIP_STAGE_PRESOLVED
    3706 * - \ref SCIP_STAGE_INITSOLVE
    3707 * - \ref SCIP_STAGE_SOLVING
    3708 * - \ref SCIP_STAGE_SOLVED
    3709 * - \ref SCIP_STAGE_EXITSOLVE
    3710 * - \ref SCIP_STAGE_FREETRANS
    3711 */
    3713 SCIP* scip /**< SCIP data structure */
    3714 )
    3715{
    3716 SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetNOrigConss", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
    3717
    3718 return scip->origprob->nconss;
    3719}
    3720
    3721/** gets array of constraints in the original problem
    3722 *
    3723 * @return array of constraints in the original problem
    3724 *
    3725 * @pre This method can be called if @p scip is in one of the following stages:
    3726 * - \ref SCIP_STAGE_PROBLEM
    3727 * - \ref SCIP_STAGE_TRANSFORMING
    3728 * - \ref SCIP_STAGE_TRANSFORMED
    3729 * - \ref SCIP_STAGE_INITPRESOLVE
    3730 * - \ref SCIP_STAGE_PRESOLVING
    3731 * - \ref SCIP_STAGE_EXITPRESOLVE
    3732 * - \ref SCIP_STAGE_PRESOLVED
    3733 * - \ref SCIP_STAGE_INITSOLVE
    3734 * - \ref SCIP_STAGE_SOLVING
    3735 * - \ref SCIP_STAGE_SOLVED
    3736 * - \ref SCIP_STAGE_EXITSOLVE
    3737 * - \ref SCIP_STAGE_FREETRANS
    3738 */
    3740 SCIP* scip /**< SCIP data structure */
    3741 )
    3742{
    3743 SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetOrigConss", FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
    3744
    3745 return scip->origprob->conss;
    3746}
    3747
    3748/** computes the number of check constraint in the current node (loop over all constraint handler and cumulates the
    3749 * number of check constraints)
    3750 *
    3751 * @return returns the number of check constraints
    3752 *
    3753 * @pre This method can be called if @p scip is in one of the following stages:
    3754 * - \ref SCIP_STAGE_TRANSFORMED
    3755 * - \ref SCIP_STAGE_INITPRESOLVE
    3756 * - \ref SCIP_STAGE_PRESOLVING
    3757 * - \ref SCIP_STAGE_EXITPRESOLVE
    3758 * - \ref SCIP_STAGE_PRESOLVED
    3759 * - \ref SCIP_STAGE_INITSOLVE
    3760 * - \ref SCIP_STAGE_SOLVING
    3761 */
    3763 SCIP* scip /**< SCIP data structure */
    3764 )
    3765{
    3766 SCIP_CONSHDLR** conshdlrs;
    3767 int nconshdlrs;
    3768 int ncheckconss;
    3769 int c;
    3770
    3772
    3773 nconshdlrs = SCIPgetNConshdlrs(scip);
    3774 conshdlrs = SCIPgetConshdlrs(scip);
    3775 assert(conshdlrs != NULL);
    3776
    3777 ncheckconss = 0;
    3778
    3779 /* loop over all constraint handler and collect the number of constraints which need to be checked */
    3780 for( c = 0; c < nconshdlrs; ++c )
    3781 {
    3782 assert(conshdlrs[c] != NULL);
    3783 ncheckconss += SCIPconshdlrGetNCheckConss(conshdlrs[c]);
    3784 }
    3785
    3786 return ncheckconss;
    3787}
    3788
    3789/*
    3790 * local subproblem methods
    3791 */
    3792
    3793/** adds a conflict to a given node or globally to the problem if @p node == NULL.
    3794 *
    3795 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
    3796 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
    3797 *
    3798 * @pre this method can be called in one of the following stages of the SCIP solving process:
    3799 * - \ref SCIP_STAGE_INITPRESOLVE
    3800 * - \ref SCIP_STAGE_PRESOLVING
    3801 * - \ref SCIP_STAGE_EXITPRESOLVE
    3802 * - \ref SCIP_STAGE_SOLVING
    3803 *
    3804 * @note this method will release the constraint
    3805 */
    3807 SCIP* scip, /**< SCIP data structure */
    3808 SCIP_NODE* node, /**< node to add conflict (or NULL if global) */
    3809 SCIP_CONS** cons, /**< constraint representing the conflict */
    3810 SCIP_NODE* validnode, /**< node at which the constraint is valid (or NULL) */
    3811 SCIP_CONFTYPE conftype, /**< type of the conflict */
    3812 SCIP_Bool iscutoffinvolved /**< is a cutoff bound involved in this conflict */
    3813 )
    3814{
    3815 SCIP_Real primalbound;
    3816
    3817 assert(scip != NULL);
    3818 assert(cons != NULL);
    3819 assert(*cons != NULL);
    3820 assert(scip->conflictstore != NULL);
    3821 assert(conftype != SCIP_CONFTYPE_BNDEXCEEDING || iscutoffinvolved);
    3822
    3824
    3825 /* mark constraint to be a conflict */
    3827 if( iscutoffinvolved )
    3828 primalbound = SCIPgetCutoffbound(scip);
    3829 else
    3830 primalbound = -SCIPinfinity(scip);
    3831
    3832 /* add a global conflict */
    3833 if( node == NULL )
    3834 {
    3835 SCIP_CALL( SCIPaddCons(scip, *cons) );
    3836 }
    3837 /* add a local conflict */
    3838 else
    3839 {
    3840 SCIP_CALL( SCIPaddConsNode(scip, node, *cons, validnode) );
    3841 }
    3842
    3843 if( node == NULL || SCIPnodeGetType(node) != SCIP_NODETYPE_PROBINGNODE )
    3844 {
    3845 /* add the conflict to the conflict store */
    3846 SCIP_CALL( SCIPconflictstoreAddConflict(scip->conflictstore, scip->mem->probmem, scip->set, scip->stat, scip->tree,
    3847 scip->transprob, scip->reopt, *cons, conftype, iscutoffinvolved, primalbound) );
    3848 }
    3849
    3850 SCIP_CALL( SCIPreleaseCons(scip, cons) );
    3851
    3852 return SCIP_OKAY;
    3853}
    3854
    3855/** tries to remove conflicts depending on an old cutoff bound if the improvement of the new incumbent is good enough
    3856 *
    3857 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
    3858 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
    3859 *
    3860 * @pre this method can be called in one of the following stages of the SCIP solving process:
    3861 * - \ref SCIP_STAGE_PRESOLVING
    3862 * - \ref SCIP_STAGE_SOLVING
    3863 */
    3865 SCIP* scip, /**< SCIP data structure */
    3866 SCIP_EVENT* event /**< event data */
    3867 )
    3868{
    3869 assert(scip != NULL);
    3870 assert(event != NULL);
    3872 assert(SCIPeventGetSol(event) != NULL);
    3873
    3874 SCIP_CALL( SCIPcheckStage(scip, "SCIPclearConflictStore", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
    3875
    3876 SCIP_CALL( SCIPconflictstoreCleanNewIncumbent(scip->conflictstore, scip->set, scip->stat, scip->mem->probmem,
    3877 scip->transprob, scip->reopt, scip->primal->cutoffbound) );
    3878
    3879 return SCIP_OKAY;
    3880}
    3881
    3882/** adds constraint to the given node (and all of its subnodes), even if it is a global constraint;
    3883 * It is sometimes desirable to add the constraint to a more local node (i.e., a node of larger depth) even if
    3884 * the constraint is also valid higher in the tree, for example, if one wants to produce a constraint which is
    3885 * only active in a small part of the tree although it is valid in a larger part.
    3886 * In this case, one should pass the more global node where the constraint is valid as "validnode".
    3887 * Note that the same constraint cannot be added twice to the branching tree with different "validnode" parameters.
    3888 * If the constraint is valid at the same node as it is inserted (the usual case), one should pass NULL as "validnode".
    3889 * If the "validnode" is the root node, it is automatically upgraded into a global constraint, but still only added to
    3890 * the given node. If a local constraint is added to the root node, it is added to the global problem instead.
    3891 *
    3892 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
    3893 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
    3894 *
    3895 * @pre this method can be called in one of the following stages of the SCIP solving process:
    3896 * - \ref SCIP_STAGE_INITPRESOLVE
    3897 * - \ref SCIP_STAGE_PRESOLVING
    3898 * - \ref SCIP_STAGE_EXITPRESOLVE
    3899 * - \ref SCIP_STAGE_SOLVING
    3900 */
    3902 SCIP* scip, /**< SCIP data structure */
    3903 SCIP_NODE* node, /**< node to add constraint to */
    3904 SCIP_CONS* cons, /**< constraint to add */
    3905 SCIP_NODE* validnode /**< node at which the constraint is valid, or NULL */
    3906 )
    3907{
    3908 SCIP_Bool isconsexact;
    3909
    3910 assert(cons != NULL);
    3911 assert(node != NULL);
    3912
    3914
    3915 /* exact constraints should be added if and only if exact solving is turned on */
    3916 isconsexact = SCIPconshdlrIsExact((SCIPconsGetHdlr(cons)));
    3917 if( SCIPisExact(scip) && !isconsexact )
    3918 {
    3919 SCIPerrorMessage("cannot add inexact constraint while exact solving is enabled\n");
    3920 return SCIP_INVALIDDATA;
    3921 }
    3922 else if( !SCIPisExact(scip) && isconsexact )
    3923 {
    3924 SCIPerrorMessage("cannot add exact constraint while exact solving is disabled\n");
    3925 return SCIP_INVALIDDATA;
    3926 }
    3927
    3928 if( validnode != NULL )
    3929 {
    3930 int validdepth;
    3931
    3932 validdepth = SCIPnodeGetDepth(validnode);
    3933 if( validdepth > SCIPnodeGetDepth(node) )
    3934 {
    3935 SCIPerrorMessage("cannot add constraint <%s> valid in depth %d to a node of depth %d\n",
    3936 SCIPconsGetName(cons), validdepth, SCIPnodeGetDepth(node));
    3937 return SCIP_INVALIDDATA;
    3938 }
    3939 if( cons->validdepth != -1 && cons->validdepth != validdepth )
    3940 {
    3941 SCIPerrorMessage("constraint <%s> is already marked to be valid in depth %d - cannot mark it to be valid in depth %d\n",
    3942 SCIPconsGetName(cons), cons->validdepth, validdepth);
    3943 return SCIP_INVALIDDATA;
    3944 }
    3945 if( validdepth <= SCIPtreeGetEffectiveRootDepth(scip->tree) )
    3946 SCIPconsSetLocal(cons, FALSE);
    3947 else
    3948 cons->validdepth = validdepth;
    3949 }
    3950
    3952 {
    3953 SCIPconsSetLocal(cons, FALSE);
    3954 SCIP_CALL( SCIPprobAddCons(scip->transprob, scip->set, scip->stat, cons) );
    3955 }
    3956 else
    3957 {
    3958 SCIP_CALL( SCIPnodeAddCons(node, scip->mem->probmem, scip->set, scip->stat, scip->tree, cons) );
    3959 }
    3960
    3961 return SCIP_OKAY;
    3962}
    3963
    3964/** adds constraint locally to the current node (and all of its subnodes), even if it is a global constraint;
    3965 * It is sometimes desirable to add the constraint to a more local node (i.e., a node of larger depth) even if
    3966 * the constraint is also valid higher in the tree, for example, if one wants to produce a constraint which is
    3967 * only active in a small part of the tree although it is valid in a larger part.
    3968 *
    3969 * If the constraint is valid at the same node as it is inserted (the usual case), one should pass NULL as "validnode".
    3970 * If the "validnode" is the root node, it is automatically upgraded into a global constraint, but still only added to
    3971 * the given node. If a local constraint is added to the root node, it is added to the global problem instead.
    3972 *
    3973 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
    3974 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
    3975 *
    3976 * @pre this method can be called in one of the following stages of the SCIP solving process:
    3977 * - \ref SCIP_STAGE_INITPRESOLVE
    3978 * - \ref SCIP_STAGE_PRESOLVING
    3979 * - \ref SCIP_STAGE_EXITPRESOLVE
    3980 * - \ref SCIP_STAGE_SOLVING
    3981 *
    3982 * @note The same constraint cannot be added twice to the branching tree with different "validnode" parameters. This is
    3983 * the case due to internal data structures and performance issues. In such a case you should try to realize your
    3984 * issue using the method SCIPdisableCons() and SCIPenableCons() and control these via the event system of SCIP.
    3985 */
    3987 SCIP* scip, /**< SCIP data structure */
    3988 SCIP_CONS* cons, /**< constraint to add */
    3989 SCIP_NODE* validnode /**< node at which the constraint is valid, or NULL */
    3990 )
    3991{
    3992 assert(cons != NULL);
    3993
    3995
    3996 SCIP_CALL( SCIPaddConsNode(scip, SCIPtreeGetCurrentNode(scip->tree), cons, validnode) );
    3997
    3998 return SCIP_OKAY;
    3999}
    4000
    4001/** disables constraint's separation, enforcing, and propagation capabilities at the given node (and all subnodes);
    4002 * if the method is called at the root node, the constraint is globally deleted from the problem;
    4003 * the constraint deletion is being remembered at the given node, s.t. after leaving the node's subtree, the constraint
    4004 * is automatically enabled again, and after entering the node's subtree, it is automatically disabled;
    4005 * this may improve performance because redundant checks on this constraint are avoided, but it consumes memory;
    4006 * alternatively, use SCIPdisableCons()
    4007 *
    4008 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
    4009 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
    4010 *
    4011 * @pre this method can be called in one of the following stages of the SCIP solving process:
    4012 * - \ref SCIP_STAGE_INITPRESOLVE
    4013 * - \ref SCIP_STAGE_PRESOLVING
    4014 * - \ref SCIP_STAGE_EXITPRESOLVE
    4015 * - \ref SCIP_STAGE_SOLVING
    4016 */
    4018 SCIP* scip, /**< SCIP data structure */
    4019 SCIP_NODE* node, /**< node to disable constraint in */
    4020 SCIP_CONS* cons /**< constraint to locally delete */
    4021 )
    4022{
    4023 assert(cons != NULL);
    4024
    4026
    4027 /* only added constraints can be removed in (de-)initialization process of presolving, otherwise the reduction
    4028 * might be wrong
    4029 */
    4030 if( scip->set->stage == SCIP_STAGE_INITPRESOLVE || scip->set->stage == SCIP_STAGE_EXITPRESOLVE )
    4031 assert(SCIPconsIsAdded(cons));
    4032
    4034 {
    4035 SCIP_CALL( SCIPconsDelete(cons, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->reopt) );
    4036 }
    4037 else
    4038 {
    4039 SCIP_CALL( SCIPnodeDelCons(node, scip->mem->probmem, scip->set, scip->stat, scip->tree, cons) );
    4040 }
    4041
    4042 return SCIP_OKAY;
    4043}
    4044
    4045/** disables constraint's separation, enforcing, and propagation capabilities at the current node (and all subnodes);
    4046 * if the method is called during problem modification or at the root node, the constraint is globally deleted from
    4047 * the problem;
    4048 * the constraint deletion is being remembered at the current node, s.t. after leaving the current subtree, the
    4049 * constraint is automatically enabled again, and after reentering the current node's subtree, it is automatically
    4050 * disabled again;
    4051 * this may improve performance because redundant checks on this constraint are avoided, but it consumes memory;
    4052 * alternatively, use SCIPdisableCons()
    4053 *
    4054 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
    4055 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
    4056 *
    4057 * @pre this method can be called in one of the following stages of the SCIP solving process:
    4058 * - \ref SCIP_STAGE_PROBLEM
    4059 * - \ref SCIP_STAGE_INITPRESOLVE
    4060 * - \ref SCIP_STAGE_PRESOLVING
    4061 * - \ref SCIP_STAGE_EXITPRESOLVE
    4062 * - \ref SCIP_STAGE_SOLVING
    4063 *
    4064 * @note SCIP stage does not get changed
    4065 *
    4066 */
    4068 SCIP* scip, /**< SCIP data structure */
    4069 SCIP_CONS* cons /**< constraint to locally delete */
    4070 )
    4071{
    4072 SCIP_NODE* node;
    4073
    4074 assert(cons != NULL);
    4075
    4077
    4078 switch( scip->set->stage )
    4079 {
    4080 case SCIP_STAGE_PROBLEM:
    4081 assert(cons->addconssetchg == NULL);
    4082 SCIP_CALL( SCIPconsDelete(cons, scip->mem->probmem, scip->set, scip->stat, scip->origprob, scip->reopt) );
    4083 return SCIP_OKAY;
    4084
    4085 /* only added constraints can be removed in (de-)initialization process of presolving, otherwise the reduction
    4086 * might be wrong
    4087 */
    4090 assert(SCIPconsIsAdded(cons));
    4091 /*lint -fallthrough*/
    4092
    4094 case SCIP_STAGE_SOLVING:
    4095 node = SCIPtreeGetCurrentNode(scip->tree);
    4096
    4098 {
    4099 SCIP_CALL( SCIPconsDelete(cons, scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->reopt) );
    4100 }
    4101 else
    4102 {
    4103 SCIP_CALL( SCIPnodeDelCons(node, scip->mem->probmem, scip->set, scip->stat, scip->tree, cons) );
    4104 }
    4105 return SCIP_OKAY;
    4106
    4107 default:
    4108 SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
    4109 return SCIP_INVALIDCALL;
    4110 } /*lint !e788*/
    4111}
    4112
    4113/** gets estimate of best primal solution w.r.t. original problem contained in current subtree
    4114 *
    4115 * @return estimate of best primal solution w.r.t. original problem contained in current subtree
    4116 *
    4117 * @pre this method can be called in one of the following stages of the SCIP solving process:
    4118 * - \ref SCIP_STAGE_SOLVING
    4119 */
    4121 SCIP* scip /**< SCIP data structure */
    4122 )
    4123{
    4124 SCIP_NODE* node;
    4125
    4126 SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetLocalOrigEstimate", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
    4127
    4128 node = SCIPtreeGetCurrentNode(scip->tree);
    4129 return node != NULL ? SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, SCIPnodeGetEstimate(node)) : SCIP_INVALID;
    4130}
    4131
    4132/** gets estimate of best primal solution w.r.t. transformed problem contained in current subtree
    4133 *
    4134 * @return estimate of best primal solution w.r.t. transformed problem contained in current subtree
    4135 *
    4136 * @pre this method can be called in one of the following stages of the SCIP solving process:
    4137 * - \ref SCIP_STAGE_SOLVING
    4138 */
    4140 SCIP* scip /**< SCIP data structure */
    4141 )
    4142{
    4143 SCIP_NODE* node;
    4144
    4145 SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetLocalTransEstimate", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
    4146
    4147 node = SCIPtreeGetCurrentNode(scip->tree);
    4148
    4149 return node != NULL ? SCIPnodeGetEstimate(node) : SCIP_INVALID;
    4150}
    4151
    4152/** gets dual bound of current node
    4153 *
    4154 * @return dual bound of current node
    4155 *
    4156 * @pre this method can be called in one of the following stages of the SCIP solving process:
    4157 * - \ref SCIP_STAGE_SOLVING
    4158 */
    4160 SCIP* scip /**< SCIP data structure */
    4161 )
    4162{
    4163 SCIP_NODE* node;
    4164
    4166
    4167 node = SCIPtreeGetCurrentNode(scip->tree);
    4168 return node != NULL ? SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, SCIPnodeGetLowerbound(node)) : SCIP_INVALID;
    4169}
    4170
    4171/** gets lower bound of current node in transformed problem
    4172 *
    4173 * @return lower bound of current node in transformed problem
    4174 *
    4175 * @pre this method can be called in one of the following stages of the SCIP solving process:
    4176 * - \ref SCIP_STAGE_SOLVING
    4177 */
    4179 SCIP* scip /**< SCIP data structure */
    4180 )
    4181{
    4182 SCIP_NODE* node;
    4183
    4185
    4186 node = SCIPtreeGetCurrentNode(scip->tree);
    4187
    4188 return node != NULL ? SCIPnodeGetLowerbound(node) : SCIP_INVALID;
    4189}
    4190
    4191/** gets dual bound of given node
    4192 *
    4193 * @return dual bound of a given node
    4194 *
    4195 * @pre this method can be called in one of the following stages of the SCIP solving process:
    4196 * - \ref SCIP_STAGE_SOLVING
    4197 */
    4199 SCIP* scip, /**< SCIP data structure */
    4200 SCIP_NODE* node /**< node to get dual bound for */
    4201 )
    4202{
    4204
    4205 return SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, SCIPnodeGetLowerbound(node));
    4206}
    4207
    4208/** gets lower bound of given node in transformed problem
    4209 *
    4210 * @return lower bound of given node in transformed problem
    4211 *
    4212 * @pre this method can be called in one of the following stages of the SCIP solving process:
    4213 * - \ref SCIP_STAGE_SOLVING
    4214 */
    4216 SCIP* scip, /**< SCIP data structure */
    4217 SCIP_NODE* node /**< node to get dual bound for */
    4218 )
    4219{
    4221
    4222 return SCIPnodeGetLowerbound(node);
    4223}
    4224
    4225/** if given value is tighter (larger for minimization, smaller for maximization) than the current node's dual bound (in
    4226 * original problem space), sets the current node's dual bound to the new value
    4227 *
    4228 * @note the given new bound has to be a dual bound, i.e., it has to be valid for the original problem.
    4229 *
    4230 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
    4231 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
    4232 *
    4233 * @pre this method can be called in one of the following stages of the SCIP solving process:
    4234 * - \ref SCIP_STAGE_PROBLEM
    4235 * - \ref SCIP_STAGE_PRESOLVING
    4236 * - \ref SCIP_STAGE_PRESOLVED
    4237 * - \ref SCIP_STAGE_SOLVING
    4238 */
    4240 SCIP* scip, /**< SCIP data structure */
    4241 SCIP_Real newbound /**< new dual bound for the node (if it's tighter than the old one) */
    4242 )
    4243{
    4244 SCIP_CALL( SCIPcheckStage(scip, "SCIPupdateLocalDualbound", FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
    4245
    4246 switch( scip->set->stage )
    4247 {
    4248 case SCIP_STAGE_PROBLEM:
    4249 /* since no root node, for which we could update the dual bound, has been create yet, update the dual bound stored in
    4250 * the problem data
    4251 */
    4252 SCIPprobUpdateDualbound(scip->origprob, newbound);
    4253 break;
    4254
    4257 /* since no root node, for which we could update the dual bound, has been create yet, update the dual bound stored in
    4258 * the problem data
    4259 */
    4260 SCIPprobUpdateDualbound(scip->transprob, SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, newbound));
    4261 break;
    4262
    4263 case SCIP_STAGE_SOLVING:
    4264 SCIP_CALL( SCIPupdateNodeLowerbound(scip, SCIPtreeGetCurrentNode(scip->tree), SCIPprobInternObjval(scip->transprob, scip->origprob, scip->set, newbound)) );
    4265 break;
    4266
    4267 default:
    4268 SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
    4269 SCIPABORT();
    4270 return SCIP_INVALIDCALL; /*lint !e527*/
    4271 } /*lint !e788*/
    4272
    4273 return SCIP_OKAY;
    4274}
    4275
    4276/** if given value is larger than the current node's lower bound (in transformed problem), sets the current node's
    4277 * lower bound to the new value
    4278 *
    4279 * @note the given new bound has to be a lower bound, i.e., it has to be valid for the transformed problem.
    4280 *
    4281 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
    4282 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
    4283 *
    4284 * @pre this method can be called in one of the following stages of the SCIP solving process:
    4285 * - \ref SCIP_STAGE_PRESOLVING
    4286 * - \ref SCIP_STAGE_PRESOLVED
    4287 * - \ref SCIP_STAGE_SOLVING
    4288 */
    4290 SCIP* scip, /**< SCIP data structure */
    4291 SCIP_Real newbound /**< new lower bound for the node (if it's larger than the old one) */
    4292 )
    4293{
    4294 SCIP_CALL( SCIPcheckStage(scip, "SCIPupdateLocalLowerbound", FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
    4295
    4296 switch( scip->set->stage )
    4297 {
    4300 /* since no root node, for which we could update the lower bound, has been created yet, update the dual bound stored
    4301 * in the problem data
    4302 */
    4303 SCIPprobUpdateDualbound(scip->transprob, SCIPprobExternObjval(scip->transprob, scip->origprob, scip->set, newbound));
    4304 break;
    4305
    4306 case SCIP_STAGE_SOLVING:
    4308 break;
    4309
    4310 default:
    4311 SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
    4312 SCIPABORT();
    4313 return SCIP_INVALIDCALL; /*lint !e527*/
    4314 } /*lint !e788*/
    4315
    4316 return SCIP_OKAY;
    4317}
    4318
    4319/** if given value is tighter (higher for minimization, lower for maximization) than the node's dual bound, sets the
    4320 * node's dual bound to the new value.
    4321 *
    4322 * @note must not be used on a leaf because the node priority queue remains untouched
    4323 *
    4324 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
    4325 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
    4326 *
    4327 * @pre this method can be called in one of the following stages of the SCIP solving process:
    4328 * - \ref SCIP_STAGE_SOLVING
    4329 */
    4331 SCIP* scip, /**< SCIP data structure */
    4332 SCIP_NODE* node, /**< node to update dual bound for */
    4333 SCIP_Real newbound /**< new dual bound for the node (if it's tighter than the old one) */
    4334 )
    4335{
    4336 SCIP_CALL( SCIPcheckStage(scip, "SCIPupdateNodeDualbound", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
    4337
    4338 SCIP_CALL( SCIPupdateNodeLowerbound(scip, node, SCIPprobInternObjval(scip->transprob, scip->origprob, scip->set, newbound)) );
    4339
    4340 return SCIP_OKAY;
    4341}
    4342
    4343/** if given value is higher than the node's lower bound (in transformed problem), sets the node's lower bound to the
    4344 * new value.
    4345 *
    4346 * @note must not be used on a leaf because the node priority queue remains untouched
    4347 *
    4348 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
    4349 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
    4350 *
    4351 * @pre this method can be called in one of the following stages of the SCIP solving process:
    4352 * - \ref SCIP_STAGE_SOLVING
    4353 */
    4355 SCIP* scip, /**< SCIP data structure */
    4356 SCIP_NODE* node, /**< node to update lower bound for */
    4357 SCIP_Real newbound /**< new lower bound for the node (if it's larger than the old one) */
    4358 )
    4359{
    4360 SCIP_CALL( SCIPcheckStage(scip, "SCIPupdateNodeLowerbound", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
    4361
    4362 /* if lowerbound exceeds the cutoffbound, the node will be marked to be cutoff instead
    4363 *
    4364 * If the node is an inner node (not a child node) we need to cutoff the node manually if we exceed the cutoffbound.
    4365 * This is only relevant if a user updates the lower bound. Therefore, we only check for a cutoff here in the user
    4366 * function instead of in SCIPnodeUpdateLowerbound().
    4367 */
    4368 if( SCIPisLT(scip, newbound, scip->primal->cutoffbound) )
    4369 {
    4370 SCIP_CALL( SCIPnodeUpdateLowerbound(node, scip->stat, scip->set, scip->eventfilter, scip->tree, scip->transprob, scip->origprob, newbound, NULL) );
    4371 }
    4372 else
    4373 {
    4374 SCIP_CALL( SCIPnodeCutoff(node, scip->set, scip->stat, scip->eventfilter, scip->tree, scip->transprob, scip->origprob, scip->reopt, scip->lp, scip->mem->probmem) );
    4375 }
    4376
    4377 return SCIP_OKAY;
    4378}
    4379
    4380/** change the node selection priority of the given child
    4381 *
    4382 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
    4383 * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
    4384 *
    4385 * @pre this method can be called in one of the following stages of the SCIP solving process:
    4386 * - \ref SCIP_STAGE_SOLVING
    4387 */
    4389 SCIP* scip, /**< SCIP data structure */
    4390 SCIP_NODE* child, /**< child to update the node selection priority */
    4391 SCIP_Real priority /**< node selection priority value */
    4392 )
    4393{
    4395
    4396 if( SCIPnodeGetType(child) != SCIP_NODETYPE_CHILD )
    4397 return SCIP_INVALIDDATA;
    4398
    4399 SCIPchildChgNodeselPrio(scip->tree, child, priority);
    4400
    4401 return SCIP_OKAY;
    4402}
    SCIP_VAR * h
    Definition: circlepacking.c:68
    void SCIPclockSetTime(SCIP_CLOCK *clck, SCIP_Real sec)
    Definition: clock.c:539
    internal methods for clocks and timing issues
    SCIP_RETCODE SCIPfreeConcurrent(SCIP *scip)
    Definition: concurrent.c:161
    helper functions for concurrent scip solvers
    SCIP_RETCODE SCIPconflictstoreUpgradeConflict(SCIP_CONFLICTSTORE *conflictstore, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_CONS *oldcons, SCIP_CONS *newcons)
    SCIP_RETCODE SCIPconflictstoreCleanNewIncumbent(SCIP_CONFLICTSTORE *conflictstore, SCIP_SET *set, SCIP_STAT *stat, BMS_BLKMEM *blkmem, SCIP_PROB *transprob, SCIP_REOPT *reopt, SCIP_Real cutoffbound)
    SCIP_RETCODE SCIPconflictstoreFree(SCIP_CONFLICTSTORE **conflictstore, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_REOPT *reopt)
    SCIP_RETCODE SCIPconflictstoreCreate(SCIP_CONFLICTSTORE **conflictstore, SCIP_SET *set)
    SCIP_RETCODE SCIPconflictstoreAddConflict(SCIP_CONFLICTSTORE *conflictstore, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_TREE *tree, SCIP_PROB *transprob, SCIP_REOPT *reopt, SCIP_CONS *cons, SCIP_CONFTYPE conftype, SCIP_Bool cutoffinvolved, SCIP_Real primalbound)
    internal methods for storing conflicts
    void SCIPconsSetLocal(SCIP_CONS *cons, SCIP_Bool local)
    Definition: cons.c:6949
    SCIP_RETCODE SCIPconsDelete(SCIP_CONS *cons, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_REOPT *reopt)
    Definition: cons.c:6652
    SCIP_RETCODE SCIPconsMarkConflict(SCIP_CONS *cons)
    Definition: cons.c:7293
    internal methods for constraints and constraint handlers
    SCIP_RETCODE SCIPdecompstoreCreate(SCIP_DECOMPSTORE **decompstore, BMS_BLKMEM *blkmem, int nslots)
    Definition: dcmp.c:500
    void SCIPdecompstoreFree(SCIP_DECOMPSTORE **decompstore, BMS_BLKMEM *blkmem)
    Definition: dcmp.c:555
    internal methods for decompositions and the decomposition store
    #define SCIP_DECOMPSTORE_CAPA
    Definition: dcmp.h:48
    methods for debugging
    #define SCIPcheckStage(scip, method, init, problem, transforming, transformed, initpresolve, presolving, exitpresolve, presolved, initsolve, solving, solved, exitsolve, freetrans, freescip)
    Definition: debug.h:364
    #define SCIPdebugFreeDebugData(set)
    Definition: debug.h:293
    #define NULL
    Definition: def.h:248
    #define SCIP_INVALID
    Definition: def.h:178
    #define SCIP_Bool
    Definition: def.h:91
    #define SCIP_Real
    Definition: def.h:156
    #define TRUE
    Definition: def.h:93
    #define FALSE
    Definition: def.h:94
    #define SCIP_CALL_ABORT(x)
    Definition: def.h:334
    #define SCIPABORT()
    Definition: def.h:327
    #define SCIP_CALL(x)
    Definition: def.h:355
    void SCIPsplitFilename(char *filename, char **path, char **name, char **extension, char **compression)
    Definition: misc.c:11073
    SCIP_Bool SCIPisTransformed(SCIP *scip)
    Definition: scip_general.c:647
    int SCIPgetNObjVars(SCIP *scip)
    Definition: scip_prob.c:2616
    SCIP_RETCODE SCIPaddVar(SCIP *scip, SCIP_VAR *var)
    Definition: scip_prob.c:1907
    int SCIPgetNIntVars(SCIP *scip)
    Definition: scip_prob.c:2340
    SCIP_RETCODE SCIPpermuteProb(SCIP *scip, unsigned int randseed, SCIP_Bool permuteconss, SCIP_Bool permutebinvars, SCIP_Bool permuteintvars, SCIP_Bool permutebinimplvars, SCIP_Bool permuteintimplvars, SCIP_Bool permutecontimplvars, SCIP_Bool permutecontvars)
    Definition: scip_prob.c:922
    SCIP_RETCODE SCIPaddConsUpgrade(SCIP *scip, SCIP_CONS *oldcons, SCIP_CONS **newcons)
    Definition: scip_prob.c:3368
    SCIP_RETCODE SCIPsetObjIntegral(SCIP *scip)
    Definition: scip_prob.c:1758
    SCIP_RETCODE SCIPgetOrigVarsData(SCIP *scip, SCIP_VAR ***vars, int *nvars, int *nbinvars, int *nintvars, int *nimplvars, int *ncontvars)
    Definition: scip_prob.c:2753
    int SCIPgetNImplVars(SCIP *scip)
    Definition: scip_prob.c:2387
    const char * SCIPgetProbName(SCIP *scip)
    Definition: scip_prob.c:1242
    int SCIPgetNContVars(SCIP *scip)
    Definition: scip_prob.c:2569
    int SCIPgetNCheckConss(SCIP *scip)
    Definition: scip_prob.c:3762
    SCIP_RETCODE SCIPaddPricedVar(SCIP *scip, SCIP_VAR *var, SCIP_Real score)
    Definition: scip_prob.c:1984
    SCIP_Real SCIPgetOrigObjscale(SCIP *scip)
    Definition: scip_prob.c:1583
    SCIP_RETCODE SCIPgetSolVarsData(SCIP *scip, SCIP_SOL *sol, SCIP_VAR ***vars, int *nvars, int *nbinvars, int *nintvars, int *nbinimplvars, int *nintimplvars, int *ncontimplvars, int *ncontvars)
    Definition: scip_prob.c:3114
    SCIP_RETCODE SCIPwriteOrigProblem(SCIP *scip, const char *filename, const char *extension, SCIP_Bool genericnames)
    Definition: scip_prob.c:742
    SCIP_RETCODE SCIPsetProbName(SCIP *scip, const char *name)
    Definition: scip_prob.c:1270
    SCIP_RETCODE SCIPsetObjlimit(SCIP *scip, SCIP_Real objlimit)
    Definition: scip_prob.c:1661
    SCIP_RETCODE SCIPsetProbDeltrans(SCIP *scip, SCIP_DECL_PROBDELTRANS((*probdeltrans)))
    Definition: scip_prob.c:244
    SCIP_Real SCIPgetTransObjoffset(SCIP *scip)
    Definition: scip_prob.c:1606
    int SCIPgetNBinImplVars(SCIP *scip)
    Definition: scip_prob.c:2432
    int SCIPgetNOrigBinVars(SCIP *scip)
    Definition: scip_prob.c:2867
    SCIP_RETCODE SCIPgetVarsData(SCIP *scip, SCIP_VAR ***vars, int *nvars, int *nbinvars, int *nintvars, int *nimplvars, int *ncontvars)
    Definition: scip_prob.c:2115
    int SCIPgetNOrigConss(SCIP *scip)
    Definition: scip_prob.c:3712
    SCIP_Real SCIPgetOrigObjoffset(SCIP *scip)
    Definition: scip_prob.c:1529
    int SCIPgetNOrigContImplVars(SCIP *scip)
    Definition: scip_prob.c:3006
    SCIP_VAR ** SCIPgetOrigVars(SCIP *scip)
    Definition: scip_prob.c:2811
    int SCIPgetNOrigContVars(SCIP *scip)
    Definition: scip_prob.c:3035
    SCIP_RETCODE SCIPsetProbExitsol(SCIP *scip, SCIP_DECL_PROBEXITSOL((*probexitsol)))
    Definition: scip_prob.c:287
    int SCIPgetNOrigIntVars(SCIP *scip)
    Definition: scip_prob.c:2896
    SCIP_CONS ** SCIPgetConss(SCIP *scip)
    Definition: scip_prob.c:3666
    SCIP_RETCODE SCIPsetProbTrans(SCIP *scip, SCIP_DECL_PROBTRANS((*probtrans)))
    Definition: scip_prob.c:223
    SCIP_RETCODE SCIPsetProbDelorig(SCIP *scip, SCIP_DECL_PROBDELORIG((*probdelorig)))
    Definition: scip_prob.c:202
    int SCIPgetNOrigImplVars(SCIP *scip)
    Definition: scip_prob.c:2925
    SCIP_Real SCIPgetObjlimit(SCIP *scip)
    Definition: scip_prob.c:1731
    SCIP_RETCODE SCIPaddObjoffset(SCIP *scip, SCIP_Real addval)
    Definition: scip_prob.c:1443
    int SCIPgetNUpgrConss(SCIP *scip)
    Definition: scip_prob.c:3578
    int SCIPgetNVars(SCIP *scip)
    Definition: scip_prob.c:2246
    SCIP_RETCODE SCIPaddCons(SCIP *scip, SCIP_CONS *cons)
    Definition: scip_prob.c:3274
    SCIP_RETCODE SCIPchgReoptObjective(SCIP *scip, SCIP_OBJSENSE objsense, SCIP_VAR **vars, SCIP_Real *coefs, int nvars)
    Definition: scip_prob.c:1294
    SCIP_CONS * SCIPfindOrigCons(SCIP *scip, const char *name)
    Definition: scip_prob.c:3476
    SCIP_RETCODE SCIPdelCons(SCIP *scip, SCIP_CONS *cons)
    Definition: scip_prob.c:3420
    int SCIPgetNConss(SCIP *scip)
    Definition: scip_prob.c:3620
    SCIP_RETCODE SCIPfreeProb(SCIP *scip)
    Definition: scip_prob.c:835
    SCIP_PROBDATA * SCIPgetProbData(SCIP *scip)
    Definition: scip_prob.c:1139
    SCIP_VAR ** SCIPgetVars(SCIP *scip)
    Definition: scip_prob.c:2201
    SCIP_Real SCIPgetObjNorm(SCIP *scip)
    Definition: scip_prob.c:1880
    SCIP_Bool SCIPallVarsInProb(SCIP *scip)
    Definition: scip_prob.c:3247
    int SCIPgetNOrigVars(SCIP *scip)
    Definition: scip_prob.c:2838
    SCIP_RETCODE SCIPprintTransProblem(SCIP *scip, FILE *file, const char *extension, SCIP_Bool genericnames)
    Definition: scip_prob.c:696
    SCIP_RETCODE SCIPprintOrigProblem(SCIP *scip, FILE *file, const char *extension, SCIP_Bool genericnames)
    Definition: scip_prob.c:652
    int SCIPgetNOrigBinImplVars(SCIP *scip)
    Definition: scip_prob.c:2952
    SCIP_RETCODE SCIPsetProbInitsol(SCIP *scip, SCIP_DECL_PROBINITSOL((*probinitsol)))
    Definition: scip_prob.c:265
    int SCIPgetNOrigIntImplVars(SCIP *scip)
    Definition: scip_prob.c:2979
    int SCIPgetNIntImplVars(SCIP *scip)
    Definition: scip_prob.c:2477
    int SCIPgetNContImplVars(SCIP *scip)
    Definition: scip_prob.c:2522
    SCIP_RETCODE SCIPdelVar(SCIP *scip, SCIP_VAR *var, SCIP_Bool *deleted)
    Definition: scip_prob.c:2041
    SCIP_RETCODE SCIPsetObjsense(SCIP *scip, SCIP_OBJSENSE objsense)
    Definition: scip_prob.c:1417
    SCIP_RETCODE SCIPaddOrigObjoffset(SCIP *scip, SCIP_Real addval)
    Definition: scip_prob.c:1486
    SCIP_RETCODE SCIPcreateProbBasic(SCIP *scip, const char *name)
    Definition: scip_prob.c:182
    SCIP_CONS ** SCIPgetOrigConss(SCIP *scip)
    Definition: scip_prob.c:3739
    SCIP_OBJSENSE SCIPgetObjsense(SCIP *scip)
    Definition: scip_prob.c:1400
    SCIP_RETCODE SCIPwriteTransProblem(SCIP *scip, const char *filename, const char *extension, SCIP_Bool genericnames)
    Definition: scip_prob.c:789
    int SCIPgetNFixedVars(SCIP *scip)
    Definition: scip_prob.c:2705
    SCIP_RETCODE SCIPcreateProb(SCIP *scip, const char *name, SCIP_DECL_PROBDELORIG((*probdelorig)), SCIP_DECL_PROBTRANS((*probtrans)), SCIP_DECL_PROBDELTRANS((*probdeltrans)), SCIP_DECL_PROBINITSOL((*probinitsol)), SCIP_DECL_PROBEXITSOL((*probexitsol)), SCIP_DECL_PROBCOPY((*probcopy)), SCIP_PROBDATA *probdata)
    Definition: scip_prob.c:119
    SCIP_RETCODE SCIPsetProbData(SCIP *scip, SCIP_PROBDATA *probdata)
    Definition: scip_prob.c:1189
    SCIP_RATIONAL * SCIPgetOrigObjoffsetExact(SCIP *scip)
    Definition: scip_prob.c:1556
    int SCIPgetNBinVars(SCIP *scip)
    Definition: scip_prob.c:2293
    SCIP_VAR ** SCIPgetFixedVars(SCIP *scip)
    Definition: scip_prob.c:2662
    int SCIPgetNTotalVars(SCIP *scip)
    Definition: scip_prob.c:3064
    SCIP_Real SCIPgetTransObjscale(SCIP *scip)
    Definition: scip_prob.c:1629
    SCIP_RETCODE SCIPsetProbCopy(SCIP *scip, SCIP_DECL_PROBCOPY((*probcopy)))
    Definition: scip_prob.c:308
    SCIP_Bool SCIPisObjIntegral(SCIP *scip)
    Definition: scip_prob.c:1801
    SCIP_VAR * SCIPfindVar(SCIP *scip, const char *name)
    Definition: scip_prob.c:3189
    SCIP_CONS * SCIPfindCons(SCIP *scip, const char *name)
    Definition: scip_prob.c:3525
    SCIP_RETCODE SCIPaddOrigObjoffsetExact(SCIP *scip, SCIP_RATIONAL *addval)
    Definition: scip_prob.c:1465
    SCIP_RETCODE SCIPreadProb(SCIP *scip, const char *filename, const char *extension)
    Definition: scip_prob.c:341
    SCIP_RETCODE SCIPupdateNodeLowerbound(SCIP *scip, SCIP_NODE *node, SCIP_Real newbound)
    Definition: scip_prob.c:4354
    SCIP_RETCODE SCIPupdateLocalLowerbound(SCIP *scip, SCIP_Real newbound)
    Definition: scip_prob.c:4289
    SCIP_Real SCIPgetNodeDualbound(SCIP *scip, SCIP_NODE *node)
    Definition: scip_prob.c:4198
    SCIP_RETCODE SCIPdelConsNode(SCIP *scip, SCIP_NODE *node, SCIP_CONS *cons)
    Definition: scip_prob.c:4017
    SCIP_Real SCIPgetLocalOrigEstimate(SCIP *scip)
    Definition: scip_prob.c:4120
    SCIP_RETCODE SCIPdelConsLocal(SCIP *scip, SCIP_CONS *cons)
    Definition: scip_prob.c:4067
    SCIP_RETCODE SCIPaddConsNode(SCIP *scip, SCIP_NODE *node, SCIP_CONS *cons, SCIP_NODE *validnode)
    Definition: scip_prob.c:3901
    SCIP_RETCODE SCIPclearConflictStore(SCIP *scip, SCIP_EVENT *event)
    Definition: scip_prob.c:3864
    SCIP_Real SCIPgetLocalLowerbound(SCIP *scip)
    Definition: scip_prob.c:4178
    SCIP_RETCODE SCIPupdateLocalDualbound(SCIP *scip, SCIP_Real newbound)
    Definition: scip_prob.c:4239
    SCIP_RETCODE SCIPaddConflict(SCIP *scip, SCIP_NODE *node, SCIP_CONS **cons, SCIP_NODE *validnode, SCIP_CONFTYPE conftype, SCIP_Bool iscutoffinvolved)
    Definition: scip_prob.c:3806
    SCIP_RETCODE SCIPchgChildPrio(SCIP *scip, SCIP_NODE *child, SCIP_Real priority)
    Definition: scip_prob.c:4388
    SCIP_RETCODE SCIPupdateNodeDualbound(SCIP *scip, SCIP_NODE *node, SCIP_Real newbound)
    Definition: scip_prob.c:4330
    SCIP_Real SCIPgetLocalDualbound(SCIP *scip)
    Definition: scip_prob.c:4159
    SCIP_RETCODE SCIPaddConsLocal(SCIP *scip, SCIP_CONS *cons, SCIP_NODE *validnode)
    Definition: scip_prob.c:3986
    SCIP_Real SCIPgetNodeLowerbound(SCIP *scip, SCIP_NODE *node)
    Definition: scip_prob.c:4215
    SCIP_Real SCIPgetLocalTransEstimate(SCIP *scip)
    Definition: scip_prob.c:4139
    #define SCIPdebugMsg
    Definition: scip_message.h:78
    SCIP_RETCODE SCIPgetBoolParam(SCIP *scip, const char *name, SCIP_Bool *value)
    Definition: scip_param.c:250
    void SCIPrandomPermuteArray(SCIP_RANDNUMGEN *randnumgen, void **array, int begin, int end)
    Definition: misc.c:10294
    int SCIPconshdlrGetNCheckConss(SCIP_CONSHDLR *conshdlr)
    Definition: cons.c:4798
    int SCIPgetNConshdlrs(SCIP *scip)
    Definition: scip_cons.c:964
    const char * SCIPconshdlrGetName(SCIP_CONSHDLR *conshdlr)
    Definition: cons.c:4316
    SCIP_Bool SCIPconshdlrIsExact(SCIP_CONSHDLR *conshdlr)
    Definition: cons.c:4357
    int SCIPconshdlrGetNActiveConss(SCIP_CONSHDLR *conshdlr)
    Definition: cons.c:4812
    SCIP_CONS ** SCIPconshdlrGetConss(SCIP_CONSHDLR *conshdlr)
    Definition: cons.c:4735
    SCIP_CONSHDLR ** SCIPgetConshdlrs(SCIP *scip)
    Definition: scip_cons.c:953
    SCIP_Bool SCIPconsIsConflict(SCIP_CONS *cons)
    Definition: cons.c:8538
    SCIP_CONSHDLR * SCIPconsGetHdlr(SCIP_CONS *cons)
    Definition: cons.c:8409
    int SCIPconsGetActiveDepth(SCIP_CONS *cons)
    Definition: cons.c:8439
    int SCIPconsGetNUpgradeLocks(SCIP_CONS *cons)
    Definition: cons.c:8841
    int SCIPconsGetValidDepth(SCIP_CONS *cons)
    Definition: cons.c:8472
    SCIP_Bool SCIPconsIsGlobal(SCIP_CONS *cons)
    Definition: cons.c:8618
    const char * SCIPconsGetName(SCIP_CONS *cons)
    Definition: cons.c:8389
    SCIP_Bool SCIPconsIsAdded(SCIP_CONS *cons)
    Definition: cons.c:8818
    SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
    Definition: scip_cons.c:1173
    SCIP_EVENTTYPE SCIPeventGetType(SCIP_EVENT *event)
    Definition: event.c:1194
    SCIP_SOL * SCIPeventGetSol(SCIP_EVENT *event)
    Definition: event.c:1567
    SCIP_Bool SCIPisExact(SCIP *scip)
    Definition: scip_exact.c:193
    BMS_BLKMEM * SCIPblkmem(SCIP *scip)
    Definition: scip_mem.c:57
    BMS_BUFMEM * SCIPbuffer(SCIP *scip)
    Definition: scip_mem.c:72
    #define SCIPallocClearBufferArray(scip, ptr, num)
    Definition: scip_mem.h:126
    #define SCIPfreeBufferArray(scip, ptr)
    Definition: scip_mem.h:136
    #define SCIPduplicateBufferArray(scip, ptr, source, num)
    Definition: scip_mem.h:132
    SCIP_NODETYPE SCIPnodeGetType(SCIP_NODE *node)
    Definition: tree.c:8473
    SCIP_Real SCIPnodeGetLowerbound(SCIP_NODE *node)
    Definition: tree.c:8503
    SCIP_Real SCIPnodeGetEstimate(SCIP_NODE *node)
    Definition: tree.c:8523
    int SCIPnodeGetDepth(SCIP_NODE *node)
    Definition: tree.c:8493
    void SCIPrationalSetReal(SCIP_RATIONAL *res, SCIP_Real real)
    Definition: rational.cpp:603
    void SCIPrationalFreeBuffer(BMS_BUFMEM *bufmem, SCIP_RATIONAL **rational)
    Definition: rational.cpp:473
    SCIP_RETCODE SCIPrationalCreateBuffer(BMS_BUFMEM *bufmem, SCIP_RATIONAL **rational)
    Definition: rational.cpp:123
    const char * SCIPreaderGetName(SCIP_READER *reader)
    Definition: reader.c:680
    SCIP_RETCODE SCIPenableReoptimization(SCIP *scip, SCIP_Bool enable)
    Definition: scip_solve.c:3153
    SCIP_Real SCIPtransformObj(SCIP *scip, SCIP_Real obj)
    Definition: scip_sol.c:2107
    SCIP_Bool SCIPsolIsOriginal(SCIP_SOL *sol)
    Definition: sol.c:4140
    SCIP_RETCODE SCIPfreeTransform(SCIP *scip)
    Definition: scip_solve.c:3462
    SCIP_Real SCIPgetCutoffbound(SCIP *scip)
    SCIP_Real SCIPgetReadingTime(SCIP *scip)
    Definition: scip_timing.c:405
    SCIP_Real SCIPinfinity(SCIP *scip)
    SCIP_Bool SCIPisIntegral(SCIP *scip, SCIP_Real val)
    SCIP_Bool SCIPisPositive(SCIP *scip, SCIP_Real val)
    SCIP_Bool SCIPisZero(SCIP *scip, SCIP_Real val)
    SCIP_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
    SCIP_VARSTATUS SCIPvarGetStatus(SCIP_VAR *var)
    Definition: var.c:23386
    SCIP_Real SCIPvarGetObj(SCIP_VAR *var)
    Definition: var.c:23900
    int SCIPvarGetProbindex(SCIP_VAR *var)
    Definition: var.c:23662
    const char * SCIPvarGetName(SCIP_VAR *var)
    Definition: var.c:23267
    SCIP_Bool SCIPvarIsExact(SCIP_VAR *var)
    Definition: var.c:23407
    SCIP_Bool SCIPvarIsIntegral(SCIP_VAR *var)
    Definition: var.c:23490
    SCIP_VAR * SCIPvarGetNegationVar(SCIP_VAR *var)
    Definition: var.c:23878
    SCIP_Bool SCIPvarIsOriginal(SCIP_VAR *var)
    Definition: var.c:23417
    SCIP_RETCODE SCIPchgVarObj(SCIP *scip, SCIP_VAR *var, SCIP_Real newobj)
    Definition: scip_var.c:5372
    SCIP_RETCODE SCIPaddVarObj(SCIP *scip, SCIP_VAR *var, SCIP_Real addobj)
    Definition: scip_var.c:5519
    void SCIPfreeRandom(SCIP *scip, SCIP_RANDNUMGEN **randnumgen)
    SCIP_RETCODE SCIPcreateRandom(SCIP *scip, SCIP_RANDNUMGEN **randnumgen, unsigned int initialseed, SCIP_Bool useglobalseed)
    void SCIPprintSysError(const char *message)
    Definition: misc.c:10719
    void SCIPlpRecalculateObjSqrNorm(SCIP_SET *set, SCIP_LP *lp)
    Definition: lp.c:18080
    SCIP_Real SCIPlpGetObjNorm(SCIP_LP *lp)
    Definition: lp.c:18111
    internal methods for LP management
    memory allocation routines
    #define BMSduplicateMemoryArray(ptr, source, num)
    Definition: memory.h:143
    #define BMSfreeMemoryArray(ptr)
    Definition: memory.h:147
    void SCIPmessagePrintWarning(SCIP_MESSAGEHDLR *messagehdlr, const char *formatstr,...)
    Definition: message.c:427
    void SCIPmessagePrintVerbInfo(SCIP_MESSAGEHDLR *messagehdlr, SCIP_VERBLEVEL verblevel, SCIP_VERBLEVEL msgverblevel, const char *formatstr,...)
    Definition: message.c:678
    SCIP_RETCODE SCIPpricerDeactivate(SCIP_PRICER *pricer, SCIP_SET *set)
    Definition: pricer.c:377
    internal methods for variable pricers
    SCIP_RETCODE SCIPpricestoreAddVar(SCIP_PRICESTORE *pricestore, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_EVENTQUEUE *eventqueue, SCIP_LP *lp, SCIP_VAR *var, SCIP_Real score, SCIP_Bool root)
    Definition: pricestore.c:181
    internal methods for storing priced variables
    void SCIPprimalAddOrigObjoffsetExact(SCIP_PRIMAL *primal, SCIP_SET *set, SCIP_RATIONAL *addval)
    Definition: primal.c:752
    void SCIPprimalAddOrigObjoffset(SCIP_PRIMAL *primal, SCIP_SET *set, SCIP_Real addval)
    Definition: primal.c:719
    SCIP_RETCODE SCIPprimalFree(SCIP_PRIMAL **primal, BMS_BLKMEM *blkmem)
    Definition: primal.c:165
    SCIP_RETCODE SCIPprimalCreate(SCIP_PRIMAL **primal)
    Definition: primal.c:133
    SCIP_RETCODE SCIPprimalUpdateObjoffset(SCIP_PRIMAL *primal, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp)
    Definition: primal.c:590
    SCIP_RETCODE SCIPprimalUpdateObjlimit(SCIP_PRIMAL *primal, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp)
    Definition: primal.c:550
    internal methods for collecting primal CIP solutions and primal informations
    SCIP_Bool SCIPprobIsPermuted(SCIP_PROB *prob)
    Definition: prob.c:2783
    void SCIPprobSetTrans(SCIP_PROB *prob, SCIP_DECL_PROBTRANS((*probtrans)))
    Definition: prob.c:379
    void SCIPprobSetInitsol(SCIP_PROB *prob, SCIP_DECL_PROBINITSOL((*probinitsol)))
    Definition: prob.c:401
    void SCIPprobSetObjIntegral(SCIP_PROB *prob)
    Definition: prob.c:1724
    const char * SCIPprobGetName(SCIP_PROB *prob)
    Definition: prob.c:2859
    int SCIPprobGetNObjVars(SCIP_PROB *prob, SCIP_SET *set)
    Definition: prob.c:2423
    SCIP_RETCODE SCIPprobPerformVarDeletions(SCIP_PROB *prob, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand)
    Definition: prob.c:1233
    void SCIPprobSetExitsol(SCIP_PROB *prob, SCIP_DECL_PROBEXITSOL((*probexitsol)))
    Definition: prob.c:412
    SCIP_Real SCIPprobGetObjlim(SCIP_PROB *prob, SCIP_SET *set)
    Definition: prob.c:2837
    void SCIPprobUpdateDualbound(SCIP_PROB *prob, SCIP_Real newbound)
    Definition: prob.c:1891
    SCIP_RETCODE SCIPprobSetName(SCIP_PROB *prob, const char *name)
    Definition: prob.c:2409
    void SCIPprobSetDeltrans(SCIP_PROB *prob, SCIP_DECL_PROBDELTRANS((*probdeltrans)))
    Definition: prob.c:390
    void SCIPprobSetData(SCIP_PROB *prob, SCIP_PROBDATA *probdata)
    Definition: prob.c:778
    void SCIPprobAddObjoffset(SCIP_PROB *prob, SCIP_Real addval)
    Definition: prob.c:1669
    void SCIPprobSetCopy(SCIP_PROB *prob, SCIP_DECL_PROBCOPY((*probcopy)))
    Definition: prob.c:423
    SCIP_VAR * SCIPprobFindVar(SCIP_PROB *prob, const char *name)
    Definition: prob.c:2626
    int SCIPprobGetNImplVars(SCIP_PROB *prob)
    Definition: prob.c:2895
    SCIP_RETCODE SCIPprobCreate(SCIP_PROB **prob, BMS_BLKMEM *blkmem, SCIP_SET *set, const char *name, SCIP_DECL_PROBDELORIG((*probdelorig)), SCIP_DECL_PROBTRANS((*probtrans)), SCIP_DECL_PROBDELTRANS((*probdeltrans)), SCIP_DECL_PROBINITSOL((*probinitsol)), SCIP_DECL_PROBEXITSOL((*probexitsol)), SCIP_DECL_PROBCOPY((*probcopy)), SCIP_PROBDATA *probdata, SCIP_Bool transformed)
    Definition: prob.c:272
    void SCIPprobSetObjlim(SCIP_PROB *prob, SCIP_Real objlim)
    Definition: prob.c:1713
    SCIP_RETCODE SCIPprobDelVar(SCIP_PROB *prob, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_EVENTQUEUE *eventqueue, SCIP_VAR *var, SCIP_Bool *deleted)
    Definition: prob.c:1171
    SCIP_Bool SCIPprobIsObjIntegral(SCIP_PROB *prob)
    Definition: prob.c:2813
    SCIP_RETCODE SCIPprobAddVar(SCIP_PROB *prob, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_VAR *var)
    Definition: prob.c:1096
    SCIP_CONS * SCIPprobFindCons(SCIP_PROB *prob, const char *name)
    Definition: prob.c:2645
    void SCIPprobMarkPermuted(SCIP_PROB *prob)
    Definition: prob.c:2793
    SCIP_PROBDATA * SCIPprobGetData(SCIP_PROB *prob)
    Definition: prob.c:2849
    SCIP_Real SCIPprobExternObjval(SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_SET *set, SCIP_Real objval)
    Definition: prob.c:2520
    SCIP_RETCODE SCIPprobFree(SCIP_PROB **prob, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_EVENTQUEUE *eventqueue, SCIP_LP *lp)
    Definition: prob.c:434
    SCIP_RETCODE SCIPprobAddCons(SCIP_PROB *prob, SCIP_SET *set, SCIP_STAT *stat, SCIP_CONS *cons)
    Definition: prob.c:1507
    void SCIPprobSetDelorig(SCIP_PROB *prob, SCIP_DECL_PROBDELORIG((*probdelorig)))
    Definition: prob.c:368
    void SCIPprobAddObjoffsetExact(SCIP_PROB *prob, SCIP_RATIONAL *addval)
    Definition: prob.c:1685
    void SCIPprobSetObjsense(SCIP_PROB *prob, SCIP_OBJSENSE objsense)
    Definition: prob.c:1656
    SCIP_Real SCIPprobInternObjval(SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_SET *set, SCIP_Real objval)
    Definition: prob.c:2573
    internal methods for storing and manipulating the main problem
    public methods for managing constraints
    public methods for managing events
    public methods for message output
    #define SCIPerrorMessage
    Definition: pub_message.h:64
    public data structures and miscellaneous methods
    public methods for input file readers
    public methods for primal CIP solutions
    public methods for branch and bound tree
    public methods for problem variables
    SCIP_RETCODE SCIPreaderWrite(SCIP_READER *reader, SCIP_PROB *prob, SCIP_SET *set, SCIP_MESSAGEHDLR *msghdlr, FILE *file, const char *filename, const char *format, SCIP_Bool genericnames, SCIP_RESULT *result)
    Definition: reader.c:277
    SCIP_RETCODE SCIPreaderRead(SCIP_READER *reader, SCIP_SET *set, const char *filename, const char *extension, SCIP_RESULT *result)
    Definition: reader.c:183
    SCIP_RETCODE SCIPreaderResetReadingTime(SCIP_READER *reader)
    Definition: reader.c:751
    internal methods for input file readers
    SCIP_RETCODE SCIPreoptAddCons(SCIP_REOPT *reopt, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_CONS *cons)
    Definition: reopt.c:8060
    SCIP_RETCODE SCIPreoptFree(SCIP_REOPT **reopt, SCIP_SET *set, SCIP_PRIMAL *origprimal, BMS_BLKMEM *blkmem)
    Definition: reopt.c:5125
    data structures and methods for collecting reoptimization information
    public methods for constraint handler plugins and constraints
    public methods for exact solving
    general public methods
    public methods for memory management
    public methods for message handling
    public methods for numerical tolerances
    public methods for SCIP parameter handling
    static SCIP_RETCODE writeProblem(SCIP *scip, const char *filename, const char *extension, SCIP_Bool transformed, SCIP_Bool genericnames)
    Definition: scip_prob.c:549
    static SCIP_RETCODE printProblem(SCIP *scip, SCIP_PROB *prob, FILE *file, const char *filename, const char *extension, SCIP_Bool genericnames)
    Definition: scip_prob.c:499
    public methods for global and local (sub)problems
    public methods for random numbers
    public methods for solutions
    public solving methods
    public methods for querying solving statistics
    public methods for timing
    public methods for the branch-and-bound tree
    public methods for SCIP variables
    SCIP_RETCODE SCIPsetFreeConcsolvers(SCIP_SET *set)
    Definition: set.c:4818
    internal methods for global SCIP settings
    SCIP_RETCODE SCIPbendersDeactivate(SCIP_BENDERS *benders, SCIP_SET *set)
    Definition: benders.c:2890
    internal methods for Benders' decomposition
    SCIP_RETCODE SCIPstatFree(SCIP_STAT **stat, BMS_BLKMEM *blkmem)
    Definition: stat.c:129
    SCIP_RETCODE SCIPstatCreate(SCIP_STAT **stat, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_MESSAGEHDLR *messagehdlr)
    Definition: stat.c:56
    internal methods for problem statistics
    int validdepth
    Definition: struct_cons.h:67
    int addarraypos
    Definition: struct_cons.h:56
    SCIP_CONSSETCHG * addconssetchg
    Definition: struct_cons.h:54
    datastructures for constraints and constraint handlers
    data structures for LP management
    datastructures for block memory pools and memory buffers
    datastructures for collecting primal CIP solutions and primal informations
    datastructures for storing and manipulating the main problem
    SCIP main data structure.
    datastructures for global SCIP settings
    datastructures for problem statistics
    datastructures for problem variables
    Definition: heur_padm.c:135
    SCIP_RETCODE SCIPsyncstoreExit(SCIP_SYNCSTORE *syncstore)
    Definition: syncstore.c:204
    SCIP_Bool SCIPsyncstoreIsInitialized(SCIP_SYNCSTORE *syncstore)
    Definition: syncstore.c:795
    the function declarations for the synchronization store
    SCIP_RETCODE SCIPnodeDelCons(SCIP_NODE *node, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_TREE *tree, SCIP_CONS *cons)
    Definition: tree.c:1739
    SCIP_RETCODE SCIPnodeCutoff(SCIP_NODE *node, SCIP_SET *set, SCIP_STAT *stat, SCIP_EVENTFILTER *eventfilter, SCIP_TREE *tree, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_REOPT *reopt, SCIP_LP *lp, BMS_BLKMEM *blkmem)
    Definition: tree.c:1259
    SCIP_NODE * SCIPtreeGetCurrentNode(SCIP_TREE *tree)
    Definition: tree.c:9462
    int SCIPtreeGetEffectiveRootDepth(SCIP_TREE *tree)
    Definition: tree.c:9518
    SCIP_RETCODE SCIPnodeAddCons(SCIP_NODE *node, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_TREE *tree, SCIP_CONS *cons)
    Definition: tree.c:1696
    void SCIPchildChgNodeselPrio(SCIP_TREE *tree, SCIP_NODE *child, SCIP_Real priority)
    Definition: tree.c:3066
    int SCIPtreeGetCurrentDepth(SCIP_TREE *tree)
    Definition: tree.c:9479
    SCIP_RETCODE SCIPnodeUpdateLowerbound(SCIP_NODE *node, SCIP_STAT *stat, SCIP_SET *set, SCIP_EVENTFILTER *eventfilter, SCIP_TREE *tree, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_Real newbound, SCIP_RATIONAL *newboundexact)
    Definition: tree.c:2851
    internal methods for branch and bound tree
    @ SCIP_CONFTYPE_BNDEXCEEDING
    Definition: type_conflict.h:64
    enum SCIP_ConflictType SCIP_CONFTYPE
    Definition: type_conflict.h:68
    #define SCIP_EVENTTYPE_BESTSOLFOUND
    Definition: type_event.h:106
    @ SCIP_VERBLEVEL_HIGH
    Definition: type_message.h:61
    @ SCIP_VERBLEVEL_NORMAL
    Definition: type_message.h:60
    @ SCIP_VERBLEVEL_FULL
    Definition: type_message.h:62
    #define SCIP_DECL_PROBCOPY(x)
    Definition: type_prob.h:150
    #define SCIP_DECL_PROBDELTRANS(x)
    Definition: type_prob.h:95
    #define SCIP_DECL_PROBEXITSOL(x)
    Definition: type_prob.h:119
    struct SCIP_ProbData SCIP_PROBDATA
    Definition: type_prob.h:53
    @ SCIP_OBJSENSE_MAXIMIZE
    Definition: type_prob.h:47
    @ SCIP_OBJSENSE_MINIMIZE
    Definition: type_prob.h:48
    #define SCIP_DECL_PROBDELORIG(x)
    Definition: type_prob.h:64
    #define SCIP_DECL_PROBTRANS(x)
    Definition: type_prob.h:83
    #define SCIP_DECL_PROBINITSOL(x)
    Definition: type_prob.h:106
    enum SCIP_Objsense SCIP_OBJSENSE
    Definition: type_prob.h:50
    @ SCIP_DIDNOTRUN
    Definition: type_result.h:42
    @ SCIP_SUCCESS
    Definition: type_result.h:58
    enum SCIP_Result SCIP_RESULT
    Definition: type_result.h:61
    @ SCIP_FILECREATEERROR
    Definition: type_retcode.h:48
    @ SCIP_NOFILE
    Definition: type_retcode.h:47
    @ SCIP_READERROR
    Definition: type_retcode.h:45
    @ SCIP_INVALIDDATA
    Definition: type_retcode.h:52
    @ SCIP_PLUGINNOTFOUND
    Definition: type_retcode.h:54
    @ SCIP_WRITEERROR
    Definition: type_retcode.h:46
    @ SCIP_NOMEMORY
    Definition: type_retcode.h:44
    @ SCIP_OKAY
    Definition: type_retcode.h:42
    @ SCIP_INVALIDCALL
    Definition: type_retcode.h:51
    enum SCIP_Retcode SCIP_RETCODE
    Definition: type_retcode.h:63
    @ SCIP_STAGE_PROBLEM
    Definition: type_set.h:45
    @ SCIP_STAGE_INITPRESOLVE
    Definition: type_set.h:48
    @ SCIP_STAGE_SOLVED
    Definition: type_set.h:54
    @ SCIP_STAGE_PRESOLVING
    Definition: type_set.h:49
    @ SCIP_STAGE_TRANSFORMED
    Definition: type_set.h:47
    @ SCIP_STAGE_INITSOLVE
    Definition: type_set.h:52
    @ SCIP_STAGE_EXITPRESOLVE
    Definition: type_set.h:50
    @ SCIP_STAGE_EXITSOLVE
    Definition: type_set.h:55
    @ SCIP_STAGE_INIT
    Definition: type_set.h:44
    @ SCIP_STAGE_FREE
    Definition: type_set.h:57
    @ SCIP_STAGE_FREETRANS
    Definition: type_set.h:56
    @ SCIP_STAGE_SOLVING
    Definition: type_set.h:53
    @ SCIP_STAGE_TRANSFORMING
    Definition: type_set.h:46
    @ SCIP_STAGE_PRESOLVED
    Definition: type_set.h:51
    @ SCIP_NODETYPE_CHILD
    Definition: type_tree.h:44
    @ SCIP_NODETYPE_PROBINGNODE
    Definition: type_tree.h:42
    @ SCIP_VARSTATUS_ORIGINAL
    Definition: type_var.h:51
    @ SCIP_VARSTATUS_COLUMN
    Definition: type_var.h:53
    @ SCIP_VARSTATUS_NEGATED
    Definition: type_var.h:57
    @ SCIP_VARSTATUS_LOOSE
    Definition: type_var.h:52