Scippy

SCIP

Solving Constraint Integer Programs

presol_dualagg.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 presol_dualagg.c
17  * @brief aggregate variables by dual arguments
18  * @author Dieter Weninger
19  *
20  * This presolver looks for variables which could not be handled by
21  * duality fixing because of one up-/downlock.
22  * If the constraint which delivers the up-/downlock has
23  * a specific structure, we can aggregate the corresponding variable.
24  *
25  * In more detail (for a minimization problem and the case of only one uplock):
26  *
27  * Given a variable \f$x_i\f$ with \f$c_i \leq 0\f$ and only one up lock (originating from a constraint c),
28  * we are looking for a binary variable \f$x_j\f$ such that:
29  * 1. if \f$x_j = 0\f$, constraint c can only be fulfilled for \f$x_i = lb_i\f$, and
30  * 2. if \f$x_j = 1\f$, constraint c becomes redundant and \f$x_i\f$ can be dual-fixed to its upper bound \f$ub_i\f$
31  * (or vice versa). Then we can perform the following aggregation: \f$x_i = lb_i + x_j (ub_i - lb_i)\f$.
32  *
33  * Similar arguments apply for the case of only one down lock and \f$c_i \geq 0\f$.
34  */
35 
36 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
37 
38 #include "blockmemshell/memory.h"
39 #include "scip/presol_dualagg.h"
40 #include "scip/pub_matrix.h"
41 #include "scip/pub_message.h"
42 #include "scip/pub_var.h"
43 #include "scip/scip_general.h"
44 #include "scip/scip_mem.h"
45 #include "scip/scip_message.h"
46 #include "scip/scip_nlp.h"
47 #include "scip/scip_numerics.h"
48 #include "scip/scip_presol.h"
49 #include "scip/scip_pricer.h"
50 #include "scip/scip_prob.h"
51 #include "scip/scip_probing.h"
52 #include "scip/scip_var.h"
53 
54 #define PRESOL_NAME "dualagg"
55 #define PRESOL_DESC "aggregate variables by dual arguments"
56 #define PRESOL_PRIORITY -12000 /**< priority of the presolver (>= 0: before, < 0: after constraint handlers) */
57 #define PRESOL_MAXROUNDS 0 /**< maximal number of presolving rounds the presolver participates in (-1: no limit) */
58 #define PRESOL_TIMING SCIP_PRESOLTIMING_EXHAUSTIVE /* timing of the presolver (fast, medium, or exhaustive) */
59 
60 /** type of aggregation */
62 {
63  BIN0UBOUND = -1, /**< x_j = u_j + (l_j-u_j)x_i with x_i binary and x_j aggregation variable */
64  NOAGG = 0, /**< do not aggregate */
65  BIN0LBOUND = 1 /**< x_j = l_j + (u_j-l_j)x_i with x_i binary and x_j aggregation variable */
66 };
67 typedef enum AggrType AGGRTYPE;
68 
69 /*
70  * Local methods
71  */
72 
73 /** find row which leads to the uplock of the given variable */
74 static
76  SCIP_MATRIX* matrix, /**< constraint matrix */
77  int aggvaridx, /**< index of variable which should be aggregated */
78  int* rowidx, /**< pointer to store row index of uplock */
79  SCIP_Real* coef /**< pointer to store coefficient of variable */
80  )
81 {
82  int* colpnt;
83  int* colend;
84  SCIP_Real* valpnt;
85 
86  assert(rowidx != NULL);
87  assert(coef != NULL);
88  assert(SCIPmatrixGetColNUplocks(matrix, aggvaridx) == 1);
89 
90  /* get nonzero entries of the variable in the matrix */
91  colpnt = SCIPmatrixGetColIdxPtr(matrix, aggvaridx);
92  colend = colpnt + SCIPmatrixGetColNNonzs(matrix, aggvaridx);
93  valpnt = SCIPmatrixGetColValPtr(matrix, aggvaridx);
94 
95  /* iterate over all non-zero coefficients of the column */
96  *rowidx = -1;
97  for(; (colpnt < colend); colpnt++, valpnt++)
98  {
99  /* currently we support only >= relation */
100  if( !SCIPmatrixIsRowRhsInfinity(matrix, *colpnt) )
101  break;
102 
103  /* coef < 0 for >= relation: this row provides an uplock for the variable */
104  if( *valpnt < 0.0 )
105  {
106  *rowidx = *colpnt;
107  *coef = *valpnt;
108  break;
109  }
110  }
111 #ifndef NDEBUG
112  /* in debug mode, we check that the lock number is correct */
113  assert(colpnt < colend);
114  for(colpnt++, valpnt++; (colpnt < colend); colpnt++, valpnt++)
115  {
116  assert(*valpnt > 0.0);
117  }
118 #endif
119 }
120 
121 /** find row which leads to the downlock of the given variable */
122 static
124  SCIP_MATRIX* matrix, /**< constraint matrix */
125  int aggvaridx, /**< index of variable which should be aggregated */
126  int* rowidx, /**< pointer to store row index of downlock */
127  SCIP_Real* coef /**< pointer to store coefficient of variable */
128  )
129 {
130  int* colpnt;
131  int* colend;
132  SCIP_Real* valpnt;
133 
134  assert(rowidx != NULL);
135  assert(coef != NULL);
136  assert(SCIPmatrixGetColNDownlocks(matrix, aggvaridx) == 1);
137 
138  /* get nonzero entries of the variable in the matrix */
139  colpnt = SCIPmatrixGetColIdxPtr(matrix, aggvaridx);
140  colend = colpnt + SCIPmatrixGetColNNonzs(matrix, aggvaridx);
141  valpnt = SCIPmatrixGetColValPtr(matrix, aggvaridx);
142 
143  /* iterate over all non-zero coefficients of the column */
144  *rowidx = -1;
145  for(; (colpnt < colend); colpnt++, valpnt++)
146  {
147  /* currently we support only >= relation */
148  if( !SCIPmatrixIsRowRhsInfinity(matrix, *colpnt) )
149  break;
150 
151  /* coef > 0 for >= relation: this row provides a downlock for the variable */
152  if( *valpnt > 0.0 )
153  {
154  *rowidx = *colpnt;
155  *coef = *valpnt;
156  break;
157  }
158  }
159 #ifndef NDEBUG
160  /* in debug mode, we check that the lock number is correct */
161  assert(colpnt < colend);
162  for(colpnt++, valpnt++; (colpnt < colend); colpnt++, valpnt++)
163  {
164  assert(*valpnt < 0.0);
165  }
166 #endif
167 }
168 
169 /** find fitting binary variable aggregation for uplock case */
170 static
172  SCIP* scip, /**< SCIP main data structure */
173  SCIP_MATRIX* matrix, /**< constraint matrix */
174  int aggvaridx, /**< index of variable which should be aggregated */
175  int* binvaridx, /**< pointer to store index of binary variable */
176  AGGRTYPE* aggtype /**< pointer to store type of aggregation */
177  )
178 {
179  int rowidx;
180  SCIP_Real coef;
181  int* rowpnt;
182  int* rowend;
183  SCIP_Real* valpnt;
184  SCIP_Real minact;
185  SCIP_Real maxact;
186  SCIP_Real lhs;
187  SCIP_Real lb;
188 
189  assert(binvaridx != NULL);
190  assert(aggtype != NULL);
191 
192  *binvaridx = -1;
193  *aggtype = NOAGG;
194 
195  getUplockRowIdx(matrix, aggvaridx, &rowidx, &coef);
196 
197  if( rowidx < 0 )
198  return;
199 
200  assert(coef < 0);
201  minact = SCIPmatrixGetRowMinActivity(matrix, rowidx);
202  maxact = SCIPmatrixGetRowMaxActivity(matrix, rowidx);
203 
204  if( SCIPisInfinity(scip, -minact) || SCIPisInfinity(scip, maxact) )
205  return;
206 
207  lhs = SCIPmatrixGetRowLhs(matrix, rowidx);
208  lb = SCIPmatrixGetColLb(matrix, aggvaridx);
209 
210  /* search for appropriate binary variables */
211  rowpnt = SCIPmatrixGetRowIdxPtr(matrix, rowidx);
212  rowend = rowpnt + SCIPmatrixGetRowNNonzs(matrix, rowidx);
213  valpnt = SCIPmatrixGetRowValPtr(matrix, rowidx);
214  for( ; (rowpnt < rowend); rowpnt++, valpnt++ )
215  {
216  SCIP_VAR* var;
217 
218  if( *rowpnt == aggvaridx )
219  continue;
220 
221  var = SCIPmatrixGetVar(matrix, *rowpnt);
222 
223  /* avoid cases where the binary variable has lb=ub=1 or lb=ub=0 */
224  if( SCIPvarGetType(var) == SCIP_VARTYPE_BINARY &&
225  SCIPmatrixGetColLb(matrix, *rowpnt) < 0.5 &&
226  SCIPmatrixGetColUb(matrix, *rowpnt) > 0.5 )
227  {
228  SCIP_Real bincoef;
229  bincoef = *valpnt;
230 
231  if( bincoef < 0 )
232  {
233  /* binvar = 0 implies that the constraint is redundant */
234  if( SCIPisGE(scip, minact-bincoef, lhs) )
235  {
236  /* binvar = 1 implies that aggvar = lb */
237  SCIP_Real bnd;
238  bnd = (lhs - maxact + coef*lb - bincoef) / coef;
239  if( SCIPisGE(scip, lb, bnd) )
240  {
241  *binvaridx = *rowpnt;
242  *aggtype = BIN0UBOUND;
243  break;
244  }
245  }
246  }
247 
248  if( bincoef > 0 )
249  {
250  /* binvar = 1 implies that the constraint is redundant */
251  if( SCIPisGE(scip, minact+bincoef, lhs) )
252  {
253  /* binvar = 0 implies that aggvar = lb */
254  SCIP_Real bnd;
255  bnd = (lhs - maxact + coef*lb + bincoef) / coef;
256  if( SCIPisGE(scip, lb, bnd) )
257  {
258  *binvaridx = *rowpnt;
259  *aggtype = BIN0LBOUND;
260  }
261  }
262  }
263  }
264  }
265 }
266 
267 /** find fitting binary variable aggregation for downlock case */
268 static
270  SCIP* scip, /**< SCIP main data structure */
271  SCIP_MATRIX* matrix, /**< constraint matrix */
272  int aggvaridx, /**< index of variable which should be aggregated */
273  int* binvaridx, /**< pointer to store index of binary variable */
274  AGGRTYPE* aggtype /**< pointer to store type of aggregation */
275  )
276 {
277  int rowidx;
278  SCIP_Real coef;
279  int* rowpnt;
280  int* rowend;
281  SCIP_Real* valpnt;
282  SCIP_Real minact;
283  SCIP_Real maxact;
284  SCIP_Real lhs;
285  SCIP_Real ub;
286 
287  assert(binvaridx != NULL);
288  assert(aggtype != NULL);
289 
290  *binvaridx = -1;
291  *aggtype = NOAGG;
292 
293  getDownlockRowIdx(matrix, aggvaridx, &rowidx, &coef);
294 
295  if( rowidx < 0 )
296  return;
297 
298  assert(coef > 0);
299  minact = SCIPmatrixGetRowMinActivity(matrix, rowidx);
300  maxact = SCIPmatrixGetRowMaxActivity(matrix, rowidx);
301 
302  if( SCIPisInfinity(scip, -minact) || SCIPisInfinity(scip, maxact) )
303  return;
304 
305  lhs = SCIPmatrixGetRowLhs(matrix, rowidx);
306  ub = SCIPmatrixGetColUb(matrix, aggvaridx);
307 
308  /* search for appropriate binary variables */
309  rowpnt = SCIPmatrixGetRowIdxPtr(matrix, rowidx);
310  rowend = rowpnt + SCIPmatrixGetRowNNonzs(matrix, rowidx);
311  valpnt = SCIPmatrixGetRowValPtr(matrix, rowidx);
312  for( ; (rowpnt < rowend); rowpnt++, valpnt++ )
313  {
314  SCIP_VAR* var;
315 
316  if( *rowpnt == aggvaridx )
317  continue;
318 
319  var = SCIPmatrixGetVar(matrix, *rowpnt);
320 
321  /* avoid cases where the binary variable has lb=ub=1 or lb=ub=0 */
322  if( SCIPvarGetType(var) == SCIP_VARTYPE_BINARY &&
323  SCIPmatrixGetColLb(matrix, *rowpnt) < 0.5 &&
324  SCIPmatrixGetColUb(matrix, *rowpnt) > 0.5 )
325  {
326  SCIP_Real bincoef;
327 
328  bincoef = *valpnt;
329 
330  if( bincoef < 0 )
331  {
332  /* binvar = 0 implies that the constraint is redundant */
333  if( SCIPisGE(scip, minact-bincoef, lhs) )
334  {
335  /* binvar = 1 implies that aggvar = ub */
336  SCIP_Real bnd;
337  bnd = (lhs - maxact + coef*ub - bincoef) / coef;
338  if( SCIPisGE(scip, bnd, ub) )
339  {
340  *binvaridx = *rowpnt;
341  *aggtype = BIN0LBOUND;
342  break;
343  }
344  }
345  }
346 
347  if( bincoef > 0 )
348  {
349  /* binvar = 1 implies that the constraint is redundant */
350  if( SCIPisGE(scip, minact+bincoef, lhs) )
351  {
352  /* binvar = 0 implies that aggvar = ub */
353  SCIP_Real bnd;
354  bnd = (lhs - maxact + coef*ub + bincoef) / coef;
355  if( SCIPisGE(scip, bnd, ub) )
356  {
357  *binvaridx = *rowpnt;
358  *aggtype = BIN0UBOUND;
359  break;
360  }
361  }
362  }
363  }
364  }
365 }
366 
367 /** find variable aggregations for uplock case */
368 static
370  SCIP* scip, /**< SCIP main data structure */
371  SCIP_MATRIX* matrix, /**< constraint matrix */
372  int* nvaragg, /**< number of redundant variables */
373  AGGRTYPE* aggtypes, /**< type of aggregations (in same order as variables in matrix) */
374  SCIP_VAR** binvars /**< pointers to the binary variables (in same order as variables in matrix) */
375  )
376 {
377  int nvars;
378  int i;
379 
380  assert(scip != NULL);
381  assert(matrix != NULL);
382  assert(nvaragg != NULL);
383  assert(aggtypes != NULL);
384  assert(binvars != NULL);
385 
386  nvars = SCIPmatrixGetNColumns(matrix);
387 
388  for( i = 0; i < nvars; i++ )
389  {
390  /* column has only one uplock which keeps it from being fixed by duality fixing */
391  if( SCIPmatrixGetColNUplocks(matrix, i) == 1 &&
392  SCIPisLE(scip, SCIPvarGetObj(SCIPmatrixGetVar(matrix, i)), 0.0) )
393  {
394  SCIP_Real lb;
395  SCIP_Real ub;
396 
397  lb = SCIPmatrixGetColLb(matrix, i);
398  ub = SCIPmatrixGetColUb(matrix, i);
399  assert(lb == SCIPvarGetLbGlobal(SCIPmatrixGetVar(matrix, i))); /*lint !e777*/
400  assert(ub == SCIPvarGetUbGlobal(SCIPmatrixGetVar(matrix, i))); /*lint !e777*/
401 
402  /* the variable needs to have finite bounds to allow an agregation */
403  if( !SCIPisInfinity(scip, -lb) && !SCIPisInfinity(scip, ub) )
404  {
405  int binvaridx;
406  AGGRTYPE aggtype;
407 
408  getBinVarIdxInUplockRow(scip, matrix, i, &binvaridx, &aggtype);
409 
410  if( binvaridx >= 0 )
411  {
412  aggtypes[i] = aggtype;
413  binvars[i] = SCIPmatrixGetVar(matrix, binvaridx);
414  (*nvaragg)++;
415  }
416  }
417  }
418  }
419 
420  return SCIP_OKAY;
421 }
422 
423 /** find variable aggregations for downlock case */
424 static
426  SCIP* scip, /**< SCIP main data structure */
427  SCIP_MATRIX* matrix, /**< constraint matrix */
428  int* nvaragg, /**< number of redundant variables */
429  AGGRTYPE* aggtypes, /**< type of aggregations (in same order as variables in matrix) */
430  SCIP_VAR** binvars /**< pointers to the binary variables (in same order as variables in matrix) */
431  )
432 {
433  int nvars;
434  int i;
435 
436  assert(scip != NULL);
437  assert(matrix != NULL);
438  assert(nvaragg != NULL);
439  assert(aggtypes != NULL);
440  assert(binvars != NULL);
441 
442  nvars = SCIPmatrixGetNColumns(matrix);
443 
444  for( i = 0; i < nvars; i++ )
445  {
446  /* column has only one downlock which keeps it from being fixed by duality fixing;
447  * only handle variable if it was not yet aggregated due to a single uplock
448  */
449  if( SCIPmatrixGetColNDownlocks(matrix, i) == 1 &&
450  SCIPisGE(scip, SCIPvarGetObj(SCIPmatrixGetVar(matrix, i)), 0.0) &&
451  aggtypes[i] == NOAGG )
452  {
453  SCIP_Real lb;
454  SCIP_Real ub;
455 
456  lb = SCIPmatrixGetColLb(matrix, i);
457  ub = SCIPmatrixGetColUb(matrix, i);
458  assert(lb == SCIPvarGetLbGlobal(SCIPmatrixGetVar(matrix, i))); /*lint !e777*/
459  assert(ub == SCIPvarGetUbGlobal(SCIPmatrixGetVar(matrix, i))); /*lint !e777*/
460 
461  /* the variable needs to have finite bounds to allow an agregation */
462  if( !SCIPisInfinity(scip, -lb) && !SCIPisInfinity(scip, ub) )
463  {
464  int binvaridx;
465  AGGRTYPE aggtype;
466  getBinVarIdxInDownlockRow(scip, matrix, i, &binvaridx, &aggtype);
467 
468  if( binvaridx >= 0 )
469  {
470  aggtypes[i] = aggtype;
471  binvars[i] = SCIPmatrixGetVar(matrix, binvaridx);
472  (*nvaragg)++;
473  }
474  }
475  }
476  }
477 
478  return SCIP_OKAY;
479 }
480 
481 /*
482  * Callback methods of presolver
483  */
484 
485 
486 /** execution method of presolver */
487 static
488 SCIP_DECL_PRESOLEXEC(presolExecDualagg)
489 { /*lint --e{715}*/
490  SCIP_MATRIX* matrix;
491  SCIP_Bool initialized;
492  SCIP_Bool complete;
493 
494  assert(result != NULL);
495  *result = SCIP_DIDNOTRUN;
496 
498  return SCIP_OKAY;
499 
501  return SCIP_OKAY;
502 
503  if( SCIPgetNBinVars(scip) == 0 )
504  return SCIP_OKAY;
505 
506  if( !SCIPallowDualReds(scip) )
507  return SCIP_OKAY;
508 
509  *result = SCIP_DIDNOTFIND;
510 
511  matrix = NULL;
512  SCIP_CALL( SCIPmatrixCreate(scip, &matrix, &initialized, &complete) );
513 
514  /* we only work on pure MIPs currently */
515  if( initialized && complete )
516  {
517  AGGRTYPE* aggtypes;
518  SCIP_VAR** binvars;
519  int nvaragg;
520  int ncols;
521 
522  ncols = SCIPmatrixGetNColumns(matrix);
523  nvaragg = 0;
524 
525  SCIP_CALL( SCIPallocBufferArray(scip, &aggtypes, ncols) );
526  BMSclearMemoryArray(aggtypes, ncols);
527 
528  SCIP_CALL( SCIPallocBufferArray(scip, &binvars, ncols) );
529  SCIPdebug( BMSclearMemoryArray(binvars, ncols) );
530 
531  /* search for aggregations */
532  SCIP_CALL( findUplockAggregations(scip, matrix, &nvaragg, aggtypes, binvars) );
533  SCIP_CALL( findDownlockAggregations(scip, matrix, &nvaragg, aggtypes, binvars) );
534 
535  /* apply aggregations, if we found any */
536  if( nvaragg > 0 )
537  {
538  int v;
539 
540  for( v = 0; v < ncols; v++ )
541  {
542  if( aggtypes[v] != NOAGG )
543  {
544  SCIP_Bool infeasible;
545  SCIP_Bool redundant;
546  SCIP_Bool aggregated;
547  SCIP_Real ub;
548  SCIP_Real lb;
549 
550  ub = SCIPmatrixGetColUb(matrix, v);
551  lb = SCIPmatrixGetColLb(matrix, v);
552 
553  /* aggregate variable */
554  assert(binvars[v] != NULL);
555  if( aggtypes[v] == BIN0UBOUND )
556  {
557  SCIP_CALL( SCIPaggregateVars(scip, SCIPmatrixGetVar(matrix, v), binvars[v], 1.0, ub-lb,
558  ub, &infeasible, &redundant, &aggregated) );
559  }
560  else
561  {
562  assert(aggtypes[v] == BIN0LBOUND);
563  SCIP_CALL( SCIPaggregateVars(scip, SCIPmatrixGetVar(matrix, v), binvars[v], 1.0, lb-ub,
564  lb, &infeasible, &redundant, &aggregated) );
565  }
566 
567  /* infeasible aggregation */
568  if( infeasible )
569  {
570  SCIPdebugMsg(scip, " -> infeasible aggregation\n");
571  *result = SCIP_CUTOFF;
572  return SCIP_OKAY;
573  }
574 
575  if( aggregated )
576  (*naggrvars)++;
577  }
578  }
579 
580  /* set result pointer */
581  if( (*naggrvars) > 0 )
582  *result = SCIP_SUCCESS;
583  }
584 
585  SCIPfreeBufferArray(scip, &binvars);
586  SCIPfreeBufferArray(scip, &aggtypes);
587  }
588 
589  SCIPmatrixFree(scip, &matrix);
590 
591  return SCIP_OKAY;
592 }
593 
594 /*
595  * presolver specific interface methods
596  */
597 
598 /** creates the dualagg presolver and includes it in SCIP */
600  SCIP* scip /**< SCIP data structure */
601  )
602 {
603  SCIP_PRESOL* presol;
604 
605  /* include presolver */
607  PRESOL_TIMING, presolExecDualagg, NULL) );
608 
609  return SCIP_OKAY;
610 }
SCIP_VAR * SCIPmatrixGetVar(SCIP_MATRIX *matrix, int col)
Definition: matrix.c:1407
#define NULL
Definition: def.h:253
SCIP_Bool SCIPisStopped(SCIP *scip)
Definition: scip_general.c:686
static SCIP_RETCODE findDownlockAggregations(SCIP *scip, SCIP_MATRIX *matrix, int *nvaragg, AGGRTYPE *aggtypes, SCIP_VAR **binvars)
SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
enum AggrType AGGRTYPE
public methods for memory management
static SCIP_RETCODE findUplockAggregations(SCIP *scip, SCIP_MATRIX *matrix, int *nvaragg, AGGRTYPE *aggtypes, SCIP_VAR **binvars)
SCIP_Bool SCIPisNLPEnabled(SCIP *scip)
Definition: scip_nlp.c:171
#define PRESOL_PRIORITY
void SCIPmatrixFree(SCIP *scip, SCIP_MATRIX **matrix)
Definition: matrix.c:864
static void getUplockRowIdx(SCIP_MATRIX *matrix, int aggvaridx, int *rowidx, SCIP_Real *coef)
public methods for presolving plugins
aggregate variables by dual arguments
SCIP_EXPORT SCIP_Real SCIPvarGetObj(SCIP_VAR *var)
Definition: var.c:17200
SCIP_EXPORT SCIP_VARTYPE SCIPvarGetType(SCIP_VAR *var)
Definition: var.c:16903
#define SCIPdebug(x)
Definition: pub_message.h:74
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
static SCIP_DECL_PRESOLEXEC(presolExecDualagg)
public methods for problem variables
#define SCIPfreeBufferArray(scip, ptr)
Definition: scip_mem.h:123
SCIP_Real SCIPmatrixGetRowMaxActivity(SCIP_MATRIX *matrix, int row)
Definition: matrix.c:1547
public methods for SCIP variables
SCIP_RETCODE SCIPmatrixCreate(SCIP *scip, SCIP_MATRIX **matrixptr, SCIP_Bool *initialized, SCIP_Bool *complete)
Definition: matrix.c:437
#define SCIPdebugMsg
Definition: scip_message.h:69
#define PRESOL_NAME
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
public methods for numerical tolerances
int SCIPmatrixGetRowNNonzs(SCIP_MATRIX *matrix, int row)
Definition: matrix.c:1455
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
static void getBinVarIdxInUplockRow(SCIP *scip, SCIP_MATRIX *matrix, int aggvaridx, int *binvaridx, AGGRTYPE *aggtype)
SCIP_Real SCIPmatrixGetRowLhs(SCIP_MATRIX *matrix, int row)
Definition: matrix.c:1489
SCIP_Real * SCIPmatrixGetColValPtr(SCIP_MATRIX *matrix, int col)
Definition: matrix.c:1315
#define PRESOL_TIMING
static void getDownlockRowIdx(SCIP_MATRIX *matrix, int aggvaridx, int *rowidx, SCIP_Real *coef)
int * SCIPmatrixGetRowIdxPtr(SCIP_MATRIX *matrix, int row)
Definition: matrix.c:1443
SCIP_Bool SCIPinProbing(SCIP *scip)
Definition: scip_probing.c:87
#define PRESOL_MAXROUNDS
#define SCIP_CALL(x)
Definition: def.h:365
SCIP_Real SCIPmatrixGetColLb(SCIP_MATRIX *matrix, int col)
Definition: matrix.c:1372
SCIP_Real * SCIPmatrixGetRowValPtr(SCIP_MATRIX *matrix, int row)
Definition: matrix.c:1431
SCIP_Real SCIPmatrixGetColUb(SCIP_MATRIX *matrix, int col)
Definition: matrix.c:1361
#define SCIPallocBufferArray(scip, ptr, num)
Definition: scip_mem.h:111
#define SCIP_Bool
Definition: def.h:70
SCIP_EXPORT SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
Definition: var.c:17362
static void getBinVarIdxInDownlockRow(SCIP *scip, SCIP_MATRIX *matrix, int aggvaridx, int *binvaridx, AGGRTYPE *aggtype)
int * SCIPmatrixGetColIdxPtr(SCIP_MATRIX *matrix, int col)
Definition: matrix.c:1327
SCIP_Bool SCIPallowDualReds(SCIP *scip)
Definition: scip_var.c:8506
AggrType
int SCIPgetNActivePricers(SCIP *scip)
Definition: scip_pricer.c:338
public methods for matrix
public methods for variable pricer plugins
public methods for nonlinear relaxations
general public methods
#define PRESOL_DESC
SCIP_EXPORT SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
Definition: var.c:17352
public methods for the probing mode
SCIP_Bool SCIPmatrixIsRowRhsInfinity(SCIP_MATRIX *matrix, int row)
Definition: matrix.c:1513
public methods for message output
SCIP_RETCODE SCIPincludePresolDualagg(SCIP *scip)
#define SCIP_Real
Definition: def.h:164
SCIP_RETCODE SCIPincludePresolBasic(SCIP *scip, SCIP_PRESOL **presolptr, const char *name, const char *desc, int priority, int maxrounds, SCIP_PRESOLTIMING timing, SCIP_DECL_PRESOLEXEC((*presolexec)), SCIP_PRESOLDATA *presoldata)
Definition: scip_presol.c:94
public methods for message handling
SCIP_Real SCIPmatrixGetRowMinActivity(SCIP_MATRIX *matrix, int row)
Definition: matrix.c:1535
int SCIPmatrixGetColNDownlocks(SCIP_MATRIX *matrix, int col)
Definition: matrix.c:1395
int SCIPgetNBinVars(SCIP *scip)
Definition: scip_prob.c:2032
int SCIPmatrixGetColNUplocks(SCIP_MATRIX *matrix, int col)
Definition: matrix.c:1383
#define BMSclearMemoryArray(ptr, num)
Definition: memory.h:120
SCIP_RETCODE SCIPaggregateVars(SCIP *scip, SCIP_VAR *varx, SCIP_VAR *vary, SCIP_Real scalarx, SCIP_Real scalary, SCIP_Real rhs, SCIP_Bool *infeasible, SCIP_Bool *redundant, SCIP_Bool *aggregated)
Definition: scip_var.c:8305
SCIP_STAGE SCIPgetStage(SCIP *scip)
Definition: scip_general.c:355
public methods for global and local (sub)problems
int SCIPmatrixGetNColumns(SCIP_MATRIX *matrix)
Definition: matrix.c:1351
int SCIPmatrixGetColNNonzs(SCIP_MATRIX *matrix, int col)
Definition: matrix.c:1339
memory allocation routines