1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /*                                                                           */
3 /*                  This file is part of the program and library             */
4 /*         SCIP --- Solving Constraint Integer Programs                      */
5 /*                                                                           */
6 /*    Copyright (C) 2002-2021 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 scipopt.org.         */
13 /*                                                                           */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file   scip_lp.h
17  * @ingroup PUBLICCOREAPI
18  * @brief  public methods for the LP relaxation, rows and columns
19  * @author Tobias Achterberg
20  * @author Timo Berthold
21  * @author Thorsten Koch
22  * @author Alexander Martin
23  * @author Marc Pfetsch
24  * @author Kati Wolter
25  * @author Gregor Hendel
26  * @author Leona Gottwald
27  */
28 
29 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
30 
31 #ifndef __SCIP_SCIP_LP_H__
32 #define __SCIP_SCIP_LP_H__
33 
34 
35 #include "lpi/type_lpi.h"
36 #include "scip/def.h"
37 #include "scip/type_cons.h"
38 #include "scip/type_lp.h"
39 #include "scip/type_misc.h"
40 #include "scip/type_retcode.h"
41 #include "scip/type_scip.h"
42 #include "scip/type_sepa.h"
43 #include "scip/type_sol.h"
44 #include "scip/type_var.h"
45 
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49 
50 /**@addtogroup PublicLPMethods
51  *
52  * @{
53  */
54 
55 /** returns, whether the LP was or is to be solved in the current node
56  *
57  *  @return whether the LP was or is to be solved in the current node.
58  *
59  *  @pre This method can be called if @p scip is in one of the following stages:
60  *       - \ref SCIP_STAGE_SOLVING
61  *
62  *  See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
63  */
64 SCIP_EXPORT
65 SCIP_Bool SCIPhasCurrentNodeLP(
66    SCIP*                 scip                /**< SCIP data structure */
67    );
68 
69 /** returns, whether the LP of the current node is already constructed
70  *
71  *  @return whether the LP of the current node is already constructed.
72  *
73  *  @pre This method can be called if @p scip is in one of the following stages:
74  *       - \ref SCIP_STAGE_SOLVING
75  *
76  *  See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
77  */
78 SCIP_EXPORT
79 SCIP_Bool SCIPisLPConstructed(
80    SCIP*                 scip                /**< SCIP data structure */
81    );
82 
83 /** makes sure that the LP of the current node is loaded and may be accessed through the LP information methods
84  *
85  *  @warning Contructing the LP might change the amount of variables known in the transformed problem and therefore also
86  *           the variables array of SCIP (returned by SCIPgetVars() and SCIPgetVarsData()), so it might be necessary to
87  *           call one of the later method after this one
88  *
89  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
90  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
91  *
92  *  @pre This method can be called if @p scip is in one of the following stages:
93  *       - \ref SCIP_STAGE_SOLVING
94  *
95  *  See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
96  */
97 SCIP_EXPORT
98 SCIP_RETCODE SCIPconstructLP(
99    SCIP*                 scip,               /**< SCIP data structure */
100    SCIP_Bool*            cutoff              /**< pointer to store whether the node can be cut off */
101    );
102 
103 /** makes sure that the LP of the current node is flushed
104  *
105  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
106  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
107  *
108  *  @pre This method can be called if @p scip is in one of the following stages:
109  *       - \ref SCIP_STAGE_SOLVING
110  *
111  *  See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
112  */
113 SCIP_EXPORT
114 SCIP_RETCODE SCIPflushLP(
115    SCIP*                 scip                /**< SCIP data structure */
116    );
117 
118 /** gets solution status of current LP
119  *
120  *  @return the solution status of current LP.
121  *
122  *  @pre This method can be called if @p scip is in one of the following stages:
123  *       - \ref SCIP_STAGE_SOLVING
124  *
125  *  See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
126  */
127 SCIP_EXPORT
128 SCIP_LPSOLSTAT SCIPgetLPSolstat(
129    SCIP*                 scip                /**< SCIP data structure */
130    );
131 
132 /** returns whether the current LP solution passed the primal feasibility check
133  *
134  *  @returns whether the current LP solution passed the primal feasibility check.
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  */
141 SCIP_EXPORT
142 SCIP_Bool SCIPisLPPrimalReliable(
143    SCIP*                 scip                /**< SCIP data structure */
144    );
145 
146 /** returns whether the current LP solution passed the dual feasibility check
147  *
148  *  @returns whether the current LP solution passed the dual feasibility check.
149  *
150  *  @pre This method can be called if @p scip is in one of the following stages:
151  *       - \ref SCIP_STAGE_SOLVING
152  *
153  *  See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
154  */
155 SCIP_EXPORT
156 SCIP_Bool SCIPisLPDualReliable(
157    SCIP*                 scip                /**< SCIP data structure */
158    );
159 
160 /** returns whether the current lp is a relaxation of the current problem and its optimal objective value is a local lower bound
161  *
162  *  @return whether the current lp is a relaxation of the current problem and its optimal objective value is a local lower bound.
163  *
164  *  @pre This method can be called if @p scip is in one of the following stages:
165  *       - \ref SCIP_STAGE_SOLVING
166  *
167  *  See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
168  */
169 SCIP_EXPORT
170 SCIP_Bool SCIPisLPRelax(
171    SCIP*                 scip                /**< SCIP data structure */
172    );
173 
174 /** gets objective value of current LP (which is the sum of column and loose objective value)
175  *
176  *  @return the objective value of current LP (which is the sum of column and loose objective value).
177  *
178  *  @pre This method can be called if @p scip is in one of the following stages:
179  *       - \ref SCIP_STAGE_SOLVING
180  *
181  *  @note This method returns the objective value of the current LP solution, which might be primal or dual infeasible
182  *        if a limit was hit during solving. It must not be used as a dual bound if the LP solution status returned by
183  *        SCIPgetLPSolstat() is SCIP_LPSOLSTAT_ITERLIMIT or SCIP_LPSOLSTAT_TIMELIMIT.
184  *
185  *  See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
186  */
187 SCIP_EXPORT
188 SCIP_Real SCIPgetLPObjval(
189    SCIP*                 scip                /**< SCIP data structure */
190    );
191 
192 /** gets part of objective value of current LP that results from COLUMN variables only
193  *
194  *  @return the part of objective value of current LP that results from COLUMN variables only.
195  *
196  *  @pre This method can be called if @p scip is in one of the following stages:
197  *       - \ref SCIP_STAGE_SOLVING
198  *
199  *  See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
200  */
201 SCIP_EXPORT
202 SCIP_Real SCIPgetLPColumnObjval(
203    SCIP*                 scip                /**< SCIP data structure */
204    );
205 
206 /** gets part of objective value of current LP that results from LOOSE variables only
207  *
208  *  @return part of objective value of current LP that results from LOOSE variables only.
209  *
210  *  @pre This method can be called if @p scip is in one of the following stages:
211  *       - \ref SCIP_STAGE_SOLVING
212  *
213  *  See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
214  */
215 SCIP_EXPORT
216 SCIP_Real SCIPgetLPLooseObjval(
217    SCIP*                 scip                /**< SCIP data structure */
218    );
219 
220 /** gets the global pseudo objective value; that is all variables set to their best  (w.r.t. the objective
221  *  function) global bound
222  *
223  *  @return the global pseudo objective value; that is all variables set to their best  (w.r.t. the objective
224  *  function) global bound.
225  *
226  *  @pre This method can be called if @p scip is in one of the following stages:
227  *       - \ref SCIP_STAGE_INITPRESOLVE
228  *       - \ref SCIP_STAGE_PRESOLVING
229  *       - \ref SCIP_STAGE_EXITPRESOLVE
230  *       - \ref SCIP_STAGE_PRESOLVED
231  *       - \ref SCIP_STAGE_INITSOLVE
232  *       - \ref SCIP_STAGE_SOLVING
233  *
234  *  See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
235  */
236 SCIP_EXPORT
237 SCIP_Real SCIPgetGlobalPseudoObjval(
238    SCIP*                 scip                /**< SCIP data structure */
239    );
240 
241 /** gets the pseudo objective value for the current search node; that is all variables set to their best (w.r.t. the
242  *  objective function) local bound
243  *
244  *  @return the pseudo objective value for the current search node; that is all variables set to their best (w.r.t. the
245  *  objective function) local bound.
246  *
247  *  @pre This method can be called if @p scip is in one of the following stages:
248  *       - \ref SCIP_STAGE_INITPRESOLVE
249  *       - \ref SCIP_STAGE_PRESOLVING
250  *       - \ref SCIP_STAGE_EXITPRESOLVE
251  *       - \ref SCIP_STAGE_PRESOLVED
252  *       - \ref SCIP_STAGE_INITSOLVE
253  *       - \ref SCIP_STAGE_SOLVING
254  *
255  *  See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
256  */
257 SCIP_EXPORT
258 SCIP_Real SCIPgetPseudoObjval(
259    SCIP*                 scip                /**< SCIP data structure */
260    );
261 
262 /** returns whether the root lp is a relaxation of the problem and its optimal objective value is a global lower bound
263  *
264  *  @return whether the root lp is a relaxation of the problem and its optimal objective value is a global lower bound.
265  *
266  *  @pre This method can be called if @p scip is in one of the following stages:
267  *       - \ref SCIP_STAGE_SOLVING
268  *
269  *  See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
270  */
271 SCIP_EXPORT
272 SCIP_Bool SCIPisRootLPRelax(
273    SCIP*                 scip                /**< SCIP data structure */
274    );
275 
276 /** gets the objective value of the root node LP or SCIP_INVALID if the root node LP was not (yet) solved
277  *
278  *  @return the objective value of the root node LP or SCIP_INVALID if the root node LP was not (yet) solved.
279  *
280  *  @pre This method can be called if @p scip is in one of the following stages:
281  *       - \ref SCIP_STAGE_INITPRESOLVE
282  *       - \ref SCIP_STAGE_PRESOLVING
283  *       - \ref SCIP_STAGE_EXITPRESOLVE
284  *       - \ref SCIP_STAGE_SOLVING
285  *
286  *  See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
287  */
288 SCIP_EXPORT
289 SCIP_Real SCIPgetLPRootObjval(
290    SCIP*                 scip                /**< SCIP data structure */
291    );
292 
293 /** gets part of the objective value of the root node LP that results from COLUMN variables only;
294  *  returns SCIP_INVALID if the root node LP was not (yet) solved
295  *
296  *  @return the part of the objective value of the root node LP that results from COLUMN variables only;
297  *  or SCIP_INVALID if the root node LP was not (yet) solved.
298  *
299  *  @pre This method can be called if @p scip is in one of the following stages:
300  *       - \ref SCIP_STAGE_INITPRESOLVE
301  *       - \ref SCIP_STAGE_PRESOLVING
302  *       - \ref SCIP_STAGE_EXITPRESOLVE
303  *       - \ref SCIP_STAGE_SOLVING
304  *
305  *  See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
306  */
307 SCIP_EXPORT
308 SCIP_Real SCIPgetLPRootColumnObjval(
309    SCIP*                 scip                /**< SCIP data structure */
310    );
311 
312 /** gets part of the objective value of the root node LP that results from LOOSE variables only;
313  *  returns SCIP_INVALID if the root node LP was not (yet) solved
314  *
315  *  @return the part of the objective value of the root node LP that results from LOOSE variables only;
316  *  or SCIP_INVALID if the root node LP was not (yet) solved.
317  *
318  *  @pre This method can be called if @p scip is in one of the following stages:
319  *       - \ref SCIP_STAGE_INITPRESOLVE
320  *       - \ref SCIP_STAGE_PRESOLVING
321  *       - \ref SCIP_STAGE_EXITPRESOLVE
322  *       - \ref SCIP_STAGE_SOLVING
323  *
324  *  See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
325  */
326 SCIP_EXPORT
327 SCIP_Real SCIPgetLPRootLooseObjval(
328    SCIP*                 scip                /**< SCIP data structure */
329    );
330 
331 /** gets current primal feasibility tolerance of LP */
332 SCIP_EXPORT
333 SCIP_Real SCIPgetLPFeastol(
334    SCIP*                 scip                /**< SCIP data structure */
335    );
336 
337 /** sets primal feasibility tolerance of LP */
338 SCIP_EXPORT
339 void SCIPsetLPFeastol(
340    SCIP*                 scip,               /**< SCIP data structure */
341    SCIP_Real             newfeastol          /**< new primal feasibility tolerance for LP */
342    );
343 
344 /** resets primal feasibility tolerance of LP
345  *
346  * Sets primal feasibility tolerance to min of numerics/lpfeastolfactor * numerics/feastol and relaxfeastol.
347  */
348 SCIP_EXPORT
349 void SCIPresetLPFeastol(
350    SCIP*                 scip                /**< SCIP data structure */
351    );
352 
353 /** gets current LP columns along with the current number of LP columns
354  *
355  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
356  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
357  *
358  *  @pre This method can be called if @p scip is in one of the following stages:
359  *       - \ref SCIP_STAGE_SOLVING
360  *
361  *  See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
362  */
363 SCIP_EXPORT
364 SCIP_RETCODE SCIPgetLPColsData(
365    SCIP*                 scip,               /**< SCIP data structure */
366    SCIP_COL***           cols,               /**< pointer to store the array of LP columns, or NULL */
367    int*                  ncols               /**< pointer to store the number of LP columns, or NULL */
368    );
369 
370 /** gets current LP columns
371  *
372  *  @return the current LP columns.
373  *
374  *  @pre This method can be called if @p scip is in one of the following stages:
375  *       - \ref SCIP_STAGE_SOLVING
376  *
377  *  See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
378  */
379 SCIP_EXPORT
380 SCIP_COL** SCIPgetLPCols(
381    SCIP*                 scip                /**< SCIP data structure */
382    );
383 
384 /** gets current number of LP columns
385  *
386  *  @return the current number of LP columns.
387  *
388  *  @pre This method can be called if @p scip is in one of the following stages:
389  *       - \ref SCIP_STAGE_SOLVING
390  *
391  *  See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
392  */
393 SCIP_EXPORT
394 int SCIPgetNLPCols(
395    SCIP*                 scip                /**< SCIP data structure */
396    );
397 
398 /** gets current LP rows along with the current number of LP rows
399  *
400  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
401  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
402  *
403  *  @pre This method can be called if @p scip is in one of the following stages:
404  *       - \ref SCIP_STAGE_SOLVING
405  *
406  *  See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
407  */
408 SCIP_EXPORT
409 SCIP_RETCODE SCIPgetLPRowsData(
410    SCIP*                 scip,               /**< SCIP data structure */
411    SCIP_ROW***           rows,               /**< pointer to store the array of LP rows, or NULL */
412    int*                  nrows               /**< pointer to store the number of LP rows, or NULL */
413    );
414 
415 /** gets current LP rows
416  *
417  *  @return the current LP rows.
418  *
419  *  @pre This method can be called if @p scip is in one of the following stages:
420  *       - \ref SCIP_STAGE_SOLVING
421  *
422  *  See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
423  */
424 SCIP_EXPORT
425 SCIP_ROW** SCIPgetLPRows(
426    SCIP*                 scip                /**< SCIP data structure */
427    );
428 
429 /** gets current number of LP rows
430  *
431  *  @return the current number of LP rows.
432  *
433  *  @pre This method can be called if @p scip is in one of the following stages:
434  *       - \ref SCIP_STAGE_SOLVING
435  *
436  *  See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
437  */
438 SCIP_EXPORT
439 int SCIPgetNLPRows(
440    SCIP*                 scip                /**< SCIP data structure */
441    );
442 
443 /** returns TRUE iff all columns, i.e. every variable with non-empty column w.r.t. all ever created rows, are present
444  *  in the LP, and FALSE, if there are additional already existing columns, that may be added to the LP in pricing
445  *
446  *  @return TRUE iff all columns, i.e. every variable with non-empty column w.r.t. all ever created rows, are present
447  *  in the LP, and FALSE, if there are additional already existing columns, that may be added to the LP in pricing.
448  *
449  *  @pre This method can be called if @p scip is in one of the following stages:
450  *       - \ref SCIP_STAGE_SOLVING
451  *
452  *  See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
453  */
454 SCIP_EXPORT
455 SCIP_Bool SCIPallColsInLP(
456    SCIP*                 scip                /**< SCIP data structure */
457    );
458 
459 /** returns whether the current LP solution is basic, i.e. is defined by a valid simplex basis
460  *
461  *  @return whether the current LP solution is basic, i.e. is defined by a valid simplex basis.
462  *
463  *  @pre This method can be called if @p scip is in one of the following stages:
464  *       - \ref SCIP_STAGE_SOLVING
465  *
466  *  See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
467  */
468 SCIP_EXPORT
469 SCIP_Bool SCIPisLPSolBasic(
470    SCIP*                 scip                /**< SCIP data structure */
471    );
472 
473 /** gets all indices of basic columns and rows: index i >= 0 corresponds to column i, index i < 0 to row -i-1
474  *
475  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
476  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
477  *
478  *  @pre This method can be called if @p scip is in one of the following stages:
479  *       - \ref SCIP_STAGE_SOLVING
480  *
481  *  See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
482  */
483 SCIP_EXPORT
484 SCIP_RETCODE SCIPgetLPBasisInd(
485    SCIP*                 scip,               /**< SCIP data structure */
486    int*                  basisind            /**< pointer to store basis indices ready to keep number of rows entries */
487    );
488 
489 /** gets a row from the inverse basis matrix B^-1
490  *
491  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
492  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
493  *
494  *  @pre This method can be called if @p scip is in one of the following stages:
495  *       - \ref SCIP_STAGE_SOLVING
496  *
497  *  See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
498  */
499 SCIP_EXPORT
500 SCIP_RETCODE SCIPgetLPBInvRow(
501    SCIP*                 scip,               /**< SCIP data structure */
502    int                   r,                  /**< row number */
503    SCIP_Real*            coefs,              /**< array to store the coefficients of the row */
504    int*                  inds,               /**< array to store the non-zero indices, or NULL */
505    int*                  ninds               /**< pointer to store the number of non-zero indices, or NULL
506                                               *  (-1: if we do not store sparsity informations) */
507    );
508 
509 /** gets a column from the inverse basis matrix B^-1
510  *
511  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
512  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
513  *
514  *  @pre This method can be called if @p scip is in one of the following stages:
515  *       - \ref SCIP_STAGE_SOLVING
516  *
517  *  See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
518  */
519 SCIP_EXPORT
520 SCIP_RETCODE SCIPgetLPBInvCol(
521    SCIP*                 scip,               /**< SCIP data structure */
522    int                   c,                  /**< column number of B^-1; this is NOT the number of the column in the LP
523                                               *   returned by SCIPcolGetLPPos(); you have to call SCIPgetBasisInd()
524                                               *   to get the array which links the B^-1 column numbers to the row and
525                                               *   column numbers of the LP! c must be between 0 and nrows-1, since the
526                                               *   basis has the size nrows * nrows */
527    SCIP_Real*            coefs,              /**< array to store the coefficients of the column */
528    int*                  inds,               /**< array to store the non-zero indices, or NULL */
529    int*                  ninds               /**< pointer to store the number of non-zero indices, or NULL
530                                               *  (-1: if we do not store sparsity informations) */
531    );
532 
533 /** gets a row from the product of inverse basis matrix B^-1 and coefficient matrix A (i.e. from B^-1 * A)
534  *
535  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
536  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
537  *
538  *  @pre This method can be called if @p scip is in one of the following stages:
539  *       - \ref SCIP_STAGE_SOLVING
540  *
541  *  See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
542  */
543 SCIP_EXPORT
544 SCIP_RETCODE SCIPgetLPBInvARow(
545    SCIP*                 scip,               /**< SCIP data structure */
546    int                   r,                  /**< row number */
547    SCIP_Real*            binvrow,            /**< row in B^-1 from prior call to SCIPgetLPBInvRow(), or NULL */
548    SCIP_Real*            coefs,              /**< array to store the coefficients of the row */
549    int*                  inds,               /**< array to store the non-zero indices, or NULL */
550    int*                  ninds               /**< pointer to store the number of non-zero indices, or NULL
551                                               *  (-1: if we do not store sparsity informations) */
552    );
553 
554 /** gets a column from the product of inverse basis matrix B^-1 and coefficient matrix A (i.e. from B^-1 * A),
555  *  i.e., it computes B^-1 * A_c with A_c being the c'th column of A
556  *
557  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
558  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
559  *
560  *  @pre This method can be called if @p scip is in one of the following stages:
561  *       - \ref SCIP_STAGE_SOLVING
562  *
563  *  See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
564  */
565 SCIP_EXPORT
566 SCIP_RETCODE SCIPgetLPBInvACol(
567    SCIP*                 scip,               /**< SCIP data structure */
568    int                   c,                  /**< column number which can be accessed by SCIPcolGetLPPos() */
569    SCIP_Real*            coefs,              /**< array to store the coefficients of the column */
570    int*                  inds,               /**< array to store the non-zero indices, or NULL */
571    int*                  ninds               /**< pointer to store the number of non-zero indices, or NULL
572                                               *  (-1: if we do not store sparsity informations) */
573    );
574 
575 /** calculates a weighted sum of all LP rows; for negative weights, the left and right hand side of the corresponding
576  *  LP row are swapped in the summation
577  *
578  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
579  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
580  *
581  *  @pre This method can be called if @p scip is in one of the following stages:
582  *       - \ref SCIP_STAGE_SOLVING
583  *
584  *  See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
585  */
586 SCIP_EXPORT
587 SCIP_RETCODE SCIPsumLPRows(
588    SCIP*                 scip,               /**< SCIP data structure */
589    SCIP_Real*            weights,            /**< row weights in row summation */
590    SCIP_REALARRAY*       sumcoef,            /**< array to store sum coefficients indexed by variables' probindex */
591    SCIP_Real*            sumlhs,             /**< pointer to store the left hand side of the row summation */
592    SCIP_Real*            sumrhs              /**< pointer to store the right hand side of the row summation */
593    );
594 
595 /** writes current LP to a file
596  *
597  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
598  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
599  *
600  *  @pre This method can be called if @p scip is in one of the following stages:
601  *       - \ref SCIP_STAGE_SOLVING
602  *
603  *  See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
604  */
605 SCIP_EXPORT
606 SCIP_RETCODE SCIPwriteLP(
607    SCIP*                 scip,               /**< SCIP data structure */
608    const char*           filename            /**< file name */
609    );
610 
611 /** writes MIP relaxation of the current branch-and-bound node to a file
612  *
613  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
614  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
615  *
616  *  @pre This method can be called if @p scip is in one of the following stages:
617  *       - \ref SCIP_STAGE_SOLVING
618  *
619  *  See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
620  */
621 SCIP_EXPORT
622 SCIP_RETCODE SCIPwriteMIP(
623    SCIP*                 scip,               /**< SCIP data structure */
624    const char*           filename,           /**< file name */
625    SCIP_Bool             genericnames,       /**< should generic names like x_i and row_j be used in order to avoid
626                                               *   troubles with reserved symbols? */
627    SCIP_Bool             origobj,            /**< should the original objective function be used? */
628    SCIP_Bool             lazyconss           /**< output removable rows as lazy constraints? */
629    );
630 
631 /** gets the LP interface of SCIP;
632  *  with the LPI you can use all of the methods defined in lpi/lpi.h;
633  *
634  *  @warning You have to make sure, that the full internal state of the LPI does not change or is recovered completely
635  *           after the end of the method that uses the LPI. In particular, if you manipulate the LP or its solution
636  *           (e.g. by calling one of the SCIPlpiAdd...() or one of the SCIPlpiSolve...() methods), you have to check in
637  *           advance with SCIPlpiWasSolved() whether the LP is currently solved. If this is the case, you have to make
638  *           sure, the internal solution status is recovered completely at the end of your method. This can be achieved
639  *           by getting the LPI state before applying any LPI manipulations with SCIPlpiGetState() and restoring it
640  *           afterwards with SCIPlpiSetState() and SCIPlpiFreeState(). Additionally you have to resolve the LP with the
641  *           appropriate SCIPlpiSolve...() call in order to reinstall the internal solution status.
642  *
643  *  @warning Make also sure, that all parameter values that you have changed are set back to their original values.
644  *
645  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
646  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
647  *
648  *  @pre This method can be called if @p scip is in one of the following stages:
649  *       - \ref SCIP_STAGE_TRANSFORMED
650  *       - \ref SCIP_STAGE_INITPRESOLVE
651  *       - \ref SCIP_STAGE_PRESOLVING
652  *       - \ref SCIP_STAGE_EXITPRESOLVE
653  *       - \ref SCIP_STAGE_PRESOLVED
654  *       - \ref SCIP_STAGE_INITSOLVE
655  *       - \ref SCIP_STAGE_SOLVING
656  *       - \ref SCIP_STAGE_SOLVED
657  *       - \ref SCIP_STAGE_EXITSOLVE
658  *
659  *  See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
660  */
661 SCIP_EXPORT
662 SCIP_RETCODE SCIPgetLPI(
663    SCIP*                 scip,               /**< SCIP data structure */
664    SCIP_LPI**            lpi                 /**< pointer to store the LP interface */
665    );
666 
667 /** Displays quality information about the current LP solution. An LP solution need to be available. Information printed
668  *  is subject to what the LP solver supports
669  *
670  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
671  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
672  *
673  *  @pre This method can be called if @p scip is in one of the following stages:
674  *       - \ref SCIP_STAGE_INIT
675  *       - \ref SCIP_STAGE_PROBLEM
676  *       - \ref SCIP_STAGE_TRANSFORMED
677  *       - \ref SCIP_STAGE_INITPRESOLVE
678  *       - \ref SCIP_STAGE_PRESOLVING
679  *       - \ref SCIP_STAGE_EXITPRESOLVE
680  *       - \ref SCIP_STAGE_PRESOLVED
681  *       - \ref SCIP_STAGE_SOLVING
682  *       - \ref SCIP_STAGE_SOLVED
683  *       - \ref SCIP_STAGE_FREE
684  *
685  *  See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
686  *
687  *  @note The printing process is done via the message handler system.
688  */
689 SCIP_EXPORT
690 SCIP_RETCODE SCIPprintLPSolutionQuality(
691    SCIP*                 scip,               /**< SCIP data structure */
692    FILE*                 file                /**< output file (or NULL for standard output) */
693    );
694 
695 /** compute relative interior point to current LP
696  *  @see SCIPlpComputeRelIntPoint
697  *
698  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
699  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
700  *
701  *  @pre This method can be called if @p scip is in one of the following stages:
702  *       - \ref SCIP_STAGE_TRANSFORMED
703  *       - \ref SCIP_STAGE_INITPRESOLVE
704  *       - \ref SCIP_STAGE_PRESOLVING
705  *       - \ref SCIP_STAGE_EXITPRESOLVE
706  *       - \ref SCIP_STAGE_PRESOLVED
707  *       - \ref SCIP_STAGE_SOLVING
708  *       - \ref SCIP_STAGE_SOLVED
709  *
710  *  See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
711  */
712 SCIP_EXPORT
713 SCIP_RETCODE SCIPcomputeLPRelIntPoint(
714    SCIP*                 scip,               /**< SCIP data structure */
715    SCIP_Bool             relaxrows,          /**< should the rows be relaxed */
716    SCIP_Bool             inclobjcutoff,      /**< should a row for the objective cutoff be included */
717    SCIP_Real             timelimit,          /**< time limit for LP solver */
718    int                   iterlimit,          /**< iteration limit for LP solver */
719    SCIP_SOL**            point               /**< relative interior point on exit */
720    );
721 
722 /**@} */
723 
724 /**@addtogroup PublicColumnMethods
725  *
726  * @{
727  */
728 
729 /** returns the reduced costs of a column in the last (feasible) LP
730  *
731  *  @return the reduced costs of a column in the last (feasible) LP
732  *
733  *  @pre this method can be called in one of the following stages of the SCIP solving process:
734  *       - \ref SCIP_STAGE_SOLVING
735  *       - \ref SCIP_STAGE_SOLVED
736  *
737  *  @note calling this method in SCIP_STAGE_SOLVED is only recommended to experienced users and should only be called
738  *        for pure LP instances (without presolving)
739  *
740  *  @note The return value of this method should be used carefully if the dual feasibility check was explictely disabled.
741  */
742 SCIP_EXPORT
743 SCIP_Real SCIPgetColRedcost(
744    SCIP*                 scip,               /**< SCIP data structure */
745    SCIP_COL*             col                 /**< LP column */
746    );
747 
748 /** returns the Farkas coefficient of a column in the last (infeasible) LP
749  *
750  *  @return the Farkas coefficient of a column in the last (infeasible) LP
751  *
752  *  @pre this method can be called in one of the following stages of the SCIP solving process:
753  *       - \ref SCIP_STAGE_SOLVING
754  */
755 SCIP_EXPORT
756 SCIP_Real SCIPgetColFarkasCoef(
757    SCIP*                 scip,               /**< SCIP data structure */
758    SCIP_COL*             col                 /**< LP column */
759    );
760 
761 /** marks a column to be not removable from the LP in the current node
762  *
763  *  @pre this method can be called in the following stage of the SCIP solving process:
764  *       - \ref SCIP_STAGE_SOLVING
765  */
766 SCIP_EXPORT
767 void SCIPmarkColNotRemovableLocal(
768    SCIP*                 scip,               /**< SCIP data structure */
769    SCIP_COL*             col                 /**< LP column */
770    );
771 
772 /**@} */
773 
774 /**@addtogroup PublicRowMethods
775  *
776  * @{
777  */
778 
779 /** creates and captures an LP row from a constraint handler
780  *
781  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
782  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
783  *
784  *  @pre this method can be called in one of the following stages of the SCIP solving process:
785  *       - \ref SCIP_STAGE_INITSOLVE
786  *       - \ref SCIP_STAGE_SOLVING
787  */
788 SCIP_EXPORT
789 SCIP_RETCODE SCIPcreateRowConshdlr(
790    SCIP*                 scip,               /**< SCIP data structure */
791    SCIP_ROW**            row,                /**< pointer to row */
792    SCIP_CONSHDLR*        conshdlr,           /**< constraint handler that creates the row */
793    const char*           name,               /**< name of row */
794    int                   len,                /**< number of nonzeros in the row */
795    SCIP_COL**            cols,               /**< array with columns of row entries */
796    SCIP_Real*            vals,               /**< array with coefficients of row entries */
797    SCIP_Real             lhs,                /**< left hand side of row */
798    SCIP_Real             rhs,                /**< right hand side of row */
799    SCIP_Bool             local,              /**< is row only valid locally? */
800    SCIP_Bool             modifiable,         /**< is row modifiable during node processing (subject to column generation)? */
801    SCIP_Bool             removable           /**< should the row be removed from the LP due to aging or cleanup? */
802    );
803 
804 /** creates and captures an LP row from a constraint
805  *
806  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
807  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
808  *
809  *  @pre this method can be called in one of the following stages of the SCIP solving process:
810  *       - \ref SCIP_STAGE_INITSOLVE
811  *       - \ref SCIP_STAGE_SOLVING
812  */
813 SCIP_EXPORT
814 SCIP_RETCODE SCIPcreateRowCons(
815    SCIP*                 scip,               /**< SCIP data structure */
816    SCIP_ROW**            row,                /**< pointer to row */
817    SCIP_CONS*            cons,               /**< constraint that creates the row */
818    const char*           name,               /**< name of row */
819    int                   len,                /**< number of nonzeros in the row */
820    SCIP_COL**            cols,               /**< array with columns of row entries */
821    SCIP_Real*            vals,               /**< array with coefficients of row entries */
822    SCIP_Real             lhs,                /**< left hand side of row */
823    SCIP_Real             rhs,                /**< right hand side of row */
824    SCIP_Bool             local,              /**< is row only valid locally? */
825    SCIP_Bool             modifiable,         /**< is row modifiable during node processing (subject to column generation)? */
826    SCIP_Bool             removable           /**< should the row be removed from the LP due to aging or cleanup? */
827    );
828 
829 /** creates and captures an LP row from a separator
830  *
831  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
832  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
833  *
834  *  @pre this method can be called in one of the following stages of the SCIP solving process:
835  *       - \ref SCIP_STAGE_INITSOLVE
836  *       - \ref SCIP_STAGE_SOLVING
837  */
838 SCIP_EXPORT
839 SCIP_RETCODE SCIPcreateRowSepa(
840    SCIP*                 scip,               /**< SCIP data structure */
841    SCIP_ROW**            row,                /**< pointer to row */
842    SCIP_SEPA*            sepa,               /**< separator that creates the row */
843    const char*           name,               /**< name of row */
844    int                   len,                /**< number of nonzeros in the row */
845    SCIP_COL**            cols,               /**< array with columns of row entries */
846    SCIP_Real*            vals,               /**< array with coefficients of row entries */
847    SCIP_Real             lhs,                /**< left hand side of row */
848    SCIP_Real             rhs,                /**< right hand side of row */
849    SCIP_Bool             local,              /**< is row only valid locally? */
850    SCIP_Bool             modifiable,         /**< is row modifiable during node processing (subject to column generation)? */
851    SCIP_Bool             removable           /**< should the row be removed from the LP due to aging or cleanup? */
852    );
853 
854 /** creates and captures an LP row from an unspecified source
855  *
856  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
857  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
858  *
859  *  @pre this method can be called in one of the following stages of the SCIP solving process:
860  *       - \ref SCIP_STAGE_INITSOLVE
861  *       - \ref SCIP_STAGE_SOLVING
862  */
863 SCIP_EXPORT
864 SCIP_RETCODE SCIPcreateRowUnspec(
865    SCIP*                 scip,               /**< SCIP data structure */
866    SCIP_ROW**            row,                /**< pointer to row */
867    const char*           name,               /**< name of row */
868    int                   len,                /**< number of nonzeros in the row */
869    SCIP_COL**            cols,               /**< array with columns of row entries */
870    SCIP_Real*            vals,               /**< array with coefficients of row entries */
871    SCIP_Real             lhs,                /**< left hand side of row */
872    SCIP_Real             rhs,                /**< right hand side of row */
873    SCIP_Bool             local,              /**< is row only valid locally? */
874    SCIP_Bool             modifiable,         /**< is row modifiable during node processing (subject to column generation)? */
875    SCIP_Bool             removable           /**< should the row be removed from the LP due to aging or cleanup? */
876    );
877 
878 /** creates and captures an LP row
879  *
880  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
881  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
882  *
883  *  @pre this method can be called in one of the following stages of the SCIP solving process:
884  *       - \ref SCIP_STAGE_INITSOLVE
885  *       - \ref SCIP_STAGE_SOLVING
886  *
887  *  @deprecated Please use SCIPcreateRowConshdlr() or SCIPcreateRowSepa() when calling from a constraint handler or separator in order
888  *              to facilitate correct statistics. If the call is from neither a constraint handler or separator, use SCIPcreateRowUnspec().
889  */
890 SCIP_EXPORT
891 SCIP_DEPRECATED
892 SCIP_RETCODE SCIPcreateRow(
893    SCIP*                 scip,               /**< SCIP data structure */
894    SCIP_ROW**            row,                /**< pointer to row */
895    const char*           name,               /**< name of row */
896    int                   len,                /**< number of nonzeros in the row */
897    SCIP_COL**            cols,               /**< array with columns of row entries */
898    SCIP_Real*            vals,               /**< array with coefficients of row entries */
899    SCIP_Real             lhs,                /**< left hand side of row */
900    SCIP_Real             rhs,                /**< right hand side of row */
901    SCIP_Bool             local,              /**< is row only valid locally? */
902    SCIP_Bool             modifiable,         /**< is row modifiable during node processing (subject to column generation)? */
903    SCIP_Bool             removable           /**< should the row be removed from the LP due to aging or cleanup? */
904    );
905 
906 /** creates and captures an LP row without any coefficients from a constraint handler
907  *
908  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
909  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
910  *
911  *  @pre this method can be called in one of the following stages of the SCIP solving process:
912  *       - \ref SCIP_STAGE_INITSOLVE
913  *       - \ref SCIP_STAGE_SOLVING
914  */
915 SCIP_EXPORT
916 SCIP_RETCODE SCIPcreateEmptyRowConshdlr(
917    SCIP*                 scip,               /**< SCIP data structure */
918    SCIP_ROW**            row,                /**< pointer to row */
919    SCIP_CONSHDLR*        conshdlr,           /**< constraint handler that creates the row */
920    const char*           name,               /**< name of row */
921    SCIP_Real             lhs,                /**< left hand side of row */
922    SCIP_Real             rhs,                /**< right hand side of row */
923    SCIP_Bool             local,              /**< is row only valid locally? */
924    SCIP_Bool             modifiable,         /**< is row modifiable during node processing (subject to column generation)? */
925    SCIP_Bool             removable           /**< should the row be removed from the LP due to aging or cleanup? */
926    );
927 
928 /** creates and captures an LP row without any coefficients from a constraint
929  *
930  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
931  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
932  *
933  *  @pre this method can be called in one of the following stages of the SCIP solving process:
934  *       - \ref SCIP_STAGE_INITSOLVE
935  *       - \ref SCIP_STAGE_SOLVING
936  */
937 SCIP_EXPORT
938 SCIP_RETCODE SCIPcreateEmptyRowCons(
939    SCIP*                 scip,               /**< SCIP data structure */
940    SCIP_ROW**            row,                /**< pointer to row */
941    SCIP_CONS*            cons,               /**< constraint that creates the row */
942    const char*           name,               /**< name of row */
943    SCIP_Real             lhs,                /**< left hand side of row */
944    SCIP_Real             rhs,                /**< right hand side of row */
945    SCIP_Bool             local,              /**< is row only valid locally? */
946    SCIP_Bool             modifiable,         /**< is row modifiable during node processing (subject to column generation)? */
947    SCIP_Bool             removable           /**< should the row be removed from the LP due to aging or cleanup? */
948    );
949 
950 /** creates and captures an LP row without any coefficients from a separator
951  *
952  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
953  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
954  *
955  *  @pre this method can be called in one of the following stages of the SCIP solving process:
956  *       - \ref SCIP_STAGE_INITSOLVE
957  *       - \ref SCIP_STAGE_SOLVING
958  */
959 SCIP_EXPORT
960 SCIP_RETCODE SCIPcreateEmptyRowSepa(
961    SCIP*                 scip,               /**< SCIP data structure */
962    SCIP_ROW**            row,                /**< pointer to row */
963    SCIP_SEPA*            sepa,               /**< separator that creates the row */
964    const char*           name,               /**< name of row */
965    SCIP_Real             lhs,                /**< left hand side of row */
966    SCIP_Real             rhs,                /**< right hand side of row */
967    SCIP_Bool             local,              /**< is row only valid locally? */
968    SCIP_Bool             modifiable,         /**< is row modifiable during node processing (subject to column generation)? */
969    SCIP_Bool             removable           /**< should the row be removed from the LP due to aging or cleanup? */
970    );
971 
972 /** creates and captures an LP row without any coefficients from an unspecified source
973  *
974  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
975  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
976  *
977  *  @pre this method can be called in one of the following stages of the SCIP solving process:
978  *       - \ref SCIP_STAGE_INITSOLVE
979  *       - \ref SCIP_STAGE_SOLVING
980  */
981 SCIP_EXPORT
982 SCIP_RETCODE SCIPcreateEmptyRowUnspec(
983    SCIP*                 scip,               /**< SCIP data structure */
984    SCIP_ROW**            row,                /**< pointer to row */
985    const char*           name,               /**< name of row */
986    SCIP_Real             lhs,                /**< left hand side of row */
987    SCIP_Real             rhs,                /**< right hand side of row */
988    SCIP_Bool             local,              /**< is row only valid locally? */
989    SCIP_Bool             modifiable,         /**< is row modifiable during node processing (subject to column generation)? */
990    SCIP_Bool             removable           /**< should the row be removed from the LP due to aging or cleanup? */
991    );
992 
993 /** creates and captures an LP row without any coefficients
994  *
995  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
996  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
997  *
998  *  @pre this method can be called in one of the following stages of the SCIP solving process:
999  *       - \ref SCIP_STAGE_INITSOLVE
1000  *       - \ref SCIP_STAGE_SOLVING
1001  *
1002  *  @deprecated Please use SCIPcreateEmptyRowConshdlr() or SCIPcreateEmptyRowSepa() when calling from a constraint handler or separator in order
1003  *              to facilitate correct statistics. If the call is from neither a constraint handler or separator, use SCIPcreateEmptyRowUnspec().
1004  */
1005 SCIP_EXPORT
1006 SCIP_DEPRECATED
1007 SCIP_RETCODE SCIPcreateEmptyRow(
1008    SCIP*                 scip,               /**< SCIP data structure */
1009    SCIP_ROW**            row,                /**< pointer to row */
1010    const char*           name,               /**< name of row */
1011    SCIP_Real             lhs,                /**< left hand side of row */
1012    SCIP_Real             rhs,                /**< right hand side of row */
1013    SCIP_Bool             local,              /**< is row only valid locally? */
1014    SCIP_Bool             modifiable,         /**< is row modifiable during node processing (subject to column generation)? */
1015    SCIP_Bool             removable           /**< should the row be removed from the LP due to aging or cleanup? */
1016    );
1017 
1018 /** increases usage counter of LP row
1019  *
1020  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1021  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1022  *
1023  *  @pre this method can be called in one of the following stages of the SCIP solving process:
1024  *       - \ref SCIP_STAGE_INITSOLVE
1025  *       - \ref SCIP_STAGE_SOLVING
1026  */
1027 SCIP_EXPORT
1028 SCIP_RETCODE SCIPcaptureRow(
1029    SCIP*                 scip,               /**< SCIP data structure */
1030    SCIP_ROW*             row                 /**< row to capture */
1031    );
1032 
1033 /** decreases usage counter of LP row, and frees memory if necessary
1034  *
1035  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1036  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1037  *
1038  *  @pre this method can be called in one of the following stages of the SCIP solving process:
1039  *       - \ref SCIP_STAGE_INITSOLVE
1040  *       - \ref SCIP_STAGE_SOLVING
1041  *       - \ref SCIP_STAGE_EXITSOLVE
1042  */
1043 SCIP_EXPORT
1044 SCIP_RETCODE SCIPreleaseRow(
1045    SCIP*                 scip,               /**< SCIP data structure */
1046    SCIP_ROW**            row                 /**< pointer to LP row */
1047    );
1048 
1049 /** changes left hand side of LP row
1050  *
1051  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1052  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1053  *
1054  *  @pre this method can be called in one of the following stages of the SCIP solving process:
1055  *       - \ref SCIP_STAGE_INITSOLVE
1056  *       - \ref SCIP_STAGE_SOLVING
1057  */
1058 SCIP_EXPORT
1059 SCIP_RETCODE SCIPchgRowLhs(
1060    SCIP*                 scip,               /**< SCIP data structure */
1061    SCIP_ROW*             row,                /**< LP row */
1062    SCIP_Real             lhs                 /**< new left hand side */
1063    );
1064 
1065 /** changes right hand side of LP row
1066  *
1067  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1068  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1069  *
1070  *  @pre this method can be called in one of the following stages of the SCIP solving process:
1071  *       - \ref SCIP_STAGE_INITSOLVE
1072  *       - \ref SCIP_STAGE_SOLVING
1073  */
1074 SCIP_EXPORT
1075 SCIP_RETCODE SCIPchgRowRhs(
1076    SCIP*                 scip,               /**< SCIP data structure */
1077    SCIP_ROW*             row,                /**< LP row */
1078    SCIP_Real             rhs                 /**< new right hand side */
1079    );
1080 
1081 /** informs row, that all subsequent additions of variables to the row should be cached and not directly applied;
1082  *  after all additions were applied, SCIPflushRowExtensions() must be called;
1083  *  while the caching of row extensions is activated, information methods of the row give invalid results;
1084  *  caching should be used, if a row is build with SCIPaddVarToRow() calls variable by variable to increase
1085  *  the performance
1086  *
1087  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1088  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1089  *
1090  *  @pre this method can be called in one of the following stages of the SCIP solving process:
1091  *       - \ref SCIP_STAGE_INITSOLVE
1092  *       - \ref SCIP_STAGE_SOLVING
1093  */
1094 SCIP_EXPORT
1095 SCIP_RETCODE SCIPcacheRowExtensions(
1096    SCIP*                 scip,               /**< SCIP data structure */
1097    SCIP_ROW*             row                 /**< LP row */
1098    );
1099 
1100 /** flushes all cached row extensions after a call of SCIPcacheRowExtensions() and merges coefficients with
1101  *  equal columns into a single coefficient
1102  *
1103  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1104  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1105  *
1106  *  @pre this method can be called in one of the following stages of the SCIP solving process:
1107  *       - \ref SCIP_STAGE_INITSOLVE
1108  *       - \ref SCIP_STAGE_SOLVING
1109  */
1110 SCIP_EXPORT
1111 SCIP_RETCODE SCIPflushRowExtensions(
1112    SCIP*                 scip,               /**< SCIP data structure */
1113    SCIP_ROW*             row                 /**< LP row */
1114    );
1115 
1116 /** resolves variable to columns and adds them with the coefficient to the row
1117  *
1118  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1119  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1120  *
1121  *  @attention If the absolute value of val is below the SCIP epsilon tolerance, the variable will not added.
1122  *
1123  *  @pre this method can be called in one of the following stages of the SCIP solving process:
1124  *       - \ref SCIP_STAGE_INITSOLVE
1125  *       - \ref SCIP_STAGE_SOLVING
1126  *
1127  *  @note In case calling this method in the enforcement process of an lp solution, it might be that some variables,
1128  *        that were not yet in the LP (e.g. dynamic columns) will change their lp solution value returned by SCIP.
1129  *        For example, a variable, which has a negative objective value, that has no column in the lp yet, is in the lp solution
1130  *        on its upper bound (variables with status SCIP_VARSTATUS_LOOSE are in an lp solution on it's best bound), but
1131  *        creating the column, changes the solution value (variable than has status SCIP_VARSTATUS_COLUMN, and the
1132  *        initialization sets the lp solution value) to 0.0. (This leads to the conclusion that, if a constraint was
1133  *        violated, the linear relaxation might not be violated anymore.)
1134  */
1135 SCIP_EXPORT
1136 SCIP_RETCODE SCIPaddVarToRow(
1137    SCIP*                 scip,               /**< SCIP data structure */
1138    SCIP_ROW*             row,                /**< LP row */
1139    SCIP_VAR*             var,                /**< problem variable */
1140    SCIP_Real             val                 /**< value of coefficient */
1141    );
1142 
1143 /** resolves variables to columns and adds them with the coefficients to the row;
1144  *  this method caches the row extensions and flushes them afterwards to gain better performance
1145  *
1146  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1147  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1148  *
1149  *  @attention If a coefficients absolute value is below the SCIP epsilon tolerance, the variable with its value is not added.
1150  *
1151  *  @pre this method can be called in one of the following stages of the SCIP solving process:
1152  *       - \ref SCIP_STAGE_INITSOLVE
1153  *       - \ref SCIP_STAGE_SOLVING
1154  */
1155 SCIP_EXPORT
1156 SCIP_RETCODE SCIPaddVarsToRow(
1157    SCIP*                 scip,               /**< SCIP data structure */
1158    SCIP_ROW*             row,                /**< LP row */
1159    int                   nvars,              /**< number of variables to add to the row */
1160    SCIP_VAR**            vars,               /**< problem variables to add */
1161    SCIP_Real*            vals                /**< values of coefficients */
1162    );
1163 
1164 /** resolves variables to columns and adds them with the same single coefficient to the row;
1165  *  this method caches the row extensions and flushes them afterwards to gain better performance
1166  *
1167  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1168  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1169  *
1170  *  @attention If the absolute value of val is below the SCIP epsilon tolerance, the variables will not added.
1171  *
1172  *  @pre this method can be called in one of the following stages of the SCIP solving process:
1173  *       - \ref SCIP_STAGE_INITSOLVE
1174  *       - \ref SCIP_STAGE_SOLVING
1175  */
1176 SCIP_EXPORT
1177 SCIP_RETCODE SCIPaddVarsToRowSameCoef(
1178    SCIP*                 scip,               /**< SCIP data structure */
1179    SCIP_ROW*             row,                /**< LP row */
1180    int                   nvars,              /**< number of variables to add to the row */
1181    SCIP_VAR**            vars,               /**< problem variables to add */
1182    SCIP_Real             val                 /**< unique value of all coefficients */
1183    );
1184 
1185 /** tries to find a value, such that all row coefficients, if scaled with this value become integral
1186  *
1187  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1188  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1189  *
1190  *  @pre this method can be called in one of the following stages of the SCIP solving process:
1191  *       - \ref SCIP_STAGE_INITSOLVE
1192  *       - \ref SCIP_STAGE_SOLVING
1193  */
1194 SCIP_EXPORT
1195 SCIP_RETCODE SCIPcalcRowIntegralScalar(
1196    SCIP*                 scip,               /**< SCIP data structure */
1197    SCIP_ROW*             row,                /**< LP row */
1198    SCIP_Real             mindelta,           /**< minimal relative allowed difference of scaled coefficient s*c and integral i */
1199    SCIP_Real             maxdelta,           /**< maximal relative allowed difference of scaled coefficient s*c and integral i */
1200    SCIP_Longint          maxdnom,            /**< maximal denominator allowed in rational numbers */
1201    SCIP_Real             maxscale,           /**< maximal allowed scalar */
1202    SCIP_Bool             usecontvars,        /**< should the coefficients of the continuous variables also be made integral? */
1203    SCIP_Real*            intscalar,          /**< pointer to store scalar that would make the coefficients integral, or NULL */
1204    SCIP_Bool*            success             /**< stores whether returned value is valid */
1205    );
1206 
1207 /** tries to scale row, s.t. all coefficients (of integer variables) become integral
1208  *
1209  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1210  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1211  *
1212  *  @pre this method can be called in one of the following stages of the SCIP solving process:
1213  *       - \ref SCIP_STAGE_INITSOLVE
1214  *       - \ref SCIP_STAGE_SOLVING
1215  */
1216 SCIP_EXPORT
1217 SCIP_RETCODE SCIPmakeRowIntegral(
1218    SCIP*                 scip,               /**< SCIP data structure */
1219    SCIP_ROW*             row,                /**< LP row */
1220    SCIP_Real             mindelta,           /**< minimal relative allowed difference of scaled coefficient s*c and integral i */
1221    SCIP_Real             maxdelta,           /**< maximal relative allowed difference of scaled coefficient s*c and integral i */
1222    SCIP_Longint          maxdnom,            /**< maximal denominator allowed in rational numbers */
1223    SCIP_Real             maxscale,           /**< maximal value to scale row with */
1224    SCIP_Bool             usecontvars,        /**< should the coefficients of the continuous variables also be made integral? */
1225    SCIP_Bool*            success             /**< stores whether row could be made rational */
1226    );
1227 
1228 /** marks a row to be not removable from the LP in the current node
1229  *
1230  *  @pre this method can be called in the following stage of the SCIP solving process:
1231  *       - \ref SCIP_STAGE_SOLVING
1232  */
1233 SCIP_EXPORT
1234 void SCIPmarkRowNotRemovableLocal(
1235    SCIP*                 scip,               /**< SCIP data structure */
1236    SCIP_ROW*             row                 /**< LP row */
1237    );
1238 
1239 /** returns number of integral columns in the row
1240  *
1241  *  @return number of integral columns in the row
1242  *
1243  *  @pre this method can be called in one of the following stages of the SCIP solving process:
1244  *       - \ref SCIP_STAGE_INITSOLVE
1245  *       - \ref SCIP_STAGE_SOLVING
1246  */
1247 SCIP_EXPORT
1248 int SCIPgetRowNumIntCols(
1249    SCIP*                 scip,               /**< SCIP data structure */
1250    SCIP_ROW*             row                 /**< LP row */
1251    );
1252 
1253 /** returns minimal absolute value of row vector's non-zero coefficients
1254  *
1255  *  @return minimal absolute value of row vector's non-zero coefficients
1256  *
1257  *  @pre this method can be called in one of the following stages of the SCIP solving process:
1258  *       - \ref SCIP_STAGE_INITSOLVE
1259  *       - \ref SCIP_STAGE_SOLVING
1260  */
1261 SCIP_EXPORT
1262 SCIP_Real SCIPgetRowMinCoef(
1263    SCIP*                 scip,               /**< SCIP data structure */
1264    SCIP_ROW*             row                 /**< LP row */
1265    );
1266 
1267 /** returns maximal absolute value of row vector's non-zero coefficients
1268  *
1269  *  @return maximal absolute value of row vector's non-zero coefficients
1270  *
1271  *  @pre this method can be called in one of the following stages of the SCIP solving process:
1272  *       - \ref SCIP_STAGE_INITSOLVE
1273  *       - \ref SCIP_STAGE_SOLVING
1274  */
1275 SCIP_EXPORT
1276 SCIP_Real SCIPgetRowMaxCoef(
1277    SCIP*                 scip,               /**< SCIP data structure */
1278    SCIP_ROW*             row                 /**< LP row */
1279    );
1280 
1281 /** returns the minimal activity of a row w.r.t. the column's bounds
1282  *
1283  *  @return the minimal activity of a row w.r.t. the column's bounds
1284  *
1285  *  @pre this method can be called in one of the following stages of the SCIP solving process:
1286  *       - \ref SCIP_STAGE_SOLVING
1287  */
1288 SCIP_EXPORT
1289 SCIP_Real SCIPgetRowMinActivity(
1290    SCIP*                 scip,               /**< SCIP data structure */
1291    SCIP_ROW*             row                 /**< LP row */
1292    );
1293 
1294 /** returns the maximal activity of a row w.r.t. the column's bounds
1295  *
1296  *  @return the maximal activity of a row w.r.t. the column's bounds
1297  *
1298  *  @pre this method can be called in one of the following stages of the SCIP solving process:
1299  *       - \ref SCIP_STAGE_SOLVING
1300  */
1301 SCIP_EXPORT
1302 SCIP_Real SCIPgetRowMaxActivity(
1303    SCIP*                 scip,               /**< SCIP data structure */
1304    SCIP_ROW*             row                 /**< LP row */
1305    );
1306 
1307 /** recalculates the activity of a row in the last LP solution
1308  *
1309  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1310  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1311  *
1312  *  @pre this method can be called in one of the following stages of the SCIP solving process:
1313  *       - \ref SCIP_STAGE_SOLVING
1314  */
1315 SCIP_EXPORT
1316 SCIP_RETCODE SCIPrecalcRowLPActivity(
1317    SCIP*                 scip,               /**< SCIP data structure */
1318    SCIP_ROW*             row                 /**< LP row */
1319    );
1320 
1321 /** returns the activity of a row in the last LP solution
1322  *
1323  *  @return activity of a row in the last LP solution
1324  *
1325  *  @pre this method can be called in one of the following stages of the SCIP solving process:
1326  *       - \ref SCIP_STAGE_SOLVING
1327  */
1328 SCIP_EXPORT
1329 SCIP_Real SCIPgetRowLPActivity(
1330    SCIP*                 scip,               /**< SCIP data structure */
1331    SCIP_ROW*             row                 /**< LP row */
1332    );
1333 
1334 /** returns the feasibility of a row in the last LP solution
1335  *
1336  *  @return the feasibility of a row in the last LP solution: negative value means infeasibility
1337  *
1338  *  @pre this method can be called in one of the following stages of the SCIP solving process:
1339  *       - \ref SCIP_STAGE_SOLVING
1340  */
1341 SCIP_EXPORT
1342 SCIP_Real SCIPgetRowLPFeasibility(
1343    SCIP*                 scip,               /**< SCIP data structure */
1344    SCIP_ROW*             row                 /**< LP row */
1345    );
1346 
1347 /** recalculates the activity of a row for the current pseudo solution
1348  *
1349  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1350  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1351  *
1352  *  @pre this method can be called in one of the following stages of the SCIP solving process:
1353  *       - \ref SCIP_STAGE_SOLVING
1354  */
1355 SCIP_EXPORT
1356 SCIP_RETCODE SCIPrecalcRowPseudoActivity(
1357    SCIP*                 scip,               /**< SCIP data structure */
1358    SCIP_ROW*             row                 /**< LP row */
1359    );
1360 
1361 /** returns the activity of a row for the current pseudo solution
1362  *
1363  *  @return the activity of a row for the current pseudo solution
1364  *
1365  *  @pre this method can be called in one of the following stages of the SCIP solving process:
1366  *       - \ref SCIP_STAGE_SOLVING
1367  */
1368 SCIP_EXPORT
1369 SCIP_Real SCIPgetRowPseudoActivity(
1370    SCIP*                 scip,               /**< SCIP data structure */
1371    SCIP_ROW*             row                 /**< LP row */
1372    );
1373 
1374 /** returns the feasibility of a row for the current pseudo solution: negative value means infeasibility
1375  *
1376  *  @return the feasibility of a row for the current pseudo solution: negative value means infeasibility
1377  *
1378  *  @pre this method can be called in one of the following stages of the SCIP solving process:
1379  *       - \ref SCIP_STAGE_SOLVING
1380  */
1381 SCIP_EXPORT
1382 SCIP_Real SCIPgetRowPseudoFeasibility(
1383    SCIP*                 scip,               /**< SCIP data structure */
1384    SCIP_ROW*             row                 /**< LP row */
1385    );
1386 
1387 /** recalculates the activity of a row in the last LP or pseudo solution
1388  *
1389  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1390  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1391  *
1392  *  @pre this method can be called in one of the following stages of the SCIP solving process:
1393  *       - \ref SCIP_STAGE_SOLVING
1394  */
1395 SCIP_EXPORT
1396 SCIP_RETCODE SCIPrecalcRowActivity(
1397    SCIP*                 scip,               /**< SCIP data structure */
1398    SCIP_ROW*             row                 /**< LP row */
1399    );
1400 
1401 /** returns the activity of a row in the last LP or pseudo solution
1402  *
1403  *  @return the activity of a row in the last LP or pseudo solution
1404  *
1405  *  @pre this method can be called in one of the following stages of the SCIP solving process:
1406  *       - \ref SCIP_STAGE_SOLVING
1407  */
1408 SCIP_EXPORT
1409 SCIP_Real SCIPgetRowActivity(
1410    SCIP*                 scip,               /**< SCIP data structure */
1411    SCIP_ROW*             row                 /**< LP row */
1412    );
1413 
1414 /** returns the feasibility of a row in the last LP or pseudo solution
1415  *
1416  *  @return the feasibility of a row in the last LP or pseudo solution
1417  *
1418  *  @pre this method can be called in one of the following stages of the SCIP solving process:
1419  *       - \ref SCIP_STAGE_SOLVING
1420  */
1421 SCIP_EXPORT
1422 SCIP_Real SCIPgetRowFeasibility(
1423    SCIP*                 scip,               /**< SCIP data structure */
1424    SCIP_ROW*             row                 /**< LP row */
1425    );
1426 
1427 /** returns the activity of a row for the given primal solution
1428  *
1429  *  @return the activitiy of a row for the given primal solution
1430  *
1431  *  @pre this method can be called in one of the following stages of the SCIP solving process:
1432  *       - \ref SCIP_STAGE_SOLVING
1433  */
1434 SCIP_EXPORT
1435 SCIP_Real SCIPgetRowSolActivity(
1436    SCIP*                 scip,               /**< SCIP data structure */
1437    SCIP_ROW*             row,                /**< LP row */
1438    SCIP_SOL*             sol                 /**< primal CIP solution */
1439    );
1440 
1441 /** returns the feasibility of a row for the given primal solution
1442  *
1443  *  @return the feasibility of a row for the given primal solution
1444  *
1445  *  @pre this method can be called in one of the following stages of the SCIP solving process:
1446  *       - \ref SCIP_STAGE_SOLVING
1447  */
1448 SCIP_EXPORT
1449 SCIP_Real SCIPgetRowSolFeasibility(
1450    SCIP*                 scip,               /**< SCIP data structure */
1451    SCIP_ROW*             row,                /**< LP row */
1452    SCIP_SOL*             sol                 /**< primal CIP solution */
1453    );
1454 
1455 /** returns the parallelism of row with objective function
1456  *
1457  *  @return 1 is returned if the row is parallel to the objective function and 0 if it is orthogonal
1458  *
1459  *  @pre this method can be called in one of the following stages of the SCIP solving process:
1460  *       - \ref SCIP_STAGE_SOLVING
1461  */
1462 SCIP_EXPORT
1463 SCIP_Real SCIPgetRowObjParallelism(
1464    SCIP*                 scip,               /**< SCIP data structure */
1465    SCIP_ROW*             row                 /**< LP row */
1466    );
1467 
1468 /** output row to file stream via the message handler system
1469  *
1470  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1471  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1472  *
1473  *  @pre this method can be called in one of the following stages of the SCIP solving process:
1474  *       - \ref SCIP_STAGE_INITSOLVE
1475  *       - \ref SCIP_STAGE_SOLVING
1476  *       - \ref SCIP_STAGE_SOLVED
1477  *       - \ref SCIP_STAGE_EXITSOLVE
1478  */
1479 SCIP_EXPORT
1480 SCIP_RETCODE SCIPprintRow(
1481    SCIP*                 scip,               /**< SCIP data structure */
1482    SCIP_ROW*             row,                /**< LP row */
1483    FILE*                 file                /**< output file (or NULL for standard output) */
1484    );
1485 
1486 /**@} */
1487 
1488 /**@addtogroup PublicLPDivingMethods
1489  *
1490  * @{
1491  */
1492 
1493 /** initiates LP diving, making methods SCIPchgVarObjDive(), SCIPchgVarLbDive(), and SCIPchgVarUbDive() available
1494  *
1495  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1496  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1497  *
1498  *  @pre This method can be called if @p scip is in one of the following stages:
1499  *       - \ref SCIP_STAGE_SOLVING
1500  *
1501  *  See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
1502  *
1503  *  @note diving is allowed even if the current LP is not flushed, not solved, or not solved to optimality; be aware
1504  *  that solving the (first) diving LP may take longer than expect and that the latter two cases could stem from
1505  *  numerical troubles during the last LP solve; because of this, most users will want to call this method only if
1506  *  SCIPgetLPSolstat(scip) == SCIP_LPSOLSTAT_OPTIMAL
1507  */
1508 SCIP_EXPORT
1509 SCIP_RETCODE SCIPstartDive(
1510    SCIP*                 scip                /**< SCIP data structure */
1511    );
1512 
1513 /** quits LP diving and resets bounds and objective values of columns to the current node's values
1514  *
1515  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1516  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1517  *
1518  *  @pre This method can be called if @p scip is in one of the following stages:
1519  *       - \ref SCIP_STAGE_SOLVING
1520  *
1521  *  See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
1522  */
1523 SCIP_EXPORT
1524 SCIP_RETCODE SCIPendDive(
1525    SCIP*                 scip                /**< SCIP data structure */
1526    );
1527 
1528 /** changes cutoffbound in current dive
1529  *
1530  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1531  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1532  *
1533  *  @pre This method can be called if @p scip is in one of the following stages:
1534  *       - \ref SCIP_STAGE_SOLVING
1535  *
1536  *  See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
1537  */
1538 SCIP_EXPORT
1539 SCIP_RETCODE SCIPchgCutoffboundDive(
1540    SCIP*                 scip,               /**< SCIP data structure */
1541    SCIP_Real             newcutoffbound      /**< new cutoffbound */
1542    );
1543 
1544 /** changes variable's objective value in current dive
1545  *
1546  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1547  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1548  *
1549  *  @pre This method can be called if @p scip is in one of the following stages:
1550  *       - \ref SCIP_STAGE_SOLVING
1551  *
1552  *  See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
1553  */
1554 SCIP_EXPORT
1555 SCIP_RETCODE SCIPchgVarObjDive(
1556    SCIP*                 scip,               /**< SCIP data structure */
1557    SCIP_VAR*             var,                /**< variable to change the objective value for */
1558    SCIP_Real             newobj              /**< new objective value */
1559    );
1560 
1561 /** changes variable's lower bound in current dive
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 if @p scip is in one of the following stages:
1567  *       - \ref SCIP_STAGE_SOLVING
1568  *
1569  *  See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
1570  */
1571 SCIP_EXPORT
1572 SCIP_RETCODE SCIPchgVarLbDive(
1573    SCIP*                 scip,               /**< SCIP data structure */
1574    SCIP_VAR*             var,                /**< variable to change the bound for */
1575    SCIP_Real             newbound            /**< new value for bound */
1576    );
1577 
1578 /** changes variable's upper bound in current dive
1579  *
1580  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1581  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1582  *
1583  *  @pre This method can be called if @p scip is in one of the following stages:
1584  *       - \ref SCIP_STAGE_SOLVING
1585  *
1586  *  See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
1587  */
1588 SCIP_EXPORT
1589 SCIP_RETCODE SCIPchgVarUbDive(
1590    SCIP*                 scip,               /**< SCIP data structure */
1591    SCIP_VAR*             var,                /**< variable to change the bound for */
1592    SCIP_Real             newbound            /**< new value for bound */
1593    );
1594 
1595 /** adds a row to the LP in current dive
1596  *
1597  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1598  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1599  *
1600  *  @pre This method can be called if @p scip is in one of the following stages:
1601  *       - \ref SCIP_STAGE_SOLVING
1602  *
1603  *  See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
1604  */
1605 SCIP_EXPORT
1606 SCIP_RETCODE SCIPaddRowDive(
1607    SCIP*                 scip,               /**< SCIP data structure */
1608    SCIP_ROW*             row                 /**< row to be added */
1609    );
1610 
1611 /** changes row lhs in current dive, change will be undone after diving ends, for permanent changes use SCIPchgRowLhs()
1612  *
1613  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1614  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1615  *
1616  *  @pre This method can be called if @p scip is in one of the following stages:
1617  *       - \ref SCIP_STAGE_SOLVING
1618  *
1619  *  See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
1620  */
1621 SCIP_EXPORT
1622 SCIP_RETCODE SCIPchgRowLhsDive(
1623    SCIP*                 scip,               /**< SCIP data structure */
1624    SCIP_ROW*             row,                /**< row to change the lhs for */
1625    SCIP_Real             newlhs              /**< new value for lhs */
1626    );
1627 
1628 /** changes row rhs in current dive, change will be undone after diving ends, for permanent changes use SCIPchgRowRhs()
1629  *
1630  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1631  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1632  *
1633  *  @pre This method can be called if @p scip is in one of the following stages:
1634  *       - \ref SCIP_STAGE_SOLVING
1635  *
1636  *  See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
1637  */
1638 SCIP_EXPORT
1639 SCIP_RETCODE SCIPchgRowRhsDive(
1640    SCIP*                 scip,               /**< SCIP data structure */
1641    SCIP_ROW*             row,                /**< row to change the lhs for */
1642    SCIP_Real             newrhs              /**< new value for rhs */
1643    );
1644 
1645 /** gets variable's objective value in current dive
1646  *
1647  *  @return the variable's objective value in current dive.
1648  *
1649  *  @pre This method can be called if @p scip is in one of the following stages:
1650  *       - \ref SCIP_STAGE_SOLVING
1651  *
1652  *  See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
1653  */
1654 SCIP_EXPORT
1655 SCIP_Real SCIPgetVarObjDive(
1656    SCIP*                 scip,               /**< SCIP data structure */
1657    SCIP_VAR*             var                 /**< variable to get the bound for */
1658    );
1659 
1660 /** gets variable's lower bound in current dive
1661  *
1662  *  @return the variable's lower bound in current dive.
1663  *
1664  *  @pre This method can be called if @p scip is in one of the following stages:
1665  *       - \ref SCIP_STAGE_SOLVING
1666  *
1667  *  See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
1668  */
1669 SCIP_EXPORT
1670 SCIP_Real SCIPgetVarLbDive(
1671    SCIP*                 scip,               /**< SCIP data structure */
1672    SCIP_VAR*             var                 /**< variable to get the bound for */
1673    );
1674 
1675 /** gets variable's upper bound in current dive
1676  *
1677  *  @return the variable's upper bound in current dive.
1678  *
1679  *  @pre This method can be called if @p scip is in one of the following stages:
1680  *       - \ref SCIP_STAGE_SOLVING
1681  *
1682  *  See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
1683  */
1684 SCIP_EXPORT
1685 SCIP_Real SCIPgetVarUbDive(
1686    SCIP*                 scip,               /**< SCIP data structure */
1687    SCIP_VAR*             var                 /**< variable to get the bound for */
1688    );
1689 /** solves the LP of the current dive; no separation or pricing is applied
1690  *
1691  *  @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1692  *          SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
1693  *
1694  *  @pre This method can be called if @p scip is in one of the following stages:
1695  *       - \ref SCIP_STAGE_SOLVING
1696  *
1697  *  See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
1698  *
1699  *  @note be aware that the LP solve may take longer than expected if SCIPgetLPSolstat(scip) != SCIP_LPSOLSTAT_OPTIMAL,
1700  *  compare the explanation of SCIPstartDive()
1701  */
1702 SCIP_EXPORT
1703 SCIP_RETCODE SCIPsolveDiveLP(
1704    SCIP*                 scip,               /**< SCIP data structure */
1705    int                   itlim,              /**< maximal number of LP iterations to perform, or -1 for no limit */
1706    SCIP_Bool*            lperror,            /**< pointer to store whether an unresolved LP error occurred */
1707    SCIP_Bool*            cutoff              /**< pointer to store whether the diving LP was infeasible or the objective
1708                                               *   limit was reached (or NULL, if not needed) */
1709    );
1710 
1711 /** returns the number of the node in the current branch and bound run, where the last LP was solved in diving
1712  *  or probing mode
1713  *
1714  *  @return the number of the node in the current branch and bound run, where the last LP was solved in diving
1715  *  or probing mode.
1716  *
1717  *  @pre This method can be called if @p scip is in one of the following stages:
1718  *       - \ref SCIP_STAGE_TRANSFORMING
1719  *       - \ref SCIP_STAGE_TRANSFORMED
1720  *       - \ref SCIP_STAGE_INITPRESOLVE
1721  *       - \ref SCIP_STAGE_PRESOLVING
1722  *       - \ref SCIP_STAGE_EXITPRESOLVE
1723  *       - \ref SCIP_STAGE_PRESOLVED
1724  *       - \ref SCIP_STAGE_INITSOLVE
1725  *       - \ref SCIP_STAGE_SOLVING
1726  *       - \ref SCIP_STAGE_SOLVED
1727  *       - \ref SCIP_STAGE_EXITSOLVE
1728  *       - \ref SCIP_STAGE_FREETRANS
1729  *
1730  *  See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
1731  */
1732 SCIP_EXPORT
1733 SCIP_Longint SCIPgetLastDivenode(
1734    SCIP*                 scip                /**< SCIP data structure */
1735    );
1736 
1737 /** returns whether we are in diving mode
1738  *
1739  *  @return whether we are in diving mode.
1740  *
1741  *  @pre This method can be called if @p scip is in one of the following stages:
1742  *       - \ref SCIP_STAGE_TRANSFORMING
1743  *       - \ref SCIP_STAGE_TRANSFORMED
1744  *       - \ref SCIP_STAGE_INITPRESOLVE
1745  *       - \ref SCIP_STAGE_PRESOLVING
1746  *       - \ref SCIP_STAGE_EXITPRESOLVE
1747  *       - \ref SCIP_STAGE_PRESOLVED
1748  *       - \ref SCIP_STAGE_INITSOLVE
1749  *       - \ref SCIP_STAGE_SOLVING
1750  *       - \ref SCIP_STAGE_SOLVED
1751  *       - \ref SCIP_STAGE_EXITSOLVE
1752  *       - \ref SCIP_STAGE_FREETRANS
1753  *
1754  *  See \ref SCIP_Stage "SCIP_STAGE" for a complete list of all possible solving stages.
1755  */
1756 SCIP_EXPORT
1757 SCIP_Bool SCIPinDive(
1758    SCIP*                 scip                /**< SCIP data structure */
1759    );
1760 
1761 /** computes the changes to the problem when fixing to the optimal face
1762  *
1763  *  returns the degeneracy rate, i.e., the number of nonbasic variables with reduced cost 0
1764  *  and the variable constraint ratio, i.e., the number of unfixed variables in relation to the basis size
1765  */
1766 SCIP_EXPORT
1767 SCIP_RETCODE SCIPgetLPDegeneracy(
1768    SCIP*                 scip,               /**< SCIP data structure */
1769    SCIP_Real*            degeneracy,         /**< pointer to store degeneracy share */
1770    SCIP_Real*            varconsratio        /**< pointer to store variable constraint ratio */
1771    );
1772 
1773 /**@} */
1774 
1775 #ifdef __cplusplus
1776 }
1777 #endif
1778 
1779 #endif
1780