LP interface for MOSEK.
Definition in file lpi_msk.c.
#include <assert.h>
#include "mosek.h"
#include "lpi/lpi.h"
#include "scip/bitencode.h"
#include "scip/pub_message.h"
#include <string.h>
#include "tinycthread/tinycthread.h"
Go to the source code of this file.
Data Structures | |
struct | SCIP_LPi |
struct | SCIP_LPiState |
Macros | |
#define | MSKCONST const /* this define is needed for older MOSEK versions */ |
#define | scipmskobjsen MSKobjsensee |
#define | SENSE2MOSEK(objsen) |
#define | MOSEK_CALL(x) |
#define | SCIP_ABORT_FALSE(x) |
#define | IS_POSINF(x) |
#define | IS_NEGINF(x) |
#define | MOSEK_relDiff(val1, val2) |
#define | SCIP_REUSEENV |
#define | DEBUG_PRINT_STAT 0 |
#define | DEBUG_PARAM_SETTING 0 |
#define | DEBUG_CHECK_DATA 0 |
#define | DEBUG_EASY_REPRODUCE 0 |
#define | DEBUG_DO_INTPNT_FEAS_CHECK 0 |
#define | DEBUG_CHECK_STATE_TOL 1e-5 |
#define | SHOW_ERRORS 0 |
#define | SHOW_RELATIVE_OPTIMAL_GAP 0 |
#define | ASSERT_ON_NUMERICAL_TROUBLES 0 |
#define | ASSERT_ON_WARNING 0 |
#define | FORCE_MOSEK_LOG 0 /* note that changing this AND setting lpinfo will lead to asserts in lpCheckIntpar */ |
#define | FORCE_MOSEK_SUMMARY 0 |
#define | FORCE_NO_MAXITER 0 |
#define | SETBACK_LIMIT 250 |
#define | STRONGBRANCH_PRICING MSK_SIM_SELECTION_SE |
#define | SUPRESS_NAME_ERROR 1 |
#define | WRITE_DUAL 0 |
#define | WRITE_PRIMAL 0 |
#define | WRITE_INTPNT 0 |
#define | DEGEN_LEVEL MSK_SIM_DEGEN_FREE |
#define | ALWAYS_SOLVE_PRIMAL_FORM 1 |
#define | COLS_PER_PACKET SCIP_DUALPACKETSIZE |
#define | ROWS_PER_PACKET SCIP_DUALPACKETSIZE |
#define | STR_HELPER(x) |
#define | STR(x) |
#define | mskname "MOSEK " STR(MSK_VERSION_MAJOR) "." STR(MSK_VERSION_MINOR) "." STR(MSK_VERSION_BUILD) "." STR(MSK_VERSION_REVISION) |
Variables | |
static MSKenv_t | reusemosekenv = NULL |
static int | numlp = 0 |
static const char * | paramname [] |
#define MSKCONST const /* this define is needed for older MOSEK versions */ |
#define SENSE2MOSEK | ( | objsen | ) |
Definition at line 65 of file lpi_msk.c.
Referenced by SCIPlpiChgObjsen(), SCIPlpiCreate(), and SCIPlpiLoadColLP().
#define MOSEK_CALL | ( | x | ) |
Definition at line 69 of file lpi_msk.c.
Referenced by checkState1(), convertstat_mosek2scip(), convertstat_mosek2scip_slack(), getASlice(), getbase(), getSolutionStatus(), handle_singular(), SCIPlpiAddCols(), SCIPlpiAddRows(), SCIPlpiChgBounds(), SCIPlpiChgCoef(), SCIPlpiChgObj(), SCIPlpiChgObjsen(), SCIPlpiChgSides(), SCIPlpiClear(), SCIPlpiCreate(), SCIPlpiDelCols(), SCIPlpiDelColset(), SCIPlpiDelRows(), SCIPlpiDelRowset(), SCIPlpiFree(), SCIPlpiGetBase(), SCIPlpiGetBasisInd(), SCIPlpiGetBInvACol(), SCIPlpiGetBInvARow(), SCIPlpiGetBInvCol(), SCIPlpiGetBInvRow(), SCIPlpiGetBounds(), SCIPlpiGetCoef(), SCIPlpiGetDualfarkas(), SCIPlpiGetIntpar(), SCIPlpiGetNCols(), SCIPlpiGetNNonz(), SCIPlpiGetNRows(), SCIPlpiGetObj(), SCIPlpiGetObjsen(), SCIPlpiGetObjval(), SCIPlpiGetPrimalRay(), SCIPlpiGetRealpar(), SCIPlpiGetSides(), SCIPlpiGetSol(), SCIPlpiGetSolFeasibility(), SCIPlpiGetState(), SCIPlpiLoadColLP(), SCIPlpiReadLP(), SCIPlpiReadState(), SCIPlpiScaleCol(), SCIPlpiScaleRow(), SCIPlpiSetIntpar(), SCIPlpiSetRealpar(), SCIPlpiSetState(), SCIPlpiSolveBarrier(), SCIPlpiSolveDual(), SCIPlpiSolvePrimal(), SCIPlpiStrongbranch(), SCIPlpiWriteLP(), SCIPlpiWriteState(), setbase(), and SolveWSimplex().
#define SCIP_ABORT_FALSE | ( | x | ) |
Definition at line 82 of file lpi_msk.c.
Referenced by SCIPlpiExistsDualRay(), SCIPlpiExistsPrimalRay(), SCIPlpiHasDualRay(), SCIPlpiHasPrimalRay(), SCIPlpiIsDualFeasible(), SCIPlpiIsOptimal(), SCIPlpiIsPrimalFeasible(), and SCIPlpiIsPrimalUnbounded().
#define IS_POSINF | ( | x | ) |
Definition at line 94 of file lpi_msk.c.
Referenced by generateMskBoundkeys(), SCIPlpiIsInfinity(), and SCIPlpiStrongbranch().
#define IS_NEGINF | ( | x | ) |
Definition at line 95 of file lpi_msk.c.
Referenced by generateMskBoundkeys(), and SCIPlpiStrongbranch().
#define MOSEK_relDiff | ( | val1, | |
val2 ) |
#define DEBUG_CHECK_STATE_TOL 1e-5 |
Definition at line 120 of file lpi_msk.c.
Referenced by checkState1().
#define FORCE_MOSEK_LOG 0 /* note that changing this AND setting lpinfo will lead to asserts in lpCheckIntpar */ |
#define SETBACK_LIMIT 250 |
Definition at line 128 of file lpi_msk.c.
Referenced by SCIPlpiCreate().
#define STRONGBRANCH_PRICING MSK_SIM_SELECTION_SE |
Definition at line 129 of file lpi_msk.c.
Referenced by SCIPlpiStrongbranch().
#define DEGEN_LEVEL MSK_SIM_DEGEN_FREE |
Definition at line 137 of file lpi_msk.c.
Referenced by SCIPlpiCreate().
#define COLS_PER_PACKET SCIP_DUALPACKETSIZE |
#define ROWS_PER_PACKET SCIP_DUALPACKETSIZE |
#define STR | ( | x | ) |
#define mskname "MOSEK " STR(MSK_VERSION_MAJOR) "." STR(MSK_VERSION_MINOR) "." STR(MSK_VERSION_BUILD) "." STR(MSK_VERSION_REVISION) |
Definition at line 753 of file lpi_msk.c.
Referenced by SCIPlpiGetSolverName().
typedef enum MSKoptimizertype_enum MSKoptimizertype |
|
static |
gives problem and solution status for a Mosek Task
With Mosek 7.0, the routine MSK_getsolutionstatus was replaced by MSK_getprosta and MSK_getsolsta.
task | Mosek Task |
whichsol | for which type of solution a status is requested |
prosta | buffer to store problem status, or NULL if not needed |
solsta | buffer to store solution status, or NULL if not needed |
Definition at line 222 of file lpi_msk.c.
References NULL.
Referenced by getSolutionStatus(), SCIPlpiGetSol(), SCIPlpiGetSolFeasibility(), SCIPlpiGetState(), SCIPlpiSolveBarrier(), SCIPlpiSolveDual(), SCIPlpiSolvePrimal(), and SolveWSimplex().
|
static |
returns the number of packets needed to store column packet information
ncols | number of columns to store |
Definition at line 249 of file lpi_msk.c.
References COLS_PER_PACKET.
|
static |
returns the number of packets needed to store row packet information
nrows | number of rows to store |
Definition at line 258 of file lpi_msk.c.
References ROWS_PER_PACKET.
|
static |
print string using message handler of SCIP
handle | error handle |
str | string that contains string on output |
Definition at line 267 of file lpi_msk.c.
References SCIPmessagePrintInfo().
Referenced by SCIPlpiCreate().
|
static |
resizes bound keys array bkx to have at least ncols entries
lpi | pointer to an LP interface structure |
ncols | number of columns |
Definition at line 404 of file lpi_msk.c.
References SCIP_LPi::bkx, SCIP_LPi::bkxsize, BMSreallocMemoryArray, MAX, SCIP_ALLOC, and SCIP_OKAY.
Referenced by SCIPlpiAddCols(), SCIPlpiChgBounds(), and SCIPlpiLoadColLP().
|
static |
resizes bound keys array bkc to have at least nrows entries
lpi | pointer to an LP interface structure |
nrows | number of rows |
Definition at line 423 of file lpi_msk.c.
References SCIP_LPi::bkc, SCIP_LPi::bkcsize, BMSreallocMemoryArray, MAX, SCIP_ALLOC, and SCIP_OKAY.
Referenced by SCIPlpiAddRows(), SCIPlpiChgSides(), and SCIPlpiLoadColLP().
|
static |
resizes aptre array to have at least n entries
lpi | pointer to an LP interface structure |
n | number of entries |
Definition at line 442 of file lpi_msk.c.
References SCIP_LPi::aptre, SCIP_LPi::aptresize, BMSreallocMemoryArray, MAX, SCIP_ALLOC, and SCIP_OKAY.
Referenced by getASlice(), SCIPlpiAddCols(), SCIPlpiAddRows(), and SCIPlpiLoadColLP().
|
static |
marks the current LP to be unsolved
lpi | pointer to an LP interface structure |
Definition at line 461 of file lpi_msk.c.
References assert(), FALSE, NULL, and SCIP_LPi::solved.
Referenced by SCIPlpiAddCols(), SCIPlpiAddRows(), SCIPlpiChgBounds(), SCIPlpiChgCoef(), SCIPlpiChgObj(), SCIPlpiChgObjsen(), SCIPlpiChgSides(), SCIPlpiClear(), SCIPlpiCreate(), SCIPlpiDelCols(), SCIPlpiDelColset(), SCIPlpiDelRows(), SCIPlpiDelRowset(), SCIPlpiLoadColLP(), SCIPlpiScaleCol(), SCIPlpiScaleRow(), SCIPlpiSetBase(), SCIPlpiSetState(), SCIPlpiSolveBarrier(), SCIPlpiStrongbranch(), and SolveWSimplex().
|
static |
compute boundkeys to inform MOSEK about fixed/free/ranged/lower bounded/upper bounded variables or constraints
n | array size |
lb | lower bounds of variables or left-hand sides of ranged rows |
ub | upper bounds of variables or right-hand sides of ranged rows |
bk | pointer to store boundkeys to inform MOSEK about status of var/row |
Definition at line 472 of file lpi_msk.c.
References assert(), i, IS_NEGINF, IS_POSINF, and NULL.
Referenced by SCIPlpiAddCols(), SCIPlpiAddRows(), SCIPlpiChgBounds(), SCIPlpiChgSides(), and SCIPlpiLoadColLP().
|
static |
get end pointers of arrays
n | array size |
beg | array of beginning indices |
nnonz | number of nonzeros |
aptre | array to store the result |
Definition at line 523 of file lpi_msk.c.
References assert(), i, NULL, and SCIP_OKAY.
Referenced by SCIPlpiAddCols(), SCIPlpiAddRows(), and SCIPlpiLoadColLP().
|
static |
compute indices from range
first | first index |
last | last index |
sub | pointer to store the indices ranges |
Definition at line 557 of file lpi_msk.c.
References assert(), BMSallocMemoryArray, i, SCIP_ALLOC, and SCIP_OKAY.
Referenced by SCIPlpiDelCols(), and SCIPlpiDelRows().
|
static |
compute indices from dense array
dstat | array |
n | size of array |
count | array of counts (sizes) |
sub | pointer to store array of indices |
Definition at line 579 of file lpi_msk.c.
References assert(), BMSallocMemoryArray, i, NULL, SCIP_ALLOC, and SCIP_OKAY.
Referenced by SCIPlpiDelColset(), and SCIPlpiDelRowset().
|
static |
scale a vector
len | length of vector |
vec | vector to be scaled |
s | scaling factor |
Definition at line 622 of file lpi_msk.c.
References i.
Referenced by SCIPlpiScaleCol(), and SCIPlpiScaleRow().
|
static |
scale lower and upper bound
bk | pointer to store boundkeys to inform MOSEK about status of var/row |
bl | lower bound |
bu | upper bound |
s | scaling factor |
Definition at line 637 of file lpi_msk.c.
References SCIPABORT.
Referenced by SCIPlpiScaleCol(), and SCIPlpiScaleRow().
|
static |
resizes state arrays to have at least ncols/nrows entries
lpi | pointer to an LP interface structure |
ncols | number of columns |
nrows | number of rows |
Definition at line 680 of file lpi_msk.c.
References BMSreallocMemoryArray, MAX, SCIP_ALLOC, SCIP_OKAY, SCIP_LPi::skc, SCIP_LPi::skcsize, SCIP_LPi::skx, and SCIP_LPi::skxsize.
Referenced by getbase(), SCIPlpiSetBase(), and SCIPlpiSetState().
|
static |
get base and store in skc/skx arrays
lpi | pointer to an LP interface structure |
ncols | number of columns |
nrows | number of rows |
Definition at line 709 of file lpi_msk.c.
References assert(), ensureStateMem(), SCIP_LPi::lastsolvetype, SCIP_LPi::lpid, MOSEK_CALL, NULL, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, SCIP_LPi::skc, SCIP_LPi::skx, and SCIP_LPi::task.
Referenced by SCIPlpiGetBase(), SCIPlpiGetState(), SCIPlpiSetState(), and SCIPlpiStrongbranch().
|
static |
set base to the values given in skc/skx arrays
lpi | pointer to an LP interface structure |
Definition at line 728 of file lpi_msk.c.
References FALSE, SCIP_LPi::lastsolvetype, SCIP_LPi::lpid, MOSEK_CALL, NULL, SCIP_OKAY, SCIPdebugMessage, SCIP_LPi::skc, SCIP_LPi::skx, SCIP_LPi::solved, and SCIP_LPi::task.
Referenced by SCIPlpiSetBase(), SCIPlpiSetState(), and SCIPlpiStrongbranch().
|
static |
method mapping parameter index to parameter name
Definition at line 5122 of file lpi_msk.c.
References assert(), paramname, SCIP_LPPAR_BARRIERCONVTOL, SCIP_LPPAR_CONDITIONLIMIT, SCIP_LPPAR_DUALFEASTOL, SCIP_LPPAR_FASTMIP, SCIP_LPPAR_FEASTOL, SCIP_LPPAR_FROMSCRATCH, SCIP_LPPAR_LPINFO, SCIP_LPPAR_LPITLIM, SCIP_LPPAR_LPTILIM, SCIP_LPPAR_MARKOWITZ, SCIP_LPPAR_OBJLIM, SCIP_LPPAR_POLISHING, SCIP_LPPAR_PRESOLVING, SCIP_LPPAR_PRICING, SCIP_LPPAR_RANDOMSEED, SCIP_LPPAR_REFACTOR, SCIP_LPPAR_ROWREPSWITCH, SCIP_LPPAR_SCALING, SCIP_LPPAR_THREADS, and SCIP_LPPAR_TIMING.
Referenced by SCIPlpiGetIntpar(), SCIPlpiGetRealpar(), SCIPlpiSetIntpar(), and SCIPlpiSetRealpar().
|
static |
Definition at line 107 of file lpi_msk.c.
Referenced by SCIPlpiCreate().
|
static |
constant array containing the parameter names
Definition at line 5096 of file lpi_msk.c.
Referenced by addFixParamDialog(), addSetParamDialog(), alnsIncludeNeighborhood(), checkTransferBoolParam(), doBendersCreate(), doBenderscutCreate(), doBranchruleCreate(), doComprCreate(), doConcsolverTypeCreate(), doConflicthdlrCreate(), doConshdlrCreate(), doCutselCreate(), doDispCreate(), doHeurCreate(), doNodeselCreate(), doPresolCreate(), doPricerCreate(), doPropCreate(), doRelaxCreate(), doSepaCreate(), doTableCreate(), emphasisParse(), paramSetBool(), paramSetChar(), paramSetInt(), paramSetLongint(), paramsetParse(), paramSetReal(), paramsetSetHeuristicsAggressive(), paramsetSetHeuristicsDefault(), paramsetSetHeuristicsFast(), paramsetSetHeuristicsOff(), paramsetSetPresolvingAggressive(), paramsetSetPresolvingDefault(), paramsetSetPresolvingFast(), paramsetSetPresolvingOff(), paramsetSetSeparatingAggressive(), paramsetSetSeparatingDefault(), paramsetSetSeparatingOff(), paramty2str(), schedulerIncludeNeighborhood(), SCIP_DECL_CONCSOLVERCREATEINST(), SCIP_DECL_NLPICREATEPROBLEM(), SCIPdivesetCreate(), SCIPincludeBenderscutInt(), SCIPincludeBenderscutNogood(), SCIPincludeBenderscutOpt(), SCIPincludeConsUpgradeNonlinear(), SCIPincludeDialogDefaultFix(), SCIPincludeDialogDefaultSet(), SCIPincludeLinconsUpgrade(), SCIPincludeNlpi(), SCIPincludeNlpSolverIpopt(), SCIPnlhdlrCreate(), SCIPparamsetCopyParams(), SCIPparamsetSetEmphasis(), SCIPparamsetSetToDefault(), SCIPparamsetSetToSubscipsOff(), SCIPsetConshdlrPresol(), SCIPsetConshdlrProp(), SCIPsetConshdlrSepa(), and SCIPsetPropPresol().