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