Scippy

SCIP

Solving Constraint Integer Programs

lpi_none.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-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_none.c
17  * @ingroup LPIS
18  * @brief dummy interface for the case no LP solver is needed
19  * @author Stefan Heinz
20  */
21 
22 /*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
23 
24 #include <assert.h>
25 
26 #include "lpi/lpi.h"
27 #include "scip/pub_message.h"
28 
29 #define LPINAME "NONE" /**< name of the LPI interface */
30 #define LPIINFINITY 1e20 /**< infinity value */
31 
32 /** LP interface
33  *
34  * Store several statistic values about the LP. These values are only needed in order to provide a rudimentary
35  * communication, e.g., there are asserts that check the number of rows and columns.
36  */
37 struct SCIP_LPi
38 {
39  int nrows; /**< number of rows */
40  int ncols; /**< number of columns */
41 };
42 
43 
44 /*
45  * Local Methods
46  */
47 
48 /** error handling method */
49 static
51  void
52  )
53 {
54  SCIPerrorMessage("No LP solver available (LPS=none).\n");
55  SCIPerrorMessage("Ensure <lp/solvefreq = -1>; note that continuous variables might require an LP-solver.\n");
56  SCIPABORT();
57 }
58 
59 /** error handling method */
60 static
62  void
63  )
64 {
65  SCIPerrorMessage("No LP solver available (LPS=none).\n");
66  SCIPerrorMessage("Ensure <lp/solvefreq = -1>; note that continuous variables might require an LP-solver.\n");
67 }
68 
69 /*
70  * LP Interface Methods
71  */
72 
73 
74 /*
75  * Miscellaneous Methods
76  */
77 
78 /**@name Miscellaneous Methods */
79 /**@{ */
80 
81 /** gets name and version of LP solver */
83  void
84  )
85 {
86  return LPINAME;
87 }
88 
89 /** gets description of LP solver (developer, webpage, ...) */
91  void
92  )
93 {
94  return "dummy LP solver interface which solely purpose is to resolve references at linking";
95 }
96 
97 /** gets pointer for LP solver - use only with great care */
99  SCIP_LPI* lpi /**< pointer to an LP interface structure */
100  )
101 { /*lint --e{715}*/
102  return (void*) NULL;
103 }
104 /**@} */
105 
106 
107 
108 
109 /*
110  * LPI Creation and Destruction Methods
111  */
112 
113 /**@name LPI Creation and Destruction Methods */
114 /**@{ */
115 
116 /** creates an LP problem object */
118  SCIP_LPI** lpi, /**< pointer to an LP interface structure */
119  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler to use for printing messages, or NULL */
120  const char* name, /**< problem name */
121  SCIP_OBJSEN objsen /**< objective sense */
122  )
123 { /*lint --e{715}*/
124  assert(lpi != NULL);
125  SCIPdebugMessage("SCIPlpiCreate()\n");
126  SCIPdebugMessage("Note that there is no LP solver linked to the binary\n");
127 
128  /* create empty LPI */
129  SCIP_ALLOC( BMSallocMemory(lpi) );
130  (*lpi)->nrows = 0;
131  (*lpi)->ncols = 0;
132 
133  return SCIP_OKAY;
134 }
135 
136 /** deletes an LP problem object */
138  SCIP_LPI** lpi /**< pointer to an LP interface structure */
139  )
140 { /*lint --e{715}*/
141  assert( lpi != NULL );
142  SCIPdebugMessage("SCIPlpiFree()\n");
143 
144  BMSfreeMemory(lpi);
145 
146  return SCIP_OKAY;
147 }
148 
149 /**@} */
150 
151 
152 
153 
154 /*
155  * Modification Methods
156  */
157 
158 /**@name Modification Methods */
159 /**@{ */
160 
161 /** copies LP data with column matrix into LP solver */
163  SCIP_LPI* lpi, /**< LP interface structure */
164  SCIP_OBJSEN objsen, /**< objective sense */
165  int ncols, /**< number of columns */
166  const SCIP_Real* obj, /**< objective function values of columns */
167  const SCIP_Real* lb, /**< lower bounds of columns */
168  const SCIP_Real* ub, /**< upper bounds of columns */
169  char** colnames, /**< column names, or NULL */
170  int nrows, /**< number of rows */
171  const SCIP_Real* lhs, /**< left hand sides of rows */
172  const SCIP_Real* rhs, /**< right hand sides of rows */
173  char** rownames, /**< row names, or NULL */
174  int nnonz, /**< number of nonzero elements in the constraint matrix */
175  const int* beg, /**< start index of each column in ind- and val-array */
176  const int* ind, /**< row indices of constraint matrix entries */
177  const SCIP_Real* val /**< values of constraint matrix entries */
178  )
179 { /*lint --e{715}*/
180  assert( lpi != NULL );
181 
182  lpi->nrows = nrows;
183  lpi->ncols = ncols;
184  assert( lpi->nrows >= 0 );
185  assert( lpi->ncols >= 0 );
186 
187  return SCIP_OKAY;
188 }
189 
190 /** adds columns to the LP */
192  SCIP_LPI* lpi, /**< LP interface structure */
193  int ncols, /**< number of columns to be added */
194  const SCIP_Real* obj, /**< objective function values of new columns */
195  const SCIP_Real* lb, /**< lower bounds of new columns */
196  const SCIP_Real* ub, /**< upper bounds of new columns */
197  char** colnames, /**< column names, or NULL */
198  int nnonz, /**< number of nonzero elements to be added to the constraint matrix */
199  const int* beg, /**< start index of each column in ind- and val-array, or NULL if nnonz == 0 */
200  const int* ind, /**< row indices of constraint matrix entries, or NULL if nnonz == 0 */
201  const SCIP_Real* val /**< values of constraint matrix entries, or NULL if nnonz == 0 */
202  )
203 { /*lint --e{715}*/
204  assert( lpi != NULL );
205  assert( lpi->ncols >= 0 );
206 
207  lpi->ncols += ncols;
208 
209  return SCIP_OKAY;
210 }
211 
212 /** deletes all columns in the given range from LP */
214  SCIP_LPI* lpi, /**< LP interface structure */
215  int firstcol, /**< first column to be deleted */
216  int lastcol /**< last column to be deleted */
217  )
218 { /*lint --e{715}*/
219  assert( lpi != NULL );
220  assert( lpi->ncols >= 0 );
221 
222  lpi->ncols -= lastcol - firstcol + 1;
223  assert( lpi->ncols >= 0 );
224 
225  return SCIP_OKAY;
226 }
227 
228 /** deletes columns from SCIP_LP; the new position of a column must not be greater that its old position */
230  SCIP_LPI* lpi, /**< LP interface structure */
231  int* dstat /**< deletion status of columns
232  * input: 1 if column should be deleted, 0 if not
233  * output: new position of column, -1 if column was deleted */
234  )
235 { /*lint --e{715}*/
236  int cnt = 0;
237  int j;
238 
239  assert( lpi != NULL );
240  assert( dstat != NULL );
241  assert( lpi->ncols >= 0 );
242 
243  for (j = 0; j < lpi->ncols; ++j)
244  {
245  if ( dstat[j] )
246  {
247  ++cnt;
248  dstat[j] = -1;
249  }
250  else
251  dstat[j] = cnt;
252  }
253  lpi->ncols -= cnt;
254  assert( lpi->ncols >= 0 );
255 
256  return SCIP_OKAY;
257 }
258 
259 /** adds rows to the LP */
261  SCIP_LPI* lpi, /**< LP interface structure */
262  int nrows, /**< number of rows to be added */
263  const SCIP_Real* lhs, /**< left hand sides of new rows */
264  const SCIP_Real* rhs, /**< right hand sides of new rows */
265  char** rownames, /**< row names, or NULL */
266  int nnonz, /**< number of nonzero elements to be added to the constraint matrix */
267  const int* beg, /**< start index of each row in ind- and val-array, or NULL if nnonz == 0 */
268  const int* ind, /**< column indices of constraint matrix entries, or NULL if nnonz == 0 */
269  const SCIP_Real* val /**< values of constraint matrix entries, or NULL if nnonz == 0 */
270  )
271 { /*lint --e{715}*/
272  assert( lpi != NULL );
273  assert( lpi->nrows >= 0 );
274 
275  lpi->nrows += nrows;
276 
277  return SCIP_OKAY;
278 }
279 
280 /** deletes all rows in the given range from LP */
282  SCIP_LPI* lpi, /**< LP interface structure */
283  int firstrow, /**< first row to be deleted */
284  int lastrow /**< last row to be deleted */
285  )
286 { /*lint --e{715}*/
287  assert( lpi != NULL );
288  assert( lpi->nrows >= 0 );
289 
290  lpi->nrows -= lastrow - firstrow + 1;
291  assert( lpi->nrows >= 0 );
292 
293  return SCIP_OKAY;
294 }
295 
296 /** deletes rows from SCIP_LP; the new position of a row must not be greater that its old position */
298  SCIP_LPI* lpi, /**< LP interface structure */
299  int* dstat /**< deletion status of rows
300  * input: 1 if row should be deleted, 0 if not
301  * output: new position of row, -1 if row was deleted */
302  )
303 { /*lint --e{715}*/
304  int cnt = 0;
305  int i;
306 
307  assert( lpi != NULL );
308  assert( dstat != NULL );
309  assert( lpi->nrows >= 0 );
310 
311  for (i = 0; i < lpi->nrows; ++i)
312  {
313  if ( dstat[i] )
314  {
315  ++cnt;
316  dstat[i] = -1;
317  }
318  else
319  dstat[i] = cnt;
320  }
321  lpi->nrows -= cnt;
322  assert( lpi->nrows >= 0 );
323 
324  return SCIP_OKAY;
325 }
326 
327 /** clears the whole LP */
329  SCIP_LPI* lpi /**< LP interface structure */
330  )
331 { /*lint --e{715}*/
332  assert( lpi != NULL );
333  assert( lpi->nrows >= 0 );
334  assert( lpi->ncols >= 0 );
335 
336  lpi->nrows = 0;
337  lpi->ncols = 0;
338 
339  return SCIP_OKAY;
340 }
341 
342 /** changes lower and upper bounds of columns */
344  SCIP_LPI* lpi, /**< LP interface structure */
345  int ncols, /**< number of columns to change bounds for */
346  const int* ind, /**< column indices */
347  const SCIP_Real* lb, /**< values for the new lower bounds */
348  const SCIP_Real* ub /**< values for the new upper bounds */
349  )
350 { /*lint --e{715}*/
351  return SCIP_OKAY;
352 }
353 
354 /** changes left and right hand sides of rows */
356  SCIP_LPI* lpi, /**< LP interface structure */
357  int nrows, /**< number of rows to change sides for */
358  const int* ind, /**< row indices */
359  const SCIP_Real* lhs, /**< new values for left hand sides */
360  const SCIP_Real* rhs /**< new values for right hand sides */
361  )
362 { /*lint --e{715}*/
363  return SCIP_OKAY;
364 }
365 
366 /** changes a single coefficient */
368  SCIP_LPI* lpi, /**< LP interface structure */
369  int row, /**< row number of coefficient to change */
370  int col, /**< column number of coefficient to change */
371  SCIP_Real newval /**< new value of coefficient */
372  )
373 { /*lint --e{715}*/
374  return SCIP_OKAY;
375 }
376 
377 /** changes the objective sense */
379  SCIP_LPI* lpi, /**< LP interface structure */
380  SCIP_OBJSEN objsen /**< new objective sense */
381  )
382 { /*lint --e{715}*/
383  return SCIP_OKAY;
384 }
385 
386 /** changes objective values of columns in the LP */
388  SCIP_LPI* lpi, /**< LP interface structure */
389  int ncols, /**< number of columns to change objective value for */
390  int* ind, /**< column indices to change objective value for */
391  SCIP_Real* obj /**< new objective values for columns */
392  )
393 { /*lint --e{715}*/
394  return SCIP_OKAY;
395 }
396 
397 /** multiplies a row with a non-zero scalar; for negative scalars, the row's sense is switched accordingly */
399  SCIP_LPI* lpi, /**< LP interface structure */
400  int row, /**< row number to scale */
401  SCIP_Real scaleval /**< scaling multiplier */
402  )
403 { /*lint --e{715}*/
404  return SCIP_OKAY;
405 }
406 
407 /** multiplies a column with a non-zero scalar; the objective value is multiplied with the scalar, and the bounds
408  * are divided by the scalar; for negative scalars, the column's bounds are switched
409  */
411  SCIP_LPI* lpi, /**< LP interface structure */
412  int col, /**< column number to scale */
413  SCIP_Real scaleval /**< scaling multiplier */
414  )
415 { /*lint --e{715}*/
416  return SCIP_OKAY;
417 }
418 
419 /**@} */
420 
421 
422 
423 
424 /*
425  * Data Accessing Methods
426  */
427 
428 /**@name Data Accessing Methods */
429 /**@{ */
430 
431 /** gets the number of rows in the LP */
433  SCIP_LPI* lpi, /**< LP interface structure */
434  int* nrows /**< pointer to store the number of rows */
435  )
436 { /*lint --e{715}*/
437  assert( lpi != NULL );
438  assert( nrows != NULL );
439  assert( lpi->nrows >= 0 );
440 
441  *nrows = lpi->nrows;
442 
443  return SCIP_OKAY;
444 }
445 
446 /** gets the number of columns in the LP */
448  SCIP_LPI* lpi, /**< LP interface structure */
449  int* ncols /**< pointer to store the number of cols */
450  )
451 { /*lint --e{715}*/
452  assert( lpi != NULL );
453  assert( ncols != NULL );
454  assert( lpi->ncols >= 0 );
455 
456  *ncols = lpi->ncols;
457 
458  return SCIP_OKAY;
459 }
460 
461 /** gets the number of nonzero elements in the LP constraint matrix */
463  SCIP_LPI* lpi, /**< LP interface structure */
464  int* nnonz /**< pointer to store the number of nonzeros */
465  )
466 { /*lint --e{715}*/
467  assert(nnonz != NULL);
468  errorMessage();
469  return SCIP_PLUGINNOTFOUND;
470 }
471 
472 /** gets columns from LP problem object; the arrays have to be large enough to store all values
473  * Either both, lb and ub, have to be NULL, or both have to be non-NULL,
474  * either nnonz, beg, ind, and val have to be NULL, or all of them have to be non-NULL.
475  */
477  SCIP_LPI* lpi, /**< LP interface structure */
478  int firstcol, /**< first column to get from LP */
479  int lastcol, /**< last column to get from LP */
480  SCIP_Real* lb, /**< buffer to store the lower bound vector, or NULL */
481  SCIP_Real* ub, /**< buffer to store the upper bound vector, or NULL */
482  int* nnonz, /**< pointer to store the number of nonzero elements returned, or NULL */
483  int* beg, /**< buffer to store start index of each column in ind- and val-array, or NULL */
484  int* ind, /**< buffer to store column indices of constraint matrix entries, or NULL */
485  SCIP_Real* val /**< buffer to store values of constraint matrix entries, or NULL */
486  )
487 { /*lint --e{715}*/
488  errorMessage();
489  return SCIP_PLUGINNOTFOUND;
490 }
491 
492 /** gets rows from LP problem object; the arrays have to be large enough to store all values.
493  * Either both, lhs and rhs, have to be NULL, or both have to be non-NULL,
494  * either nnonz, beg, ind, and val have to be NULL, or all of them have to be non-NULL.
495  */
497  SCIP_LPI* lpi, /**< LP interface structure */
498  int firstrow, /**< first row to get from LP */
499  int lastrow, /**< last row to get from LP */
500  SCIP_Real* lhs, /**< buffer to store left hand side vector, or NULL */
501  SCIP_Real* rhs, /**< buffer to store right hand side vector, or NULL */
502  int* nnonz, /**< pointer to store the number of nonzero elements returned, or NULL */
503  int* beg, /**< buffer to store start index of each row in ind- and val-array, or NULL */
504  int* ind, /**< buffer to store row indices of constraint matrix entries, or NULL */
505  SCIP_Real* val /**< buffer to store values of constraint matrix entries, or NULL */
506  )
507 { /*lint --e{715}*/
508  errorMessage();
509  return SCIP_PLUGINNOTFOUND;
510 }
511 
512 /** gets column names */
514  SCIP_LPI* lpi, /**< LP interface structure */
515  int firstcol, /**< first column to get name from LP */
516  int lastcol, /**< last column to get name from LP */
517  char** colnames, /**< pointers to column names (of size at least lastcol-firstcol+1) */
518  char* namestorage, /**< storage for col names */
519  int namestoragesize, /**< size of namestorage (if 0, storageleft returns the storage needed) */
520  int* storageleft /**< amount of storage left (if < 0 the namestorage was not big enough) */
521  )
522 {
523  errorMessage();
524  return SCIP_PLUGINNOTFOUND;
525 }
526 
527 /** gets row names */
529  SCIP_LPI* lpi, /**< LP interface structure */
530  int firstrow, /**< first row to get name from LP */
531  int lastrow, /**< last row to get name from LP */
532  char** rownames, /**< pointers to row names (of size at least lastrow-firstrow+1) */
533  char* namestorage, /**< storage for row names */
534  int namestoragesize, /**< size of namestorage (if 0, -storageleft returns the storage needed) */
535  int* storageleft /**< amount of storage left (if < 0 the namestorage was not big enough) */
536  )
537 {
538  errorMessage();
539  return SCIP_PLUGINNOTFOUND;
540 }
541 
542 /** gets the objective sense of the LP */
544  SCIP_LPI* lpi, /**< LP interface structure */
545  SCIP_OBJSEN* objsen /**< pointer to store objective sense */
546  )
547 { /*lint --e{715}*/
548  errorMessage();
549  return SCIP_PLUGINNOTFOUND;
550 }
551 
552 /** gets objective coefficients from LP problem object */
554  SCIP_LPI* lpi, /**< LP interface structure */
555  int firstcol, /**< first column to get objective coefficient for */
556  int lastcol, /**< last column to get objective coefficient for */
557  SCIP_Real* vals /**< array to store objective coefficients */
558  )
559 { /*lint --e{715}*/
560  errorMessage();
561  return SCIP_PLUGINNOTFOUND;
562 }
563 
564 /** gets current bounds from LP problem object */
566  SCIP_LPI* lpi, /**< LP interface structure */
567  int firstcol, /**< first column to get bounds for */
568  int lastcol, /**< last column to get bounds for */
569  SCIP_Real* lbs, /**< array to store lower bound values, or NULL */
570  SCIP_Real* ubs /**< array to store upper bound values, or NULL */
571  )
572 { /*lint --e{715}*/
573  errorMessage();
574  return SCIP_PLUGINNOTFOUND;
575 }
576 
577 /** gets current row sides from LP problem object */
579  SCIP_LPI* lpi, /**< LP interface structure */
580  int firstrow, /**< first row to get sides for */
581  int lastrow, /**< last row to get sides for */
582  SCIP_Real* lhss, /**< array to store left hand side values, or NULL */
583  SCIP_Real* rhss /**< array to store right hand side values, or NULL */
584  )
585 { /*lint --e{715}*/
586  assert(firstrow <= lastrow);
587  errorMessage();
588  return SCIP_PLUGINNOTFOUND;
589 }
590 
591 /** gets a single coefficient */
593  SCIP_LPI* lpi, /**< LP interface structure */
594  int row, /**< row number of coefficient */
595  int col, /**< column number of coefficient */
596  SCIP_Real* val /**< pointer to store the value of the coefficient */
597  )
598 { /*lint --e{715}*/
599  errorMessage();
600  return SCIP_PLUGINNOTFOUND;
601 }
602 
603 /**@} */
604 
605 
606 
607 
608 /*
609  * Solving Methods
610  */
611 
612 /**@name Solving Methods */
613 /**@{ */
614 
615 /** calls primal simplex to solve the LP */
617  SCIP_LPI* lpi /**< LP interface structure */
618  )
619 { /*lint --e{715}*/
620  errorMessage();
621  return SCIP_PLUGINNOTFOUND;
622 }
623 
624 /** calls dual simplex to solve the LP */
626  SCIP_LPI* lpi /**< LP interface structure */
627  )
628 { /*lint --e{715}*/
629  errorMessage();
630  return SCIP_PLUGINNOTFOUND;
631 }
632 
633 /** calls barrier or interior point algorithm to solve the LP with crossover to simplex basis */
635  SCIP_LPI* lpi, /**< LP interface structure */
636  SCIP_Bool crossover /**< perform crossover */
637  )
638 { /*lint --e{715}*/
639  errorMessage();
640  return SCIP_PLUGINNOTFOUND;
641 }
642 
643 /** start strong branching - call before any strong branching */
645  SCIP_LPI* lpi /**< LP interface structure */
646  )
647 { /*lint --e{715}*/
648  assert( lpi != NULL);
649  return SCIP_OKAY;
650 }
651 
652 /** end strong branching - call after any strong branching */
654  SCIP_LPI* lpi /**< LP interface structure */
655  )
656 { /*lint --e{715}*/
657  assert( lpi != NULL);
658  return SCIP_OKAY;
659 }
660 
661 /** performs strong branching iterations on one @b fractional candidate */
663  SCIP_LPI* lpi, /**< LP interface structure */
664  int col, /**< column to apply strong branching on */
665  SCIP_Real psol, /**< fractional current primal solution value of column */
666  int itlim, /**< iteration limit for strong branchings */
667  SCIP_Real* down, /**< stores dual bound after branching column down */
668  SCIP_Real* up, /**< stores dual bound after branching column up */
669  SCIP_Bool* downvalid, /**< stores whether the returned down value is a valid dual bound;
670  * otherwise, it can only be used as an estimate value */
671  SCIP_Bool* upvalid, /**< stores whether the returned up value is a valid dual bound;
672  * otherwise, it can only be used as an estimate value */
673  int* iter /**< stores total number of strong branching iterations, or -1; may be NULL */
674  )
675 { /*lint --e{715}*/
676  assert( down != NULL );
677  assert( up != NULL );
678  assert( downvalid != NULL );
679  assert( upvalid != NULL );
680  errorMessage();
681  return SCIP_PLUGINNOTFOUND;
682 }
683 
684 /** performs strong branching iterations on given @b fractional candidates */
686  SCIP_LPI* lpi, /**< LP interface structure */
687  int* cols, /**< columns to apply strong branching on */
688  int ncols, /**< number of columns */
689  SCIP_Real* psols, /**< fractional current primal solution values of columns */
690  int itlim, /**< iteration limit for strong branchings */
691  SCIP_Real* down, /**< stores dual bounds after branching columns down */
692  SCIP_Real* up, /**< stores dual bounds after branching columns up */
693  SCIP_Bool* downvalid, /**< stores whether the returned down values are valid dual bounds;
694  * otherwise, they can only be used as an estimate values */
695  SCIP_Bool* upvalid, /**< stores whether the returned up values are a valid dual bounds;
696  * otherwise, they can only be used as an estimate values */
697  int* iter /**< stores total number of strong branching iterations, or -1; may be NULL */
698  )
699 { /*lint --e{715}*/
700  assert( cols != NULL );
701  assert( psols != NULL );
702  assert( down != NULL );
703  assert( up != NULL );
704  assert( downvalid != NULL );
705  assert( upvalid != NULL );
706  errorMessage();
707  return SCIP_PLUGINNOTFOUND;
708 }
709 
710 /** performs strong branching iterations on one candidate with @b integral value */
712  SCIP_LPI* lpi, /**< LP interface structure */
713  int col, /**< column to apply strong branching on */
714  SCIP_Real psol, /**< current integral primal solution value of column */
715  int itlim, /**< iteration limit for strong branchings */
716  SCIP_Real* down, /**< stores dual bound after branching column down */
717  SCIP_Real* up, /**< stores dual bound after branching column up */
718  SCIP_Bool* downvalid, /**< stores whether the returned down value is a valid dual bound;
719  * otherwise, it can only be used as an estimate value */
720  SCIP_Bool* upvalid, /**< stores whether the returned up value is a valid dual bound;
721  * otherwise, it can only be used as an estimate value */
722  int* iter /**< stores total number of strong branching iterations, or -1; may be NULL */
723  )
724 { /*lint --e{715}*/
725  assert( down != NULL );
726  assert( up != NULL );
727  assert( downvalid != NULL );
728  assert( upvalid != NULL );
729  errorMessage();
730  return SCIP_PLUGINNOTFOUND;
731 }
732 
733 /** performs strong branching iterations on given candidates with @b integral values */
735  SCIP_LPI* lpi, /**< LP interface structure */
736  int* cols, /**< columns to apply strong branching on */
737  int ncols, /**< number of columns */
738  SCIP_Real* psols, /**< current integral primal solution values of columns */
739  int itlim, /**< iteration limit for strong branchings */
740  SCIP_Real* down, /**< stores dual bounds after branching columns down */
741  SCIP_Real* up, /**< stores dual bounds after branching columns up */
742  SCIP_Bool* downvalid, /**< stores whether the returned down values are valid dual bounds;
743  * otherwise, they can only be used as an estimate values */
744  SCIP_Bool* upvalid, /**< stores whether the returned up values are a valid dual bounds;
745  * otherwise, they can only be used as an estimate values */
746  int* iter /**< stores total number of strong branching iterations, or -1; may be NULL */
747  )
748 { /*lint --e{715}*/
749  assert( cols != NULL );
750  assert( psols != NULL );
751  assert( down != NULL );
752  assert( up != NULL );
753  assert( downvalid != NULL );
754  assert( upvalid != NULL );
755  errorMessage();
756  return SCIP_PLUGINNOTFOUND;
757 }
758 /**@} */
759 
760 
761 
762 
763 /*
764  * Solution Information Methods
765  */
766 
767 /**@name Solution Information Methods */
768 /**@{ */
769 
770 /** returns whether a solve method was called after the last modification of the LP */
772  SCIP_LPI* lpi /**< LP interface structure */
773  )
774 { /*lint --e{715}*/
776  return FALSE;
777 }
778 
779 /** gets information about primal and dual feasibility of the current LP solution */
781  SCIP_LPI* lpi, /**< LP interface structure */
782  SCIP_Bool* primalfeasible, /**< stores primal feasibility status */
783  SCIP_Bool* dualfeasible /**< stores dual feasibility status */
784  )
785 { /*lint --e{715}*/
786  assert(primalfeasible != NULL);
787  assert(dualfeasible != NULL);
788  errorMessage();
789  return SCIP_PLUGINNOTFOUND;
790 }
791 
792 /** returns TRUE iff LP is proven to have a primal unbounded ray (but not necessary a primal feasible point);
793  * this does not necessarily mean, that the solver knows and can return the primal ray
794  */
796  SCIP_LPI* lpi /**< LP interface structure */
797  )
798 { /*lint --e{715}*/
800  return FALSE;
801 }
802 
803 /** returns TRUE iff LP is proven to have a primal unbounded ray (but not necessary a primal feasible point),
804  * and the solver knows and can return the primal ray
805  */
807  SCIP_LPI* lpi /**< LP interface structure */
808  )
809 { /*lint --e{715}*/
811  return FALSE;
812 }
813 
814 /** returns TRUE iff LP is proven to be primal unbounded */
816  SCIP_LPI* lpi /**< LP interface structure */
817  )
818 { /*lint --e{715}*/
820  return FALSE;
821 }
822 
823 /** returns TRUE iff LP is proven to be primal infeasible */
825  SCIP_LPI* lpi /**< LP interface structure */
826  )
827 { /*lint --e{715}*/
829  return FALSE;
830 }
831 
832 /** returns TRUE iff LP is proven to be primal feasible */
834  SCIP_LPI* lpi /**< LP interface structure */
835  )
836 { /*lint --e{715}*/
838  return FALSE;
839 }
840 
841 /** returns TRUE iff LP is proven to have a dual unbounded ray (but not necessary a dual feasible point);
842  * this does not necessarily mean, that the solver knows and can return the dual ray
843  */
845  SCIP_LPI* lpi /**< LP interface structure */
846  )
847 { /*lint --e{715}*/
849  return FALSE;
850 }
851 
852 /** returns TRUE iff LP is proven to have a dual unbounded ray (but not necessary a dual feasible point),
853  * and the solver knows and can return the dual ray
854  */
856  SCIP_LPI* lpi /**< LP interface structure */
857  )
858 { /*lint --e{715}*/
860  return FALSE;
861 }
862 
863 /** returns TRUE iff LP is proven to be dual unbounded */
865  SCIP_LPI* lpi /**< LP interface structure */
866  )
867 { /*lint --e{715}*/
869  return FALSE;
870 }
871 
872 /** returns TRUE iff LP is proven to be dual infeasible */
874  SCIP_LPI* lpi /**< LP interface structure */
875  )
876 { /*lint --e{715}*/
878  return FALSE;
879 }
880 
881 /** returns TRUE iff LP is proven to be dual feasible */
883  SCIP_LPI* lpi /**< LP interface structure */
884  )
885 { /*lint --e{715}*/
887  return FALSE;
888 }
889 
890 /** returns TRUE iff LP was solved to optimality */
892  SCIP_LPI* lpi /**< LP interface structure */
893  )
894 { /*lint --e{715}*/
896  return FALSE;
897 }
898 
899 /** returns TRUE iff current LP basis is stable */
901  SCIP_LPI* lpi /**< LP interface structure */
902  )
903 { /*lint --e{715}*/
905  return FALSE;
906 }
907 
908 /** returns TRUE iff the objective limit was reached */
910  SCIP_LPI* lpi /**< LP interface structure */
911  )
912 { /*lint --e{715}*/
914  return FALSE;
915 }
916 
917 /** returns TRUE iff the iteration limit was reached */
919  SCIP_LPI* lpi /**< LP interface structure */
920  )
921 { /*lint --e{715}*/
923  return FALSE;
924 }
925 
926 /** returns TRUE iff the time limit was reached */
928  SCIP_LPI* lpi /**< LP interface structure */
929  )
930 { /*lint --e{715}*/
932  return FALSE;
933 }
934 
935 /** returns the internal solution status of the solver */
937  SCIP_LPI* lpi /**< LP interface structure */
938  )
939 { /*lint --e{715}*/
941  return FALSE;
942 }
943 
944 /** tries to reset the internal status of the LP solver in order to ignore an instability of the last solving call */
946  SCIP_LPI* lpi, /**< LP interface structure */
947  SCIP_Bool* success /**< pointer to store, whether the instability could be ignored */
948  )
949 { /*lint --e{715}*/
950  assert(success != NULL);
951  errorMessage();
952  return SCIP_PLUGINNOTFOUND;
953 }
954 
955 /** gets objective value of solution */
957  SCIP_LPI* lpi, /**< LP interface structure */
958  SCIP_Real* objval /**< stores the objective value */
959  )
960 { /*lint --e{715}*/
961  assert(objval != NULL);
962  errorMessage();
963  return SCIP_PLUGINNOTFOUND;
964 }
965 
966 /** gets primal and dual solution vectors */
968  SCIP_LPI* lpi, /**< LP interface structure */
969  SCIP_Real* objval, /**< stores the objective value, may be NULL if not needed */
970  SCIP_Real* primsol, /**< primal solution vector, may be NULL if not needed */
971  SCIP_Real* dualsol, /**< dual solution vector, may be NULL if not needed */
972  SCIP_Real* activity, /**< row activity vector, may be NULL if not needed */
973  SCIP_Real* redcost /**< reduced cost vector, may be NULL if not needed */
974  )
975 { /*lint --e{715}*/
976  errorMessage();
977  return SCIP_PLUGINNOTFOUND;
978 }
979 
980 /** gets primal ray for unbounded LPs */
982  SCIP_LPI* lpi, /**< LP interface structure */
983  SCIP_Real* ray /**< primal ray */
984  )
985 { /*lint --e{715}*/
986  errorMessage();
987  return SCIP_PLUGINNOTFOUND;
988 }
989 
990 /** gets dual Farkas proof for infeasibility */
992  SCIP_LPI* lpi, /**< LP interface structure */
993  SCIP_Real* dualfarkas /**< dual Farkas row multipliers */
994  )
995 { /*lint --e{715}*/
996  assert(dualfarkas != NULL);
997  errorMessage();
998  return SCIP_PLUGINNOTFOUND;
999 }
1000 
1001 /** gets the number of LP iterations of the last solve call */
1003  SCIP_LPI* lpi, /**< LP interface structure */
1004  int* iterations /**< pointer to store the number of iterations of the last solve call */
1005  )
1006 { /*lint --e{715}*/
1007  assert(iterations != NULL);
1008  errorMessage();
1009  return SCIP_PLUGINNOTFOUND;
1010 }
1011 
1012 /** gets information about the quality of an LP solution
1013  *
1014  * Such information is usually only available, if also a (maybe not optimal) solution is available.
1015  * The LPI should return SCIP_INVALID for @p quality, if the requested quantity is not available.
1016  */
1018  SCIP_LPI* lpi, /**< LP interface structure */
1019  SCIP_LPSOLQUALITY qualityindicator, /**< indicates which quality should be returned */
1020  SCIP_Real* quality /**< pointer to store quality number */
1021  )
1022 {
1023  assert(lpi != NULL);
1024  assert(quality != NULL);
1025 
1026  *quality = SCIP_INVALID;
1027 
1028  return SCIP_OKAY;
1029 }
1030 
1031 /**@} */
1032 
1033 
1034 
1035 
1036 /*
1037  * LP Basis Methods
1038  */
1039 
1040 /**@name LP Basis Methods */
1041 /**@{ */
1042 
1043 /** gets current basis status for columns and rows; arrays must be large enough to store the basis status */
1045  SCIP_LPI* lpi, /**< LP interface structure */
1046  int* cstat, /**< array to store column basis status, or NULL */
1047  int* rstat /**< array to store row basis status, or NULL */
1048  )
1049 { /*lint --e{715}*/
1050  errorMessage();
1051  return SCIP_PLUGINNOTFOUND;
1052 }
1053 
1054 /** sets current basis status for columns and rows */
1056  SCIP_LPI* lpi, /**< LP interface structure */
1057  int* cstat, /**< array with column basis status */
1058  int* rstat /**< array with row basis status */
1059  )
1060 { /*lint --e{715}*/
1061  assert(cstat != NULL);
1062  assert(rstat != NULL);
1063  errorMessage();
1064  return SCIP_PLUGINNOTFOUND;
1065 }
1066 
1067 /** returns the indices of the basic columns and rows; basic column n gives value n, basic row m gives value -1-m */
1068 extern
1070  SCIP_LPI* lpi, /**< LP interface structure */
1071  int* bind /**< pointer to store basis indices ready to keep number of rows entries */
1072  )
1073 { /*lint --e{715}*/
1074  errorMessage();
1075  return SCIP_PLUGINNOTFOUND;
1076 }
1077 
1078 /** get dense row of inverse basis matrix B^-1 */
1080  SCIP_LPI* lpi, /**< LP interface structure */
1081  int r, /**< row number */
1082  SCIP_Real* coef /**< pointer to store the coefficients of the row */
1083  )
1084 { /*lint --e{715}*/
1085  errorMessage();
1086  return SCIP_PLUGINNOTFOUND;
1087 }
1088 
1089 /** get dense column of inverse basis matrix B^-1 */
1091  SCIP_LPI* lpi, /**< LP interface structure */
1092  int c, /**< column number of B^-1; this is NOT the number of the column in the LP;
1093  * you have to call SCIPlpiGetBasisInd() to get the array which links the
1094  * B^-1 column numbers to the row and column numbers of the LP!
1095  * c must be between 0 and nrows-1, since the basis has the size
1096  * nrows * nrows */
1097  SCIP_Real* coef /**< pointer to store the coefficients of the column */
1098  )
1099 { /*lint --e{715}*/
1100  errorMessage();
1101  return SCIP_PLUGINNOTFOUND;
1102 }
1103 
1104 /** get dense row of inverse basis matrix times constraint matrix B^-1 * A */
1106  SCIP_LPI* lpi, /**< LP interface structure */
1107  int r, /**< row number */
1108  const SCIP_Real* binvrow, /**< row in (A_B)^-1 from prior call to SCIPlpiGetBInvRow(), or NULL */
1109  SCIP_Real* coef /**< vector to return coefficients */
1110  )
1111 { /*lint --e{715}*/
1112  errorMessage();
1113  return SCIP_PLUGINNOTFOUND;
1114 }
1115 
1116 /** get dense column of inverse basis matrix times constraint matrix B^-1 * A */
1118  SCIP_LPI* lpi, /**< LP interface structure */
1119  int c, /**< column number */
1120  SCIP_Real* coef /**< vector to return coefficients */
1121  )
1122 { /*lint --e{715}*/
1123  errorMessage();
1124  return SCIP_PLUGINNOTFOUND;
1125 }
1126 
1127 /**@} */
1128 
1129 
1130 
1131 
1132 /*
1133  * LP State Methods
1134  */
1135 
1136 /**@name LP State Methods */
1137 /**@{ */
1138 
1139 /** stores LPi state (like basis information) into lpistate object */
1141  SCIP_LPI* lpi, /**< LP interface structure */
1142  BMS_BLKMEM* blkmem, /**< block memory */
1143  SCIP_LPISTATE** lpistate /**< pointer to LPi state information (like basis information) */
1144  )
1145 { /*lint --e{715}*/
1146  assert(blkmem != NULL);
1147  assert(lpistate != NULL);
1148  errorMessage();
1149  return SCIP_PLUGINNOTFOUND;
1150 }
1151 
1152 /** loads LPi state (like basis information) into solver; note that the LP might have been extended with additional
1153  * columns and rows since the state was stored with SCIPlpiGetState()
1154  */
1156  SCIP_LPI* lpi, /**< LP interface structure */
1157  BMS_BLKMEM* blkmem, /**< block memory */
1158  SCIP_LPISTATE* lpistate /**< LPi state information (like basis information) */
1159  )
1160 { /*lint --e{715}*/
1161  assert(blkmem != NULL);
1162  errorMessage();
1163  return SCIP_PLUGINNOTFOUND;
1164 }
1165 
1166 /** clears current LPi state (like basis information) of the solver */
1168  SCIP_LPI* lpi /**< LP interface structure */
1169  )
1170 { /*lint --e{715}*/
1171  assert(lpi != NULL);
1172  return SCIP_OKAY;
1173 }
1174 
1175 /** frees LPi state information */
1177  SCIP_LPI* lpi, /**< LP interface structure */
1178  BMS_BLKMEM* blkmem, /**< block memory */
1179  SCIP_LPISTATE** lpistate /**< pointer to LPi state information (like basis information) */
1180  )
1181 { /*lint --e{715}*/
1182  return SCIP_OKAY;
1183 }
1184 
1185 /** checks, whether the given LP state contains simplex basis information */
1187  SCIP_LPI* lpi, /**< LP interface structure */
1188  SCIP_LPISTATE* lpistate /**< LP state information (like basis information) */
1189  )
1190 { /*lint --e{715}*/
1192  return FALSE;
1193 }
1194 
1195 /** reads LP state (like basis information from a file */
1197  SCIP_LPI* lpi, /**< LP interface structure */
1198  const char* fname /**< file name */
1199  )
1200 { /*lint --e{715}*/
1201  errorMessage();
1202  return SCIP_PLUGINNOTFOUND;
1203 }
1204 
1205 /** writes LP state (like basis information) to a file */
1207  SCIP_LPI* lpi, /**< LP interface structure */
1208  const char* fname /**< file name */
1209  )
1210 { /*lint --e{715}*/
1211  errorMessage();
1212  return SCIP_PLUGINNOTFOUND;
1213 }
1214 
1215 /**@} */
1216 
1217 
1218 
1219 
1220 /*
1221  * LP Pricing Norms Methods
1222  */
1223 
1224 /**@name LP Pricing Norms Methods */
1225 /**@{ */
1226 
1227 /** stores LPi pricing norms information
1228  * @todo should we store norm information?
1229  */
1231  SCIP_LPI* lpi, /**< LP interface structure */
1232  BMS_BLKMEM* blkmem, /**< block memory */
1233  SCIP_LPINORMS** lpinorms /**< pointer to LPi pricing norms information */
1234  )
1235 { /*lint --e{715}*/
1236  errorMessage();
1237  return SCIP_PLUGINNOTFOUND;
1238 }
1239 
1240 /** loads LPi pricing norms into solver; note that the LP might have been extended with additional
1241  * columns and rows since the state was stored with SCIPlpiGetNorms()
1242  */
1244  SCIP_LPI* lpi, /**< LP interface structure */
1245  BMS_BLKMEM* blkmem, /**< block memory */
1246  SCIP_LPINORMS* lpinorms /**< LPi pricing norms information */
1247  )
1248 { /*lint --e{715}*/
1249  errorMessage();
1250  return SCIP_PLUGINNOTFOUND;
1251 }
1252 
1253 /** frees pricing norms information */
1255  SCIP_LPI* lpi, /**< LP interface structure */
1256  BMS_BLKMEM* blkmem, /**< block memory */
1257  SCIP_LPINORMS** lpinorms /**< pointer to LPi pricing norms information */
1258  )
1259 { /*lint --e{715}*/
1260  errorMessage();
1261  return SCIP_PLUGINNOTFOUND;
1262 }
1263 
1264 /**@} */
1265 
1266 
1267 
1268 
1269 /*
1270  * Parameter Methods
1271  */
1272 
1273 /**@name Parameter Methods */
1274 /**@{ */
1275 
1276 /** gets integer parameter of LP */
1278  SCIP_LPI* lpi, /**< LP interface structure */
1279  SCIP_LPPARAM type, /**< parameter number */
1280  int* ival /**< buffer to store the parameter value */
1281  )
1282 { /*lint --e{715}*/
1283  assert(ival != NULL);
1284  return SCIP_PARAMETERUNKNOWN;
1285 }
1286 
1287 /** sets integer parameter of LP */
1289  SCIP_LPI* lpi, /**< LP interface structure */
1290  SCIP_LPPARAM type, /**< parameter number */
1291  int ival /**< parameter value */
1292  )
1293 { /*lint --e{715}*/
1294  return SCIP_PARAMETERUNKNOWN;
1295 }
1296 
1297 /** gets floating point parameter of LP */
1299  SCIP_LPI* lpi, /**< LP interface structure */
1300  SCIP_LPPARAM type, /**< parameter number */
1301  SCIP_Real* dval /**< buffer to store the parameter value */
1302  )
1303 { /*lint --e{715}*/
1304  assert(dval != NULL);
1305  return SCIP_PARAMETERUNKNOWN;
1306 }
1307 
1308 /** sets floating point parameter of LP */
1310  SCIP_LPI* lpi, /**< LP interface structure */
1311  SCIP_LPPARAM type, /**< parameter number */
1312  SCIP_Real dval /**< parameter value */
1313  )
1314 { /*lint --e{715}*/
1315  return SCIP_PARAMETERUNKNOWN;
1316 }
1317 
1318 /**@} */
1319 
1320 /*
1321  * Numerical Methods
1322  */
1323 
1324 /**@name Numerical Methods */
1325 /**@{ */
1326 
1327 /** returns value treated as infinity in the LP solver */
1329  SCIP_LPI* lpi /**< LP interface structure */
1330  )
1331 { /*lint --e{715}*/
1332  return LPIINFINITY;
1333 }
1334 
1335 /** checks if given value is treated as infinity in the LP solver */
1337  SCIP_LPI* lpi, /**< LP interface structure */
1338  SCIP_Real val /**< value to be checked for infinity */
1339  )
1340 { /*lint --e{715}*/
1341  if( val >= LPIINFINITY )
1342  return TRUE;
1343  return FALSE;
1344 }
1345 
1346 /**@} */
1347 
1348 
1349 
1350 
1351 /*
1352  * File Interface Methods
1353  */
1354 
1355 /**@name File Interface Methods */
1356 /**@{ */
1357 
1358 /** reads LP from a file */
1360  SCIP_LPI* lpi, /**< LP interface structure */
1361  const char* fname /**< file name */
1362  )
1363 { /*lint --e{715}*/
1364  errorMessage();
1365  return SCIP_PLUGINNOTFOUND;
1366 }
1367 
1368 /** writes LP to a file */
1370  SCIP_LPI* lpi, /**< LP interface structure */
1371  const char* fname /**< file name */
1372  )
1373 { /*lint --e{715}*/
1374  errorMessage();
1375  return SCIP_PLUGINNOTFOUND;
1376 }
1377 
1378 /**@} */
1379