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