SCIP-SDP
2.0.0
|
General interface methods for SDP-preprocessing (mainly fixing variables and removing empty rows/cols) More...
Go to the source code of this file.
Macros | |
#define | BMS_CALL(x) |
#define | CHECK_IF_SOLVED(sdpi) |
#define | CHECK_IF_SOLVED_BOOL(sdpi) |
#define | DUPLICATE_ARRAY_NULL(blkmem, target, source, size) |
#define | SCIP_CALL_PARAM(x) |
Functions | |
static void | ensureLowerTriangular (int *i, int *j) |
static SCIP_Bool | isFixed (SCIP_SDPI *sdpi, int v) |
static SCIP_RETCODE | compConstMatAfterFixings (SCIP_SDPI *sdpi, int *sdpconstnnonz, int *sdpconstnblocknonz, int **sdpconstrow, int **sdpconstcol, SCIP_Real **sdpconstval) |
static SCIP_RETCODE | findEmptyRowColsSDP (SCIP_SDPI *sdpi, int *sdpconstnblocknonz, int **sdpconstrow, int **sdpconstcol, SCIP_Real **sdpconstval, int **indchanges, int *nremovedinds, int *blockindchanges, int *nremovedblocks) |
static SCIP_RETCODE | computeLpLhsRhsAfterFixings (SCIP_SDPI *sdpi, int *nactivelpcons, SCIP_Real *lplhsafterfix, SCIP_Real *lprhsafterfix, int *rownactivevars, SCIP_Bool *fixingsfound) |
Miscellaneous Methods | |
const char * | SCIPsdpiGetSolverName (void) |
const char * | SCIPsdpiGetSolverDesc (void) |
void * | SCIPsdpiGetSolverPointer (SCIP_SDPI *sdpi) |
SDPI Creation and Destruction Methods | |
SCIP_RETCODE | SCIPsdpiCreate (SCIP_SDPI **sdpi, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem) |
SCIP_RETCODE | SCIPsdpiFree (SCIP_SDPI **sdpi) |
SCIP_RETCODE | SCIPsdpiClone (SCIP_SDPI *oldsdpi, SCIP_SDPI *newsdpi) |
Modification Methods | |
SCIP_RETCODE | SCIPsdpiLoadSDP (SCIP_SDPI *sdpi, int nvars, SCIP_Real *obj, SCIP_Real *lb, SCIP_Real *ub, int nsdpblocks, int *sdpblocksizes, int *sdpnblockvars, int sdpconstnnonz, int *sdpconstnblocknonz, int **sdpconstrow, int **sdpconstcol, SCIP_Real **sdpconstval, int sdpnnonz, int **sdpnblockvarnonz, int **sdpvar, int ***sdprow, int ***sdpcol, SCIP_Real ***sdpval, int nlpcons, SCIP_Real *lplhs, SCIP_Real *lprhs, int lpnnonz, int *lprow, int *lpcol, SCIP_Real *lpval) |
SCIP_RETCODE | SCIPsdpiAddLPRows (SCIP_SDPI *sdpi, int nrows, const SCIP_Real *lhs, const SCIP_Real *rhs, int nnonz, const int *row, const int *col, const SCIP_Real *val) |
SCIP_RETCODE | SCIPsdpiDelLPRows (SCIP_SDPI *sdpi, int firstrow, int lastrow) |
SCIP_RETCODE | SCIPsdpiDelLPRowset (SCIP_SDPI *sdpi, int *dstat) |
SCIP_RETCODE | SCIPsdpiClear (SCIP_SDPI *sdpi) |
SCIP_RETCODE | SCIPsdpiChgBounds (SCIP_SDPI *sdpi, int nvars, const int *ind, const SCIP_Real *lb, const SCIP_Real *ub) |
SCIP_RETCODE | SCIPsdpiChgLPLhRhSides (SCIP_SDPI *sdpi, int nrows, const int *ind, const SCIP_Real *lhs, const SCIP_Real *rhs) |
Data Accessing Methods | |
SCIP_RETCODE | SCIPsdpiGetNLPRows (SCIP_SDPI *sdpi, int *nlprows) |
SCIP_RETCODE | SCIPsdpiGetNSDPBlocks (SCIP_SDPI *sdpi, int *nsdpblocks) |
SCIP_RETCODE | SCIPsdpiGetNVars (SCIP_SDPI *sdpi, int *nvars) |
SCIP_RETCODE | SCIPsdpiGetSDPNNonz (SCIP_SDPI *sdpi, int *nnonz) |
SCIP_RETCODE | SCIPsdpiGetConstNNonz (SCIP_SDPI *sdpi, int *nnonz) |
SCIP_RETCODE | SCIPsdpiGetLPNNonz (SCIP_SDPI *sdpi, int *nnonz) |
SCIP_RETCODE | SCIPsdpiGetObj (SCIP_SDPI *sdpi, int firstvar, int lastvar, SCIP_Real *vals) |
SCIP_RETCODE | SCIPsdpiGetBounds (SCIP_SDPI *sdpi, int firstvar, int lastvar, SCIP_Real *lbs, SCIP_Real *ubs) |
SCIP_RETCODE | SCIPsdpiGetLhSides (SCIP_SDPI *sdpi, int firstrow, int lastrow, SCIP_Real *lhss) |
SCIP_RETCODE | SCIPsdpiGetRhSides (SCIP_SDPI *sdpi, int firstrow, int lastrow, SCIP_Real *rhss) |
Solving Methods | |
SCIP_RETCODE | SCIPsdpiSolve (SCIP_SDPI *sdpi, SCIP_Real *start, int *totalsdpiterations, SCIP_Bool enforceslatercheck) |
Solution Information Methods | |
SCIP_Bool | SCIPsdpiWasSolved (SCIP_SDPI *sdpi) |
SCIP_Bool | SCIPsdpiSolvedOrig (SCIP_SDPI *sdpi) |
SCIP_Bool | SCIPsdpiFeasibilityKnown (SCIP_SDPI *sdpi) |
SCIP_RETCODE | SCIPsdpiGetSolFeasibility (SCIP_SDPI *sdpi, SCIP_Bool *primalfeasible, SCIP_Bool *dualfeasible) |
SCIP_Bool | SCIPsdpiIsPrimalUnbounded (SCIP_SDPI *sdpi) |
SCIP_Bool | SCIPsdpiIsPrimalInfeasible (SCIP_SDPI *sdpi) |
SCIP_Bool | SCIPsdpiIsPrimalFeasible (SCIP_SDPI *sdpi) |
SCIP_Bool | SCIPsdpiIsDualUnbounded (SCIP_SDPI *sdpi) |
SCIP_Bool | SCIPsdpiIsDualInfeasible (SCIP_SDPI *sdpi) |
SCIP_Bool | SCIPsdpiIsDualFeasible (SCIP_SDPI *sdpi) |
SCIP_Bool | SCIPsdpiIsConverged (SCIP_SDPI *sdpi) |
SCIP_Bool | SCIPsdpiIsObjlimExc (SCIP_SDPI *sdpi) |
SCIP_Bool | SCIPsdpiIsIterlimExc (SCIP_SDPI *sdpi) |
SCIP_Bool | SCIPsdpiIsTimelimExc (SCIP_SDPI *sdpi) |
int | SCIPsdpiGetInternalStatus (SCIP_SDPI *sdpi) |
SCIP_Bool | SCIPsdpiIsOptimal (SCIP_SDPI *sdpi) |
SCIP_Bool | SCIPsdpiIsAcceptable (SCIP_SDPI *sdpi) |
SCIP_RETCODE | SCIPsdpiGetObjval (SCIP_SDPI *sdpi, SCIP_Real *objval) |
SCIP_RETCODE | SCIPsdpiGetSol (SCIP_SDPI *sdpi, SCIP_Real *objval, SCIP_Real *dualsol, int *dualsollength) |
SCIP_RETCODE | SCIPsdpiGetPrimalBoundVars (SCIP_SDPI *sdpi, SCIP_Real *lbvars, SCIP_Real *ubvars, int *arraylength) |
SCIP_RETCODE | SCIPsdpiGetIterations (SCIP_SDPI *sdpi, int *iterations) |
Numerical Methods | |
SCIP_Real | SCIPsdpiInfinity (SCIP_SDPI *sdpi) |
SCIP_Bool | SCIPsdpiIsInfinity (SCIP_SDPI *sdpi, SCIP_Real val) |
SCIP_Real | SCIPsdpiMaxPenParam (SCIP_SDPI *sdpi) |
SCIP_Bool | SCIPsdpiIsGEMaxPenParam (SCIP_SDPI *sdpi, SCIP_Real val) |
SCIP_RETCODE | SCIPsdpiGetRealpar (SCIP_SDPI *sdpi, SCIP_SDPPARAM type, SCIP_Real *dval) |
SCIP_RETCODE | SCIPsdpiSetRealpar (SCIP_SDPI *sdpi, SCIP_SDPPARAM type, SCIP_Real dval) |
SCIP_RETCODE | SCIPsdpiGetIntpar (SCIP_SDPI *sdpi, SCIP_SDPPARAM type, int *ival) |
SCIP_RETCODE | SCIPsdpiSetIntpar (SCIP_SDPI *sdpi, SCIP_SDPPARAM type, int ival) |
File Interface Methods | |
SCIP_RETCODE | SCIPsdpiReadSDP (SCIP_SDPI *sdpi, const char *fname) |
SCIP_RETCODE | SCIPsdpiWriteSDP (SCIP_SDPI *sdpi, const char *fname) |
General interface methods for SDP-preprocessing (mainly fixing variables and removing empty rows/cols)
Definition in file sdpi.c.
#define BMS_CALL | ( | x | ) |
Checks if a BMSallocMemory-call was successfull, otherwise returns SCIP_NOMEMRY
Definition at line 53 of file sdpi.c.
Referenced by compConstMatAfterFixings(), SCIPsdpiAddLPRows(), SCIPsdpiClone(), SCIPsdpiCreate(), SCIPsdpiDelLPRows(), SCIPsdpiLoadSDP(), and SCIPsdpiSolve().
#define CHECK_IF_SOLVED | ( | sdpi | ) |
this will be called in all functions that want to access solution information to check if the problem was solved since the last change of the problem
Definition at line 64 of file sdpi.c.
Referenced by SCIPsdpiGetIterations(), SCIPsdpiGetObjval(), SCIPsdpiGetPrimalBoundVars(), SCIPsdpiGetSol(), and SCIPsdpiGetSolFeasibility().
#define CHECK_IF_SOLVED_BOOL | ( | sdpi | ) |
same as CHECK_IF_SOLVED, but this will be used in functions returning a boolean value
Definition at line 75 of file sdpi.c.
Referenced by SCIPsdpiFeasibilityKnown(), SCIPsdpiIsAcceptable(), SCIPsdpiIsConverged(), SCIPsdpiIsDualFeasible(), SCIPsdpiIsDualInfeasible(), SCIPsdpiIsDualUnbounded(), SCIPsdpiIsIterlimExc(), SCIPsdpiIsObjlimExc(), SCIPsdpiIsOptimal(), SCIPsdpiIsPrimalFeasible(), SCIPsdpiIsPrimalInfeasible(), SCIPsdpiIsPrimalUnbounded(), and SCIPsdpiIsTimelimExc().
#define DUPLICATE_ARRAY_NULL | ( | blkmem, | |
target, | |||
source, | |||
size | |||
) |
duplicate an array that might be null (in that case null is returned, otherwise BMSduplicateMemory is called)
Definition at line 86 of file sdpi.c.
Referenced by SCIPsdpiLoadSDP().
#define SCIP_CALL_PARAM | ( | x | ) |
same as SCIP_CALL, but gives a SCIP_PARAMETERUNKNOWN error if it fails
Definition at line 96 of file sdpi.c.
Referenced by SCIPsdpiGetIntpar(), SCIPsdpiGetRealpar(), SCIPsdpiSetIntpar(), and SCIPsdpiSetRealpar().
|
static |
For given row and column (i,j) checks if i >= j, so that i and j give a position in the lower triangular part, otherwise i and j will be switched. This function will be called whenever a position in a symmetric matrix is given, to prevent problems if position (i,j) is given but later (j,i) should be changed.
i | row index |
j | column index |
Definition at line 172 of file sdpi.c.
Referenced by SCIPsdpiLoadSDP().
|
static |
tests if for a given variable the lower bound is in an epsilon neighborhood of the upper bound
sdpi | pointer to an SDP interface structure |
v | global index of the variable to check this for |
Definition at line 189 of file sdpi.c.
Referenced by compConstMatAfterFixings(), computeLpLhsRhsAfterFixings(), and findEmptyRowColsSDP().
|
static |
Computes the constant Matrix after all variables with lb=ub have been fixed and their nonzeros were moved to the constant part. The five variables other than sdpi are used to return the matrix.
The size of sdpconstnblocknonz and the first pointers of sdpconst row/col/val should be equal to sdpi->nsdpblocks, the size of sdpconst row/col/val [i], which is given in sdpconstblocknnonz, needs to be sufficient, otherwise the needed length will be returned in sdpconstnblocknonz and a debug message will be thrown.
sdpi | pointer to an SDP interface structure |
sdpconstnnonz | number of nonzero elements in the constant matrices of the SDP-Blocks |
sdpconstnblocknonz | number of nonzeros for each variable in the constant part, also the i-th entry gives the number of entries of sdpconst row/col/val [i] |
sdpconstrow | pointers to row-indices for each block |
sdpconstcol | pointers to column-indices for each block |
sdpconstval | pointers to the values of the nonzeros for each block |
Definition at line 221 of file sdpi.c.
References BMS_CALL, isFixed(), and SCIPsdpVarfixerMergeArraysIntoNew().
Referenced by SCIPsdpiSolve().
|
static |
This takes the sdpi and the computed constant matrix after fixings as input and checks for empty rows and columns in each block, which should be removed to not harm the Slater condition. It also removes SDP blocks with no entries left, these are returned in blockindchanges and nremovedblocks.
sdpi | pointer to an SDP interface structure |
sdpconstnblocknonz | number of nonzeros for each variable in the constant part, also the i-th entry gives the number of entries of sdpconst row/col/val [i] |
sdpconstrow | pointers to row-indices for each block |
sdpconstcol | pointers to column-indices for each block |
sdpconstval | pointers to the values of the nonzeros for each block |
indchanges | pointer to store the changes needed to be done to the indices, if indchange[block][nonz]=-1, then the index can be removed, otherwise it gives the number of indices removed before this, i.e. the value to decrease this index by, this array should have memory allocated in the size sdpi->nsdpblocks times sdpi->sdpblocksizes[block] |
nremovedinds | pointer to store the number of rows/cols to be fixed for each block |
blockindchanges | pointer to store index change for each block, system is the same as for indchanges |
nremovedblocks | pointer to store the number of blocks to be removed from the SDP |
Definition at line 335 of file sdpi.c.
References isFixed().
Referenced by SCIPsdpiSolve().
|
static |
computes the number of active variables for each constraint, thereby detecting constraints that may be removed, and computes the LP-left- and right-hand-sides after including all locally fixed variables for all constraints with at least two remaining active variables
sdpi | pointer to an SDP interface structure |
nactivelpcons | output: number of active LP-constraints |
lplhsafterfix | output: first nlpcons (output) entries give left-hand sides of active lp-constraints after fixing variables, these are in the same relative order as before (with non-active rows removed) |
lprhsafterfix | output: first nlpcons (output) entries give right-hand sides of active lp-constraints after fixing variables, these are in the same relative order as before (with non-active rows removed) |
rownactivevars | output: number of active variable for every row |
fixingsfound | output: returns true if a variable was fixed during this function call |
Definition at line 462 of file sdpi.c.
References isFixed(), and SCIPsdpiInfinity().
Referenced by SCIPsdpiSolve().
const char* SCIPsdpiGetSolverName | ( | void | ) |
gets name and potentially version of SDP solver
Definition at line 813 of file sdpi.c.
References SCIPsdpiSolverGetSolverName().
Referenced by SCIP_DECL_RELAXINIT(), and SCIPincludeRelaxSdp().
const char* SCIPsdpiGetSolverDesc | ( | void | ) |
gets description of SDP solver (developer, webpage, ...)
Definition at line 821 of file sdpi.c.
References SCIPsdpiSolverGetSolverDesc().
Referenced by SCIPincludeRelaxSdp().
void* SCIPsdpiGetSolverPointer | ( | SCIP_SDPI * | sdpi | ) |
gets pointer for SDP solver - use only with great care
The behavior of this function depends on the solver and its use is therefore only recommended if you really know what you are doing. In general, it returns a pointer to the SDP solver object.
sdpi | SDP interface structure |
Definition at line 834 of file sdpi.c.
References SCIPsdpiSolverGetSolverPointer().
SCIP_RETCODE SCIPsdpiCreate | ( | SCIP_SDPI ** | sdpi, |
SCIP_MESSAGEHDLR * | messagehdlr, | ||
BMS_BLKMEM * | blkmem | ||
) |
creates an SDP problem object
sdpi | pointer to an SDP interface structure |
messagehdlr | message handler to use for printing messages, or NULL |
blkmem | block memory |
Definition at line 852 of file sdpi.c.
References BMS_CALL, and SCIPsdpiSolverCreate().
Referenced by SCIPincludeRelaxSdp().
SCIP_RETCODE SCIPsdpiFree | ( | SCIP_SDPI ** | sdpi | ) |
deletes an SDP problem object
sdpi | pointer to an SDP interface structure |
Definition at line 908 of file sdpi.c.
References SCIPsdpiSolverFree().
Referenced by SCIP_DECL_RELAXFREE().
cloning method of the general SDP-Interface
oldsdpi | pointer to the SDP interface structure that should be cloned |
newsdpi | pointer to an SDP interface structure to clone into |
Definition at line 971 of file sdpi.c.
References BMS_CALL, and SCIPsdpiSolverCreate().
SCIP_RETCODE SCIPsdpiLoadSDP | ( | SCIP_SDPI * | sdpi, |
int | nvars, | ||
SCIP_Real * | obj, | ||
SCIP_Real * | lb, | ||
SCIP_Real * | ub, | ||
int | nsdpblocks, | ||
int * | sdpblocksizes, | ||
int * | sdpnblockvars, | ||
int | sdpconstnnonz, | ||
int * | sdpconstnblocknonz, | ||
int ** | sdpconstrow, | ||
int ** | sdpconstcol, | ||
SCIP_Real ** | sdpconstval, | ||
int | sdpnnonz, | ||
int ** | sdpnblockvarnonz, | ||
int ** | sdpvar, | ||
int *** | sdprow, | ||
int *** | sdpcol, | ||
SCIP_Real *** | sdpval, | ||
int | nlpcons, | ||
SCIP_Real * | lplhs, | ||
SCIP_Real * | lprhs, | ||
int | lpnnonz, | ||
int * | lprow, | ||
int * | lpcol, | ||
SCIP_Real * | lpval | ||
) |
copies SDP data into SDP solver
sdpi | SDP interface structure |
nvars | number of variables |
obj | objective function values of variables |
lb | lower bounds of variables |
ub | upper bounds of variables |
nsdpblocks | number of SDP-blocks |
sdpblocksizes | sizes of the SDP-blocks (may be NULL if nsdpblocks = sdpconstnnonz = sdpnnonz = 0) |
sdpnblockvars | number of variables in each SDP block (may be NULL if nsdpblocks = sdpconstnnonz = sdpnnonz = 0) |
sdpconstnnonz | number of nonzero elements in the constant matrices of the SDP-Blocks |
sdpconstnblocknonz | number of nonzeros for each variable in the constant part, also the i-th entry gives the number of entries of sdpconst row/col/val [i] |
sdpconstrow | pointer to row-indices of constant matrix for each block (may be NULL if sdpconstnnonz = 0) |
sdpconstcol | pointer to column-indices of constant matrix for each block (may be NULL if sdpconstnnonz = 0) |
sdpconstval | pointer to values of entries of constant matrix for each block (may be NULL if sdpconstnnonz = 0) |
sdpnnonz | number of nonzero elements in the SDP-constraint matrices |
sdpnblockvarnonz | sdpnblockvarnonz[i][j] gives the number of nonzeros for the j-th variable (not necessarly variable j) in the i-th block, this is also the length of row/col/val[i][j] |
sdpvar | sdpvar[i][j] gives the sdp-index of the j-th variable (according to the sorting for row/col/val) in the i-th block |
sdprow | pointer to the row-indices for each block and variable in this block, so row[i][j][k] gives the k-th nonzero of the j-th variable (not necessarly variable j) in the i-th block (may be NULL if sdptnnonz = 0) |
sdpcol | pointer to the column-indices for each block and variable in this block (may be NULL if sdptnnonz = 0) |
sdpval | pointer to the values of the nonzeros for each block and variable in this block (may be NULL if sdptnnonz = 0) |
nlpcons | number of LP-constraints |
lplhs | left hand sides of LP rows (may be NULL if nlpcons = 0) |
lprhs | right hand sides of LP rows (may be NULL if nlpcons = 0) |
lpnnonz | number of nonzero elements in the LP-constraint matrix |
lprow | row-index for each entry in lpval-array (may be NULL if lpnnonz = 0) |
lpcol | column-index for each entry in lpval-array (may be NULL if lpnnonz = 0) |
lpval | values of LP-constraint matrix entries (may be NULL if lpnnonz = 0) |
Definition at line 1089 of file sdpi.c.
References BMS_CALL, DUPLICATE_ARRAY_NULL, and ensureLowerTriangular().
Referenced by putSdpDataInInterface().
SCIP_RETCODE SCIPsdpiAddLPRows | ( | SCIP_SDPI * | sdpi, |
int | nrows, | ||
const SCIP_Real * | lhs, | ||
const SCIP_Real * | rhs, | ||
int | nnonz, | ||
const int * | row, | ||
const int * | col, | ||
const SCIP_Real * | val | ||
) |
adds rows to the LP-Block
sdpi | SDP interface structure |
nrows | number of rows to be added |
lhs | left hand sides of new rows |
rhs | right hand sides of new rows |
nnonz | number of nonzero elements to be added to the LP constraint matrix |
row | row indices of constraint matrix entries, going from 0 to nrows - 1, these will be changed to nlpcons + i |
col | column indices of constraint matrix entries |
val | values of constraint matrix entries |
Definition at line 1306 of file sdpi.c.
References BMS_CALL.
Referenced by putLpDataInInterface().
SCIP_RETCODE SCIPsdpiDelLPRows | ( | SCIP_SDPI * | sdpi, |
int | firstrow, | ||
int | lastrow | ||
) |
deletes all rows in the given range from the LP-Block
sdpi | SDP interface structure |
firstrow | first row to be deleted |
lastrow | last row to be deleted |
Definition at line 1369 of file sdpi.c.
References BMS_CALL.
Referenced by putLpDataInInterface(), and SCIPsdpiDelLPRowset().
SCIP_RETCODE SCIPsdpiDelLPRowset | ( | SCIP_SDPI * | sdpi, |
int * | dstat | ||
) |
deletes LP rows from SCIP_SDPI
sdpi | SDP interface structure |
dstat | deletion status of LP rows input: 1 if row should be deleted, 0 otherwise output: new position of row, -1 if row was deleted |
Definition at line 1473 of file sdpi.c.
References SCIPsdpiDelLPRows().
SCIP_RETCODE SCIPsdpiClear | ( | SCIP_SDPI * | sdpi | ) |
clears the whole SDP
sdpi | SDP interface structure |
Definition at line 1512 of file sdpi.c.
References SCIPsdpiSolverResetCounter().
Referenced by SCIP_DECL_RELAXEXIT().
SCIP_RETCODE SCIPsdpiChgBounds | ( | SCIP_SDPI * | sdpi, |
int | nvars, | ||
const int * | ind, | ||
const SCIP_Real * | lb, | ||
const SCIP_Real * | ub | ||
) |
changes lower and upper bounds of variables
sdpi | SDP interface structure |
nvars | number of variables to change bounds for |
ind | variables indices |
lb | values for the new lower bounds |
ub | values for the new upper bounds |
Definition at line 1528 of file sdpi.c.
Referenced by putLpDataInInterface().
SCIP_RETCODE SCIPsdpiChgLPLhRhSides | ( | SCIP_SDPI * | sdpi, |
int | nrows, | ||
const int * | ind, | ||
const SCIP_Real * | lhs, | ||
const SCIP_Real * | rhs | ||
) |
SCIP_RETCODE SCIPsdpiGetNLPRows | ( | SCIP_SDPI * | sdpi, |
int * | nlprows | ||
) |
gets the number of LP-rows in the SDP
sdpi | SDP interface structure |
nlprows | pointer to store the number of rows |
Definition at line 1598 of file sdpi.c.
Referenced by putLpDataInInterface().
SCIP_RETCODE SCIPsdpiGetNSDPBlocks | ( | SCIP_SDPI * | sdpi, |
int * | nsdpblocks | ||
) |
SCIP_RETCODE SCIPsdpiGetNVars | ( | SCIP_SDPI * | sdpi, |
int * | nvars | ||
) |
SCIP_RETCODE SCIPsdpiGetSDPNNonz | ( | SCIP_SDPI * | sdpi, |
int * | nnonz | ||
) |
SCIP_RETCODE SCIPsdpiGetConstNNonz | ( | SCIP_SDPI * | sdpi, |
int * | nnonz | ||
) |
SCIP_RETCODE SCIPsdpiGetLPNNonz | ( | SCIP_SDPI * | sdpi, |
int * | nnonz | ||
) |
SCIP_RETCODE SCIPsdpiGetObj | ( | SCIP_SDPI * | sdpi, |
int | firstvar, | ||
int | lastvar, | ||
SCIP_Real * | vals | ||
) |
gets objective coefficients from SDP problem object
sdpi | SDP interface structure |
firstvar | first variable to get objective coefficient for |
lastvar | last variable to get objective coefficient for |
vals | pointer to store objective coefficients (memory of size lastvar - firstvar + 1 needs to be allocated) |
SCIP_RETCODE SCIPsdpiGetBounds | ( | SCIP_SDPI * | sdpi, |
int | firstvar, | ||
int | lastvar, | ||
SCIP_Real * | lbs, | ||
SCIP_Real * | ubs | ||
) |
gets current variable bounds from SDP problem object
sdpi | SDP interface structure |
firstvar | first variable to get bounds for |
lastvar | last variable to get bounds for |
lbs | pointer to store lower bound values, or NULL (memory of size lastvar - firstvar + 1 needs to be allocated) |
ubs | pointer to store upper bound values, or NULL (memory of size lastvar - firstvar + 1 needs to be allocated) |
SCIP_RETCODE SCIPsdpiGetLhSides | ( | SCIP_SDPI * | sdpi, |
int | firstrow, | ||
int | lastrow, | ||
SCIP_Real * | lhss | ||
) |
gets current left hand sides from SDP problem object
sdpi | SDP interface structure |
firstrow | first row to get sides for |
lastrow | last row to get sides for |
lhss | pointer to store left hand side values (memory of size lastvar - firstvar + 1 needs to be allocated) |
SCIP_RETCODE SCIPsdpiGetRhSides | ( | SCIP_SDPI * | sdpi, |
int | firstrow, | ||
int | lastrow, | ||
SCIP_Real * | rhss | ||
) |
gets current right hand sides from SDP problem object
sdpi | SDP interface structure |
firstrow | first row to get sides for |
lastrow | last row to get sides for |
rhss | pointer to store right hand side values (memory of size lastvar - firstvar + 1 needs to be allocated) |
SCIP_RETCODE SCIPsdpiSolve | ( | SCIP_SDPI * | sdpi, |
SCIP_Real * | start, | ||
int * | totalsdpiterations, | ||
SCIP_Bool | enforceslatercheck | ||
) |
solves the SDP, as start optionally a starting point for the solver may be given, if it is NULL, the solver will start from scratch
sdpi | SDP interface structure |
start | NULL or a starting point for the solver, this should have length nvars |
totalsdpiterations | the number of sdpiterations needed will be added to the int this points to |
enforceslatercheck | always check for Slater condition in case the problem could not be solved and printf the solution of this check |
Definition at line 1780 of file sdpi.c.
References BMS_CALL, compConstMatAfterFixings(), computeLpLhsRhsAfterFixings(), findEmptyRowColsSDP(), SCIPsdpiSolverGetIterations(), SCIPsdpiSolverGetObjval(), SCIPsdpiSolverIncreaseCounter(), SCIPsdpiSolverIsAcceptable(), SCIPsdpiSolverIsDualUnbounded(), SCIPsdpiSolverIsGEMaxPenParam(), SCIPsdpiSolverIsOptimal(), SCIPsdpiSolverLoadAndSolve(), and SCIPsdpiSolverLoadAndSolveWithPenalty().
Referenced by calc_relax().
SCIP_Bool SCIPsdpiWasSolved | ( | SCIP_SDPI * | sdpi | ) |
returns whether a solve method was called after the last modification of the SDP
sdpi | SDP interface structure |
Definition at line 2062 of file sdpi.c.
Referenced by calc_relax().
SCIP_Bool SCIPsdpiSolvedOrig | ( | SCIP_SDPI * | sdpi | ) |
returns whether the original problem was solved, if SCIPsdpiWasSolved = true and SCIPsdpiSolvedOrig = false, then a penalty formulation was solved
sdpi | SDP interface structure |
Definition at line 2072 of file sdpi.c.
Referenced by calc_relax(), and SCIPrelaxSdpSolvedOrig().
SCIP_Bool SCIPsdpiFeasibilityKnown | ( | SCIP_SDPI * | sdpi | ) |
returns true if the solver could determine whether the problem is feasible, so it returns true if the solver knows that the problem is feasible/infeasible/unbounded, it returns false if the solver doesn't know anything about the feasibility status and thus the functions IsPrimalFeasible etc. shouldn't be used
sdpi | SDP interface structure |
Definition at line 2084 of file sdpi.c.
References CHECK_IF_SOLVED_BOOL, and SCIPsdpiSolverFeasibilityKnown().
Referenced by calc_relax().
SCIP_RETCODE SCIPsdpiGetSolFeasibility | ( | SCIP_SDPI * | sdpi, |
SCIP_Bool * | primalfeasible, | ||
SCIP_Bool * | dualfeasible | ||
) |
gets information about primal and dual feasibility of the current SDP solution
sdpi | SDP interface structure |
primalfeasible | pointer to store the primal feasibility status |
dualfeasible | pointer to store the dual feasibility status |
Definition at line 2098 of file sdpi.c.
References CHECK_IF_SOLVED, and SCIPsdpiSolverGetSolFeasibility().
SCIP_Bool SCIPsdpiIsPrimalUnbounded | ( | SCIP_SDPI * | sdpi | ) |
returns TRUE iff SDP is proven to be primal unbounded returns FALSE with a debug-message if the solver couldnot determine feasibility
sdpi | SDP interface structure |
Definition at line 2121 of file sdpi.c.
References CHECK_IF_SOLVED_BOOL, and SCIPsdpiSolverIsPrimalUnbounded().
SCIP_Bool SCIPsdpiIsPrimalInfeasible | ( | SCIP_SDPI * | sdpi | ) |
returns TRUE iff SDP is proven to be primal infeasible returns FALSE with a debug-message if the solver couldnot determine feasibility
sdpi | SDP interface structure |
Definition at line 2139 of file sdpi.c.
References CHECK_IF_SOLVED_BOOL, and SCIPsdpiSolverIsPrimalInfeasible().
SCIP_Bool SCIPsdpiIsPrimalFeasible | ( | SCIP_SDPI * | sdpi | ) |
returns TRUE iff SDP is proven to be primal feasible returns FALSE with a debug-message if the solver couldnot determine feasibility
sdpi | SDP interface structure |
Definition at line 2157 of file sdpi.c.
References CHECK_IF_SOLVED_BOOL, and SCIPsdpiSolverIsPrimalFeasible().
Referenced by calc_relax().
SCIP_Bool SCIPsdpiIsDualUnbounded | ( | SCIP_SDPI * | sdpi | ) |
returns TRUE iff SDP is proven to be dual unbounded returns FALSE with a debug-message if the solver couldnot determine feasibility
sdpi | SDP interface structure |
Definition at line 2175 of file sdpi.c.
References CHECK_IF_SOLVED_BOOL, and SCIPsdpiSolverIsDualUnbounded().
Referenced by calc_relax().
SCIP_Bool SCIPsdpiIsDualInfeasible | ( | SCIP_SDPI * | sdpi | ) |
returns TRUE iff SDP is proven to be dual infeasible returns FALSE with a debug-message if the solver couldnot determine feasibility
sdpi | SDP interface structure |
Definition at line 2193 of file sdpi.c.
References CHECK_IF_SOLVED_BOOL, and SCIPsdpiSolverIsDualInfeasible().
Referenced by calc_relax().
SCIP_Bool SCIPsdpiIsDualFeasible | ( | SCIP_SDPI * | sdpi | ) |
returns TRUE iff SDP is proven to be dual feasible returns FALSE with a debug-message if the solver couldnot determine feasibility
sdpi | SDP interface structure |
Definition at line 2211 of file sdpi.c.
References CHECK_IF_SOLVED_BOOL, and SCIPsdpiSolverIsDualFeasible().
Referenced by calc_relax().
SCIP_Bool SCIPsdpiIsConverged | ( | SCIP_SDPI * | sdpi | ) |
returns TRUE iff the solver converged
sdpi | SDP interface structure |
Definition at line 2228 of file sdpi.c.
References CHECK_IF_SOLVED_BOOL, and SCIPsdpiSolverIsConverged().
SCIP_Bool SCIPsdpiIsObjlimExc | ( | SCIP_SDPI * | sdpi | ) |
returns TRUE iff the objective limit was reached
sdpi | SDP interface structure |
Definition at line 2245 of file sdpi.c.
References CHECK_IF_SOLVED_BOOL, and SCIPsdpiSolverIsObjlimExc().
Referenced by calc_relax().
SCIP_Bool SCIPsdpiIsIterlimExc | ( | SCIP_SDPI * | sdpi | ) |
returns TRUE iff the iteration limit was reached
sdpi | SDP interface structure |
Definition at line 2262 of file sdpi.c.
References CHECK_IF_SOLVED_BOOL, and SCIPsdpiSolverIsIterlimExc().
SCIP_Bool SCIPsdpiIsTimelimExc | ( | SCIP_SDPI * | sdpi | ) |
returns TRUE iff the time limit was reached
sdpi | SDP interface structure |
Definition at line 2279 of file sdpi.c.
References CHECK_IF_SOLVED_BOOL, and SCIPsdpiSolverIsTimelimExc().
int SCIPsdpiGetInternalStatus | ( | SCIP_SDPI * | sdpi | ) |
returns the internal solution status of the solver, which has the following meaning:
-1: solver wasn't started
0: converged
1: infeasible start
2: numerical problems
3: objective limit reached
4: iteration limit reached
5: time limit reached
6: user termination
7: other
sdpi | SDP interface structure |
Definition at line 2305 of file sdpi.c.
References SCIPsdpiSolverGetInternalStatus().
SCIP_Bool SCIPsdpiIsOptimal | ( | SCIP_SDPI * | sdpi | ) |
returns TRUE iff SDP was solved to optimality, meaning the solver converged and returned primal and dual feasible solutions
sdpi | SDP interface structure |
Definition at line 2326 of file sdpi.c.
References CHECK_IF_SOLVED_BOOL, and SCIPsdpiSolverIsOptimal().
SCIP_Bool SCIPsdpiIsAcceptable | ( | SCIP_SDPI * | sdpi | ) |
returns TRUE iff SDP was solved to optimality or some other status was reached that is still acceptable inside a Branch & Bound framework
sdpi | SDP interface structure |
Definition at line 2344 of file sdpi.c.
References CHECK_IF_SOLVED_BOOL, and SCIPsdpiSolverIsAcceptable().
Referenced by calc_relax().
SCIP_RETCODE SCIPsdpiGetObjval | ( | SCIP_SDPI * | sdpi, |
SCIP_Real * | objval | ||
) |
gets objective value of solution
sdpi | SDP interface structure |
objval | pointer to store the objective value |
Definition at line 2361 of file sdpi.c.
References CHECK_IF_SOLVED, and SCIPsdpiSolverGetObjval().
SCIP_RETCODE SCIPsdpiGetSol | ( | SCIP_SDPI * | sdpi, |
SCIP_Real * | objval, | ||
SCIP_Real * | dualsol, | ||
int * | dualsollength | ||
) |
gets dual solution vector for feasible SDPs, if dualsollength isn't equal to the number of variables this will return the needed length and a debug message
sdpi | SDP interface structure |
objval | pointer to store the objective value, may be NULL if not needed |
dualsol | pointer to store the dual solution vector, may be NULL if not needed |
dualsollength | length of the dualsol vector, must be 0 if dualsol is NULL, if this is less than the number of variables in the SDP, a DebugMessage will be thrown and this is set to the needed value |
Definition at line 2383 of file sdpi.c.
References CHECK_IF_SOLVED, and SCIPsdpiSolverGetSol().
Referenced by calc_relax(), and SCIPrelaxSdpGetRelaxSol().
SCIP_RETCODE SCIPsdpiGetPrimalBoundVars | ( | SCIP_SDPI * | sdpi, |
SCIP_Real * | lbvars, | ||
SCIP_Real * | ubvars, | ||
int * | arraylength | ||
) |
gets the primal variables corresponding to the lower and upper variable-bounds in the dual problem, the last input should specify the length of the arrays, if this is less than the number of variables, the needed length will be returned and a debug message thrown
sdpi | pointer to an SDP interface structure |
lbvars | pointer to store the values of the variables corresponding to lower bounds in the dual problems |
ubvars | pointer to store the values of the variables corresponding to upper bounds in the dual problems |
arraylength | input: length of lbvars and ubvars output: number of elements inserted into lbvars/ubvars (or needed length if it wasn't sufficient) |
Definition at line 2410 of file sdpi.c.
References CHECK_IF_SOLVED, and SCIPsdpiSolverGetPrimalBoundVars().
Referenced by SCIPrelaxSdpGetPrimalBoundVars().
SCIP_RETCODE SCIPsdpiGetIterations | ( | SCIP_SDPI * | sdpi, |
int * | iterations | ||
) |
gets the number of SDP iterations of the last solve call
sdpi | SDP interface structure |
iterations | pointer to store the number of iterations of the last solve call |
Definition at line 2437 of file sdpi.c.
References CHECK_IF_SOLVED, and SCIPsdpiSolverGetIterations().
SCIP_Real SCIPsdpiInfinity | ( | SCIP_SDPI * | sdpi | ) |
returns value treated as infinity in the SDP solver
sdpi | SDP interface structure |
Definition at line 2470 of file sdpi.c.
References SCIPsdpiSolverInfinity().
Referenced by calc_relax(), computeLpLhsRhsAfterFixings(), and SCIPsdpiIsInfinity().
SCIP_Bool SCIPsdpiIsInfinity | ( | SCIP_SDPI * | sdpi, |
SCIP_Real | val | ||
) |
checks if given value is treated as (plus or minus) infinity in the SDP solver
sdpi | SDP interface structure |
val | value to be checked for infinity |
Definition at line 2480 of file sdpi.c.
References SCIPsdpiInfinity().
SCIP_Real SCIPsdpiMaxPenParam | ( | SCIP_SDPI * | sdpi | ) |
returns highest penalty parameter to be used
sdpi | SDP interface structure |
Definition at line 2491 of file sdpi.c.
References SCIPsdpiSolverMaxPenParam().
Referenced by SCIPsdpiIsGEMaxPenParam().
SCIP_Bool SCIPsdpiIsGEMaxPenParam | ( | SCIP_SDPI * | sdpi, |
SCIP_Real | val | ||
) |
checks if given value is greater or equal to the highest penalty parameter to be used
sdpi | SDP interface structure |
val | value to be compared to maximum penalty parameter |
Definition at line 2501 of file sdpi.c.
References SCIPsdpiMaxPenParam().
SCIP_RETCODE SCIPsdpiGetRealpar | ( | SCIP_SDPI * | sdpi, |
SCIP_SDPPARAM | type, | ||
SCIP_Real * | dval | ||
) |
gets floating point parameter of SDP
sdpi | SDP interface structure |
type | parameter number |
dval | pointer to store the parameter value |
Definition at line 2512 of file sdpi.c.
References SCIP_CALL_PARAM, SCIP_SDPPAR_EPSILON, SCIP_SDPPAR_FEASTOL, SCIP_SDPPAR_OBJLIMIT, and SCIPsdpiSolverGetRealpar().
SCIP_RETCODE SCIPsdpiSetRealpar | ( | SCIP_SDPI * | sdpi, |
SCIP_SDPPARAM | type, | ||
SCIP_Real | dval | ||
) |
sets floating point parameter of SDP
sdpi | SDP interface structure |
type | parameter number |
dval | parameter value |
Definition at line 2549 of file sdpi.c.
References SCIP_CALL_PARAM, SCIP_SDPPAR_EPSILON, SCIP_SDPPAR_FEASTOL, SCIP_SDPPAR_OBJLIMIT, SCIPsdpiSolverGetRealpar(), and SCIPsdpiSolverSetRealpar().
Referenced by calc_relax(), and SCIP_DECL_RELAXINIT().
SCIP_RETCODE SCIPsdpiGetIntpar | ( | SCIP_SDPI * | sdpi, |
SCIP_SDPPARAM | type, | ||
int * | ival | ||
) |
gets integer parameter of SDP
sdpi | SDP interface structure |
type | parameter number |
ival | pointer to store the parameter value |
Definition at line 2587 of file sdpi.c.
References SCIP_CALL_PARAM, SCIP_SDPPAR_SDPINFO, SCIP_SDPPAR_SLATERCHECK, and SCIPsdpiSolverGetIntpar().
SCIP_RETCODE SCIPsdpiSetIntpar | ( | SCIP_SDPI * | sdpi, |
SCIP_SDPPARAM | type, | ||
int | ival | ||
) |
sets integer parameter of SDP
sdpi | SDP interface structure |
type | parameter number |
ival | parameter value |
Definition at line 2629 of file sdpi.c.
References SCIP_CALL_PARAM, SCIP_SDPPAR_SDPINFO, SCIP_SDPPAR_SLATERCHECK, SCIPsdpiSolverGetIntpar(), and SCIPsdpiSolverSetIntpar().
Referenced by SCIP_DECL_RELAXINIT().
SCIP_RETCODE SCIPsdpiReadSDP | ( | SCIP_SDPI * | sdpi, |
const char * | fname | ||
) |