Scippy

SCIP

Solving Constraint Integer Programs

scip_lp.c
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of the program and library */
4 /* SCIP --- Solving Constraint Integer Programs */
5 /* */
6 /* Copyright (C) 2002-2019 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SCIP is distributed under the terms of the ZIB Academic License. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SCIP; see the file COPYING. If not visit scip.zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file scip_lp.c
17  * @brief public methods for the LP relaxation, rows and columns
18  * @author Tobias Achterberg
19  * @author Timo Berthold
20  * @author Gerald Gamrath
21  * @author Robert Lion Gottwald
22  * @author Stefan Heinz
23  * @author Gregor Hendel
24  * @author Thorsten Koch
25  * @author Alexander Martin
26  * @author Marc Pfetsch
27  * @author Michael Winkler
28  * @author Kati Wolter
29  *
30  * @todo check all SCIP_STAGE_* switches, and include the new stages TRANSFORMED and INITSOLVE
31  */
32 
33 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
34 
35 #include <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  *
1602  * @note If the variable being added is FIXED (as given by the status SCIP_VARSTATUS_FIXED), then the variable is not
1603  * added to the row, but the corresponding constant is added. Similarly, if the input variable is aggregated (as
1604  * given by the status SCIP_VARSTATUS_AGGREGATED), then the input variable is substituted with its aggregation.
1605  * For other cases, and to better understand the function behavior, please check the code of SCIPvarAddToRow.
1606  */
1608  SCIP* scip, /**< SCIP data structure */
1609  SCIP_ROW* row, /**< LP row */
1610  SCIP_VAR* var, /**< problem variable */
1611  SCIP_Real val /**< value of coefficient */
1612  )
1613 {
1614  SCIP_CALL( SCIPcheckStage(scip, "SCIPaddVarToRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1615 
1616  SCIP_CALL( SCIPvarAddToRow(var, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->transprob, scip->lp, row, val) );
1617 
1618  return SCIP_OKAY;
1619 }
1620 
1621 /** resolves variables to columns and adds them with the coefficients to the row;
1622  * this method caches the row extensions and flushes them afterwards to gain better performance
1623  *
1624  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1625  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1626  *
1627  * @attention If a coefficients absolute value is below the SCIP epsilon tolerance, the variable with its value is not added.
1628  *
1629  * @pre this method can be called in one of the following stages of the SCIP solving process:
1630  * - \ref SCIP_STAGE_INITSOLVE
1631  * - \ref SCIP_STAGE_SOLVING
1632  */
1634  SCIP* scip, /**< SCIP data structure */
1635  SCIP_ROW* row, /**< LP row */
1636  int nvars, /**< number of variables to add to the row */
1637  SCIP_VAR** vars, /**< problem variables to add */
1638  SCIP_Real* vals /**< values of coefficients */
1639  )
1640 {
1641  int v;
1642 
1643  assert(nvars == 0 || vars != NULL);
1644  assert(nvars == 0 || vals != NULL);
1645 
1646  SCIP_CALL( SCIPcheckStage(scip, "SCIPaddVarsToRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1647 
1648  /* resize the row to be able to store all variables (at least, if they are COLUMN variables) */
1649  SCIP_CALL( SCIProwEnsureSize(row, scip->mem->probmem, scip->set, SCIProwGetNNonz(row) + nvars) );
1650 
1651  /* delay the row sorting */
1652  SCIProwDelaySort(row);
1653 
1654  /* add the variables to the row */
1655  for( v = 0; v < nvars; ++v )
1656  {
1657  SCIP_CALL( SCIPvarAddToRow(vars[v], scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->transprob, scip->lp,
1658  row, vals[v]) );
1659  }
1660 
1661  /* force the row sorting */
1662  SCIProwForceSort(row, scip->set);
1663 
1664  return SCIP_OKAY;
1665 }
1666 
1667 /** resolves variables to columns and adds them with the same single coefficient to the row;
1668  * this method caches the row extensions and flushes them afterwards to gain better performance
1669  *
1670  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1671  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1672  *
1673  * @attention If the absolute value of val is below the SCIP epsilon tolerance, the variables will not added.
1674  *
1675  * @pre this method can be called in one of the following stages of the SCIP solving process:
1676  * - \ref SCIP_STAGE_INITSOLVE
1677  * - \ref SCIP_STAGE_SOLVING
1678  */
1680  SCIP* scip, /**< SCIP data structure */
1681  SCIP_ROW* row, /**< LP row */
1682  int nvars, /**< number of variables to add to the row */
1683  SCIP_VAR** vars, /**< problem variables to add */
1684  SCIP_Real val /**< unique value of all coefficients */
1685  )
1686 {
1687  int v;
1688 
1689  assert(nvars == 0 || vars != NULL);
1690 
1691  SCIP_CALL( SCIPcheckStage(scip, "SCIPaddVarsToRowSameCoef", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1692 
1693  /* resize the row to be able to store all variables (at least, if they are COLUMN variables) */
1694  SCIP_CALL( SCIProwEnsureSize(row, scip->mem->probmem, scip->set, SCIProwGetNNonz(row) + nvars) );
1695 
1696  /* delay the row sorting */
1697  SCIProwDelaySort(row);
1698 
1699  /* add the variables to the row */
1700  for( v = 0; v < nvars; ++v )
1701  {
1702  SCIP_CALL( SCIPvarAddToRow(vars[v], scip->mem->probmem, scip->set, scip->stat, scip->eventqueue, scip->transprob, scip->lp,
1703  row, val) );
1704  }
1705 
1706  /* force the row sorting */
1707  SCIProwForceSort(row, scip->set);
1708 
1709  return SCIP_OKAY;
1710 }
1711 
1712 /** tries to find a value, such that all row coefficients, if scaled with this value become integral
1713  *
1714  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1715  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1716  *
1717  * @pre this method can be called in one of the following stages of the SCIP solving process:
1718  * - \ref SCIP_STAGE_INITSOLVE
1719  * - \ref SCIP_STAGE_SOLVING
1720  */
1722  SCIP* scip, /**< SCIP data structure */
1723  SCIP_ROW* row, /**< LP row */
1724  SCIP_Real mindelta, /**< minimal relative allowed difference of scaled coefficient s*c and integral i */
1725  SCIP_Real maxdelta, /**< maximal relative allowed difference of scaled coefficient s*c and integral i */
1726  SCIP_Longint maxdnom, /**< maximal denominator allowed in rational numbers */
1727  SCIP_Real maxscale, /**< maximal allowed scalar */
1728  SCIP_Bool usecontvars, /**< should the coefficients of the continuous variables also be made integral? */
1729  SCIP_Real* intscalar, /**< pointer to store scalar that would make the coefficients integral, or NULL */
1730  SCIP_Bool* success /**< stores whether returned value is valid */
1731  )
1732 {
1733  SCIP_CALL( SCIPcheckStage(scip, "SCIPcalcRowIntegralScalar", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1734 
1735  SCIP_CALL( SCIProwCalcIntegralScalar(row, scip->set, mindelta, maxdelta, maxdnom, maxscale,
1736  usecontvars, intscalar, success) );
1737 
1738  return SCIP_OKAY;
1739 }
1740 
1741 /** tries to scale row, s.t. all coefficients (of integer variables) become integral
1742  *
1743  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1744  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1745  *
1746  * @pre this method can be called in one of the following stages of the SCIP solving process:
1747  * - \ref SCIP_STAGE_INITSOLVE
1748  * - \ref SCIP_STAGE_SOLVING
1749  */
1751  SCIP* scip, /**< SCIP data structure */
1752  SCIP_ROW* row, /**< LP row */
1753  SCIP_Real mindelta, /**< minimal relative allowed difference of scaled coefficient s*c and integral i */
1754  SCIP_Real maxdelta, /**< maximal relative allowed difference of scaled coefficient s*c and integral i */
1755  SCIP_Longint maxdnom, /**< maximal denominator allowed in rational numbers */
1756  SCIP_Real maxscale, /**< maximal value to scale row with */
1757  SCIP_Bool usecontvars, /**< should the coefficients of the continuous variables also be made integral? */
1758  SCIP_Bool* success /**< stores whether row could be made rational */
1759  )
1760 {
1761  SCIP_CALL( SCIPcheckStage(scip, "SCIPmakeRowIntegral", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1762 
1763  SCIP_CALL( SCIProwMakeIntegral(row, scip->mem->probmem, scip->set, scip->eventqueue, scip->stat, scip->lp, mindelta, maxdelta, maxdnom, maxscale,
1764  usecontvars, success) );
1765 
1766  return SCIP_OKAY;
1767 }
1768 
1769 /** marks a row to be not removable from the LP in the current node
1770  *
1771  * @pre this method can be called in the following stage of the SCIP solving process:
1772  * - \ref SCIP_STAGE_SOLVING
1773  */
1775  SCIP* scip, /**< SCIP data structure */
1776  SCIP_ROW* row /**< LP row */
1777  )
1778 {
1779  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPmarkRowNotRemovableLocal", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1780 
1781  SCIProwMarkNotRemovableLocal(row, scip->stat);
1782 }
1783 
1784 /** returns number of integral columns in the row
1785  *
1786  * @return number of integral columns in the row
1787  *
1788  * @pre this method can be called in one of the following stages of the SCIP solving process:
1789  * - \ref SCIP_STAGE_INITSOLVE
1790  * - \ref SCIP_STAGE_SOLVING
1791  */
1793  SCIP* scip, /**< SCIP data structure */
1794  SCIP_ROW* row /**< LP row */
1795  )
1796 {
1797  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetRowNumIntCols", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1798 
1799  return SCIProwGetNumIntCols(row, scip->set);
1800 }
1801 
1802 /** returns minimal absolute value of row vector's non-zero coefficients
1803  *
1804  * @return minimal absolute value of row vector's non-zero coefficients
1805  *
1806  * @pre this method can be called in one of the following stages of the SCIP solving process:
1807  * - \ref SCIP_STAGE_INITSOLVE
1808  * - \ref SCIP_STAGE_SOLVING
1809  */
1811  SCIP* scip, /**< SCIP data structure */
1812  SCIP_ROW* row /**< LP row */
1813  )
1814 {
1815  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetRowMinCoef", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1816 
1817  return SCIProwGetMinval(row, scip->set);
1818 }
1819 
1820 /** returns maximal absolute value of row vector's non-zero coefficients
1821  *
1822  * @return maximal absolute value of row vector's non-zero coefficients
1823  *
1824  * @pre this method can be called in one of the following stages of the SCIP solving process:
1825  * - \ref SCIP_STAGE_INITSOLVE
1826  * - \ref SCIP_STAGE_SOLVING
1827  */
1829  SCIP* scip, /**< SCIP data structure */
1830  SCIP_ROW* row /**< LP row */
1831  )
1832 {
1833  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetRowMaxCoef", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1834 
1835  return SCIProwGetMaxval(row, scip->set);
1836 }
1837 
1838 /** returns the minimal activity of a row w.r.t. the column's bounds
1839  *
1840  * @return the minimal activity of a row w.r.t. the column's bounds
1841  *
1842  * @pre this method can be called in one of the following stages of the SCIP solving process:
1843  * - \ref SCIP_STAGE_SOLVING
1844  */
1846  SCIP* scip, /**< SCIP data structure */
1847  SCIP_ROW* row /**< LP row */
1848  )
1849 {
1850  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetRowMinActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1851 
1852  return SCIProwGetMinActivity(row, scip->set, scip->stat);
1853 }
1854 
1855 /** returns the maximal activity of a row w.r.t. the column's bounds
1856  *
1857  * @return the maximal activity of a row w.r.t. the column's bounds
1858  *
1859  * @pre this method can be called in one of the following stages of the SCIP solving process:
1860  * - \ref SCIP_STAGE_SOLVING
1861  */
1863  SCIP* scip, /**< SCIP data structure */
1864  SCIP_ROW* row /**< LP row */
1865  )
1866 {
1867  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetRowMaxActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1868 
1869  return SCIProwGetMaxActivity(row, scip->set, scip->stat);
1870 }
1871 
1872 /** recalculates the activity of a row in the last LP solution
1873  *
1874  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1875  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1876  *
1877  * @pre this method can be called in one of the following stages of the SCIP solving process:
1878  * - \ref SCIP_STAGE_SOLVING
1879  */
1881  SCIP* scip, /**< SCIP data structure */
1882  SCIP_ROW* row /**< LP row */
1883  )
1884 {
1885  SCIP_CALL( SCIPcheckStage(scip, "SCIPrecalcRowLPActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1886 
1887  SCIProwRecalcLPActivity(row, scip->stat);
1888 
1889  return SCIP_OKAY;
1890 }
1891 
1892 /** returns the activity of a row in the last LP solution
1893  *
1894  * @return activity of a row in the last LP solution
1895  *
1896  * @pre this method can be called in one of the following stages of the SCIP solving process:
1897  * - \ref SCIP_STAGE_SOLVING
1898  */
1900  SCIP* scip, /**< SCIP data structure */
1901  SCIP_ROW* row /**< LP row */
1902  )
1903 {
1904  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetRowLPActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1905 
1906  return SCIProwGetLPActivity(row, scip->set, scip->stat, scip->lp);
1907 }
1908 
1909 /** returns the feasibility of a row in the last LP solution
1910  *
1911  * @return the feasibility of a row in the last LP solution: negative value means infeasibility
1912  *
1913  * @pre this method can be called in one of the following stages of the SCIP solving process:
1914  * - \ref SCIP_STAGE_SOLVING
1915  */
1917  SCIP* scip, /**< SCIP data structure */
1918  SCIP_ROW* row /**< LP row */
1919  )
1920 {
1921  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetRowLPFeasibility", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1922 
1923  return SCIProwGetLPFeasibility(row, scip->set, scip->stat, scip->lp);
1924 }
1925 
1926 /** recalculates the activity of a row for the current pseudo solution
1927  *
1928  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1929  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1930  *
1931  * @pre this method can be called in one of the following stages of the SCIP solving process:
1932  * - \ref SCIP_STAGE_SOLVING
1933  */
1935  SCIP* scip, /**< SCIP data structure */
1936  SCIP_ROW* row /**< LP row */
1937  )
1938 {
1939  SCIP_CALL( SCIPcheckStage(scip, "SCIPrecalcRowPseudoActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1940 
1941  SCIProwRecalcPseudoActivity(row, scip->stat);
1942 
1943  return SCIP_OKAY;
1944 }
1945 
1946 /** returns the activity of a row for the current pseudo solution
1947  *
1948  * @return the activity of a row for the current pseudo solution
1949  *
1950  * @pre this method can be called in one of the following stages of the SCIP solving process:
1951  * - \ref SCIP_STAGE_SOLVING
1952  */
1954  SCIP* scip, /**< SCIP data structure */
1955  SCIP_ROW* row /**< LP row */
1956  )
1957 {
1958  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetRowPseudoActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1959 
1960  return SCIProwGetPseudoActivity(row, scip->set, scip->stat);
1961 }
1962 
1963 /** returns the feasibility of a row for the current pseudo solution: negative value means infeasibility
1964  *
1965  * @return the feasibility of a row for the current pseudo solution: negative value means infeasibility
1966  *
1967  * @pre this method can be called in one of the following stages of the SCIP solving process:
1968  * - \ref SCIP_STAGE_SOLVING
1969  */
1971  SCIP* scip, /**< SCIP data structure */
1972  SCIP_ROW* row /**< LP row */
1973  )
1974 {
1975  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetRowPseudoFeasibility", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1976 
1977  return SCIProwGetPseudoFeasibility(row, scip->set, scip->stat);
1978 }
1979 
1980 /** recalculates the activity of a row in the last LP or pseudo solution
1981  *
1982  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1983  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1984  *
1985  * @pre this method can be called in one of the following stages of the SCIP solving process:
1986  * - \ref SCIP_STAGE_SOLVING
1987  */
1989  SCIP* scip, /**< SCIP data structure */
1990  SCIP_ROW* row /**< LP row */
1991  )
1992 {
1993  SCIP_CALL( SCIPcheckStage(scip, "SCIPrecalcRowActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
1994 
1995  if( SCIPtreeHasCurrentNodeLP(scip->tree) )
1996  SCIProwRecalcLPActivity(row, scip->stat);
1997  else
1998  SCIProwRecalcPseudoActivity(row, scip->stat);
1999 
2000  return SCIP_OKAY;
2001 }
2002 
2003 /** returns the activity of a row in the last LP or pseudo solution
2004  *
2005  * @return the activity of a row in the last LP or pseudo solution
2006  *
2007  * @pre this method can be called in one of the following stages of the SCIP solving process:
2008  * - \ref SCIP_STAGE_SOLVING
2009  */
2011  SCIP* scip, /**< SCIP data structure */
2012  SCIP_ROW* row /**< LP row */
2013  )
2014 {
2015  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetRowActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
2016 
2017  if( SCIPtreeHasCurrentNodeLP(scip->tree) )
2018  return SCIProwGetLPActivity(row, scip->set, scip->stat, scip->lp);
2019  else
2020  return SCIProwGetPseudoActivity(row, scip->set, scip->stat);
2021 }
2022 
2023 /** returns the feasibility of a row in the last LP or pseudo solution
2024  *
2025  * @return the feasibility of a row in the last LP or pseudo solution
2026  *
2027  * @pre this method can be called in one of the following stages of the SCIP solving process:
2028  * - \ref SCIP_STAGE_SOLVING
2029  */
2031  SCIP* scip, /**< SCIP data structure */
2032  SCIP_ROW* row /**< LP row */
2033  )
2034 {
2035  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetRowFeasibility", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
2036 
2037  if( SCIPtreeHasCurrentNodeLP(scip->tree) )
2038  return SCIProwGetLPFeasibility(row, scip->set, scip->stat, scip->lp);
2039  else
2040  return SCIProwGetPseudoFeasibility(row, scip->set, scip->stat);
2041 }
2042 
2043 /** returns the activity of a row for the given primal solution
2044  *
2045  * @return the activitiy of a row for the given primal solution
2046  *
2047  * @pre this method can be called in one of the following stages of the SCIP solving process:
2048  * - \ref SCIP_STAGE_SOLVING
2049  */
2051  SCIP* scip, /**< SCIP data structure */
2052  SCIP_ROW* row, /**< LP row */
2053  SCIP_SOL* sol /**< primal CIP solution */
2054  )
2055 {
2056  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetRowSolActivity", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, FALSE) );
2057 
2058  if( sol != NULL )
2059  return SCIProwGetSolActivity(row, scip->set, scip->stat, sol);
2060  else if( SCIPtreeHasCurrentNodeLP(scip->tree) )
2061  return SCIProwGetLPActivity(row, scip->set, scip->stat, scip->lp);
2062  else
2063  return SCIProwGetPseudoActivity(row, scip->set, scip->stat);
2064 }
2065 
2066 /** returns the feasibility of a row for the given primal solution
2067  *
2068  * @return the feasibility of a row for the given primal solution
2069  *
2070  * @pre this method can be called in one of the following stages of the SCIP solving process:
2071  * - \ref SCIP_STAGE_SOLVING
2072  */
2074  SCIP* scip, /**< SCIP data structure */
2075  SCIP_ROW* row, /**< LP row */
2076  SCIP_SOL* sol /**< primal CIP solution */
2077  )
2078 {
2079  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetRowSolFeasibility", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
2080 
2081  if( sol != NULL )
2082  return SCIProwGetSolFeasibility(row, scip->set, scip->stat, sol);
2083  else if( SCIPtreeHasCurrentNodeLP(scip->tree) )
2084  return SCIProwGetLPFeasibility(row, scip->set, scip->stat, scip->lp);
2085  else
2086  return SCIProwGetPseudoFeasibility(row, scip->set, scip->stat);
2087 }
2088 
2089 /** output row to file stream via the message handler system
2090  *
2091  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2092  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2093  *
2094  * @pre this method can be called in one of the following stages of the SCIP solving process:
2095  * - \ref SCIP_STAGE_SOLVING
2096  * - \ref SCIP_STAGE_SOLVED
2097  * - \ref SCIP_STAGE_EXITSOLVE
2098  */
2100  SCIP* scip, /**< SCIP data structure */
2101  SCIP_ROW* row, /**< LP row */
2102  FILE* file /**< output file (or NULL for standard output) */
2103  )
2104 {
2105  assert(row != NULL);
2106 
2107  SCIP_CALL( SCIPcheckStage(scip, "SCIPprintRow", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE) );
2108 
2109  SCIProwPrint(row, scip->messagehdlr, file);
2110 
2111  return SCIP_OKAY;
2112 }
2113 
2114 /** initiates LP diving, making methods SCIPchgVarObjDive(), SCIPchgVarLbDive(), and SCIPchgVarUbDive() available
2115  *
2116  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2117  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2118  *
2119  * @pre This method can be called if @p scip is in one of the following stages:
2120  * - \ref SCIP_STAGE_SOLVING
2121  *
2122  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
2123  *
2124  * @note diving is allowed even if the current LP is not flushed, not solved, or not solved to optimality; be aware
2125  * that solving the (first) diving LP may take longer than expect and that the latter two cases could stem from
2126  * numerical troubles during the last LP solve; because of this, most users will want to call this method only if
2127  * SCIPgetLPSolstat(scip) == SCIP_LPSOLSTAT_OPTIMAL
2128  */
2130  SCIP* scip /**< SCIP data structure */
2131  )
2132 {
2133  assert(scip != NULL);
2134 
2135  SCIP_CALL( SCIPcheckStage(scip, "SCIPstartDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
2137 
2138  if( SCIPlpDiving(scip->lp) )
2139  {
2140  SCIPerrorMessage("already in diving mode\n");
2141  return SCIP_INVALIDCALL;
2142  }
2143 
2144  if( SCIPtreeProbing(scip->tree) )
2145  {
2146  SCIPerrorMessage("cannot start diving while being in probing mode\n");
2147  return SCIP_INVALIDCALL;
2148  }
2149 
2151  {
2152  SCIPerrorMessage("cannot start diving if LP has not been constructed\n");
2153  return SCIP_INVALIDCALL;
2154  }
2155  assert(SCIPtreeHasCurrentNodeLP(scip->tree));
2156 
2157  SCIP_CALL( SCIPlpStartDive(scip->lp, scip->mem->probmem, scip->set, scip->stat) );
2158 
2159  /* remember the relaxation solution to reset it later */
2160  if( SCIPisRelaxSolValid(scip) )
2161  {
2162  SCIP_CALL( SCIPtreeStoreRelaxSol(scip->tree, scip->set, scip->relaxation, scip->transprob) );
2163  }
2164 
2165  return SCIP_OKAY;
2166 }
2167 
2168 /** quits LP diving and resets bounds and objective values of columns to the current node's values
2169  *
2170  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2171  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2172  *
2173  * @pre This method can be called if @p scip is in one of the following stages:
2174  * - \ref SCIP_STAGE_SOLVING
2175  *
2176  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
2177  */
2179  SCIP* scip /**< SCIP data structure */
2180  )
2181 {
2182  assert(scip != NULL);
2183 
2184  SCIP_CALL( SCIPcheckStage(scip, "SCIPendDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
2185 
2186  if( !SCIPlpDiving(scip->lp) )
2187  {
2188  SCIPerrorMessage("not in diving mode\n");
2189  return SCIP_INVALIDCALL;
2190  }
2191 
2192  /* unmark the diving flag in the LP and reset all variables' objective and bound values */
2193  SCIP_CALL( SCIPlpEndDive(scip->lp, scip->mem->probmem, scip->set, scip->messagehdlr, scip->stat, scip->eventqueue, scip->eventfilter,
2194  scip->transprob, scip->transprob->vars, scip->transprob->nvars) );
2195 
2196  /* the lower bound may have changed slightly due to LP resolve in SCIPlpEndDive() */
2197  if( !scip->lp->resolvelperror && scip->tree->focusnode != NULL && SCIPlpIsRelax(scip->lp) && SCIPlpIsSolved(scip->lp) )
2198  {
2199  assert(SCIPtreeIsFocusNodeLPConstructed(scip->tree));
2200  SCIP_CALL( SCIPnodeUpdateLowerboundLP(scip->tree->focusnode, scip->set, scip->stat, scip->tree, scip->transprob,
2201  scip->origprob, scip->lp) );
2202  }
2203  /* reset the probably changed LP's cutoff bound */
2204  SCIP_CALL( SCIPlpSetCutoffbound(scip->lp, scip->set, scip->transprob, scip->primal->cutoffbound) );
2205  assert(scip->lp->cutoffbound == scip->primal->cutoffbound); /*lint !e777*/
2206 
2207  /* if a new best solution was created, the cutoff of the tree was delayed due to diving;
2208  * the cutoff has to be done now.
2209  */
2210  if( scip->tree->cutoffdelayed )
2211  {
2212  SCIP_CALL( SCIPtreeCutoff(scip->tree, scip->reopt, scip->mem->probmem, scip->set, scip->stat, scip->eventqueue,
2213  scip->lp, scip->primal->cutoffbound) );
2214  }
2215 
2216  /* if a relaxation was stored before diving, restore it now */
2217  if( scip->tree->probdiverelaxstored )
2218  {
2219  SCIP_CALL( SCIPtreeRestoreRelaxSol(scip->tree, scip->set, scip->relaxation, scip->transprob) );
2220  }
2221 
2222  return SCIP_OKAY;
2223 }
2224 
2225 /** changes cutoffbound in current dive
2226  *
2227  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2228  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2229  *
2230  * @pre This method can be called if @p scip is in one of the following stages:
2231  * - \ref SCIP_STAGE_SOLVING
2232  *
2233  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
2234  */
2236  SCIP* scip, /**< SCIP data structure */
2237  SCIP_Real newcutoffbound /**< new cutoffbound */
2238  )
2239 {
2240  assert(scip != NULL);
2241 
2242  SCIP_CALL( SCIPcheckStage(scip, "SCIPchgCutoffboundDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
2243 
2244  if( !SCIPlpDiving(scip->lp) )
2245  {
2246  SCIPerrorMessage("not in diving mode\n");
2247  return SCIP_INVALIDCALL;
2248  }
2249 
2250  SCIP_CALL( SCIPlpSetCutoffbound(scip->lp, scip->set, scip->transprob, newcutoffbound) );
2251 
2252  return SCIP_OKAY;
2253 }
2254 
2255 /** changes variable's objective value in current dive
2256  *
2257  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2258  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2259  *
2260  * @pre This method can be called if @p scip is in one of the following stages:
2261  * - \ref SCIP_STAGE_SOLVING
2262  *
2263  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
2264  */
2266  SCIP* scip, /**< SCIP data structure */
2267  SCIP_VAR* var, /**< variable to change the objective value for */
2268  SCIP_Real newobj /**< new objective value */
2269  )
2270 {
2271  assert(scip != NULL);
2272  assert(var != NULL);
2273 
2274  SCIP_CALL( SCIPcheckStage(scip, "SCIPchgVarObjDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
2275 
2276  if( !SCIPlpDiving(scip->lp) )
2277  {
2278  SCIPerrorMessage("not in diving mode\n");
2279  return SCIP_INVALIDCALL;
2280  }
2281 
2282  /* invalidate the LP's cutoff bound, since this has nothing to do with the current objective value anymore;
2283  * the cutoff bound is reset in SCIPendDive()
2284  */
2285  SCIP_CALL( SCIPlpSetCutoffbound(scip->lp, scip->set, scip->transprob, SCIPsetInfinity(scip->set)) );
2286 
2287  /* mark the LP's objective function invalid */
2289 
2290  /* change the objective value of the variable in the diving LP */
2291  SCIP_CALL( SCIPvarChgObjDive(var, scip->set, scip->lp, newobj) );
2292 
2293  return SCIP_OKAY;
2294 }
2295 
2296 /** changes variable's lower bound in current dive
2297  *
2298  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2299  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2300  *
2301  * @pre This method can be called if @p scip is in one of the following stages:
2302  * - \ref SCIP_STAGE_SOLVING
2303  *
2304  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
2305  */
2307  SCIP* scip, /**< SCIP data structure */
2308  SCIP_VAR* var, /**< variable to change the bound for */
2309  SCIP_Real newbound /**< new value for bound */
2310  )
2311 {
2312  assert(scip != NULL);
2313  assert(var != NULL);
2314 
2315  SCIP_CALL( SCIPcheckStage(scip, "SCIPchgVarLbDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
2316 
2317  if( !SCIPlpDiving(scip->lp) )
2318  {
2319  SCIPerrorMessage("not in diving mode\n");
2320  return SCIP_INVALIDCALL;
2321  }
2322 
2323  SCIP_CALL( SCIPvarChgLbDive(var, scip->set, scip->lp, newbound) );
2324 
2325  return SCIP_OKAY;
2326 }
2327 
2328 /** changes variable's upper bound in current dive
2329  *
2330  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2331  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2332  *
2333  * @pre This method can be called if @p scip is in one of the following stages:
2334  * - \ref SCIP_STAGE_SOLVING
2335  *
2336  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
2337  */
2339  SCIP* scip, /**< SCIP data structure */
2340  SCIP_VAR* var, /**< variable to change the bound for */
2341  SCIP_Real newbound /**< new value for bound */
2342  )
2343 {
2344  assert(scip != NULL);
2345  assert(var != NULL);
2346 
2347  SCIP_CALL( SCIPcheckStage(scip, "SCIPchgVarUbDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
2348 
2349  if( !SCIPlpDiving(scip->lp) )
2350  {
2351  SCIPerrorMessage("not in diving mode\n");
2352  return SCIP_INVALIDCALL;
2353  }
2354 
2355  SCIP_CALL( SCIPvarChgUbDive(var, scip->set, scip->lp, newbound) );
2356 
2357  return SCIP_OKAY;
2358 }
2359 
2360 /** adds a row to the LP in current dive
2361  *
2362  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2363  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2364  *
2365  * @pre This method can be called if @p scip is in one of the following stages:
2366  * - \ref SCIP_STAGE_SOLVING
2367  *
2368  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
2369  */
2371  SCIP* scip, /**< SCIP data structure */
2372  SCIP_ROW* row /**< row to be added */
2373  )
2374 {
2375  SCIP_NODE* node;
2376  int depth;
2377 
2378  assert(scip != NULL);
2379  assert(row != NULL);
2380 
2381  SCIP_CALL( SCIPcheckStage(scip, "SCIPaddRowDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
2382 
2383  if( !SCIPlpDiving(scip->lp) )
2384  {
2385  SCIPerrorMessage("not in diving mode\n");
2386  return SCIP_INVALIDCALL;
2387  }
2388 
2389  /* get depth of current node */
2390  node = SCIPtreeGetCurrentNode(scip->tree);
2391  assert(node != NULL);
2392  depth = SCIPnodeGetDepth(node);
2393 
2394  SCIP_CALL( SCIPlpAddRow(scip->lp, scip->mem->probmem, scip->set, scip->eventqueue, scip->eventfilter, row, depth) );
2395 
2396  return SCIP_OKAY;
2397 }
2398 
2399 /** changes row lhs in current dive, change will be undone after diving ends, for permanent changes use SCIPchgRowLhs()
2400  *
2401  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2402  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2403  *
2404  * @pre This method can be called if @p scip is in one of the following stages:
2405  * - \ref SCIP_STAGE_SOLVING
2406  *
2407  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
2408  */
2410  SCIP* scip, /**< SCIP data structure */
2411  SCIP_ROW* row, /**< row to change the lhs for */
2412  SCIP_Real newlhs /**< new value for lhs */
2413  )
2414 {
2415  assert(scip != NULL);
2416  assert(row != NULL);
2417 
2418  SCIP_CALL( SCIPcheckStage(scip, "SCIPchgRowLhsDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
2419 
2420  if( !SCIPlpDiving(scip->lp) )
2421  {
2422  SCIPerrorMessage("not in diving mode\n");
2423  return SCIP_INVALIDCALL;
2424  }
2425 
2427  SCIP_CALL( SCIProwChgLhs(row, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp, newlhs) );
2428 
2429  return SCIP_OKAY;
2430 }
2431 
2432 /** changes row rhs in current dive, change will be undone after diving ends, for permanent changes use SCIPchgRowRhs()
2433  *
2434  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2435  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2436  *
2437  * @pre This method can be called if @p scip is in one of the following stages:
2438  * - \ref SCIP_STAGE_SOLVING
2439  *
2440  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
2441  */
2443  SCIP* scip, /**< SCIP data structure */
2444  SCIP_ROW* row, /**< row to change the lhs for */
2445  SCIP_Real newrhs /**< new value for rhs */
2446  )
2447 {
2448  assert(scip != NULL);
2449  assert(row != NULL);
2450 
2451  SCIP_CALL( SCIPcheckStage(scip, "SCIPchgRowRhsDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
2452 
2453  if( !SCIPlpDiving(scip->lp) )
2454  {
2455  SCIPerrorMessage("not in diving mode\n");
2456  return SCIP_INVALIDCALL;
2457  }
2458 
2460  SCIP_CALL( SCIProwChgRhs(row, scip->mem->probmem, scip->set, scip->eventqueue, scip->lp, newrhs) );
2461 
2462  return SCIP_OKAY;
2463 }
2464 
2465 /** gets variable's objective value in current dive
2466  *
2467  * @return the variable's objective value in current dive.
2468  *
2469  * @pre This method can be called if @p scip is in one of the following stages:
2470  * - \ref SCIP_STAGE_SOLVING
2471  *
2472  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
2473  */
2475  SCIP* scip, /**< SCIP data structure */
2476  SCIP_VAR* var /**< variable to get the bound for */
2477  )
2478 {
2479  assert(scip != NULL);
2480  assert(var != NULL);
2481 
2482  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetVarObjDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
2483 
2484  if( !SCIPlpDiving(scip->lp) )
2485  {
2486  SCIPerrorMessage("not in diving mode\n");
2487  SCIPABORT();
2488  return SCIP_INVALID; /*lint !e527*/
2489  }
2490 
2491  return SCIPvarGetObjLP(var);
2492 }
2493 
2494 /** gets variable's lower bound in current dive
2495  *
2496  * @return the variable's lower bound in current dive.
2497  *
2498  * @pre This method can be called if @p scip is in one of the following stages:
2499  * - \ref SCIP_STAGE_SOLVING
2500  *
2501  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
2502  */
2504  SCIP* scip, /**< SCIP data structure */
2505  SCIP_VAR* var /**< variable to get the bound for */
2506  )
2507 {
2508  assert(scip != NULL);
2509  assert(var != NULL);
2510 
2511  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetVarLbDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
2512 
2513  if( !SCIPlpDiving(scip->lp) )
2514  {
2515  SCIPerrorMessage("not in diving mode\n");
2516  SCIPABORT();
2517  return SCIP_INVALID; /*lint !e527*/
2518  }
2519 
2520  return SCIPvarGetLbLP(var, scip->set);
2521 }
2522 
2523 /** gets variable's upper bound in current dive
2524  *
2525  * @return the variable's upper bound in current dive.
2526  *
2527  * @pre This method can be called if @p scip is in one of the following stages:
2528  * - \ref SCIP_STAGE_SOLVING
2529  *
2530  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
2531  */
2533  SCIP* scip, /**< SCIP data structure */
2534  SCIP_VAR* var /**< variable to get the bound for */
2535  )
2536 {
2537  assert(scip != NULL);
2538  assert(var != NULL);
2539 
2540  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetVarUbDive", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
2541 
2542  if( !SCIPlpDiving(scip->lp) )
2543  {
2544  SCIPerrorMessage("not in diving mode\n");
2545  SCIPABORT();
2546  return SCIP_INVALID; /*lint !e527*/
2547  }
2548 
2549  return SCIPvarGetUbLP(var, scip->set);
2550 }
2551 
2552 /** solves the LP of the current dive; no separation or pricing is applied
2553  *
2554  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
2555  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
2556  *
2557  * @pre This method can be called if @p scip is in one of the following stages:
2558  * - \ref SCIP_STAGE_SOLVING
2559  *
2560  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
2561  *
2562  * @note be aware that the LP solve may take longer than expected if SCIPgetLPSolstat(scip) != SCIP_LPSOLSTAT_OPTIMAL,
2563  * compare the explanation of SCIPstartDive()
2564  */
2566  SCIP* scip, /**< SCIP data structure */
2567  int itlim, /**< maximal number of LP iterations to perform, or -1 for no limit */
2568  SCIP_Bool* lperror, /**< pointer to store whether an unresolved LP error occurred */
2569  SCIP_Bool* cutoff /**< pointer to store whether the diving LP was infeasible or the objective
2570  * limit was reached (or NULL, if not needed) */
2571  )
2572 {
2573  assert(scip != NULL);
2574 
2575  SCIP_CALL( SCIPcheckStage(scip, "SCIPsolveDiveLP", FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, FALSE, FALSE) );
2576 
2577  if( !SCIPlpDiving(scip->lp) )
2578  {
2579  SCIPerrorMessage("not in diving mode\n");
2580  return SCIP_INVALIDCALL;
2581  }
2582 
2583  if( cutoff != NULL )
2584  *cutoff = FALSE;
2585 
2586  /* solve diving LP */
2587  SCIP_CALL( SCIPlpSolveAndEval(scip->lp, scip->set, scip->messagehdlr, scip->mem->probmem, scip->stat,
2588  scip->eventqueue, scip->eventfilter, scip->transprob, (SCIP_Longint)itlim, FALSE, FALSE, FALSE, lperror) );
2589 
2590  /* the LP is infeasible or the objective limit was reached */
2592  || (SCIPlpGetSolstat(scip->lp) == SCIP_LPSOLSTAT_OPTIMAL &&
2593  SCIPisGE(scip, SCIPgetLPObjval(scip), SCIPgetCutoffbound(scip))) )
2594  {
2595  /* analyze the infeasible LP (only if the objective was not changed, all columns are in the LP, and no external
2596  * pricers exist) */
2597  if( !scip->set->misc_exactsolve && !(SCIPlpDivingObjChanged(scip->lp) || SCIPlpDivingRowsChanged(scip->lp))
2598  && SCIPprobAllColsInLP(scip->transprob, scip->set, scip->lp) )
2599  {
2600  SCIP_CALL( SCIPconflictAnalyzeLP(scip->conflict, scip->conflictstore, scip->mem->probmem, scip->set, scip->stat, scip->transprob,
2601  scip->origprob, scip->tree, scip->reopt, scip->lp, scip->branchcand, scip->eventqueue, scip->cliquetable, NULL) );
2602  }
2603 
2604  if( cutoff != NULL )
2605  *cutoff = TRUE;
2606  }
2607 
2608  return SCIP_OKAY;
2609 }
2610 
2611 /** returns the number of the node in the current branch and bound run, where the last LP was solved in diving
2612  * or probing mode
2613  *
2614  * @return the number of the node in the current branch and bound run, where the last LP was solved in diving
2615  * or probing mode.
2616  *
2617  * @pre This method can be called if @p scip is in one of the following stages:
2618  * - \ref SCIP_STAGE_TRANSFORMING
2619  * - \ref SCIP_STAGE_TRANSFORMED
2620  * - \ref SCIP_STAGE_INITPRESOLVE
2621  * - \ref SCIP_STAGE_PRESOLVING
2622  * - \ref SCIP_STAGE_EXITPRESOLVE
2623  * - \ref SCIP_STAGE_PRESOLVED
2624  * - \ref SCIP_STAGE_INITSOLVE
2625  * - \ref SCIP_STAGE_SOLVING
2626  * - \ref SCIP_STAGE_SOLVED
2627  * - \ref SCIP_STAGE_EXITSOLVE
2628  * - \ref SCIP_STAGE_FREETRANS
2629  *
2630  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
2631  */
2633  SCIP* scip /**< SCIP data structure */
2634  )
2635 {
2636  assert(scip != NULL);
2637 
2638  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPgetLastDivenode", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
2639 
2640  return scip->stat->lastdivenode;
2641 }
2642 
2643 /** returns whether we are in diving mode
2644  *
2645  * @return whether we are in diving mode.
2646  *
2647  * @pre This method can be called if @p scip is in one of the following stages:
2648  * - \ref SCIP_STAGE_TRANSFORMING
2649  * - \ref SCIP_STAGE_TRANSFORMED
2650  * - \ref SCIP_STAGE_INITPRESOLVE
2651  * - \ref SCIP_STAGE_PRESOLVING
2652  * - \ref SCIP_STAGE_EXITPRESOLVE
2653  * - \ref SCIP_STAGE_PRESOLVED
2654  * - \ref SCIP_STAGE_INITSOLVE
2655  * - \ref SCIP_STAGE_SOLVING
2656  * - \ref SCIP_STAGE_SOLVED
2657  * - \ref SCIP_STAGE_EXITSOLVE
2658  * - \ref SCIP_STAGE_FREETRANS
2659  *
2660  * See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
2661  */
2663  SCIP* scip /**< SCIP data structure */
2664  )
2665 {
2666  assert(scip != NULL);
2667 
2668  SCIP_CALL_ABORT( SCIPcheckStage(scip, "SCIPinDive", FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE) );
2669 
2670  return SCIPlpDiving(scip->lp);
2671 }
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:1679
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:246
internal methods for managing events
SCIP_Bool SCIPlpDivingRowsChanged(SCIP_LP *lp)
Definition: lp.c:17509
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:17467
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:1880
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:18223
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:1607
int SCIProwGetNNonz(SCIP_ROW *row)
Definition: lp.c:16880
SCIP_Real SCIPgetRowPseudoFeasibility(SCIP *scip, SCIP_ROW *row)
Definition: scip_lp.c:1970
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:1278
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:2370
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:13062
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:12418
SCIP_BRANCHCAND * branchcand
Definition: struct_scip.h:79
SCIP_Bool probdiverelaxstored
Definition: struct_tree.h:240
#define FALSE
Definition: def.h:72
SCIP_RETCODE SCIPlpWrite(SCIP_LP *lp, const char *fname)
Definition: lp.c:16227
SCIP_Bool SCIPlpIsSolBasic(SCIP_LP *lp)
Definition: lp.c:17457
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:71
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:17372
SCIP_RETCODE SCIPchgVarLbDive(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip_lp.c:2306
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:7957
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:15809
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:12215
SCIP_ROW ** SCIPlpGetRows(SCIP_LP *lp)
Definition: lp.c:17232
SCIP_RETCODE SCIPrecalcRowActivity(SCIP *scip, SCIP_ROW *row)
Definition: scip_lp.c:1988
SCIP_Real SCIPlpGetPseudoObjval(SCIP_LP *lp, SCIP_SET *set, SCIP_PROB *prob)
Definition: lp.c:13094
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:7357
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:12895
internal methods for LP management
SCIP_PROB * origprob
Definition: struct_scip.h:70
SCIP_Bool SCIPtreeIsFocusNodeLPConstructed(SCIP_TREE *tree)
Definition: tree.c:8270
SCIP_Real SCIPgetRowFeasibility(SCIP *scip, SCIP_ROW *row)
Definition: scip_lp.c:2030
SCIP_Bool SCIPlpIsRootLPRelax(SCIP_LP *lp)
Definition: lp.c:17350
SCIP_RETCODE SCIPlpRecordOldRowSideDive(SCIP_LP *lp, SCIP_ROW *row, SCIP_SIDETYPE sidetype)
Definition: lp.c:15991
SCIP_Real SCIPgetRowMaxCoef(SCIP *scip, SCIP_ROW *row)
Definition: scip_lp.c:1828
internal methods for branching and inference history
SCIP_Real SCIPgetRowMaxActivity(SCIP *scip, SCIP_ROW *row)
Definition: scip_lp.c:1862
public methods for numerical tolerances
internal methods for collecting primal CIP solutions and primal informations
int SCIPlpGetNCols(SCIP_LP *lp)
Definition: lp.c:17222
SCIP_Real SCIPvarGetUbLP(SCIP_VAR *var, SCIP_SET *set)
Definition: var.c:12488
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:17360
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:12372
SCIP_MEM * mem
Definition: struct_scip.h:61
SCIP_RETCODE SCIPchgRowLhsDive(SCIP *scip, SCIP_ROW *row, SCIP_Real newlhs)
Definition: scip_lp.c:2409
SCIP_Bool SCIPtreeProbing(SCIP_TREE *tree)
Definition: tree.c:8189
SCIP_Real SCIPgetLPLooseObjval(SCIP *scip)
Definition: scip_lp.c:341
SCIP_Real SCIPgetVarUbDive(SCIP *scip, SCIP_VAR *var)
Definition: scip_lp.c:2532
SCIP_RETCODE SCIPlpStartDive(SCIP_LP *lp, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat)
Definition: lp.c:15703
void SCIPmarkRowNotRemovableLocal(SCIP *scip, SCIP_ROW *row)
Definition: scip_lp.c:1774
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:16242
SCIP_Real SCIPgetRowMinCoef(SCIP *scip, SCIP_ROW *row)
Definition: scip_lp.c:1810
SCIP_Bool SCIPlpIsPrimalReliable(SCIP_LP *lp)
Definition: lp.c:17437
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:17447
SCIP_RETCODE SCIPsolveDiveLP(SCIP *scip, int itlim, SCIP_Bool *lperror, SCIP_Bool *cutoff)
Definition: scip_lp.c:2565
methods for block memory pools and memory buffers
SCIP_RETCODE SCIPrecalcRowPseudoActivity(SCIP *scip, SCIP_ROW *row)
Definition: scip_lp.c:1934
SCIP_COL ** SCIPlpGetCols(SCIP_LP *lp)
Definition: lp.c:17212
SCIP_RETCODE SCIPchgCutoffboundDive(SCIP *scip, SCIP_Real newcutoffbound)
Definition: scip_lp.c:2235
SCIP_RETCODE SCIPvarChgObjDive(SCIP_VAR *var, SCIP_SET *set, SCIP_LP *lp, SCIP_Real newobj)
Definition: var.c:6164
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:2010
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:358
SCIP main data structure.
int SCIPlpGetNRows(SCIP_LP *lp)
Definition: lp.c:17242
void SCIPlpMarkDivingObjChanged(SCIP_LP *lp)
Definition: lp.c:17487
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:1899
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:303
SCIP_LPI * SCIPlpGetLPI(SCIP_LP *lp)
Definition: lp.c:17394
SCIP_Real SCIPlpGetObjval(SCIP_LP *lp, SCIP_SET *set, SCIP_PROB *prob)
Definition: lp.c:12911
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:2632
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:17384
internal methods for user interface dialog
#define SCIP_Bool
Definition: def.h:69
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:1953
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:1792
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:2338
SCIP_RETCODE SCIPvarChgUbDive(SCIP_VAR *var, SCIP_SET *set, SCIP_LP *lp, SCIP_Real newbound)
Definition: var.c:8047
SCIP_RETCODE SCIPcaptureRow(SCIP *scip, SCIP_ROW *row)
Definition: scip_lp.c:1452
SCIP_Bool SCIPlpDivingObjChanged(SCIP_LP *lp)
Definition: lp.c:17477
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:8324
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:2050
SCIP_Bool cutoffdelayed
Definition: struct_tree.h:227
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:12950
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:13751
SCIP_Bool SCIPinDive(SCIP *scip)
Definition: scip_lp.c:2662
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:2265
SCIP_VAR * SCIPcolGetVar(SCIP_COL *col)
Definition: lp.c:16729
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:8290
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:1916
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:7337
default user interface dialog
#define SCIP_Real
Definition: def.h:157
SCIP_RETCODE SCIPaddVarsToRow(SCIP *scip, SCIP_ROW *row, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
Definition: scip_lp.c:1633
internal methods for problem statistics
SCIP_VAR ** vars
Definition: struct_prob.h:55
SCIP_Bool SCIPlpIsSolved(SCIP_LP *lp)
Definition: lp.c:17427
SCIP_RETCODE SCIPtreeStoreRelaxSol(SCIP_TREE *tree, SCIP_SET *set, SCIP_RELAXATION *relaxation, SCIP_PROB *transprob)
Definition: tree.c:6941
SCIP_Real SCIPgetRowMinActivity(SCIP *scip, SCIP_ROW *row)
Definition: scip_lp.c:1845
SCIP_Real SCIPgetGlobalPseudoObjval(SCIP *scip)
Definition: scip_lp.c:366
#define SCIP_INVALID
Definition: def.h:177
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:2099
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:1721
SCIP_Bool SCIPlpIsRelax(SCIP_LP *lp)
Definition: lp.c:17417
#define SCIP_Longint
Definition: def.h:142
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:2073
SCIP_Real SCIPgetVarLbDive(SCIP *scip, SCIP_VAR *var)
Definition: scip_lp.c:2503
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:2129
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:5055
SCIP_RETCODE SCIPtreeRestoreRelaxSol(SCIP_TREE *tree, SCIP_SET *set, SCIP_RELAXATION *relaxation, SCIP_PROB *transprob)
Definition: tree.c:6978
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:2178
#define SCIP_CALL_ABORT(x)
Definition: def.h:337
internal methods for primal heuristics
SCIP_RETCODE SCIPchgRowRhsDive(SCIP *scip, SCIP_ROW *row, SCIP_Real newrhs)
Definition: scip_lp.c:2442
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:12939
void SCIProwRecalcPseudoActivity(SCIP_ROW *row, SCIP_STAT *stat)
Definition: lp.c:6302
#define SCIPABORT()
Definition: def.h:330
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:1750
SCIP_Real SCIPgetVarObjDive(SCIP *scip, SCIP_VAR *var)
Definition: scip_lp.c:2474
internal methods for Benders&#39; decomposition cuts
SCIP_Real SCIPgetRowActivity(SCIP *scip, SCIP_ROW *row)
Definition: scip_lp.c:2010
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:182
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.