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