Scippy

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