Scippy

SCIP

Solving Constraint Integer Programs

scip_lp.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 scip_lp.c
17  * @brief public methods for the LP relaxation, rows and columns
18  * @author Tobias Achterberg
19  * @author Timo Berthold
20  * @author Gerald Gamrath
21  * @author Robert Lion Gottwald
22  * @author Stefan Heinz
23  * @author Gregor Hendel
24  * @author Thorsten Koch
25  * @author Alexander Martin
26  * @author Marc Pfetsch
27  * @author Michael Winkler
28  * @author Kati Wolter
29  *
30  * @todo check all SCIP_STAGE_* switches, and include the new stages TRANSFORMED and INITSOLVE
31  */
32 
33 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
34 
35 #include "blockmemshell/memory.h"
36 #include "lpi/lpi.h"
37 #include "scip/conflict.h"
38 #include "scip/debug.h"
39 #include "scip/lp.h"
40 #include "scip/prob.h"
41 #include "scip/pub_lp.h"
42 #include "scip/pub_message.h"
43 #include "scip/pub_tree.h"
44 #include "scip/scip_lp.h"
45 #include "scip/scip_mem.h"
46 #include "scip/scip_numerics.h"
47 #include "scip/scip_sol.h"
48 #include "scip/scip_solvingstats.h"
49 #include "scip/scip_tree.h"
50 #include "scip/scip_var.h"
51 #include "scip/set.h"
52 #include "scip/solve.h"
53 #include "scip/struct_lp.h"
54 #include "scip/struct_mem.h"
55 #include "scip/struct_primal.h"
56 #include "scip/struct_prob.h"
57 #include "scip/struct_scip.h"
58 #include "scip/struct_set.h"
59 #include "scip/struct_stat.h"
60 #include "scip/struct_tree.h"
61 #include "scip/tree.h"
62 #include "scip/var.h"
63 
64 /** returns, whether the LP was or is to be solved in the current node
65  *
66  * @return whether the LP was or is to be solved in the current node.
67  *
68  * @pre This method can be called if @p scip is in one of the following stages:
69  * - \ref SCIP_STAGE_SOLVING
70  *
71  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
72  */
74  SCIP* scip /**< SCIP data structure */
75  )
76 {
77  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPhasCurrentNodeLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
78 
79  return SCIPtreeHasCurrentNodeLP(scip->tree);
80 }
81 
82 /** returns, whether the LP of the current node is already constructed
83  *
84  * @return whether the LP of the current node is already constructed.
85  *
86  * @pre This method can be called if @p scip is in one of the following stages:
87  * - \ref SCIP_STAGE_SOLVING
88  *
89  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
90  */
92  SCIP* scip /**< SCIP data structure */
93  )
94 {
95  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPisLPConstructed", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
96 
98 }
99 
100 /** makes sure that the LP of the current node is loaded and may be accessed through the LP information methods
101  *
102  * @warning Contructing the LP might change the amount of variables known in the transformed problem and therefore also
103  * the variables array of SCIP (returned by SCIPgetVars() and SCIPgetVarsData()), so it might be necessary to
104  * call one of the later method after this one
105  *
106  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
107  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
108  *
109  * @pre This method can be called if @p scip is in one of the following stages:
110  * - \ref SCIP_STAGE_SOLVING
111  *
112  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
113  */
115  SCIP* scip, /**< SCIP data structure */
116  SCIP_Bool* cutoff /**< pointer to store whether the node can be cut off */
117  )
118 {
119  SCIP_CALL( SCIPcheckStage(scip, "SCIPconstructLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
120 
121  SCIP_CALL( SCIPconstructCurrentLP(scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
122  scip->tree, scip->reopt, scip->lp, scip->pricestore, scip->sepastore, scip->cutpool, scip->branchcand,
123  scip->eventqueue, scip->eventfilter, scip->cliquetable, FALSE, cutoff) );
124 
125  return SCIP_OKAY;
126 }
127 
128 /** makes sure that the LP of the current node is flushed
129  *
130  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
131  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
132  *
133  * @pre This method can be called if @p scip is in one of the following stages:
134  * - \ref SCIP_STAGE_SOLVING
135  *
136  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
137  */
139  SCIP* scip /**< SCIP data structure */
140  )
141 {
143 
144  SCIP_CALL( SCIPlpFlush(scip->lp, scip->mem->probmem, scip->set, scip->eventqueue) );
145 
146  return SCIP_OKAY;
147 }
148 
149 /** gets solution status of current LP
150  *
151  * @return the solution status of current LP.
152  *
153  * @pre This method can be called if @p scip is in one of the following stages:
154  * - \ref SCIP_STAGE_SOLVING
155  *
156  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
157  */
159  SCIP* scip /**< SCIP data structure */
160  )
161 {
162  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetLPSolstat", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
163 
165  return SCIPlpGetSolstat(scip->lp);
166  else
168 }
169 
170 /** returns whether the current LP solution passed the primal feasibility check
171  *
172  * @return whether the current LP solution passed the primal feasibility check.
173  *
174  * @pre This method can be called if @p scip is in one of the following stages:
175  * - \ref SCIP_STAGE_SOLVING
176  *
177  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
178  */
180  SCIP* scip /**< SCIP data structure */
181  )
182 {
183  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPisLPPrimalReliable", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
184 
185  return SCIPlpIsPrimalReliable(scip->lp);
186 }
187 
188 /** returns whether the current LP solution passed the dual feasibility check
189  *
190  * @returns whether the current LP solution passed the dual feasibility check.
191  *
192  * @pre This method can be called if @p scip is in one of the following stages:
193  * - \ref SCIP_STAGE_SOLVING
194  *
195  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
196  */
198  SCIP* scip /**< SCIP data structure */
199  )
200 {
201  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPisLPDualReliable", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
202 
203  return SCIPlpIsDualReliable(scip->lp);
204 }
205 
206 /** returns whether the current lp is a relaxation of the current problem and its optimal objective value is a local lower bound
207  *
208  * @return whether the current lp is a relaxation of the current problem and its optimal objective value is a local lower bound.
209  *
210  * @pre This method can be called if @p scip is in one of the following stages:
211  * - \ref SCIP_STAGE_SOLVING
212  *
213  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
214  */
216  SCIP* scip /**< SCIP data structure */
217  )
218 {
220 
221  return SCIPlpIsRelax(scip->lp);
222 }
223 
224 /** gets objective value of current LP (which is the sum of column and loose objective value)
225  *
226  * @return the objective value of current LP (which is the sum of column and loose objective value).
227  *
228  * @pre This method can be called if @p scip is in one of the following stages:
229  * - \ref SCIP_STAGE_SOLVING
230  *
231  * @note This method returns the objective value of the current LP solution, which might be primal or dual infeasible
232  * if a limit was hit during solving. It must not be used as a dual bound if the LP solution status returned by
233  * SCIPgetLPSolstat() is SCIP_LPSOLSTAT_ITERLIMIT or SCIP_LPSOLSTAT_TIMELIMIT.
234  *
235  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
236  */
238  SCIP* scip /**< SCIP data structure */
239  )
240 {
242 
243  return SCIPlpGetObjval(scip->lp, scip->set, scip->transprob);
244 }
245 
246 /** gets part of objective value of current LP that results from COLUMN variables only
247  *
248  * @return the part of objective value of current LP that results from COLUMN variables only.
249  *
250  * @pre This method can be called if @p scip is in one of the following stages:
251  * - \ref SCIP_STAGE_SOLVING
252  *
253  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
254  */
256  SCIP* scip /**< SCIP data structure */
257  )
258 {
259  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetLPColumnObjval", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
260 
261  return SCIPlpGetColumnObjval(scip->lp);
262 }
263 
264 /** gets part of objective value of current LP that results from LOOSE variables only
265  *
266  * @return part of objective value of current LP that results from LOOSE variables only.
267  *
268  * @pre This method can be called if @p scip is in one of the following stages:
269  * - \ref SCIP_STAGE_SOLVING
270  *
271  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
272  */
274  SCIP* scip /**< SCIP data structure */
275  )
276 {
277  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetLPLooseObjval", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
278 
279  return SCIPlpGetLooseObjval(scip->lp, scip->set, scip->transprob);
280 }
281 
282 /** gets the global pseudo objective value; that is all variables set to their best (w.r.t. the objective
283  * function) global bound
284  *
285  * @return the global pseudo objective value; that is all variables set to their best (w.r.t. the objective
286  * function) global bound.
287  *
288  * @pre This method can be called if @p scip is in one of the following stages:
289  * - \ref SCIP_STAGE_INITPRESOLVE
290  * - \ref SCIP_STAGE_PRESOLVING
291  * - \ref SCIP_STAGE_EXITPRESOLVE
292  * - \ref SCIP_STAGE_PRESOLVED
293  * - \ref SCIP_STAGE_INITSOLVE
294  * - \ref SCIP_STAGE_SOLVING
295  *
296  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
297  */
299  SCIP* scip /**< SCIP data structure */
300  )
301 {
302  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetGlobalPseudoObjval", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
303 
304  return SCIPlpGetGlobalPseudoObjval(scip->lp, scip->set, scip->transprob);
305 }
306 
307 /** gets the pseudo objective value for the current search node; that is all variables set to their best (w.r.t. the
308  * objective function) local bound
309  *
310  * @return the pseudo objective value for the current search node; that is all variables set to their best (w.r.t. the
311  * objective function) local bound.
312  *
313  * @pre This method can be called if @p scip is in one of the following stages:
314  * - \ref SCIP_STAGE_INITPRESOLVE
315  * - \ref SCIP_STAGE_PRESOLVING
316  * - \ref SCIP_STAGE_EXITPRESOLVE
317  * - \ref SCIP_STAGE_PRESOLVED
318  * - \ref SCIP_STAGE_INITSOLVE
319  * - \ref SCIP_STAGE_SOLVING
320  *
321  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
322  */
324  SCIP* scip /**< SCIP data structure */
325  )
326 {
327  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetPseudoObjval", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
328 
329  return SCIPlpGetPseudoObjval(scip->lp, scip->set, scip->transprob);
330 }
331 
332 /** returns whether the root lp is a relaxation of the problem and its optimal objective value is a global lower bound
333  *
334  * @return whether the root lp is a relaxation of the problem and its optimal objective value is a global lower bound.
335  *
336  * @pre This method can be called if @p scip is in one of the following stages:
337  * - \ref SCIP_STAGE_SOLVING
338  *
339  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
340  */
342  SCIP* scip /**< SCIP data structure */
343  )
344 {
345  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPisRootLPRelax", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
346 
347  return SCIPlpIsRootLPRelax(scip->lp);
348 }
349 
350 /** gets the objective value of the root node LP or SCIP_INVALID if the root node LP was not (yet) solved
351  *
352  * @return the objective value of the root node LP or SCIP_INVALID if the root node LP was not (yet) solved.
353  *
354  * @pre This method can be called if @p scip is in one of the following stages:
355  * - \ref SCIP_STAGE_INITPRESOLVE
356  * - \ref SCIP_STAGE_PRESOLVING
357  * - \ref SCIP_STAGE_EXITPRESOLVE
358  * - \ref SCIP_STAGE_SOLVING
359  *
360  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
361  */
363  SCIP* scip /**< SCIP data structure */
364  )
365 {
366  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetLPRootObjval", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
367 
368  return SCIPlpGetRootObjval(scip->lp);
369 }
370 
371 /** gets part of the objective value of the root node LP that results from COLUMN variables only;
372  * returns SCIP_INVALID if the root node LP was not (yet) solved
373  *
374  * @return the part of the objective value of the root node LP that results from COLUMN variables only;
375  * or SCIP_INVALID if the root node LP was not (yet) solved.
376  *
377  * @pre This method can be called if @p scip is in one of the following stages:
378  * - \ref SCIP_STAGE_INITPRESOLVE
379  * - \ref SCIP_STAGE_PRESOLVING
380  * - \ref SCIP_STAGE_EXITPRESOLVE
381  * - \ref SCIP_STAGE_SOLVING
382  *
383  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
384  */
386  SCIP* scip /**< SCIP data structure */
387  )
388 {
389  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetLPRootColumnObjval", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
390 
391  return SCIPlpGetRootColumnObjval(scip->lp);
392 }
393 
394 /** gets part of the objective value of the root node LP that results from LOOSE variables only;
395  * returns SCIP_INVALID if the root node LP was not (yet) solved
396  *
397  * @return the part of the objective value of the root node LP that results from LOOSE variables only;
398  * or SCIP_INVALID if the root node LP was not (yet) solved.
399  *
400  * @pre This method can be called if @p scip is in one of the following stages:
401  * - \ref SCIP_STAGE_INITPRESOLVE
402  * - \ref SCIP_STAGE_PRESOLVING
403  * - \ref SCIP_STAGE_EXITPRESOLVE
404  * - \ref SCIP_STAGE_SOLVING
405  *
406  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
407  */
409  SCIP* scip /**< SCIP data structure */
410  )
411 {
412  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetLPRootLooseObjval", FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
413 
414  return SCIPlpGetRootLooseObjval(scip->lp);
415 }
416 
417 /** gets current LP columns along with the current number of LP columns
418  *
419  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
420  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
421  *
422  * @pre This method can be called if @p scip is in one of the following stages:
423  * - \ref SCIP_STAGE_SOLVING
424  *
425  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
426  */
428  SCIP* scip, /**< SCIP data structure */
429  SCIP_COL*** cols, /**< pointer to store the array of LP columns, or NULL */
430  int* ncols /**< pointer to store the number of LP columns, or NULL */
431  )
432 {
433  SCIP_CALL( SCIPcheckStage(scip, "SCIPgetLPColsData", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
434 
436  {
437  if( cols != NULL )
438  *cols = SCIPlpGetCols(scip->lp);
439  if( ncols != NULL )
440  *ncols = SCIPlpGetNCols(scip->lp);
441  }
442  else
443  {
444  if( cols != NULL )
445  *cols = NULL;
446  if( ncols != NULL )
447  *ncols = 0;
448  }
449 
450  return SCIP_OKAY;
451 }
452 
453 /** gets current LP columns
454  *
455  * @return the current LP columns.
456  *
457  * @pre This method can be called if @p scip is in one of the following stages:
458  * - \ref SCIP_STAGE_SOLVING
459  *
460  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
461  */
463  SCIP* scip /**< SCIP data structure */
464  )
465 {
467 
469  return SCIPlpGetCols(scip->lp);
470  else
471  return NULL;
472 }
473 
474 /** gets current number of LP columns
475  *
476  * @return the current number of LP columns.
477  *
478  * @pre This method can be called if @p scip is in one of the following stages:
479  * - \ref SCIP_STAGE_SOLVING
480  *
481  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
482  */
484  SCIP* scip /**< SCIP data structure */
485  )
486 {
488 
490  return SCIPlpGetNCols(scip->lp);
491  else
492  return 0;
493 }
494 
495 /** gets current LP rows along with the current number of LP rows
496  *
497  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
498  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
499  *
500  * @pre This method can be called if @p scip is in one of the following stages:
501  * - \ref SCIP_STAGE_SOLVING
502  *
503  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
504  */
506  SCIP* scip, /**< SCIP data structure */
507  SCIP_ROW*** rows, /**< pointer to store the array of LP rows, or NULL */
508  int* nrows /**< pointer to store the number of LP rows, or NULL */
509  )
510 {
511  SCIP_CALL( SCIPcheckStage(scip, "SCIPgetLPRowsData", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
512 
514  {
515  if( rows != NULL )
516  *rows = SCIPlpGetRows(scip->lp);
517  if( nrows != NULL )
518  *nrows = SCIPlpGetNRows(scip->lp);
519  }
520  else
521  {
522  if( rows != NULL )
523  *rows = NULL;
524  if( nrows != NULL )
525  *nrows = 0;
526  }
527 
528  return SCIP_OKAY;
529 }
530 
531 /** gets current LP rows
532  *
533  * @return the current LP rows.
534  *
535  * @pre This method can be called if @p scip is in one of the following stages:
536  * - \ref SCIP_STAGE_SOLVING
537  *
538  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
539  */
541  SCIP* scip /**< SCIP data structure */
542  )
543 {
545 
547  return SCIPlpGetRows(scip->lp);
548  else
549  return NULL;
550 }
551 
552 /** gets current number of LP rows
553  *
554  * @return the current number of LP rows.
555  *
556  * @pre This method can be called if @p scip is in one of the following stages:
557  * - \ref SCIP_STAGE_SOLVING
558  *
559  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
560  */
562  SCIP* scip /**< SCIP data structure */
563  )
564 {
566 
568  return SCIPlpGetNRows(scip->lp);
569  else
570  return 0;
571 }
572 
573 /** returns TRUE iff all columns, i.e. every variable with non-empty column w.r.t. all ever created rows, are present
574  * in the LP, and FALSE, if there are additional already existing columns, that may be added to the LP in pricing
575  *
576  * @return TRUE iff all columns, i.e. every variable with non-empty column w.r.t. all ever created rows, are present
577  * in the LP, and FALSE, if there are additional already existing columns, that may be added to the LP in pricing.
578  *
579  * @pre This method can be called if @p scip is in one of the following stages:
580  * - \ref SCIP_STAGE_SOLVING
581  *
582  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
583  */
585  SCIP* scip /**< SCIP data structure */
586  )
587 {
589 
590  return SCIPprobAllColsInLP(scip->transprob, scip->set, scip->lp);
591 }
592 
593 /** returns whether the current LP solution is basic, i.e. is defined by a valid simplex basis
594  *
595  * @return whether the current LP solution is basic, i.e. is defined by a valid simplex basis.
596  *
597  * @pre This method can be called if @p scip is in one of the following stages:
598  * - \ref SCIP_STAGE_SOLVING
599  *
600  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
601  */
603  SCIP* scip /**< SCIP data structure */
604  )
605 {
606  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPisLPSolBasic", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
607 
608  return SCIPlpIsSolBasic(scip->lp);
609 }
610 
611 /** gets all indices of basic columns and rows: index i >= 0 corresponds to column i, index i < 0 to row -i-1
612  *
613  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
614  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
615  *
616  * @pre This method can be called if @p scip is in one of the following stages:
617  * - \ref SCIP_STAGE_SOLVING
618  *
619  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
620  */
622  SCIP* scip, /**< SCIP data structure */
623  int* basisind /**< pointer to store basis indices ready to keep number of rows entries */
624  )
625 {
626  SCIP_CALL( SCIPcheckStage(scip, "SCIPgetLPBasisInd", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
627 
628  if( !SCIPlpIsSolBasic(scip->lp) )
629  {
630  SCIPerrorMessage("current LP solution is not basic\n");
631  return SCIP_INVALIDCALL;
632  }
633 
634  SCIP_CALL( SCIPlpGetBasisInd(scip->lp, basisind) );
635 
636  return SCIP_OKAY;
637 }
638 
639 /** gets a row from the inverse basis matrix B^-1
640  *
641  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
642  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
643  *
644  * @pre This method can be called if @p scip is in one of the following stages:
645  * - \ref SCIP_STAGE_SOLVING
646  *
647  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
648  */
650  SCIP* scip, /**< SCIP data structure */
651  int r, /**< row number */
652  SCIP_Real* coefs, /**< array to store the coefficients of the row */
653  int* inds, /**< array to store the non-zero indices, or NULL */
654  int* ninds /**< pointer to store the number of non-zero indices, or NULL
655  * (-1: if we do not store sparsity informations) */
656  )
657 {
658  SCIP_CALL( SCIPcheckStage(scip, "SCIPgetLPBInvRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
659 
660  if( !SCIPlpIsSolBasic(scip->lp) )
661  {
662  SCIPerrorMessage("current LP solution is not basic\n");
663  return SCIP_INVALIDCALL;
664  }
665 
666  SCIP_CALL( SCIPlpGetBInvRow(scip->lp, r, coefs, inds, ninds) );
667 
668  /* debug check if the coef is the r-th line of the inverse matrix B^-1 */
669  SCIP_CALL( SCIPdebugCheckBInvRow(scip, r, coefs) ); /*lint !e506 !e774*/
670 
671  return SCIP_OKAY;
672 }
673 
674 /** gets a column from the inverse basis matrix B^-1
675  *
676  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
677  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
678  *
679  * @pre This method can be called if @p scip is in one of the following stages:
680  * - \ref SCIP_STAGE_SOLVING
681  *
682  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
683  */
685  SCIP* scip, /**< SCIP data structure */
686  int c, /**< column number of B^-1; this is NOT the number of the column in the LP
687  * returned by SCIPcolGetLPPos(); you have to call SCIPgetBasisInd()
688  * to get the array which links the B^-1 column numbers to the row and
689  * column numbers of the LP! c must be between 0 and nrows-1, since the
690  * basis has the size nrows * nrows */
691  SCIP_Real* coefs, /**< array to store the coefficients of the column */
692  int* inds, /**< array to store the non-zero indices, or NULL */
693  int* ninds /**< pointer to store the number of non-zero indices, or NULL
694  * (-1: if we do not store sparsity informations) */
695  )
696 {
697  SCIP_CALL( SCIPcheckStage(scip, "SCIPgetLPBInvCol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
698 
699  if( !SCIPlpIsSolBasic(scip->lp) )
700  {
701  SCIPerrorMessage("current LP solution is not basic\n");
702  return SCIP_INVALIDCALL;
703  }
704 
705  SCIP_CALL( SCIPlpGetBInvCol(scip->lp, c, coefs, inds, ninds) );
706 
707  return SCIP_OKAY;
708 }
709 
710 /** gets a row from the product of inverse basis matrix B^-1 and coefficient matrix A (i.e. from B^-1 * A)
711  *
712  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
713  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
714  *
715  * @pre This method can be called if @p scip is in one of the following stages:
716  * - \ref SCIP_STAGE_SOLVING
717  *
718  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
719  */
721  SCIP* scip, /**< SCIP data structure */
722  int r, /**< row number */
723  SCIP_Real* binvrow, /**< row in B^-1 from prior call to SCIPgetLPBInvRow(), or NULL */
724  SCIP_Real* coefs, /**< array to store the coefficients of the row */
725  int* inds, /**< array to store the non-zero indices, or NULL */
726  int* ninds /**< pointer to store the number of non-zero indices, or NULL
727  * (-1: if we do not store sparsity informations) */
728  )
729 {
730  SCIP_CALL( SCIPcheckStage(scip, "SCIPgetLPBInvARow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
731 
732  if( !SCIPlpIsSolBasic(scip->lp) )
733  {
734  SCIPerrorMessage("current LP solution is not basic\n");
735  return SCIP_INVALIDCALL;
736  }
737 
738  SCIP_CALL( SCIPlpGetBInvARow(scip->lp, r, binvrow, coefs, inds, ninds) );
739 
740  return SCIP_OKAY;
741 }
742 
743 /** gets a column from the product of inverse basis matrix B^-1 and coefficient matrix A (i.e. from B^-1 * A),
744  * i.e., it computes B^-1 * A_c with A_c being the c'th column of A
745  *
746  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
747  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
748  *
749  * @pre This method can be called if @p scip is in one of the following stages:
750  * - \ref SCIP_STAGE_SOLVING
751  *
752  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
753  */
755  SCIP* scip, /**< SCIP data structure */
756  int c, /**< column number which can be accessed by SCIPcolGetLPPos() */
757  SCIP_Real* coefs, /**< array to store the coefficients of the column */
758  int* inds, /**< array to store the non-zero indices, or NULL */
759  int* ninds /**< pointer to store the number of non-zero indices, or NULL
760  * (-1: if we do not store sparsity informations) */
761  )
762 {
763  SCIP_CALL( SCIPcheckStage(scip, "SCIPgetLPBInvACol", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
764 
765  if( !SCIPlpIsSolBasic(scip->lp) )
766  {
767  SCIPerrorMessage("current LP solution is not basic\n");
768  return SCIP_INVALIDCALL;
769  }
770 
771  SCIP_CALL( SCIPlpGetBInvACol(scip->lp, c, coefs, inds, ninds) );
772 
773  return SCIP_OKAY;
774 }
775 
776 /** calculates a weighted sum of all LP rows; for negative weights, the left and right hand side of the corresponding
777  * LP row are swapped in the summation
778  *
779  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
780  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
781  *
782  * @pre This method can be called if @p scip is in one of the following stages:
783  * - \ref SCIP_STAGE_SOLVING
784  *
785  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
786  */
788  SCIP* scip, /**< SCIP data structure */
789  SCIP_Real* weights, /**< row weights in row summation */
790  SCIP_REALARRAY* sumcoef, /**< array to store sum coefficients indexed by variables' probindex */
791  SCIP_Real* sumlhs, /**< pointer to store the left hand side of the row summation */
792  SCIP_Real* sumrhs /**< pointer to store the right hand side of the row summation */
793  )
794 {
795  SCIP_CALL( SCIPcheckStage(scip, "SCIPsumLPRows", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
796 
797  SCIP_CALL( SCIPlpSumRows(scip->lp, scip->set, scip->transprob, weights, sumcoef, sumlhs, sumrhs) );
798 
799  return SCIP_OKAY;
800 }
801 
802 /** writes current LP to a file
803  *
804  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
805  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
806  *
807  * @pre This method can be called if @p scip is in one of the following stages:
808  * - \ref SCIP_STAGE_SOLVING
809  *
810  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
811  */
813  SCIP* scip, /**< SCIP data structure */
814  const char* filename /**< file name */
815  )
816 {
817  SCIP_Bool cutoff;
818 
820 
822  {
823  SCIP_CALL( SCIPconstructCurrentLP(scip->mem->probmem, scip->set, scip->stat, scip->transprob, scip->origprob,
824  scip->tree, scip->reopt, scip->lp, scip->pricestore, scip->sepastore, scip->cutpool, scip->branchcand,
825  scip->eventqueue, scip->eventfilter, scip->cliquetable, FALSE, &cutoff) );
826  }
827 
828  /* we need a flushed lp to write the current lp */
829  SCIP_CALL( SCIPlpFlush(scip->lp, scip->mem->probmem, scip->set, scip->eventqueue) );
830 
831  SCIP_CALL( SCIPlpWrite(scip->lp, filename) );
832 
833  return SCIP_OKAY;
834 }
835 
836 /** writes MIP relaxation of the current branch-and-bound node to a file
837  *
838  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
839  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
840  *
841  * @pre This method can be called if @p scip is in one of the following stages:
842  * - \ref SCIP_STAGE_SOLVING
843  *
844  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
845  */
847  SCIP* scip, /**< SCIP data structure */
848  const char* filename, /**< file name */
849  SCIP_Bool genericnames, /**< should generic names like x_i and row_j be used in order to avoid
850  * troubles with reserved symbols? */
851  SCIP_Bool origobj, /**< should the original objective function be used? */
852  SCIP_Bool lazyconss /**< output removable rows as lazy constraints? */
853  )
854 {
855  SCIP_CALL( SCIPcheckStage(scip, "SCIPwriteMIP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
856 
857  /* we need a flushed lp to write the current mip */
858  SCIP_CALL( SCIPlpFlush(scip->lp, scip->mem->probmem, scip->set, scip->eventqueue) );
859 
860  SCIP_CALL( SCIPlpWriteMip(scip->lp, scip->set, scip->messagehdlr, filename, genericnames,
861  origobj, scip->origprob->objsense, scip->transprob->objscale, scip->transprob->objoffset, lazyconss) );
862 
863  return SCIP_OKAY;
864 }
865 
866 /** gets the LP interface of SCIP;
867  * with the LPI you can use all of the methods defined in lpi/lpi.h;
868  *
869  * @warning You have to make sure, that the full internal state of the LPI does not change or is recovered completely
870  * after the end of the method that uses the LPI. In particular, if you manipulate the LP or its solution
871  * (e.g. by calling one of the SCIPlpiAdd...() or one of the SCIPlpiSolve...() methods), you have to check in
872  * advance with SCIPlpiWasSolved() whether the LP is currently solved. If this is the case, you have to make
873  * sure, the internal solution status is recovered completely at the end of your method. This can be achieved
874  * by getting the LPI state before applying any LPI manipulations with SCIPlpiGetState() and restoring it
875  * afterwards with SCIPlpiSetState() and SCIPlpiFreeState(). Additionally you have to resolve the LP with the
876  * appropriate SCIPlpiSolve...() call in order to reinstall the internal solution status.
877  *
878  * @warning Make also sure, that all parameter values that you have changed are set back to their original values.
879  *
880  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
881  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
882  *
883  * @pre This method can be called if @p scip is in one of the following stages:
884  * - \ref SCIP_STAGE_TRANSFORMED
885  * - \ref SCIP_STAGE_INITPRESOLVE
886  * - \ref SCIP_STAGE_PRESOLVING
887  * - \ref SCIP_STAGE_EXITPRESOLVE
888  * - \ref SCIP_STAGE_PRESOLVED
889  * - \ref SCIP_STAGE_INITSOLVE
890  * - \ref SCIP_STAGE_SOLVING
891  * - \ref SCIP_STAGE_SOLVED
892  * - \ref SCIP_STAGE_EXITSOLVE
893  *
894  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
895  */
897  SCIP* scip, /**< SCIP data structure */
898  SCIP_LPI** lpi /**< pointer to store the LP interface */
899  )
900 {
901  assert(lpi != NULL);
902 
903  SCIP_CALL( SCIPcheckStage(scip, "SCIPgetLPI", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
904 
905  *lpi = SCIPlpGetLPI(scip->lp);
906 
907  return SCIP_OKAY;
908 }
909 
910 /** displays quality information about the current LP solution. An LP solution need to be available; information printed
911  * is subject to what the LP solver supports
912  *
913  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
914  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
915  *
916  * @pre This method can be called if @p scip is in one of the following stages:
917  * - \ref SCIP_STAGE_INIT
918  * - \ref SCIP_STAGE_PROBLEM
919  * - \ref SCIP_STAGE_TRANSFORMED
920  * - \ref SCIP_STAGE_INITPRESOLVE
921  * - \ref SCIP_STAGE_PRESOLVING
922  * - \ref SCIP_STAGE_EXITPRESOLVE
923  * - \ref SCIP_STAGE_PRESOLVED
924  * - \ref SCIP_STAGE_SOLVING
925  * - \ref SCIP_STAGE_SOLVED
926  * - \ref SCIP_STAGE_FREE
927  *
928  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
929  *
930  * @note The printing process is done via the message handler system.
931  */
933  SCIP* scip, /**< SCIP data structure */
934  FILE* file /**< output file (or NULL for standard output) */
935  )
936 {
937  SCIP_LPI* lpi;
938  SCIP_Real quality;
939 
940  SCIP_CALL( SCIPcheckStage(scip, "SCIPprintLPSolutionQuality", TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE) );
941 
942  switch( scip->set->stage )
943  {
944  case SCIP_STAGE_INIT:
945  case SCIP_STAGE_PROBLEM:
951  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Problem not solving yet, no LP available.\n");
952  return SCIP_OKAY;
953 
954  case SCIP_STAGE_SOLVING:
955  case SCIP_STAGE_SOLVED:
956  break;
957 
958  default:
959  SCIPerrorMessage("invalid SCIP stage <%d>\n", scip->set->stage);
960  return SCIP_INVALIDCALL;
961  } /*lint !e788*/
962 
963  /* note that after diving mode, the LPI may only have the basis information, but SCIPlpiWasSolved() can be false; in
964  * this case, we will (depending on the LP solver) probably not obtain the quality measure; one solution would be to
965  * store the results of SCIPlpiGetRealSolQuality() within the SCIP_LP after each LP solve; this would have the added
966  * advantage, that we reduce direct access to the LPI, but it sounds potentially expensive
967  */
968  lpi = SCIPlpGetLPI(scip->lp);
969  assert(lpi != NULL);
970 
972  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Basis matrix condition (estimated): ");
973  if( quality != SCIP_INVALID ) /*lint !e777*/
974  SCIPmessageFPrintInfo(scip->messagehdlr, file, "%.6e\n", quality);
975  else
976  SCIPmessageFPrintInfo(scip->messagehdlr, file, "not available\n", quality);
977 
979  SCIPmessageFPrintInfo(scip->messagehdlr, file, "Basis matrix condition (exact): ");
980  if( quality != SCIP_INVALID ) /*lint !e777*/
981  SCIPmessageFPrintInfo(scip->messagehdlr, file, "%.6e\n", quality);
982  else
983  SCIPmessageFPrintInfo(scip->messagehdlr, file, "not available\n", quality);
984 
985  return SCIP_OKAY;
986 }
987 
988 /** compute relative interior point to current LP
989  * @see SCIPlpComputeRelIntPoint
990  *
991  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
992  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
993  *
994  * @pre This method can be called if @p scip is in one of the following stages:
995  * - \ref SCIP_STAGE_TRANSFORMED
996  * - \ref SCIP_STAGE_INITPRESOLVE
997  * - \ref SCIP_STAGE_PRESOLVING
998  * - \ref SCIP_STAGE_EXITPRESOLVE
999  * - \ref SCIP_STAGE_PRESOLVED
1000  * - \ref SCIP_STAGE_SOLVING
1001  * - \ref SCIP_STAGE_SOLVED
1002  *
1003  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
1004  */
1006  SCIP* scip, /**< SCIP data structure */
1007  SCIP_Bool relaxrows, /**< should the rows be relaxed */
1008  SCIP_Bool inclobjcutoff, /**< should a row for the objective cutoff be included */
1009  SCIP_Real timelimit, /**< time limit for LP solver */
1010  int iterlimit, /**< iteration limit for LP solver */
1011  SCIP_SOL** point /**< relative interior point on exit */
1012  )
1013 {
1014  SCIP_Real* pointvals;
1015  SCIP_Bool success;
1016 
1017  SCIP_CALL( SCIPcheckStage(scip, "SCIPcomputeLPRelIntPoint", FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
1018 
1019  assert(scip != NULL);
1020  assert(scip->lp != NULL);
1021  assert(point != NULL);
1022 
1023  *point = NULL;
1024 
1025  SCIP_CALL( SCIPallocBufferArray(scip, &pointvals, SCIPlpGetNCols(scip->lp)) );
1026 
1027  SCIP_CALL( SCIPlpComputeRelIntPoint(scip->set, scip->messagehdlr, scip->lp, scip->transprob,
1028  relaxrows, inclobjcutoff, timelimit, iterlimit, pointvals, &success) );
1029 
1030  /* if successful, create new solution with point values */
1031  if( success )
1032  {
1033  int i;
1034 
1035  SCIP_CALL( SCIPcreateSol(scip, point, NULL) );
1036 
1037  for( i = 0; i < SCIPlpGetNCols(scip->lp); ++i )
1038  {
1039  SCIP_CALL( SCIPsetSolVal(scip, *point, SCIPcolGetVar(SCIPlpGetCols(scip->lp)[i]), pointvals[i]) );
1040  }
1041  }
1042 
1043  SCIPfreeBufferArray(scip, &pointvals);
1044 
1045  return SCIP_OKAY;
1046 }
1047 
1048 /*
1049  * LP column methods
1050  */
1051 
1052 /** returns the reduced costs of a column in the last (feasible) LP
1053  *
1054  * @return the reduced costs of a column in the last (feasible) LP
1055  *
1056  * @pre this method can be called in one of the following stages of the SCIP solving process:
1057  * - \ref SCIP_STAGE_SOLVING
1058  * - \ref SCIP_STAGE_SOLVED
1059  *
1060  * @note calling this method in SCIP_STAGE_SOLVED is only recommended to experienced users and should only be called
1061  * for pure LP instances (without presolving)
1062  *
1063  * @note The return value of this method should be used carefully if the dual feasibility check was explictely disabled.
1064  */
1066  SCIP* scip, /**< SCIP data structure */
1067  SCIP_COL* col /**< LP column */
1068  )
1069 {
1070  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetColRedcost", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
1071 
1072  if( !SCIPtreeHasCurrentNodeLP(scip->tree) )
1073  {
1074  SCIPerrorMessage("cannot get reduced costs, because node LP is not processed\n");
1075  SCIPABORT();
1076  return 0.0; /*lint !e527*/
1077  }
1078 
1079  return SCIPcolGetRedcost(col, scip->stat, scip->lp);
1080 }
1081 
1082 
1083 /** returns the Farkas coefficient of a column in the last (infeasible) LP
1084  *
1085  * @return the Farkas coefficient of a column in the last (infeasible) LP
1086  *
1087  * @pre this method can be called in one of the following stages of the SCIP solving process:
1088  * - \ref SCIP_STAGE_SOLVING
1089  * - \ref SCIP_STAGE_SOLVED
1090  */
1092  SCIP* scip, /**< SCIP data structure */
1093  SCIP_COL* col /**< LP column */
1094  )
1095 {
1096  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetColFarkasCoef", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
1097 
1098  if( !SCIPtreeHasCurrentNodeLP(scip->tree) )
1099  {
1100  SCIPerrorMessage("cannot get Farkas coeff, because node LP is not processed\n");
1101  SCIPABORT();
1102  return 0.0; /*lint !e527*/
1103  }
1104 
1105  return SCIPcolGetFarkasCoef(col, scip->stat, scip->lp);
1106 }
1107 
1108 /** marks a column to be not removable from the LP in the current node
1109  *
1110  * @pre this method can be called in the following stage of the SCIP solving process:
1111  * - \ref SCIP_STAGE_SOLVING
1112  */
1114  SCIP* scip, /**< SCIP data structure */
1115  SCIP_COL* col /**< LP column */
1116  )
1117 {
1118  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPmarkColNotRemovableLocal", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1119 
1120  SCIPcolMarkNotRemovableLocal(col, scip->stat);
1121 }
1122 
1123 /*
1124  * LP row methods
1125  */
1126 
1127 /** creates and captures an LP row from a constraint handler
1128  *
1129  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1130  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1131  *
1132  * @pre this method can be called in one of the following stages of the SCIP solving process:
1133  * - \ref SCIP_STAGE_INITSOLVE
1134  * - \ref SCIP_STAGE_SOLVING
1135  */
1137  SCIP* scip, /**< SCIP data structure */
1138  SCIP_ROW** row, /**< pointer to row */
1139  SCIP_CONSHDLR* conshdlr, /**< constraint handler that creates the row */
1140  const char* name, /**< name of row */
1141  int len, /**< number of nonzeros in the row */
1142  SCIP_COL** cols, /**< array with columns of row entries */
1143  SCIP_Real* vals, /**< array with coefficients of row entries */
1144  SCIP_Real lhs, /**< left hand side of row */
1145  SCIP_Real rhs, /**< right hand side of row */
1146  SCIP_Bool local, /**< is row only valid locally? */
1147  SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */
1148  SCIP_Bool removable /**< should the row be removed from the LP due to aging or cleanup? */
1149  )
1150 {
1151  assert(conshdlr != NULL);
1152 
1153  SCIP_CALL( SCIPcheckStage(scip, "SCIPcreateRowCons", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1154 
1155  SCIP_CALL( SCIProwCreate(row, scip->mem->probmem, scip->set, scip->stat, scip->lp,
1156  name, len, cols, vals, lhs, rhs, SCIP_ROWORIGINTYPE_CONS, (void*) conshdlr, local, modifiable, removable) );
1157 
1158  return SCIP_OKAY;
1159 }
1160 
1161 /** creates and captures an LP row from a separator
1162  *
1163  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1164  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1165  *
1166  * @pre this method can be called in one of the following stages of the SCIP solving process:
1167  * - \ref SCIP_STAGE_INITSOLVE
1168  * - \ref SCIP_STAGE_SOLVING
1169  */
1171  SCIP* scip, /**< SCIP data structure */
1172  SCIP_ROW** row, /**< pointer to row */
1173  SCIP_SEPA* sepa, /**< separator that creates the row */
1174  const char* name, /**< name of row */
1175  int len, /**< number of nonzeros in the row */
1176  SCIP_COL** cols, /**< array with columns of row entries */
1177  SCIP_Real* vals, /**< array with coefficients of row entries */
1178  SCIP_Real lhs, /**< left hand side of row */
1179  SCIP_Real rhs, /**< right hand side of row */
1180  SCIP_Bool local, /**< is row only valid locally? */
1181  SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */
1182  SCIP_Bool removable /**< should the row be removed from the LP due to aging or cleanup? */
1183  )
1184 {
1185  assert(sepa != NULL);
1186 
1187  SCIP_CALL( SCIPcheckStage(scip, "SCIPcreateRowSepa", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1188 
1189  SCIP_CALL( SCIProwCreate(row, scip->mem->probmem, scip->set, scip->stat, scip->lp,
1190  name, len, cols, vals, lhs, rhs, SCIP_ROWORIGINTYPE_SEPA, (void*) sepa, local, modifiable, removable) );
1191 
1192  return SCIP_OKAY;
1193 }
1194 
1195 /** creates and captures an LP row from an unspecified source
1196  *
1197  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1198  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1199  *
1200  * @pre this method can be called in one of the following stages of the SCIP solving process:
1201  * - \ref SCIP_STAGE_INITSOLVE
1202  * - \ref SCIP_STAGE_SOLVING
1203  */
1205  SCIP* scip, /**< SCIP data structure */
1206  SCIP_ROW** row, /**< pointer to row */
1207  const char* name, /**< name of row */
1208  int len, /**< number of nonzeros in the row */
1209  SCIP_COL** cols, /**< array with columns of row entries */
1210  SCIP_Real* vals, /**< array with coefficients of row entries */
1211  SCIP_Real lhs, /**< left hand side of row */
1212  SCIP_Real rhs, /**< right hand side of row */
1213  SCIP_Bool local, /**< is row only valid locally? */
1214  SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */
1215  SCIP_Bool removable /**< should the row be removed from the LP due to aging or cleanup? */
1216  )
1217 {
1218  SCIP_CALL( SCIPcheckStage(scip, "SCIPcreateRowUnspec", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1219 
1220  SCIP_CALL( SCIProwCreate(row, scip->mem->probmem, scip->set, scip->stat, scip->lp,
1221  name, len, cols, vals, lhs, rhs, SCIP_ROWORIGINTYPE_UNSPEC, NULL, local, modifiable, removable) );
1222 
1223  return SCIP_OKAY;
1224 }
1225 
1226 /** creates and captures an LP row
1227  *
1228  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1229  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1230  *
1231  * @pre this method can be called in one of the following stages of the SCIP solving process:
1232  * - \ref SCIP_STAGE_INITSOLVE
1233  * - \ref SCIP_STAGE_SOLVING
1234  *
1235  * @deprecated Please use SCIPcreateRowCons() or SCIPcreateRowSepa() when calling from a constraint handler or separator in order
1236  * to facilitate correct statistics. If the call is from neither a constraint handler or separator, use SCIPcreateRowUnspec().
1237  */
1239  SCIP* scip, /**< SCIP data structure */
1240  SCIP_ROW** row, /**< pointer to row */
1241  const char* name, /**< name of row */
1242  int len, /**< number of nonzeros in the row */
1243  SCIP_COL** cols, /**< array with columns of row entries */
1244  SCIP_Real* vals, /**< array with coefficients of row entries */
1245  SCIP_Real lhs, /**< left hand side of row */
1246  SCIP_Real rhs, /**< right hand side of row */
1247  SCIP_Bool local, /**< is row only valid locally? */
1248  SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */
1249  SCIP_Bool removable /**< should the row be removed from the LP due to aging or cleanup? */
1250  )
1251 {
1252  SCIP_CALL( SCIPcheckStage(scip, "SCIPcreateRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1253 
1254  SCIP_CALL( SCIPcreateRowUnspec(scip, row, name, len, cols, vals, lhs, rhs, local, modifiable, removable) );
1255 
1256  return SCIP_OKAY;
1257 }
1258 
1259 /** creates and captures an LP row without any coefficients from a constraint handler
1260  *
1261  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1262  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1263  *
1264  * @pre this method can be called in one of the following stages of the SCIP solving process:
1265  * - \ref SCIP_STAGE_INITSOLVE
1266  * - \ref SCIP_STAGE_SOLVING
1267  */
1269  SCIP* scip, /**< SCIP data structure */
1270  SCIP_ROW** row, /**< pointer to row */
1271  SCIP_CONSHDLR* conshdlr, /**< constraint handler that creates the row */
1272  const char* name, /**< name of row */
1273  SCIP_Real lhs, /**< left hand side of row */
1274  SCIP_Real rhs, /**< right hand side of row */
1275  SCIP_Bool local, /**< is row only valid locally? */
1276  SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */
1277  SCIP_Bool removable /**< should the row be removed from the LP due to aging or cleanup? */
1278  )
1279 {
1280  SCIP_CALL( SCIPcheckStage(scip, "SCIPcreateEmptyRowCons", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1281 
1282  SCIP_CALL( SCIProwCreate(row, scip->mem->probmem, scip->set, scip->stat, scip->lp,
1283  name, 0, NULL, NULL, lhs, rhs, SCIP_ROWORIGINTYPE_CONS, (void*) conshdlr, local, modifiable, removable) );
1284 
1285  return SCIP_OKAY;
1286 }
1287 
1288 /** creates and captures an LP row without any coefficients from a separator
1289  *
1290  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1291  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1292  *
1293  * @pre this method can be called in one of the following stages of the SCIP solving process:
1294  * - \ref SCIP_STAGE_INITSOLVE
1295  * - \ref SCIP_STAGE_SOLVING
1296  */
1298  SCIP* scip, /**< SCIP data structure */
1299  SCIP_ROW** row, /**< pointer to row */
1300  SCIP_SEPA* sepa, /**< separator that creates the row */
1301  const char* name, /**< name of row */
1302  SCIP_Real lhs, /**< left hand side of row */
1303  SCIP_Real rhs, /**< right hand side of row */
1304  SCIP_Bool local, /**< is row only valid locally? */
1305  SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */
1306  SCIP_Bool removable /**< should the row be removed from the LP due to aging or cleanup? */
1307  )
1308 {
1309  SCIP_CALL( SCIPcheckStage(scip, "SCIPcreateEmptyRowSepa", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1310 
1311  SCIP_CALL( SCIProwCreate(row, scip->mem->probmem, scip->set, scip->stat, scip->lp,
1312  name, 0, NULL, NULL, lhs, rhs, SCIP_ROWORIGINTYPE_SEPA, (void*) sepa, local, modifiable, removable) );
1313 
1314  return SCIP_OKAY;
1315 }
1316 
1317 /** creates and captures an LP row without any coefficients from an unspecified source
1318  *
1319  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1320  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1321  *
1322  * @pre this method can be called in one of the following stages of the SCIP solving process:
1323  * - \ref SCIP_STAGE_INITSOLVE
1324  * - \ref SCIP_STAGE_SOLVING
1325  */
1327  SCIP* scip, /**< SCIP data structure */
1328  SCIP_ROW** row, /**< pointer to row */
1329  const char* name, /**< name of row */
1330  SCIP_Real lhs, /**< left hand side of row */
1331  SCIP_Real rhs, /**< right hand side of row */
1332  SCIP_Bool local, /**< is row only valid locally? */
1333  SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */
1334  SCIP_Bool removable /**< should the row be removed from the LP due to aging or cleanup? */
1335  )
1336 {
1337  SCIP_CALL( SCIPcheckStage(scip, "SCIPcreateEmptyRowUnspec", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1338 
1339  SCIP_CALL( SCIProwCreate(row, scip->mem->probmem, scip->set, scip->stat, scip->lp,
1340  name, 0, NULL, NULL, lhs, rhs, SCIP_ROWORIGINTYPE_UNSPEC, NULL, local, modifiable, removable) );
1341 
1342  return SCIP_OKAY;
1343 }
1344 
1345 /** creates and captures an LP row without any coefficients
1346  *
1347  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1348  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1349  *
1350  * @pre this method can be called in one of the following stages of the SCIP solving process:
1351  * - \ref SCIP_STAGE_INITSOLVE
1352  * - \ref SCIP_STAGE_SOLVING
1353  *
1354  * @deprecated Please use SCIPcreateEmptyRowCons() or SCIPcreateEmptyRowSepa() when calling from a constraint handler or separator in order
1355  * to facilitate correct statistics. If the call is from neither a constraint handler or separator, use SCIPcreateEmptyRowUnspec().
1356  */
1358  SCIP* scip, /**< SCIP data structure */
1359  SCIP_ROW** row, /**< pointer to row */
1360  const char* name, /**< name of row */
1361  SCIP_Real lhs, /**< left hand side of row */
1362  SCIP_Real rhs, /**< right hand side of row */
1363  SCIP_Bool local, /**< is row only valid locally? */
1364  SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */
1365  SCIP_Bool removable /**< should the row be removed from the LP due to aging or cleanup? */
1366  )
1367 {
1368  SCIP_CALL( SCIPcheckStage(scip, "SCIPcreateEmptyRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1369 
1370  SCIP_CALL( SCIPcreateEmptyRowUnspec(scip, row, name, lhs, rhs, local, modifiable, removable) );
1371 
1372  return SCIP_OKAY;
1373 }
1374 
1375 /** increases usage counter of LP row
1376  *
1377  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1378  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1379  *
1380  * @pre this method can be called in one of the following stages of the SCIP solving process:
1381  * - \ref SCIP_STAGE_INITSOLVE
1382  * - \ref SCIP_STAGE_SOLVING
1383  */
1385  SCIP* scip, /**< SCIP data structure */
1386  SCIP_ROW* row /**< row to capture */
1387  )
1388 {
1389  SCIP_CALL( SCIPcheckStage(scip, "SCIPcaptureRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1390 
1391  SCIProwCapture(row);
1392 
1393  return SCIP_OKAY;
1394 }
1395 
1396 /** decreases usage counter of LP row, and frees memory if necessary
1397  *
1398  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1399  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1400  *
1401  * @pre this method can be called in one of the following stages of the SCIP solving process:
1402  * - \ref SCIP_STAGE_INITSOLVE
1403  * - \ref SCIP_STAGE_SOLVING
1404  * - \ref SCIP_STAGE_EXITSOLVE
1405  */
1407  SCIP* scip, /**< SCIP data structure */
1408  SCIP_ROW** row /**< pointer to LP row */
1409  )
1410 {
1411  SCIP_CALL( SCIPcheckStage(scip, "SCIPreleaseRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE) );
1412 
1413  SCIP_CALL( SCIProwRelease(row, scip->mem->probmem, scip->set, scip->lp) );
1414 
1415  return SCIP_OKAY;
1416 }
1417 
1418 /** changes left hand side of LP row
1419  *
1420  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1421  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1422  *
1423  * @pre this method can be called in one of the following stages of the SCIP solving process:
1424  * - \ref SCIP_STAGE_INITSOLVE
1425  * - \ref SCIP_STAGE_SOLVING
1426  */
1428  SCIP* scip, /**< SCIP data structure */
1429  SCIP_ROW* row, /**< LP row */
1430  SCIP_Real lhs /**< new left hand side */
1431  )
1432 {
1433  SCIP_CALL( SCIPcheckStage(scip, "SCIPchgRowLhs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1434 
1435  assert(!SCIPlpDiving(scip->lp) || (row->lppos == -1));
1436 
1437  SCIP_CALL( SCIProwChgLhs(row, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp, lhs) );
1438 
1439  return SCIP_OKAY;
1440 }
1441 
1442 /** changes right hand side of LP row
1443  *
1444  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1445  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1446  *
1447  * @pre this method can be called in one of the following stages of the SCIP solving process:
1448  * - \ref SCIP_STAGE_INITSOLVE
1449  * - \ref SCIP_STAGE_SOLVING
1450  */
1452  SCIP* scip, /**< SCIP data structure */
1453  SCIP_ROW* row, /**< LP row */
1454  SCIP_Real rhs /**< new right hand side */
1455  )
1456 {
1457  SCIP_CALL( SCIPcheckStage(scip, "SCIPchgRowRhs", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1458 
1459  assert(!SCIPlpDiving(scip->lp) || (row->lppos == -1));
1460 
1461  SCIP_CALL( SCIProwChgRhs(row, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp, rhs) );
1462 
1463  return SCIP_OKAY;
1464 }
1465 
1466 /** informs row, that all subsequent additions of variables to the row should be cached and not directly applied;
1467  * after all additions were applied, SCIPflushRowExtensions() must be called;
1468  * while the caching of row extensions is activated, information methods of the row give invalid results;
1469  * caching should be used, if a row is build with SCIPaddVarToRow() calls variable by variable to increase
1470  * the performance
1471  *
1472  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1473  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1474  *
1475  * @pre this method can be called in one of the following stages of the SCIP solving process:
1476  * - \ref SCIP_STAGE_INITSOLVE
1477  * - \ref SCIP_STAGE_SOLVING
1478  */
1480  SCIP* scip, /**< SCIP data structure */
1481  SCIP_ROW* row /**< LP row */
1482  )
1483 {
1484  SCIP_CALL( SCIPcheckStage(scip, "SCIPcacheRowExtensions", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1485 
1486  /* delay the row sorting */
1487  SCIProwDelaySort(row);
1488 
1489  return SCIP_OKAY;
1490 }
1491 
1492 /** flushes all cached row extensions after a call of SCIPcacheRowExtensions() and merges coefficients with
1493  * equal columns into a single coefficient
1494  *
1495  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1496  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1497  *
1498  * @pre this method can be called in one of the following stages of the SCIP solving process:
1499  * - \ref SCIP_STAGE_INITSOLVE
1500  * - \ref SCIP_STAGE_SOLVING
1501  */
1503  SCIP* scip, /**< SCIP data structure */
1504  SCIP_ROW* row /**< LP row */
1505  )
1506 {
1507  SCIP_CALL( SCIPcheckStage(scip, "SCIPflushRowExtensions", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1508 
1509  /* force the row sorting, and merge equal column entries */
1510  SCIProwForceSort(row, scip->set);
1511 
1512  return SCIP_OKAY;
1513 }
1514 
1515 /** resolves variable to columns and adds them with the coefficient to the row
1516  *
1517  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1518  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1519  *
1520  * @attention If the absolute value of val is below the SCIP epsilon tolerance, the variable will not added.
1521  *
1522  * @pre this method can be called in one of the following stages of the SCIP solving process:
1523  * - \ref SCIP_STAGE_INITSOLVE
1524  * - \ref SCIP_STAGE_SOLVING
1525  *
1526  * @note In case calling this method in the enforcement process of an lp solution, it might be that some variables,
1527  * that were not yet in the LP (e.g. dynamic columns) will change their lp solution value returned by SCIP.
1528  * For example, a variable, which has a negative objective value, that has no column in the lp yet, is in the lp solution
1529  * on its upper bound (variables with status SCIP_VARSTATUS_LOOSE are in an lp solution on it's best bound), but
1530  * creating the column, changes the solution value (variable than has status SCIP_VARSTATUS_COLUMN, and the
1531  * initialization sets the lp solution value) to 0.0. (This leads to the conclusion that, if a constraint was
1532  * violated, the linear relaxation might not be violated anymore.)
1533  *
1534  * @note If the variable being added is FIXED (as given by the status SCIP_VARSTATUS_FIXED), then the variable is not
1535  * added to the row, but the corresponding constant is added. Similarly, if the input variable is aggregated (as
1536  * given by the status SCIP_VARSTATUS_AGGREGATED), then the input variable is substituted with its aggregation.
1537  * For other cases, and to better understand the function behavior, please check the code of SCIPvarAddToRow.
1538  */
1540  SCIP* scip, /**< SCIP data structure */
1541  SCIP_ROW* row, /**< LP row */
1542  SCIP_VAR* var, /**< problem variable */
1543  SCIP_Real val /**< value of coefficient */
1544  )
1545 {
1546  SCIP_CALL( SCIPcheckStage(scip, "SCIPaddVarToRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1547 
1548  SCIP_CALL( SCIPvarAddToRow(var, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->transprob, scip->lp, row, val) );
1549 
1550  return SCIP_OKAY;
1551 }
1552 
1553 /** resolves variables to columns and adds them with the coefficients to the row;
1554  * this method caches the row extensions and flushes them afterwards to gain better performance
1555  *
1556  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1557  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1558  *
1559  * @attention If a coefficients absolute value is below the SCIP epsilon tolerance, the variable with its value is not added.
1560  *
1561  * @pre this method can be called in one of the following stages of the SCIP solving process:
1562  * - \ref SCIP_STAGE_INITSOLVE
1563  * - \ref SCIP_STAGE_SOLVING
1564  */
1566  SCIP* scip, /**< SCIP data structure */
1567  SCIP_ROW* row, /**< LP row */
1568  int nvars, /**< number of variables to add to the row */
1569  SCIP_VAR** vars, /**< problem variables to add */
1570  SCIP_Real* vals /**< values of coefficients */
1571  )
1572 {
1573  int v;
1574 
1575  assert(nvars == 0 || vars != NULL);
1576  assert(nvars == 0 || vals != NULL);
1577 
1578  SCIP_CALL( SCIPcheckStage(scip, "SCIPaddVarsToRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1579 
1580  /* resize the row to be able to store all variables (at least, if they are COLUMN variables) */
1581  SCIP_CALL( SCIProwEnsureSize(row, scip->mem->probmem, scip->set, SCIProwGetNNonz(row) + nvars) );
1582 
1583  /* delay the row sorting */
1584  SCIProwDelaySort(row);
1585 
1586  /* add the variables to the row */
1587  for( v = 0; v < nvars; ++v )
1588  {
1589  SCIP_CALL( SCIPvarAddToRow(vars[v], scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->transprob, scip->lp,
1590  row, vals[v]) );
1591  }
1592 
1593  /* force the row sorting */
1594  SCIProwForceSort(row, scip->set);
1595 
1596  return SCIP_OKAY;
1597 }
1598 
1599 /** resolves variables to columns and adds them with the same single coefficient to the row;
1600  * this method caches the row extensions and flushes them afterwards to gain better performance
1601  *
1602  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1603  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1604  *
1605  * @attention If the absolute value of val is below the SCIP epsilon tolerance, the variables will not added.
1606  *
1607  * @pre this method can be called in one of the following stages of the SCIP solving process:
1608  * - \ref SCIP_STAGE_INITSOLVE
1609  * - \ref SCIP_STAGE_SOLVING
1610  */
1612  SCIP* scip, /**< SCIP data structure */
1613  SCIP_ROW* row, /**< LP row */
1614  int nvars, /**< number of variables to add to the row */
1615  SCIP_VAR** vars, /**< problem variables to add */
1616  SCIP_Real val /**< unique value of all coefficients */
1617  )
1618 {
1619  int v;
1620 
1621  assert(nvars == 0 || vars != NULL);
1622 
1623  SCIP_CALL( SCIPcheckStage(scip, "SCIPaddVarsToRowSameCoef", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1624 
1625  /* resize the row to be able to store all variables (at least, if they are COLUMN variables) */
1626  SCIP_CALL( SCIProwEnsureSize(row, scip->mem->probmem, scip->set, SCIProwGetNNonz(row) + nvars) );
1627 
1628  /* delay the row sorting */
1629  SCIProwDelaySort(row);
1630 
1631  /* add the variables to the row */
1632  for( v = 0; v < nvars; ++v )
1633  {
1634  SCIP_CALL( SCIPvarAddToRow(vars[v], scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->transprob, scip->lp,
1635  row, val) );
1636  }
1637 
1638  /* force the row sorting */
1639  SCIProwForceSort(row, scip->set);
1640 
1641  return SCIP_OKAY;
1642 }
1643 
1644 /** tries to find a value, such that all row coefficients, if scaled with this value become integral
1645  *
1646  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1647  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1648  *
1649  * @pre this method can be called in one of the following stages of the SCIP solving process:
1650  * - \ref SCIP_STAGE_INITSOLVE
1651  * - \ref SCIP_STAGE_SOLVING
1652  */
1654  SCIP* scip, /**< SCIP data structure */
1655  SCIP_ROW* row, /**< LP row */
1656  SCIP_Real mindelta, /**< minimal relative allowed difference of scaled coefficient s*c and integral i */
1657  SCIP_Real maxdelta, /**< maximal relative allowed difference of scaled coefficient s*c and integral i */
1658  SCIP_Longint maxdnom, /**< maximal denominator allowed in rational numbers */
1659  SCIP_Real maxscale, /**< maximal allowed scalar */
1660  SCIP_Bool usecontvars, /**< should the coefficients of the continuous variables also be made integral? */
1661  SCIP_Real* intscalar, /**< pointer to store scalar that would make the coefficients integral, or NULL */
1662  SCIP_Bool* success /**< stores whether returned value is valid */
1663  )
1664 {
1665  SCIP_CALL( SCIPcheckStage(scip, "SCIPcalcRowIntegralScalar", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1666 
1667  SCIP_CALL( SCIProwCalcIntegralScalar(row, scip->set, mindelta, maxdelta, maxdnom, maxscale,
1668  usecontvars, intscalar, success) );
1669 
1670  return SCIP_OKAY;
1671 }
1672 
1673 /** tries to scale row, s.t. all coefficients (of integer variables) become integral
1674  *
1675  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1676  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1677  *
1678  * @pre this method can be called in one of the following stages of the SCIP solving process:
1679  * - \ref SCIP_STAGE_INITSOLVE
1680  * - \ref SCIP_STAGE_SOLVING
1681  */
1683  SCIP* scip, /**< SCIP data structure */
1684  SCIP_ROW* row, /**< LP row */
1685  SCIP_Real mindelta, /**< minimal relative allowed difference of scaled coefficient s*c and integral i */
1686  SCIP_Real maxdelta, /**< maximal relative allowed difference of scaled coefficient s*c and integral i */
1687  SCIP_Longint maxdnom, /**< maximal denominator allowed in rational numbers */
1688  SCIP_Real maxscale, /**< maximal value to scale row with */
1689  SCIP_Bool usecontvars, /**< should the coefficients of the continuous variables also be made integral? */
1690  SCIP_Bool* success /**< stores whether row could be made rational */
1691  )
1692 {
1693  SCIP_CALL( SCIPcheckStage(scip, "SCIPmakeRowIntegral", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1694 
1695  SCIP_CALL( SCIProwMakeIntegral(row, scip->mem->probmem, scip->set, scip->eventqueue, scip->stat, scip->lp, mindelta, maxdelta, maxdnom, maxscale,
1696  usecontvars, success) );
1697 
1698  return SCIP_OKAY;
1699 }
1700 
1701 /** marks a row to be not removable from the LP in the current node
1702  *
1703  * @pre this method can be called in the following stage of the SCIP solving process:
1704  * - \ref SCIP_STAGE_SOLVING
1705  */
1707  SCIP* scip, /**< SCIP data structure */
1708  SCIP_ROW* row /**< LP row */
1709  )
1710 {
1711  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPmarkRowNotRemovableLocal", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1712 
1713  SCIProwMarkNotRemovableLocal(row, scip->stat);
1714 }
1715 
1716 /** returns number of integral columns in the row
1717  *
1718  * @return number of integral columns in the row
1719  *
1720  * @pre this method can be called in one of the following stages of the SCIP solving process:
1721  * - \ref SCIP_STAGE_INITSOLVE
1722  * - \ref SCIP_STAGE_SOLVING
1723  */
1725  SCIP* scip, /**< SCIP data structure */
1726  SCIP_ROW* row /**< LP row */
1727  )
1728 {
1729  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetRowNumIntCols", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1730 
1731  return SCIProwGetNumIntCols(row, scip->set);
1732 }
1733 
1734 /** returns minimal absolute value of row vector's non-zero coefficients
1735  *
1736  * @return minimal absolute value of row vector's non-zero coefficients
1737  *
1738  * @pre this method can be called in one of the following stages of the SCIP solving process:
1739  * - \ref SCIP_STAGE_INITSOLVE
1740  * - \ref SCIP_STAGE_SOLVING
1741  */
1743  SCIP* scip, /**< SCIP data structure */
1744  SCIP_ROW* row /**< LP row */
1745  )
1746 {
1747  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetRowMinCoef", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1748 
1749  return SCIProwGetMinval(row, scip->set);
1750 }
1751 
1752 /** returns maximal absolute value of row vector's non-zero coefficients
1753  *
1754  * @return maximal absolute value of row vector's non-zero coefficients
1755  *
1756  * @pre this method can be called in one of the following stages of the SCIP solving process:
1757  * - \ref SCIP_STAGE_INITSOLVE
1758  * - \ref SCIP_STAGE_SOLVING
1759  */
1761  SCIP* scip, /**< SCIP data structure */
1762  SCIP_ROW* row /**< LP row */
1763  )
1764 {
1765  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetRowMaxCoef", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1766 
1767  return SCIProwGetMaxval(row, scip->set);
1768 }
1769 
1770 /** returns the minimal activity of a row w.r.t. the column's bounds
1771  *
1772  * @return the minimal activity of a row w.r.t. the column's bounds
1773  *
1774  * @pre this method can be called in one of the following stages of the SCIP solving process:
1775  * - \ref SCIP_STAGE_SOLVING
1776  */
1778  SCIP* scip, /**< SCIP data structure */
1779  SCIP_ROW* row /**< LP row */
1780  )
1781 {
1782  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetRowMinActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1783 
1784  return SCIProwGetMinActivity(row, scip->set, scip->stat);
1785 }
1786 
1787 /** returns the maximal activity of a row w.r.t. the column's bounds
1788  *
1789  * @return the maximal activity of a row w.r.t. the column's bounds
1790  *
1791  * @pre this method can be called in one of the following stages of the SCIP solving process:
1792  * - \ref SCIP_STAGE_SOLVING
1793  */
1795  SCIP* scip, /**< SCIP data structure */
1796  SCIP_ROW* row /**< LP row */
1797  )
1798 {
1799  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetRowMaxActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1800 
1801  return SCIProwGetMaxActivity(row, scip->set, scip->stat);
1802 }
1803 
1804 /** recalculates the activity of a row in the last LP solution
1805  *
1806  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1807  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1808  *
1809  * @pre this method can be called in one of the following stages of the SCIP solving process:
1810  * - \ref SCIP_STAGE_SOLVING
1811  */
1813  SCIP* scip, /**< SCIP data structure */
1814  SCIP_ROW* row /**< LP row */
1815  )
1816 {
1817  SCIP_CALL( SCIPcheckStage(scip, "SCIPrecalcRowLPActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1818 
1819  SCIProwRecalcLPActivity(row, scip->stat);
1820 
1821  return SCIP_OKAY;
1822 }
1823 
1824 /** returns the activity of a row in the last LP solution
1825  *
1826  * @return activity of a row in the last LP solution
1827  *
1828  * @pre this method can be called in one of the following stages of the SCIP solving process:
1829  * - \ref SCIP_STAGE_SOLVING
1830  */
1832  SCIP* scip, /**< SCIP data structure */
1833  SCIP_ROW* row /**< LP row */
1834  )
1835 {
1836  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetRowLPActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1837 
1838  return SCIProwGetLPActivity(row, scip->set, scip->stat, scip->lp);
1839 }
1840 
1841 /** returns the feasibility of a row in the last LP solution
1842  *
1843  * @return the feasibility of a row in the last LP solution: negative value means infeasibility
1844  *
1845  * @pre this method can be called in one of the following stages of the SCIP solving process:
1846  * - \ref SCIP_STAGE_SOLVING
1847  */
1849  SCIP* scip, /**< SCIP data structure */
1850  SCIP_ROW* row /**< LP row */
1851  )
1852 {
1853  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetRowLPFeasibility", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1854 
1855  return SCIProwGetLPFeasibility(row, scip->set, scip->stat, scip->lp);
1856 }
1857 
1858 /** recalculates the activity of a row for the current pseudo solution
1859  *
1860  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1861  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1862  *
1863  * @pre this method can be called in one of the following stages of the SCIP solving process:
1864  * - \ref SCIP_STAGE_SOLVING
1865  */
1867  SCIP* scip, /**< SCIP data structure */
1868  SCIP_ROW* row /**< LP row */
1869  )
1870 {
1871  SCIP_CALL( SCIPcheckStage(scip, "SCIPrecalcRowPseudoActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1872 
1873  SCIProwRecalcPseudoActivity(row, scip->stat);
1874 
1875  return SCIP_OKAY;
1876 }
1877 
1878 /** returns the activity of a row for the current pseudo solution
1879  *
1880  * @return the activity of a row for the current pseudo solution
1881  *
1882  * @pre this method can be called in one of the following stages of the SCIP solving process:
1883  * - \ref SCIP_STAGE_SOLVING
1884  */
1886  SCIP* scip, /**< SCIP data structure */
1887  SCIP_ROW* row /**< LP row */
1888  )
1889 {
1890  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetRowPseudoActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1891 
1892  return SCIProwGetPseudoActivity(row, scip->set, scip->stat);
1893 }
1894 
1895 /** returns the feasibility of a row for the current pseudo solution: negative value means infeasibility
1896  *
1897  * @return the feasibility of a row for the current pseudo solution: negative value means infeasibility
1898  *
1899  * @pre this method can be called in one of the following stages of the SCIP solving process:
1900  * - \ref SCIP_STAGE_SOLVING
1901  */
1903  SCIP* scip, /**< SCIP data structure */
1904  SCIP_ROW* row /**< LP row */
1905  )
1906 {
1907  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetRowPseudoFeasibility", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1908 
1909  return SCIProwGetPseudoFeasibility(row, scip->set, scip->stat);
1910 }
1911 
1912 /** recalculates the activity of a row in the last LP or pseudo solution
1913  *
1914  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1915  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1916  *
1917  * @pre this method can be called in one of the following stages of the SCIP solving process:
1918  * - \ref SCIP_STAGE_SOLVING
1919  */
1921  SCIP* scip, /**< SCIP data structure */
1922  SCIP_ROW* row /**< LP row */
1923  )
1924 {
1925  SCIP_CALL( SCIPcheckStage(scip, "SCIPrecalcRowActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1926 
1927  if( SCIPtreeHasCurrentNodeLP(scip->tree) )
1928  SCIProwRecalcLPActivity(row, scip->stat);
1929  else
1930  SCIProwRecalcPseudoActivity(row, scip->stat);
1931 
1932  return SCIP_OKAY;
1933 }
1934 
1935 /** returns the activity of a row in the last LP or pseudo solution
1936  *
1937  * @return the activity of a row in the last LP or pseudo solution
1938  *
1939  * @pre this method can be called in one of the following stages of the SCIP solving process:
1940  * - \ref SCIP_STAGE_SOLVING
1941  */
1943  SCIP* scip, /**< SCIP data structure */
1944  SCIP_ROW* row /**< LP row */
1945  )
1946 {
1947  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetRowActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1948 
1949  if( SCIPtreeHasCurrentNodeLP(scip->tree) )
1950  return SCIProwGetLPActivity(row, scip->set, scip->stat, scip->lp);
1951  else
1952  return SCIProwGetPseudoActivity(row, scip->set, scip->stat);
1953 }
1954 
1955 /** returns the feasibility of a row in the last LP or pseudo solution
1956  *
1957  * @return the feasibility of a row in the last LP or pseudo solution
1958  *
1959  * @pre this method can be called in one of the following stages of the SCIP solving process:
1960  * - \ref SCIP_STAGE_SOLVING
1961  */
1963  SCIP* scip, /**< SCIP data structure */
1964  SCIP_ROW* row /**< LP row */
1965  )
1966 {
1967  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetRowFeasibility", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1968 
1969  if( SCIPtreeHasCurrentNodeLP(scip->tree) )
1970  return SCIProwGetLPFeasibility(row, scip->set, scip->stat, scip->lp);
1971  else
1972  return SCIProwGetPseudoFeasibility(row, scip->set, scip->stat);
1973 }
1974 
1975 /** returns the activity of a row for the given primal solution
1976  *
1977  * @return the activitiy of a row for the given primal solution
1978  *
1979  * @pre this method can be called in one of the following stages of the SCIP solving process:
1980  * - \ref SCIP_STAGE_SOLVING
1981  */
1983  SCIP* scip, /**< SCIP data structure */
1984  SCIP_ROW* row, /**< LP row */
1985  SCIP_SOL* sol /**< primal CIP solution */
1986  )
1987 {
1988  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetRowSolActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
1989 
1990  if( sol != NULL )
1991  return SCIProwGetSolActivity(row, scip->set, scip->stat, sol);
1992  else if( SCIPtreeHasCurrentNodeLP(scip->tree) )
1993  return SCIProwGetLPActivity(row, scip->set, scip->stat, scip->lp);
1994  else
1995  return SCIProwGetPseudoActivity(row, scip->set, scip->stat);
1996 }
1997 
1998 /** returns the feasibility of a row for the given primal solution
1999  *
2000  * @return the feasibility of a row for the given primal solution
2001  *
2002  * @pre this method can be called in one of the following stages of the SCIP solving process:
2003  * - \ref SCIP_STAGE_SOLVING
2004  */
2006  SCIP* scip, /**< SCIP data structure */
2007  SCIP_ROW* row, /**< LP row */
2008  SCIP_SOL* sol /**< primal CIP solution */
2009  )
2010 {
2011  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetRowSolFeasibility", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
2012 
2013  if( sol != NULL )
2014  return SCIProwGetSolFeasibility(row, scip->set, scip->stat, sol);
2015  else if( SCIPtreeHasCurrentNodeLP(scip->tree) )
2016  return SCIProwGetLPFeasibility(row, scip->set, scip->stat, scip->lp);
2017  else
2018  return SCIProwGetPseudoFeasibility(row, scip->set, scip->stat);
2019 }
2020 
2021 /** output row to file stream via the message handler system
2022  *
2023  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2024  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2025  *
2026  * @pre this method can be called in one of the following stages of the SCIP solving process:
2027  * - \ref SCIP_STAGE_SOLVING
2028  * - \ref SCIP_STAGE_SOLVED
2029  * - \ref SCIP_STAGE_EXITSOLVE
2030  */
2032  SCIP* scip, /**< SCIP data structure */
2033  SCIP_ROW* row, /**< LP row */
2034  FILE* file /**< output file (or NULL for standard output) */
2035  )
2036 {
2037  assert(row != NULL);
2038 
2039  SCIP_CALL( SCIPcheckStage(scip, "SCIPprintRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
2040 
2041  SCIProwPrint(row, scip->messagehdlr, file);
2042 
2043  return SCIP_OKAY;
2044 }
2045 
2046 /** initiates LP diving, making methods SCIPchgVarObjDive(), SCIPchgVarLbDive(), and SCIPchgVarUbDive() available
2047  *
2048  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2049  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2050  *
2051  * @pre This method can be called if @p scip is in one of the following stages:
2052  * - \ref SCIP_STAGE_SOLVING
2053  *
2054  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
2055  *
2056  * @note diving is allowed even if the current LP is not flushed, not solved, or not solved to optimality; be aware
2057  * that solving the (first) diving LP may take longer than expect and that the latter two cases could stem from
2058  * numerical troubles during the last LP solve; because of this, most users will want to call this method only if
2059  * SCIPgetLPSolstat(scip) == SCIP_LPSOLSTAT_OPTIMAL
2060  */
2062  SCIP* scip /**< SCIP data structure */
2063  )
2064 {
2065  assert(scip != NULL);
2066 
2067  SCIP_CALL( SCIPcheckStage(scip, "SCIPstartDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
2069 
2070  if( SCIPlpDiving(scip->lp) )
2071  {
2072  SCIPerrorMessage("already in diving mode\n");
2073  return SCIP_INVALIDCALL;
2074  }
2075 
2076  if( SCIPtreeProbing(scip->tree) )
2077  {
2078  SCIPerrorMessage("cannot start diving while being in probing mode\n");
2079  return SCIP_INVALIDCALL;
2080  }
2081 
2083  {
2084  SCIPerrorMessage("cannot start diving if LP has not been constructed\n");
2085  return SCIP_INVALIDCALL;
2086  }
2087  assert(SCIPtreeHasCurrentNodeLP(scip->tree));
2088 
2089  SCIP_CALL( SCIPlpStartDive(scip->lp, scip->mem->probmem, scip->set, scip->stat) );
2090 
2091  /* remember the relaxation solution to reset it later */
2092  if( SCIPisRelaxSolValid(scip) )
2093  {
2094  SCIP_CALL( SCIPtreeStoreRelaxSol(scip->tree, scip->set, scip->relaxation, scip->transprob) );
2095  }
2096 
2097  return SCIP_OKAY;
2098 }
2099 
2100 /** quits LP diving and resets bounds and objective values of columns to the current node's values
2101  *
2102  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2103  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2104  *
2105  * @pre This method can be called if @p scip is in one of the following stages:
2106  * - \ref SCIP_STAGE_SOLVING
2107  *
2108  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
2109  */
2111  SCIP* scip /**< SCIP data structure */
2112  )
2113 {
2114  assert(scip != NULL);
2115 
2116  SCIP_CALL( SCIPcheckStage(scip, "SCIPendDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
2117 
2118  if( !SCIPlpDiving(scip->lp) )
2119  {
2120  SCIPerrorMessage("not in diving mode\n");
2121  return SCIP_INVALIDCALL;
2122  }
2123 
2124  /* unmark the diving flag in the LP and reset all variables' objective and bound values */
2125  SCIP_CALL( SCIPlpEndDive(scip->lp, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat, scip->eventqueue, scip->eventfilter,
2126  scip->transprob, scip->transprob->vars, scip->transprob->nvars) );
2127 
2128  /* the lower bound may have changed slightly due to LP resolve in SCIPlpEndDive() */
2129  if( !scip->lp->resolvelperror && scip->tree->focusnode != NULL && SCIPlpIsRelax(scip->lp) && SCIPlpIsSolved(scip->lp) )
2130  {
2131  assert(SCIPtreeIsFocusNodeLPConstructed(scip->tree));
2132  SCIP_CALL( SCIPnodeUpdateLowerboundLP(scip->tree->focusnode, scip->set, scip->stat, scip->tree, scip->transprob,
2133  scip->origprob, scip->lp) );
2134  }
2135  /* reset the probably changed LP's cutoff bound */
2136  SCIP_CALL( SCIPlpSetCutoffbound(scip->lp, scip->set, scip->transprob, scip->primal->cutoffbound) );
2137  assert(scip->lp->cutoffbound == scip->primal->cutoffbound); /*lint !e777*/
2138 
2139  /* if a new best solution was created, the cutoff of the tree was delayed due to diving;
2140  * the cutoff has to be done now.
2141  */
2142  if( scip->tree->cutoffdelayed )
2143  {
2144  SCIP_CALL( SCIPtreeCutoff(scip->tree, scip->reopt, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue,
2145  scip->lp, scip->primal->cutoffbound) );
2146  }
2147 
2148  /* if a relaxation was stored before diving, restore it now */
2149  if( scip->tree->probdiverelaxstored )
2150  {
2151  SCIP_CALL( SCIPtreeRestoreRelaxSol(scip->tree, scip->set, scip->relaxation, scip->transprob) );
2152  }
2153 
2154  return SCIP_OKAY;
2155 }
2156 
2157 /** changes cutoffbound in current dive
2158  *
2159  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2160  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2161  *
2162  * @pre This method can be called if @p scip is in one of the following stages:
2163  * - \ref SCIP_STAGE_SOLVING
2164  *
2165  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
2166  */
2168  SCIP* scip, /**< SCIP data structure */
2169  SCIP_Real newcutoffbound /**< new cutoffbound */
2170  )
2171 {
2172  assert(scip != NULL);
2173 
2174  SCIP_CALL( SCIPcheckStage(scip, "SCIPchgCutoffboundDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
2175 
2176  if( !SCIPlpDiving(scip->lp) )
2177  {
2178  SCIPerrorMessage("not in diving mode\n");
2179  return SCIP_INVALIDCALL;
2180  }
2181 
2182  SCIP_CALL( SCIPlpSetCutoffbound(scip->lp, scip->set, scip->transprob, newcutoffbound) );
2183 
2184  return SCIP_OKAY;
2185 }
2186 
2187 /** changes variable's objective value in current dive
2188  *
2189  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2190  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2191  *
2192  * @pre This method can be called if @p scip is in one of the following stages:
2193  * - \ref SCIP_STAGE_SOLVING
2194  *
2195  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
2196  */
2198  SCIP* scip, /**< SCIP data structure */
2199  SCIP_VAR* var, /**< variable to change the objective value for */
2200  SCIP_Real newobj /**< new objective value */
2201  )
2202 {
2203  assert(scip != NULL);
2204  assert(var != NULL);
2205 
2206  SCIP_CALL( SCIPcheckStage(scip, "SCIPchgVarObjDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
2207 
2208  if( !SCIPlpDiving(scip->lp) )
2209  {
2210  SCIPerrorMessage("not in diving mode\n");
2211  return SCIP_INVALIDCALL;
2212  }
2213 
2214  /* invalidate the LP's cutoff bound, since this has nothing to do with the current objective value anymore;
2215  * the cutoff bound is reset in SCIPendDive()
2216  */
2217  SCIP_CALL( SCIPlpSetCutoffbound(scip->lp, scip->set, scip->transprob, SCIPsetInfinity(scip->set)) );
2218 
2219  /* mark the LP's objective function invalid */
2221 
2222  /* change the objective value of the variable in the diving LP */
2223  SCIP_CALL( SCIPvarChgObjDive(var, scip->set, scip->lp, newobj) );
2224 
2225  return SCIP_OKAY;
2226 }
2227 
2228 /** changes variable's lower bound in current dive
2229  *
2230  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2231  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2232  *
2233  * @pre This method can be called if @p scip is in one of the following stages:
2234  * - \ref SCIP_STAGE_SOLVING
2235  *
2236  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
2237  */
2239  SCIP* scip, /**< SCIP data structure */
2240  SCIP_VAR* var, /**< variable to change the bound for */
2241  SCIP_Real newbound /**< new value for bound */
2242  )
2243 {
2244  assert(scip != NULL);
2245  assert(var != NULL);
2246 
2247  SCIP_CALL( SCIPcheckStage(scip, "SCIPchgVarLbDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
2248 
2249  if( !SCIPlpDiving(scip->lp) )
2250  {
2251  SCIPerrorMessage("not in diving mode\n");
2252  return SCIP_INVALIDCALL;
2253  }
2254 
2255  SCIP_CALL( SCIPvarChgLbDive(var, scip->set, scip->lp, newbound) );
2256 
2257  return SCIP_OKAY;
2258 }
2259 
2260 /** changes variable's upper bound in current dive
2261  *
2262  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2263  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2264  *
2265  * @pre This method can be called if @p scip is in one of the following stages:
2266  * - \ref SCIP_STAGE_SOLVING
2267  *
2268  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
2269  */
2271  SCIP* scip, /**< SCIP data structure */
2272  SCIP_VAR* var, /**< variable to change the bound for */
2273  SCIP_Real newbound /**< new value for bound */
2274  )
2275 {
2276  assert(scip != NULL);
2277  assert(var != NULL);
2278 
2279  SCIP_CALL( SCIPcheckStage(scip, "SCIPchgVarUbDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
2280 
2281  if( !SCIPlpDiving(scip->lp) )
2282  {
2283  SCIPerrorMessage("not in diving mode\n");
2284  return SCIP_INVALIDCALL;
2285  }
2286 
2287  SCIP_CALL( SCIPvarChgUbDive(var, scip->set, scip->lp, newbound) );
2288 
2289  return SCIP_OKAY;
2290 }
2291 
2292 /** adds a row to the LP in current dive
2293  *
2294  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2295  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2296  *
2297  * @pre This method can be called if @p scip is in one of the following stages:
2298  * - \ref SCIP_STAGE_SOLVING
2299  *
2300  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
2301  */
2303  SCIP* scip, /**< SCIP data structure */
2304  SCIP_ROW* row /**< row to be added */
2305  )
2306 {
2307  SCIP_NODE* node;
2308  int depth;
2309 
2310  assert(scip != NULL);
2311  assert(row != NULL);
2312 
2313  SCIP_CALL( SCIPcheckStage(scip, "SCIPaddRowDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
2314 
2315  if( !SCIPlpDiving(scip->lp) )
2316  {
2317  SCIPerrorMessage("not in diving mode\n");
2318  return SCIP_INVALIDCALL;
2319  }
2320 
2321  /* get depth of current node */
2322  node = SCIPtreeGetCurrentNode(scip->tree);
2323  assert(node != NULL);
2324  depth = SCIPnodeGetDepth(node);
2325 
2326  SCIP_CALL( SCIPlpAddRow(scip->lp, scip->mem->probmem, scip->set, scip->eventqueue, scip->eventfilter, row, depth) );
2327 
2328  return SCIP_OKAY;
2329 }
2330 
2331 /** changes row lhs in current dive, change will be undone after diving ends, for permanent changes use SCIPchgRowLhs()
2332  *
2333  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2334  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2335  *
2336  * @pre This method can be called if @p scip is in one of the following stages:
2337  * - \ref SCIP_STAGE_SOLVING
2338  *
2339  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
2340  */
2342  SCIP* scip, /**< SCIP data structure */
2343  SCIP_ROW* row, /**< row to change the lhs for */
2344  SCIP_Real newlhs /**< new value for lhs */
2345  )
2346 {
2347  assert(scip != NULL);
2348  assert(row != NULL);
2349 
2350  SCIP_CALL( SCIPcheckStage(scip, "SCIPchgRowLhsDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
2351 
2352  if( !SCIPlpDiving(scip->lp) )
2353  {
2354  SCIPerrorMessage("not in diving mode\n");
2355  return SCIP_INVALIDCALL;
2356  }
2357 
2359  SCIP_CALL( SCIProwChgLhs(row, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp, newlhs) );
2360 
2361  return SCIP_OKAY;
2362 }
2363 
2364 /** changes row rhs in current dive, change will be undone after diving ends, for permanent changes use SCIPchgRowRhs()
2365  *
2366  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2367  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2368  *
2369  * @pre This method can be called if @p scip is in one of the following stages:
2370  * - \ref SCIP_STAGE_SOLVING
2371  *
2372  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
2373  */
2375  SCIP* scip, /**< SCIP data structure */
2376  SCIP_ROW* row, /**< row to change the lhs for */
2377  SCIP_Real newrhs /**< new value for rhs */
2378  )
2379 {
2380  assert(scip != NULL);
2381  assert(row != NULL);
2382 
2383  SCIP_CALL( SCIPcheckStage(scip, "SCIPchgRowRhsDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
2384 
2385  if( !SCIPlpDiving(scip->lp) )
2386  {
2387  SCIPerrorMessage("not in diving mode\n");
2388  return SCIP_INVALIDCALL;
2389  }
2390 
2392  SCIP_CALL( SCIProwChgRhs(row, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp, newrhs) );
2393 
2394  return SCIP_OKAY;
2395 }
2396 
2397 /** gets variable's objective value in current dive
2398  *
2399  * @return the variable's objective value in current dive.
2400  *
2401  * @pre This method can be called if @p scip is in one of the following stages:
2402  * - \ref SCIP_STAGE_SOLVING
2403  *
2404  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
2405  */
2407  SCIP* scip, /**< SCIP data structure */
2408  SCIP_VAR* var /**< variable to get the bound for */
2409  )
2410 {
2411  assert(scip != NULL);
2412  assert(var != NULL);
2413 
2414  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetVarObjDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
2415 
2416  if( !SCIPlpDiving(scip->lp) )
2417  {
2418  SCIPerrorMessage("not in diving mode\n");
2419  SCIPABORT();
2420  return SCIP_INVALID; /*lint !e527*/
2421  }
2422 
2423  return SCIPvarGetObjLP(var);
2424 }
2425 
2426 /** gets variable's lower bound in current dive
2427  *
2428  * @return the variable's lower bound in current dive.
2429  *
2430  * @pre This method can be called if @p scip is in one of the following stages:
2431  * - \ref SCIP_STAGE_SOLVING
2432  *
2433  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
2434  */
2436  SCIP* scip, /**< SCIP data structure */
2437  SCIP_VAR* var /**< variable to get the bound for */
2438  )
2439 {
2440  assert(scip != NULL);
2441  assert(var != NULL);
2442 
2443  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetVarLbDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
2444 
2445  if( !SCIPlpDiving(scip->lp) )
2446  {
2447  SCIPerrorMessage("not in diving mode\n");
2448  SCIPABORT();
2449  return SCIP_INVALID; /*lint !e527*/
2450  }
2451 
2452  return SCIPvarGetLbLP(var, scip->set);
2453 }
2454 
2455 /** gets variable's upper bound in current dive
2456  *
2457  * @return the variable's upper bound in current dive.
2458  *
2459  * @pre This method can be called if @p scip is in one of the following stages:
2460  * - \ref SCIP_STAGE_SOLVING
2461  *
2462  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
2463  */
2465  SCIP* scip, /**< SCIP data structure */
2466  SCIP_VAR* var /**< variable to get the bound for */
2467  )
2468 {
2469  assert(scip != NULL);
2470  assert(var != NULL);
2471 
2472  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetVarUbDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
2473 
2474  if( !SCIPlpDiving(scip->lp) )
2475  {
2476  SCIPerrorMessage("not in diving mode\n");
2477  SCIPABORT();
2478  return SCIP_INVALID; /*lint !e527*/
2479  }
2480 
2481  return SCIPvarGetUbLP(var, scip->set);
2482 }
2483 
2484 /** solves the LP of the current dive; no separation or pricing is applied
2485  *
2486  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2487  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2488  *
2489  * @pre This method can be called if @p scip is in one of the following stages:
2490  * - \ref SCIP_STAGE_SOLVING
2491  *
2492  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
2493  *
2494  * @note be aware that the LP solve may take longer than expected if SCIPgetLPSolstat(scip) != SCIP_LPSOLSTAT_OPTIMAL,
2495  * compare the explanation of SCIPstartDive()
2496  */
2498  SCIP* scip, /**< SCIP data structure */
2499  int itlim, /**< maximal number of LP iterations to perform, or -1 for no limit */
2500  SCIP_Bool* lperror, /**< pointer to store whether an unresolved LP error occurred */
2501  SCIP_Bool* cutoff /**< pointer to store whether the diving LP was infeasible or the objective
2502  * limit was reached (or NULL, if not needed) */
2503  )
2504 {
2505  assert(scip != NULL);
2506 
2507  SCIP_CALL( SCIPcheckStage(scip, "SCIPsolveDiveLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
2508 
2509  if( !SCIPlpDiving(scip->lp) )
2510  {
2511  SCIPerrorMessage("not in diving mode\n");
2512  return SCIP_INVALIDCALL;
2513  }
2514 
2515  if( cutoff != NULL )
2516  *cutoff = FALSE;
2517 
2518  /* solve diving LP */
2519  SCIP_CALL( SCIPlpSolveAndEval(scip->lp, scip->set, scip->messagehdlr, scip->mem->probmem, scip->stat,
2520  scip->eventqueue, scip->eventfilter, scip->transprob, (SCIP_Longint)itlim, FALSE, FALSE, FALSE, lperror) );
2521 
2522  /* the LP is infeasible or the objective limit was reached */
2524  || (SCIPlpGetSolstat(scip->lp) == SCIP_LPSOLSTAT_OPTIMAL &&
2525  SCIPisGE(scip, SCIPgetLPObjval(scip), SCIPgetCutoffbound(scip))) )
2526  {
2527  /* analyze the infeasible LP (only if the objective was not changed, all columns are in the LP, and no external
2528  * pricers exist) */
2529  if( !scip->set->misc_exactsolve && !(SCIPlpDivingObjChanged(scip->lp) || SCIPlpDivingRowsChanged(scip->lp))
2530  && SCIPprobAllColsInLP(scip->transprob, scip->set, scip->lp) )
2531  {
2532  SCIP_CALL( SCIPconflictAnalyzeLP(scip->conflict, scip->conflictstore, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
2533  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, NULL) );
2534  }
2535 
2536  if( cutoff != NULL )
2537  *cutoff = TRUE;
2538  }
2539 
2540  return SCIP_OKAY;
2541 }
2542 
2543 /** returns the number of the node in the current branch and bound run, where the last LP was solved in diving
2544  * or probing mode
2545  *
2546  * @return the number of the node in the current branch and bound run, where the last LP was solved in diving
2547  * or probing mode.
2548  *
2549  * @pre This method can be called if @p scip is in one of the following stages:
2550  * - \ref SCIP_STAGE_TRANSFORMING
2551  * - \ref SCIP_STAGE_TRANSFORMED
2552  * - \ref SCIP_STAGE_INITPRESOLVE
2553  * - \ref SCIP_STAGE_PRESOLVING
2554  * - \ref SCIP_STAGE_EXITPRESOLVE
2555  * - \ref SCIP_STAGE_PRESOLVED
2556  * - \ref SCIP_STAGE_INITSOLVE
2557  * - \ref SCIP_STAGE_SOLVING
2558  * - \ref SCIP_STAGE_SOLVED
2559  * - \ref SCIP_STAGE_EXITSOLVE
2560  * - \ref SCIP_STAGE_FREETRANS
2561  *
2562  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
2563  */
2565  SCIP* scip /**< SCIP data structure */
2566  )
2567 {
2568  assert(scip != NULL);
2569 
2570  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetLastDivenode", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
2571 
2572  return scip->stat->lastdivenode;
2573 }
2574 
2575 /** returns whether we are in diving mode
2576  *
2577  * @return whether we are in diving mode.
2578  *
2579  * @pre This method can be called if @p scip is in one of the following stages:
2580  * - \ref SCIP_STAGE_TRANSFORMING
2581  * - \ref SCIP_STAGE_TRANSFORMED
2582  * - \ref SCIP_STAGE_INITPRESOLVE
2583  * - \ref SCIP_STAGE_PRESOLVING
2584  * - \ref SCIP_STAGE_EXITPRESOLVE
2585  * - \ref SCIP_STAGE_PRESOLVED
2586  * - \ref SCIP_STAGE_INITSOLVE
2587  * - \ref SCIP_STAGE_SOLVING
2588  * - \ref SCIP_STAGE_SOLVED
2589  * - \ref SCIP_STAGE_EXITSOLVE
2590  * - \ref SCIP_STAGE_FREETRANS
2591  *
2592  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
2593  */
2595  SCIP* scip /**< SCIP data structure */
2596  )
2597 {
2598  assert(scip != NULL);
2599 
2600  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPinDive", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
2601 
2602  return SCIPlpDiving(scip->lp);
2603 }
SCIP_Real cutoffbound
Definition: struct_primal.h:46
SCIP_STAT * stat
Definition: struct_scip.h:69
void SCIPcolMarkNotRemovableLocal(SCIP_COL *col, SCIP_STAT *stat)
Definition: lp.c:4674
SCIP_RETCODE SCIPgetLPColsData(SCIP *scip, SCIP_COL ***cols, int *ncols)
Definition: scip_lp.c:427
SCIP_Real SCIProwGetSolFeasibility(SCIP_ROW *row, SCIP_SET *set, SCIP_STAT *stat, SCIP_SOL *sol)
Definition: lp.c:6415
SCIP_RETCODE SCIPconflictAnalyzeLP(SCIP_CONFLICT *conflict, SCIP_CONFLICTSTORE *conflictstore, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable, SCIP_Bool *success)
Definition: conflict.c:8102
#define NULL
Definition: def.h:253
SCIP_RETCODE SCIPrecalcRowPseudoActivity(SCIP *scip, SCIP_ROW *row)
Definition: scip_lp.c:1866
SCIP_Bool SCIPlpDivingRowsChanged(SCIP_LP *lp)
Definition: lp.c:17516
SCIP_RETCODE SCIPsetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var, SCIP_Real val)
Definition: scip_sol.c:1212
SCIP_Bool SCIPlpDiving(SCIP_LP *lp)
Definition: lp.c:17474
public methods for branch and bound tree
SCIP_RETCODE SCIPcaptureRow(SCIP *scip, SCIP_ROW *row)
Definition: scip_lp.c:1384
internal methods for branch and bound tree
SCIP_CONFLICT * conflict
Definition: struct_scip.h:85
SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
int SCIPgetNLPRows(SCIP *scip)
Definition: scip_lp.c:561
SCIP_Real SCIProwGetMinval(SCIP_ROW *row, SCIP_SET *set)
Definition: lp.c:6594
SCIP_RETCODE SCIPlpComputeRelIntPoint(SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_LP *lp, SCIP_PROB *prob, SCIP_Bool relaxrows, SCIP_Bool inclobjcutoff, SCIP_Real timelimit, int iterlimit, SCIP_Real *point, SCIP_Bool *success)
Definition: lp.c:18230
public methods for memory management
SCIP_RETCODE SCIPlpFlush(SCIP_LP *lp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_EVENTQUEUE *eventqueue)
Definition: lp.c:8578
SCIP_RETCODE SCIPlpGetBInvCol(SCIP_LP *lp, int c, SCIP_Real *coef, int *inds, int *ninds)
Definition: lp.c:9764
SCIP_Real SCIPgetRowMaxActivity(SCIP *scip, SCIP_ROW *row)
Definition: scip_lp.c:1794
SCIP_Real SCIPgetVarLbDive(SCIP *scip, SCIP_VAR *var)
Definition: scip_lp.c:2435
SCIP_Real SCIProwGetPseudoActivity(SCIP_ROW *row, SCIP_SET *set, SCIP_STAT *stat)
Definition: lp.c:6329
void SCIProwRecalcLPActivity(SCIP_ROW *row, SCIP_STAT *stat)
Definition: lp.c:6079
SCIP_RETCODE SCIPcreateRow(SCIP *scip, SCIP_ROW **row, const char *name, int len, SCIP_COL **cols, SCIP_Real *vals, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool removable)
Definition: scip_lp.c:1238
int SCIProwGetNNonz(SCIP_ROW *row)
Definition: lp.c:16887
void SCIProwCapture(SCIP_ROW *row)
Definition: lp.c:5246
SCIP_EVENTQUEUE * eventqueue
Definition: struct_scip.h:78
SCIP_RETCODE SCIPprintRow(SCIP *scip, SCIP_ROW *row, FILE *file)
Definition: scip_lp.c:2031
int SCIPgetNLPCols(SCIP *scip)
Definition: scip_lp.c:483
SCIP_PRIMAL * primal
Definition: struct_scip.h:83
interface methods for specific LP solvers
SCIP_RETCODE SCIPconstructCurrentLP(BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_PRICESTORE *pricestore, SCIP_SEPASTORE *sepastore, SCIP_CUTPOOL *cutpool, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_CLIQUETABLE *cliquetable, SCIP_Bool newinitconss, SCIP_Bool *cutoff)
Definition: solve.c:1279
SCIP_RETCODE SCIPrecalcRowActivity(SCIP *scip, SCIP_ROW *row)
Definition: scip_lp.c:1920
SCIP_Real SCIPsetInfinity(SCIP_SET *set)
Definition: set.c:5813
SCIP_Real SCIPlpGetGlobalPseudoObjval(SCIP_LP *lp, SCIP_SET *set, SCIP_PROB *prob)
Definition: lp.c:13069
SCIP_RETCODE SCIProwEnsureSize(SCIP_ROW *row, BMS_BLKMEM *blkmem, SCIP_SET *set, int num)
Definition: lp.c:612
SCIP_Real SCIPvarGetLbLP(SCIP_VAR *var, SCIP_SET *set)
Definition: var.c:12426
SCIP_NODE * SCIPgetCurrentNode(SCIP *scip)
Definition: scip_tree.c:80
SCIP_BRANCHCAND * branchcand
Definition: struct_scip.h:79
SCIP_RETCODE SCIPcomputeLPRelIntPoint(SCIP *scip, SCIP_Bool relaxrows, SCIP_Bool inclobjcutoff, SCIP_Real timelimit, int iterlimit, SCIP_SOL **point)
Definition: scip_lp.c:1005
SCIP_Bool SCIPisRootLPRelax(SCIP *scip)
Definition: scip_lp.c:341
SCIP_Bool probdiverelaxstored
Definition: struct_tree.h:240
#define FALSE
Definition: def.h:73
SCIP_RETCODE SCIPlpWrite(SCIP_LP *lp, const char *fname)
Definition: lp.c:16234
SCIP_Bool SCIPlpIsSolBasic(SCIP_LP *lp)
Definition: lp.c:17464
int SCIPgetRowNumIntCols(SCIP *scip, SCIP_ROW *row)
Definition: scip_lp.c:1724
SCIP_Real objoffset
Definition: struct_prob.h:41
SCIP_Real SCIPgetLPRootColumnObjval(SCIP *scip)
Definition: scip_lp.c:385
SCIP_EXPORT int SCIPnodeGetDepth(SCIP_NODE *node)
Definition: tree.c:7357
SCIP_Real SCIPgetGlobalPseudoObjval(SCIP *scip)
Definition: scip_lp.c:298
SCIP_STAGE stage
Definition: struct_set.h:63
#define TRUE
Definition: def.h:72
SCIP_RETCODE SCIPcreateEmptyRowUnspec(SCIP *scip, SCIP_ROW **row, const char *name, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool removable)
Definition: scip_lp.c:1326
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
SCIP_Real SCIPgetVarUbDive(SCIP *scip, SCIP_VAR *var)
Definition: scip_lp.c:2464
SCIP_Real SCIPlpGetRootColumnObjval(SCIP_LP *lp)
Definition: lp.c:17379
SCIP_Real SCIPgetLPLooseObjval(SCIP *scip)
Definition: scip_lp.c:273
SCIP_Bool SCIPisLPConstructed(SCIP *scip)
Definition: scip_lp.c:91
SCIP_RETCODE SCIPchgVarLbDive(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip_lp.c:2238
SCIP_RETCODE SCIPvarChgLbDive(SCIP_VAR *var, SCIP_SET *set, SCIP_LP *lp, SCIP_Real newbound)
Definition: var.c:7965
SCIP_RETCODE SCIPlpEndDive(SCIP_LP *lp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_STAT *stat, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_PROB *prob, SCIP_VAR **vars, int nvars)
Definition: lp.c:15816
SCIP_RETCODE SCIProwMakeIntegral(SCIP_ROW *row, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_EVENTQUEUE *eventqueue, SCIP_STAT *stat, SCIP_LP *lp, SCIP_Real mindelta, SCIP_Real maxdelta, SCIP_Longint maxdnom, SCIP_Real maxscale, SCIP_Bool usecontvars, SCIP_Bool *success)
Definition: lp.c:5888
SCIP_RETCODE SCIPlpSolveAndEval(SCIP_LP *lp, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, SCIP_STAT *stat, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_PROB *prob, SCIP_Longint itlim, SCIP_Bool limitresolveiters, SCIP_Bool aging, SCIP_Bool keepsol, SCIP_Bool *lperror)
Definition: lp.c:12222
SCIP_ROW ** SCIPlpGetRows(SCIP_LP *lp)
Definition: lp.c:17239
SCIP_Real SCIPlpGetPseudoObjval(SCIP_LP *lp, SCIP_SET *set, SCIP_PROB *prob)
Definition: lp.c:13101
SCIP_RETCODE SCIPflushRowExtensions(SCIP *scip, SCIP_ROW *row)
Definition: scip_lp.c:1502
SCIP_RETCODE SCIProwCreate(SCIP_ROW **row, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_LP *lp, const char *name, int len, SCIP_COL **cols, SCIP_Real *vals, SCIP_Real lhs, SCIP_Real rhs, SCIP_ROWORIGINTYPE origintype, void *origin, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool removable)
Definition: lp.c:5033
SCIP_RETCODE SCIPrecalcRowLPActivity(SCIP *scip, SCIP_ROW *row)
Definition: scip_lp.c:1812
SCIP_PROB * transprob
Definition: struct_scip.h:87
SCIP_Real SCIPgetPseudoObjval(SCIP *scip)
Definition: scip_lp.c:323
#define SCIPfreeBufferArray(scip, ptr)
Definition: scip_mem.h:123
enum SCIP_LPSolStat SCIP_LPSOLSTAT
Definition: type_lp.h:42
SCIP_RETCODE SCIPsolveDiveLP(SCIP *scip, int itlim, SCIP_Bool *lperror, SCIP_Bool *cutoff)
Definition: scip_lp.c:2497
public methods for SCIP variables
SCIP_Real SCIPgetRowSolFeasibility(SCIP *scip, SCIP_ROW *row, SCIP_SOL *sol)
Definition: scip_lp.c:2005
SCIP_LPSOLSTAT SCIPlpGetSolstat(SCIP_LP *lp)
Definition: lp.c:12902
SCIP_Real SCIPgetCutoffbound(SCIP *scip)
internal methods for LP management
SCIP_LPSOLSTAT SCIPgetLPSolstat(SCIP *scip)
Definition: scip_lp.c:158
SCIP_PROB * origprob
Definition: struct_scip.h:70
SCIP_Bool SCIPtreeIsFocusNodeLPConstructed(SCIP_TREE *tree)
Definition: tree.c:8270
SCIP_Bool SCIPlpIsRootLPRelax(SCIP_LP *lp)
Definition: lp.c:17357
SCIP_RETCODE SCIPlpRecordOldRowSideDive(SCIP_LP *lp, SCIP_ROW *row, SCIP_SIDETYPE sidetype)
Definition: lp.c:15998
SCIP_Bool SCIPhasCurrentNodeLP(SCIP *scip)
Definition: scip_lp.c:73
SCIP_ROW ** SCIPgetLPRows(SCIP *scip)
Definition: scip_lp.c:540
public methods for numerical tolerances
SCIP_RETCODE SCIPcreateSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
Definition: scip_sol.c:319
int SCIPlpGetNCols(SCIP_LP *lp)
Definition: lp.c:17229
SCIP_Real SCIPvarGetUbLP(SCIP_VAR *var, SCIP_SET *set)
Definition: var.c:12496
public methods for querying solving statistics
SCIP_Real SCIPgetRowMinCoef(SCIP *scip, SCIP_ROW *row)
Definition: scip_lp.c:1742
SCIP_Bool SCIPisLPRelax(SCIP *scip)
Definition: scip_lp.c:215
SCIP_PRICESTORE * pricestore
Definition: struct_scip.h:90
public methods for the branch-and-bound tree
SCIP_RETCODE SCIPcalcRowIntegralScalar(SCIP *scip, SCIP_ROW *row, SCIP_Real mindelta, SCIP_Real maxdelta, SCIP_Longint maxdnom, SCIP_Real maxscale, SCIP_Bool usecontvars, SCIP_Real *intscalar, SCIP_Bool *success)
Definition: scip_lp.c:1653
SCIP_RETCODE SCIPchgCutoffboundDive(SCIP *scip, SCIP_Real newcutoffbound)
Definition: scip_lp.c:2167
SCIP_Real SCIPlpGetRootObjval(SCIP_LP *lp)
Definition: lp.c:17367
SCIP_RETCODE SCIPaddRowDive(SCIP *scip, SCIP_ROW *row)
Definition: scip_lp.c:2302
int lppos
Definition: struct_lp.h:230
void SCIProwForceSort(SCIP_ROW *row, SCIP_SET *set)
Definition: lp.c:6066
SCIP_Real SCIPvarGetObjLP(SCIP_VAR *var)
Definition: var.c:12380
SCIP_MEM * mem
Definition: struct_scip.h:61
SCIP_Bool SCIPtreeProbing(SCIP_TREE *tree)
Definition: tree.c:8189
SCIP_RETCODE SCIPchgRowRhsDive(SCIP *scip, SCIP_ROW *row, SCIP_Real newrhs)
Definition: scip_lp.c:2374
SCIP_RETCODE SCIPcacheRowExtensions(SCIP *scip, SCIP_ROW *row)
Definition: scip_lp.c:1479
SCIP_RETCODE SCIPprintLPSolutionQuality(SCIP *scip, FILE *file)
Definition: scip_lp.c:932
SCIP_RETCODE SCIPlpStartDive(SCIP_LP *lp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat)
Definition: lp.c:15710
SCIP_RETCODE SCIProwChgLhs(SCIP_ROW *row, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_EVENTQUEUE *eventqueue, SCIP_LP *lp, SCIP_Real lhs)
Definition: lp.c:5573
SCIP_RETCODE SCIPlpWriteMip(SCIP_LP *lp, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, const char *fname, SCIP_Bool genericnames, SCIP_Bool origobj, SCIP_OBJSENSE objsense, SCIP_Real objscale, SCIP_Real objoffset, SCIP_Bool lazyconss)
Definition: lp.c:16249
SCIP_Bool SCIPallColsInLP(SCIP *scip)
Definition: scip_lp.c:584
SCIP_Bool SCIPlpIsPrimalReliable(SCIP_LP *lp)
Definition: lp.c:17444
internal methods for storing and manipulating the main problem
#define SCIPerrorMessage
Definition: pub_message.h:45
SCIP_EVENTFILTER * eventfilter
Definition: struct_scip.h:77
SCIP_Bool SCIPlpIsDualReliable(SCIP_LP *lp)
Definition: lp.c:17454
SCIP_RETCODE SCIPgetLPRowsData(SCIP *scip, SCIP_ROW ***rows, int *nrows)
Definition: scip_lp.c:505
SCIP_RETCODE SCIPreleaseRow(SCIP *scip, SCIP_ROW **row)
Definition: scip_lp.c:1406
SCIP_RETCODE SCIPstartDive(SCIP *scip)
Definition: scip_lp.c:2061
SCIP_COL ** SCIPlpGetCols(SCIP_LP *lp)
Definition: lp.c:17219
SCIP_RETCODE SCIPvarChgObjDive(SCIP_VAR *var, SCIP_SET *set, SCIP_LP *lp, SCIP_Real newobj)
Definition: var.c:6172
SCIP_RETCODE SCIPcheckStage(SCIP *scip, const char *method, SCIP_Bool init, SCIP_Bool problem, SCIP_Bool transforming, SCIP_Bool transformed, SCIP_Bool initpresolve, SCIP_Bool presolving, SCIP_Bool exitpresolve, SCIP_Bool presolved, SCIP_Bool initsolve, SCIP_Bool solving, SCIP_Bool solved, SCIP_Bool exitsolve, SCIP_Bool freetrans, SCIP_Bool freescip)
Definition: debug.c:2010
SCIP_RETCODE SCIPwriteMIP(SCIP *scip, const char *filename, SCIP_Bool genericnames, SCIP_Bool origobj, SCIP_Bool lazyconss)
Definition: scip_lp.c:846
SCIP_RETCODE SCIPlpSumRows(SCIP_LP *lp, SCIP_SET *set, SCIP_PROB *prob, SCIP_Real *weights, SCIP_REALARRAY *sumcoef, SCIP_Real *sumlhs, SCIP_Real *sumrhs)
Definition: lp.c:9839
SCIP_CONFLICTSTORE * conflictstore
Definition: struct_scip.h:93
SCIP_RETCODE SCIPgetLPBInvCol(SCIP *scip, int c, SCIP_Real *coefs, int *inds, int *ninds)
Definition: scip_lp.c:684
SCIP_OBJSENSE objsense
Definition: struct_prob.h:77
SCIP_RETCODE SCIPchgRowLhsDive(SCIP *scip, SCIP_ROW *row, SCIP_Real newlhs)
Definition: scip_lp.c:2341
SCIP_REOPT * reopt
Definition: struct_scip.h:74
void SCIProwDelaySort(SCIP_ROW *row)
Definition: lp.c:6055
SCIP_Real cutoffbound
Definition: struct_lp.h:274
SCIP_Real SCIProwGetPseudoFeasibility(SCIP_ROW *row, SCIP_SET *set, SCIP_STAT *stat)
Definition: lp.c:6357
SCIP_RETCODE SCIPlpAddRow(SCIP_LP *lp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_EVENTQUEUE *eventqueue, SCIP_EVENTFILTER *eventfilter, SCIP_ROW *row, int depth)
Definition: lp.c:9401
data structures for branch and bound tree
internal methods for global SCIP settings
#define SCIP_CALL(x)
Definition: def.h:365
SCIP main data structure.
int SCIPlpGetNRows(SCIP_LP *lp)
Definition: lp.c:17249
void SCIPlpMarkDivingObjChanged(SCIP_LP *lp)
Definition: lp.c:17494
SCIP_RETCODE SCIPsumLPRows(SCIP *scip, SCIP_Real *weights, SCIP_REALARRAY *sumcoef, SCIP_Real *sumlhs, SCIP_Real *sumrhs)
Definition: scip_lp.c:787
SCIP_Bool resolvelperror
Definition: struct_lp.h:368
SCIP_Bool SCIPisLPSolBasic(SCIP *scip)
Definition: scip_lp.c:602
#define SCIPdebugCheckBInvRow(scip, r, coef)
Definition: debug.h:280
SCIP_LPI * SCIPlpGetLPI(SCIP_LP *lp)
Definition: lp.c:17401
SCIP_Real SCIPlpGetObjval(SCIP_LP *lp, SCIP_SET *set, SCIP_PROB *prob)
Definition: lp.c:12918
void SCIProwPrint(SCIP_ROW *row, SCIP_MESSAGEHDLR *messagehdlr, FILE *file)
Definition: lp.c:5206
SCIP_Real SCIPgetLPObjval(SCIP *scip)
Definition: scip_lp.c:237
int SCIProwGetNumIntCols(SCIP_ROW *row, SCIP_SET *set)
Definition: lp.c:6642
SCIP_RETCODE SCIProwRelease(SCIP_ROW **row, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_LP *lp)
Definition: lp.c:5259
SCIP_CUTPOOL * cutpool
Definition: struct_scip.h:94
SCIP_CLIQUETABLE * cliquetable
Definition: struct_scip.h:86
SCIP_Real SCIProwGetSolActivity(SCIP_ROW *row, SCIP_SET *set, SCIP_STAT *stat, SCIP_SOL *sol)
Definition: lp.c:6373
SCIP_Bool SCIPisLPPrimalReliable(SCIP *scip)
Definition: scip_lp.c:179
internal methods for problem variables
SCIP_Real SCIPgetRowPseudoFeasibility(SCIP *scip, SCIP_ROW *row)
Definition: scip_lp.c:1902
#define SCIPallocBufferArray(scip, ptr, num)
Definition: scip_mem.h:111
SCIP_RETCODE SCIPlpGetBasisInd(SCIP_LP *lp, int *basisind)
Definition: lp.c:9708
SCIP_SEPASTORE * sepastore
Definition: struct_scip.h:91
SCIP_RETCODE SCIPgetLPBInvARow(SCIP *scip, int r, SCIP_Real *binvrow, SCIP_Real *coefs, int *inds, int *ninds)
Definition: scip_lp.c:720
SCIP_Real SCIPlpGetRootLooseObjval(SCIP_LP *lp)
Definition: lp.c:17391
SCIP_RETCODE SCIPendDive(SCIP *scip)
Definition: scip_lp.c:2110
SCIP_RETCODE SCIPaddVarsToRowSameCoef(SCIP *scip, SCIP_ROW *row, int nvars, SCIP_VAR **vars, SCIP_Real val)
Definition: scip_lp.c:1611
#define SCIP_Bool
Definition: def.h:70
SCIP_RETCODE SCIPconstructLP(SCIP *scip, SCIP_Bool *cutoff)
Definition: scip_lp.c:114
SCIP_Real SCIPgetRowPseudoActivity(SCIP *scip, SCIP_ROW *row)
Definition: scip_lp.c:1885
SCIP_RETCODE SCIPlpGetBInvRow(SCIP_LP *lp, int r, SCIP_Real *coef, int *inds, int *ninds)
Definition: lp.c:9742
SCIP_RETCODE SCIPvarChgUbDive(SCIP_VAR *var, SCIP_SET *set, SCIP_LP *lp, SCIP_Real newbound)
Definition: var.c:8055
SCIP_Bool SCIPlpDivingObjChanged(SCIP_LP *lp)
Definition: lp.c:17484
SCIP_RETCODE SCIPchgVarUbDive(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip_lp.c:2270
methods for debugging
SCIP_RETCODE SCIPcreateEmptyRowCons(SCIP *scip, SCIP_ROW **row, SCIP_CONSHDLR *conshdlr, const char *name, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool removable)
Definition: scip_lp.c:1268
public methods for LP management
SCIP_Longint lastdivenode
Definition: struct_stat.h:102
datastructures for block memory pools and memory buffers
SCIP_Bool SCIPprobAllColsInLP(SCIP_PROB *prob, SCIP_SET *set, SCIP_LP *lp)
Definition: prob.c:2267
SCIP_Bool SCIPtreeHasCurrentNodeLP(SCIP_TREE *tree)
Definition: tree.c:8324
SCIP_RETCODE SCIPflushLP(SCIP *scip)
Definition: scip_lp.c:138
SCIP_RETCODE SCIPgetLPI(SCIP *scip, SCIP_LPI **lpi)
Definition: scip_lp.c:896
void SCIPmarkColNotRemovableLocal(SCIP *scip, SCIP_COL *col)
Definition: scip_lp.c:1113
datastructures for problem statistics
SCIP_Bool cutoffdelayed
Definition: struct_tree.h:227
SCIP_VAR * SCIPcolGetVar(SCIP_COL *col)
Definition: lp.c:16736
public methods for the LP relaxation, rows and columns
SCIP_Real SCIProwGetMaxActivity(SCIP_ROW *row, SCIP_SET *set, SCIP_STAT *stat)
Definition: lp.c:6526
SCIP_Real SCIPlpGetLooseObjval(SCIP_LP *lp, SCIP_SET *set, SCIP_PROB *prob)
Definition: lp.c:12957
SCIP_Bool SCIPinDive(SCIP *scip)
Definition: scip_lp.c:2594
datastructures for storing and manipulating the main problem
SCIP_Real * r
Definition: circlepacking.c:50
SCIP_RETCODE SCIPvarAddToRow(SCIP_VAR *var, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_EVENTQUEUE *eventqueue, SCIP_PROB *prob, SCIP_LP *lp, SCIP_ROW *row, SCIP_Real val)
Definition: var.c:13759
SCIP_Real SCIPgetVarObjDive(SCIP *scip, SCIP_VAR *var)
Definition: scip_lp.c:2406
SCIP_Bool misc_exactsolve
Definition: struct_set.h:361
BMS_BLKMEM * probmem
Definition: struct_mem.h:40
SCIP_Real SCIProwGetMinActivity(SCIP_ROW *row, SCIP_SET *set, SCIP_STAT *stat)
Definition: lp.c:6505
public methods for solutions
internal methods for conflict analysis
SCIP_RETCODE SCIPlpSetCutoffbound(SCIP_LP *lp, SCIP_SET *set, SCIP_PROB *prob, SCIP_Real cutoffbound)
Definition: lp.c:10076
SCIP_RETCODE SCIPgetLPBInvACol(SCIP *scip, int c, SCIP_Real *coefs, int *inds, int *ninds)
Definition: scip_lp.c:754
SCIP_RETCODE SCIPchgRowRhs(SCIP *scip, SCIP_ROW *row, SCIP_Real rhs)
Definition: scip_lp.c:1451
internal methods for main solving loop and node processing
SCIP_RETCODE SCIPchgRowLhs(SCIP *scip, SCIP_ROW *row, SCIP_Real lhs)
Definition: scip_lp.c:1427
SCIP_Real SCIPgetRowLPActivity(SCIP *scip, SCIP_ROW *row)
Definition: scip_lp.c:1831
SCIP_RETCODE SCIPwriteLP(SCIP *scip, const char *filename)
Definition: scip_lp.c:812
SCIP_NODE * SCIPtreeGetCurrentNode(SCIP_TREE *tree)
Definition: tree.c:8290
SCIP_Real SCIPgetColFarkasCoef(SCIP *scip, SCIP_COL *col)
Definition: scip_lp.c:1091
SCIP_RETCODE SCIPaddVarToRow(SCIP *scip, SCIP_ROW *row, SCIP_VAR *var, SCIP_Real val)
Definition: scip_lp.c:1539
SCIP_SET * set
Definition: struct_scip.h:62
SCIP_Longint SCIPgetLastDivenode(SCIP *scip)
Definition: scip_lp.c:2564
SCIP_Real SCIPgetLPColumnObjval(SCIP *scip)
Definition: scip_lp.c:255
public methods for message output
data structures for LP management
void SCIPmessageFPrintInfo(SCIP_MESSAGEHDLR *messagehdlr, FILE *file, const char *formatstr,...)
Definition: message.c:608
SCIP_Real SCIProwGetLPFeasibility(SCIP_ROW *row, SCIP_SET *set, SCIP_STAT *stat, SCIP_LP *lp)
Definition: lp.c:6161
struct SCIP_LPi SCIP_LPI
Definition: type_lpi.h:96
SCIP_MESSAGEHDLR * messagehdlr
Definition: struct_scip.h:65
#define SCIP_Real
Definition: def.h:164
SCIP_VAR ** vars
Definition: struct_prob.h:55
SCIP_Bool SCIPlpIsSolved(SCIP_LP *lp)
Definition: lp.c:17434
SCIP_RETCODE SCIPtreeStoreRelaxSol(SCIP_TREE *tree, SCIP_SET *set, SCIP_RELAXATION *relaxation, SCIP_PROB *transprob)
Definition: tree.c:6941
SCIP_Bool SCIPisRelaxSolValid(SCIP *scip)
Definition: scip_var.c:2529
datastructures for collecting primal CIP solutions and primal informations
#define SCIP_INVALID
Definition: def.h:184
SCIP_Real SCIPgetRowLPFeasibility(SCIP *scip, SCIP_ROW *row)
Definition: scip_lp.c:1848
SCIP_RETCODE SCIProwChgRhs(SCIP_ROW *row, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_EVENTQUEUE *eventqueue, SCIP_LP *lp, SCIP_Real rhs)
Definition: lp.c:5605
SCIP_Bool SCIPlpIsRelax(SCIP_LP *lp)
Definition: lp.c:17424
SCIP_RETCODE SCIPgetLPBasisInd(SCIP *scip, int *basisind)
Definition: scip_lp.c:621
SCIP_Real SCIPgetColRedcost(SCIP *scip, SCIP_COL *col)
Definition: scip_lp.c:1065
#define SCIP_Longint
Definition: def.h:149
SCIP_RETCODE SCIProwCalcIntegralScalar(SCIP_ROW *row, SCIP_SET *set, SCIP_Real mindelta, SCIP_Real maxdelta, SCIP_Longint maxdnom, SCIP_Real maxscale, SCIP_Bool usecontvars, SCIP_Real *intscalar, SCIP_Bool *success)
Definition: lp.c:5654
SCIP_RETCODE SCIPgetLPBInvRow(SCIP *scip, int r, SCIP_Real *coefs, int *inds, int *ninds)
Definition: scip_lp.c:649
SCIP_Real SCIPgetRowFeasibility(SCIP *scip, SCIP_ROW *row)
Definition: scip_lp.c:1962
SCIP_RETCODE SCIPnodeUpdateLowerboundLP(SCIP_NODE *node, SCIP_SET *set, SCIP_STAT *stat, SCIP_TREE *tree, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_LP *lp)
Definition: tree.c:2343
SCIP_TREE * tree
Definition: struct_scip.h:84
SCIP_RETCODE SCIPlpGetBInvARow(SCIP_LP *lp, int r, SCIP_Real *binvrow, SCIP_Real *coef, int *inds, int *ninds)
Definition: lp.c:9790
void SCIProwMarkNotRemovableLocal(SCIP_ROW *row, SCIP_STAT *stat)
Definition: lp.c:7785
SCIP_COL ** SCIPgetLPCols(SCIP *scip)
Definition: scip_lp.c:462
SCIP_RELAXATION * relaxation
Definition: struct_scip.h:82
SCIP_Real SCIPgetLPRootObjval(SCIP *scip)
Definition: scip_lp.c:362
SCIP_Real SCIProwGetMaxval(SCIP_ROW *row, SCIP_SET *set)
Definition: lp.c:6578
SCIP_Real SCIPcolGetFarkasCoef(SCIP_COL *col, SCIP_STAT *stat, SCIP_LP *lp)
Definition: lp.c:4072
SCIP_Real SCIProwGetLPActivity(SCIP_ROW *row, SCIP_SET *set, SCIP_STAT *stat, SCIP_LP *lp)
Definition: lp.c:6131
SCIP_EXPORT SCIP_NODETYPE SCIPnodeGetType(SCIP_NODE *node)
Definition: tree.c:7337
SCIP_RETCODE SCIPtreeCutoff(SCIP_TREE *tree, SCIP_REOPT *reopt, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_EVENTQUEUE *eventqueue, SCIP_LP *lp, SCIP_Real cutoffbound)
Definition: tree.c:5055
SCIP_RETCODE SCIPcreateRowSepa(SCIP *scip, SCIP_ROW **row, SCIP_SEPA *sepa, const char *name, int len, SCIP_COL **cols, SCIP_Real *vals, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool removable)
Definition: scip_lp.c:1170
SCIP_RETCODE SCIPtreeRestoreRelaxSol(SCIP_TREE *tree, SCIP_SET *set, SCIP_RELAXATION *relaxation, SCIP_PROB *transprob)
Definition: tree.c:6978
SCIP_Real SCIPgetRowMaxCoef(SCIP *scip, SCIP_ROW *row)
Definition: scip_lp.c:1760
SCIP_RETCODE SCIPlpGetBInvACol(SCIP_LP *lp, int c, SCIP_Real *coef, int *inds, int *ninds)
Definition: lp.c:9815
SCIP_RETCODE SCIPaddVarsToRow(SCIP *scip, SCIP_ROW *row, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
Definition: scip_lp.c:1565
SCIP_Bool SCIPisLPDualReliable(SCIP *scip)
Definition: scip_lp.c:197
SCIP_RETCODE SCIPcreateRowCons(SCIP *scip, SCIP_ROW **row, SCIP_CONSHDLR *conshdlr, const char *name, int len, SCIP_COL **cols, SCIP_Real *vals, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool removable)
Definition: scip_lp.c:1136
SCIP_RETCODE SCIPcreateEmptyRow(SCIP *scip, SCIP_ROW **row, const char *name, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool removable)
Definition: scip_lp.c:1357
#define SCIP_CALL_ABORT(x)
Definition: def.h:344
SCIP_Real SCIPcolGetRedcost(SCIP_COL *col, SCIP_STAT *stat, SCIP_LP *lp)
Definition: lp.c:3889
SCIP_LP * lp
Definition: struct_scip.h:80
SCIP_Real SCIPlpGetColumnObjval(SCIP_LP *lp)
Definition: lp.c:12946
void SCIProwRecalcPseudoActivity(SCIP_ROW *row, SCIP_STAT *stat)
Definition: lp.c:6302
#define SCIPABORT()
Definition: def.h:337
void SCIPmarkRowNotRemovableLocal(SCIP *scip, SCIP_ROW *row)
Definition: scip_lp.c:1706
SCIP_RETCODE SCIPchgVarObjDive(SCIP *scip, SCIP_VAR *var, SCIP_Real newobj)
Definition: scip_lp.c:2197
SCIP_Real SCIPgetLPRootLooseObjval(SCIP *scip)
Definition: scip_lp.c:408
SCIP_Real SCIPgetRowMinActivity(SCIP *scip, SCIP_ROW *row)
Definition: scip_lp.c:1777
datastructures for global SCIP settings
SCIP_RETCODE SCIPmakeRowIntegral(SCIP *scip, SCIP_ROW *row, SCIP_Real mindelta, SCIP_Real maxdelta, SCIP_Longint maxdnom, SCIP_Real maxscale, SCIP_Bool usecontvars, SCIP_Bool *success)
Definition: scip_lp.c:1682
SCIP_EXPORT SCIP_RETCODE SCIPlpiGetRealSolQuality(SCIP_LPI *lpi, SCIP_LPSOLQUALITY qualityindicator, SCIP_Real *quality)
SCIP_RETCODE SCIPcreateEmptyRowSepa(SCIP *scip, SCIP_ROW **row, SCIP_SEPA *sepa, const char *name, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool removable)
Definition: scip_lp.c:1297
SCIP_Real objscale
Definition: struct_prob.h:42
SCIP_NODE * focusnode
Definition: struct_tree.h:182
SCIP_RETCODE SCIPcreateRowUnspec(SCIP *scip, SCIP_ROW **row, const char *name, int len, SCIP_COL **cols, SCIP_Real *vals, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool removable)
Definition: scip_lp.c:1204
SCIP_Real SCIPgetRowSolActivity(SCIP *scip, SCIP_ROW *row, SCIP_SOL *sol)
Definition: scip_lp.c:1982
SCIP_Real SCIPgetRowActivity(SCIP *scip, SCIP_ROW *row)
Definition: scip_lp.c:1942
memory allocation routines