Scippy

SCIP

Solving Constraint Integer Programs

prop_nlobbt.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 prop_nlobbt.c
17  * @ingroup DEFPLUGINS_PROP
18  * @brief nlobbt propagator
19  * @author Benjamin Mueller
20  */
21 
22 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
23 
24 #include "blockmemshell/memory.h"
25 #include "scip/prop_genvbounds.h"
26 #include "scip/prop_nlobbt.h"
27 #include "scip/pub_message.h"
28 #include "scip/pub_misc.h"
29 #include "scip/pub_misc_sort.h"
30 #include "scip/pub_nlp.h"
31 #include "scip/pub_prop.h"
32 #include "scip/pub_tree.h"
33 #include "scip/pub_var.h"
34 #include "scip/scip_general.h"
35 #include "scip/scip_lp.h"
36 #include "scip/scip_mem.h"
37 #include "scip/scip_message.h"
38 #include "scip/scip_nlp.h"
39 #include "scip/scip_nlpi.h"
40 #include "scip/scip_numerics.h"
41 #include "scip/scip_param.h"
42 #include "scip/scip_prob.h"
43 #include "scip/scip_probing.h"
44 #include "scip/scip_prop.h"
45 #include "scip/scip_randnumgen.h"
46 #include "scip/scip_solvingstats.h"
47 #include "scip/scip_timing.h"
48 #include "scip/scip_tree.h"
49 #include "scip/scip_var.h"
50 #include <string.h>
51 
52 #define PROP_NAME "nlobbt"
53 #define PROP_DESC "propagator template"
54 #define PROP_PRIORITY -1100000
55 #define PROP_FREQ -1
56 #define PROP_DELAY TRUE
57 #define PROP_TIMING SCIP_PROPTIMING_AFTERLPLOOP
58 
59 #define DEFAULT_MINNONCONVEXFRAC 0.20 /**< default minimum (# convex nlrows)/(# nonconvex nlrows) threshold to apply propagator */
60 #define DEFAULT_MINLINEARFRAC 0.02 /**< default minimum (# convex nlrows)/(# linear nlrows) threshold to apply propagator */
61 #define DEFAULT_FEASTOLFAC 0.01 /**< default factor for NLP feasibility tolerance */
62 #define DEFAULT_RELOBJTOLFAC 0.01 /**< default factor for NLP relative objective tolerance */
63 #define DEFAULT_ADDLPROWS TRUE /**< should (non-initial) LP rows be used? */
64 #define DEFAULT_ITLIMITFACTOR 2.0 /**< multiple of root node LP iterations used as total LP iteration
65  * limit for nlobbt (<= 0: no limit ) */
66 #define DEFAULT_NLPITERLIMIT 500 /**< default iteration limit of NLP solver; 0 for no limit */
67 #define DEFAULT_NLPTIMELIMIT 0.0 /**< default time limit of NLP solver; 0.0 for no limit */
68 #define DEFAULT_NLPVERLEVEL 0 /**< verbosity level of NLP solver */
69 #define DEFAULT_RANDSEED 79 /**< initial random seed */
70 
71 /*
72  * Data structures
73  */
74 
75 /* status of bound candidates */
76 #define UNSOLVED 1 /**< did not solve LB or UB problem */
77 #define SOLVEDLB 2 /**< solved LB problem */
78 #define SOLVEDUB 4 /**< solved UB problem */
79 
80 /** propagator data */
81 struct SCIP_PropData
82 {
83  SCIP_NLPI* nlpi; /**< nlpi used to create the nlpi problem */
84  SCIP_NLPIPROBLEM* nlpiprob; /**< nlpi problem representing the convex NLP relaxation */
85  SCIP_HASHMAP* var2nlpiidx; /**< mapping between variables and nlpi indices */
86  SCIP_VAR** nlpivars; /**< array containing all variables of the nlpi */
87  int nlpinvars; /**< total number of nlpi variables */
88  SCIP_Real* nlscore; /**< score for each nonlinear variable */
89  int* status; /**< array containing a bound status for each candidate */
90  SCIP_PROP* genvboundprop; /**< genvbound propagator */
91  SCIP_RANDNUMGEN* randnumgen; /**< random number generator */
92  SCIP_Bool skipprop; /**< should the propagator be skipped? */
93  SCIP_Longint lastnode; /**< number of last node where obbt was performed */
94  int currpos; /**< current position in the nlpivars array */
95 
96  int nlpiterlimit; /**< iteration limit of NLP solver; 0 for no limit */
97  SCIP_Real nlptimelimit; /**< time limit of NLP solver; 0.0 for no limit */
98  int nlpverblevel; /**< verbosity level of NLP solver */
99  SCIP_NLPSTATISTICS nlpstatistics; /**< statistics from NLP solver */
100 
101  SCIP_Real feastolfac; /**< factor for NLP feasibility tolerance */
102  SCIP_Real relobjtolfac; /**< factor for NLP relative objective tolerance */
103  SCIP_Real minnonconvexfrac; /**< minimum (#convex nlrows)/(#nonconvex nlrows) threshold to apply propagator */
104  SCIP_Real minlinearfrac; /**< minimum (#convex nlrows)/(#linear nlrows) threshold to apply propagator */
105  SCIP_Bool addlprows; /**< should (non-initial) LP rows be used? */
106  SCIP_Real itlimitfactor; /**< LP iteration limit for nlobbt will be this factor times total LP
107  * iterations in root node */
108 };
109 
110 /*
111  * Local methods
112  */
113 
114 /** clears the propagator data */
115 static
117  SCIP* scip, /**< SCIP data structure */
118  SCIP_PROPDATA* propdata /**< propagator data */
119  )
120 {
121  assert(propdata != NULL);
122 
123  if( propdata->nlpiprob != NULL )
124  {
125  assert(propdata->nlpi != NULL);
126 
127  SCIPfreeBlockMemoryArray(scip, &propdata->status, propdata->nlpinvars);
128  SCIPfreeBlockMemoryArray(scip, &propdata->nlscore, propdata->nlpinvars);
129  SCIPfreeBlockMemoryArray(scip, &propdata->nlpivars, propdata->nlpinvars);
130  SCIPhashmapFree(&propdata->var2nlpiidx);
131  SCIP_CALL( SCIPfreeNlpiProblem(scip, propdata->nlpi, &propdata->nlpiprob) );
132 
133  propdata->nlpinvars = 0;
134  }
135  assert(propdata->nlpinvars == 0);
136 
137  propdata->skipprop = FALSE;
138  propdata->currpos = 0;
139  propdata->lastnode = -1;
140 
141  return SCIP_OKAY;
142 }
143 
144 /** checks whether it is worth to call nonlinear OBBT procedure */
145 static
147  SCIP* scip, /**< SCIP data structure */
148  SCIP_PROPDATA* propdata /**< propagation data */
149  )
150 {
151  SCIP_NLROW** nlrows;
152  int nnonconvexnlrows;
153  int nconvexnlrows;
154  int nlinearnlrows;
155  int nnlrows;
156  int i;
157 
158  nlrows = SCIPgetNLPNlRows(scip);
159  nnlrows = SCIPgetNNLPNlRows(scip);
160  nnonconvexnlrows = 0;
161  nconvexnlrows = 0;
162  nlinearnlrows = 0;
163 
164  for( i = 0; i < nnlrows; ++i )
165  {
166  if( SCIPnlrowGetExpr(nlrows[i]) == NULL )
167  ++nlinearnlrows;
168  else if( SCIPnlrowGetCurvature(nlrows[i]) == SCIP_EXPRCURV_CONVEX )
169  {
170  if( !SCIPisInfinity(scip, SCIPnlrowGetRhs(nlrows[i])) )
171  ++nconvexnlrows;
172  if( !SCIPisInfinity(scip, -SCIPnlrowGetLhs(nlrows[i])) )
173  ++nnonconvexnlrows;
174  }
175  else if( SCIPnlrowGetCurvature(nlrows[i]) == SCIP_EXPRCURV_CONCAVE )
176  {
177  if( !SCIPisInfinity(scip, SCIPnlrowGetRhs(nlrows[i])) )
178  ++nnonconvexnlrows;
179  if( !SCIPisInfinity(scip, -SCIPnlrowGetLhs(nlrows[i])) )
180  ++nconvexnlrows;
181  }
182  else
183  {
184  if( !SCIPisInfinity(scip, SCIPnlrowGetRhs(nlrows[i])) )
185  ++nnonconvexnlrows;
186  if( !SCIPisInfinity(scip, -SCIPnlrowGetLhs(nlrows[i])) )
187  ++nnonconvexnlrows;
188  }
189  }
190 
191  SCIPdebugMsg(scip, "nconvex=%d nnonconvex=%d nlinear=%d\n", nconvexnlrows, nnonconvexnlrows, nlinearnlrows);
192 
193  return nconvexnlrows > 0
194  && nnonconvexnlrows > 0
195  && (SCIPisGE(scip, (SCIP_Real)nconvexnlrows, nnonconvexnlrows * propdata->minnonconvexfrac))
196  && (SCIPisGE(scip, (SCIP_Real)nconvexnlrows, nlinearnlrows * propdata->minlinearfrac));
197 }
198 
199 /** filters variables which achieve their lower or dual bound in the current NLP solution */
200 static
202  SCIP* scip, /**< SCIP data structure */
203  SCIP_PROPDATA* propdata /**< propagator data */
204  )
205 {
206  SCIP_Real* primal;
207  int i;
208 
209  assert(propdata->currpos >= 0 && propdata->currpos < propdata->nlpinvars);
210  assert(SCIPgetNlpiSolstat(scip, propdata->nlpi, propdata->nlpiprob) <= SCIP_NLPSOLSTAT_FEASIBLE);
211 
212  SCIP_CALL( SCIPgetNlpiSolution(scip, propdata->nlpi, propdata->nlpiprob, &primal, NULL, NULL, NULL, NULL) );
213  assert(primal != NULL);
214 
215  /* we skip all candidates which have been processed already, i.e., starting at propdata->currpos + 1 */
216  for( i = propdata->currpos + 1; i < propdata->nlpinvars; ++i )
217  {
218  SCIP_VAR* var;
219  SCIP_Real val;
220  int varidx;
221 
222  /* only uninteresting variables left -> stop filtering */
223  if( SCIPisLE(scip, propdata->nlscore[i], 0.0) )
224  break;
225 
226  var = propdata->nlpivars[i];
227  assert(var != NULL && SCIPhashmapExists(propdata->var2nlpiidx, (void*)var));
228 
229  varidx = SCIPhashmapGetImageInt(propdata->var2nlpiidx, (void*)var);
230  assert(SCIPgetVars(scip)[varidx] == var);
231  val = primal[varidx];
232 
233  if( (propdata->status[i] & SOLVEDLB) == 0 && !SCIPisInfinity(scip, -val) /*lint !e641*/
234  && SCIPisFeasLE(scip, val, SCIPvarGetLbLocal(var)) )
235  {
236  SCIPdebugMsg(scip, "filter LB of %s in [%g,%g] with %g\n", SCIPvarGetName(var), SCIPvarGetLbLocal(var),
237  SCIPvarGetUbLocal(var), val);
238  propdata->status[i] |= SOLVEDLB; /*lint !e641*/
239  assert((propdata->status[i] & SOLVEDLB) != 0); /*lint !e641*/
240  }
241 
242  if( (propdata->status[i] & SOLVEDUB) == 0 && !SCIPisInfinity(scip, val) /*lint !e641*/
243  && SCIPisFeasGE(scip, val, SCIPvarGetUbLocal(var)) )
244  {
245  SCIPdebugMsg(scip, "filter UB of %s in [%g,%g] with %g\n", SCIPvarGetName(var), SCIPvarGetLbLocal(var),
246  SCIPvarGetUbLocal(var), val);
247  propdata->status[i] |= SOLVEDUB; /*lint !e641*/
248  assert((propdata->status[i] & SOLVEDUB) != 0); /*lint !e641*/
249  }
250  }
251 
252  return SCIP_OKAY;
253 }
254 
255 /** tries to add a generalized variable bound by exploiting the dual solution of the last NLP solve (see @ref
256  * prop_nlobbt.h for more information)
257  */
258 static
260  SCIP* scip, /**< SCIP data structure */
261  SCIP_PROPDATA* propdata, /**< propagator data */
262  SCIP_VAR* var, /**< variable used in last NLP solve */
263  int varidx, /**< variable index in the propdata->nlpivars array */
264  SCIP_BOUNDTYPE boundtype, /**< type of bound provided by the genvbound */
265  SCIP_Real cutoffbound /**< cutoff bound */
266  )
267 {
268  SCIP_VAR** lvbvars;
269  SCIP_Real* lvbcoefs;
270  SCIP_Real* primal;
271  SCIP_Real* dual;
272  SCIP_Real* alpha;
273  SCIP_Real* beta;
274  SCIP_Real constant;
275  SCIP_Real mu;
276  int nlvbvars;
277  int i;
278 
279  assert(propdata->genvboundprop != NULL);
280  assert(var != NULL);
281  assert(varidx >= 0 && varidx < propdata->nlpinvars);
282  assert(SCIPgetNlpiSolstat(scip, propdata->nlpi, propdata->nlpiprob) <= SCIP_NLPSOLSTAT_LOCOPT);
283 
284  SCIP_CALL( SCIPgetNlpiSolution(scip, propdata->nlpi, propdata->nlpiprob, &primal, &dual, &alpha, &beta, NULL) );
285 
286  /* not possible to generate genvbound if the duals for the propagated variable do not disappear */
287  if( !SCIPisFeasZero(scip, alpha[varidx] - beta[varidx]) )
288  return SCIP_OKAY;
289 
290  SCIP_CALL( SCIPallocBufferArray(scip, &lvbcoefs, propdata->nlpinvars) );
291  SCIP_CALL( SCIPallocBufferArray(scip, &lvbvars, propdata->nlpinvars) );
292  constant = boundtype == SCIP_BOUNDTYPE_LOWER ? primal[varidx] : -primal[varidx];
293  mu = 0.0;
294  nlvbvars = 0;
295 
296  /* collect coefficients of genvbound */
297  for( i = 0; i < propdata->nlpinvars; ++i )
298  {
299  if( !SCIPisZero(scip, beta[i] - alpha[i]) )
300  {
301  lvbvars[nlvbvars] = propdata->nlpivars[i];
302  lvbcoefs[nlvbvars] = beta[i] - alpha[i];
303  ++nlvbvars;
304 
305  constant += (alpha[i] - beta[i]) * primal[i];
306  }
307  }
308 
309  /* first dual multiplier corresponds to the cutoff row if cutoffbound < SCIPinfinity() */
310  if( !SCIPisInfinity(scip, cutoffbound) && SCIPisGT(scip, dual[0], 0.0) )
311  {
312  mu = dual[0];
313  constant += mu * cutoffbound;
314  }
315 
316  /* add genvbound to genvbounds propagator */
317  if( !SCIPisInfinity(scip, REALABS(constant)) && (nlvbvars > 0 || SCIPisFeasGT(scip, mu, 0.0)) )
318  {
319  SCIP_CALL( SCIPgenVBoundAdd(scip, propdata->genvboundprop, lvbvars, var, lvbcoefs, nlvbvars, -mu, constant,
320  boundtype) );
321  SCIPdebugMsg(scip, "add genvbound for %s\n", SCIPvarGetName(var));
322  }
323 
324  SCIPfreeBufferArray(scip, &lvbvars);
325  SCIPfreeBufferArray(scip, &lvbcoefs);
326 
327  return SCIP_OKAY;
328 }
329 
330 /** sets the objective function, solves the NLP, and tightens the given variable; after calling this function, the
331  * objective function is set to zero
332  *
333  * @note function assumes that objective function is zero
334  */
335 static
337  SCIP* scip, /**< SCIP data structure */
338  SCIP_PROPDATA* propdata, /**< propagator data */
339  SCIP_VAR* var, /**< variable to propagate */
340  int varidx, /**< variable index in the propdata->nlpivars array */
341  SCIP_BOUNDTYPE boundtype, /**< minimize or maximize var? */
342  SCIP_NLPPARAM* nlpparam, /**< NLP solve parameters */
343  int* nlpiter, /**< buffer to store the total number of nlp iterations */
344  SCIP_RESULT* result /**< pointer to store result */
345  )
346 {
347  SCIP_Real timelimit;
348  SCIP_Real* primal;
349  SCIP_Real obj;
350  int iterlimit;
351 
352 #ifdef SCIP_DEBUG
353  SCIP_Real oldlb;
354  SCIP_Real oldub;
355 
356  oldlb = SCIPvarGetLbLocal(var);
357  oldub = SCIPvarGetUbLocal(var);
358 #endif
359 
360  assert(var != NULL);
361  assert(varidx >= 0 && varidx < propdata->nlpinvars);
362  assert(result != NULL && *result != SCIP_CUTOFF);
363 
364  *nlpiter = 0;
365 
366  /* set time and iteration limit */
367  SCIP_CALL( SCIPgetRealParam(scip, "limits/time", &timelimit) );
368  if( !SCIPisInfinity(scip, timelimit) )
369  {
370  timelimit -= SCIPgetSolvingTime(scip);
371  if( timelimit <= 0.0 )
372  {
373  SCIPdebugMsg(scip, "skip NLP solve; no time left\n");
374  return SCIP_OKAY;
375  }
376  }
377  if( propdata->nlptimelimit > 0.0 )
378  timelimit = MIN(propdata->nlptimelimit, timelimit);
379  iterlimit = propdata->nlpiterlimit > 0 ? propdata->nlpiterlimit : INT_MAX;
380  nlpparam->timelimit = timelimit;
381  nlpparam->iterlimit = iterlimit;
382 
383  /* set corresponding objective coefficient and solve NLP */
384  obj = boundtype == SCIP_BOUNDTYPE_LOWER ? 1.0 : -1.0;
385  SCIP_CALL( SCIPsetNlpiObjective(scip, propdata->nlpi, propdata->nlpiprob, 1, &varidx, &obj, NULL, 0.0) );
386 
387  SCIPdebugMsg(scip, "solve var=%s boundtype=%d nlscore=%g\n", SCIPvarGetName(var), boundtype,
388  propdata->nlscore[propdata->currpos]);
389  SCIP_CALL( SCIPsolveNlpiParam(scip, propdata->nlpi, propdata->nlpiprob, *nlpparam) );
390  SCIPdebugMsg(scip, "NLP solstat = %d\n", SCIPgetNlpiSolstat(scip, propdata->nlpi, propdata->nlpiprob));
391 
392  /* collect NLP statistics */
393  SCIP_CALL( SCIPgetNlpiStatistics(scip, propdata->nlpi, propdata->nlpiprob, &propdata->nlpstatistics) );
394  *nlpiter = propdata->nlpstatistics.niterations;
395  SCIPdebugMsg(scip, "iterations %d time %g\n", *nlpiter, propdata->nlpstatistics.totaltime);
396 
397  /* filter bound candidates first, otherwise we do not have access to the primal solution values */
398  if( SCIPgetNlpiSolstat(scip, propdata->nlpi, propdata->nlpiprob) <= SCIP_NLPSOLSTAT_FEASIBLE )
399  {
400  SCIP_CALL( filterCands(scip, propdata) );
401  }
402 
403  /* try to tighten variable bound */
404  if( SCIPgetNlpiSolstat(scip, propdata->nlpi, propdata->nlpiprob) <= SCIP_NLPSOLSTAT_LOCOPT )
405  {
406  SCIP_Bool tightened;
407  SCIP_Bool infeasible;
408 
409  /* try to add a genvbound in the root node */
410  if( propdata->genvboundprop != NULL && SCIPgetDepth(scip) == 0 )
411  {
412  SCIP_CALL( addGenVBound(scip, propdata, var, varidx, boundtype, SCIPgetCutoffbound(scip)) );
413  }
414 
415  SCIP_CALL( SCIPgetNlpiSolution(scip, propdata->nlpi, propdata->nlpiprob, &primal, NULL, NULL, NULL, NULL) );
416 
417  if( boundtype == SCIP_BOUNDTYPE_LOWER )
418  {
419  SCIP_CALL( SCIPtightenVarLb(scip, var, primal[varidx], FALSE, &infeasible, &tightened) );
420  }
421  else
422  {
423  SCIP_CALL( SCIPtightenVarUb(scip, var, primal[varidx], FALSE, &infeasible, &tightened) );
424  }
425 
426  if( infeasible )
427  {
428  SCIPdebugMsg(scip, "detect infeasibility after propagating %s\n", SCIPvarGetName(var));
429  *result = SCIP_CUTOFF;
430  }
431  else if( tightened )
432  {
433  SCIP_Real lb;
434  SCIP_Real ub;
435 
436  *result = SCIP_REDUCEDDOM;
437 
438  /* update bounds in NLP */
439  lb = SCIPvarGetLbLocal(var);
440  ub = SCIPvarGetUbLocal(var);
441  SCIP_CALL( SCIPchgNlpiVarBounds(scip, propdata->nlpi, propdata->nlpiprob, 1, &varidx, &lb, &ub) );
442 
443 #ifdef SCIP_DEBUG
444  SCIPdebugMsg(scip, "tightened bounds of %s from [%g,%g] to [%g,%g]\n", SCIPvarGetName(var), oldlb, oldub, lb, ub);
445 #endif
446  }
447  }
448 
449  /* reset objective function */
450  obj = 0.0;
451  SCIP_CALL( SCIPsetNlpiObjective(scip, propdata->nlpi, propdata->nlpiprob, 1, &varidx, &obj, NULL, 0.0) );
452 
453  return SCIP_OKAY;
454 }
455 
456 /** main method of the propagator
457  *
458  * creates a convex NLP relaxation and solves the OBBT-NLPs for each possible candidate;
459  * binary and variables with a small domain will be ignored to reduce the computational cost of the propagator; after
460  * solving each NLP we filter out all variable candidates which are on their lower or upper bound; candidates with a
461  * larger number of occurrences are preferred
462  */
463 static
465  SCIP* scip, /**< SCIP data structure */
466  SCIP_PROPDATA* propdata, /**< propagation data */
467  SCIP_RESULT* result /**< pointer to store result */
468  )
469 {
470  SCIP_NLPPARAM nlpparam = SCIP_NLPPARAM_DEFAULT(scip); /*lint !e446*/
471  int nlpiterleft;
472 
473  assert(result != NULL);
474  assert(!propdata->skipprop);
475  assert(SCIPgetNNlpis(scip) > 0);
476 
477  *result = SCIP_DIDNOTRUN;
478 
479  if( propdata->nlpiprob == NULL && !isNlobbtApplicable(scip, propdata) )
480  {
481  /* do not call the propagator anymore (except after a restart) */
482  SCIPdebugMsg(scip, "nlobbt propagator is not applicable\n");
483  propdata->skipprop = TRUE;
484  return SCIP_OKAY;
485  }
486 
487  *result = SCIP_DIDNOTFIND;
488 
489  /* compute NLP iteration limit */
490  if( propdata->itlimitfactor > 0.0 )
491  nlpiterleft = (int)(propdata->itlimitfactor * SCIPgetNRootLPIterations(scip));
492  else
493  nlpiterleft = INT_MAX;
494 
495  /* recompute NLP relaxation if the variable set changed */
496  if( propdata->nlpiprob != NULL && SCIPgetNVars(scip) != propdata->nlpinvars )
497  {
498  SCIP_CALL( propdataClear(scip, propdata) );
499  assert(propdata->nlpiprob == NULL);
500  }
501 
502  /* create or update NLP relaxation */
503  if( propdata->nlpiprob == NULL )
504  {
505  int i;
506 
507  propdata->nlpinvars = SCIPgetNVars(scip);
508  propdata->nlpi = SCIPgetNlpis(scip)[0];
509  assert(propdata->nlpi != NULL);
510 
511  SCIP_CALL( SCIPhashmapCreate(&propdata->var2nlpiidx, SCIPblkmem(scip), propdata->nlpinvars) );
512  SCIP_CALL( SCIPduplicateBlockMemoryArray(scip, &propdata->nlpivars, SCIPgetVars(scip), propdata->nlpinvars) ); /*lint !e666*/
513  SCIP_CALL( SCIPallocBlockMemoryArray(scip, &propdata->nlscore, propdata->nlpinvars) );
514  SCIP_CALL( SCIPallocBlockMemoryArray(scip, &propdata->status, propdata->nlpinvars) );
515 
516  SCIP_CALL( SCIPcreateNlpiProblemFromNlRows(scip, propdata->nlpi, &propdata->nlpiprob, "nlobbt-nlp", SCIPgetNLPNlRows(scip), SCIPgetNNLPNlRows(scip),
517  propdata->var2nlpiidx, NULL, propdata->nlscore, SCIPgetCutoffbound(scip), FALSE, TRUE) );
518 
519  /* initialize bound status; perturb nlscores by a factor which ensures that zero scores remain zero */
520  assert(propdata->randnumgen != NULL);
521  for( i = 0; i < propdata->nlpinvars; ++i )
522  {
523  propdata->status[i] = UNSOLVED; /*lint !e641*/
524  propdata->nlscore[i] *= 1.0 + SCIPrandomGetReal(propdata->randnumgen, SCIPfeastol(scip), 2.0 * SCIPfeastol(scip));
525  }
526 
527  /* add rows of the LP */
528  if( SCIPgetDepth(scip) == 0 )
529  {
530  SCIP_CALL( SCIPaddNlpiProblemRows(scip, propdata->nlpi, propdata->nlpiprob, propdata->var2nlpiidx,
531  SCIPgetLPRows(scip), SCIPgetNLPRows(scip)) );
532  }
533  }
534  else
535  {
536  SCIP_CALL( SCIPupdateNlpiProblem(scip, propdata->nlpi, propdata->nlpiprob, propdata->var2nlpiidx,
537  propdata->nlpivars, propdata->nlpinvars, SCIPgetCutoffbound(scip)) );
538  }
539 
540  assert(propdata->nlpiprob != NULL);
541  assert(propdata->var2nlpiidx != NULL);
542  assert(propdata->nlpivars != NULL);
543  assert(propdata->nlscore != NULL);
544 
545  /* sort variables w.r.t. their nlscores if we did not solve any NLP for this node */
546  if( propdata->currpos == 0 )
547  {
548  SCIPsortDownRealIntPtr(propdata->nlscore, propdata->status, (void**)propdata->nlpivars, propdata->nlpinvars);
549  }
550 
551  /* set parameters of NLP solver */
552  nlpparam.feastol *= propdata->feastolfac;
553  nlpparam.opttol = SCIPfeastol(scip) * propdata->relobjtolfac;
554  nlpparam.verblevel = (unsigned short)propdata->nlpverblevel;
555 
556  /* main propagation loop */
557  while( propdata->currpos < propdata->nlpinvars
558  && nlpiterleft > 0
559  && SCIPisGT(scip, propdata->nlscore[propdata->currpos], 0.0)
560  && *result != SCIP_CUTOFF
561  && !SCIPisStopped(scip) )
562  {
563  SCIP_VAR* var;
564  int varidx;
565  int iters;
566 
567  var = propdata->nlpivars[propdata->currpos];
568  assert(var != NULL);
569 
570  /* skip binary or almost fixed variables */
572  || SCIPisFeasEQ(scip, SCIPvarGetLbLocal(var), SCIPvarGetUbLocal(var)) )
573  {
574  ++(propdata->currpos);
575  continue;
576  }
577 
578  SCIPdebugMsg(scip, "iterations left %d\n", nlpiterleft);
579 
580  /* get index of var in the nlpi */
581  assert(SCIPhashmapExists(propdata->var2nlpiidx, (void*)var) );
582  varidx = SCIPhashmapGetImageInt(propdata->var2nlpiidx, (void*)var);
583  assert(var == SCIPgetVars(scip)[varidx]);
584 
585  /* case: minimize var */
586  if( (propdata->status[propdata->currpos] & SOLVEDLB) == 0 ) /*lint !e641*/
587  {
588  SCIP_CALL( solveNlp(scip, propdata, var, varidx, SCIP_BOUNDTYPE_LOWER, &nlpparam, &iters, result) );
589  nlpiterleft -= iters;
590  }
591 
592  /* case: maximize var */
593  if( *result != SCIP_CUTOFF && (propdata->status[propdata->currpos] & SOLVEDUB) == 0 ) /*lint !e641*/
594  {
595  SCIP_CALL( solveNlp(scip, propdata, var, varidx, SCIP_BOUNDTYPE_UPPER, &nlpparam, &iters, result) );
596  nlpiterleft -= iters;
597  }
598 
599  /* update the current position */
600  ++(propdata->currpos);
601  }
602 
603  return SCIP_OKAY;
604 }
605 
606 /*
607  * Callback methods of propagator
608  */
609 
610 /** destructor of propagator to free user data (called when SCIP is exiting) */
611 static
612 SCIP_DECL_PROPFREE(propFreeNlobbt)
613 { /*lint --e{715}*/
614  SCIP_PROPDATA* propdata;
615 
616  propdata = SCIPpropGetData(prop);
617  assert(propdata != NULL);
618 
619  SCIP_CALL( propdataClear(scip, propdata) );
620  SCIPfreeBlockMemory(scip, &propdata);
621  SCIPpropSetData(prop, NULL);
622 
623  return SCIP_OKAY;
624 }
625 
626 /** solving process initialization method of propagator (called when branch and bound process is about to begin) */
627 static
628 SCIP_DECL_PROPINITSOL(propInitsolNlobbt)
629 { /*lint --e{715}*/
630  SCIP_PROPDATA* propdata;
631 
632  assert(scip != NULL);
633  assert(prop != NULL);
634 
635  propdata = SCIPpropGetData(prop);
636  assert(propdata != NULL);
637 
638  /* if genvbounds propagator is not available, we cannot create genvbounds */
639  propdata->genvboundprop = SCIPfindProp(scip, "genvbounds");
640 
641  SCIP_CALL( SCIPcreateRandom(scip, &propdata->randnumgen,
643  propdata->lastnode = -1;
644 
645  return SCIP_OKAY;
646 }
647 
648 /** solving process deinitialization method of propagator (called before branch and bound process data is freed) */
649 static
650 SCIP_DECL_PROPEXITSOL(propExitsolNlobbt)
651 { /*lint --e{715}*/
652  SCIP_PROPDATA* propdata;
653 
654  propdata = SCIPpropGetData(prop);
655  assert(propdata != NULL);
656 
657  SCIPfreeRandom(scip, &propdata->randnumgen);
658 
659  SCIP_CALL( propdataClear(scip, propdata) );
660 
661  return SCIP_OKAY;
662 }
663 
664 /** execution method of propagator */
665 static
666 SCIP_DECL_PROPEXEC(propExecNlobbt)
667 { /*lint --e{715}*/
668  SCIP_PROPDATA* propdata;
669 
670  *result = SCIP_DIDNOTRUN;
671 
672  propdata = SCIPpropGetData(prop);
673  assert(propdata != NULL);
674 
675  if( propdata->skipprop || SCIPgetStage(scip) != SCIP_STAGE_SOLVING || SCIPinRepropagation(scip)
676  || SCIPinProbing(scip) || SCIPinDive(scip) || !SCIPallowWeakDualReds(scip) || SCIPgetNNlpis(scip) == 0 )
677  {
678  SCIPdebugMsg(scip, "skip nlobbt propagator\n");
679  return SCIP_OKAY;
680  }
681 
682  /* only run if LP all columns are in the LP, e.g., do not run if pricers are active */
683  if( !SCIPallColsInLP(scip) )
684  {
685  SCIPdebugMsg(scip, "not all columns in LP, skipping obbt\n");
686  return SCIP_OKAY;
687  }
688 
689  /* do not run if SCIP does not have constructed an NLP */
690  if( !SCIPisNLPConstructed(scip) )
691  {
692  SCIPdebugMsg(scip, "NLP not constructed, skipping nlobbt\n");
693  return SCIP_OKAY;
694  }
695 
696  /* consider all variables again if we process a new node */
697  if( SCIPnodeGetNumber(SCIPgetCurrentNode(scip)) != propdata->lastnode )
698  {
699  propdata->lastnode = SCIPnodeGetNumber(SCIPgetCurrentNode(scip));
700  propdata->currpos = 0;
701  }
702 
703  /* call main procedure of nonlinear OBBT propagator */
704  SCIP_CALL( applyNlobbt(scip, propdata, result) );
705 
706  return SCIP_OKAY;
707 }
708 
709 /*
710  * propagator specific interface methods
711  */
712 
713 /** creates the nlobbt propagator and includes it in SCIP */
715  SCIP* scip /**< SCIP data structure */
716  )
717 {
718  SCIP_PROPDATA* propdata;
719  SCIP_PROP* prop;
720 
721  propdata = NULL;
722  prop = NULL;
723 
724  SCIP_CALL( SCIPallocBlockMemory(scip, &propdata) );
725  assert(propdata != NULL);
726  BMSclearMemory(propdata);
727 
729  propExecNlobbt, propdata) );
730  assert(prop != NULL);
731 
732  SCIP_CALL( SCIPsetPropFree(scip, prop, propFreeNlobbt) );
733  SCIP_CALL( SCIPsetPropInitsol(scip, prop, propInitsolNlobbt) );
734  SCIP_CALL( SCIPsetPropExitsol(scip, prop, propExitsolNlobbt) );
735 
736  SCIP_CALL( SCIPaddRealParam(scip, "propagating/" PROP_NAME "/feastolfac",
737  "factor for NLP feasibility tolerance",
738  &propdata->feastolfac, TRUE, DEFAULT_FEASTOLFAC, 0.0, 1.0, NULL, NULL) );
739 
740  SCIP_CALL( SCIPaddRealParam(scip, "propagating/" PROP_NAME "/relobjtolfac",
741  "factor for NLP relative objective tolerance",
742  &propdata->relobjtolfac, TRUE, DEFAULT_RELOBJTOLFAC, 0.0, 1.0, NULL, NULL) );
743 
744  SCIP_CALL( SCIPaddRealParam(scip, "propagating/" PROP_NAME "/minnonconvexfrac",
745  "(#convex nlrows)/(#nonconvex nlrows) threshold to apply propagator",
746  &propdata->minnonconvexfrac, TRUE, DEFAULT_MINNONCONVEXFRAC, 0.0, SCIPinfinity(scip), NULL, NULL) );
747 
748  SCIP_CALL( SCIPaddRealParam(scip, "propagating/" PROP_NAME "/minlinearfrac",
749  "minimum (#convex nlrows)/(#linear nlrows) threshold to apply propagator",
750  &propdata->minlinearfrac, TRUE, DEFAULT_MINLINEARFRAC, 0.0, SCIPinfinity(scip), NULL, NULL) );
751 
752  SCIP_CALL( SCIPaddBoolParam(scip, "propagating/" PROP_NAME "/addlprows",
753  "should non-initial LP rows be used?",
754  &propdata->addlprows, FALSE, DEFAULT_ADDLPROWS, NULL, NULL) );
755 
756  SCIP_CALL( SCIPaddIntParam(scip, "propagating/" PROP_NAME "/nlpiterlimit",
757  "iteration limit of NLP solver; 0 for no limit",
758  &propdata->nlpiterlimit, TRUE, DEFAULT_NLPITERLIMIT, 0, INT_MAX, NULL, NULL) );
759 
760  SCIP_CALL( SCIPaddRealParam(scip, "propagating/" PROP_NAME "/nlptimelimit",
761  "time limit of NLP solver; 0.0 for no limit",
762  &propdata->nlptimelimit, TRUE, DEFAULT_NLPTIMELIMIT, 0.0, SCIP_REAL_MAX, NULL, NULL) );
763 
764  SCIP_CALL( SCIPaddIntParam(scip, "propagating/" PROP_NAME "/nlpverblevel",
765  "verbosity level of NLP solver",
766  &propdata->nlpverblevel, TRUE, DEFAULT_NLPVERLEVEL, 0, 5, NULL, NULL) );
767 
768  SCIP_CALL( SCIPaddRealParam(scip, "propagating/" PROP_NAME "/itlimitfactor",
769  "LP iteration limit for nlobbt will be this factor times total LP iterations in root node",
770  &propdata->itlimitfactor, TRUE, DEFAULT_ITLIMITFACTOR, 0.0, SCIP_REAL_MAX, NULL, NULL) );
771 
772  return SCIP_OKAY;
773 }
enum SCIP_Result SCIP_RESULT
Definition: type_result.h:52
void SCIPfreeRandom(SCIP *scip, SCIP_RANDNUMGEN **randnumgen)
#define SOLVEDUB
Definition: prop_nlobbt.c:79
#define SCIPfreeBlockMemoryArray(scip, ptr, num)
Definition: scip_mem.h:101
enum SCIP_BoundType SCIP_BOUNDTYPE
Definition: type_lp.h:50
static SCIP_DECL_PROPINITSOL(propInitsolNlobbt)
Definition: prop_nlobbt.c:629
SCIP_ROW ** SCIPgetLPRows(SCIP *scip)
Definition: scip_lp.c:596
SCIP_Bool SCIPisFeasZero(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPinRepropagation(SCIP *scip)
Definition: scip_tree.c:137
int SCIPgetNNLPNlRows(SCIP *scip)
Definition: scip_nlp.c:332
SCIP_Real SCIPgetSolvingTime(SCIP *scip)
Definition: scip_timing.c:369
SCIP_Longint SCIPgetNRootLPIterations(SCIP *scip)
SCIP_Real SCIPfeastol(SCIP *scip)
#define SCIPallocBlockMemoryArray(scip, ptr, num)
Definition: scip_mem.h:84
SCIP_Bool SCIPisNLPConstructed(SCIP *scip)
Definition: scip_nlp.c:101
SCIP_RETCODE SCIPtightenVarLb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
Definition: scip_var.c:5200
static SCIP_DECL_PROPEXITSOL(propExitsolNlobbt)
Definition: prop_nlobbt.c:651
SCIP_Bool SCIPisFeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
public methods for SCIP parameter handling
SCIP_NODE * SCIPgetCurrentNode(SCIP *scip)
Definition: scip_tree.c:82
SCIP_STAGE SCIPgetStage(SCIP *scip)
Definition: scip_general.c:356
#define PROP_FREQ
Definition: prop_nlobbt.c:55
public methods for branch and bound tree
SCIP_Real opttol
Definition: type_nlpi.h:61
public methods for memory management
SCIP_Real SCIPgetCutoffbound(SCIP *scip)
SCIP_PROP * SCIPfindProp(SCIP *scip, const char *name)
Definition: scip_prop.c:320
#define PROP_PRIORITY
Definition: prop_nlobbt.c:54
SCIP_RETCODE SCIPgetRealParam(SCIP *scip, const char *name, SCIP_Real *value)
Definition: scip_param.c:298
#define DEFAULT_FEASTOLFAC
Definition: prop_nlobbt.c:61
void SCIPsortDownRealIntPtr(SCIP_Real *realarray, int *intarray, void **ptrarray, int len)
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
Definition: var.c:17966
SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
static SCIP_RETCODE addGenVBound(SCIP *scip, SCIP_PROPDATA *propdata, SCIP_VAR *var, int varidx, SCIP_BOUNDTYPE boundtype, SCIP_Real cutoffbound)
Definition: prop_nlobbt.c:260
SCIP_CLOCK * totaltime
Definition: struct_scip.h:67
public methods for timing
SCIP_Real feastol
Definition: type_nlpi.h:60
#define DEFAULT_MINLINEARFRAC
Definition: prop_nlobbt.c:60
#define DEFAULT_NLPITERLIMIT
Definition: prop_nlobbt.c:67
SCIP_RETCODE SCIPincludePropNlobbt(SCIP *scip)
Definition: prop_nlobbt.c:715
SCIP_Bool SCIPisFeasGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
static SCIP_RETCODE solveNlp(SCIP *scip, SCIP_PROPDATA *propdata, SCIP_VAR *var, int varidx, SCIP_BOUNDTYPE boundtype, SCIP_NLPPARAM *nlpparam, int *nlpiter, SCIP_RESULT *result)
Definition: prop_nlobbt.c:337
#define FALSE
Definition: def.h:87
unsigned short verblevel
Definition: type_nlpi.h:65
SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize)
Definition: misc.c:3014
SCIP_Real SCIPinfinity(SCIP *scip)
#define TRUE
Definition: def.h:86
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:54
SCIP_Real SCIPnlrowGetRhs(SCIP_NLROW *nlrow)
Definition: nlp.c:1814
public methods for problem variables
SCIP_RETCODE SCIPtightenVarUb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
Definition: scip_var.c:5317
#define SCIPfreeBlockMemory(scip, ptr)
Definition: scip_mem.h:99
SCIP_EXPRCURV SCIPnlrowGetCurvature(SCIP_NLROW *nlrow)
Definition: nlp.c:1824
SCIP_NLPI ** SCIPgetNlpis(SCIP *scip)
Definition: scip_nlpi.c:177
#define SCIPfreeBufferArray(scip, ptr)
Definition: scip_mem.h:127
public methods for SCIP variables
#define DEFAULT_RELOBJTOLFAC
Definition: prop_nlobbt.c:62
#define SCIPdebugMsg
Definition: scip_message.h:69
SCIP_RETCODE SCIPaddIntParam(SCIP *scip, const char *name, const char *desc, int *valueptr, SCIP_Bool isadvanced, int defaultvalue, int minvalue, int maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
Definition: scip_param.c:74
#define DEFAULT_RANDSEED
Definition: prop_nlobbt.c:70
SCIP_Real timelimit
Definition: type_nlpi.h:63
static SCIP_RETCODE propdataClear(SCIP *scip, SCIP_PROPDATA *propdata)
Definition: prop_nlobbt.c:117
public methods for numerical tolerances
public methods for querying solving statistics
SCIP_Bool SCIPhashmapExists(SCIP_HASHMAP *hashmap, void *origin)
Definition: misc.c:3363
public methods for the branch-and-bound tree
int SCIPgetNNlpis(SCIP *scip)
Definition: scip_nlpi.c:190
SCIP_Longint SCIPnodeGetNumber(SCIP_NODE *node)
Definition: tree.c:7432
#define DEFAULT_NLPVERLEVEL
Definition: prop_nlobbt.c:69
public methods for NLPI solver interfaces
#define SCIPduplicateBlockMemoryArray(scip, ptr, source, num)
Definition: scip_mem.h:96
#define DEFAULT_NLPTIMELIMIT
Definition: prop_nlobbt.c:68
SCIP_RETCODE SCIPupdateNlpiProblem(SCIP *scip, SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *nlpiprob, SCIP_HASHMAP *var2nlpiidx, SCIP_VAR **nlpivars, int nlpinvars, SCIP_Real cutoffbound)
Definition: scip_nlpi.c:720
static SCIP_RETCODE applyNlobbt(SCIP *scip, SCIP_PROPDATA *propdata, SCIP_RESULT *result)
Definition: prop_nlobbt.c:465
SCIP_RETCODE SCIPgenVBoundAdd(SCIP *scip, SCIP_PROP *genvboundprop, SCIP_VAR **vars, SCIP_VAR *var, SCIP_Real *coefs, int ncoefs, SCIP_Real coefcutoffbound, SCIP_Real constant, SCIP_BOUNDTYPE boundtype)
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
Definition: scip_mem.c:48
#define PROP_NAME
Definition: prop_nlobbt.c:52
const char * SCIPvarGetName(SCIP_VAR *var)
Definition: var.c:17251
void SCIPhashmapFree(SCIP_HASHMAP **hashmap)
Definition: misc.c:3048
#define NULL
Definition: lpi_spx1.cpp:155
#define REALABS(x)
Definition: def.h:201
int SCIPgetNLPRows(SCIP *scip)
Definition: scip_lp.c:617
#define SCIP_CALL(x)
Definition: def.h:384
SCIP_Bool SCIPisFeasGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_NLROW ** SCIPgetNLPNlRows(SCIP *scip)
Definition: scip_nlp.c:310
SCIP_Bool SCIPisFeasLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
public methods for NLP management
SCIP_RETCODE SCIPaddNlpiProblemRows(SCIP *scip, SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM *nlpiprob, SCIP_HASHMAP *var2idx, SCIP_ROW **rows, int nrows)
Definition: scip_nlpi.c:772
SCIP_RETCODE SCIPcreateRandom(SCIP *scip, SCIP_RANDNUMGEN **randnumgen, unsigned int initialseed, SCIP_Bool useglobalseed)
#define SCIPallocBufferArray(scip, ptr, num)
Definition: scip_mem.h:115
public data structures and miscellaneous methods
#define PROP_DESC
Definition: prop_nlobbt.c:53
#define SCIP_Bool
Definition: def.h:84
int SCIPgetDepth(SCIP *scip)
Definition: scip_tree.c:661
nonlinear OBBT propagator
#define DEFAULT_ITLIMITFACTOR
Definition: prop_nlobbt.c:64
#define PROP_DELAY
Definition: prop_nlobbt.c:56
#define SOLVEDLB
Definition: prop_nlobbt.c:78
SCIP_Bool SCIPallowWeakDualReds(SCIP *scip)
Definition: scip_var.c:8653
SCIP_RETCODE SCIPcreateNlpiProblemFromNlRows(SCIP *scip, SCIP_NLPI *nlpi, SCIP_NLPIPROBLEM **nlpiprob, const char *name, SCIP_NLROW **nlrows, int nnlrows, SCIP_HASHMAP *var2idx, SCIP_HASHMAP *nlrow2idx, SCIP_Real *nlscore, SCIP_Real cutoffbound, SCIP_Bool setobj, SCIP_Bool onlyconvex)
Definition: scip_nlpi.c:434
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
#define BMSclearMemory(ptr)
Definition: memory.h:122
SCIP_RETCODE SCIPsetPropExitsol(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPEXITSOL((*propexitsol)))
Definition: scip_prop.c:222
SCIP_Real SCIPrandomGetReal(SCIP_RANDNUMGEN *randnumgen, SCIP_Real minrandval, SCIP_Real maxrandval)
Definition: misc.c:10025
SCIP_Bool SCIPinProbing(SCIP *scip)
Definition: scip_probing.c:88
public methods for the LP relaxation, rows and columns
int SCIPgetNVars(SCIP *scip)
Definition: scip_prob.c:1991
#define SCIP_REAL_MAX
Definition: def.h:178
public methods for nonlinear relaxation
SCIP_Bool SCIPinDive(SCIP *scip)
Definition: scip_lp.c:2760
methods for sorting joint arrays of various types
general public methods
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
static SCIP_RETCODE filterCands(SCIP *scip, SCIP_PROPDATA *propdata)
Definition: prop_nlobbt.c:202
public methods for random numbers
public methods for the probing mode
public methods for message output
static SCIP_DECL_PROPEXEC(propExecNlobbt)
Definition: prop_nlobbt.c:667
SCIP_VAR ** SCIPgetVars(SCIP *scip)
Definition: scip_prob.c:1946
SCIP_RETCODE SCIPsetPropInitsol(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPINITSOL((*propinitsol)))
Definition: scip_prop.c:206
#define SCIP_NLPPARAM_DEFAULT(scip)
Definition: type_nlpi.h:117
#define PROP_TIMING
Definition: prop_nlobbt.c:57
#define SCIP_Real
Definition: def.h:177
struct SCIP_PropData SCIP_PROPDATA
Definition: type_prop.h:43
SCIP_Bool SCIPisStopped(SCIP *scip)
Definition: scip_general.c:694
public methods for message handling
SCIP_RETCODE SCIPsetPropFree(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPFREE((*propfree)))
Definition: scip_prop.c:158
SCIP_PROPDATA * SCIPpropGetData(SCIP_PROP *prop)
Definition: prop.c:780
void SCIPpropSetData(SCIP_PROP *prop, SCIP_PROPDATA *propdata)
Definition: prop.c:790
#define SCIP_Longint
Definition: def.h:162
SCIP_Bool SCIPallColsInLP(SCIP *scip)
Definition: scip_lp.c:640
public methods for propagator plugins
SCIP_VARTYPE SCIPvarGetType(SCIP_VAR *var)
Definition: var.c:17416
SCIP_Bool SCIPisZero(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
#define DEFAULT_MINNONCONVEXFRAC
Definition: prop_nlobbt.c:59
SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)
Definition: var.c:17976
#define DEFAULT_ADDLPROWS
Definition: prop_nlobbt.c:63
SCIPallocBlockMemory(scip, subsol))
int SCIPhashmapGetImageInt(SCIP_HASHMAP *hashmap, void *origin)
Definition: misc.c:3221
SCIP_Real SCIPnlrowGetLhs(SCIP_NLROW *nlrow)
Definition: nlp.c:1804
public methods for global and local (sub)problems
static SCIP_DECL_PROPFREE(propFreeNlobbt)
Definition: prop_nlobbt.c:613
SCIP_RETCODE SCIPaddRealParam(SCIP *scip, const char *name, const char *desc, SCIP_Real *valueptr, SCIP_Bool isadvanced, SCIP_Real defaultvalue, SCIP_Real minvalue, SCIP_Real maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
Definition: scip_param.c:130
static SCIP_Bool isNlobbtApplicable(SCIP *scip, SCIP_PROPDATA *propdata)
Definition: prop_nlobbt.c:147
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
SCIP_EXPR * SCIPnlrowGetExpr(SCIP_NLROW *nlrow)
Definition: nlp.c:1794
public methods for propagators
generalized variable bounds propagator
#define UNSOLVED
Definition: prop_nlobbt.c:77
SCIP_RETCODE SCIPincludePropBasic(SCIP *scip, SCIP_PROP **propptr, const char *name, const char *desc, int priority, int freq, SCIP_Bool delay, SCIP_PROPTIMING timingmask, SCIP_DECL_PROPEXEC((*propexec)), SCIP_PROPDATA *propdata)
Definition: scip_prop.c:105
memory allocation routines