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