Scippy

SCIP

Solving Constraint Integer Programs

lpi.h
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-2014 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SCIP is distributed under the terms of the ZIB Academic License. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SCIP; see the file COPYING. If not email to scip@zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file lpi.h
17  * @ingroup PUBLICMETHODS
18  * @brief interface methods for specific LP solvers
19  * @author Tobias Achterberg
20  * @author Marc Pfetsch
21  *
22  * This file specifies a generic LP solver interface used by SCIP to create, modify, and solve linear programs of the
23  * form
24  *
25  * min/max obj * x
26  * lhs <= A * x <= rhs
27  * lb <= x <= ub
28  *
29  * and query information about the solution. Although it includes a few SCIP header files, e.g., because it uses SCIP's
30  * return codes, it can be used independently of any SCIP instance.
31  */
32 
33 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
34 
35 #ifndef __SCIP_LPI_H__
36 #define __SCIP_LPI_H__
37 
38 
39 #include "scip/def.h"
40 #include "blockmemshell/memory.h"
41 #include "scip/type_retcode.h"
42 #include "lpi/type_lpi.h"
43 
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
47 
48 /*
49  * Miscellaneous Methods
50  */
51 
52 /**@name Miscellaneous Methods */
53 /**@{ */
54 
55 /** gets name and version of LP solver */
56 extern
57 const char* SCIPlpiGetSolverName(
58  void
59  );
60 
61 /** gets description of LP solver (developer, webpage, ...) */
62 extern
63 const char* SCIPlpiGetSolverDesc(
64  void
65  );
66 
67 /** gets pointer for LP solver - use only with great care
68  *
69  * The behavior of this function depends on the solver and its use is
70  * therefore only recommended if you really know what you are
71  * doing. In general, it returns a pointer to the LP solver object.
72  */
73 extern
75  SCIP_LPI* lpi /**< pointer to an LP interface structure */
76  );
77 
78 /**@} */
79 
80 
81 
82 
83 /*
84  * LPI Creation and Destruction Methods
85  */
86 
87 /**@name LPI Creation and Destruction Methods */
88 /**@{ */
89 
90 /** creates an LP problem object */
91 extern
93  SCIP_LPI** lpi, /**< pointer to an LP interface structure */
94  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler to use for printing messages, or NULL */
95  const char* name, /**< problem name */
96  SCIP_OBJSEN objsen /**< objective sense */
97  );
98 
99 /** deletes an LP problem object */
100 extern
102  SCIP_LPI** lpi /**< pointer to an LP interface structure */
103  );
104 
105 /**@} */
106 
107 
108 
109 
110 /*
111  * Modification Methods
112  */
113 
114 /**@name Modification Methods */
115 /**@{ */
116 
117 /** copies LP data with column matrix into LP solver */
118 extern
120  SCIP_LPI* lpi, /**< LP interface structure */
121  SCIP_OBJSEN objsen, /**< objective sense */
122  int ncols, /**< number of columns */
123  const SCIP_Real* obj, /**< objective function values of columns */
124  const SCIP_Real* lb, /**< lower bounds of columns */
125  const SCIP_Real* ub, /**< upper bounds of columns */
126  char** colnames, /**< column names, or NULL */
127  int nrows, /**< number of rows */
128  const SCIP_Real* lhs, /**< left hand sides of rows */
129  const SCIP_Real* rhs, /**< right hand sides of rows */
130  char** rownames, /**< row names, or NULL */
131  int nnonz, /**< number of nonzero elements in the constraint matrix */
132  const int* beg, /**< start index of each column in ind- and val-array */
133  const int* ind, /**< row indices of constraint matrix entries */
134  const SCIP_Real* val /**< values of constraint matrix entries */
135  );
136 
137 /** adds columns to the LP
138  *
139  * @note ind array is not checked for duplicates, problems may appear if indeces are added more than once
140  */
141 extern
143  SCIP_LPI* lpi, /**< LP interface structure */
144  int ncols, /**< number of columns to be added */
145  const SCIP_Real* obj, /**< objective function values of new columns */
146  const SCIP_Real* lb, /**< lower bounds of new columns */
147  const SCIP_Real* ub, /**< upper bounds of new columns */
148  char** colnames, /**< column names, or NULL */
149  int nnonz, /**< number of nonzero elements to be added to the constraint matrix */
150  const int* beg, /**< start index of each column in ind- and val-array, or NULL if nnonz == 0 */
151  const int* ind, /**< row indices of constraint matrix entries, or NULL if nnonz == 0 */
152  const SCIP_Real* val /**< values of constraint matrix entries, or NULL if nnonz == 0 */
153  );
154 
155 /** deletes all columns in the given range from LP */
156 extern
158  SCIP_LPI* lpi, /**< LP interface structure */
159  int firstcol, /**< first column to be deleted */
160  int lastcol /**< last column to be deleted */
161  );
162 
163 /** deletes columns from SCIP_LPI; the new position of a column must not be greater that its old position */
164 extern
166  SCIP_LPI* lpi, /**< LP interface structure */
167  int* dstat /**< deletion status of columns
168  * input: 1 if column should be deleted, 0 if not
169  * output: new position of column, -1 if column was deleted */
170  );
171 
172 /** adds rows to the LP
173  *
174  * @note ind array is not checked for duplicates, problems may appear if indeces are added more than once
175  */
176 extern
178  SCIP_LPI* lpi, /**< LP interface structure */
179  int nrows, /**< number of rows to be added */
180  const SCIP_Real* lhs, /**< left hand sides of new rows */
181  const SCIP_Real* rhs, /**< right hand sides of new rows */
182  char** rownames, /**< row names, or NULL */
183  int nnonz, /**< number of nonzero elements to be added to the constraint matrix */
184  const int* beg, /**< start index of each row in ind- and val-array, or NULL if nnonz == 0 */
185  const int* ind, /**< column indices of constraint matrix entries, or NULL if nnonz == 0 */
186  const SCIP_Real* val /**< values of constraint matrix entries, or NULL if nnonz == 0 */
187  );
188 
189 /** deletes all rows in the given range from LP */
190 extern
192  SCIP_LPI* lpi, /**< LP interface structure */
193  int firstrow, /**< first row to be deleted */
194  int lastrow /**< last row to be deleted */
195  );
196 
197 /** deletes rows from SCIP_LPI; the new position of a row must not be greater that its old position */
198 extern
200  SCIP_LPI* lpi, /**< LP interface structure */
201  int* dstat /**< deletion status of rows
202  * input: 1 if row should be deleted, 0 if not
203  * output: new position of row, -1 if row was deleted */
204  );
205 
206 /** clears the whole LP */
207 extern
209  SCIP_LPI* lpi /**< LP interface structure */
210  );
211 
212 /** changes lower and upper bounds of columns */
213 extern
215  SCIP_LPI* lpi, /**< LP interface structure */
216  int ncols, /**< number of columns to change bounds for */
217  const int* ind, /**< column indices */
218  const SCIP_Real* lb, /**< values for the new lower bounds */
219  const SCIP_Real* ub /**< values for the new upper bounds */
220  );
221 
222 /** changes left and right hand sides of rows */
223 extern
225  SCIP_LPI* lpi, /**< LP interface structure */
226  int nrows, /**< number of rows to change sides for */
227  const int* ind, /**< row indices */
228  const SCIP_Real* lhs, /**< new values for left hand sides */
229  const SCIP_Real* rhs /**< new values for right hand sides */
230  );
231 
232 /** changes a single coefficient */
233 extern
235  SCIP_LPI* lpi, /**< LP interface structure */
236  int row, /**< row number of coefficient to change */
237  int col, /**< column number of coefficient to change */
238  SCIP_Real newval /**< new value of coefficient */
239  );
240 
241 /** changes the objective sense */
242 extern
244  SCIP_LPI* lpi, /**< LP interface structure */
245  SCIP_OBJSEN objsen /**< new objective sense */
246  );
247 
248 /** changes objective values of columns in the LP */
249 extern
251  SCIP_LPI* lpi, /**< LP interface structure */
252  int ncols, /**< number of columns to change objective value for */
253  int* ind, /**< column indices to change objective value for */
254  SCIP_Real* obj /**< new objective values for columns */
255  );
256 
257 /** multiplies a row with a non-zero scalar; for negative scalars, the row's sense is switched accordingly */
258 extern
260  SCIP_LPI* lpi, /**< LP interface structure */
261  int row, /**< row number to scale */
262  SCIP_Real scaleval /**< scaling multiplier */
263  );
264 
265 /** multiplies a column with a non-zero scalar; the objective value is multiplied with the scalar, and the bounds
266  * are divided by the scalar; for negative scalars, the column's bounds are switched
267  */
268 extern
270  SCIP_LPI* lpi, /**< LP interface structure */
271  int col, /**< column number to scale */
272  SCIP_Real scaleval /**< scaling multiplier */
273  );
274 
275 /**@} */
276 
277 
278 
279 
280 /*
281  * Data Accessing Methods
282  */
283 
284 /**@name Data Accessing Methods */
285 /**@{ */
286 
287 /** gets the number of rows in the LP */
288 extern
290  SCIP_LPI* lpi, /**< LP interface structure */
291  int* nrows /**< pointer to store the number of rows */
292  );
293 
294 /** gets the number of columns in the LP */
295 extern
297  SCIP_LPI* lpi, /**< LP interface structure */
298  int* ncols /**< pointer to store the number of cols */
299  );
300 
301 /** gets the objective sense of the LP */
303  SCIP_LPI* lpi, /**< LP interface structure */
304  SCIP_OBJSEN* objsen /**< pointer to store objective sense */
305  );
306 
307 /** gets the number of nonzero elements in the LP constraint matrix */
308 extern
310  SCIP_LPI* lpi, /**< LP interface structure */
311  int* nnonz /**< pointer to store the number of nonzeros */
312  );
313 
314 /** gets columns from LP problem object; the arrays have to be large enough to store all values;
315  * Either both, lb and ub, have to be NULL, or both have to be non-NULL,
316  * either nnonz, beg, ind, and val have to be NULL, or all of them have to be non-NULL.
317  */
318 extern
320  SCIP_LPI* lpi, /**< LP interface structure */
321  int firstcol, /**< first column to get from LP */
322  int lastcol, /**< last column to get from LP */
323  SCIP_Real* lb, /**< buffer to store the lower bound vector, or NULL */
324  SCIP_Real* ub, /**< buffer to store the upper bound vector, or NULL */
325  int* nnonz, /**< pointer to store the number of nonzero elements returned, or NULL */
326  int* beg, /**< buffer to store start index of each column in ind- and val-array, or NULL */
327  int* ind, /**< buffer to store column indices of constraint matrix entries, or NULL */
328  SCIP_Real* val /**< buffer to store values of constraint matrix entries, or NULL */
329  );
330 
331 /** gets rows from LP problem object; the arrays have to be large enough to store all values.
332  * Either both, lhs and rhs, have to be NULL, or both have to be non-NULL,
333  * either nnonz, beg, ind, and val have to be NULL, or all of them have to be non-NULL.
334  */
335 extern
337  SCIP_LPI* lpi, /**< LP interface structure */
338  int firstrow, /**< first row to get from LP */
339  int lastrow, /**< last row to get from LP */
340  SCIP_Real* lhs, /**< buffer to store left hand side vector, or NULL */
341  SCIP_Real* rhs, /**< buffer to store right hand side vector, or NULL */
342  int* nnonz, /**< pointer to store the number of nonzero elements returned, or NULL */
343  int* beg, /**< buffer to store start index of each row in ind- and val-array, or NULL */
344  int* ind, /**< buffer to store row indices of constraint matrix entries, or NULL */
345  SCIP_Real* val /**< buffer to store values of constraint matrix entries, or NULL */
346  );
347 
348 /** gets column names */
349 extern
351  SCIP_LPI* lpi, /**< LP interface structure */
352  int firstcol, /**< first column to get name from LP */
353  int lastcol, /**< last column to get name from LP */
354  char** colnames, /**< pointers to column names (of size at least lastcol-firstcol+1) */
355  char* namestorage, /**< storage for col names */
356  int namestoragesize, /**< size of namestorage (if 0, -storageleft returns the storage needed) */
357  int* storageleft /**< amount of storage left (if < 0 the namestorage was not big enough) */
358  );
359 
360 /** gets row names */
361 extern
363  SCIP_LPI* lpi, /**< LP interface structure */
364  int firstrow, /**< first row to get name from LP */
365  int lastrow, /**< last row to get name from LP */
366  char** rownames, /**< pointers to row names (of size at least lastrow-firstrow+1) */
367  char* namestorage, /**< storage for row names */
368  int namestoragesize, /**< size of namestorage (if 0, -storageleft returns the storage needed) */
369  int* storageleft /**< amount of storage left (if < 0 the namestorage was not big enough) */
370  );
371 
372 /** gets objective coefficients from LP problem object */
373 extern
375  SCIP_LPI* lpi, /**< LP interface structure */
376  int firstcol, /**< first column to get objective coefficient for */
377  int lastcol, /**< last column to get objective coefficient for */
378  SCIP_Real* vals /**< array to store objective coefficients */
379  );
380 
381 /** gets current bounds from LP problem object */
382 extern
384  SCIP_LPI* lpi, /**< LP interface structure */
385  int firstcol, /**< first column to get bounds for */
386  int lastcol, /**< last column to get bounds for */
387  SCIP_Real* lbs, /**< array to store lower bound values, or NULL */
388  SCIP_Real* ubs /**< array to store upper bound values, or NULL */
389  );
390 
391 /** gets current row sides from LP problem object */
392 extern
394  SCIP_LPI* lpi, /**< LP interface structure */
395  int firstrow, /**< first row to get sides for */
396  int lastrow, /**< last row to get sides for */
397  SCIP_Real* lhss, /**< array to store left hand side values, or NULL */
398  SCIP_Real* rhss /**< array to store right hand side values, or NULL */
399  );
400 
401 /** gets a single coefficient */
402 extern
404  SCIP_LPI* lpi, /**< LP interface structure */
405  int row, /**< row number of coefficient */
406  int col, /**< column number of coefficient */
407  SCIP_Real* val /**< pointer to store the value of the coefficient */
408  );
409 
410 /**@} */
411 
412 
413 
414 
415 /*
416  * Solving Methods
417  */
418 
419 /**@name Solving Methods */
420 /**@{ */
421 
422 /** calls primal simplex to solve the LP */
423 extern
425  SCIP_LPI* lpi /**< LP interface structure */
426  );
427 
428 /** calls dual simplex to solve the LP */
429 extern
431  SCIP_LPI* lpi /**< LP interface structure */
432  );
433 
434 /** calls barrier or interior point algorithm to solve the LP with crossover to simplex basis */
435 extern
437  SCIP_LPI* lpi, /**< LP interface structure */
438  SCIP_Bool crossover /**< perform crossover */
439  );
440 
441 /** start strong branching - call before any strong branching */
442 extern
444  SCIP_LPI* lpi /**< LP interface structure */
445  );
446 
447 /** end strong branching - call after any strong branching */
448 extern
450  SCIP_LPI* lpi /**< LP interface structure */
451  );
452 
453 /** performs strong branching iterations on one @b fractional candidate */
454 extern
456  SCIP_LPI* lpi, /**< LP interface structure */
457  int col, /**< column to apply strong branching on */
458  SCIP_Real psol, /**< fractional current primal solution value of column */
459  int itlim, /**< iteration limit for strong branchings */
460  SCIP_Real* down, /**< stores dual bound after branching column down */
461  SCIP_Real* up, /**< stores dual bound after branching column up */
462  SCIP_Bool* downvalid, /**< stores whether the returned down value is a valid dual bound;
463  * otherwise, it can only be used as an estimate value */
464  SCIP_Bool* upvalid, /**< stores whether the returned up value is a valid dual bound;
465  * otherwise, it can only be used as an estimate value */
466  int* iter /**< stores total number of strong branching iterations, or -1; may be NULL */
467  );
468 
469 /** performs strong branching iterations on given @b fractional candidates */
470 extern
472  SCIP_LPI* lpi, /**< LP interface structure */
473  int* cols, /**< columns to apply strong branching on */
474  int ncols, /**< number of columns */
475  SCIP_Real* psols, /**< fractional current primal solution values of columns */
476  int itlim, /**< iteration limit for strong branchings */
477  SCIP_Real* down, /**< stores dual bounds after branching columns down */
478  SCIP_Real* up, /**< stores dual bounds after branching columns up */
479  SCIP_Bool* downvalid, /**< stores whether the returned down values are valid dual bounds;
480  * otherwise, they can only be used as an estimate values */
481  SCIP_Bool* upvalid, /**< stores whether the returned up values are a valid dual bounds;
482  * otherwise, they can only be used as an estimate values */
483  int* iter /**< stores total number of strong branching iterations, or -1; may be NULL */
484  );
485 
486 /** performs strong branching iterations on one candidate with @b integral value */
487 extern
489  SCIP_LPI* lpi, /**< LP interface structure */
490  int col, /**< column to apply strong branching on */
491  SCIP_Real psol, /**< current integral primal solution value of column */
492  int itlim, /**< iteration limit for strong branchings */
493  SCIP_Real* down, /**< stores dual bound after branching column down */
494  SCIP_Real* up, /**< stores dual bound after branching column up */
495  SCIP_Bool* downvalid, /**< stores whether the returned down value is a valid dual bound;
496  * otherwise, it can only be used as an estimate value */
497  SCIP_Bool* upvalid, /**< stores whether the returned up value is a valid dual bound;
498  * otherwise, it can only be used as an estimate value */
499  int* iter /**< stores total number of strong branching iterations, or -1; may be NULL */
500  );
501 
502 /** performs strong branching iterations on given candidates with @b integral values */
503 extern
505  SCIP_LPI* lpi, /**< LP interface structure */
506  int* cols, /**< columns to apply strong branching on */
507  int ncols, /**< number of columns */
508  SCIP_Real* psols, /**< current integral primal solution values of columns */
509  int itlim, /**< iteration limit for strong branchings */
510  SCIP_Real* down, /**< stores dual bounds after branching columns down */
511  SCIP_Real* up, /**< stores dual bounds after branching columns up */
512  SCIP_Bool* downvalid, /**< stores whether the returned down values are valid dual bounds;
513  * otherwise, they can only be used as an estimate values */
514  SCIP_Bool* upvalid, /**< stores whether the returned up values are a valid dual bounds;
515  * otherwise, they can only be used as an estimate values */
516  int* iter /**< stores total number of strong branching iterations, or -1; may be NULL */
517  );
518 /**@} */
519 
520 
521 
522 
523 /*
524  * Solution Information Methods
525  */
526 
527 /**@name Solution Information Methods */
528 /**@{ */
529 
530 /** returns whether a solve method was called after the last modification of the LP */
531 extern
533  SCIP_LPI* lpi /**< LP interface structure */
534  );
535 
536 /** gets information about primal and dual feasibility of the current LP solution */
537 extern
539  SCIP_LPI* lpi, /**< LP interface structure */
540  SCIP_Bool* primalfeasible, /**< stores primal feasibility status */
541  SCIP_Bool* dualfeasible /**< stores dual feasibility status */
542  );
543 
544 /** returns TRUE iff LP is proven to have a primal unbounded ray (but not necessary a primal feasible point);
545  * this does not necessarily mean, that the solver knows and can return the primal ray
546  */
547 extern
549  SCIP_LPI* lpi /**< LP interface structure */
550  );
551 
552 /** returns TRUE iff LP is proven to have a primal unbounded ray (but not necessary a primal feasible point),
553  * and the solver knows and can return the primal ray
554  */
555 extern
557  SCIP_LPI* lpi /**< LP interface structure */
558  );
559 
560 /** returns TRUE iff LP is proven to be primal unbounded */
561 extern
563  SCIP_LPI* lpi /**< LP interface structure */
564  );
565 
566 /** returns TRUE iff LP is proven to be primal infeasible */
567 extern
569  SCIP_LPI* lpi /**< LP interface structure */
570  );
571 
572 /** returns TRUE iff LP is proven to be primal feasible */
573 extern
575  SCIP_LPI* lpi /**< LP interface structure */
576  );
577 
578 /** returns TRUE iff LP is proven to have a dual unbounded ray (but not necessary a dual feasible point);
579  * this does not necessarily mean, that the solver knows and can return the dual ray
580  */
581 extern
583  SCIP_LPI* lpi /**< LP interface structure */
584  );
585 
586 /** returns TRUE iff LP is proven to have a dual unbounded ray (but not necessary a dual feasible point),
587  * and the solver knows and can return the dual ray
588  */
589 extern
591  SCIP_LPI* lpi /**< LP interface structure */
592  );
593 
594 /** returns TRUE iff LP is proven to be dual unbounded */
595 extern
597  SCIP_LPI* lpi /**< LP interface structure */
598  );
599 
600 /** returns TRUE iff LP is proven to be dual infeasible */
601 extern
603  SCIP_LPI* lpi /**< LP interface structure */
604  );
605 
606 /** returns TRUE iff LP is proven to be dual feasible */
607 extern
609  SCIP_LPI* lpi /**< LP interface structure */
610  );
611 
612 /** returns TRUE iff LP was solved to optimality */
613 extern
615  SCIP_LPI* lpi /**< LP interface structure */
616  );
617 
618 /** returns TRUE iff current LP basis is stable */
619 extern
621  SCIP_LPI* lpi /**< LP interface structure */
622  );
623 
624 /** returns TRUE iff the objective limit was reached */
625 extern
627  SCIP_LPI* lpi /**< LP interface structure */
628  );
629 
630 /** returns TRUE iff the iteration limit was reached */
631 extern
633  SCIP_LPI* lpi /**< LP interface structure */
634  );
635 
636 /** returns TRUE iff the time limit was reached */
637 extern
639  SCIP_LPI* lpi /**< LP interface structure */
640  );
641 
642 /** returns the internal solution status of the solver */
643 extern
645  SCIP_LPI* lpi /**< LP interface structure */
646  );
647 
648 /** tries to reset the internal status of the LP solver in order to ignore an instability of the last solving call */
649 extern
651  SCIP_LPI* lpi, /**< LP interface structure */
652  SCIP_Bool* success /**< pointer to store, whether the instability could be ignored */
653  );
654 
655 /** gets objective value of solution */
656 extern
658  SCIP_LPI* lpi, /**< LP interface structure */
659  SCIP_Real* objval /**< stores the objective value */
660  );
661 
662 /** gets primal and dual solution vectors for feasible LPs */
663 extern
665  SCIP_LPI* lpi, /**< LP interface structure */
666  SCIP_Real* objval, /**< stores the objective value, may be NULL if not needed */
667  SCIP_Real* primsol, /**< primal solution vector, may be NULL if not needed */
668  SCIP_Real* dualsol, /**< dual solution vector, may be NULL if not needed */
669  SCIP_Real* activity, /**< row activity vector, may be NULL if not needed */
670  SCIP_Real* redcost /**< reduced cost vector, may be NULL if not needed */
671  );
672 
673 /** gets primal ray for unbounded LPs */
674 extern
676  SCIP_LPI* lpi, /**< LP interface structure */
677  SCIP_Real* ray /**< primal ray */
678  );
679 
680 /** gets dual Farkas proof for infeasibility */
681 extern
683  SCIP_LPI* lpi, /**< LP interface structure */
684  SCIP_Real* dualfarkas /**< dual Farkas row multipliers */
685  );
686 
687 /** gets the number of LP iterations of the last solve call */
688 extern
690  SCIP_LPI* lpi, /**< LP interface structure */
691  int* iterations /**< pointer to store the number of iterations of the last solve call */
692  );
693 
694 /** gets information about the quality of an LP solution
695  *
696  * Such information is usually only available, if also a (maybe not optimal) solution is available.
697  * The LPI should return SCIP_INVALID for @p quality, if the requested quantity is not available.
698  */
699 extern
701  SCIP_LPI* lpi, /**< LP interface structure */
702  SCIP_LPSOLQUALITY qualityindicator, /**< indicates which quality should be returned */
703  SCIP_Real* quality /**< pointer to store quality number */
704  );
705 
706 /**@} */
707 
708 
709 
710 
711 /*
712  * LP Basis Methods
713  */
714 
715 /**@name LP Basis Methods */
716 /**@{ */
717 
718 /** gets current basis status for columns and rows; arrays must be large enough to store the basis status */
719 extern
721  SCIP_LPI* lpi, /**< LP interface structure */
722  int* cstat, /**< array to store column basis status, or NULL */
723  int* rstat /**< array to store row basis status, or NULL */
724  );
725 
726 /** sets current basis status for columns and rows */
727 extern
729  SCIP_LPI* lpi, /**< LP interface structure */
730  int* cstat, /**< array with column basis status */
731  int* rstat /**< array with row basis status */
732  );
733 
734 /** returns the indices of the basic columns and rows; basic column n gives value n, basic row m gives value -1-m */
735 extern
737  SCIP_LPI* lpi, /**< LP interface structure */
738  int* bind /**< pointer to store basis indices ready to keep number of rows entries */
739  );
740 
741 /** get dense row of inverse basis matrix B^-1 */
742 extern
744  SCIP_LPI* lpi, /**< LP interface structure */
745  int r, /**< row number */
746  SCIP_Real* coef /**< pointer to store the coefficients of the row */
747  );
748 
749 /** get dense column of inverse basis matrix B^-1 */
750 extern
752  SCIP_LPI* lpi, /**< LP interface structure */
753  int c, /**< column number of B^-1; this is NOT the number of the column in the LP;
754  * you have to call SCIPlpiGetBasisInd() to get the array which links the
755  * B^-1 column numbers to the row and column numbers of the LP!
756  * c must be between 0 and nrows-1, since the basis has the size
757  * nrows * nrows */
758  SCIP_Real* coef /**< pointer to store the coefficients of the column */
759  );
760 
761 /** get dense row of inverse basis matrix times constraint matrix B^-1 * A */
762 extern
764  SCIP_LPI* lpi, /**< LP interface structure */
765  int r, /**< row number */
766  const SCIP_Real* binvrow, /**< row in (A_B)^-1 from prior call to SCIPlpiGetBInvRow(), or NULL */
767  SCIP_Real* coef /**< vector to return coefficients */
768  );
769 
770 /** get dense column of inverse basis matrix times constraint matrix B^-1 * A */
771 extern
773  SCIP_LPI* lpi, /**< LP interface structure */
774  int c, /**< column number */
775  SCIP_Real* coef /**< vector to return coefficients */
776  );
777 
778 /**@} */
779 
780 
781 
782 
783 /*
784  * LPi State Methods
785  */
786 
787 /**@name LPi State Methods */
788 /**@{ */
789 
790 /** stores LPi state (like basis information) into lpistate object */
791 extern
793  SCIP_LPI* lpi, /**< LP interface structure */
794  BMS_BLKMEM* blkmem, /**< block memory */
795  SCIP_LPISTATE** lpistate /**< pointer to LPi state information (like basis information) */
796  );
797 
798 /** loads LPi state (like basis information) into solver; note that the LP might have been extended with additional
799  * columns and rows since the state was stored with SCIPlpiGetState()
800  */
801 extern
803  SCIP_LPI* lpi, /**< LP interface structure */
804  BMS_BLKMEM* blkmem, /**< block memory */
805  SCIP_LPISTATE* lpistate /**< LPi state information (like basis information) */
806  );
807 
808 /** clears current LPi state (like basis information) of the solver */
809 extern
811  SCIP_LPI* lpi /**< LP interface structure */
812  );
813 
814 /** frees LPi state information */
815 extern
817  SCIP_LPI* lpi, /**< LP interface structure */
818  BMS_BLKMEM* blkmem, /**< block memory */
819  SCIP_LPISTATE** lpistate /**< pointer to LPi state information (like basis information) */
820  );
821 
822 /** checks, whether the given LPi state contains simplex basis information */
823 extern
825  SCIP_LPI* lpi, /**< LP interface structure */
826  SCIP_LPISTATE* lpistate /**< LPi state information (like basis information) */
827  );
828 
829 /** reads LPi state (like basis information from a file */
830 extern
832  SCIP_LPI* lpi, /**< LP interface structure */
833  const char* fname /**< file name */
834  );
835 
836 /** writes LPi state (like basis information) to a file */
837 extern
839  SCIP_LPI* lpi, /**< LP interface structure */
840  const char* fname /**< file name */
841  );
842 
843 /**@} */
844 
845 
846 /*
847  * LPi Pricing Norms Methods
848  */
849 
850 /**@name LPi Pricing Norms Methods */
851 /**@{ */
852 
853 /** stores LPi pricing norms into lpinorms object */
854 extern
856  SCIP_LPI* lpi, /**< LP interface structure */
857  BMS_BLKMEM* blkmem, /**< block memory */
858  SCIP_LPINORMS** lpinorms /**< pointer to LPi pricing norms information */
859  );
860 
861 /** loads LPi pricing norms into solver; note that the LP might have been extended with additional
862  * columns and rows since the norms were stored with SCIPlpiGetNorms()
863  */
864 extern
866  SCIP_LPI* lpi, /**< LP interface structure */
867  BMS_BLKMEM* blkmem, /**< block memory */
868  SCIP_LPINORMS* lpinorms /**< LPi pricing norms information */
869  );
870 
871 /** frees LPi pricing norms information */
872 extern
874  SCIP_LPI* lpi, /**< LP interface structure */
875  BMS_BLKMEM* blkmem, /**< block memory */
876  SCIP_LPINORMS** lpinorms /**< pointer to LPi pricing norms information */
877  );
878 
879 
880 /**@} */
881 
882 
883 
884 
885 /*
886  * Parameter Methods
887  */
888 
889 /**@name Parameter Methods */
890 /**@{ */
891 
892 /** gets integer parameter of LP */
893 extern
895  SCIP_LPI* lpi, /**< LP interface structure */
896  SCIP_LPPARAM type, /**< parameter number */
897  int* ival /**< buffer to store the parameter value */
898  );
899 
900 /** sets integer parameter of LP */
901 extern
903  SCIP_LPI* lpi, /**< LP interface structure */
904  SCIP_LPPARAM type, /**< parameter number */
905  int ival /**< parameter value */
906  );
907 
908 /** gets floating point parameter of LP */
909 extern
911  SCIP_LPI* lpi, /**< LP interface structure */
912  SCIP_LPPARAM type, /**< parameter number */
913  SCIP_Real* dval /**< buffer to store the parameter value */
914  );
915 
916 /** sets floating point parameter of LP */
917 extern
919  SCIP_LPI* lpi, /**< LP interface structure */
920  SCIP_LPPARAM type, /**< parameter number */
921  SCIP_Real dval /**< parameter value */
922  );
923 
924 /**@} */
925 
926 
927 
928 
929 /*
930  * Numerical Methods
931  */
932 
933 /**@name Numerical Methods */
934 /**@{ */
935 
936 /** returns value treated as infinity in the LP solver */
937 extern
939  SCIP_LPI* lpi /**< LP interface structure */
940  );
941 
942 /** checks if given value is treated as infinity in the LP solver */
943 extern
945  SCIP_LPI* lpi, /**< LP interface structure */
946  SCIP_Real val /**< value to be checked for infinity */
947  );
948 
949 /**@} */
950 
951 
952 
953 
954 /*
955  * File Interface Methods
956  */
957 
958 /**@name File Interface Methods */
959 /**@{ */
960 
961 /** reads LP from a file */
962 extern
964  SCIP_LPI* lpi, /**< LP interface structure */
965  const char* fname /**< file name */
966  );
967 
968 /** writes LP to a file */
969 extern
971  SCIP_LPI* lpi, /**< LP interface structure */
972  const char* fname /**< file name */
973  );
974 
975 /**@} */
976 
977 #ifdef __cplusplus
978 }
979 #endif
980 
981 #endif
982