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>
#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) (((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 | MOSEK_relDiff(val1, val2) ( ((val1)-(val2))/(MAX3(1.0,REALABS(val1),REALABS(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) #x |
#define | STR(x) STR_HELPER(x) |
#define | mskname "MOSEK " STR(MSK_VERSION_MAJOR) "." STR(MSK_VERSION_MINOR) "." STR(MSK_VERSION_BUILD) "." STR(MSK_VERSION_REVISION) |
Typedefs | |
typedef enum MSKoptimizertype_enum | MSKoptimizertype |
typedef SCIP_DUALPACKET | COLPACKET |
typedef SCIP_DUALPACKET | ROWPACKET |
Variables | |
static MSKenv_t | reusemosekenv = NULL |
static int | numlp = 0 |
static const char * | paramname [] |
Macro Definition Documentation
◆ MSKCONST
#define MSKCONST const /* this define is needed for older MOSEK versions */ |
◆ scipmskobjsen
◆ SENSE2MOSEK
#define SENSE2MOSEK | ( | objsen | ) | (((objsen)==SCIP_OBJSEN_MINIMIZE)?(MSK_OBJECTIVE_SENSE_MINIMIZE):(MSK_OBJECTIVE_SENSE_MAXIMIZE)) |
Definition at line 65 of file lpi_msk.c.
Referenced by SCIPlpiChgObjsen(), SCIPlpiCreate(), and SCIPlpiLoadColLP().
◆ MOSEK_CALL
#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(), 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 82 of file lpi_msk.c.
Referenced by SCIPlpiExistsDualRay(), SCIPlpiExistsPrimalRay(), SCIPlpiHasDualRay(), SCIPlpiHasPrimalRay(), SCIPlpiIsDualFeasible(), SCIPlpiIsOptimal(), SCIPlpiIsPrimalFeasible(), and SCIPlpiIsPrimalUnbounded().
◆ IS_POSINF
Definition at line 94 of file lpi_msk.c.
Referenced by generateMskBoundkeys(), SCIPlpiIsInfinity(), and SCIPlpiStrongbranch().
◆ IS_NEGINF
Definition at line 95 of file lpi_msk.c.
Referenced by generateMskBoundkeys(), and SCIPlpiStrongbranch().
◆ MOSEK_relDiff
Definition at line 96 of file lpi_msk.c.
Referenced by SCIPlpiIsStable().
◆ SCIP_REUSEENV
◆ 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 120 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 128 of file lpi_msk.c.
Referenced by SCIPlpiCreate().
◆ STRONGBRANCH_PRICING
#define STRONGBRANCH_PRICING MSK_SIM_SELECTION_SE |
Definition at line 129 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 137 of file lpi_msk.c.
Referenced by SCIPlpiCreate().
◆ ALWAYS_SOLVE_PRIMAL_FORM
◆ COLS_PER_PACKET
#define COLS_PER_PACKET SCIP_DUALPACKETSIZE |
Definition at line 197 of file lpi_msk.c.
Referenced by colpacketNum().
◆ ROWS_PER_PACKET
#define ROWS_PER_PACKET SCIP_DUALPACKETSIZE |
Definition at line 199 of file lpi_msk.c.
Referenced by rowpacketNum().
◆ STR_HELPER
◆ STR
#define STR | ( | x | ) | STR_HELPER(x) |
◆ mskname
#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 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 222 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 249 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 258 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 267 of file lpi_msk.c.
References BMSallocMemoryArray, BMSfreeMemoryArray, MOSEK_CALL, SCIP_LPi::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 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().
◆ 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 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().
◆ 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 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().
◆ invalidateSolution()
|
static |
marks the current LP to be unsolved
- Parameters
-
lpi pointer to an LP interface structure
Definition at line 461 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 472 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 523 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 557 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 579 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 622 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 637 of file lpi_msk.c.
References SCIPABORT.
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 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().
◆ 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 709 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 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().
◆ paramty2str()
|
static |
method mapping parameter index to parameter name
Definition at line 5122 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
◆ reusemosekenv
◆ numlp
◆ paramname
|
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(), SCIP_DECL_CONCSOLVERCREATEINST(), SCIP_DECL_NLPICREATEPROBLEM(), SCIPdivesetCreate(), SCIPincludeBenderscutInt(), SCIPincludeBenderscutNogood(), SCIPincludeBenderscutOpt(), SCIPincludeConsUpgradeNonlinear(), SCIPincludeDialogDefaultFix(), SCIPincludeDialogDefaultSet(), SCIPincludeNlpi(), SCIPincludeNlpSolverIpopt(), SCIPnlhdlrCreate(), SCIPparamsetCopyParams(), SCIPparamsetSetEmphasis(), SCIPparamsetSetToDefault(), SCIPparamsetSetToSubscipsOff(), SCIPsetConshdlrPresol(), SCIPsetConshdlrProp(), SCIPsetConshdlrSepa(), and SCIPsetPropPresol().