scip_lp.h
Go to the documentation of this file.
29 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
102 /** makes sure that the LP of the current node is loaded and may be accessed through the LP information methods
104 * @warning Contructing the LP might change the amount of variables known in the transformed problem and therefore also
105 * the variables array of SCIP (returned by SCIPgetVars() and SCIPgetVarsData()), so it might be necessary to
108 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
124 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
179 /** returns whether the current lp is a relaxation of the current problem and its optimal objective value is a local lower bound
181 * @return whether the current lp is a relaxation of the current problem and its optimal objective value is a local lower bound.
195 * @return the objective value of current LP (which is the sum of column and loose objective value).
200 * @note This method returns the objective value of the current LP solution, which might be primal or dual infeasible
201 * if a limit was hit during solving. It must not be used as a dual bound if the LP solution status returned by
239 /** gets the global pseudo objective value; that is all variables set to their best (w.r.t. the objective
242 * @return the global pseudo objective value; that is all variables set to their best (w.r.t. the objective
260 /** gets the pseudo objective value for the current search node; that is all variables set to their best (w.r.t. the
263 * @return the pseudo objective value for the current search node; that is all variables set to their best (w.r.t. the
281 /** returns whether the root lp is a relaxation of the problem and its optimal objective value is a global lower bound
283 * @return whether the root lp is a relaxation of the problem and its optimal objective value is a global lower bound.
295 /** gets the objective value of the root node LP or SCIP_INVALID if the root node LP was not (yet) solved
297 * @return the objective value of the root node LP or SCIP_INVALID if the root node LP was not (yet) solved.
312 /** gets part of the objective value of the root node LP that results from COLUMN variables only;
315 * @return the part of the objective value of the root node LP that results from COLUMN variables only;
331 /** gets part of the objective value of the root node LP that results from LOOSE variables only;
334 * @return the part of the objective value of the root node LP that results from LOOSE variables only;
352 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
397 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
440 /** returns TRUE iff all columns, i.e. every variable with non-empty column w.r.t. all ever created rows, are present
441 * in the LP, and FALSE, if there are additional already existing columns, that may be added to the LP in pricing
443 * @return TRUE iff all columns, i.e. every variable with non-empty column w.r.t. all ever created rows, are present
444 * in the LP, and FALSE, if there are additional already existing columns, that may be added to the LP in pricing.
470 /** gets all indices of basic columns and rows: index i >= 0 corresponds to column i, index i < 0 to row -i-1
472 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
488 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
508 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
530 /** gets a row from the product of inverse basis matrix B^-1 and coefficient matrix A (i.e. from B^-1 * A)
532 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
551 /** gets a column from the product of inverse basis matrix B^-1 and coefficient matrix A (i.e. from B^-1 * A),
554 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
572 /** calculates a weighted sum of all LP rows; for negative weights, the left and right hand side of the corresponding
575 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
587 SCIP_REALARRAY* sumcoef, /**< array to store sum coefficients indexed by variables' probindex */
594 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
610 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
631 * @warning You have to make sure, that the full internal state of the LPI does not change or is recovered completely
632 * after the end of the method that uses the LPI. In particular, if you manipulate the LP or its solution
633 * (e.g. by calling one of the SCIPlpiAdd...() or one of the SCIPlpiSolve...() methods), you have to check in
634 * advance with SCIPlpiWasSolved() whether the LP is currently solved. If this is the case, you have to make
635 * sure, the internal solution status is recovered completely at the end of your method. This can be achieved
636 * by getting the LPI state before applying any LPI manipulations with SCIPlpiGetState() and restoring it
637 * afterwards with SCIPlpiSetState() and SCIPlpiFreeState(). Additionally you have to resolve the LP with the
640 * @warning Make also sure, that all parameter values that you have changed are set back to their original values.
642 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
664 /** Displays quality information about the current LP solution. An LP solution need to be available. Information printed
667 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
695 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
734 * @note calling this method in SCIP_STAGE_SOLVED is only recommended to experienced users and should only be called
737 * @note The return value of this method should be used carefully if the dual feasibility check was explictely disabled.
778 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
797 SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */
803 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
822 SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */
828 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
846 SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */
852 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
859 * @deprecated Please use SCIPcreateRowCons() or SCIPcreateRowSepa() when calling from a constraint handler or separator in order
860 * to facilitate correct statistics. If the call is from neither a constraint handler or separator, use SCIPcreateRowUnspec().
873 SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */
879 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
895 SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */
901 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
917 SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */
923 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
938 SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */
944 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
951 * @deprecated Please use SCIPcreateEmptyRowCons() or SCIPcreateEmptyRowSepa() when calling from a constraint handler or separator in order
952 * to facilitate correct statistics. If the call is from neither a constraint handler or separator, use SCIPcreateEmptyRowUnspec().
962 SCIP_Bool modifiable, /**< is row modifiable during node processing (subject to column generation)? */
968 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
983 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
999 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1015 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1029 /** informs row, that all subsequent additions of variables to the row should be cached and not directly applied;
1031 * while the caching of row extensions is activated, information methods of the row give invalid results;
1032 * caching should be used, if a row is build with SCIPaddVarToRow() calls variable by variable to increase
1035 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1048 /** flushes all cached row extensions after a call of SCIPcacheRowExtensions() and merges coefficients with
1051 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1066 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1069 * @attention If the absolute value of val is below the SCIP epsilon tolerance, the variable will not added.
1075 * @note In case calling this method in the enforcement process of an lp solution, it might be that some variables,
1076 * that were not yet in the LP (e.g. dynamic columns) will change their lp solution value returned by SCIP.
1077 * For example, a variable, which has a negative objective value, that has no column in the lp yet, is in the lp solution
1078 * on its upper bound (variables with status SCIP_VARSTATUS_LOOSE are in an lp solution on it's best bound), but
1079 * creating the column, changes the solution value (variable than has status SCIP_VARSTATUS_COLUMN, and the
1080 * initialization sets the lp solution value) to 0.0. (This leads to the conclusion that, if a constraint was
1094 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1097 * @attention If a coefficients absolute value is below the SCIP epsilon tolerance, the variable with its value is not added.
1115 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1118 * @attention If the absolute value of val is below the SCIP epsilon tolerance, the variables will not added.
1133 /** tries to find a value, such that all row coefficients, if scaled with this value become integral
1135 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1146 SCIP_Real mindelta, /**< minimal relative allowed difference of scaled coefficient s*c and integral i */
1147 SCIP_Real maxdelta, /**< maximal relative allowed difference of scaled coefficient s*c and integral i */
1150 SCIP_Bool usecontvars, /**< should the coefficients of the continuous variables also be made integral? */
1151 SCIP_Real* intscalar, /**< pointer to store scalar that would make the coefficients integral, or NULL */
1157 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1168 SCIP_Real mindelta, /**< minimal relative allowed difference of scaled coefficient s*c and integral i */
1169 SCIP_Real maxdelta, /**< maximal relative allowed difference of scaled coefficient s*c and integral i */
1172 SCIP_Bool usecontvars, /**< should the coefficients of the continuous variables also be made integral? */
1257 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1297 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1322 /** returns the feasibility of a row for the current pseudo solution: negative value means infeasibility
1324 * @return the feasibility of a row for the current pseudo solution: negative value means infeasibility
1337 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1405 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1428 /** initiates LP diving, making methods SCIPchgVarObjDive(), SCIPchgVarLbDive(), and SCIPchgVarUbDive() available
1430 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1438 * @note diving is allowed even if the current LP is not flushed, not solved, or not solved to optimality; be aware
1439 * that solving the (first) diving LP may take longer than expect and that the latter two cases could stem from
1440 * numerical troubles during the last LP solve; because of this, most users will want to call this method only if
1448 /** quits LP diving and resets bounds and objective values of columns to the current node's values
1450 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1465 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1481 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1498 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1515 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1532 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1546 /** changes row lhs in current dive, change will be undone after diving ends, for permanent changes use SCIPchgRowLhs()
1548 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1563 /** changes row rhs in current dive, change will be undone after diving ends, for permanent changes use SCIPchgRowRhs()
1565 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1626 * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
1634 * @note be aware that the LP solve may take longer than expected if SCIPgetLPSolstat(scip) != SCIP_LPSOLSTAT_OPTIMAL,
1646 /** returns the number of the node in the current branch and bound run, where the last LP was solved in diving
1649 * @return the number of the node in the current branch and bound run, where the last LP was solved in diving
SCIP_RETCODE SCIPaddVarsToRowSameCoef(SCIP *scip, SCIP_ROW *row, int nvars, SCIP_VAR **vars, SCIP_Real val)
Definition: scip_lp.c:1674
SCIP_RETCODE SCIPcreateRowSepa(SCIP *scip, SCIP_ROW **row, SCIP_SEPA *sepa, const char *name, int len, SCIP_COL **cols, SCIP_Real *vals, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool removable)
Definition: scip_lp.c:1238
SCIP_RETCODE SCIPcreateEmptyRow(SCIP *scip, SCIP_ROW **row, const char *name, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool removable)
Definition: scip_lp.c:1425
SCIP_RETCODE SCIPgetLPBInvRow(SCIP *scip, int r, SCIP_Real *coefs, int *inds, int *ninds)
Definition: scip_lp.c:717
SCIP_RETCODE SCIPcomputeLPRelIntPoint(SCIP *scip, SCIP_Bool relaxrows, SCIP_Bool inclobjcutoff, SCIP_Real timelimit, int iterlimit, SCIP_SOL **point)
Definition: scip_lp.c:1073
SCIP_RETCODE SCIPcacheRowExtensions(SCIP *scip, SCIP_ROW *row)
Definition: scip_lp.c:1547
internal methods for branch and bound tree
type definitions for miscellaneous datastructures
SCIP_RETCODE SCIPcreateEmptyRowUnspec(SCIP *scip, SCIP_ROW **row, const char *name, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool removable)
Definition: scip_lp.c:1394
Definition: struct_scip.h:58
SCIP_RETCODE SCIPrecalcRowLPActivity(SCIP *scip, SCIP_ROW *row)
Definition: scip_lp.c:1875
SCIP_RETCODE SCIPflushRowExtensions(SCIP *scip, SCIP_ROW *row)
Definition: scip_lp.c:1570
SCIP_RETCODE SCIPcreateRowUnspec(SCIP *scip, SCIP_ROW **row, const char *name, int len, SCIP_COL **cols, SCIP_Real *vals, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool removable)
Definition: scip_lp.c:1272
SCIP_RETCODE SCIPaddVarToRow(SCIP *scip, SCIP_ROW *row, SCIP_VAR *var, SCIP_Real val)
Definition: scip_lp.c:1602
SCIP_Real SCIPgetRowPseudoFeasibility(SCIP *scip, SCIP_ROW *row)
Definition: scip_lp.c:1965
Definition: struct_var.h:198
SCIP_RETCODE SCIPchgVarLbDive(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip_lp.c:2301
SCIP_RETCODE SCIPgetLPBInvCol(SCIP *scip, int c, SCIP_Real *coefs, int *inds, int *ninds)
Definition: scip_lp.c:752
type definitions for return codes for SCIP methods
SCIP_RETCODE SCIPrecalcRowActivity(SCIP *scip, SCIP_ROW *row)
Definition: scip_lp.c:1983
SCIP_RETCODE SCIPcreateRow(SCIP *scip, SCIP_ROW **row, const char *name, int len, SCIP_COL **cols, SCIP_Real *vals, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool removable)
Definition: scip_lp.c:1306
Definition: struct_sepa.h:37
SCIP_RETCODE SCIPgetLPColsData(SCIP *scip, SCIP_COL ***cols, int *ncols)
Definition: scip_lp.c:495
SCIP_Real SCIPgetRowFeasibility(SCIP *scip, SCIP_ROW *row)
Definition: scip_lp.c:2025
SCIP_Real SCIPgetRowMaxActivity(SCIP *scip, SCIP_ROW *row)
Definition: scip_lp.c:1857
Definition: struct_lp.h:126
type definitions for LP management
Definition: struct_sol.h:63
SCIP_RETCODE SCIPchgRowLhsDive(SCIP *scip, SCIP_ROW *row, SCIP_Real newlhs)
Definition: scip_lp.c:2404
Definition: struct_misc.h:140
void SCIPmarkRowNotRemovableLocal(SCIP *scip, SCIP_ROW *row)
Definition: scip_lp.c:1769
SCIP_RETCODE SCIPsolveDiveLP(SCIP *scip, int itlim, SCIP_Bool *lperror, SCIP_Bool *cutoff)
Definition: scip_lp.c:2560
Definition: struct_cons.h:117
SCIP_RETCODE SCIPrecalcRowPseudoActivity(SCIP *scip, SCIP_ROW *row)
Definition: scip_lp.c:1929
type definitions for SCIP's main datastructure
SCIP_RETCODE SCIPchgCutoffboundDive(SCIP *scip, SCIP_Real newcutoffbound)
Definition: scip_lp.c:2230
SCIP_RETCODE SCIPsumLPRows(SCIP *scip, SCIP_Real *weights, SCIP_REALARRAY *sumcoef, SCIP_Real *sumlhs, SCIP_Real *sumrhs)
Definition: scip_lp.c:855
type definitions for specific LP solvers interface
internal miscellaneous methods
internal methods for global SCIP settings
SCIP main data structure.
type definitions for problem variables
SCIP_Real SCIPgetRowLPActivity(SCIP *scip, SCIP_ROW *row)
Definition: scip_lp.c:1894
SCIP_RETCODE SCIPcreateRowCons(SCIP *scip, SCIP_ROW **row, SCIP_CONSHDLR *conshdlr, const char *name, int len, SCIP_COL **cols, SCIP_Real *vals, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool removable)
Definition: scip_lp.c:1204
SCIP_RETCODE SCIPgetLPBInvACol(SCIP *scip, int c, SCIP_Real *coefs, int *inds, int *ninds)
Definition: scip_lp.c:822
internal methods for problem variables
SCIP_RETCODE SCIPgetLPBInvARow(SCIP *scip, int r, SCIP_Real *binvrow, SCIP_Real *coefs, int *inds, int *ninds)
Definition: scip_lp.c:788
SCIP_RETCODE SCIPchgRowRhs(SCIP *scip, SCIP_ROW *row, SCIP_Real rhs)
Definition: scip_lp.c:1519
SCIP_Real SCIPgetRowPseudoActivity(SCIP *scip, SCIP_ROW *row)
Definition: scip_lp.c:1948
SCIP_RETCODE SCIPcreateEmptyRowCons(SCIP *scip, SCIP_ROW **row, SCIP_CONSHDLR *conshdlr, const char *name, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool removable)
Definition: scip_lp.c:1336
SCIP_RETCODE SCIPchgVarUbDive(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound)
Definition: scip_lp.c:2333
Definition: struct_lp.h:192
methods for debugging
SCIP_RETCODE SCIPcreateEmptyRowSepa(SCIP *scip, SCIP_ROW **row, SCIP_SEPA *sepa, const char *name, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool removable)
Definition: scip_lp.c:1365
SCIP_RETCODE SCIPchgRowLhs(SCIP *scip, SCIP_ROW *row, SCIP_Real lhs)
Definition: scip_lp.c:1495
void SCIPmarkColNotRemovableLocal(SCIP *scip, SCIP_COL *col)
Definition: scip_lp.c:1181
datastructures for problem statistics
SCIP_Real SCIPgetRowSolActivity(SCIP *scip, SCIP_ROW *row, SCIP_SOL *sol)
Definition: scip_lp.c:2045
type definitions for storing primal CIP solutions
SCIP_RETCODE SCIPprintLPSolutionQuality(SCIP *scip, FILE *file)
Definition: scip_lp.c:1000
SCIP_RETCODE SCIPwriteMIP(SCIP *scip, const char *filename, SCIP_Bool genericnames, SCIP_Bool origobj, SCIP_Bool lazyconss)
Definition: scip_lp.c:914
SCIP_RETCODE SCIPchgVarObjDive(SCIP *scip, SCIP_VAR *var, SCIP_Real newobj)
Definition: scip_lp.c:2260
internal methods for main solving loop and node processing
type definitions for separators
SCIP_Real SCIPgetRowLPFeasibility(SCIP *scip, SCIP_ROW *row)
Definition: scip_lp.c:1911
SCIP_RETCODE SCIPaddVarsToRow(SCIP *scip, SCIP_ROW *row, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
Definition: scip_lp.c:1628
SCIP_Real SCIPgetRowMinActivity(SCIP *scip, SCIP_ROW *row)
Definition: scip_lp.c:1840
internal methods for constraints and constraint handlers
SCIP_RETCODE SCIPprintRow(SCIP *scip, SCIP_ROW *row, FILE *file)
Definition: scip_lp.c:2094
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:1716
SCIP_Real SCIPgetRowSolFeasibility(SCIP *scip, SCIP_ROW *row, SCIP_SOL *sol)
Definition: scip_lp.c:2068
SCIP_Real SCIPgetColFarkasCoef(SCIP *scip, SCIP_COL *col)
Definition: scip_lp.c:1159
SCIP_RETCODE SCIPgetLPRowsData(SCIP *scip, SCIP_ROW ***rows, int *nrows)
Definition: scip_lp.c:573
common defines and data types used in all packages of SCIP
SCIP_RETCODE SCIPchgRowRhsDive(SCIP *scip, SCIP_ROW *row, SCIP_Real newrhs)
Definition: scip_lp.c:2437
Definition: objbenders.h:33
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:1745
type definitions for constraints and constraint handlers