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 |
Variables | |
| static MSKenv_t | reusemosekenv = NULL |
| static int | numlp = 0 |
| static const char * | paramname [] |
| #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 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 757 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 223 of file lpi_msk.c.
References MSK_getsolutionstatus(), and NULL.
Referenced by getSolutionStatus(), MSK_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 250 of file lpi_msk.c.
References colpacketNum(), and COLS_PER_PACKET.
|
static |
returns the number of packets needed to store row packet information
| nrows | number of rows to store |
Definition at line 259 of file lpi_msk.c.
References rowpacketNum(), and ROWS_PER_PACKET.
|
static |
print string using message handler of SCIP
| handle | error handle |
| str | string that contains string on output |
Definition at line 268 of file lpi_msk.c.
References NULL, printstr(), and SCIPmessagePrintInfo().
Referenced by printstr(), and 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 408 of file lpi_msk.c.
References SCIP_LPi::bkx, SCIP_LPi::bkxsize, BMSreallocMemoryArray, ensureBkxMem(), MAX, SCIP_ALLOC, and SCIP_OKAY.
Referenced by ensureBkxMem(), 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 427 of file lpi_msk.c.
References SCIP_LPi::bkc, SCIP_LPi::bkcsize, BMSreallocMemoryArray, ensureBkcMem(), MAX, SCIP_ALLOC, and SCIP_OKAY.
Referenced by ensureBkcMem(), 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 446 of file lpi_msk.c.
References SCIP_LPi::aptre, SCIP_LPi::aptresize, BMSreallocMemoryArray, ensureAptreMem(), MAX, SCIP_ALLOC, and SCIP_OKAY.
Referenced by ensureAptreMem(), getASlice(), SCIPlpiAddCols(), SCIPlpiAddRows(), and SCIPlpiLoadColLP().
|
static |
marks the current LP to be unsolved
| lpi | pointer to an LP interface structure |
Definition at line 465 of file lpi_msk.c.
References assert(), FALSE, invalidateSolution(), NULL, and SCIP_LPi::solved.
|
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 476 of file lpi_msk.c.
References assert(), generateMskBoundkeys(), i, IS_NEGINF, IS_POSINF, and NULL.
Referenced by generateMskBoundkeys(), 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 527 of file lpi_msk.c.
References assert(), getEndptrs(), i, NULL, and SCIP_OKAY.
Referenced by getEndptrs(), 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 561 of file lpi_msk.c.
References assert(), BMSallocMemoryArray, getIndicesRange(), i, SCIP_ALLOC, and SCIP_OKAY.
Referenced by getIndicesRange(), 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 583 of file lpi_msk.c.
References assert(), BMSallocMemoryArray, getIndicesFromDense(), i, NULL, SCIP_ALLOC, and SCIP_OKAY.
Referenced by getIndicesFromDense(), SCIPlpiDelColset(), and SCIPlpiDelRowset().
|
static |
scale a vector
| len | length of vector |
| vec | vector to be scaled |
| s | scaling factor |
Definition at line 626 of file lpi_msk.c.
References i, and scale_vec().
Referenced by scale_vec(), 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 641 of file lpi_msk.c.
References scale_bound(), and SCIPABORT.
Referenced by scale_bound(), 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 684 of file lpi_msk.c.
References BMSreallocMemoryArray, ensureStateMem(), MAX, SCIP_ALLOC, SCIP_OKAY, SCIP_LPi::skc, SCIP_LPi::skcsize, SCIP_LPi::skx, and SCIP_LPi::skxsize.
Referenced by ensureStateMem(), 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 713 of file lpi_msk.c.
References assert(), ensureStateMem(), getbase(), 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 getbase(), 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 732 of file lpi_msk.c.
References FALSE, SCIP_LPi::lastsolvetype, SCIP_LPi::lpid, MOSEK_CALL, NULL, SCIP_OKAY, SCIPdebugMessage, setbase(), SCIP_LPi::skc, SCIP_LPi::skx, SCIP_LPi::solved, and SCIP_LPi::task.
Referenced by SCIPlpiSetBase(), SCIPlpiSetState(), SCIPlpiStrongbranch(), and setbase().
|
static |
method mapping parameter index to parameter name
Definition at line 5198 of file lpi_msk.c.
References assert(), paramname, paramty2str(), 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 paramty2str(), 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 5172 of file lpi_msk.c.
Referenced by paramty2str().