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