Scippy

SCIP

Solving Constraint Integer Programs

cutpool.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-2018 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 cutpool.c
17  * @brief methods for storing cuts in a cut pool
18  * @author Tobias Achterberg
19  * @author Stefan Heinz
20  * @author Gerald Gamrath
21  * @author Marc Pfetsch
22  * @author Kati Wolter
23  */
24 
25 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
26 
27 #include <assert.h>
28 
29 #include "scip/def.h"
30 #include "scip/set.h"
31 #include "scip/stat.h"
32 #include "scip/clock.h"
33 #include "scip/lp.h"
34 #include "scip/cons.h"
35 #include "scip/sepa.h"
36 #include "scip/sepastore.h"
37 #include "scip/cutpool.h"
38 #include "scip/pub_message.h"
39 #include "scip/pub_misc.h"
40 
41 #include "scip/struct_cutpool.h"
42 
43 
44 
45 /*
46  * Hash functions
47  */
48 
49 /** gets the hash key of a cut */
50 static
51 SCIP_DECL_HASHGETKEY(hashGetKeyCut)
52 { /*lint --e{715}*/
53  SCIP_CUT* cut;
54 
55  cut = (SCIP_CUT*)elem;
56  assert(cut != NULL);
57  assert(cut->row != NULL);
58 
59  /* the key of a cut is the row */
60  return cut->row;
61 }
62 
63 /** returns TRUE iff both cuts are identical */
64 static
65 SCIP_DECL_HASHKEYEQ(hashKeyEqCut)
66 { /*lint --e{715}*/
67  SCIP_ROW* row1;
68  SCIP_ROW* row2;
69  SCIP_Real row1scale;
70  SCIP_Real row2scale;
71  SCIP_SET* set;
72 
73  row1 = (SCIP_ROW*)key1;
74  row2 = (SCIP_ROW*)key2;
75  assert(row1 != NULL);
76  assert(row2 != NULL);
77 
78  /* return true if the row is the same */
79  if( row1 == row2 )
80  return TRUE;
81 
82  assert(row1->validminmaxidx);
83  assert(row2->validminmaxidx);
84 
85  /* compare the trivial characteristics of the rows */
86  if( row1->len != row2->len
87  || row1->minidx != row2->minidx
88  || row1->maxidx != row2->maxidx
89  )
90  return FALSE;
91 
92  set = (SCIP_SET*) userptr;
93 
94  /* set scale for the rows such that the largest absolute coefficient is 1.0 */
95  row1scale = 1.0 / SCIProwGetMaxval(row1, set);
96  row2scale = 1.0 / SCIProwGetMaxval(row2, set);
97 
98  /* check if scaled min value is feas equal first */
99  if( !SCIPsetIsFeasEQ(set, row1scale * SCIProwGetMinval(row1, set),
100  row2scale * SCIProwGetMinval(row2, set)) )
101  return FALSE;
102 
103  SCIProwSort(row1);
104  assert(row1->lpcolssorted);
105  assert(row1->nonlpcolssorted);
106 
107  SCIProwSort(row2);
108  assert(row2->lpcolssorted);
109  assert(row2->nonlpcolssorted);
110 
111  /* currently we are only handling rows which are completely linked or not linked at all */
112  assert(row1->nunlinked == 0 || row1->nlpcols == 0);
113  assert(row2->nunlinked == 0 || row2->nlpcols == 0);
114 
115  /* set scale sign such that the rows are of the form ax <= b */
116  if( SCIPsetIsInfinity(set, row1->rhs) )
117  row1scale = -row1scale;
118  if( SCIPsetIsInfinity(set, row2->rhs) )
119  row2scale = -row2scale;
120 
121  /* both rows have LP columns, or none of them has, or one has only LP colums and the other only non-LP columns,
122  * so we can rely on the sorting of the columns
123  */
124  if( (row1->nlpcols == 0) == (row2->nlpcols == 0)
125  || (row1->nlpcols == 0 && row2->nlpcols == row2->len)
126  || (row1->nlpcols == row1->len && row2->nlpcols == 0) )
127  {
128  int i;
129 
130  if( (row1->nlpcols == 0) == (row2->nlpcols == 0) )
131  {
132 #ifndef NDEBUG
133  /* in debug mode, we check that we can rely on the partition into LP columns and non-LP columns */
134  int i2;
135 
136  i = 0;
137  i2 = row2->nlpcols;
138  while( i < row1->nlpcols && i2 < row2->len )
139  {
140  assert(row1->cols[i] != row2->cols[i2]);
141  if( row1->cols_index[i] < row2->cols_index[i2] )
142  ++i;
143  else
144  {
145  assert(row1->cols_index[i] > row2->cols_index[i2]);
146  ++i2;
147  }
148  }
149  assert(i == row1->nlpcols || i2 == row2->len);
150 
151  i = row1->nlpcols;
152  i2 = 0;
153  while( i < row1->len && i2 < row2->nlpcols )
154  {
155  assert(row1->cols[i] != row2->cols[i2]);
156  if( row1->cols_index[i] < row2->cols_index[i2] )
157  ++i;
158  else
159  {
160  assert(row1->cols_index[i] > row2->cols_index[i2]);
161  ++i2;
162  }
163  }
164  assert(i == row1->len || i2 == row2->nlpcols);
165 #endif
166 
167  /* both rows are linked and the number of lpcolumns is not equal so they cannot be equal */
168  if( row1->nlpcols != row2->nlpcols )
169  return FALSE;
170  }
171 
172  /* compare the columns of the rows */
173  for( i = 0; i < row1->len; ++i )
174  {
175  if( row1->cols_index[i] != row2->cols_index[i] )
176  return FALSE;
177  }
178 
179  /* compare the coefficients of the rows */
180  for( i = 0; i < row1->len; ++i )
181  {
182  if( !SCIPsetIsFeasEQ(set, row1scale * row1->vals[i], row2scale * row2->vals[i]) )
183  return FALSE;
184  }
185  }
186  /* one row has LP columns, but the other not, that could be because the one without was just created and isn't
187  * linked yet; in this case, one column could be an LP column in one row and a non-LP column in the other row, so we
188  * cannot rely on the partition; thus, we iteratively check whether the next column of row1 is either the next LP
189  * column of row2 or the next non-LP column of row2 and the coefficients are equal
190  */
191  else
192  {
193  int i1;
194  int ilp;
195  int inlp;
196 
197  /* ensure that row1 is the row without LP columns, switch the rows, if neccessary */
198  if( row2->nlpcols == 0 )
199  {
200  SCIP_ROW* tmprow;
201  SCIP_Real tmpscale;
202 
203  tmprow = row2;
204  row2 = row1;
205  row1 = tmprow;
206 
207  tmpscale = row2scale;
208  row2scale = row1scale;
209  row1scale = tmpscale;
210  }
211  assert(row1->nlpcols == 0 && row2->nlpcols > 0);
212 
213  ilp = 0;
214  inlp = row2->nlpcols;
215 
216  /* compare the columns and coefficients of the rows */
217  for( i1 = 0; i1 < row1->len; ++i1 )
218  {
219  /* current column of row1 is the current LP column of row2, check the coefficient */
220  if( ilp < row2->nlpcols && row1->cols[i1] == row2->cols[ilp] )
221  {
222  if( !SCIPsetIsFeasEQ(set, row1scale * row1->vals[i1], row2scale * row2->vals[ilp]) )
223  return FALSE;
224  else
225  ++ilp;
226  }
227  /* current column of row1 is the current non-LP column of row2, check the coefficient */
228  else if( inlp < row2->len && row1->cols[i1] == row2->cols[inlp] )
229  {
230  if( !SCIPsetIsFeasEQ(set, row1scale * row1->vals[i1], row2scale * row2->vals[inlp]) )
231  return FALSE;
232  else
233  ++inlp;
234  }
235  /* current column of row1 is neither the current LP column of row2, nor the current non-LP column of row 2 */
236  else
237  return FALSE;
238  }
239  }
240 
241  return TRUE;
242 }
243 
244 static
245 SCIP_DECL_HASHKEYVAL(hashKeyValCut)
246 { /*lint --e{715}*/
247  SCIP_ROW* row;
248  int i;
249  SCIP_Real scale;
250  SCIP_SET* set;
251  uint64_t hash;
252 
253  set = (SCIP_SET*) userptr;
254  row = (SCIP_ROW*)key;
255  assert(row != NULL);
256  assert(row->len > 0);
257 
258  scale = 1.0 / SCIProwGetMaxval(row, set);
259  if( SCIPsetIsInfinity(set, row->rhs) )
260  scale = -scale;
261 
262  hash = (uint64_t) (long) row->len;
263 
264  for( i = 0; i < row->len; ++i )
265  {
266  SCIP_Real val = scale * row->vals[i];
267 
268  hash += SCIPhashTwo(SCIPrealHashCode(val), row->cols_index[i]);
269  }
270 
271  return hash;
272 }
273 
274 
275 /*
276  * dynamic memory arrays
277  */
278 
279 /** resizes cuts array to be able to store at least num entries */
280 static
282  SCIP_CUTPOOL* cutpool, /**< cut pool */
283  SCIP_SET* set, /**< global SCIP settings */
284  int num /**< minimal number of slots in array */
285  )
286 {
287  assert(cutpool != NULL);
288  assert(set != NULL);
289 
290  if( num > cutpool->cutssize )
291  {
292  int newsize;
293 
294  newsize = SCIPsetCalcMemGrowSize(set, num);
295  SCIP_ALLOC( BMSreallocMemoryArray(&cutpool->cuts, newsize) );
296  cutpool->cutssize = newsize;
297  }
298  assert(num <= cutpool->cutssize);
299 
300  return SCIP_OKAY;
301 }
302 
303 
304 
305 /*
306  * Cut methods
307  */
308 
309 /** creates a cut and captures the row */
310 static
312  SCIP_CUT** cut, /**< pointer to store the cut */
313  BMS_BLKMEM* blkmem, /**< block memory */
314  SCIP_ROW* row /**< row this cut represents */
315  )
316 {
317  assert(cut != NULL);
318  assert(blkmem != NULL);
319  assert(row != NULL);
320 
321  /* allocate cut memory */
322  SCIP_ALLOC( BMSallocBlockMemory(blkmem, cut) );
323  (*cut)->row = row;
324  (*cut)->age = 0;
325  (*cut)->processedlp = -1;
326  (*cut)->processedlpsol = -1;
327  (*cut)->pos = -1;
328 
329  /* capture row */
330  SCIProwCapture(row);
331 
332  return SCIP_OKAY;
333 }
334 
335 /** frees a cut and releases the row */
336 static
338  SCIP_CUT** cut, /**< pointer to store the cut */
339  BMS_BLKMEM* blkmem, /**< block memory */
340  SCIP_SET* set, /**< global SCIP settings */
341  SCIP_LP* lp /**< current LP data */
342  )
343 {
344  assert(cut != NULL);
345  assert(*cut != NULL);
346  assert((*cut)->row != NULL);
347  assert(blkmem != NULL);
348 
349  /* release row */
350  SCIP_CALL( SCIProwRelease(&(*cut)->row, blkmem, set, lp) );
351 
352  /* free cut memory */
353  BMSfreeBlockMemory(blkmem, cut);
354 
355  return SCIP_OKAY;
356 }
357 
358 /** returns whether the cut's age exceeds the age limit */
359 static
361  SCIP_CUT* cut, /**< cut to check */
362  int agelimit /**< maximum age a cut can reach before it is deleted from the pool, or -1 */
363  )
364 {
365  assert(cut != NULL);
366 
367  /* since agelimit can be -1 cast to unsigned before comparison, then it is the maximum unsigned value in that case */
368  return (unsigned int)cut->age > (unsigned int)agelimit;
369 }
370 
371 /** gets the row of the cut */
373  SCIP_CUT* cut /**< cut */
374  )
375 {
376  assert(cut != NULL);
377 
378  return cut->row;
379 }
380 
381 /** gets the age of the cut: the number of consecutive cut pool separation rounds where the cut was neither in the LP nor violated */
383  SCIP_CUT* cut /**< cut */
384  )
385 {
386  assert(cut != NULL);
387 
388  return cut->age;
389 }
390 
391 /** returns the ratio of LPs where the row belonging to this cut was active in an LP solution, i.e.
392  * where the age of its row has not been increased
393  *
394  * @see SCIPcutGetAge() to get the age of a cut
395  */
397  SCIP_CUT* cut /**< cut */
398  )
399 {
400  SCIP_Longint nlpsaftercreation;
401  SCIP_Longint activeinlpcounter;
402 
403  assert(cut != NULL);
404  assert(cut->row != NULL);
405 
406  nlpsaftercreation = SCIProwGetNLPsAfterCreation(cut->row);
407  activeinlpcounter = SCIProwGetActiveLPCount(cut->row);
408 
409  return (nlpsaftercreation > 0 ? activeinlpcounter / (SCIP_Real)nlpsaftercreation : 0.0);
410 }
411 
412 /*
413  * Cutpool methods
414  */
415 
416 /** creates cut pool */
418  SCIP_CUTPOOL** cutpool, /**< pointer to store cut pool */
419  BMS_BLKMEM* blkmem, /**< block memory */
420  SCIP_SET* set, /**< global SCIP settings */
421  int agelimit, /**< maximum age a cut can reach before it is deleted from the pool */
422  SCIP_Bool globalcutpool /**< is this the global cut pool of SCIP? */
423  )
424 {
425  assert(cutpool != NULL);
426  assert(agelimit >= -1);
427 
428  SCIP_ALLOC( BMSallocMemory(cutpool) );
429 
430  SCIP_CALL( SCIPclockCreate(&(*cutpool)->poolclock, SCIP_CLOCKTYPE_DEFAULT) );
431 
432  SCIP_CALL( SCIPhashtableCreate(&(*cutpool)->hashtable, blkmem,
433  (set->misc_usesmalltables ? SCIP_HASHSIZE_CUTPOOLS_SMALL : SCIP_HASHSIZE_CUTPOOLS),
434  hashGetKeyCut, hashKeyEqCut, hashKeyValCut, (void*) set) );
435 
436  (*cutpool)->cuts = NULL;
437  (*cutpool)->cutssize = 0;
438  (*cutpool)->ncuts = 0;
439  (*cutpool)->nremovablecuts = 0;
440  (*cutpool)->agelimit = agelimit;
441  (*cutpool)->processedlp = -1;
442  (*cutpool)->processedlpsol = -1;
443  (*cutpool)->processedlpefficacy = SCIP_INVALID;
444  (*cutpool)->processedlpsolefficacy = SCIP_INVALID;
445  (*cutpool)->firstunprocessed = 0;
446  (*cutpool)->firstunprocessedsol = 0;
447  (*cutpool)->maxncuts = 0;
448  (*cutpool)->ncalls = 0;
449  (*cutpool)->ncutsfound = 0;
450  (*cutpool)->globalcutpool = globalcutpool;
451 
452  return SCIP_OKAY;
453 }
454 
455 /** frees cut pool */
457  SCIP_CUTPOOL** cutpool, /**< pointer to store cut pool */
458  BMS_BLKMEM* blkmem, /**< block memory */
459  SCIP_SET* set, /**< global SCIP settings */
460  SCIP_LP* lp /**< current LP data */
461  )
462 {
463  assert(cutpool != NULL);
464  assert(*cutpool != NULL);
465 
466  /* remove all cuts from the pool */
467  SCIP_CALL( SCIPcutpoolClear(*cutpool, blkmem, set, lp) );
468 
469  /* free clock */
470  SCIPclockFree(&(*cutpool)->poolclock);
471 
472  /* free hash table */
473  SCIPhashtableFree(&(*cutpool)->hashtable);
474 
475  BMSfreeMemoryArrayNull(&(*cutpool)->cuts);
476  BMSfreeMemory(cutpool);
477 
478  return SCIP_OKAY;
479 }
480 
481 /** removes all rows from the cut pool */
483  SCIP_CUTPOOL* cutpool, /**< cut pool */
484  BMS_BLKMEM* blkmem, /**< block memory */
485  SCIP_SET* set, /**< global SCIP settings */
486  SCIP_LP* lp /**< current LP data */
487  )
488 {
489  int i;
490 
491  assert(cutpool != NULL);
492 
493  /* free cuts */
494  for( i = 0; i < cutpool->ncuts; ++i )
495  {
496  if( cutpool->globalcutpool )
497  cutpool->cuts[i]->row->inglobalcutpool = FALSE;
498  SCIProwUnlock(cutpool->cuts[i]->row);
499  SCIP_CALL( cutFree(&cutpool->cuts[i], blkmem, set, lp) );
500  }
501 
502  cutpool->ncuts = 0;
503  cutpool->nremovablecuts = 0;
504 
505  return SCIP_OKAY;
506 }
507 
508 /** removes the cut from the cut pool */
509 static
511  SCIP_CUTPOOL* cutpool, /**< cut pool */
512  BMS_BLKMEM* blkmem, /**< block memory */
513  SCIP_SET* set, /**< global SCIP settings */
514  SCIP_STAT* stat, /**< problem statistics data */
515  SCIP_LP* lp, /**< current LP data */
516  SCIP_CUT* cut /**< cut to remove */
517  )
518 {
519  int pos;
520 
521  assert(cutpool != NULL);
522  assert(cutpool->firstunprocessed <= cutpool->ncuts);
523  assert(cutpool->firstunprocessedsol <= cutpool->ncuts);
524  assert(blkmem != NULL);
525  assert(stat != NULL);
526  assert(cutpool->processedlp <= stat->lpcount);
527  assert(cutpool->processedlpsol <= stat->lpcount);
528  assert(cut != NULL);
529  assert(cut->row != NULL);
530 
531  pos = cut->pos;
532  assert(0 <= pos && pos < cutpool->ncuts);
533  assert(cutpool->cuts[pos] == cut);
534 
535  /* decrease the number of removable cuts counter (row might have changed its removable status -> counting might not
536  * be correct
537  */
538  if( SCIProwIsRemovable(cut->row) && cutpool->nremovablecuts > 0 )
539  cutpool->nremovablecuts--;
540 
541  /* if this is the global cut pool of SCIP, mark the row to not be member anymore */
542  if( cutpool->globalcutpool )
543  {
544  assert(cut->row->inglobalcutpool);
545  cut->row->inglobalcutpool = FALSE;
546  }
547 
548  /* remove the cut from the hash table */
549  assert(SCIPhashtableExists(cutpool->hashtable, (void*)cut));
550  SCIP_CALL( SCIPhashtableRemove(cutpool->hashtable, (void*)cut) );
551  assert(! SCIPhashtableExists(cutpool->hashtable, (void*)cut));
552 
553  /* unlock the row */
554  SCIProwUnlock(cut->row);
555 
556  /* free the cut */
557  SCIP_CALL( cutFree(&cutpool->cuts[pos], blkmem, set, lp) );
558 
559  /* move the last cut of the pool to the free position */
560  if( pos < cutpool->ncuts-1 )
561  {
562  cutpool->cuts[pos] = cutpool->cuts[cutpool->ncuts-1];
563  cutpool->cuts[pos]->pos = pos;
564  assert(cutpool->cuts[pos]->processedlp <= stat->lpcount);
565  assert(cutpool->cuts[pos]->processedlpsol <= stat->lpcount);
566  if( cutpool->cuts[pos]->processedlp < stat->lpcount )
567  cutpool->firstunprocessed = MIN(cutpool->firstunprocessed, pos);
568  if( cutpool->cuts[pos]->processedlpsol < stat->lpcount )
569  cutpool->firstunprocessedsol = MIN(cutpool->firstunprocessedsol, pos);
570  }
571  else
572  {
573  cutpool->firstunprocessed = MIN(cutpool->firstunprocessed, cutpool->ncuts-1);
574  cutpool->firstunprocessedsol = MIN(cutpool->firstunprocessedsol, cutpool->ncuts-1);
575  }
576 
577  cutpool->ncuts--;
578 
579  return SCIP_OKAY;
580 }
581 
582 /** checks if cut is already existing */
584  SCIP_CUTPOOL* cutpool, /**< cut pool */
585  SCIP_SET* set, /**< global SCIP settings */
586  SCIP_ROW* row /**< cutting plane to add */
587  )
588 {
589  SCIP_CUT* othercut;
590  assert(cutpool != NULL);
591  assert(row != NULL);
592 
593  if( row->len == 0 )
594  {
595  /* trivial cut is only new if it proves infeasibility */
596  return SCIPsetIsFeasLT(set, row->constant, row->lhs) || SCIPsetIsFeasGT(set, row->constant, row->rhs);
597  }
598 
599  othercut = (SCIP_CUT*)SCIPhashtableRetrieve(cutpool->hashtable, (void*)row);
600  /* check in hash table, if cut already exists in the pool */
601  if( othercut == NULL )
602  {
603  return TRUE;
604  }
605  else if( othercut->row != row )
606  {
607  SCIP_ROW* otherrow = othercut->row;
608  SCIP_Real otherrhs;
609  SCIP_Real rhs;
610  SCIP_Real scale;
611  SCIP_Real otherscale;
612 
613  /* since we are comparing the improvement with an absolute value, we apply a
614  * scale to both rows such that the max absolute value is 1.0.
615  * Then bring the cut into the form ax <= b
616  */
617  scale = 1.0 / SCIProwGetMaxval(row, set);
618  otherscale = 1.0 / SCIProwGetMaxval(otherrow, set);
619 
620  if( SCIPsetIsInfinity(set, otherrow->rhs) )
621  {
622  otherrhs = otherscale * (otherrow->constant - otherrow->lhs);
623  }
624  else
625  {
626  otherrhs = otherscale * (otherrow->rhs - otherrow->constant);
627  }
628 
629  if( SCIPsetIsInfinity(set, row->rhs) )
630  {
631  rhs = scale * (row->constant - row->lhs);
632  }
633  else
634  {
635  rhs = scale * (row->rhs - row->constant);
636  }
637 
638  if( SCIPsetIsFeasLT(set, rhs, otherrhs) )
639  return TRUE;
640  }
641 
642  return FALSE;
643 }
644 
645 /** if not already existing, adds row to cut pool and captures it */
647  SCIP_CUTPOOL* cutpool, /**< cut pool */
648  BMS_BLKMEM* blkmem, /**< block memory */
649  SCIP_SET* set, /**< global SCIP settings */
650  SCIP_STAT* stat, /**< problem statistics data */
651  SCIP_LP* lp, /**< current LP data */
652  SCIP_ROW* row /**< cutting plane to add */
653  )
654 {
655  SCIP_CUT* othercut;
656  assert(cutpool != NULL);
657  assert(row != NULL);
658 
659  if( row->len == 0 )
660  return SCIP_OKAY;
661 
662  othercut = (SCIP_CUT*)SCIPhashtableRetrieve(cutpool->hashtable, (void*)row);
663  /* check in hash table, if cut already exists in the pool */
664  if( othercut == NULL )
665  {
666  SCIP_CALL( SCIPcutpoolAddNewRow(cutpool, blkmem, set, stat, lp, row) );
667  }
668  else
669  {
670  SCIP_ROW* otherrow = othercut->row;
671  SCIP_Real otherrhs;
672  SCIP_Real rhs;
673  SCIP_Real scale;
674  SCIP_Real otherscale;
675 
676  /* since we are comparing the improvement with an absolute value, we apply a
677  * scale to both rows such that the max absolute value is 1.0.
678  * Then bring the cut into the form ax <= b
679  */
680  scale = 1.0 / SCIProwGetMaxval(row, set);
681  otherscale = 1.0 / SCIProwGetMaxval(otherrow, set);
682 
683  if( SCIPsetIsInfinity(set, otherrow->rhs) )
684  {
685  otherrhs = otherscale * (otherrow->constant - otherrow->lhs);
686  }
687  else
688  {
689  otherrhs = otherscale * (otherrow->rhs - otherrow->constant);
690  }
691 
692  if( SCIPsetIsInfinity(set, row->rhs) )
693  {
694  rhs = scale * (row->constant - row->lhs);
695  }
696  else
697  {
698  rhs = scale * (row->rhs - row->constant);
699  }
700 
701  if( SCIPsetIsFeasLT(set, rhs, otherrhs) )
702  {
703  SCIP_CALL( cutpoolDelCut(cutpool, blkmem, set, stat, lp, othercut) );
704 
705  /* use recursion, since in rare cases new cut might compare equal to multiple other cuts
706  * that do not compare equal themselve due to non-transitivity of epsilon comparisons
707  */
708  SCIP_CALL( SCIPcutpoolAddRow(cutpool, blkmem, set, stat, lp, row) );
709  }
710  }
711 
712  return SCIP_OKAY;
713 }
714 
715 /** adds row to cut pool and captures it; doesn't check for multiple cuts */
717  SCIP_CUTPOOL* cutpool, /**< cut pool */
718  BMS_BLKMEM* blkmem, /**< block memory */
719  SCIP_SET* set, /**< global SCIP settings */
720  SCIP_STAT* stat, /**< problem statistics data */
721  SCIP_LP* lp, /**< current LP data */
722  SCIP_ROW* row /**< cutting plane to add */
723  )
724 {
725  SCIP_Real thisefficacy;
726  SCIP_CUT* cut;
727 
728  assert(cutpool != NULL);
729  assert(row != NULL);
730 
731  /* check, if row is modifiable or local */
732  if( SCIProwIsModifiable(row) )
733  {
734  SCIPerrorMessage("cannot store modifiable row <%s> in a cut pool\n", SCIProwGetName(row));
735  return SCIP_INVALIDDATA;
736  }
737  if( SCIProwIsLocal(row) )
738  {
739  SCIPerrorMessage("cannot store locally valid row <%s> in a cut pool\n", SCIProwGetName(row));
740  return SCIP_INVALIDDATA;
741  }
742 
743  assert(! row->inglobalcutpool);
744 
745  /* only called to ensure that minidx and maxidx are up-to-date */
746  (void) SCIProwGetMaxidx(row, set);
747  assert(row->validminmaxidx);
748 
749  /* create the cut */
750  SCIP_CALL( cutCreate(&cut, blkmem, row) );
751  cut->pos = cutpool->ncuts;
752 
753  /* add cut to the pool */
754  SCIP_CALL( cutpoolEnsureCutsMem(cutpool, set, cutpool->ncuts+1) );
755  cutpool->cuts[cutpool->ncuts] = cut;
756  cutpool->ncuts++;
757  cutpool->maxncuts = MAX(cutpool->maxncuts, cutpool->ncuts);
758  if( SCIProwIsRemovable(row) )
759  cutpool->nremovablecuts++;
760 
761  assert(!SCIPhashtableExists(cutpool->hashtable, (void*)cut));
762 
763  /* insert cut in the hash table */
764  SCIP_CALL( SCIPhashtableInsert(cutpool->hashtable, (void*)cut) );
765 
766  assert(SCIPhashtableExists(cutpool->hashtable, (void*)cut));
767 
769  {
770  thisefficacy = SCIProwGetLPEfficacy(row, set, stat, lp);
771  stat->bestefficacy = MAX(thisefficacy, stat->bestefficacy);
772  }
773 
774  /* if this is the global cut pool of SCIP, mark the row to be member of the pool */
775  if( cutpool->globalcutpool )
776  row->inglobalcutpool = TRUE;
777 
778  /* lock the row */
779  SCIProwLock(row);
780 
781  return SCIP_OKAY;
782 }
783 
784 /** removes the LP row from the cut pool */
786  SCIP_CUTPOOL* cutpool, /**< cut pool */
787  BMS_BLKMEM* blkmem, /**< block memory */
788  SCIP_SET* set, /**< global SCIP settings */
789  SCIP_STAT* stat, /**< problem statistics data */
790  SCIP_LP* lp, /**< current LP data */
791  SCIP_ROW* row /**< row to remove */
792  )
793 {
794  SCIP_CUT* cut;
795 
796  assert(cutpool != NULL);
797  assert(row != NULL);
798 
799  /* find the cut in hash table */
800  cut = (SCIP_CUT*)SCIPhashtableRetrieve(cutpool->hashtable, (void*)row);
801  if( cut == NULL )
802  {
803  SCIPerrorMessage("row <%s> is not existing in cutpool %p\n", SCIProwGetName(row), cutpool);
804  return SCIP_INVALIDDATA;
805  }
806 
807  SCIP_CALL( cutpoolDelCut(cutpool, blkmem, set, stat, lp, cut) );
808 
809  return SCIP_OKAY;
810 }
811 
812 
813 /** separates cuts of the cut pool */
815  SCIP_CUTPOOL* cutpool, /**< cut pool */
816  BMS_BLKMEM* blkmem, /**< block memory */
817  SCIP_SET* set, /**< global SCIP settings */
818  SCIP_STAT* stat, /**< problem statistics data */
819  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
820  SCIP_EVENTFILTER* eventfilter, /**< event filter for global events */
821  SCIP_LP* lp, /**< current LP data */
822  SCIP_SEPASTORE* sepastore, /**< separation storage */
823  SCIP_SOL* sol, /**< solution to be separated (or NULL for LP-solution) */
824  SCIP_Bool cutpoolisdelayed, /**< is the cutpool delayed (count cuts found)? */
825  SCIP_Bool root, /**< are we at the root node? */
826  SCIP_RESULT* result /**< pointer to store the result of the separation call */
827  )
828 {
829  SCIP_CUT* cut;
830  SCIP_Bool found;
831  SCIP_Bool cutoff;
832  SCIP_Real minefficacy;
833  SCIP_Bool retest;
834  int firstunproc;
835  int oldncuts;
836  int nefficaciouscuts;
837  int c;
838 
839  assert(cutpool != NULL);
840  assert(stat != NULL);
841  assert(cutpool->processedlp <= stat->lpcount);
842  assert(cutpool->processedlpsol <= stat->lpcount);
843  assert(cutpool->firstunprocessed <= cutpool->ncuts);
844  assert(cutpool->firstunprocessedsol <= cutpool->ncuts);
845  assert(result != NULL);
846 
847  *result = SCIP_DIDNOTRUN;
848 
849  /* don't separate cut pool in the root node, if there are no removable cuts */
850  if( root && cutpool->nremovablecuts == 0 )
851  return SCIP_OKAY;
852 
853  if ( sol == NULL )
854  {
855  if( cutpool->processedlp < stat->lpcount )
856  cutpool->firstunprocessed = 0;
857  if( cutpool->firstunprocessed == cutpool->ncuts )
858  return SCIP_OKAY;
859  firstunproc = cutpool->firstunprocessed;
860  }
861  else
862  {
863  if( cutpool->processedlpsol < stat->lpcount )
864  cutpool->firstunprocessedsol = 0;
865  if( cutpool->firstunprocessedsol == cutpool->ncuts )
866  return SCIP_OKAY;
867  firstunproc = cutpool->firstunprocessedsol;
868  }
869 
870  *result = SCIP_DIDNOTFIND;
871  cutpool->ncalls++;
872  found = FALSE;
873  minefficacy = stat->bestefficacy * stat->minefficacyfac;
874 
875  if( sol == NULL )
876  {
877  retest = cutpool->processedlpefficacy > minefficacy;
878  cutpool->processedlpefficacy = minefficacy;
879  }
880  else
881  {
882  retest = cutpool->processedlpsolefficacy > minefficacy;
883  cutpool->processedlpsolefficacy = minefficacy;
884  }
885 
886  SCIPsetDebugMsg(set, "separating%s cut pool %p with %d cuts, beginning with cut %d\n", ( sol == NULL ) ? "" : " solution from", (void*)cutpool, cutpool->ncuts, firstunproc);
887 
888  /* start timing */
889  SCIPclockStart(cutpool->poolclock, set);
890 
891  /* remember the current total number of found cuts */
892  oldncuts = SCIPsepastoreGetNCuts(sepastore);
893  nefficaciouscuts = 0;
894 
895  /* process all unprocessed cuts in the pool */
896  cutoff = FALSE;
897  for( c = firstunproc; c < cutpool->ncuts; ++c )
898  {
899  SCIP_Longint proclp;
900 
901  cut = cutpool->cuts[c];
902  assert(cut != NULL);
903  assert(cut->processedlp <= stat->lpcount);
904  assert(cut->processedlpsol <= stat->lpcount);
905  assert(cut->pos == c);
906 
907  proclp = ( sol == NULL ) ? cut->processedlp : cut->processedlpsol;
908 
909  if( retest || proclp < stat->lpcount )
910  {
911  SCIP_ROW* row;
912 
913  if ( sol == NULL )
914  cut->processedlp = stat->lpcount;
915  else
916  cut->processedlpsol = stat->lpcount;
917 
918  row = cut->row;
919  if( !SCIProwIsInLP(row) )
920  {
921  SCIP_Real efficacy;
922 
923  /* if the cut is a bound change (i.e. a row with only one variable), add it as bound change instead of LP
924  * row; hence, we want to remove the bound change cut from the SCIP cut pool
925  */
926  if( !SCIProwIsModifiable(row) && SCIProwGetNNonz(row) == 1 )
927  {
928  /* insert bound change cut into separation store which will force that cut */
929  SCIP_CALL( SCIPsepastoreAddCut(sepastore, blkmem, set, stat, eventqueue, eventfilter, lp, row, FALSE, root, &cutoff) );
930  SCIP_CALL( cutpoolDelCut(cutpool, blkmem, set, stat, lp, cut) );
931 
932  if ( cutoff )
933  break;
934 
935  continue;
936  }
937 
938  efficacy = sol == NULL ? SCIProwGetLPEfficacy(row, set, stat, lp) : SCIProwGetSolEfficacy(row, set, stat, sol);
939  if( SCIPsetIsFeasPositive(set, efficacy) )
940  ++nefficaciouscuts;
941 
942  if( efficacy >= minefficacy )
943  {
944  /* insert cut in separation storage */
945  SCIPsetDebugMsg(set, " -> separated cut <%s> from the cut pool (feasibility: %g)\n",
946  SCIProwGetName(row), ( sol == NULL ) ? SCIProwGetLPFeasibility(row, set, stat, lp) : SCIProwGetSolFeasibility(row, set, stat, sol) );
947  SCIP_CALL( SCIPsepastoreAddCut(sepastore, blkmem, set, stat, eventqueue, eventfilter, lp, row, FALSE, root, &cutoff) );
948 
949  /* count cuts */
950  if ( cutpoolisdelayed )
951  {
952  if ( SCIProwGetOriginSepa(row) != NULL )
953  {
954  SCIP_SEPA* sepa;
955 
956  sepa = SCIProwGetOriginSepa(row);
957  SCIPsepaIncNCutsFound(sepa);
959  }
960  else if ( SCIProwGetOriginCons(row) != NULL )
961  {
962  SCIP_CONSHDLR* conshdlr;
963 
964  conshdlr = SCIProwGetOriginCons(row);
965  SCIPconshdlrIncNCutsFound(conshdlr);
966  }
967  }
968 
969  found = TRUE;
970  cut->age = 0;
971 
972  if ( cutoff )
973  break;
974  }
975  else
976  {
977  cut->age++;
978  if( cutIsAged(cut, cutpool->agelimit) )
979  {
980  SCIP_CALL( cutpoolDelCut(cutpool, blkmem, set, stat, lp, cut) );
981  }
982  }
983  }
984  }
985  }
986 
987  if ( sol == NULL )
988  {
989  cutpool->processedlp = stat->lpcount;
990  cutpool->firstunprocessed = cutpool->ncuts;
991  }
992  else
993  {
994  cutpool->processedlpsol = stat->lpcount;
995  cutpool->firstunprocessedsol = cutpool->ncuts;
996  }
997 
998  if( nefficaciouscuts > 0 )
999  {
1000  int maxncuts = SCIPsetGetSepaMaxcuts(set, root);
1001  int ncuts = SCIPsepastoreGetNCuts(sepastore) - oldncuts;
1002 
1003  maxncuts = MIN(maxncuts, nefficaciouscuts);
1004 
1005  /* update the number of found cuts */
1006  cutpool->ncutsfound += ncuts;
1007 
1008  if( ncuts > (0.5 * maxncuts) )
1009  {
1010  stat->ncutpoolfails = MIN(stat->ncutpoolfails - 1, -1);
1011  }
1012  else if( ncuts == 0 || (ncuts < (0.05 * maxncuts)) )
1013  {
1014  stat->ncutpoolfails = MAX(stat->ncutpoolfails + 1, 1);
1015  }
1016  }
1017 
1018  if( stat->ncutpoolfails == (root ? 2 : 10) )
1019  {
1020  cutpool->firstunprocessed = 0;
1021  cutpool->firstunprocessedsol = 0;
1022  stat->minefficacyfac *= 0.5;
1023  stat->ncutpoolfails = 0;
1024  }
1025  else if( stat->ncutpoolfails == -2 )
1026  {
1027  stat->minefficacyfac *= 1.2;
1028  stat->ncutpoolfails = 0;
1029  }
1030 
1031  /* stop timing */
1032  SCIPclockStop(cutpool->poolclock, set);
1033 
1034  if ( cutoff )
1035  *result = SCIP_CUTOFF;
1036  else if( found )
1037  *result = SCIP_SEPARATED;
1038 
1039  return SCIP_OKAY;
1040 }
1041 
1042 /** gets array of cuts in the cut pool */
1044  SCIP_CUTPOOL* cutpool /**< cut pool */
1045  )
1046 {
1047  assert(cutpool != NULL);
1048 
1049  return cutpool->cuts;
1050 }
1051 
1052 /** gets number of cuts in the cut pool */
1054  SCIP_CUTPOOL* cutpool /**< cut pool */
1055  )
1056 {
1057  assert(cutpool != NULL);
1058 
1059  return cutpool->ncuts;
1060 }
1061 
1062 /** gets maximum number of cuts that were stored in the cut pool at the same time */
1064  SCIP_CUTPOOL* cutpool /**< cut pool */
1065  )
1066 {
1067  assert(cutpool != NULL);
1068 
1069  return cutpool->maxncuts;
1070 }
1071 
1072 /** gets time in seconds used for separating cuts from the pool */
1074  SCIP_CUTPOOL* cutpool /**< cut pool */
1075  )
1076 {
1077  assert(cutpool != NULL);
1078 
1079  return SCIPclockGetTime(cutpool->poolclock);
1080 }
1081 
1082 /** get number of times, the cut pool was separated */
1084  SCIP_CUTPOOL* cutpool /**< cut pool */
1085  )
1086 {
1087  assert(cutpool != NULL);
1088 
1089  return cutpool->ncalls;
1090 }
1091 
1092 /** get total number of cuts that were separated from the cut pool */
1094  SCIP_CUTPOOL* cutpool /**< cut pool */
1095  )
1096 {
1097  assert(cutpool != NULL);
1098 
1099  return cutpool->ncutsfound;
1100 }
1101 
enum SCIP_Result SCIP_RESULT
Definition: type_result.h:52
internal methods for separators
SCIP_Bool SCIProwIsRemovable(SCIP_ROW *row)
Definition: lp.c:16998
SCIP_ROW * row
int nunlinked
Definition: struct_lp.h:228
SCIP_Real SCIProwGetSolFeasibility(SCIP_ROW *row, SCIP_SET *set, SCIP_STAT *stat, SCIP_SOL *sol)
Definition: lp.c:6415
SCIP_Bool SCIPsetIsInfinity(SCIP_SET *set, SCIP_Real val)
Definition: set.c:5953
int SCIProwGetMaxidx(SCIP_ROW *row, SCIP_SET *set)
Definition: lp.c:6610
#define NULL
Definition: def.h:239
SCIP_HASHTABLE * hashtable
#define BMSfreeMemoryArrayNull(ptr)
Definition: memory.h:130
#define SCIP_HASHSIZE_CUTPOOLS
Definition: def.h:271
SCIP_SEPA * SCIProwGetOriginSepa(SCIP_ROW *row)
Definition: lp.c:17033
SCIP_Longint processedlp
SCIP_Real SCIProwGetMinval(SCIP_ROW *row, SCIP_SET *set)
Definition: lp.c:6594
int * cols_index
Definition: struct_lp.h:219
SCIP_RETCODE SCIPhashtableInsert(SCIP_HASHTABLE *hashtable, void *element)
Definition: misc.c:2265
SCIP_Bool SCIPsetIsFeasEQ(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6351
SCIP_CUT ** cuts
SCIP_Longint SCIPcutpoolGetNCutsFound(SCIP_CUTPOOL *cutpool)
Definition: cutpool.c:1093
internal methods for clocks and timing issues
int SCIProwGetNNonz(SCIP_ROW *row)
Definition: lp.c:16790
void SCIProwCapture(SCIP_ROW *row)
Definition: lp.c:5246
const char * SCIProwGetName(SCIP_ROW *row)
Definition: lp.c:16928
SCIP_Longint SCIProwGetActiveLPCount(SCIP_ROW *row)
Definition: lp.c:17102
void SCIPclockStop(SCIP_CLOCK *clck, SCIP_SET *set)
Definition: clock.c:350
#define FALSE
Definition: def.h:65
SCIP_Longint processedlpsol
void SCIPclockStart(SCIP_CLOCK *clck, SCIP_SET *set)
Definition: clock.c:280
#define TRUE
Definition: def.h:64
SCIP_Real SCIPcutGetLPActivityQuot(SCIP_CUT *cut)
Definition: cutpool.c:396
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
SCIP_Longint SCIPcutpoolGetNCalls(SCIP_CUTPOOL *cutpool)
Definition: cutpool.c:1083
SCIP_Real SCIProwGetLPEfficacy(SCIP_ROW *row, SCIP_SET *set, SCIP_STAT *stat, SCIP_LP *lp)
Definition: lp.c:6715
SCIP_RETCODE SCIPcutpoolAddNewRow(SCIP_CUTPOOL *cutpool, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_LP *lp, SCIP_ROW *row)
Definition: cutpool.c:716
int SCIPsetCalcMemGrowSize(SCIP_SET *set, int num)
Definition: set.c:5503
void SCIPsepaIncNCutsFoundAtNode(SCIP_SEPA *sepa)
Definition: sepa.c:876
SCIP_Real processedlpefficacy
static SCIP_RETCODE cutpoolDelCut(SCIP_CUTPOOL *cutpool, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_LP *lp, SCIP_CUT *cut)
Definition: cutpool.c:510
int SCIPcutpoolGetMaxNCuts(SCIP_CUTPOOL *cutpool)
Definition: cutpool.c:1063
static SCIP_RETCODE cutFree(SCIP_CUT **cut, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_LP *lp)
Definition: cutpool.c:337
#define BMSfreeMemory(ptr)
Definition: memory.h:127
SCIP_Longint processedlp
SCIP_RETCODE SCIPcutpoolFree(SCIP_CUTPOOL **cutpool, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_LP *lp)
Definition: cutpool.c:456
int nlpcols
Definition: struct_lp.h:227
SCIP_LPSOLSTAT SCIPlpGetSolstat(SCIP_LP *lp)
Definition: lp.c:12891
internal methods for LP management
SCIP_RETCODE SCIPhashtableCreate(SCIP_HASHTABLE **hashtable, BMS_BLKMEM *blkmem, int tablesize, SCIP_DECL_HASHGETKEY((*hashgetkey)), SCIP_DECL_HASHKEYEQ((*hashkeyeq)), SCIP_DECL_HASHKEYVAL((*hashkeyval)), void *userptr)
Definition: misc.c:2014
int SCIPsetGetSepaMaxcuts(SCIP_SET *set, SCIP_Bool root)
Definition: set.c:5681
SCIP_Bool SCIProwIsInLP(SCIP_ROW *row)
Definition: lp.c:17080
int ncutpoolfails
Definition: struct_stat.h:203
SCIP_Real * vals
Definition: struct_lp.h:220
SCIP_RETCODE SCIPcutpoolDelRow(SCIP_CUTPOOL *cutpool, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_LP *lp, SCIP_ROW *row)
Definition: cutpool.c:785
void SCIProwSort(SCIP_ROW *row)
Definition: lp.c:5923
#define SCIPerrorMessage
Definition: pub_message.h:45
SCIP_Longint lpcount
Definition: struct_stat.h:174
static SCIP_RETCODE cutCreate(SCIP_CUT **cut, BMS_BLKMEM *blkmem, SCIP_ROW *row)
Definition: cutpool.c:311
SCIP_COL ** cols
Definition: struct_lp.h:218
SCIP_Bool SCIProwIsLocal(SCIP_ROW *row)
Definition: lp.c:16978
static INLINE uint32_t SCIPrealHashCode(double x)
Definition: pub_misc.h:490
static SCIP_DECL_HASHKEYVAL(hashKeyValCut)
Definition: cutpool.c:245
SCIP_Real lhs
Definition: struct_lp.h:195
SCIP_Longint processedlpsol
int SCIPsepastoreGetNCuts(SCIP_SEPASTORE *sepastore)
Definition: sepastore.c:1085
SCIP_Real SCIPclockGetTime(SCIP_CLOCK *clck)
Definition: clock.c:428
datastructures for storing cuts in a cut pool
SCIP_CONSHDLR * SCIProwGetOriginCons(SCIP_ROW *row)
Definition: lp.c:17018
int maxidx
Definition: struct_lp.h:234
SCIP_ROW * SCIPcutGetRow(SCIP_CUT *cut)
Definition: cutpool.c:372
internal methods for global SCIP settings
#define SCIP_CALL(x)
Definition: def.h:351
#define SCIPhashTwo(a, b)
Definition: pub_misc.h:474
SCIP_Real processedlpsolefficacy
SCIP_RETCODE SCIPcutpoolClear(SCIP_CUTPOOL *cutpool, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_LP *lp)
Definition: cutpool.c:482
SCIP_RETCODE SCIPhashtableRemove(SCIP_HASHTABLE *hashtable, void *element)
Definition: misc.c:2395
SCIP_CUT ** SCIPcutpoolGetCuts(SCIP_CUTPOOL *cutpool)
Definition: cutpool.c:1043
Definition: grphload.c:88
int SCIPcutpoolGetNCuts(SCIP_CUTPOOL *cutpool)
Definition: cutpool.c:1053
internal methods for storing separated cuts
SCIP_Bool SCIProwIsModifiable(SCIP_ROW *row)
Definition: lp.c:16988
SCIP_RETCODE SCIProwRelease(SCIP_ROW **row, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_LP *lp)
Definition: lp.c:5259
SCIP_RETCODE SCIPclockCreate(SCIP_CLOCK **clck, SCIP_CLOCKTYPE clocktype)
Definition: clock.c:160
void SCIPconshdlrIncNCutsFound(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4877
#define BMSfreeBlockMemory(mem, ptr)
Definition: memory.h:446
SCIP_Real bestefficacy
Definition: struct_stat.h:141
public data structures and miscellaneous methods
#define SCIP_Bool
Definition: def.h:62
SCIP_Real minefficacyfac
Definition: struct_stat.h:142
SCIP_Bool SCIPcutpoolIsCutNew(SCIP_CUTPOOL *cutpool, SCIP_SET *set, SCIP_ROW *row)
Definition: cutpool.c:583
void SCIPclockFree(SCIP_CLOCK **clck)
Definition: clock.c:175
#define SCIP_HASHSIZE_CUTPOOLS_SMALL
Definition: def.h:274
#define MIN(x, y)
Definition: def.h:209
#define SCIPsetDebugMsg
Definition: set.h:1940
int minidx
Definition: struct_lp.h:233
SCIP_RETCODE SCIPcutpoolCreate(SCIP_CUTPOOL **cutpool, BMS_BLKMEM *blkmem, SCIP_SET *set, int agelimit, SCIP_Bool globalcutpool)
Definition: cutpool.c:417
unsigned int lpcolssorted
Definition: struct_lp.h:241
internal methods for storing cuts in a cut pool
void * SCIPhashtableRetrieve(SCIP_HASHTABLE *hashtable, void *key)
Definition: misc.c:2326
SCIP_Real SCIProwGetSolEfficacy(SCIP_ROW *row, SCIP_SET *set, SCIP_STAT *stat, SCIP_SOL *sol)
Definition: lp.c:6772
int firstunprocessedsol
SCIP_CLOCK * poolclock
SCIP_Bool SCIPsetIsFeasLT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6373
void SCIPhashtableFree(SCIP_HASHTABLE **hashtable)
Definition: misc.c:2064
void SCIProwLock(SCIP_ROW *row)
Definition: lp.c:5285
SCIP_Real rhs
Definition: struct_lp.h:196
SCIP_Real constant
Definition: struct_lp.h:194
SCIP_Longint ncalls
#define MAX(x, y)
Definition: def.h:208
unsigned int inglobalcutpool
Definition: struct_lp.h:252
public methods for message output
SCIP_Longint ncutsfound
SCIP_Real SCIProwGetLPFeasibility(SCIP_ROW *row, SCIP_SET *set, SCIP_STAT *stat, SCIP_LP *lp)
Definition: lp.c:6161
#define SCIP_Real
Definition: def.h:150
internal methods for problem statistics
SCIP_Bool SCIPsetIsFeasPositive(SCIP_SET *set, SCIP_Real val)
Definition: set.c:6472
#define BMSallocMemory(ptr)
Definition: memory.h:101
#define SCIP_INVALID
Definition: def.h:170
#define BMSreallocMemoryArray(ptr, num)
Definition: memory.h:109
internal methods for constraints and constraint handlers
void SCIPsepaIncNCutsFound(SCIP_SEPA *sepa)
Definition: sepa.c:866
SCIP_RETCODE SCIPcutpoolAddRow(SCIP_CUTPOOL *cutpool, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_LP *lp, SCIP_ROW *row)
Definition: cutpool.c:646
SCIP_RETCODE SCIPcutpoolSeparate(SCIP_CUTPOOL *cutpool, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_LP *lp, SCIP_SEPASTORE *sepastore, SCIP_SOL *sol, SCIP_Bool cutpoolisdelayed, SCIP_Bool root, SCIP_RESULT *result)
Definition: cutpool.c:814
#define SCIP_Longint
Definition: def.h:135
SCIP_Bool SCIPsetIsFeasGT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
Definition: set.c:6417
SCIP_Bool SCIPhashtableExists(SCIP_HASHTABLE *hashtable, void *element)
Definition: misc.c:2377
SCIP_Real SCIProwGetMaxval(SCIP_ROW *row, SCIP_SET *set)
Definition: lp.c:6578
#define BMSallocBlockMemory(mem, ptr)
Definition: memory.h:433
SCIP_Real SCIPcutpoolGetTime(SCIP_CUTPOOL *cutpool)
Definition: cutpool.c:1073
SCIP_Bool globalcutpool
int SCIPcutGetAge(SCIP_CUT *cut)
Definition: cutpool.c:382
common defines and data types used in all packages of SCIP
struct BMS_BlkMem BMS_BLKMEM
Definition: memory.h:419
unsigned int validminmaxidx
Definition: struct_lp.h:244
#define SCIP_ALLOC(x)
Definition: def.h:362
unsigned int nonlpcolssorted
Definition: struct_lp.h:242
SCIP_Longint SCIProwGetNLPsAfterCreation(SCIP_ROW *row)
Definition: lp.c:17112
static SCIP_Bool cutIsAged(SCIP_CUT *cut, int agelimit)
Definition: cutpool.c:360
static SCIP_DECL_HASHGETKEY(hashGetKeyCut)
Definition: cutpool.c:51
static SCIP_DECL_HASHKEYEQ(hashKeyEqCut)
Definition: cutpool.c:65
static SCIP_RETCODE cutpoolEnsureCutsMem(SCIP_CUTPOOL *cutpool, SCIP_SET *set, int num)
Definition: cutpool.c:281
SCIP_RETCODE SCIPsepastoreAddCut(SCIP_SEPASTORE *sepastore, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_LP *lp, SCIP_ROW *cut, SCIP_Bool forcecut, SCIP_Bool root, SCIP_Bool *infeasible)
Definition: sepastore.c:399
int len
Definition: struct_lp.h:226
int age
Definition: struct_lp.h:238
void SCIProwUnlock(SCIP_ROW *row)
Definition: lp.c:5300