Scippy

SCIP

Solving Constraint Integer Programs

lp.h
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-2014 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 lp.h
17  * @brief internal methods for LP management
18  * @author Tobias Achterberg
19  * @author Marc Pfetsch
20  * @author Kati Wolter
21  * @author Gerald Gamrath
22  */
23 
24 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
25 
26 #ifndef __SCIP_LP_H__
27 #define __SCIP_LP_H__
28 
29 
30 #include <stdio.h>
31 
32 #include "scip/def.h"
33 #include "blockmemshell/memory.h"
34 #include "scip/type_set.h"
35 #include "scip/type_stat.h"
36 #include "scip/type_misc.h"
37 #include "scip/type_lp.h"
38 #include "scip/type_var.h"
39 #include "scip/type_prob.h"
40 #include "scip/type_sol.h"
41 #include "scip/pub_lp.h"
42 
43 #include "scip/struct_lp.h"
44 
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48 
49 /*
50  * Column methods
51  */
52 
53 /** creates an LP column */
54 extern
56  SCIP_COL** col, /**< pointer to column data */
57  BMS_BLKMEM* blkmem, /**< block memory */
58  SCIP_SET* set, /**< global SCIP settings */
59  SCIP_STAT* stat, /**< problem statistics */
60  SCIP_VAR* var, /**< variable, this column represents */
61  int len, /**< number of nonzeros in the column */
62  SCIP_ROW** rows, /**< array with rows of column entries */
63  SCIP_Real* vals, /**< array with coefficients of column entries */
64  SCIP_Bool removable /**< should the column be removed from the LP due to aging or cleanup? */
65  );
66 
67 /** frees an LP column */
68 extern
70  SCIP_COL** col, /**< pointer to LP column */
71  BMS_BLKMEM* blkmem, /**< block memory */
72  SCIP_SET* set, /**< global SCIP settings */
73  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
74  SCIP_LP* lp /**< current LP data */
75  );
76 
77 /** output column to file stream */
78 extern
79 void SCIPcolPrint(
80  SCIP_COL* col, /**< LP column */
81  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
82  FILE* file /**< output file (or NULL for standard output) */
83  );
84 
85 /** adds a previously non existing coefficient to an LP column */
86 extern
88  SCIP_COL* col, /**< LP column */
89  BMS_BLKMEM* blkmem, /**< block memory */
90  SCIP_SET* set, /**< global SCIP settings */
91  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
92  SCIP_LP* lp, /**< current LP data */
93  SCIP_ROW* row, /**< LP row */
94  SCIP_Real val /**< value of coefficient */
95  );
96 
97 /** deletes coefficient from column */
98 extern
100  SCIP_COL* col, /**< column to be changed */
101  BMS_BLKMEM* blkmem, /**< block memory */
102  SCIP_SET* set, /**< global SCIP settings */
103  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
104  SCIP_LP* lp, /**< current LP data */
105  SCIP_ROW* row /**< coefficient to be deleted */
106  );
107 
108 /** changes or adds a coefficient to an LP column */
109 extern
111  SCIP_COL* col, /**< LP column */
112  BMS_BLKMEM* blkmem, /**< block memory */
113  SCIP_SET* set, /**< global SCIP settings */
114  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
115  SCIP_LP* lp, /**< current LP data */
116  SCIP_ROW* row, /**< LP row */
117  SCIP_Real val /**< value of coefficient */
118  );
119 
120 /** increases value of an existing or nonexisting coefficient in an LP column */
121 extern
123  SCIP_COL* col, /**< LP column */
124  BMS_BLKMEM* blkmem, /**< block memory */
125  SCIP_SET* set, /**< global SCIP settings */
126  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
127  SCIP_LP* lp, /**< current LP data */
128  SCIP_ROW* row, /**< LP row */
129  SCIP_Real incval /**< value to add to the coefficient */
130  );
131 
132 /** changes objective value of column */
133 extern
135  SCIP_COL* col, /**< LP column to change */
136  SCIP_SET* set, /**< global SCIP settings */
137  SCIP_LP* lp, /**< current LP data */
138  SCIP_Real newobj /**< new objective value */
139  );
140 
141 /** changes lower bound of column */
142 extern
144  SCIP_COL* col, /**< LP column to change */
145  SCIP_SET* set, /**< global SCIP settings */
146  SCIP_LP* lp, /**< current LP data */
147  SCIP_Real newlb /**< new lower bound value */
148  );
149 
150 /** changes upper bound of column */
151 extern
153  SCIP_COL* col, /**< LP column to change */
154  SCIP_SET* set, /**< global SCIP settings */
155  SCIP_LP* lp, /**< current LP data */
156  SCIP_Real newub /**< new upper bound value */
157  );
158 
159 /** calculates the reduced costs of a column using the given dual solution vector */
160 extern
162  SCIP_COL* col, /**< LP column */
163  SCIP_Real* dualsol /**< dual solution vector for current LP rows */
164  );
165 
166 /** gets the reduced costs of a column in last LP or after recalculation */
167 extern
169  SCIP_COL* col, /**< LP column */
170  SCIP_STAT* stat, /**< problem statistics */
171  SCIP_LP* lp /**< current LP data */
172  );
173 
174 /** gets the feasibility of (the dual row of) a column in last LP or after recalculation */
175 extern
177  SCIP_COL* col, /**< LP column */
178  SCIP_SET* set, /**< global SCIP settings */
179  SCIP_STAT* stat, /**< problem statistics */
180  SCIP_LP* lp /**< current LP data */
181  );
182 
183 /** calculates the Farkas coefficient y^T A_i of a column i using the given dual Farkas vector y */
184 extern
186  SCIP_COL* col, /**< LP column */
187  SCIP_Real* dualfarkas /**< dense dual Farkas vector for current LP rows */
188  );
189 
190 /** gets the Farkas coefficient y^T A_i of a column i in last LP (which must be infeasible) */
191 extern
193  SCIP_COL* col, /**< LP column */
194  SCIP_STAT* stat, /**< problem statistics */
195  SCIP_LP* lp /**< current LP data */
196  );
197 
198 /** gets the Farkas value of a column in last LP (which must be infeasible), i.e. the Farkas coefficient y^T A_i times
199  * the best bound for this coefficient, i.e. max{y^T A_i x_i | lb <= x_i <= ub}
200  */
201 extern
203  SCIP_COL* col, /**< LP column */
204  SCIP_STAT* stat, /**< problem statistics */
205  SCIP_LP* lp /**< current LP data */
206  );
207 
208 /** start strong branching - call before any strong branching */
209 extern
211  SCIP_LP* lp /**< LP data */
212  );
213 
214 /** end strong branching - call after any strong branching */
215 extern
217  SCIP_LP* lp /**< LP data */
218  );
219 
220 /** sets strong branching information for a column variable */
221 extern
223  SCIP_COL* col, /**< LP column */
224  SCIP_SET* set, /**< global SCIP settings */
225  SCIP_STAT* stat, /**< dynamic problem statistics */
226  SCIP_LP* lp, /**< LP data */
227  SCIP_Real lpobjval, /**< objective value of the current LP */
228  SCIP_Real primsol, /**< primal solution value of the column in the current LP */
229  SCIP_Real sbdown, /**< dual bound after branching column down */
230  SCIP_Real sbup, /**< dual bound after branching column up */
231  SCIP_Bool sbdownvalid, /**< is the returned down value a valid dual bound? */
232  SCIP_Bool sbupvalid, /**< is the returned up value a valid dual bound? */
233  SCIP_Longint iter, /**< total number of strong branching iterations */
234  int itlim /**< iteration limit applied to the strong branching call */
235  );
236 
237 /** invalidates strong branching information for a column variable */
238 extern
240  SCIP_COL* col, /**< LP column */
241  SCIP_SET* set, /**< global SCIP settings */
242  SCIP_STAT* stat, /**< dynamic problem statistics */
243  SCIP_LP* lp /**< LP data */
244  );
245 
246 /** gets strong branching information on a column variable */
248  SCIP_COL* col, /**< LP column */
249  SCIP_Bool integral, /**< should integral strong branching be performed? */
250  SCIP_SET* set, /**< global SCIP settings */
251  SCIP_STAT* stat, /**< dynamic problem statistics */
252  SCIP_PROB* prob, /**< problem data */
253  SCIP_LP* lp, /**< LP data */
254  int itlim, /**< iteration limit for strong branchings */
255  SCIP_Real* down, /**< stores dual bound after branching column down */
256  SCIP_Real* up, /**< stores dual bound after branching column up */
257  SCIP_Bool* downvalid, /**< stores whether the returned down value is a valid dual bound, or NULL;
258  * otherwise, it can only be used as an estimate value */
259  SCIP_Bool* upvalid, /**< stores whether the returned up value is a valid dual bound, or NULL;
260  * otherwise, it can only be used as an estimate value */
261  SCIP_Bool* lperror /**< pointer to store whether an unresolved LP error occurred */
262  );
263 
264 /** gets strong branching information on column variables */
265 extern
267  SCIP_COL** cols, /**< LP columns */
268  int ncols, /**< number of columns */
269  SCIP_Bool integral, /**< should integral strong branching be performed? */
270  SCIP_SET* set, /**< global SCIP settings */
271  SCIP_STAT* stat, /**< dynamic problem statistics */
272  SCIP_PROB* prob, /**< problem data */
273  SCIP_LP* lp, /**< LP data */
274  int itlim, /**< iteration limit for strong branchings */
275  SCIP_Real* down, /**< stores dual bounds after branching columns down */
276  SCIP_Real* up, /**< stores dual bounds after branching columns up */
277  SCIP_Bool* downvalid, /**< stores whether the returned down values are valid dual bounds, or NULL;
278  * otherwise, they can only be used as an estimate value */
279  SCIP_Bool* upvalid, /**< stores whether the returned up values are valid dual bounds, or NULL;
280  * otherwise, they can only be used as an estimate value */
281  SCIP_Bool* lperror /**< pointer to store whether an unresolved LP error occurred */
282  );
283 
284 /** gets last strong branching information available for a column variable;
285  * returns values of SCIP_INVALID, if strong branching was not yet called on the given column;
286  * keep in mind, that the returned old values may have nothing to do with the current LP solution
287  */
288 extern
290  SCIP_COL* col, /**< LP column */
291  SCIP_Real* down, /**< stores dual bound after branching column down, or NULL */
292  SCIP_Real* up, /**< stores dual bound after branching column up, or NULL */
293  SCIP_Bool* downvalid, /**< stores whether the returned down value is a valid dual bound, or NULL;
294  * otherwise, it can only be used as an estimate value */
295  SCIP_Bool* upvalid, /**< stores whether the returned up value is a valid dual bound, or NULL;
296  * otherwise, it can only be used as an estimate value */
297  SCIP_Real* solval, /**< stores LP solution value of column at last strong branching call, or NULL */
298  SCIP_Real* lpobjval /**< stores LP objective value at last strong branching call, or NULL */
299  );
300 
301 /** if strong branching was already applied on the column at the current node, returns the number of LPs solved after
302  * the LP where the strong branching on this column was applied;
303  * if strong branching was not yet applied on the column at the current node, returns INT_MAX
304  */
305 extern
307  SCIP_COL* col, /**< LP column */
308  SCIP_STAT* stat /**< dynamic problem statistics */
309  );
310 
311 /** marks a column to be not removable from the LP in the current node because it became obsolete */
312 extern
314  SCIP_COL* col, /**< LP column */
315  SCIP_STAT* stat /**< problem statistics */
316  );
317 
318 
319 /*
320  * Row methods
321  */
322 
323 /** creates and captures an LP row */
324 extern
326  SCIP_ROW** row, /**< pointer to LP row data */
327  BMS_BLKMEM* blkmem, /**< block memory */
328  SCIP_SET* set, /**< global SCIP settings */
329  SCIP_STAT* stat, /**< problem statistics */
330  const char* name, /**< name of row */
331  int len, /**< number of nonzeros in the row */
332  SCIP_COL** cols, /**< array with columns of row entries */
333  SCIP_Real* vals, /**< array with coefficients of row entries */
334  SCIP_Real lhs, /**< left hand side of row */
335  SCIP_Real rhs, /**< right hand side of row */
336  SCIP_ROWORIGINTYPE origintype, /**< type of origin of row */
337  void* origin, /**< pointer to constraint handler or separator who created the row (NULL if unkown) */
338  SCIP_Bool local, /**< is row only valid locally? */
339  SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */
340  SCIP_Bool removable /**< should the row be removed from the LP due to aging or cleanup? */
341  );
342 
343 /** frees an LP row */
344 extern
346  SCIP_ROW** row, /**< pointer to LP row */
347  BMS_BLKMEM* blkmem, /**< block memory */
348  SCIP_SET* set, /**< global SCIP settings */
349  SCIP_LP* lp /**< current LP data */
350  );
351 
352 /** output row to file stream */
353 extern
354 void SCIProwPrint(
355  SCIP_ROW* row, /**< LP row */
356  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
357  FILE* file /**< output file (or NULL for standard output) */
358  );
359 
360 /** ensures, that column array of row can store at least num entries */
361 extern
363  SCIP_ROW* row, /**< LP row */
364  BMS_BLKMEM* blkmem, /**< block memory */
365  SCIP_SET* set, /**< global SCIP settings */
366  int num /**< minimum number of entries to store */
367  );
368 
369 /** increases usage counter of LP row */
370 extern
371 void SCIProwCapture(
372  SCIP_ROW* row /**< LP row */
373  );
374 
375 /** decreases usage counter of LP row, and frees memory if necessary */
376 extern
378  SCIP_ROW** row, /**< pointer to LP row */
379  BMS_BLKMEM* blkmem, /**< block memory */
380  SCIP_SET* set, /**< global SCIP settings */
381  SCIP_LP* lp /**< current LP data */
382  );
383 
384 /** enables delaying of row sorting */
385 extern
386 void SCIProwDelaySort(
387  SCIP_ROW* row /**< LP row */
388  );
389 
390 /** disables delaying of row sorting, sorts row and merges coefficients with equal columns */
391 extern
392 void SCIProwForceSort(
393  SCIP_ROW* row, /**< LP row */
394  SCIP_SET* set /**< global SCIP settings */
395  );
396 
397 /** adds a previously non existing coefficient to an LP row */
398 extern
400  SCIP_ROW* row, /**< LP row */
401  BMS_BLKMEM* blkmem, /**< block memory */
402  SCIP_SET* set, /**< global SCIP settings */
403  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
404  SCIP_LP* lp, /**< current LP data */
405  SCIP_COL* col, /**< LP column */
406  SCIP_Real val /**< value of coefficient */
407  );
408 
409 /** deletes coefficient from row */
410 extern
412  SCIP_ROW* row, /**< LP row */
413  BMS_BLKMEM* blkmem, /**< block memory */
414  SCIP_SET* set, /**< global SCIP settings */
415  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
416  SCIP_LP* lp, /**< current LP data */
417  SCIP_COL* col /**< coefficient to be deleted */
418  );
419 
420 /** changes or adds a coefficient to an LP row */
421 extern
423  SCIP_ROW* row, /**< LP row */
424  BMS_BLKMEM* blkmem, /**< block memory */
425  SCIP_SET* set, /**< global SCIP settings */
426  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
427  SCIP_LP* lp, /**< current LP data */
428  SCIP_COL* col, /**< LP column */
429  SCIP_Real val /**< value of coefficient */
430  );
431 
432 /** increases value of an existing or nonexisting coefficient in an LP column */
433 extern
435  SCIP_ROW* row, /**< LP row */
436  BMS_BLKMEM* blkmem, /**< block memory */
437  SCIP_SET* set, /**< global SCIP settings */
438  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
439  SCIP_LP* lp, /**< current LP data */
440  SCIP_COL* col, /**< LP column */
441  SCIP_Real incval /**< value to add to the coefficient */
442  );
443 
444 /** changes constant value of a row */
445 extern
447  SCIP_ROW* row, /**< LP row */
448  BMS_BLKMEM* blkmem, /**< block memory */
449  SCIP_SET* set, /**< global SCIP settings */
450  SCIP_STAT* stat, /**< problem statistics */
451  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
452  SCIP_LP* lp, /**< current LP data */
453  SCIP_Real constant /**< new constant value */
454  );
455 
456 /** add constant value to a row */
457 extern
459  SCIP_ROW* row, /**< LP row */
460  BMS_BLKMEM* blkmem, /**< block memory */
461  SCIP_SET* set, /**< global SCIP settings */
462  SCIP_STAT* stat, /**< problem statistics */
463  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
464  SCIP_LP* lp, /**< current LP data */
465  SCIP_Real addval /**< constant value to add to the row */
466  );
467 
468 /** changes left hand side of LP row */
469 extern
471  SCIP_ROW* row, /**< LP row */
472  BMS_BLKMEM* blkmem, /**< block memory */
473  SCIP_SET* set, /**< global SCIP settings */
474  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
475  SCIP_LP* lp, /**< current LP data */
476  SCIP_Real lhs /**< new left hand side */
477  );
478 
479 /** changes right hand side of LP row */
480 extern
482  SCIP_ROW* row, /**< LP row */
483  BMS_BLKMEM* blkmem, /**< block memory */
484  SCIP_SET* set, /**< global SCIP settings */
485  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
486  SCIP_LP* lp, /**< current LP data */
487  SCIP_Real rhs /**< new right hand side */
488  );
489 
490 /** changes the local flag of LP row */
491 extern
493  SCIP_ROW* row, /**< LP row */
494  SCIP_Bool local /**< new value for local flag */
495  );
496 
497 /** tries to find a value, such that all row coefficients, if scaled with this value become integral */
498 extern
500  SCIP_ROW* row, /**< LP row */
501  SCIP_SET* set, /**< global SCIP settings */
502  SCIP_Real mindelta, /**< minimal relative allowed difference of scaled coefficient s*c and integral i */
503  SCIP_Real maxdelta, /**< maximal relative allowed difference of scaled coefficient s*c and integral i */
504  SCIP_Longint maxdnom, /**< maximal denominator allowed in rational numbers */
505  SCIP_Real maxscale, /**< maximal allowed scalar */
506  SCIP_Bool usecontvars, /**< should the coefficients of the continuous variables also be made integral? */
507  SCIP_Real* intscalar, /**< pointer to store scalar that would make the coefficients integral */
508  SCIP_Bool* success /**< stores whether returned value is valid */
509  );
510 
511 /** tries to scale row, s.t. all coefficients become integral */
512 extern
514  SCIP_ROW* row, /**< LP row */
515  BMS_BLKMEM* blkmem, /**< block memory */
516  SCIP_SET* set, /**< global SCIP settings */
517  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
518  SCIP_STAT* stat, /**< problem statistics */
519  SCIP_LP* lp, /**< current LP data */
520  SCIP_Real mindelta, /**< minimal relative allowed difference of scaled coefficient s*c and integral i */
521  SCIP_Real maxdelta, /**< maximal relative allowed difference of scaled coefficient s*c and integral i */
522  SCIP_Longint maxdnom, /**< maximal denominator allowed in rational numbers */
523  SCIP_Real maxscale, /**< maximal value to scale row with */
524  SCIP_Bool usecontvars, /**< should the coefficients of the continuous variables also be made integral? */
525  SCIP_Bool* success /**< stores whether row could be made rational */
526  );
527 
528 /** recalculates the current activity of a row */
529 extern
531  SCIP_ROW* row, /**< LP row */
532  SCIP_STAT* stat /**< problem statistics */
533  );
534 
535 /** returns the activity of a row in the current LP solution */
536 extern
538  SCIP_ROW* row, /**< LP row */
539  SCIP_SET* set, /**< global SCIP settings */
540  SCIP_STAT* stat, /**< problem statistics */
541  SCIP_LP* lp /**< current LP data */
542  );
543 
544 /** returns the feasibility of a row in the current LP solution: negative value means infeasibility */
545 extern
547  SCIP_ROW* row, /**< LP row */
548  SCIP_SET* set, /**< global SCIP settings */
549  SCIP_STAT* stat, /**< problem statistics */
550  SCIP_LP* lp /**< current LP data */
551  );
552 
553 /** returns the feasibility of a row in the current relaxed solution: negative value means infeasibility */
554 extern
556  SCIP_ROW* row, /**< LP row */
557  SCIP_SET* set, /**< global SCIP settings */
558  SCIP_STAT* stat /**< problem statistics */
559  );
560 
561 /** returns the feasibility of a row in the current NLP solution: negative value means infeasibility */
562 extern
564  SCIP_ROW* row, /**< LP row */
565  SCIP_SET* set, /**< global SCIP settings */
566  SCIP_STAT* stat /**< problem statistics */
567  );
568 
569 /** calculates the current pseudo activity of a row */
570 extern
572  SCIP_ROW* row, /**< row data */
573  SCIP_STAT* stat /**< problem statistics */
574  );
575 
576 /** returns the pseudo activity of a row in the current pseudo solution */
577 extern
579  SCIP_ROW* row, /**< LP row */
580  SCIP_SET* set, /**< global SCIP settings */
581  SCIP_STAT* stat /**< problem statistics */
582  );
583 
584 /** returns the pseudo feasibility of a row in the current pseudo solution: negative value means infeasibility */
585 extern
587  SCIP_ROW* row, /**< LP row */
588  SCIP_SET* set, /**< global SCIP settings */
589  SCIP_STAT* stat /**< problem statistics */
590  );
591 
592 /** returns the activity of a row for a given solution */
593 extern
595  SCIP_ROW* row, /**< LP row */
596  SCIP_SET* set, /**< global SCIP settings */
597  SCIP_STAT* stat, /**< problem statistics data */
598  SCIP_SOL* sol /**< primal CIP solution */
599  );
600 
601 /** returns the feasibility of a row for the given solution */
602 extern
604  SCIP_ROW* row, /**< LP row */
605  SCIP_SET* set, /**< global SCIP settings */
606  SCIP_STAT* stat, /**< problem statistics data */
607  SCIP_SOL* sol /**< primal CIP solution */
608  );
609 
610 /** returns the minimal activity of a row w.r.t. the columns' bounds */
611 extern
613  SCIP_ROW* row, /**< LP row */
614  SCIP_SET* set, /**< global SCIP settings */
615  SCIP_STAT* stat /**< problem statistics data */
616  );
617 
618 /** returns the maximal activity of a row w.r.t. the columns' bounds */
619 extern
621  SCIP_ROW* row, /**< LP row */
622  SCIP_SET* set, /**< global SCIP settings */
623  SCIP_STAT* stat /**< problem statistics data */
624  );
625 
626 /** returns whether the row is unmodifiable and redundant w.r.t. the columns' bounds */
627 extern
629  SCIP_ROW* row, /**< LP row */
630  SCIP_SET* set, /**< global SCIP settings */
631  SCIP_STAT* stat /**< problem statistics data */
632  );
633 
634 /** gets maximal absolute value of row vector coefficients */
635 extern
637  SCIP_ROW* row, /**< LP row */
638  SCIP_SET* set /**< global SCIP settings */
639  );
640 
641 /** gets minimal absolute value of row vector's non-zero coefficients */
642 extern
644  SCIP_ROW* row, /**< LP row */
645  SCIP_SET* set /**< global SCIP settings */
646  );
647 
648 /** gets maximal column index of row entries */
649 int SCIProwGetMaxidx(
650  SCIP_ROW* row, /**< LP row */
651  SCIP_SET* set /**< global SCIP settings */
652  );
653 
654 /** gets minimal column index of row entries */
655 int SCIProwGetMinidx(
656  SCIP_ROW* row, /**< LP row */
657  SCIP_SET* set /**< global SCIP settings */
658  );
659 
660 /** returns row's efficacy with respect to the current LP solution: e = -feasibility/norm */
661 extern
663  SCIP_ROW* row, /**< LP row */
664  SCIP_SET* set, /**< global SCIP settings */
665  SCIP_STAT* stat, /**< problem statistics data */
666  SCIP_LP* lp /**< current LP data */
667  );
668 
669 /** returns whether the row's efficacy with respect to the current LP solution is greater than the minimal cut efficacy */
670 extern
672  SCIP_ROW* row, /**< LP row */
673  SCIP_SET* set, /**< global SCIP settings */
674  SCIP_STAT* stat, /**< problem statistics data */
675  SCIP_LP* lp, /**< current LP data */
676  SCIP_Bool root /**< should the root's minimal cut efficacy be used? */
677  );
678 
679 /** returns row's efficacy with respect to the given primal solution: e = -feasibility/norm */
680 extern
682  SCIP_ROW* row, /**< LP row */
683  SCIP_SET* set, /**< global SCIP settings */
684  SCIP_STAT* stat, /**< problem statistics data */
685  SCIP_SOL* sol /**< primal CIP solution */
686  );
687 
688 /** returns whether the row's efficacy with respect to the given primal solution is greater than the minimal cut
689  * efficacy
690  */
691 extern
693  SCIP_ROW* row, /**< LP row */
694  SCIP_SET* set, /**< global SCIP settings */
695  SCIP_STAT* stat, /**< problem statistics data */
696  SCIP_SOL* sol, /**< primal CIP solution */
697  SCIP_Bool root /**< should the root's minimal cut efficacy be used? */
698  );
699 
700 /** returns row's efficacy with respect to the relaxed solution: e = -feasibility/norm */
701 extern
703  SCIP_ROW* row, /**< LP row */
704  SCIP_SET* set, /**< global SCIP settings */
705  SCIP_STAT* stat /**< problem statistics data */
706  );
707 
708 /** returns row's efficacy with respect to the NLP solution: e = -feasibility/norm */
709 extern
711  SCIP_ROW* row, /**< LP row */
712  SCIP_SET* set, /**< global SCIP settings */
713  SCIP_STAT* stat /**< problem statistics data */
714  );
715 
716 /** gets parallelism of row with objective function: if the returned value is 1, the row is parallel to the objective
717  * function, if the value is 0, it is orthogonal to the objective function
718  */
719 extern
721  SCIP_ROW* row, /**< LP row */
722  SCIP_SET* set, /**< global SCIP settings */
723  SCIP_LP* lp /**< current LP data */
724  );
725 
726 /** includes event handler with given data in row's event filter */
727 extern
729  SCIP_ROW* row, /**< row */
730  BMS_BLKMEM* blkmem, /**< block memory */
731  SCIP_SET* set, /**< global SCIP settings */
732  SCIP_EVENTTYPE eventtype, /**< event type to catch */
733  SCIP_EVENTHDLR* eventhdlr, /**< event handler to call for the event processing */
734  SCIP_EVENTDATA* eventdata, /**< event data to pass to the event handler for the event processing */
735  int* filterpos /**< pointer to store position of event filter entry, or NULL */
736  );
737 
738 /** deletes event handler with given data from row's event filter */
739 extern
741  SCIP_ROW* row, /**< row */
742  BMS_BLKMEM* blkmem, /**< block memory */
743  SCIP_SET* set, /**< global SCIP settings */
744  SCIP_EVENTTYPE eventtype, /**< event type mask of dropped event */
745  SCIP_EVENTHDLR* eventhdlr, /**< event handler to call for the event processing */
746  SCIP_EVENTDATA* eventdata, /**< event data to pass to the event handler for the event processing */
747  int filterpos /**< position of event filter entry returned by SCIPvarCatchEvent(), or -1 */
748  );
749 
750 /** marks a row to be not removable from the LP in the current node */
751 extern
753  SCIP_ROW* row, /**< LP row */
754  SCIP_STAT* stat /**< problem statistics */
755  );
756 
757 
758 /*
759  * LP methods
760  */
761 
762 /** creates empty LP data object */
763 extern
765  SCIP_LP** lp, /**< pointer to LP data object */
766  SCIP_SET* set, /**< global SCIP settings */
767  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
768  SCIP_STAT* stat, /**< problem statistics */
769  const char* name /**< problem name */
770  );
771 
772 /** frees LP data object */
773 extern
775  SCIP_LP** lp, /**< pointer to LP data object */
776  BMS_BLKMEM* blkmem, /**< block memory */
777  SCIP_SET* set, /**< global SCIP settings */
778  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
779  SCIP_EVENTFILTER* eventfilter /**< global event filter */
780  );
781 
782 /** resets the LP to the empty LP by removing all columns and rows from LP, releasing all rows, and flushing the
783  * changes to the LP solver
784  */
785 extern
787  SCIP_LP* lp, /**< LP data */
788  BMS_BLKMEM* blkmem, /**< block memory */
789  SCIP_SET* set, /**< global SCIP settings */
790  SCIP_STAT* stat, /**< problem statistics */
791  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
792  SCIP_EVENTFILTER* eventfilter /**< global event filter */
793  );
794 
795 /** adds a column to the LP and captures the variable */
796 extern
798  SCIP_LP* lp, /**< LP data */
799  SCIP_SET* set, /**< global SCIP settings */
800  SCIP_COL* col, /**< LP column */
801  int depth /**< depth in the tree where the column addition is performed */
802  );
803 
804 /** adds a row to the LP and captures it */
805 extern
807  SCIP_LP* lp, /**< LP data */
808  BMS_BLKMEM* blkmem, /**< block memory buffers */
809  SCIP_SET* set, /**< global SCIP settings */
810  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
811  SCIP_EVENTFILTER* eventfilter, /**< global event filter */
812  SCIP_ROW* row, /**< LP row */
813  int depth /**< depth in the tree where the row addition is performed */
814  );
815 
816 /** removes all columns after the given number of columns from the LP */
817 extern
819  SCIP_LP* lp, /**< LP data */
820  SCIP_SET* set, /**< global SCIP settings */
821  int newncols /**< new number of columns in the LP */
822  );
823 
824 /** removes and releases all rows after the given number of rows from the LP */
825 extern
827  SCIP_LP* lp, /**< LP data */
828  BMS_BLKMEM* blkmem, /**< block memory */
829  SCIP_SET* set, /**< global SCIP settings */
830  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
831  SCIP_EVENTFILTER* eventfilter, /**< global event filter */
832  int newnrows /**< new number of rows in the LP */
833  );
834 
835 /** removes all columns and rows from LP, releases all rows */
836 extern
838  SCIP_LP* lp, /**< LP data */
839  BMS_BLKMEM* blkmem, /**< block memory */
840  SCIP_SET* set, /**< global SCIP settings */
841  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
842  SCIP_EVENTFILTER* eventfilter /**< global event filter */
843  );
844 
845 /** remembers number of columns and rows to track the newly added ones */
846 extern
847 void SCIPlpMarkSize(
848  SCIP_LP* lp /**< current LP data */
849  );
850 
851 /** sets the remembered number of columns and rows to the given values */
852 extern
853 void SCIPlpSetSizeMark(
854  SCIP_LP* lp, /**< current LP data */
855  int nrows, /**< number of rows to set the size marker to */
856  int ncols /**< number of columns to set the size marker to */
857  );
858 
859 /** gets all indices of basic columns and rows: index i >= 0 corresponds to column i, index i < 0 to row -i-1 */
860 extern
862  SCIP_LP* lp, /**< LP data */
863  int* basisind /**< pointer to store basis indices ready to keep number of rows entries */
864  );
865 
866 /** gets current basis status for columns and rows; arrays must be large enough to store the basis status */
867 extern
869  SCIP_LP* lp, /**< LP data */
870  int* cstat, /**< array to store column basis status, or NULL */
871  int* rstat /**< array to store row basis status, or NULL */
872  );
873 
874 /** gets a row from the inverse basis matrix B^-1 */
875 extern
877  SCIP_LP* lp, /**< LP data */
878  int r, /**< row number */
879  SCIP_Real* coef /**< pointer to store the coefficients of the row */
880  );
881 
882 /** gets a column from the inverse basis matrix B^-1 */
883 extern
885  SCIP_LP* lp, /**< LP data */
886  int c, /**< column number of B^-1; this is NOT the number of the column in the LP
887  * returned by SCIPcolGetLPPos(); you have to call SCIPgetBasisInd()
888  * to get the array which links the B^-1 column numbers to the row and
889  * column numbers of the LP! c must be between 0 and nrows-1, since the
890  * basis has the size nrows * nrows */
891  SCIP_Real* coef /**< pointer to store the coefficients of the column */
892  );
893 
894 /** gets a row from the product of inverse basis matrix B^-1 and coefficient matrix A (i.e. from B^-1 * A) */
895 extern
897  SCIP_LP* lp, /**< LP data */
898  int r, /**< row number */
899  SCIP_Real* binvrow, /**< row in B^-1 from prior call to SCIPlpGetBInvRow(), or NULL */
900  SCIP_Real* coef /**< pointer to store the coefficients of the row */
901  );
902 
903 /** gets a column from the product of inverse basis matrix B^-1 and coefficient matrix A (i.e. from B^-1 * A),
904  * i.e., it computes B^-1 * A_c with A_c being the c'th column of A
905  */
906 extern
908  SCIP_LP* lp, /**< LP data */
909  int c, /**< column number which can be accessed by SCIPcolGetLPPos() */
910  SCIP_Real* coef /**< pointer to store the coefficients of the column */
911  );
912 
913 /** calculates a weighted sum of all LP rows; for negative weights, the left and right hand side of the corresponding
914  * LP row are swapped in the summation
915  */
916 extern
918  SCIP_LP* lp, /**< LP data */
919  SCIP_SET* set, /**< global SCIP settings */
920  SCIP_PROB* prob, /**< problem data */
921  SCIP_Real* weights, /**< row weights in row summation */
922  SCIP_REALARRAY* sumcoef, /**< array to store sum coefficients indexed by variables' probindex */
923  SCIP_Real* sumlhs, /**< pointer to store the left hand side of the row summation */
924  SCIP_Real* sumrhs /**< pointer to store the right hand side of the row summation */
925  );
926 
927 /* calculates a MIR cut out of the weighted sum of LP rows; The weights of modifiable rows are set to 0.0, because these
928  * rows cannot participate in a MIR cut.
929  */
930 extern
932  SCIP_LP* lp, /**< LP data */
933  SCIP_SET* set, /**< global SCIP settings */
934  SCIP_STAT* stat, /**< problem statistics */
935  SCIP_PROB* prob, /**< problem data */
936  SCIP_SOL* sol, /**< the solution that should be separated, or NULL for LP solution */
937  SCIP_Real boundswitch, /**< fraction of domain up to which lower bound is used in transformation */
938  SCIP_Bool usevbds, /**< should variable bounds be used in bound transformation? */
939  SCIP_Bool allowlocal, /**< should local information allowed to be used, resulting in a local cut? */
940  SCIP_Bool fixintegralrhs, /**< should complementation tried to be adjusted such that rhs gets fractional? */
941  int* boundsfortrans, /**< bounds that should be used for transformed variables: vlb_idx/vub_idx,
942  * -1 for global lb/ub, -2 for local lb/ub, or -3 for using closest bound;
943  * NULL for using closest bound for all variables */
944  SCIP_BOUNDTYPE* boundtypesfortrans, /**< type of bounds that should be used for transformed variables;
945  * NULL for using closest bound for all variables */
946  int maxmksetcoefs, /**< maximal number of nonzeros allowed in aggregated base inequality */
947  SCIP_Real maxweightrange, /**< maximal valid range max(|weights|)/min(|weights|) of row weights */
948  SCIP_Real minfrac, /**< minimal fractionality of rhs to produce MIR cut for */
949  SCIP_Real maxfrac, /**< maximal fractionality of rhs to produce MIR cut for */
950  SCIP_Real* weights, /**< row weights in row summation */
951  int* sidetypes, /**< specify row side type (-1 = lhs, 0 = unkown, 1 = rhs) or NULL for automatic choices */
952  SCIP_Real scale, /**< additional scaling factor multiplied to all rows */
953  SCIP_Real* mksetcoefs, /**< array to store mixed knapsack set coefficients: size nvars; or NULL */
954  SCIP_Bool* mksetcoefsvalid, /**< pointer to store whether mixed knapsack set coefficients are valid; or NULL */
955  SCIP_Real* mircoef, /**< array to store MIR coefficients: must be of size nvars */
956  SCIP_Real* mirrhs, /**< pointer to store the right hand side of the MIR row */
957  SCIP_Real* cutactivity, /**< pointer to store the activity of the resulting cut */
958  SCIP_Bool* success, /**< pointer to store whether the returned coefficients are a valid MIR cut */
959  SCIP_Bool* cutislocal, /**< pointer to store whether the returned cut is only valid locally */
960  int* cutrank /**< pointer to store the rank of the returned cut; or NULL */
961  );
962 
963 /* calculates a strong CG cut out of the weighted sum of LP rows; The weights of modifiable rows are set to 0.0, because these
964  * rows cannot participate in a strong CG cut.
965  */
966 extern
968  SCIP_LP* lp, /**< LP data */
969  SCIP_SET* set, /**< global SCIP settings */
970  SCIP_STAT* stat, /**< problem statistics */
971  SCIP_PROB* prob, /**< problem data */
972  SCIP_Real boundswitch, /**< fraction of domain up to which lower bound is used in transformation */
973  SCIP_Bool usevbds, /**< should variable bounds be used in bound transformation? */
974  SCIP_Bool allowlocal, /**< should local information allowed to be used, resulting in a local cut? */
975  int maxmksetcoefs, /**< maximal number of nonzeros allowed in aggregated base inequality */
976  SCIP_Real maxweightrange, /**< maximal valid range max(|weights|)/min(|weights|) of row weights */
977  SCIP_Real minfrac, /**< minimal fractionality of rhs to produce strong CG cut for */
978  SCIP_Real maxfrac, /**< maximal fractionality of rhs to produce strong CG cut for */
979  SCIP_Real* weights, /**< row weights in row summation */
980  SCIP_Real scale, /**< additional scaling factor multiplied to all rows */
981  SCIP_Real* strongcgcoef, /**< array to store strong CG coefficients: must be of size nvars */
982  SCIP_Real* strongcgrhs, /**< pointer to store the right hand side of the strong CG row */
983  SCIP_Real* cutactivity, /**< pointer to store the activity of the resulting cut */
984  SCIP_Bool* success, /**< pointer to store whether the returned coefficients are a valid strong CG cut */
985  SCIP_Bool* cutislocal, /**< pointer to store whether the returned cut is only valid locally */
986  int* cutrank /**< pointer to store the rank of the returned cut; or NULL */
987  );
988 
989 /** stores LP state (like basis information) into LP state object */
990 extern
992  SCIP_LP* lp, /**< LP data */
993  BMS_BLKMEM* blkmem, /**< block memory */
994  SCIP_LPISTATE** lpistate /**< pointer to LP state information (like basis information) */
995  );
996 
997 /** loads LP state (like basis information) into solver */
998 extern
1000  SCIP_LP* lp, /**< LP data */
1001  BMS_BLKMEM* blkmem, /**< block memory */
1002  SCIP_SET* set, /**< global SCIP settings */
1003  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
1004  SCIP_LPISTATE* lpistate, /**< LP state information (like basis information) */
1005  SCIP_Bool wasprimfeas, /**< primal feasibility when LP state information was stored */
1006  SCIP_Bool wasdualfeas /**< dual feasibility when LP state information was stored */
1007  );
1008 
1009 /** frees LP state information */
1010 extern
1012  SCIP_LP* lp, /**< LP data */
1013  BMS_BLKMEM* blkmem, /**< block memory */
1014  SCIP_LPISTATE** lpistate /**< pointer to LP state information (like basis information) */
1015  );
1016 
1017 /** stores pricing norms into LP norms object */
1018 extern
1020  SCIP_LP* lp, /**< LP data */
1021  BMS_BLKMEM* blkmem, /**< block memory */
1022  SCIP_LPINORMS** lpinorms /**< pointer to LP pricing norms information */
1023  );
1024 
1025 /** loads pricing norms from LP norms object into solver */
1026 extern
1028  SCIP_LP* lp, /**< LP data */
1029  BMS_BLKMEM* blkmem, /**< block memory */
1030  SCIP_LPINORMS* lpinorms /**< LP pricing norms information */
1031  );
1032 
1033 /** frees pricing norms information */
1034 extern
1036  SCIP_LP* lp, /**< LP data */
1037  BMS_BLKMEM* blkmem, /**< block memory */
1038  SCIP_LPINORMS** lpinorms /**< pointer to LP pricing norms information */
1039  );
1040 
1041 /** sets the upper objective limit of the LP solver */
1042 extern
1044  SCIP_LP* lp, /**< current LP data */
1045  SCIP_SET* set, /**< global SCIP settings */
1046  SCIP_PROB* prob, /**< problem data */
1047  SCIP_Real cutoffbound /**< new upper objective limit */
1048  );
1049 
1050 /** applies all cached changes to the LP solver */
1051 extern
1053  SCIP_LP* lp, /**< current LP data */
1054  BMS_BLKMEM* blkmem, /**< block memory */
1055  SCIP_SET* set, /**< global SCIP settings */
1056  SCIP_EVENTQUEUE* eventqueue /**< event queue */
1057  );
1058 
1059 /** marks the LP to be flushed, even if the LP thinks it is not flushed */
1060 extern
1062  SCIP_LP* lp, /**< current LP data */
1063  SCIP_SET* set /**< global SCIP settings */
1064  );
1065 
1066 /** solves the LP with simplex algorithm, and copy the solution into the column's data */
1067 extern
1069  SCIP_LP* lp, /**< LP data */
1070  SCIP_SET* set, /**< global SCIP settings */
1071  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
1072  BMS_BLKMEM* blkmem, /**< block memory buffers */
1073  SCIP_STAT* stat, /**< problem statistics */
1074  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
1075  SCIP_EVENTFILTER* eventfilter, /**< global event filter */
1076  SCIP_PROB* prob, /**< problem data */
1077  SCIP_Longint itlim, /**< maximal number of LP iterations to perform, or -1 for no limit */
1078  SCIP_Bool limitresolveiters, /**< should LP iterations for resolving calls be limited?
1079  * (limit is computed within the method w.r.t. the average LP iterations) */
1080  SCIP_Bool aging, /**< should aging and removal of obsolete cols/rows be applied? */
1081  SCIP_Bool keepsol, /**< should the old LP solution be kept if no iterations were performed? */
1082  SCIP_Bool* lperror /**< pointer to store whether an unresolved LP error occurred */
1083  );
1084 
1085 /** gets solution status of current LP */
1086 extern
1088  SCIP_LP* lp /**< current LP data */
1089  );
1090 
1091 /** sets whether the root LP is a relaxation of the problem and its optimal objective value is a global lower bound */
1092 extern
1094  SCIP_LP* lp, /**< LP data */
1095  SCIP_Bool isrelax /**< is the root lp a relaxation of the problem? */
1096  );
1097 
1098 /** returns whether the root lp is a relaxation of the problem and its optimal objective value is a global lower bound */
1099 extern
1101  SCIP_LP* lp /**< LP data */
1102  );
1103 
1104 /** gets objective value of current LP
1105  *
1106  * @note This method returns the objective value of the current LP solution, which might be primal or dual infeasible
1107  * if a limit was hit during solving. It must not be used as a dual bound if the LP solution status is
1108  * SCIP_LPSOLSTAT_ITERLIMIT or SCIP_LPSOLSTAT_TIMELIMIT.
1109  */
1110 extern
1112  SCIP_LP* lp, /**< current LP data */
1113  SCIP_SET* set, /**< global SCIP settings */
1114  SCIP_PROB* prob /**< problem data */
1115  );
1116 
1117 /** gets part of objective value of current LP that results from COLUMN variables only */
1118 extern
1120  SCIP_LP* lp /**< current LP data */
1121  );
1122 
1123 /** gets part of objective value of current LP that results from LOOSE variables only */
1124 extern
1126  SCIP_LP* lp, /**< current LP data */
1127  SCIP_SET* set, /**< global SCIP settings */
1128  SCIP_PROB* prob /**< problem data */
1129  );
1130 
1131 /** remembers the current LP objective value as root solution value */
1132 extern
1134  SCIP_LP* lp, /**< current LP data */
1135  SCIP_SET* set, /**< global SCIP settings */
1136  SCIP_PROB* prob /**< problem data */
1137  );
1138 
1139 /** invalidates the root LP solution value */
1140 extern
1142  SCIP_LP* lp /**< current LP data */
1143  );
1144 
1145 /** gets the global pseudo objective value; that is all variables set to their best (w.r.t. the objective function)
1146  * global bound
1147  */
1148 extern
1150  SCIP_LP* lp, /**< current LP data */
1151  SCIP_SET* set, /**< global SCIP settings */
1152  SCIP_PROB* prob /**< problem data */
1153  );
1154 
1155 /** gets the pseudo objective value for the current search node; that is all variables set to their best (w.r.t. the
1156  * objective function) local bound
1157  */
1158 extern
1160  SCIP_LP* lp, /**< current LP data */
1161  SCIP_SET* set, /**< global SCIP settings */
1162  SCIP_PROB* prob /**< problem data */
1163  );
1164 
1165 /** gets pseudo objective value, if a bound of the given variable would be modified in the given way */
1166 extern
1168  SCIP_LP* lp, /**< current LP data */
1169  SCIP_SET* set, /**< global SCIP settings */
1170  SCIP_PROB* prob, /**< problem data */
1171  SCIP_VAR* var, /**< problem variable */
1172  SCIP_Real oldbound, /**< old value for bound */
1173  SCIP_Real newbound, /**< new value for bound */
1174  SCIP_BOUNDTYPE boundtype /**< type of bound: lower or upper bound */
1175  );
1176 
1177 /** gets pseudo objective value, if a bound of the given variable would be modified in the given way;
1178  * perform calculations with interval arithmetic to get an exact lower bound
1179  */
1180 extern
1182  SCIP_LP* lp, /**< current LP data */
1183  SCIP_SET* set, /**< global SCIP settings */
1184  SCIP_VAR* var, /**< problem variable */
1185  SCIP_Real oldbound, /**< old value for bound */
1186  SCIP_Real newbound, /**< new value for bound */
1187  SCIP_BOUNDTYPE boundtype /**< type of bound: lower or upper bound */
1188  );
1189 
1190 /** updates current pseudo and loose objective value for a change in a variable's objective value */
1191 extern
1193  SCIP_LP* lp, /**< current LP data */
1194  SCIP_SET* set, /**< global SCIP settings */
1195  SCIP_VAR* var, /**< problem variable that changed */
1196  SCIP_Real oldobj, /**< old objective value of variable */
1197  SCIP_Real newobj /**< new objective value of variable */
1198  );
1199 
1200 /** updates current root pseudo objective value for a global change in a variable's lower bound */
1201 extern
1203  SCIP_LP* lp, /**< current LP data */
1204  SCIP_SET* set, /**< global SCIP settings */
1205  SCIP_VAR* var, /**< problem variable that changed */
1206  SCIP_Real oldlb, /**< old lower bound of variable */
1207  SCIP_Real newlb /**< new lower bound of variable */
1208  );
1209 
1210 /** updates current pseudo and loose objective value for a change in a variable's lower bound */
1211 extern
1213  SCIP_LP* lp, /**< current LP data */
1214  SCIP_SET* set, /**< global SCIP settings */
1215  SCIP_VAR* var, /**< problem variable that changed */
1216  SCIP_Real oldlb, /**< old lower bound of variable */
1217  SCIP_Real newlb /**< new lower bound of variable */
1218  );
1219 
1220 /** updates current root pseudo objective value for a global change in a variable's upper bound */
1221 extern
1223  SCIP_LP* lp, /**< current LP data */
1224  SCIP_SET* set, /**< global SCIP settings */
1225  SCIP_VAR* var, /**< problem variable that changed */
1226  SCIP_Real oldub, /**< old upper bound of variable */
1227  SCIP_Real newub /**< new upper bound of variable */
1228  );
1229 
1230 /** updates current pseudo objective value for a change in a variable's upper bound */
1231 extern
1233  SCIP_LP* lp, /**< current LP data */
1234  SCIP_SET* set, /**< global SCIP settings */
1235  SCIP_VAR* var, /**< problem variable that changed */
1236  SCIP_Real oldub, /**< old upper bound of variable */
1237  SCIP_Real newub /**< new upper bound of variable */
1238  );
1239 
1240 /** informs LP, that given variable was added to the problem */
1241 extern
1243  SCIP_LP* lp, /**< current LP data */
1244  SCIP_SET* set, /**< global SCIP settings */
1245  SCIP_VAR* var /**< variable that is now a LOOSE problem variable */
1246  );
1247 
1248 /** informs LP, that given variable is to be deleted from the problem */
1249 extern
1251  SCIP_LP* lp, /**< current LP data */
1252  SCIP_SET* set, /**< global SCIP settings */
1253  SCIP_VAR* var /**< variable that will be deleted from the problem */
1254  );
1255 
1256 /** informs LP, that given formerly loose problem variable is now a column variable */
1257 extern
1259  SCIP_LP* lp, /**< current LP data */
1260  SCIP_SET* set, /**< global SCIP settings */
1261  SCIP_VAR* var /**< problem variable that changed from LOOSE to COLUMN */
1262  );
1263 
1264 /** informs LP, that given formerly column problem variable is now again a loose variable */
1265 extern
1267  SCIP_LP* lp, /**< current LP data */
1268  SCIP_SET* set, /**< global SCIP settings */
1269  SCIP_VAR* var /**< problem variable that changed from COLUMN to LOOSE */
1270  );
1271 
1272 /** decrease the number of loose variables by one */
1273 extern
1274 void SCIPlpDecNLoosevars(
1275  SCIP_LP* lp /**< current LP data */
1276  );
1277 
1278 /** stores the LP solution in the columns and rows */
1279 extern
1281  SCIP_LP* lp, /**< current LP data */
1282  SCIP_SET* set, /**< global SCIP settings */
1283  SCIP_STAT* stat, /**< problem statistics */
1284  SCIP_Bool* primalfeasible, /**< pointer to store whether the solution is primal feasible, or NULL */
1285  SCIP_Bool* dualfeasible /**< pointer to store whether the solution is dual feasible, or NULL */
1286  );
1287 
1288 /** stores LP solution with infinite objective value in the columns and rows */
1289 extern
1291  SCIP_LP* lp, /**< current LP data */
1292  SCIP_SET* set, /**< global SCIP settings */
1293  SCIP_STAT* stat, /**< problem statistics */
1294  SCIP_Bool* primalfeasible, /**< pointer to store whether the solution is primal feasible, or NULL */
1295  SCIP_Bool* rayfeasible /**< pointer to store whether the primal ray is a feasible unboundedness proof, or NULL */
1296  );
1297 
1298 /** returns primal ray proving the unboundedness of the current LP */
1299 extern
1301  SCIP_LP* lp, /**< current LP data */
1302  SCIP_SET* set, /**< global SCIP settings */
1303  SCIP_Real* ray /**< array for storing primal ray values, they are stored w.r.t. the problem index of the variables,
1304  * so the size of this array should be at least number of active variables
1305  * (all entries have to be initialized to 0 before) */
1306  );
1307 
1308 /** stores the dual Farkas multipliers for infeasibility proof in rows */
1309 extern
1311  SCIP_LP* lp, /**< current LP data */
1312  SCIP_SET* set, /**< global SCIP settings */
1313  SCIP_STAT* stat /**< problem statistics */
1314  );
1315 
1316 /** get number of iterations used in last LP solve */
1317 extern
1319  SCIP_LP* lp, /**< current LP data */
1320  int* iterations /**< pointer to store the iteration count */
1321  );
1322 
1323 /** increases age of columns with solution value 0.0 and rows with activity not at its bounds,
1324  * resets age of non-zero columns and sharp rows
1325  */
1326 extern
1328  SCIP_LP* lp, /**< current LP data */
1329  SCIP_STAT* stat /**< problem statistics */
1330  );
1331 
1332 /** removes all non-basic columns and basic rows in the part of the LP created at the current node, that are too old */
1333 extern
1335  SCIP_LP* lp, /**< current LP data */
1336  BMS_BLKMEM* blkmem, /**< block memory buffers */
1337  SCIP_SET* set, /**< global SCIP settings */
1338  SCIP_STAT* stat, /**< problem statistics */
1339  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
1340  SCIP_EVENTFILTER* eventfilter /**< global event filter */
1341  );
1342 
1343 /** removes all non-basic columns and basic rows in whole LP, that are too old */
1344 extern
1346  SCIP_LP* lp, /**< current LP data */
1347  BMS_BLKMEM* blkmem, /**< block memory buffers */
1348  SCIP_SET* set, /**< global SCIP settings */
1349  SCIP_STAT* stat, /**< problem statistics */
1350  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
1351  SCIP_EVENTFILTER* eventfilter /**< global event filter */
1352  );
1353 
1354 /** removes all non-basic columns at 0.0 and basic rows in the part of the LP created at the current node */
1355 extern
1357  SCIP_LP* lp, /**< current LP data */
1358  BMS_BLKMEM* blkmem, /**< block memory buffers */
1359  SCIP_SET* set, /**< global SCIP settings */
1360  SCIP_STAT* stat, /**< problem statistics */
1361  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
1362  SCIP_EVENTFILTER* eventfilter, /**< global event filter */
1363  SCIP_Bool root /**< are we at the root node? */
1364  );
1365 
1366 /** removes all non-basic columns at 0.0 and basic rows in the whole LP */
1367 extern
1369  SCIP_LP* lp, /**< current LP data */
1370  BMS_BLKMEM* blkmem, /**< block memory buffers */
1371  SCIP_SET* set, /**< global SCIP settings */
1372  SCIP_STAT* stat, /**< problem statistics */
1373  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
1374  SCIP_EVENTFILTER* eventfilter, /**< global event filter */
1375  SCIP_Bool root /**< are we at the root node? */
1376  );
1377 
1378 /** removes all redundant rows that were added at the current node */
1379 extern
1381  SCIP_LP* lp, /**< current LP data */
1382  BMS_BLKMEM* blkmem, /**< block memory buffers */
1383  SCIP_SET* set, /**< global SCIP settings */
1384  SCIP_STAT* stat, /**< problem statistics */
1385  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
1386  SCIP_EVENTFILTER* eventfilter /**< global event filter */
1387  );
1388 
1389 /** initiates LP diving */
1390 extern
1392  SCIP_LP* lp, /**< current LP data */
1393  BMS_BLKMEM* blkmem, /**< block memory */
1394  SCIP_SET* set, /**< global SCIP settings */
1395  SCIP_STAT* stat /**< problem statistics */
1396  );
1397 
1398 /** quits LP diving and resets bounds and objective values of columns to the current node's values */
1399 extern
1401  SCIP_LP* lp, /**< current LP data */
1402  BMS_BLKMEM* blkmem, /**< block memory */
1403  SCIP_SET* set, /**< global SCIP settings */
1404  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
1405  SCIP_STAT* stat, /**< problem statistics */
1406  SCIP_EVENTQUEUE* eventqueue, /**< event queue */
1407  SCIP_EVENTFILTER* eventfilter, /**< global event filter */
1408  SCIP_PROB* prob, /**< problem data */
1409  SCIP_VAR** vars, /**< array with all active variables */
1410  int nvars /**< number of active variables */
1411  );
1412 
1413 /** records a current row side such that any change will be undone after diving */
1414 extern
1416  SCIP_LP* lp, /**< LP data object */
1417  SCIP_ROW* row, /**< row affected by the change */
1418  SCIP_SIDETYPE sidetype /**< side type */
1419  );
1420 
1421 /** informs the LP that probing mode was initiated */
1422 extern
1424  SCIP_LP* lp /**< current LP data */
1425  );
1426 
1427 /** informs the LP that probing mode was finished */
1428 extern
1430  SCIP_LP* lp /**< current LP data */
1431  );
1432 
1433 /** informs the LP that the probing mode is now used for strongbranching */
1434 extern
1436  SCIP_LP* lp /**< current LP data */
1437  );
1438 
1439 /** informs the LP that the probing mode is not used for strongbranching anymore */
1440 extern
1442  SCIP_LP* lp /**< current LP data */
1443  );
1444 
1445 /** gets proven lower (dual) bound of last LP solution */
1446 extern
1448  SCIP_LP* lp, /**< current LP data */
1449  SCIP_SET* set, /**< global SCIP settings */
1450  SCIP_Real* bound /**< pointer to store proven dual bound */
1451  );
1452 
1453 /** gets proven dual bound of last LP solution */
1454 extern
1456  SCIP_LP* lp, /**< current LP data */
1457  SCIP_SET* set, /**< global SCIP settings */
1458  SCIP_Bool* proved /**< pointer to store whether infeasibility is proven */
1459  );
1460 
1461 /** writes LP to a file */
1462 extern
1464  SCIP_LP* lp, /**< current LP data */
1465  const char* fname /**< file name */
1466  );
1467 
1468 /** writes MIP to a file */
1469 extern
1471  SCIP_LP* lp, /**< current LP data */
1472  SCIP_SET* set, /**< global SCIP settings */
1473  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
1474  const char* fname, /**< file name */
1475  SCIP_Bool genericnames, /**< should generic names like x_i and row_j be used in order to avoid
1476  * troubles with reserved symbols? */
1477  SCIP_Bool origobj, /**< should the original objective function be used? */
1478  SCIP_OBJSENSE objsense, /**< objective sense */
1479  SCIP_Real objscale, /**< objective scaling factor */
1480  SCIP_Real objoffset, /**< objective offset, e.g., caused by variable fixings in presolving */
1481  SCIP_Bool lazyconss /**< output removable rows as lazy constraints? */
1482 );
1483 
1484 /** recalculates Euclidean norm of objective function vector of column variables if it have gotten unreliable during calculation */
1485 extern
1487  SCIP_SET* set, /**< global SCIP settings */
1488  SCIP_LP* lp /**< LP data */
1489  );
1490 
1491 /** compute relative interior point */
1492 extern
1494  SCIP_SET* set, /**< global SCIP settings */
1495  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
1496  SCIP_LP* lp, /**< LP data */
1497  SCIP_PROB* prob, /**< problem data */
1498  SCIP_Bool relaxrows, /**< should the rows be relaxed */
1499  SCIP_Bool inclobjcutoff, /**< should a row for the objective cutoff be included */
1500  SCIP_Real timelimit, /**< time limit for LP solver */
1501  int iterlimit, /**< iteration limit for LP solver */
1502  SCIP_Real* point, /**< array to store relative interior point on exit */
1503  SCIP_Bool* success /**< buffer to indicate whether interior point was successfully computed */
1504  );
1505 
1506 /** gets array with columns of the LP */
1507 extern
1509  SCIP_LP* lp /**< current LP data */
1510  );
1511 
1512 /** gets current number of columns in LP */
1513 extern
1514 int SCIPlpGetNCols(
1515  SCIP_LP* lp /**< current LP data */
1516  );
1517 
1518 /** gets array with rows of the LP */
1519 extern
1521  SCIP_LP* lp /**< current LP data */
1522  );
1523 
1524 /** gets current number of rows in LP */
1525 extern
1526 int SCIPlpGetNRows(
1527  SCIP_LP* lp /**< current LP data */
1528  );
1529 
1530 /** gets array with newly added columns after the last mark */
1531 extern
1533  SCIP_LP* lp /**< current LP data */
1534  );
1535 
1536 /** gets number of newly added columns after the last mark */
1537 extern
1538 int SCIPlpGetNNewcols(
1539  SCIP_LP* lp /**< current LP data */
1540  );
1541 
1542 /** gets array with newly added rows after the last mark */
1543 extern
1545  SCIP_LP* lp /**< current LP data */
1546  );
1547 
1548 /** gets number of newly added rows after the last mark */
1549 extern
1550 int SCIPlpGetNNewrows(
1551  SCIP_LP* lp /**< current LP data */
1552  );
1553 
1554 /** gets Euclidean norm of objective function vector of column variables, only use this method if
1555  * lp->objsqrnormunreliable == FALSE, so probably you have to call SCIPlpRecalculateObjSqrNorm before */
1556 extern
1558  SCIP_LP* lp /**< LP data */
1559  );
1560 
1561 /** gets the objective value of the root node LP; returns SCIP_INVALID if the root node LP was not (yet) solved */
1562 extern
1564  SCIP_LP* lp /**< LP data */
1565  );
1566 
1567 /** gets part of the objective value of the root node LP that results from COLUMN variables only;
1568  * returns SCIP_INVALID if the root node LP was not (yet) solved
1569  */
1570 extern
1572  SCIP_LP* lp /**< LP data */
1573  );
1574 
1575 /** gets part of the objective value of the root node LP that results from LOOSE variables only;
1576  * returns SCIP_INVALID if the root node LP was not (yet) solved
1577  */
1578 extern
1580  SCIP_LP* lp /**< LP data */
1581  );
1582 
1583 /** gets the LP solver interface */
1584 extern
1586  SCIP_LP* lp /**< current LP data */
1587  );
1588 
1589 /** sets whether the current lp is a relaxation of the current problem and its optimal objective value is a local lower bound */
1590 extern
1591 void SCIPlpSetIsRelax(
1592  SCIP_LP* lp, /**< LP data */
1593  SCIP_Bool relax /**< is the current lp a relaxation? */
1594  );
1595 
1596 /** returns whether the current LP is a relaxation of the problem for which it has been solved and its
1597  * solution value a valid local lower bound?
1598  */
1599 extern
1601  SCIP_LP* lp /**< LP data */
1602  );
1603 
1604 /** returns whether the current LP is flushed and solved */
1605 extern
1607  SCIP_LP* lp /**< current LP data */
1608  );
1609 
1610 /** returns whether the current LP solution is a basic solution */
1611 extern
1613  SCIP_LP* lp /**< current LP data */
1614  );
1615 
1616 /** returns whether the LP is in diving mode */
1617 extern
1619  SCIP_LP* lp /**< current LP data */
1620  );
1621 
1622 /** returns whether the LP is in diving mode and the objective value of at least one column was changed */
1623 extern
1625  SCIP_LP* lp /**< current LP data */
1626  );
1627 
1628 /** marks the diving LP to have a changed objective function */
1629 extern
1631  SCIP_LP* lp /**< current LP data */
1632  );
1633 
1634 #ifdef NDEBUG
1635 
1636 /* In optimized mode, the function calls are overwritten by defines to reduce the number of function calls and
1637  * speed up the algorithms.
1638  */
1639 
1640 #define SCIPlpGetCols(lp) ((lp)->cols)
1641 #define SCIPlpGetNCols(lp) ((lp)->ncols)
1642 #define SCIPlpGetRows(lp) ((lp)->rows)
1643 #define SCIPlpGetNRows(lp) ((lp)->nrows)
1644 #define SCIPlpGetNewcols(lp) (&((lp)->cols[(lp)->firstnewcol]))
1645 #define SCIPlpGetNNewcols(lp) ((lp)->ncols - (lp)->firstnewcol)
1646 #define SCIPlpGetNewrows(lp) (&((lp)->rows[(lp)->firstnewrow]))
1647 #define SCIPlpGetNNewrows(lp) ((lp)->nrows - (lp)->firstnewrow)
1648 #define SCIPlpGetObjNorm(lp) (SQRT((lp)->objsqrnorm))
1649 #define SCIPlpGetRootObjval(lp) (MIN((lp)->rootlpobjval + (lp)->rootlooseobjval, SCIP_INVALID))
1650 #define SCIPlpGetRootColumnObjval(lp) ((lp)->rootlpobjval)
1651 #define SCIPlpGetRootLooseObjval(lp) ((lp)->rootlooseobjval)
1652 #define SCIPlpGetLPI(lp) (lp)->lpi
1653 #define SCIPlpSetIsRelax(lp,relax) ((lp)->isrelax = relax)
1654 #define SCIPlpIsRelax(lp) (lp)->isrelax
1655 #define SCIPlpIsSolved(lp) ((lp)->flushed && (lp)->solved)
1656 #define SCIPlpIsSolBasic(lp) ((lp)->solisbasic)
1657 #define SCIPlpDiving(lp) (lp)->diving
1658 #define SCIPlpDivingObjChanged(lp) (lp)->divingobjchg
1659 #define SCIPlpMarkDivingObjChanged(lp) ((lp)->divingobjchg = TRUE)
1660 
1661 #endif
1662 
1663 #ifdef __cplusplus
1664 }
1665 #endif
1666 
1667 #endif
1668