lpi_cpx.c
Go to the documentation of this file.
31 /* CPLEX supports FASTMIP which fastens the lp solving process but therefor it might happen that there will be a loss in 35 /*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/ 57 /* this macro is only called in functions returning SCIP_Bool; thus, we return FALSE if there is an error in optimized mode */ 69 /* At several places we need to guarantee to have a factorization of an optimal basis and call the simplex to produce 70 * it. In a numerical perfect world, this should need no iterations. However, due to numerical inaccuracies after 71 * refactorization, it might be necessary to do a few extra pivot steps, in particular if FASTMIP is used. */ 72 #define CPX_REFACTORMAXITERS 50 /* maximal number of iterations allowed for producing a refactorization of the basis */ 74 /* CPLEX seems to ignore bounds with absolute value less than 1e-10. There is no interface define for this constant yet, 78 typedef SCIP_DUALPACKET COLPACKET; /* each column needs two bits of information (basic/on_lower/on_upper) */ 80 typedef SCIP_DUALPACKET ROWPACKET; /* each row needs two bit of information (basic/on_lower/on_upper) */ 167 SCIP_Real conditionlimit; /**< maximum condition number of LP basis counted as stable (-1.0: no limit) */ 173 #if (CPX_VERSION == 1100 || (CPX_VERSION == 1220 && (CPX_SUBVERSION == 0 || CPX_SUBVERSION == 2))) 174 int pseudonthreads; /**< number of threads that SCIP set for the LP solver, but due to CPLEX bug, 365 /* because the basis status values are equally defined in SCIP and CPLEX, they don't need to be transformed */ 490 CHECK_ZERO( lpi->messagehdlr, CPXgetintparam(lpi->cpxenv, intparam[i], &(cpxparam->intparval[i])) ); 494 CHECK_ZERO( lpi->messagehdlr, CPXgetdblparam(lpi->cpxenv, dblparam[i], &(cpxparam->dblparval[i])) ); 546 CHECK_ZERO( lpi->messagehdlr, CPXsetintparam(lpi->cpxenv, intparam[i], lpi->curparam.intparval[i]) ); 556 CHECK_ZERO( lpi->messagehdlr, CPXsetdblparam(lpi->cpxenv, dblparam[i], lpi->curparam.dblparval[i]) ); 763 * -> To keep SCIP's meaning of the rhs value, we would like to use negative range values: rng := lhs - rhs, 771 * -> Because of this bug, we have to use an additional rhsarray[] for the converted right hand sides and 772 * use rhsarray[i] = lhs[i] and rngarray[i] = rhs[i] - lhs[i] for ranged rows to keep the range values 841 /** converts CPLEX's sen/rhs/rng triplets into SCIP's lhs/rhs pairs, only storing the left hand side */ 889 /** converts CPLEX's sen/rhs/rng triplets into SCIP's lhs/rhs pairs, only storing the right hand side */ 955 /** after restoring the old lp data in CPLEX we need to resolve the lp to be able to retrieve correct information */ 963 /* modifying the LP, restoring the old LP, and loading the old basis is not enough for CPLEX to be able to return the 966 * this may happen after manual strong branching on an integral variable, or after conflict analysis on a strong 967 * branching conflict created a constraint that is not able to modify the LP but trigger the additional call of the 970 * In a numerical perfect world, CPX_REFACTORMAXITERS below should be zero. However, due to numerical inaccuracies 976 SCIPmessagePrintWarning(lpi->messagehdlr, "CPLEX needed %d phase 1 iterations to restore optimal basis.\n", CPXgetphase1cnt(lpi->cpxenv, lpi->cpxlp)); 978 SCIPmessagePrintWarning(lpi->messagehdlr, "CPLEX needed %d iterations to restore optimal basis.\n", CPXgetitcnt(lpi->cpxenv, lpi->cpxlp)); 1005 sprintf(cpxname, "CPLEX %d.%d.%d.%d", CPX_VERSION_VERSION, CPX_VERSION_RELEASE, CPX_VERSION_MODIFICATION, CPX_VERSION_FIX); 1007 sprintf(cpxname, "CPLEX %d.%d.%d.%d", CPX_VERSION/100, (CPX_VERSION%100)/10, CPX_VERSION%10, CPX_SUBVERSION); 1052 assert(sizeof(SCIP_Real) == sizeof(double)); /* CPLEX only works with doubles as floating points */ 1064 #if (CPX_VERSION == 1100 || (CPX_VERSION == 1220 && (CPX_SUBVERSION == 0 || CPX_SUBVERSION == 2))) 1065 /* manually set number of threads to 1 to avoid huge system load due to CPLEX bug (version 1100) or segmentation fault (version 1220) */ 1069 #if 0 /* turning presolve off seems to be faster than turning it off on demand (if presolve detects infeasibility) */ 1215 CHECK_ZERO( lpi->messagehdlr, CPXcopylpwnames(lpi->cpxenv, lpi->cpxlp, ncols, nrows, cpxObjsen(objsen), obj, 1216 lpi->rhsarray, lpi->senarray, beg, cnt, ind, val, lb, ub, lpi->rngarray, colnames, rownames) ); 1237 const int* beg, /**< start index of each column in ind- and val-array, or NULL if nnonz == 0 */ 1252 CHECK_ZERO( lpi->messagehdlr, CPXaddcols(lpi->cpxenv, lpi->cpxlp, ncols, nnonz, obj, beg, ind, val, lb, ub, colnames) ); 1256 CHECK_ZERO( lpi->messagehdlr, CPXnewcols(lpi->cpxenv, lpi->cpxlp, ncols, obj, lb, ub, NULL, colnames) ); 1272 assert(0 <= firstcol && firstcol <= lastcol && lastcol < CPXgetnumcols(lpi->cpxenv, lpi->cpxlp)); 1283 /** deletes columns from SCIP_LP; the new position of a column must not be greater that its old position */ 1335 CHECK_ZERO( lpi->messagehdlr, CPXaddrows(lpi->cpxenv, lpi->cpxlp, 0, nrows, nnonz, lpi->rhsarray, lpi->senarray, beg, ind, val, NULL, 1340 CHECK_ZERO( lpi->messagehdlr, CPXnewrows(lpi->cpxenv, lpi->cpxlp, nrows, lpi->rhsarray, lpi->senarray, NULL, rownames) ); 1351 CHECK_ZERO( lpi->messagehdlr, CPXchgrngval(lpi->cpxenv, lpi->cpxlp, rngcount, lpi->rngindarray, lpi->rngarray) ); 1367 assert(0 <= firstrow && firstrow <= lastrow && lastrow < CPXgetnumrows(lpi->cpxenv, lpi->cpxlp)); 1378 /** deletes rows from SCIP_LP; the new position of a row must not be greater that its old position */ 1455 CHECK_ZERO( lpi->messagehdlr, CPXchgbds(lpi->cpxenv, lpi->cpxlp, ncols, ind, lpi->larray, (SCIP_Real*)lb) ); 1456 CHECK_ZERO( lpi->messagehdlr, CPXchgbds(lpi->cpxenv, lpi->cpxlp, ncols, ind, lpi->uarray, (SCIP_Real*)ub) ); 1505 CHECK_ZERO( lpi->messagehdlr, CPXchgsense(lpi->cpxenv, lpi->cpxlp, nrows, ind, lpi->senarray) ); 1518 CHECK_ZERO( lpi->messagehdlr, CPXchgrngval(lpi->cpxenv, lpi->cpxlp, rngcount, lpi->rngindarray, lpi->rngarray) ); 1587 /** multiplies a row with a non-zero scalar; for negative scalars, the row's sense is switched accordingly */ 1612 SCIP_CALL( SCIPlpiGetRows(lpi, row, row, &lhs, &rhs, &nnonz, &beg, lpi->indarray, lpi->valarray) ); 1641 /** multiplies a column with a non-zero scalar; the objective value is multiplied with the scalar, and the bounds 1669 SCIP_CALL( SCIPlpiGetCols(lpi, col, col, &lb, &ub, &nnonz, &beg, lpi->indarray, lpi->valarray) ); 1768 /** gets columns from LP problem object; the arrays have to be large enough to store all values 1787 assert(0 <= firstcol && firstcol <= lastcol && lastcol < CPXgetnumcols(lpi->cpxenv, lpi->cpxlp)); 1845 assert(0 <= firstrow && firstrow <= lastrow && lastrow < CPXgetnumrows(lpi->cpxenv, lpi->cpxlp)); 1853 CHECK_ZERO( lpi->messagehdlr, CPXgetsense(lpi->cpxenv, lpi->cpxlp, lpi->senarray, firstrow, lastrow) ); 1854 CHECK_ZERO( lpi->messagehdlr, CPXgetrhs(lpi->cpxenv, lpi->cpxlp, lpi->rhsarray, firstrow, lastrow) ); 1897 int namestoragesize, /**< size of namestorage (if 0, storageleft returns the storage needed) */ 1910 assert(0 <= firstcol && firstcol <= lastcol && lastcol < CPXgetnumcols(lpi->cpxenv, lpi->cpxlp)); 1914 retcode = CPXgetcolname(lpi->cpxenv, lpi->cpxlp, colnames, namestorage, namestoragesize, storageleft, firstcol, lastcol); 1931 int namestoragesize, /**< size of namestorage (if 0, -storageleft returns the storage needed) */ 1944 assert(0 <= firstrow && firstrow <= lastrow && lastrow < CPXgetnumrows(lpi->cpxenv, lpi->cpxlp)); 1948 retcode = CPXgetrowname(lpi->cpxenv, lpi->cpxlp, rownames, namestorage, namestoragesize, storageleft, firstrow, lastrow); 1966 assert(CPXgetobjsen(lpi->cpxenv, lpi->cpxlp) == CPX_MIN || CPXgetobjsen(lpi->cpxenv, lpi->cpxlp) == CPX_MAX); 1970 *objsen = (CPXgetobjsen(lpi->cpxenv, lpi->cpxlp) == CPX_MIN) ? SCIP_OBJSEN_MINIMIZE : SCIP_OBJSEN_MAXIMIZE; 2045 CHECK_ZERO( lpi->messagehdlr, CPXgetsense(lpi->cpxenv, lpi->cpxlp, lpi->senarray, firstrow, lastrow) ); 2046 CHECK_ZERO( lpi->messagehdlr, CPXgetrhs(lpi->cpxenv, lpi->cpxlp, lpi->rhsarray, firstrow, lastrow) ); 2118 lpi->iterations = CPXgetphase1cnt(lpi->cpxenv, lpi->cpxlp) + CPXgetitcnt(lpi->cpxenv, lpi->cpxlp); 2131 CHECK_ZERO( lpi->messagehdlr, CPXsolninfo(lpi->cpxenv, lpi->cpxlp, NULL, NULL, &primalfeasible, &dualfeasible) ); 2141 /* maybe the preprocessor solved the problem; but we need a solution, so solve again without preprocessing */ 2142 SCIPdebugMessage("presolver may have solved the problem -> calling CPLEX primal simplex again without presolve\n"); 2159 lpi->iterations += CPXgetphase1cnt(lpi->cpxenv, lpi->cpxlp) + CPXgetitcnt(lpi->cpxenv, lpi->cpxlp); 2162 SCIPdebugMessage(" -> CPLEX returned solstat=%d (%d iterations)\n", lpi->solstat, lpi->iterations); 2171 SCIPerrorMessage("CPLEX primal simplex returned CPX_STAT_INForUNBD after presolving was turned off\n"); 2175 /* check whether the solution is basic: if Cplex, e.g., hits a time limit in data setup, this might not be the case, 2183 CHECK_ZERO( lpi->messagehdlr, CPXsolninfo(lpi->cpxenv, lpi->cpxlp, NULL, &solntype, NULL, NULL) ); 2190 CHECK_ZERO( lpi->messagehdlr, CPXsolninfo(lpi->cpxenv, lpi->cpxlp, NULL, &solntype, NULL, NULL) ); 2223 lpi->iterations = CPXgetphase1cnt(lpi->cpxenv, lpi->cpxlp) + CPXgetitcnt(lpi->cpxenv, lpi->cpxlp); 2234 CHECK_ZERO( lpi->messagehdlr, CPXsolninfo(lpi->cpxenv, lpi->cpxlp, NULL, &solntype, NULL, NULL) ); 2238 CHECK_ZERO( lpi->messagehdlr, CPXsolninfo(lpi->cpxenv, lpi->cpxlp, NULL, NULL, &primalfeasible, &dualfeasible) ); 2248 /* maybe the preprocessor solved the problem; but we need a solution, so solve again without preprocessing */ 2249 SCIPdebugMessage("presolver may have solved the problem -> calling CPLEX dual simplex again without presolve\n"); 2266 lpi->iterations += CPXgetphase1cnt(lpi->cpxenv, lpi->cpxlp) + CPXgetitcnt(lpi->cpxenv, lpi->cpxlp); 2269 CHECK_ZERO( lpi->messagehdlr, CPXsolninfo(lpi->cpxenv, lpi->cpxlp, NULL, NULL, &primalfeasible, &dualfeasible) ); 2270 SCIPdebugMessage(" -> CPLEX returned solstat=%d (%d iterations)\n", lpi->solstat, lpi->iterations); 2279 SCIPerrorMessage("CPLEX dual simplex returned CPX_STAT_INForUNBD after presolving was turned off\n"); 2283 /* check whether the solution is basic: if Cplex, e.g., hits a time limit in data setup, this might not be the case, 2291 CHECK_ZERO( lpi->messagehdlr, CPXsolninfo(lpi->cpxenv, lpi->cpxlp, NULL, &solntype, NULL, NULL) ); 2298 CHECK_ZERO( lpi->messagehdlr, CPXsolninfo(lpi->cpxenv, lpi->cpxlp, NULL, &solntype, NULL, NULL) ); 2303 /* this fixes the strange behavior of CPLEX, that in case of the objective limit exceedance, it returns the 2305 * (using this "wrong" dual solution can cause column generation algorithms to fail to find an improving column) 2327 SCIPdebugMessage("dual solution %g does not exceed objective limit [%g,%g] (%d iterations) -> calling CPLEX dual simplex again for one iteration\n", 2349 lpi->iterations += CPXgetphase1cnt(lpi->cpxenv, lpi->cpxlp) + CPXgetitcnt(lpi->cpxenv, lpi->cpxlp); 2371 lpi->iterations += CPXgetphase1cnt(lpi->cpxenv, lpi->cpxlp) + CPXgetitcnt(lpi->cpxenv, lpi->cpxlp); 2374 SCIPdebugMessage(" -> CPLEX returned solstat=%d (%d iterations)\n", lpi->solstat, lpi->iterations); 2382 /** calls barrier or interior point algorithm to solve the LP with crossover to simplex basis */ 2418 CHECK_ZERO( lpi->messagehdlr, CPXsolninfo(lpi->cpxenv, lpi->cpxlp, NULL, &solntype, NULL, NULL) ); 2423 SCIPdebugMessage(" -> CPLEX returned solstat=%d (%d iterations)\n", lpi->solstat, lpi->iterations); 2427 /* maybe the preprocessor solved the problem; but we need a solution, so solve again without preprocessing */ 2428 SCIPdebugMessage("CPLEX returned INForUNBD -> calling CPLEX barrier again without presolve\n"); 2445 CHECK_ZERO( lpi->messagehdlr, CPXsolninfo(lpi->cpxenv, lpi->cpxlp, NULL, &solntype, NULL, NULL) ); 2456 SCIPerrorMessage("CPLEX barrier returned CPX_STAT_INForUNBD after presolving was turned off\n"); 2519 *down = objsen == CPX_MIN ? getDblParam(lpi, CPX_PARAM_OBJULIM) : getDblParam(lpi, CPX_PARAM_OBJLLIM); 2525 *down = objsen == CPX_MIN ? getDblParam(lpi, CPX_PARAM_OBJLLIM) : getDblParam(lpi, CPX_PARAM_OBJULIM); 2537 *down = objsen == CPX_MIN ? getDblParam(lpi, CPX_PARAM_OBJULIM) : getDblParam(lpi, CPX_PARAM_OBJLLIM); 2546 *up = objsen == CPX_MIN ? getDblParam(lpi, CPX_PARAM_OBJULIM) : getDblParam(lpi, CPX_PARAM_OBJLLIM); 2552 *up = objsen == CPX_MIN ? getDblParam(lpi, CPX_PARAM_OBJLLIM) : getDblParam(lpi, CPX_PARAM_OBJULIM); 2564 *up = objsen == CPX_MIN ? getDblParam(lpi, CPX_PARAM_OBJLLIM) : getDblParam(lpi, CPX_PARAM_OBJULIM); 2615 SCIPdebugMessage("calling CPLEX strongbranching on fractional variable %d (%d iterations)\n", col, itlim); 2683 SCIPdebugMessage("calling CPLEX strongbranching on %d fractional variables (%d iterations)\n", ncols, itlim); 2742 SCIPdebugMessage("calling CPLEX strongbranching on variable %d with integral value (%d iterations)\n", col, itlim); 2749 SCIP_CALL( lpiStrongbranchIntegral(lpi, col, psol, itlim, down, up, downvalid, upvalid, iter) ); 2781 SCIPdebugMessage("calling CPLEX strongbranching on %d variables with integer values (%d iterations)\n", ncols, itlim); 2790 SCIP_CALL( lpiStrongbranchIntegral(lpi, cols[j], psols[j], itlim, &(down[j]), &(up[j]), &(downvalid[j]), &(upvalid[j]), iter) ); 2835 CHECK_ZERO( lpi->messagehdlr, CPXsolninfo(lpi->cpxenv, lpi->cpxlp, NULL, NULL, &pfeas, &dfeas) ); 2842 /** returns TRUE iff LP is proven to have a primal unbounded ray (but not necessary a primal feasible point); 2853 return (lpi->solstat == CPX_STAT_UNBOUNDED || lpi->solstat == CPX_STAT_OPTIMAL_FACE_UNBOUNDED); 2856 /** returns TRUE iff LP is proven to have a primal unbounded ray (but not necessary a primal feasible point), 2868 return (lpi->solstat == CPX_STAT_UNBOUNDED && CPXgetmethod(lpi->cpxenv, lpi->cpxlp) == CPX_ALG_PRIMAL); 2887 /* If the solution status of CPLEX is CPX_STAT_UNBOUNDED, it only means, there is an unbounded ray, 2888 * but not necessarily a feasible primal solution. If primalfeasible == FALSE, we cannot conclude, 2891 return ((primalfeasible && (lpi->solstat == CPX_STAT_UNBOUNDED || lpi->solstat == CPX_STAT_INForUNBD)) 2911 return (lpi->solstat == CPX_STAT_INFEASIBLE || (lpi->solstat == CPX_STAT_INForUNBD && dualfeasible)); 2933 /** returns TRUE iff LP is proven to have a dual unbounded ray (but not necessary a dual feasible point); 2946 /** returns TRUE iff LP is proven to have a dual unbounded ray (but not necessary a dual feasible point), 2958 return (lpi->solstat == CPX_STAT_INFEASIBLE && CPXgetmethod(lpi->cpxenv, lpi->cpxlp) == CPX_ALG_DUAL); 2977 return (dualfeasible && (lpi->solstat == CPX_STAT_INFEASIBLE || lpi->solstat == CPX_STAT_INForUNBD)); 3043 /* If the solution status of CPLEX is CPX_STAT_UNBOUNDED, it only means, there is an unbounded ray, 3044 * but not necessarily a feasible primal solution. If primalfeasible == FALSE, we interpret this 3057 /* If the condition number of the basis should be checked, everything above the specified threshold is counted 3072 /* if the kappa could not be computed (e.g., because we do not have a basis), we cannot check the condition */ 3126 /** tries to reset the internal status of the LP solver in order to ignore an instability of the last solving call */ 3197 CHECK_ZERO( lpi->messagehdlr, CPXsolution(lpi->cpxenv, lpi->cpxlp, &dummy, objval, primsol, dualsol, NULL, redcost) ); 3202 CHECK_ZERO( lpi->messagehdlr, CPXgetax(lpi->cpxenv, lpi->cpxlp, activity, 0, CPXgetnumrows(lpi->cpxenv, lpi->cpxlp)-1) ); 3263 * Such information is usually only available, if also a (maybe not optimal) solution is available. 3264 * The LPI should return SCIP_INVALID for @p quality, if the requested quantity is not available. 3297 CHECK_ZERO( lpi->messagehdlr, CPXsolninfo(lpi->cpxenv, lpi->cpxlp, NULL, &solntype, NULL, NULL) ); 3319 /** gets current basis status for columns and rows; arrays must be large enough to store the basis status */ 3338 /* correct rstat values for "<=" constraints: Here CPX_AT_LOWER bound means that the slack is 0, i.e., the upper bound is tight */ 3350 /* because the basis status values are equally defined in SCIP and CPLEX, they don't need to be transformed */ 3380 /* because the basis status values are equally defined in SCIP and CPLEX, they don't need to be transformed */ 3386 /* correct rstat values for ">=" constraints: Here CPX_AT_LOWER bound means that the slack is 0, i.e., the upper bound is tight */ 3403 /** returns the indices of the basic columns and rows; basic column n gives value n, basic row m gives value -1-m */ 3417 /* this might be turned off if the user as called SCIPlpiClearState() or set SCIP_LPPAR_FROMSCRATCH to TRUE */ 3422 if( retval == CPXERR_NO_SOLN || retval == CPXERR_NO_LU_FACTOR || retval == CPXERR_NO_BASIC_SOLN || retval == CPXERR_NO_BASIS ) 3434 * @note The LP interface defines slack variables to have coefficient +1. This means that if, internally, the LP solver 3435 * uses a -1 coefficient, then rows associated with slacks variables whose coefficient is -1, should be negated; 3460 /* this might be turned off if the user as called SCIPlpiClearState() or set SCIP_LPPAR_FROMSCRATCH to TRUE */ 3465 if( retval == CPXERR_NO_SOLN || retval == CPXERR_NO_LU_FACTOR || retval == CPXERR_NO_BASIC_SOLN || retval == CPXERR_NO_BASIS ) 3472 /* the LPi expects slack variables with coefficient +1; CPLEX adds slack variables with a coefficient -1 for 'G' 3488 CHECK_ZERO( lpi->messagehdlr, CPXgetsense(lpi->cpxenv, lpi->cpxlp, &rowsense, basicrow, basicrow) ); 3505 * @note The LP interface defines slack variables to have coefficient +1. This means that if, internally, the LP solver 3506 * uses a -1 coefficient, then rows associated with slacks variables whose coefficient is -1, should be negated; 3536 /* this might be turned off if the user as called SCIPlpiClearState() or set SCIP_LPPAR_FROMSCRATCH to TRUE */ 3541 if( retval == CPXERR_NO_SOLN || retval == CPXERR_NO_LU_FACTOR || retval == CPXERR_NO_BASIC_SOLN || retval == CPXERR_NO_BASIS ) 3548 /* the LPi expects slack variables with coefficient +1; CPLEX adds slack variables with a coefficient -1 for 'G' 3555 CHECK_ZERO( lpi->messagehdlr, CPXgetsense(lpi->cpxenv, lpi->cpxlp, lpi->senarray, 0, nrows - 1) ); 3568 if( basicrow >= 0 && basicrow < nrows && (lpi->senarray[basicrow] == 'G' || lpi->senarray[basicrow] == 'R') ) 3578 * @note The LP interface defines slack variables to have coefficient +1. This means that if, internally, the LP solver 3579 * uses a -1 coefficient, then rows associated with slacks variables whose coefficient is -1, should be negated; 3585 const SCIP_Real* binvrow, /**< row in (A_B)^-1 from prior call to SCIPlpiGetBInvRow(), or NULL */ 3605 /* this might be turned off if the user as called SCIPlpiClearState() or set SCIP_LPPAR_FROMSCRATCH to TRUE */ 3610 if( retval == CPXERR_NO_SOLN || retval == CPXERR_NO_LU_FACTOR || retval == CPXERR_NO_BASIC_SOLN || retval == CPXERR_NO_BASIS ) 3617 /* the LPi expects slack variables with coefficient +1; CPLEX adds slack variables with a coefficient -1 for 'G' 3633 CHECK_ZERO( lpi->messagehdlr, CPXgetsense(lpi->cpxenv, lpi->cpxlp, &rowsense, basicrow, basicrow) ); 3650 * @note The LP interface defines slack variables to have coefficient +1. This means that if, internally, the LP solver 3651 * uses a -1 coefficient, then rows associated with slacks variables whose coefficient is -1, should be negated; 3677 /* this might be turned off if the user as called SCIPlpiClearState() or set SCIP_LPPAR_FROMSCRATCH to TRUE */ 3682 if( retval == CPXERR_NO_SOLN || retval == CPXERR_NO_LU_FACTOR || retval == CPXERR_NO_BASIC_SOLN || retval == CPXERR_NO_BASIS ) 3689 /* the LPi expects slack variables with coefficient +1; CPLEX adds slack variables with a coefficient -1 for 'G' 3696 CHECK_ZERO( lpi->messagehdlr, CPXgetsense(lpi->cpxenv, lpi->cpxlp, lpi->senarray, 0, nrows - 1) ); 3709 if( basicrow >= 0 && basicrow < nrows && (lpi->senarray[basicrow] == 'G' || lpi->senarray[basicrow] == 'R') ) 3745 /* if there is no basis information available (e.g. after barrier without crossover), or no state can be saved; if 3762 SCIPdebugMessage("storing CPLEX LPI state in %p (%d cols, %d rows)\n", (void *) *lpistate, ncols, nrows); 3775 /** loads LPi state (like basis information) into solver; note that the LP might have been extended with additional 3802 SCIPdebugMessage("loading LPI state %p (%d cols, %d rows) into CPLEX LP with %d cols and %d rows\n", 3947 /* if there is no basis information available (e.g. after barrier without crossover), norms cannot be saved; if 3965 SCIPdebugMessage("storing CPLEX LPI pricing norms in %p (%d rows)\n", (void *) *lpinorms, nrows); 3968 retval = CPXgetdnorms(lpi->cpxenv, lpi->cpxlp, (*lpinorms)->norm, (*lpinorms)->head, &((*lpinorms)->normlen)); 3970 /* if CPLEX used the primal simplex in the last optimization call, we do not have dual norms (error 1264) */ 3988 /** loads LPi pricing norms into solver; note that the LP might have been extended with additional 4018 CHECK_ZERO( lpi->messagehdlr, CPXcopydnorms(lpi->cpxenv, lpi->cpxlp, lpinorms->norm, lpinorms->head, lpinorms->normlen) ); 4126 #if (CPX_VERSION == 1100 || (CPX_VERSION == 1220 && (CPX_SUBVERSION == 0 || CPX_SUBVERSION == 2))) 4127 /* Due to CPLEX bug, we always set the thread count to 1. In order to fulfill an assert in lp.c, we have to 4227 #if (CPX_VERSION == 1100 || (CPX_VERSION == 1220 && (CPX_SUBVERSION == 0 || CPX_SUBVERSION == 2))) 4228 /* Due to CPLEX bug, we always set the thread count to 1. In order to fulfill an assert in lp.c, we have to
SCIP_RETCODE SCIPlpiGetDualfarkas(SCIP_LPI *lpi, SCIP_Real *dualfarkas) Definition: lpi_cpx.c:3228 Definition: type_lpi.h:58 SCIP_Bool SCIPlpiIsInfinity(SCIP_LPI *lpi, SCIP_Real val) Definition: lpi_cpx.c:4358 SCIP_RETCODE SCIPlpiSetNorms(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPINORMS *lpinorms) Definition: lpi_cpx.c:3991 Definition: type_lpi.h:50 SCIP_RETCODE SCIPlpiGetRealpar(SCIP_LPI *lpi, SCIP_LPPARAM type, SCIP_Real *dval) Definition: lpi_cpx.c:4245 SCIP_RETCODE SCIPlpiGetBInvARow(SCIP_LPI *lpi, int r, const SCIP_Real *binvrow, SCIP_Real *coef, int *inds, int *ninds) Definition: lpi_cpx.c:3582 SCIP_RETCODE SCIPlpiFreeNorms(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPINORMS **lpinorms) Definition: lpi_cpx.c:4024 Definition: type_lpi.h:41 void SCIPdecodeDualBit(const SCIP_DUALPACKET *inp, int *out, int count) Definition: bitencode.c:298 interface methods for specific LP solvers SCIP_RETCODE SCIPlpiAddRows(SCIP_LPI *lpi, int nrows, const SCIP_Real *lhs, const SCIP_Real *rhs, char **rownames, int nnonz, const int *beg, const int *ind, const SCIP_Real *val) Definition: lpi_cpx.c:1305 Definition: type_lpi.h:52 Definition: type_lpi.h:72 static SCIP_RETCODE lpistateCreate(SCIP_LPISTATE **lpistate, BMS_BLKMEM *blkmem, int ncols, int nrows) Definition: lpi_cpx.c:433 Definition: struct_message.h:35 SCIP_RETCODE SCIPlpiGetSides(SCIP_LPI *lpi, int firstrow, int lastrow, SCIP_Real *lhss, SCIP_Real *rhss) Definition: lpi_cpx.c:2026 Definition: type_lpi.h:89 SCIP_RETCODE SCIPlpiSetBase(SCIP_LPI *lpi, int *cstat, int *rstat) Definition: lpi_cpx.c:3360 static SCIP_RETCODE ensureSidechgMem(SCIP_LPI *lpi, int num) Definition: lpi_cpx.c:234 SCIP_RETCODE SCIPlpiReadState(SCIP_LPI *lpi, const char *fname) Definition: lpi_cpx.c:3882 SCIP_RETCODE SCIPlpiGetBInvACol(SCIP_LPI *lpi, int c, SCIP_Real *coef, int *inds, int *ninds) Definition: lpi_cpx.c:3654 static void lpistatePack(SCIP_LPISTATE *lpistate, const int *cstat, const int *rstat) Definition: lpi_cpx.c:401 SCIP_RETCODE SCIPlpiGetRows(SCIP_LPI *lpi, int firstrow, int lastrow, SCIP_Real *lhs, SCIP_Real *rhs, int *nnonz, int *beg, int *ind, SCIP_Real *val) Definition: lpi_cpx.c:1828 SCIP_Bool SCIPlpiHasStateBasis(SCIP_LPI *lpi, SCIP_LPISTATE *lpistate) Definition: lpi_cpx.c:3873 static void reconvertBothSides(SCIP_LPI *lpi, int nrows, SCIP_Real *lhs, SCIP_Real *rhs) Definition: lpi_cpx.c:786 SCIP_Bool SCIPlpiIsPrimalInfeasible(SCIP_LPI *lpi) Definition: lpi_cpx.c:2896 SCIP_RETCODE SCIPlpiStartStrongbranch(SCIP_LPI *lpi) Definition: lpi_cpx.c:2573 SCIP_RETCODE SCIPlpiGetBInvRow(SCIP_LPI *lpi, int r, SCIP_Real *coef, int *inds, int *ninds) Definition: lpi_cpx.c:3438 static SCIP_RETCODE getParameterValues(SCIP_LPI *lpi, SCIP_CPXPARAM *cpxparam) Definition: lpi_cpx.c:476 Definition: lpi_cpx.c:191 SCIP_RETCODE SCIPlpiGetSol(SCIP_LPI *lpi, SCIP_Real *objval, SCIP_Real *primsol, SCIP_Real *dualsol, SCIP_Real *activity, SCIP_Real *redcost) Definition: lpi_cpx.c:3179 Definition: type_lpi.h:53 Definition: type_lpi.h:70 static SCIP_RETCODE setParameterValues(SCIP_LPI *const lpi, SCIP_CPXPARAM *const cpxparam) Definition: lpi_cpx.c:526 Definition: type_lpi.h:90 packing single and dual bit values Definition: type_retcode.h:36 static void lpistateUnpack(const SCIP_LPISTATE *lpistate, int *cstat, int *rstat) Definition: lpi_cpx.c:417 SCIP_RETCODE SCIPlpiGetSolFeasibility(SCIP_LPI *lpi, SCIP_Bool *primalfeasible, SCIP_Bool *dualfeasible) Definition: lpi_cpx.c:2818 Definition: type_lpi.h:34 SCIP_RETCODE SCIPlpiChgSides(SCIP_LPI *lpi, int nrows, const int *ind, const SCIP_Real *lhs, const SCIP_Real *rhs) Definition: lpi_cpx.c:1480 Definition: type_lpi.h:44 SCIP_RETCODE SCIPlpiSetRealpar(SCIP_LPI *lpi, SCIP_LPPARAM type, SCIP_Real dval) Definition: lpi_cpx.c:4291 void SCIPmessagePrintWarning(SCIP_MESSAGEHDLR *messagehdlr, const char *formatstr,...) Definition: message.c:411 static SCIP_RETCODE lpiStrongbranchIntegral(SCIP_LPI *lpi, int col, SCIP_Real psol, int itlim, SCIP_Real *down, SCIP_Real *up, SCIP_Bool *downvalid, SCIP_Bool *upvalid, int *iter) Definition: lpi_cpx.c:2467 Definition: type_lpi.h:51 Definition: type_retcode.h:33 Definition: type_lpi.h:33 SCIP_RETCODE SCIPlpiStrongbranchInt(SCIP_LPI *lpi, int col, SCIP_Real psol, int itlim, SCIP_Real *down, SCIP_Real *up, SCIP_Bool *downvalid, SCIP_Bool *upvalid, int *iter) Definition: lpi_cpx.c:2721 SCIP_RETCODE SCIPlpiStrongbranchFrac(SCIP_LPI *lpi, int col, SCIP_Real psol, int itlim, SCIP_Real *down, SCIP_Real *up, SCIP_Bool *downvalid, SCIP_Bool *upvalid, int *iter) Definition: lpi_cpx.c:2591 Definition: type_lpi.h:45 SCIP_RETCODE SCIPlpiGetState(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPISTATE **lpistate) Definition: lpi_cpx.c:3730 static void setIntParam(SCIP_LPI *lpi, int const param, int const parval) Definition: lpi_cpx.c:635 Definition: type_retcode.h:46 Definition: type_lpi.h:54 SCIP_RETCODE SCIPlpiGetIntpar(SCIP_LPI *lpi, SCIP_LPPARAM type, int *ival) Definition: lpi_cpx.c:4053 SCIP_RETCODE SCIPlpiLoadColLP(SCIP_LPI *lpi, SCIP_OBJSEN objsen, int ncols, const SCIP_Real *obj, const SCIP_Real *lb, const SCIP_Real *ub, char **colnames, int nrows, const SCIP_Real *lhs, const SCIP_Real *rhs, char **rownames, int nnonz, const int *beg, const int *ind, const SCIP_Real *val) Definition: lpi_cpx.c:1169 SCIP_RETCODE SCIPlpiGetRowNames(SCIP_LPI *lpi, int firstrow, int lastrow, char **rownames, char *namestorage, int namestoragesize, int *storageleft) Definition: lpi_cpx.c:1925 void SCIPencodeDualBit(const int *inp, SCIP_DUALPACKET *out, int count) Definition: bitencode.c:228 Definition: type_lpi.h:68 SCIP_RETCODE SCIPlpiScaleCol(SCIP_LPI *lpi, int col, SCIP_Real scaleval) Definition: lpi_cpx.c:1644 SCIP_RETCODE SCIPlpiGetBase(SCIP_LPI *lpi, int *cstat, int *rstat) Definition: lpi_cpx.c:3320 SCIP_RETCODE SCIPlpiStrongbranchesInt(SCIP_LPI *lpi, int *cols, int ncols, SCIP_Real *psols, int itlim, SCIP_Real *down, SCIP_Real *up, SCIP_Bool *downvalid, SCIP_Bool *upvalid, int *iter) Definition: lpi_cpx.c:2755 SCIP_RETCODE SCIPlpiGetBounds(SCIP_LPI *lpi, int firstcol, int lastcol, SCIP_Real *lbs, SCIP_Real *ubs) Definition: lpi_cpx.c:1997 SCIP_RETCODE SCIPlpiGetObjval(SCIP_LPI *lpi, SCIP_Real *objval) Definition: lpi_cpx.c:3150 SCIP_RETCODE SCIPlpiCreate(SCIP_LPI **lpi, SCIP_MESSAGEHDLR *messagehdlr, const char *name, SCIP_OBJSEN objsen) Definition: lpi_cpx.c:1043 static void setDblParam(SCIP_LPI *lpi, int const param, double parval) Definition: lpi_cpx.c:660 Definition: type_lpi.h:71 Definition: type_lpi.h:67 SCIP_RETCODE SCIPlpiChgBounds(SCIP_LPI *lpi, int ncols, const int *ind, const SCIP_Real *lb, const SCIP_Real *ub) Definition: lpi_cpx.c:1430 Definition: type_lpi.h:57 Definition: type_lpi.h:43 SCIP_RETCODE SCIPlpiChgObjsen(SCIP_LPI *lpi, SCIP_OBJSEN objsen) Definition: lpi_cpx.c:1546 Definition: type_lpi.h:42 SCIP_RETCODE SCIPlpiScaleRow(SCIP_LPI *lpi, int row, SCIP_Real scaleval) Definition: lpi_cpx.c:1588 SCIP_RETCODE SCIPlpiGetCoef(SCIP_LPI *lpi, int row, int col, SCIP_Real *val) Definition: lpi_cpx.c:2062 SCIP_RETCODE SCIPlpiDelRows(SCIP_LPI *lpi, int firstrow, int lastrow) Definition: lpi_cpx.c:1358 SCIP_RETCODE SCIPlpiGetNorms(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPINORMS **lpinorms) Definition: lpi_cpx.c:3931 Definition: type_lpi.h:47 SCIP_RETCODE SCIPlpiGetCols(SCIP_LPI *lpi, int firstcol, int lastcol, SCIP_Real *lb, SCIP_Real *ub, int *nnonz, int *beg, int *ind, SCIP_Real *val) Definition: lpi_cpx.c:1772 static SCIP_RETCODE checkParameterValues(SCIP_LPI *const lpi) Definition: lpi_cpx.c:502 SCIP_RETCODE SCIPlpiChgCoef(SCIP_LPI *lpi, int row, int col, SCIP_Real newval) Definition: lpi_cpx.c:1525 SCIP_RETCODE SCIPlpiSetState(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPISTATE *lpistate) Definition: lpi_cpx.c:3778 static void copyParameterValues(SCIP_CPXPARAM *dest, SCIP_CPXPARAM *const source) Definition: lpi_cpx.c:567 Definition: type_retcode.h:40 Definition: lpi_clp.cpp:121 SCIP_RETCODE SCIPlpiGetObjsen(SCIP_LPI *lpi, SCIP_OBJSEN *objsen) Definition: lpi_cpx.c:1959 SCIP_RETCODE SCIPlpiGetPrimalRay(SCIP_LPI *lpi, SCIP_Real *ray) Definition: lpi_cpx.c:3209 public methods for message output Definition: type_lpi.h:79 static SCIP_RETCODE ensureBoundchgMem(SCIP_LPI *lpi, int num) Definition: lpi_cpx.c:205 Definition: type_lpi.h:69 Definition: lpi_clp.cpp:93 SCIP_RETCODE SCIPlpiAddCols(SCIP_LPI *lpi, int ncols, const SCIP_Real *obj, const SCIP_Real *lb, const SCIP_Real *ub, char **colnames, int nnonz, const int *beg, const int *ind, const SCIP_Real *val) Definition: lpi_cpx.c:1229 SCIP_RETCODE SCIPlpiStrongbranchesFrac(SCIP_LPI *lpi, int *cols, int ncols, SCIP_Real *psols, int itlim, SCIP_Real *down, SCIP_Real *up, SCIP_Bool *downvalid, SCIP_Bool *upvalid, int *iter) Definition: lpi_cpx.c:2655 Definition: type_lpi.h:49 SCIP_RETCODE SCIPlpiSolveBarrier(SCIP_LPI *lpi, SCIP_Bool crossover) Definition: lpi_cpx.c:2383 static void convertSides(SCIP_LPI *lpi, int nrows, const SCIP_Real *lhs, const SCIP_Real *rhs, int indoffset, int *rngcount) Definition: lpi_cpx.c:720 SCIP_RETCODE SCIPlpiDelCols(SCIP_LPI *lpi, int firstcol, int lastcol) Definition: lpi_cpx.c:1263 static void reconvertSides(SCIP_LPI *lpi, int nrows, SCIP_Real *lhs, SCIP_Real *rhs) Definition: lpi_cpx.c:939 static void reconvertLhs(SCIP_LPI *lpi, int nrows, SCIP_Real *lhs) Definition: lpi_cpx.c:843 SCIP_RETCODE SCIPlpiFreeState(SCIP_LPI *lpi, BMS_BLKMEM *blkmem, SCIP_LPISTATE **lpistate) Definition: lpi_cpx.c:3855 SCIP_RETCODE SCIPlpiGetObj(SCIP_LPI *lpi, int firstcol, int lastcol, SCIP_Real *vals) Definition: lpi_cpx.c:1976 static void reconvertRhs(SCIP_LPI *lpi, int nrows, SCIP_Real *rhs) Definition: lpi_cpx.c:891 SCIP_RETCODE SCIPlpiWriteLP(SCIP_LPI *lpi, const char *fname) Definition: lpi_cpx.c:4403 SCIP_RETCODE SCIPlpiIgnoreInstability(SCIP_LPI *lpi, SCIP_Bool *success) Definition: lpi_cpx.c:3127 Definition: type_lpi.h:66 Definition: type_lpi.h:46 Definition: type_lpi.h:80 Definition: type_retcode.h:35 SCIP_RETCODE SCIPlpiChgObj(SCIP_LPI *lpi, int ncols, int *ind, SCIP_Real *obj) Definition: lpi_cpx.c:1569 Definition: type_retcode.h:43 SCIP_RETCODE SCIPlpiGetRealSolQuality(SCIP_LPI *lpi, SCIP_LPSOLQUALITY qualityindicator, SCIP_Real *quality) Definition: lpi_cpx.c:3266 SCIP_RETCODE SCIPlpiGetBasisInd(SCIP_LPI *lpi, int *bind) Definition: lpi_cpx.c:3404 SCIP_RETCODE SCIPlpiSetIntpar(SCIP_LPI *lpi, SCIP_LPPARAM type, int ival) Definition: lpi_cpx.c:4143 SCIP_RETCODE SCIPlpiGetIterations(SCIP_LPI *lpi, int *iterations) Definition: lpi_cpx.c:3248 SCIP_RETCODE SCIPlpiGetColNames(SCIP_LPI *lpi, int firstcol, int lastcol, char **colnames, char *namestorage, int namestoragesize, int *storageleft) Definition: lpi_cpx.c:1891 static void lpistateFree(SCIP_LPISTATE **lpistate, BMS_BLKMEM *blkmem) Definition: lpi_cpx.c:454 Definition: type_lpi.h:82 Definition: type_lpi.h:48 SCIP_RETCODE SCIPlpiGetBInvCol(SCIP_LPI *lpi, int c, SCIP_Real *coef, int *inds, int *ninds) Definition: lpi_cpx.c:3509 Definition: type_lpi.h:81 SCIP_RETCODE SCIPlpiWriteState(SCIP_LPI *lpi, const char *fname) Definition: lpi_cpx.c:3899 Definition: lpi_cpx.c:129 |