SCIP

    Solving Constraint Integer Programs

    heur_simplerounding.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-2026 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 heur_simplerounding.c
    26 * @ingroup DEFPLUGINS_HEUR
    27 * @brief simple and fast LP rounding heuristic
    28 * @author Tobias Achterberg
    29 * @author Marc Pfetsch
    30 *
    31 * The heuristic also tries to round relaxation solutions if available.
    32 */
    33
    34/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
    35
    38#include "scip/pub_heur.h"
    39#include "scip/pub_message.h"
    40#include "scip/pub_var.h"
    41#include "scip/scip_branch.h"
    42#include "scip/scip_heur.h"
    43#include "scip/scip_lp.h"
    44#include "scip/scip_mem.h"
    45#include "scip/scip_message.h"
    46#include "scip/scip_numerics.h"
    47#include "scip/scip_param.h"
    48#include "scip/scip_prob.h"
    49#include "scip/scip_sol.h"
    51#include "scip/scip_var.h"
    52
    53
    54#define HEUR_NAME "simplerounding"
    55#define HEUR_DESC "simple and fast LP rounding heuristic"
    56#define HEUR_DISPCHAR SCIP_HEURDISPCHAR_ROUNDING
    57#define HEUR_PRIORITY -30
    58#define HEUR_FREQ 1
    59#define HEUR_FREQOFS 0
    60#define HEUR_MAXDEPTH -1
    61#define HEUR_TIMING SCIP_HEURTIMING_DURINGLPLOOP | SCIP_HEURTIMING_DURINGPRICINGLOOP
    62#define HEUR_USESSUBSCIP FALSE /**< does the heuristic use a secondary SCIP instance? */
    63
    64#define DEFAULT_ONCEPERNODE FALSE /**< should the heuristic only be called once per node? */
    65
    66/* locally defined heuristic data */
    67struct SCIP_HeurData
    68{
    69 SCIP_SOL* sol; /**< working solution */
    70 SCIP_Longint lastlp; /**< last LP number where the heuristic was applied */
    71 int nroundablevars; /**< number of variables that can be rounded (-1 if not yet calculated) */
    72 SCIP_Bool oncepernode; /**< should the heuristic only be called once per node? */
    73};
    74
    75
    76/*
    77 * Local methods
    78 */
    79
    80/** perform rounding */
    81static
    83 SCIP* scip, /**< SCIP main data structure */
    84 SCIP_SOL* sol, /**< solution to round */
    85 SCIP_VAR** cands, /**< candidate variables */
    86 SCIP_Real* candssol, /**< solutions of candidate variables */
    87 int ncands, /**< number of candidates */
    88 SCIP_RESULT* result /**< pointer to store the result of the heuristic call */
    89 )
    90{
    91 int nunroundableimplints = 0;
    92 int c;
    93
    94 /* round all roundable fractional variables as long as no unroundable variable was found */
    95 for( c = 0; c < ncands; ++c )
    96 {
    97 SCIP_VAR* var;
    98 SCIP_Real oldsolval;
    99 SCIP_Real newsolval;
    100 SCIP_Bool mayrounddown;
    101 SCIP_Bool mayroundup;
    102
    103 oldsolval = candssol[c];
    104 assert( ! SCIPisFeasIntegral(scip, oldsolval) );
    105 var = cands[c];
    106 assert( SCIPvarGetStatus(var) == SCIP_VARSTATUS_COLUMN );
    107 mayrounddown = SCIPvarMayRoundDown(var);
    108 mayroundup = SCIPvarMayRoundUp(var);
    109 SCIPdebugMsg(scip, "simple rounding heuristic: var <%s>, val=%g, rounddown=%u, roundup=%u\n",
    110 SCIPvarGetName(var), oldsolval, mayrounddown, mayroundup);
    111
    112 /* choose rounding direction */
    113 if ( mayrounddown && mayroundup )
    114 {
    115 /* we can round in both directions: round in objective function direction */
    116 if ( SCIPvarGetObj(var) >= 0.0 )
    117 newsolval = SCIPfeasFloor(scip, oldsolval);
    118 else
    119 newsolval = SCIPfeasCeil(scip, oldsolval);
    120 }
    121 else if ( mayrounddown )
    122 newsolval = SCIPfeasFloor(scip, oldsolval);
    123 else if ( mayroundup )
    124 newsolval = SCIPfeasCeil(scip, oldsolval);
    125 else if( SCIPvarIsImpliedIntegral(var) )
    126 {
    127 ++nunroundableimplints;
    128 continue;
    129 }
    130 else
    131 break;
    132
    133 /* store new solution value */
    134 SCIP_CALL( SCIPsetSolVal(scip, sol, var, newsolval) );
    135 }
    136
    137 /* check, if rounding was successful */
    138 if( c == ncands )
    139 {
    140 SCIP_Bool stored;
    141 SCIP_Bool checklprows;
    142
    143 /* unroundable implied integral variables are adjusted, LP rows must be checked afterwards */
    144 if( nunroundableimplints > 0 )
    145 {
    147 checklprows = TRUE;
    148 }
    149 else
    150 checklprows = FALSE;
    151
    152 if( SCIPallColsInLP(scip) )
    153 {
    154 /* check solution for feasibility, and add it to solution store if possible
    155 * integrality need not be checked, because all fractional
    156 * variables were already moved in feasible direction to the next integer
    157 *
    158 * feasibility of LP rows must be checked again at the presence of
    159 * unroundable implied integral variables with fractional LP solution value
    160 */
    161 SCIP_CALL( SCIPtrySol(scip, sol, FALSE, FALSE, FALSE, FALSE, checklprows, &stored) );
    162 }
    163 else
    164 {
    165 /* if there are variables which are not present in the LP, e.g., for
    166 * column generation, we need to check their bounds
    167 */
    168 SCIP_CALL( SCIPtrySol(scip, sol, FALSE, FALSE, TRUE, FALSE, checklprows, &stored) );
    169 }
    170
    171 if( stored )
    172 {
    173#ifdef SCIP_DEBUG
    174 SCIPdebugMsg(scip, "found feasible rounded solution:\n");
    176#endif
    177 *result = SCIP_FOUNDSOL;
    178 }
    179 }
    180 return SCIP_OKAY;
    181}
    182
    183/** perform LP-rounding */
    184static
    186 SCIP* scip, /**< SCIP main data structure */
    187 SCIP_HEURDATA* heurdata, /**< heuristic data */
    188 SCIP_HEURTIMING heurtiming, /**< heuristic timing mask */
    189 SCIP_RESULT* result /**< pointer to store the result of the heuristic call */
    190 )
    191{
    192 SCIP_SOL* sol;
    193 SCIP_VAR** lpcands;
    194 SCIP_Real* lpcandssol;
    195 SCIP_Longint nlps;
    196 int nlpcands;
    197 int nfracimplvars;
    198
    199 /* only call heuristic, if an optimal LP solution is at hand */
    201 return SCIP_OKAY;
    202
    203 /* only call heuristic, if the LP objective value is smaller than the cutoff bound */
    205 return SCIP_OKAY;
    206
    207 /* get fractional variables, that should be integral */
    208 SCIP_CALL( SCIPgetLPBranchCands(scip, &lpcands, &lpcandssol, NULL, &nlpcands, NULL, &nfracimplvars) );
    209
    210 /* only call heuristic, if LP solution is fractional; except we are called during pricing, in this case we
    211 * want to detect a (mixed) integer (LP) solution which is primal feasible
    212 */
    213 if ( nlpcands == 0 && heurtiming != SCIP_HEURTIMING_DURINGPRICINGLOOP )
    214 return SCIP_OKAY;
    215
    216 /* don't call heuristic, if there are more fractional variables than roundable ones. We do not consider
    217 * fractional continuous implied integer variables here, because simple rounding may adjust those separately,
    218 * even if they aren't roundable
    219 */
    220 if ( nlpcands > heurdata->nroundablevars )
    221 return SCIP_OKAY;
    222
    223 /* get the working solution from heuristic's local data */
    224 sol = heurdata->sol;
    225 assert( sol != NULL );
    226
    227 /* copy the current LP solution to the working solution */
    229
    230 /* don't call heuristic, if we have already processed the current LP solution */
    231 nlps = SCIPgetNLPs(scip);
    232 if( nlps == heurdata->lastlp )
    233 return SCIP_OKAY;
    234 heurdata->lastlp = nlps;
    235
    236 /* perform simple rounding */
    237 SCIPdebugMsg(scip, "executing simple LP-rounding heuristic, fractionals: %d + %d\n", nlpcands, nfracimplvars);
    238 SCIP_CALL( performSimpleRounding(scip, sol, lpcands, lpcandssol, nlpcands + nfracimplvars, result) );
    239
    240 return SCIP_OKAY;
    241}
    242
    243/** perform relaxation solution rounding */
    244static
    246 SCIP* scip, /**< SCIP main data structure */
    247 SCIP_HEURDATA* heurdata, /**< heuristic data */
    248 SCIP_RESULT* result /**< pointer to store the result of the heuristic call */
    249 )
    250{
    251 SCIP_VAR** vars;
    252 SCIP_VAR** relaxcands;
    253 SCIP_SOL* sol;
    254 SCIP_Real* relaxcandssol;
    255 int nrelaxcands = 0;
    256 int nbinvars;
    257 int nintvars;
    258 int nimplvars;
    259 int nintegervars;
    260 int ndiscretevars;
    261 int v;
    262
    263 /* do not call heuristic if no relaxation solution is available */
    265 return SCIP_OKAY;
    266
    267 /* get integral variables */
    268 SCIP_CALL( SCIPgetVarsData(scip, &vars, NULL, &nbinvars, &nintvars, &nimplvars, NULL) );
    269 nintegervars = nbinvars + nintvars;
    270 ndiscretevars = nintegervars + nimplvars;
    271
    272 /* get storage */
    273 SCIP_CALL( SCIPallocBufferArray(scip, &relaxcands, ndiscretevars) );
    274 SCIP_CALL( SCIPallocBufferArray(scip, &relaxcandssol, ndiscretevars) );
    275
    276 /* get fractional non-implied integral variables */
    277 for( v = 0; v < nintegervars; ++v )
    278 {
    279 SCIP_Real val;
    280
    281 val = SCIPgetRelaxSolVal(scip, vars[v]);
    282 if( !SCIPisFeasIntegral(scip, val) )
    283 {
    284 relaxcands[nrelaxcands] = vars[v];
    285 relaxcandssol[nrelaxcands++] = val;
    286 }
    287 }
    288
    289 /* don't call heuristic, if there are more fractional variables than roundable ones. We explicitly
    290 * do not consider implied integral variables with fractional relaxation solution here
    291 * because they may be feasibly adjusted, although they are not roundable
    292 */
    293 if( nrelaxcands > heurdata->nroundablevars )
    294 {
    295 SCIPfreeBufferArray(scip, &relaxcands);
    296 SCIPfreeBufferArray(scip, &relaxcandssol);
    297 return SCIP_OKAY;
    298 }
    299
    300 /* collect implied integral variables with fractional solution value */
    301 for( v = nintegervars; v < ndiscretevars; ++v )
    302 {
    303 SCIP_Real val;
    304
    305 val = SCIPgetRelaxSolVal(scip, vars[v]);
    306 if( !SCIPisFeasIntegral(scip, val) )
    307 {
    308 relaxcands[nrelaxcands] = vars[v];
    309 relaxcandssol[nrelaxcands++] = val;
    310 }
    311 }
    312
    313 /* get the working solution from heuristic's local data */
    314 sol = heurdata->sol;
    315 assert( sol != NULL );
    316
    317 /* copy the current relaxation solution to the working solution */
    319
    320 /* perform simple rounding */
    321 SCIPdebugMsg(scip, "executing simple rounding heuristic on relaxation solution: %d fractionals\n", nrelaxcands);
    322 SCIP_CALL( performSimpleRounding(scip, sol, relaxcands, relaxcandssol, nrelaxcands, result) );
    323
    324 /* free storage */
    325 SCIPfreeBufferArray(scip, &relaxcands);
    326 SCIPfreeBufferArray(scip, &relaxcandssol);
    327
    328 return SCIP_OKAY;
    329}
    330
    331
    332/*
    333 * Callback methods
    334 */
    335
    336/** copy method for primal heuristic plugins (called when SCIP copies plugins) */
    337static
    338SCIP_DECL_HEURCOPY(heurCopySimplerounding)
    339{ /*lint --e{715}*/
    340 assert(scip != NULL);
    341 assert(heur != NULL);
    342
    344
    345 /* call inclusion method of primal heuristic */
    347
    348 return SCIP_OKAY;
    349}
    350
    351/** destructor of primal heuristic to free user data (called when SCIP is exiting) */
    352static
    353SCIP_DECL_HEURFREE(heurFreeSimplerounding) /*lint --e{715}*/
    354{ /*lint --e{715}*/
    355 SCIP_HEURDATA* heurdata;
    356
    357 assert(heur != NULL);
    358 assert(scip != NULL);
    359
    361
    362 /* free heuristic data */
    363 heurdata = SCIPheurGetData(heur);
    364 assert(heurdata != NULL);
    365 SCIPfreeBlockMemory(scip, &heurdata);
    366 SCIPheurSetData(heur, NULL);
    367
    368 return SCIP_OKAY;
    369}
    370
    371
    372/** initialization method of primal heuristic (called after problem was transformed) */
    373static
    374SCIP_DECL_HEURINIT(heurInitSimplerounding) /*lint --e{715}*/
    375{ /*lint --e{715}*/
    376 SCIP_HEURDATA* heurdata;
    377
    379
    380 heurdata = SCIPheurGetData(heur);
    381 assert(heurdata != NULL);
    382
    383 /* create heuristic data */
    384 SCIP_CALL( SCIPcreateSol(scip, &heurdata->sol, heur) );
    385 heurdata->lastlp = -1;
    386 heurdata->nroundablevars = -1;
    387
    388 return SCIP_OKAY;
    389}
    390
    391
    392/** deinitialization method of primal heuristic (called before transformed problem is freed) */
    393static
    394SCIP_DECL_HEUREXIT(heurExitSimplerounding) /*lint --e{715}*/
    395{ /*lint --e{715}*/
    396 SCIP_HEURDATA* heurdata;
    397
    399
    400 /* free heuristic data */
    401 heurdata = SCIPheurGetData(heur);
    402 assert(heurdata != NULL);
    403 SCIP_CALL( SCIPfreeSol(scip, &heurdata->sol) );
    404
    405 return SCIP_OKAY;
    406}
    407
    408
    409/** solving process initialization method of primal heuristic (called when branch and bound process is about to begin) */
    410static
    411SCIP_DECL_HEURINITSOL(heurInitsolSimplerounding)
    412{
    413 SCIP_HEURDATA* heurdata;
    414
    416
    417 heurdata = SCIPheurGetData(heur);
    418 assert(heurdata != NULL);
    419 heurdata->lastlp = -1;
    420
    421 /* change the heuristic's timingmask, if it should be called only once per node */
    422 if( heurdata->oncepernode )
    424
    425 return SCIP_OKAY;
    426}
    427
    428
    429/** solving process deinitialization method of primal heuristic (called before branch and bound process data is freed) */
    430static
    431SCIP_DECL_HEUREXITSOL(heurExitsolSimplerounding)
    432{
    433 /* reset the timing mask to its default value */
    435
    436 return SCIP_OKAY;
    437}
    438
    439
    440/** execution method of primal heuristic */
    441static
    442SCIP_DECL_HEUREXEC(heurExecSimplerounding) /*lint --e{715}*/
    443{ /*lint --e{715}*/
    444 SCIP_HEURDATA* heurdata;
    445 int nbinintvars;
    446
    447 assert(SCIPhasCurrentNodeLP(scip));
    448 assert(result != NULL);
    449
    451
    452 *result = SCIP_DIDNOTRUN;
    453
    454 /* get nonimplied integral variable number */
    455 nbinintvars = SCIPgetNBinVars(scip) + SCIPgetNIntVars(scip);
    456
    457 /* only call heuristic if there are integral variables */
    458 if( nbinintvars == 0 )
    459 return SCIP_OKAY;
    460
    461 /* get heuristic data */
    462 heurdata = SCIPheurGetData(heur);
    463 assert(heurdata != NULL);
    464
    465 /* only call heuristic if there are roundable variables; except we are called during pricing, in this case we
    466 * want to detect a (mixed) integer (LP) solution which is primal feasible
    467 */
    468 if( heurtiming != SCIP_HEURTIMING_DURINGPRICINGLOOP && heurdata->nroundablevars == 0 )
    469 return SCIP_OKAY;
    470
    471 /* only call heuristic if an optimal LP solution or a relaxation solution is available */
    473 return SCIP_OKAY;
    474
    475 /* only call heuristic if the LP objective value is smaller than the cutoff bound */
    477 return SCIP_OKAY;
    478
    479 /* only call heuristic if the current LP solution is not already processed or a relaxation solution is available */
    480 if( SCIPgetNLPs(scip) == heurdata->lastlp && !SCIPisRelaxSolValid(scip) )
    481 return SCIP_OKAY;
    482
    483 /* on our first call or after each pricing round, calculate the number of roundable variables */
    484 if( heurtiming == SCIP_HEURTIMING_DURINGPRICINGLOOP || heurdata->nroundablevars == -1 )
    485 {
    486 SCIP_VAR** vars;
    487 int i;
    488
    489 heurdata->nroundablevars = 0;
    490 vars = SCIPgetVars(scip);
    491
    492 for( i = 0; i < nbinintvars; ++i )
    493 {
    494 if( SCIPvarMayRoundDown(vars[i]) || SCIPvarMayRoundUp(vars[i]) )
    495 ++heurdata->nroundablevars;
    496 }
    497
    498 /* only call heuristic if there are roundable variables; except we are called during pricing, in this case we
    499 * want to detect a (mixed) integer (LP) solution which is primal feasible
    500 */
    501 if( heurtiming != SCIP_HEURTIMING_DURINGPRICINGLOOP && heurdata->nroundablevars == 0 )
    502 return SCIP_OKAY;
    503 }
    504
    505 *result = SCIP_DIDNOTFIND;
    506
    507 /* try to round LP solution */
    508 SCIP_CALL( performLPSimpleRounding(scip, heurdata, heurtiming, result) );
    509
    510 /* try to round relaxation solution */
    511 SCIP_CALL( performRelaxSimpleRounding(scip, heurdata, result) );
    512
    513 return SCIP_OKAY;
    514}
    515
    516/*
    517 * heuristic specific interface methods
    518 */
    519
    520/** creates the simple rounding heuristic and includes it in SCIP */
    522 SCIP* scip /**< SCIP data structure */
    523 )
    524{
    525 SCIP_HEURDATA* heurdata;
    526 SCIP_HEUR* heur;
    527
    528 /* create heuristic data */
    529 SCIP_CALL( SCIPallocBlockMemory(scip, &heurdata) );
    530
    531 /* include primal heuristic */
    534 HEUR_MAXDEPTH, HEUR_TIMING, HEUR_USESSUBSCIP, heurExecSimplerounding, heurdata) );
    535 assert(heur != NULL);
    536
    537 /* primal heuristic is safe to use in exact solving mode */
    538 SCIPheurMarkExact(heur);
    539
    540 /* set non-NULL pointers to callback methods */
    541 SCIP_CALL( SCIPsetHeurCopy(scip, heur, heurCopySimplerounding) );
    542 SCIP_CALL( SCIPsetHeurInit(scip, heur, heurInitSimplerounding) );
    543 SCIP_CALL( SCIPsetHeurExit(scip, heur, heurExitSimplerounding) );
    544 SCIP_CALL( SCIPsetHeurInitsol(scip, heur, heurInitsolSimplerounding) );
    545 SCIP_CALL( SCIPsetHeurExitsol(scip, heur, heurExitsolSimplerounding) );
    546 SCIP_CALL( SCIPsetHeurFree(scip, heur, heurFreeSimplerounding) );
    547
    548 SCIP_CALL( SCIPaddBoolParam(scip, "heuristics/" HEUR_NAME "/oncepernode",
    549 "should the heuristic only be called once per node?",
    550 &heurdata->oncepernode, TRUE, DEFAULT_ONCEPERNODE, NULL, NULL) );
    551
    552 return SCIP_OKAY;
    553}
    #define NULL
    Definition: def.h:257
    #define SCIP_Longint
    Definition: def.h:150
    #define SCIP_Bool
    Definition: def.h:100
    #define SCIP_STRINGEQ(name, reference, retcode)
    Definition: def.h:454
    #define SCIP_Real
    Definition: def.h:165
    #define TRUE
    Definition: def.h:102
    #define FALSE
    Definition: def.h:103
    #define SCIP_CALL(x)
    Definition: def.h:364
    int SCIPgetNIntVars(SCIP *scip)
    Definition: scip_prob.c:2340
    SCIP_RETCODE SCIPgetVarsData(SCIP *scip, SCIP_VAR ***vars, int *nvars, int *nbinvars, int *nintvars, int *nimplvars, int *ncontvars)
    Definition: scip_prob.c:2115
    SCIP_VAR ** SCIPgetVars(SCIP *scip)
    Definition: scip_prob.c:2201
    int SCIPgetNBinVars(SCIP *scip)
    Definition: scip_prob.c:2293
    #define SCIPdebugMsg
    Definition: scip_message.h:78
    SCIP_RETCODE SCIPaddBoolParam(SCIP *scip, const char *name, const char *desc, SCIP_Bool *valueptr, SCIP_Bool isadvanced, SCIP_Bool defaultvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
    Definition: scip_param.c:57
    SCIP_RETCODE SCIPincludeHeurSimplerounding(SCIP *scip)
    SCIP_RETCODE SCIPgetLPBranchCands(SCIP *scip, SCIP_VAR ***lpcands, SCIP_Real **lpcandssol, SCIP_Real **lpcandsfrac, int *nlpcands, int *npriolpcands, int *nfracimplvars)
    Definition: scip_branch.c:402
    SCIP_RETCODE SCIPsetHeurExitsol(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEUREXITSOL((*heurexitsol)))
    Definition: scip_heur.c:247
    SCIP_RETCODE SCIPsetHeurCopy(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURCOPY((*heurcopy)))
    Definition: scip_heur.c:167
    SCIP_HEURDATA * SCIPheurGetData(SCIP_HEUR *heur)
    Definition: heur.c:1368
    SCIP_RETCODE SCIPincludeHeurBasic(SCIP *scip, SCIP_HEUR **heur, const char *name, const char *desc, char dispchar, int priority, int freq, int freqofs, int maxdepth, SCIP_HEURTIMING timingmask, SCIP_Bool usessubscip, SCIP_DECL_HEUREXEC((*heurexec)), SCIP_HEURDATA *heurdata)
    Definition: scip_heur.c:122
    SCIP_RETCODE SCIPsetHeurFree(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURFREE((*heurfree)))
    Definition: scip_heur.c:183
    SCIP_RETCODE SCIPsetHeurExit(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEUREXIT((*heurexit)))
    Definition: scip_heur.c:215
    void SCIPheurSetTimingmask(SCIP_HEUR *heur, SCIP_HEURTIMING timingmask)
    Definition: heur.c:1507
    SCIP_RETCODE SCIPsetHeurInitsol(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURINITSOL((*heurinitsol)))
    Definition: scip_heur.c:231
    void SCIPheurMarkExact(SCIP_HEUR *heur)
    Definition: heur.c:1457
    SCIP_RETCODE SCIPsetHeurInit(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURINIT((*heurinit)))
    Definition: scip_heur.c:199
    const char * SCIPheurGetName(SCIP_HEUR *heur)
    Definition: heur.c:1467
    void SCIPheurSetData(SCIP_HEUR *heur, SCIP_HEURDATA *heurdata)
    Definition: heur.c:1378
    SCIP_Bool SCIPhasCurrentNodeLP(SCIP *scip)
    Definition: scip_lp.c:87
    SCIP_LPSOLSTAT SCIPgetLPSolstat(SCIP *scip)
    Definition: scip_lp.c:174
    SCIP_Bool SCIPallColsInLP(SCIP *scip)
    Definition: scip_lp.c:655
    SCIP_Real SCIPgetLPObjval(SCIP *scip)
    Definition: scip_lp.c:253
    #define SCIPallocBufferArray(scip, ptr, num)
    Definition: scip_mem.h:124
    #define SCIPfreeBufferArray(scip, ptr)
    Definition: scip_mem.h:136
    #define SCIPfreeBlockMemory(scip, ptr)
    Definition: scip_mem.h:108
    #define SCIPallocBlockMemory(scip, ptr)
    Definition: scip_mem.h:89
    SCIP_RETCODE SCIPcreateSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
    Definition: scip_sol.c:514
    SCIP_RETCODE SCIPfreeSol(SCIP *scip, SCIP_SOL **sol)
    Definition: scip_sol.c:1250
    SCIP_RETCODE SCIPprintSol(SCIP *scip, SCIP_SOL *sol, FILE *file, SCIP_Bool printzeros)
    Definition: scip_sol.c:2351
    SCIP_RETCODE SCIPadjustImplicitSolVals(SCIP *scip, SCIP_SOL *sol, SCIP_Bool uselprows)
    Definition: scip_sol.c:2307
    SCIP_RETCODE SCIPlinkRelaxSol(SCIP *scip, SCIP_SOL *sol)
    Definition: scip_sol.c:1386
    SCIP_RETCODE SCIPtrySol(SCIP *scip, SCIP_SOL *sol, SCIP_Bool printreason, SCIP_Bool completely, SCIP_Bool checkbounds, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool *stored)
    Definition: scip_sol.c:4017
    SCIP_RETCODE SCIPlinkLPSol(SCIP *scip, SCIP_SOL *sol)
    Definition: scip_sol.c:1293
    SCIP_RETCODE SCIPsetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var, SCIP_Real val)
    Definition: scip_sol.c:1569
    SCIP_Longint SCIPgetNLPs(SCIP *scip)
    SCIP_Real SCIPgetCutoffbound(SCIP *scip)
    SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
    SCIP_Real SCIPfeasCeil(SCIP *scip, SCIP_Real val)
    SCIP_Real SCIPfeasFloor(SCIP *scip, SCIP_Real val)
    SCIP_Bool SCIPisFeasIntegral(SCIP *scip, SCIP_Real val)
    SCIP_Bool SCIPvarMayRoundUp(SCIP_VAR *var)
    Definition: var.c:4478
    SCIP_VARSTATUS SCIPvarGetStatus(SCIP_VAR *var)
    Definition: var.c:23418
    SCIP_Bool SCIPvarIsImpliedIntegral(SCIP_VAR *var)
    Definition: var.c:23530
    SCIP_Bool SCIPvarMayRoundDown(SCIP_VAR *var)
    Definition: var.c:4467
    SCIP_Real SCIPvarGetObj(SCIP_VAR *var)
    Definition: var.c:23932
    const char * SCIPvarGetName(SCIP_VAR *var)
    Definition: var.c:23299
    SCIP_Real SCIPgetRelaxSolVal(SCIP *scip, SCIP_VAR *var)
    Definition: scip_var.c:3347
    SCIP_Bool SCIPisRelaxSolValid(SCIP *scip)
    Definition: scip_var.c:3281
    static SCIP_DECL_HEURFREE(heurFreeSimplerounding)
    #define HEUR_TIMING
    static SCIP_DECL_HEUREXITSOL(heurExitsolSimplerounding)
    #define HEUR_FREQOFS
    #define HEUR_DESC
    #define DEFAULT_ONCEPERNODE
    static SCIP_DECL_HEURCOPY(heurCopySimplerounding)
    static SCIP_DECL_HEURINITSOL(heurInitsolSimplerounding)
    #define HEUR_DISPCHAR
    #define HEUR_MAXDEPTH
    static SCIP_RETCODE performSimpleRounding(SCIP *scip, SCIP_SOL *sol, SCIP_VAR **cands, SCIP_Real *candssol, int ncands, SCIP_RESULT *result)
    #define HEUR_PRIORITY
    #define HEUR_NAME
    static SCIP_RETCODE performLPSimpleRounding(SCIP *scip, SCIP_HEURDATA *heurdata, SCIP_HEURTIMING heurtiming, SCIP_RESULT *result)
    static SCIP_DECL_HEUREXEC(heurExecSimplerounding)
    static SCIP_DECL_HEURINIT(heurInitSimplerounding)
    #define HEUR_FREQ
    static SCIP_RETCODE performRelaxSimpleRounding(SCIP *scip, SCIP_HEURDATA *heurdata, SCIP_RESULT *result)
    #define HEUR_USESSUBSCIP
    static SCIP_DECL_HEUREXIT(heurExitSimplerounding)
    Simple and fast LP rounding heuristic.
    memory allocation routines
    public methods for primal heuristics
    public methods for message output
    public methods for problem variables
    public methods for branching rule plugins and branching
    public methods for primal heuristic plugins and divesets
    public methods for the LP relaxation, rows and columns
    public methods for memory management
    public methods for message handling
    public methods for numerical tolerances
    public methods for SCIP parameter handling
    public methods for global and local (sub)problems
    public methods for solutions
    public methods for querying solving statistics
    public methods for SCIP variables
    struct SCIP_HeurData SCIP_HEURDATA
    Definition: type_heur.h:77
    @ SCIP_LPSOLSTAT_OPTIMAL
    Definition: type_lp.h:44
    @ SCIP_DIDNOTRUN
    Definition: type_result.h:42
    @ SCIP_DIDNOTFIND
    Definition: type_result.h:44
    @ SCIP_FOUNDSOL
    Definition: type_result.h:56
    enum SCIP_Result SCIP_RESULT
    Definition: type_result.h:61
    @ SCIP_OKAY
    Definition: type_retcode.h:42
    @ SCIP_INVALIDCALL
    Definition: type_retcode.h:51
    enum SCIP_Retcode SCIP_RETCODE
    Definition: type_retcode.h:63
    #define SCIP_HEURTIMING_DURINGPRICINGLOOP
    Definition: type_timing.h:91
    unsigned int SCIP_HEURTIMING
    Definition: type_timing.h:103
    #define SCIP_HEURTIMING_AFTERLPNODE
    Definition: type_timing.h:83
    @ SCIP_VARSTATUS_COLUMN
    Definition: type_var.h:53