Detailed Description
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>
Go to the source code of this file.
Data Structures | |
struct | SCIP_LPi |
struct | SCIP_LPiState |
Macros | |
#define | MSKCONST const |
#define | scipmskobjsen MSKobjsensee |
#define | SENSE2MOSEK(objsen) (((objsen)==SCIP_OBJSEN_MINIMIZE)?(MSK_OBJECTIVE_SENSE_MINIMIZE):(MSK_OBJECTIVE_SENSE_MAXIMIZE)) |
#define | MOSEK_CALL(x) |
#define | SCIP_ABORT_FALSE(x) |
#define | IS_POSINF(x) ((x) >= MSK_INFINITY) |
#define | IS_NEGINF(x) ((x) <= -MSK_INFINITY) |
#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 |
Typedefs | |
typedef enum MSKoptimizertype_enum | MSKoptimizertype |
typedef SCIP_DUALPACKET | COLPACKET |
typedef SCIP_DUALPACKET | ROWPACKET |
Variables | |
static MSKenv_t | MosekEnv = NULL |
static int | numlp = 0 |
static int | optimizecount = 0 |
static int | nextlpid = 1 |
static char | mskname [100] |
static const char * | paramname [] |
Macro Definition Documentation
◆ MSKCONST
◆ scipmskobjsen
#define scipmskobjsen MSKobjsensee |
Definition at line 51 of file lpi_msk.c.
Referenced by SolveWSimplex().
◆ SENSE2MOSEK
#define SENSE2MOSEK | ( | objsen | ) | (((objsen)==SCIP_OBJSEN_MINIMIZE)?(MSK_OBJECTIVE_SENSE_MINIMIZE):(MSK_OBJECTIVE_SENSE_MAXIMIZE)) |
Definition at line 52 of file lpi_msk.c.
Referenced by SCIPlpiChgObjsen(), SCIPlpiCreate(), and SCIPlpiLoadColLP().
◆ MOSEK_CALL
#define MOSEK_CALL | ( | x | ) |
Definition at line 56 of file lpi_msk.c.
Referenced by checkState1(), convertstat_mosek2scip(), convertstat_mosek2scip_slack(), getASlice(), getbase(), getSolutionStatus(), handle_singular(), printstr(), 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().
◆ SCIP_ABORT_FALSE
#define SCIP_ABORT_FALSE | ( | x | ) |
Definition at line 69 of file lpi_msk.c.
Referenced by SCIPlpiExistsDualRay(), SCIPlpiExistsPrimalRay(), SCIPlpiHasDualRay(), SCIPlpiHasPrimalRay(), SCIPlpiIsDualFeasible(), SCIPlpiIsOptimal(), SCIPlpiIsPrimalFeasible(), and SCIPlpiIsPrimalUnbounded().
◆ IS_POSINF
Definition at line 81 of file lpi_msk.c.
Referenced by generateMskBoundkeys(), SCIPlpiIsInfinity(), and SCIPlpiStrongbranch().
◆ IS_NEGINF
Definition at line 82 of file lpi_msk.c.
Referenced by generateMskBoundkeys(), and SCIPlpiStrongbranch().
◆ DEBUG_PRINT_STAT
◆ DEBUG_PARAM_SETTING
◆ DEBUG_CHECK_DATA
◆ DEBUG_EASY_REPRODUCE
◆ DEBUG_DO_INTPNT_FEAS_CHECK
◆ DEBUG_CHECK_STATE_TOL
#define DEBUG_CHECK_STATE_TOL 1e-5 |
Definition at line 99 of file lpi_msk.c.
Referenced by checkState1().
◆ SHOW_ERRORS
◆ SHOW_RELATIVE_OPTIMAL_GAP
◆ ASSERT_ON_NUMERICAL_TROUBLES
◆ ASSERT_ON_WARNING
◆ FORCE_MOSEK_LOG
#define FORCE_MOSEK_LOG 0 /* note that changing this AND setting lpinfo will lead to asserts in lpCheckIntpar */ |
◆ FORCE_MOSEK_SUMMARY
◆ FORCE_NO_MAXITER
◆ SETBACK_LIMIT
#define SETBACK_LIMIT 250 |
Definition at line 107 of file lpi_msk.c.
Referenced by SCIPlpiCreate().
◆ STRONGBRANCH_PRICING
#define STRONGBRANCH_PRICING MSK_SIM_SELECTION_SE |
Definition at line 108 of file lpi_msk.c.
Referenced by SCIPlpiStrongbranch().
◆ SUPRESS_NAME_ERROR
◆ WRITE_DUAL
◆ WRITE_PRIMAL
◆ WRITE_INTPNT
◆ DEGEN_LEVEL
#define DEGEN_LEVEL MSK_SIM_DEGEN_FREE |
Definition at line 116 of file lpi_msk.c.
Referenced by SCIPlpiCreate().
◆ ALWAYS_SOLVE_PRIMAL_FORM
◆ COLS_PER_PACKET
#define COLS_PER_PACKET SCIP_DUALPACKETSIZE |
Definition at line 170 of file lpi_msk.c.
Referenced by colpacketNum().
◆ ROWS_PER_PACKET
#define ROWS_PER_PACKET SCIP_DUALPACKETSIZE |
Definition at line 172 of file lpi_msk.c.
Referenced by rowpacketNum().
Typedef Documentation
◆ MSKoptimizertype
typedef enum MSKoptimizertype_enum MSKoptimizertype |
◆ COLPACKET
typedef SCIP_DUALPACKET COLPACKET |
◆ ROWPACKET
typedef SCIP_DUALPACKET ROWPACKET |
Function Documentation
◆ MSK_getsolutionstatus()
|
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.
- Parameters
-
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 195 of file lpi_msk.c.
References NULL.
Referenced by getSolutionStatus(), SCIPlpiGetSol(), SCIPlpiGetSolFeasibility(), SCIPlpiGetState(), SCIPlpiSolveBarrier(), SCIPlpiSolveDual(), SCIPlpiSolvePrimal(), and SolveWSimplex().
◆ colpacketNum()
|
static |
returns the number of packets needed to store column packet information
- Parameters
-
ncols number of columns to store
Definition at line 222 of file lpi_msk.c.
References COLS_PER_PACKET.
Referenced by lpistateCreate(), and lpistateFree().
◆ rowpacketNum()
|
static |
returns the number of packets needed to store row packet information
- Parameters
-
nrows number of rows to store
Definition at line 231 of file lpi_msk.c.
References ROWS_PER_PACKET.
Referenced by lpistateCreate(), and lpistateFree().
◆ printstr()
|
static |
print string using message handler of SCIP
- Parameters
-
handle error handle str string that contains string on output
Definition at line 240 of file lpi_msk.c.
References BMSallocMemoryArray, BMSfreeMemoryArray, MOSEK_CALL, MosekEnv, NULL, SCIP_ALLOC, SCIP_OKAY, SCIPdebugMessage, SCIPerrorMessage, SCIPmessagePrintInfo(), and SCIP_LPi::task.
Referenced by SCIPlpiCreate().
◆ ensureBkxMem()
|
static |
resizes bound keys array bkx to have at least ncols entries
- Parameters
-
lpi pointer to an LP interface structure ncols number of columns
Definition at line 377 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().
◆ ensureBkcMem()
|
static |
resizes bound keys array bkc to have at least nrows entries
- Parameters
-
lpi pointer to an LP interface structure nrows number of rows
Definition at line 396 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().
◆ ensureAptreMem()
|
static |
resizes aptre array to have at least n entries
- Parameters
-
lpi pointer to an LP interface structure n number of entries
Definition at line 415 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().
◆ invalidateSolution()
|
static |
marks the current LP to be unsolved
- Parameters
-
lpi pointer to an LP interface structure
Definition at line 434 of file lpi_msk.c.
References 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().
◆ generateMskBoundkeys()
|
static |
compute boundkeys to inform MOSEK about fixed/free/ranged/lower bounded/upper bounded variables or constraints
- Parameters
-
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 445 of file lpi_msk.c.
References IS_NEGINF, IS_POSINF, and NULL.
Referenced by SCIPlpiAddCols(), SCIPlpiAddRows(), SCIPlpiChgBounds(), SCIPlpiChgSides(), and SCIPlpiLoadColLP().
◆ getEndptrs()
|
static |
get end pointers of arrays
- Parameters
-
n array size beg array of beginning indices nnonz number of nonzeros aptre array to store the result
Definition at line 496 of file lpi_msk.c.
References NULL, and SCIP_OKAY.
Referenced by SCIPlpiAddCols(), SCIPlpiAddRows(), and SCIPlpiLoadColLP().
◆ getIndicesRange()
|
static |
compute indices from range
- Parameters
-
first first index last last index sub pointer to store the indices ranges
Definition at line 530 of file lpi_msk.c.
References BMSallocMemoryArray, SCIP_ALLOC, and SCIP_OKAY.
Referenced by SCIPlpiDelCols(), and SCIPlpiDelRows().
◆ getIndicesFromDense()
|
static |
compute indices from dense array
- Parameters
-
dstat array n size of array count array of counts (sizes) sub pointer to store array of indices
Definition at line 552 of file lpi_msk.c.
References BMSallocMemoryArray, NULL, SCIP_ALLOC, and SCIP_OKAY.
Referenced by SCIPlpiDelColset(), and SCIPlpiDelRowset().
◆ scale_vec()
|
static |
scale a vector
- Parameters
-
len length of vector vec vector to be scaled s scaling factor
Definition at line 595 of file lpi_msk.c.
Referenced by SCIPlpiScaleCol(), and SCIPlpiScaleRow().
◆ scale_bound()
|
static |
scale lower and upper bound
- Parameters
-
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 610 of file lpi_msk.c.
References FALSE.
Referenced by SCIPlpiScaleCol(), and SCIPlpiScaleRow().
◆ ensureStateMem()
|
static |
resizes state arrays to have at least ncols/nrows entries
- Parameters
-
lpi pointer to an LP interface structure ncols number of columns nrows number of rows
Definition at line 653 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().
◆ getbase()
|
static |
get base and store in skc/skx arrays
- Parameters
-
lpi pointer to an LP interface structure ncols number of columns nrows number of rows
Definition at line 682 of file lpi_msk.c.
References 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().
◆ setbase()
|
static |
set base to the values given in skc/skx arrays
- Parameters
-
lpi pointer to an LP interface structure
Definition at line 701 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().
◆ paramty2str()
|
static |
method mapping parameter index to parameter name
Definition at line 4984 of file lpi_msk.c.
References 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().
Variable Documentation
◆ MosekEnv
|
static |
Definition at line 85 of file lpi_msk.c.
Referenced by getASlice(), getSolutionStatus(), printstr(), SCIPlpiAddCols(), SCIPlpiAddRows(), SCIPlpiChgBounds(), SCIPlpiChgCoef(), SCIPlpiChgObj(), SCIPlpiChgObjsen(), SCIPlpiChgSides(), SCIPlpiClear(), SCIPlpiClearState(), SCIPlpiCreate(), SCIPlpiDelCols(), SCIPlpiDelColset(), SCIPlpiDelRows(), SCIPlpiDelRowset(), SCIPlpiExistsDualRay(), SCIPlpiExistsPrimalRay(), SCIPlpiFree(), SCIPlpiFreeState(), SCIPlpiGetBase(), SCIPlpiGetBasisInd(), SCIPlpiGetBInvACol(), SCIPlpiGetBInvARow(), SCIPlpiGetBInvCol(), SCIPlpiGetBInvRow(), SCIPlpiGetBounds(), SCIPlpiGetCoef(), SCIPlpiGetColNames(), SCIPlpiGetCols(), SCIPlpiGetDualfarkas(), SCIPlpiGetInternalStatus(), SCIPlpiGetIntpar(), SCIPlpiGetIterations(), SCIPlpiGetNCols(), SCIPlpiGetNNonz(), SCIPlpiGetNorms(), SCIPlpiGetNRows(), SCIPlpiGetObj(), SCIPlpiGetObjsen(), SCIPlpiGetObjval(), SCIPlpiGetPrimalRay(), SCIPlpiGetRealpar(), SCIPlpiGetRealSolQuality(), SCIPlpiGetRowNames(), SCIPlpiGetRows(), SCIPlpiGetSides(), SCIPlpiGetSol(), SCIPlpiGetSolFeasibility(), SCIPlpiGetSolverPointer(), SCIPlpiGetState(), SCIPlpiHasDualRay(), SCIPlpiHasPrimalRay(), SCIPlpiHasStateBasis(), SCIPlpiIgnoreInstability(), SCIPlpiInfinity(), SCIPlpiIsDualFeasible(), SCIPlpiIsDualInfeasible(), SCIPlpiIsDualUnbounded(), SCIPlpiIsInfinity(), SCIPlpiIsIterlimExc(), SCIPlpiIsObjlimExc(), SCIPlpiIsOptimal(), SCIPlpiIsPrimalFeasible(), SCIPlpiIsPrimalInfeasible(), SCIPlpiIsPrimalUnbounded(), SCIPlpiIsStable(), SCIPlpiIsTimelimExc(), SCIPlpiLoadColLP(), SCIPlpiReadLP(), SCIPlpiReadState(), SCIPlpiScaleCol(), SCIPlpiScaleRow(), SCIPlpiSetBase(), SCIPlpiSetIntpar(), SCIPlpiSetRealpar(), SCIPlpiSetState(), SCIPlpiSolveBarrier(), SCIPlpiSolveDual(), SCIPlpiSolvePrimal(), SCIPlpiStartStrongbranch(), SCIPlpiStrongbranch(), SCIPlpiWriteLP(), SCIPlpiWriteState(), and SolveWSimplex().
◆ numlp
|
static |
Definition at line 86 of file lpi_msk.c.
Referenced by SCIPlpiCreate(), and SCIPlpiFree().
◆ optimizecount
|
static |
Definition at line 88 of file lpi_msk.c.
Referenced by checkState1(), filterTRMrescode(), SCIPlpiGetState(), SCIPlpiSolveBarrier(), SCIPlpiSolveDual(), SCIPlpiSolvePrimal(), SCIPlpiStrongbranch(), and SolveWSimplex().
◆ nextlpid
|
static |
Definition at line 89 of file lpi_msk.c.
Referenced by SCIPlpiCreate().
◆ mskname
|
static |
Definition at line 722 of file lpi_msk.c.
Referenced by SCIPlpiGetSolverName().
◆ paramname
|
static |
constant array containing the parameter names
Definition at line 4958 of file lpi_msk.c.
Referenced by addFixParamDialog(), addSetParamDialog(), alnsIncludeNeighborhood(), checkTransferBoolParam(), doBendersCreate(), doBenderscutCreate(), doBranchruleCreate(), doComprCreate(), doConcsolverTypeCreate(), doConflicthdlrCreate(), doConshdlrCreate(), 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(), SCIP_DECL_CONCSOLVERCREATEINST(), SCIPdivesetCreate(), SCIPincludeBenderscutInt(), SCIPincludeBenderscutNogood(), SCIPincludeBenderscutOpt(), SCIPincludeDialogDefaultFix(), SCIPincludeDialogDefaultSet(), SCIPincludeNlpi(), SCIPincludeNonlinconsUpgrade(), SCIPincludeQuadconsUpgrade(), SCIPparamsetCopyParams(), SCIPparamsetSetEmphasis(), SCIPparamsetSetToDefault(), SCIPparamsetSetToSubscipsOff(), SCIPsetConshdlrPresol(), SCIPsetConshdlrProp(), SCIPsetConshdlrSepa(), and SCIPsetPropPresol().