SCIP-SDP  3.1.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Macros | Functions
sdpi.c File Reference

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)
 
#define SCIP_CALL_PARAM_IGNORE_UNKNOWN(x)
 
#define MIN_GAPTOL   1e-10
 
#define DEFAULT_SDPSOLVERGAPTOL   1e-4
 
#define DEFAULT_FEASTOL   1e-6
 
#define DEFAULT_EPSILON   1e-9
 
#define DEFAULT_PENALTYPARAM   1e+5
 
#define DEFAULT_MAXPENALTYPARAM   1e+10
 
#define DEFAULT_NPENALTYINCR   8
 

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)
 
static SCIP_RETCODE checkAllFixed (SCIP_SDPI *sdpi)
 
static SCIP_RETCODE checkFixedFeasibilitySdp (SCIP_SDPI *sdpi, int *sdpconstnblocknonz, int **sdpconstrow, int **sdpconstcol, SCIP_Real **sdpconstval, int **indchanges, int *nremovedinds, int *blockindchanges)
 
static SCIP_RETCODE checkSlaterCondition (SCIP_SDPI *sdpi, SCIP_Real timelimit, clock_t starttime, int *sdpconstnblocknonz, int **sdpconstrow, int **sdpconstcol, SCIP_Real **sdpconstval, int **indchanges, int *nremovedinds, SCIP_Real *lplhsafterfix, SCIP_Real *lprhsafterfix, int *rowsnactivevars, int *blockindchanges, int sdpconstnnonz, int nactivelpcons, int nremovedblocks, SCIP_Bool rootnodefailed)
 
Miscellaneous Methods
const char * SCIPsdpiGetSolverName (void)
 
const char * SCIPsdpiGetSolverDesc (void)
 
void * SCIPsdpiGetSolverPointer (SCIP_SDPI *sdpi)
 
SCIP_Real SCIPsdpiGetDefaultSdpiSolverFeastol (void)
 
SCIP_Real SCIPsdpiGetDefaultSdpiSolverGaptol (void)
 
int SCIPsdpiGetDefaultSdpiSolverNpenaltyIncreases (void)
 
SCIP_Bool SCIPsdpiDoesWarmstartNeedPrimal (void)
 
SDPI Creation and Destruction Methods
SCIP_RETCODE SCIPsdpiCreate (SCIP_SDPI **sdpi, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, BMS_BUFMEM *bufmem)
 
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 SCIPsdpiChgObj (SCIP_SDPI *sdpi, int nvars, const int *ind, const SCIP_Real *obj)
 
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 *starty, int *startZnblocknonz, int **startZrow, int **startZcol, SCIP_Real **startZval, int *startXnblocknonz, int **startXrow, int **startXcol, SCIP_Real **startXval, SCIP_SDPSOLVERSETTING startsettings, SCIP_Bool enforceslatercheck, SCIP_Real timelimit)
 
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 SCIPsdpiGetLowerObjbound (SCIP_SDPI *sdpi, SCIP_Real *objlb)
 
SCIP_RETCODE SCIPsdpiGetSol (SCIP_SDPI *sdpi, SCIP_Real *objval, SCIP_Real *dualsol, int *dualsollength)
 
SCIP_RETCODE SCIPsdpiGetPreoptimalPrimalNonzeros (SCIP_SDPI *sdpi, int nblocks, int *startXnblocknonz)
 
SCIP_RETCODE SCIPsdpiGetPreoptimalSol (SCIP_SDPI *sdpi, SCIP_Bool *success, SCIP_Real *dualsol, int *dualsollength, int nblocks, int *startXnblocknonz, int **startXrow, int **startXcol, SCIP_Real **startXval)
 
SCIP_RETCODE SCIPsdpiGetPrimalBoundVars (SCIP_SDPI *sdpi, SCIP_Real *lbvars, SCIP_Real *ubvars, int *arraylength)
 
SCIP_RETCODE SCIPsdpiGetPrimalNonzeros (SCIP_SDPI *sdpi, int nblocks, int *startXnblocknonz)
 
SCIP_RETCODE SCIPsdpiGetPrimalMatrix (SCIP_SDPI *sdpi, int nblocks, int *startXnblocknonz, int **startXrow, int **startXcol, SCIP_Real **startXval)
 
SCIP_Real SCIPsdpiGetMaxPrimalEntry (SCIP_SDPI *sdpi)
 
SCIP_RETCODE SCIPsdpiGetIterations (SCIP_SDPI *sdpi, int *iterations)
 
SCIP_RETCODE SCIPsdpiGetSdpCalls (SCIP_SDPI *sdpi, int *calls)
 
SCIP_RETCODE SCIPsdpiSettingsUsed (SCIP_SDPI *sdpi, SCIP_SDPSOLVERSETTING *usedsetting)
 
SCIP_RETCODE SCIPsdpiSlaterSettings (SCIP_SDPI *sdpi, SCIP_SDPSLATERSETTING *slatersetting)
 
SCIP_RETCODE SCIPsdpiSlater (SCIP_SDPI *sdpi, SCIP_SDPSLATER *primalslater, SCIP_SDPSLATER *dualslater)
 
Numerical Methods
SCIP_Real SCIPsdpiInfinity (SCIP_SDPI *sdpi)
 
SCIP_Bool SCIPsdpiIsInfinity (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)
 
SCIP_RETCODE SCIPsdpiComputeLambdastar (SCIP_SDPI *sdpi, SCIP_Real maxguess)
 
SCIP_RETCODE SCIPsdpiComputePenaltyparam (SCIP_SDPI *sdpi, SCIP_Real maxcoeff, SCIP_Real *penaltyparam)
 
SCIP_RETCODE SCIPsdpiComputeMaxPenaltyparam (SCIP_SDPI *sdpi, SCIP_Real penaltyparam, SCIP_Real *maxpenaltyparam)
 
File Interface Methods
SCIP_RETCODE SCIPsdpiReadSDP (SCIP_SDPI *sdpi, const char *fname)
 
SCIP_RETCODE SCIPsdpiWriteSDP (SCIP_SDPI *sdpi, const char *fname)
 

Detailed Description

General interface methods for SDP-preprocessing (mainly fixing variables and removing empty rows/cols)

Author
Tristan Gally

Definition in file sdpi.c.

Macro Definition Documentation

#define BMS_CALL (   x)
Value:
do \
{ \
if( NULL == (x) ) \
{ \
SCIPerrorMessage("No memory in function call\n"); \
return SCIP_NOMEMORY; \
} \
} \
while( FALSE )

Checks if a BMSallocMemory-call was successfull, otherwise returns SCIP_NOMEMORY

Definition at line 58 of file sdpi.c.

Referenced by checkFixedFeasibilitySdp(), checkSlaterCondition(), compConstMatAfterFixings(), SCIPsdpiAddLPRows(), SCIPsdpiClone(), SCIPsdpiCreate(), SCIPsdpiDelLPRows(), SCIPsdpiLoadSDP(), and SCIPsdpiSolve().

#define CHECK_IF_SOLVED (   sdpi)
Value:
do \
{ \
if ( ! (sdpi->solved) ) \
{ \
SCIPerrorMessage("Tried to access solution information ahead of solving! \n"); \
return SCIP_LPERROR; \
} \
} \
while( FALSE )

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 69 of file sdpi.c.

Referenced by SCIPsdpiGetObjval(), SCIPsdpiGetPrimalBoundVars(), SCIPsdpiGetSol(), and SCIPsdpiGetSolFeasibility().

#define CHECK_IF_SOLVED_BOOL (   sdpi)
Value:
do \
{ \
if ( ! (sdpi->solved) ) \
{ \
SCIPerrorMessage("Tried to access solution information ahead of solving! \n"); \
return FALSE; \
} \
} \
while( FALSE )

same as CHECK_IF_SOLVED, but this will be used in functions returning a boolean value

Definition at line 80 of file sdpi.c.

Referenced by SCIPsdpiFeasibilityKnown(), SCIPsdpiIsConverged(), SCIPsdpiIsDualFeasible(), SCIPsdpiIsDualInfeasible(), SCIPsdpiIsDualUnbounded(), SCIPsdpiIsIterlimExc(), SCIPsdpiIsObjlimExc(), SCIPsdpiIsOptimal(), SCIPsdpiIsPrimalFeasible(), SCIPsdpiIsPrimalInfeasible(), and SCIPsdpiIsPrimalUnbounded().

#define DUPLICATE_ARRAY_NULL (   blkmem,
  target,
  source,
  size 
)
Value:
do \
{ \
if (size > 0) \
BMS_CALL( BMSduplicateBlockMemoryArray(blkmem, target, source, size) ); \
else \
*target = NULL; \
} \
while( FALSE )
#define BMS_CALL(x)
Definition: sdpi.c:58

duplicate an array that might be null (in that case null is returned, otherwise BMSduplicateMemory is called)

Definition at line 91 of file sdpi.c.

Referenced by checkSlaterCondition(), and SCIPsdpiLoadSDP().

#define SCIP_CALL_PARAM (   x)
Value:
do \
{ \
SCIP_RETCODE _restat_; \
if ( (_restat_ = (x)) != SCIP_OKAY ) \
{ \
if ( _restat_ != SCIP_PARAMETERUNKNOWN ) \
{ \
SCIPerrorMessage("Error <%d> in function call\n", _restat_); \
SCIPABORT(); \
} \
return _restat_; \
} \
} \
while( FALSE )

same as SCIP_CALL, but gives a SCIP_PARAMETERUNKNOWN error if it fails

Definition at line 101 of file sdpi.c.

Referenced by SCIPsdpiGetIntpar(), SCIPsdpiGetRealpar(), SCIPsdpiSetIntpar(), SCIPsdpiSetRealpar(), and SCIPsdpiSolve().

#define SCIP_CALL_PARAM_IGNORE_UNKNOWN (   x)
Value:
do \
{ \
SCIP_RETCODE _restat_; \
if ( (_restat_ = (x)) != SCIP_OKAY ) \
{ \
if ( _restat_ != SCIP_PARAMETERUNKNOWN ) \
{ \
SCIPerrorMessage("Error <%d> in function call\n", _restat_); \
SCIPABORT(); \
} \
} \
} \
while( FALSE )

same as SCIP_CALL_PARAM, but ignores SCIP_PARAMETERUNKNOWN

Definition at line 117 of file sdpi.c.

Referenced by SCIPsdpiSetRealpar().

#define MIN_GAPTOL   1e-10

minimum gaptolerance for SDP-solver if decreasing it for a penalty formulation

Definition at line 132 of file sdpi.c.

Referenced by SCIPsdpiSolve().

#define DEFAULT_SDPSOLVERGAPTOL   1e-4

the stopping criterion for the duality gap the sdpsolver should use

Definition at line 134 of file sdpi.c.

Referenced by SCIPsdpiCreate().

#define DEFAULT_FEASTOL   1e-6

used to test for feasibility

Definition at line 135 of file sdpi.c.

Referenced by SCIPsdpiCreate().

#define DEFAULT_EPSILON   1e-9

used to test whether given values are equal

Definition at line 136 of file sdpi.c.

Referenced by SCIPsdpiCreate().

#define DEFAULT_PENALTYPARAM   1e+5

the starting penalty parameter Gamma used for the penalty formulation if the SDP-solver didn't converge

Definition at line 137 of file sdpi.c.

Referenced by SCIPsdpiCreate().

#define DEFAULT_MAXPENALTYPARAM   1e+10

the maximum penalty parameter Gamma used for the penalty formulation if the SDP-solver didn't converge

Definition at line 138 of file sdpi.c.

Referenced by SCIPsdpiCreate().

#define DEFAULT_NPENALTYINCR   8

maximum number of times the penalty parameter will be increased if penalty formulation failed

Definition at line 139 of file sdpi.c.

Referenced by SCIPsdpiCreate().

Function Documentation

static void ensureLowerTriangular ( int *  i,
int *  j 
)
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.

Parameters
irow index
jcolumn index

Definition at line 214 of file sdpi.c.

Referenced by SCIPsdpiLoadSDP().

static SCIP_Bool isFixed ( SCIP_SDPI sdpi,
int  v 
)
static

tests if for a given variable the lower bound is in an epsilon neighborhood of the upper bound

Parameters
sdpipointer to an SDP-interface structure
vglobal index of the variable to check this for

Definition at line 231 of file sdpi.c.

Referenced by checkAllFixed(), checkSlaterCondition(), compConstMatAfterFixings(), computeLpLhsRhsAfterFixings(), and findEmptyRowColsSDP().

static SCIP_RETCODE compConstMatAfterFixings ( SCIP_SDPI sdpi,
int *  sdpconstnnonz,
int *  sdpconstnblocknonz,
int **  sdpconstrow,
int **  sdpconstcol,
SCIP_Real **  sdpconstval 
)
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.

Parameters
sdpipointer to an SDP-interface structure
sdpconstnnonzpointer to store number of nonzero elements in the constant matrices of the SDP-blocks
sdpconstnblocknonzpointer to store 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]
sdpconstrowpointer to store row-indices for each block
sdpconstcolpointer to store column-indices for each block
sdpconstvalpointer to store the values of the nonzeros for each block

Definition at line 263 of file sdpi.c.

References BMS_CALL, isFixed(), and SCIPsdpVarfixerMergeArraysIntoNew().

Referenced by SCIPsdpiSolve().

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

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.

Parameters
sdpipointer to an SDP-interface structure
sdpconstnblocknonznumber 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]
sdpconstrowpointers to row-indices for each block
sdpconstcolpointers to column-indices for each block
sdpconstvalpointers to the values of the nonzeros for each block
indchangespointer 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]
nremovedindspointer to store the number of rows/cols to be fixed for each block
blockindchangespointer to store index change for each block, system is the same as for indchanges
nremovedblockspointer to store the number of blocks to be removed from the SDP

Definition at line 377 of file sdpi.c.

References isFixed().

Referenced by SCIPsdpiSolve().

static SCIP_RETCODE computeLpLhsRhsAfterFixings ( SCIP_SDPI sdpi,
int *  nactivelpcons,
SCIP_Real *  lplhsafterfix,
SCIP_Real *  lprhsafterfix,
int *  rownactivevars,
SCIP_Bool *  fixingsfound 
)
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

Parameters
sdpipointer to an SDP-interface structure
nactivelpconsoutput: number of active LP-constraints
lplhsafterfixoutput: 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)
lprhsafterfixoutput: 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)
rownactivevarsoutput: number of active variables for every row
fixingsfoundoutput: returns true if a variable was fixed during this function call

Definition at line 504 of file sdpi.c.

References isFixed(), and SCIPsdpiInfinity().

Referenced by SCIPsdpiSolve().

static SCIP_RETCODE checkAllFixed ( SCIP_SDPI sdpi)
static

checks whether all variables are fixed (lb=ub), in that case changes the sdpi->allfixed pointer accordingly

Parameters
sdpipointer to an SDP-interface structure

Definition at line 851 of file sdpi.c.

References isFixed().

Referenced by SCIPsdpiSolve().

static SCIP_RETCODE checkFixedFeasibilitySdp ( SCIP_SDPI sdpi,
int *  sdpconstnblocknonz,
int **  sdpconstrow,
int **  sdpconstcol,
SCIP_Real **  sdpconstval,
int **  indchanges,
int *  nremovedinds,
int *  blockindchanges 
)
static

If all variables are fixed, check whether the remaining solution is feasible for the SDP-constraints (LP-constraints should be checked already when computing the rhs after fixing)

Parameters
sdpipointer to an SDP-interface structure
sdpconstnblocknonznumber 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]
sdpconstrowpointers to row-indices for each block
sdpconstcolpointers to column-indices for each block
sdpconstvalpointers to the values of the nonzeros for each block
indchangespointer to store the changes needed to be done to the indices, if indchanges[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]
nremovedindspointer to store the number of rows/cols to be fixed for each block
blockindchangespointer to store index change for each block, system is the same as for indchanges

Definition at line 879 of file sdpi.c.

References BMS_CALL, and SCIPlapackComputeIthEigenvalue().

Referenced by SCIPsdpiSolve().

static SCIP_RETCODE checkSlaterCondition ( SCIP_SDPI sdpi,
SCIP_Real  timelimit,
clock_t  starttime,
int *  sdpconstnblocknonz,
int **  sdpconstrow,
int **  sdpconstcol,
SCIP_Real **  sdpconstval,
int **  indchanges,
int *  nremovedinds,
SCIP_Real *  lplhsafterfix,
SCIP_Real *  lprhsafterfix,
int *  rowsnactivevars,
int *  blockindchanges,
int  sdpconstnnonz,
int  nactivelpcons,
int  nremovedblocks,
SCIP_Bool  rootnodefailed 
)
static

checks primal and dual Slater condition and outputs result depending on Slater settings in sdpi as well as updating sdpisolver->primalslater and sdpisolver->dualslater

Parameters
sdpipointer to an SDP-interface structure
timelimitafter this many seconds solving will be aborted (currently only implemented for DSDP)
starttimecurrenttime - starttime will be substracted from the timelimit given to the solver
sdpconstnblocknonznumber 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] (may be NULL if sdpconstnnonz = 0)
sdpconstrowpointer to row-indices of constant matrix for each block (may be NULL if sdpconstnnonz = 0)
sdpconstcolpointer to column-indices of constant matrix for each block (may be NULL if sdpconstnnonz = 0)
sdpconstvalpointer to values of constant matrix for each block (may be NULL if sdpconstnnonz = 0)
indchangesindex changes for each variable in each block; variable v is removed in block b if indchanges[b][v] = -1, otherwise it gives the number of removed variables with smaller indices (may be NULL if sdpi->nsdpblocks = 0)
nremovedindsnumber of removed variables for each block (may be NULL if sdpi->nsdpblocks = 0)
lplhsafterfixleft-hand sides of LP-constraints after fixing variables (may be NULL if nactivelpcons = 0)
lprhsafterfixright-hand sides of LP-constraints after fixing variables (may be NULL if nactivelpcons = 0)
rowsnactivevarsnumber of active variables for each LP-constraint (may be NULL if sdpi->nlpcons = 0)
blockindchangesindex changes for SDP-blocks; blockindchanges[b] = -1 if SDP-block b should be removed (may be NULL if sdpi->nsdpblocks = 0)
sdpconstnnonztotal number of nonzeros in the constant SDP part
nactivelpconsnumber of active LP-constraints
nremovedblocksnumber of removed SDP-blocks
rootnodefailedif TRUE we will output a message that the root node could not be solved and whether this was due to the Slater condition, otherwise we will print depending on sdpi->slatercheck

Definition at line 986 of file sdpi.c.

References BMS_CALL, DUPLICATE_ARRAY_NULL, isFixed(), SCIP_SDPSLATER_HOLDS, SCIP_SDPSLATER_INF, SCIP_SDPSLATER_NOINFO, SCIP_SDPSLATER_NOT, SCIP_SDPSOLVERSETTING_UNSOLVED, SCIPsdpiIsInfinity(), SCIPsdpiSolverGetObjval(), SCIPsdpiSolverInfinity(), SCIPsdpiSolverIsDualInfeasible(), SCIPsdpiSolverIsDualUnbounded(), SCIPsdpiSolverIsInfinity(), SCIPsdpiSolverIsOptimal(), SCIPsdpiSolverIsPrimalUnbounded(), SCIPsdpiSolverLoadAndSolve(), and SCIPsdpiSolverLoadAndSolveWithPenalty().

Referenced by SCIPsdpiSolve().

const char* SCIPsdpiGetSolverName ( void  )

gets name and potentially version of SDP-solver

Definition at line 1375 of file sdpi.c.

References SCIPsdpiSolverGetSolverName().

Referenced by calcRelax(), SCIP_DECL_RELAXEXITSOL(), SCIP_DECL_RELAXINITSOL(), SCIP_DECL_TABLEOUTPUT(), and SCIPincludeRelaxSdp().

const char* SCIPsdpiGetSolverDesc ( void  )

gets description of SDP-solver (developer, webpage, ...)

Definition at line 1383 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.

Parameters
sdpiSDP-interface structure

Definition at line 1396 of file sdpi.c.

References SCIPsdpiSolverGetSolverPointer().

SCIP_Real SCIPsdpiGetDefaultSdpiSolverFeastol ( void  )

gets default feasibility tolerance for SDP-solver in SCIP-SDP

Definition at line 1404 of file sdpi.c.

References SCIPsdpiSolverGetDefaultSdpiSolverFeastol().

Referenced by SCIPincludeRelaxSdp().

SCIP_Real SCIPsdpiGetDefaultSdpiSolverGaptol ( void  )

gets default duality gap tolerance for SDP-solver in SCIP-SDP

Definition at line 1412 of file sdpi.c.

References SCIPsdpiSolverGetDefaultSdpiSolverGaptol().

Referenced by SCIPincludeRelaxSdp().

int SCIPsdpiGetDefaultSdpiSolverNpenaltyIncreases ( void  )

gets default number of increases of penalty parameter for SDP-solver in SCIP-SDP

Definition at line 1420 of file sdpi.c.

References SCIPsdpiSolverGetDefaultSdpiSolverNpenaltyIncreases().

Referenced by SCIPincludeRelaxSdp().

SCIP_Bool SCIPsdpiDoesWarmstartNeedPrimal ( void  )

Should primal solution values be saved for warmstarting purposes?

Definition at line 1428 of file sdpi.c.

References SCIPsdpiSolverDoesWarmstartNeedPrimal().

Referenced by calcRelax(), SCIP_DECL_RELAXEXITSOL(), and SCIPrelaxSdpComputeAnalyticCenters().

SCIP_RETCODE SCIPsdpiCreate ( SCIP_SDPI **  sdpi,
SCIP_MESSAGEHDLR *  messagehdlr,
BMS_BLKMEM *  blkmem,
BMS_BUFMEM *  bufmem 
)

creates an sdpi object

Parameters
sdpipointer to an SDP-interface structure
messagehdlrmessage handler to use for printing messages, or NULL
blkmemblock memory
bufmembuffer memory

Definition at line 1446 of file sdpi.c.

References BMS_CALL, DEFAULT_EPSILON, DEFAULT_FEASTOL, DEFAULT_MAXPENALTYPARAM, DEFAULT_NPENALTYINCR, DEFAULT_PENALTYPARAM, DEFAULT_SDPSOLVERGAPTOL, SCIP_SDPSLATER_NOINFO, SCIPsdpiSolverCreate(), and SCIPsdpiSolverInfinity().

Referenced by SCIPincludeRelaxSdp().

SCIP_RETCODE SCIPsdpiFree ( SCIP_SDPI **  sdpi)

deletes an sdpi object

Parameters
sdpipointer to an SDP-interface structure

Definition at line 1514 of file sdpi.c.

References SCIPsdpiSolverFree().

Referenced by SCIP_DECL_RELAXFREE().

SCIP_RETCODE SCIPsdpiClone ( SCIP_SDPI oldsdpi,
SCIP_SDPI newsdpi 
)

cloning method of the general SDP-Interface

Note
The solver specific interface is created anew and not copied.
Parameters
oldsdpipointer to the SDP-interface structure that should be cloned
newsdpipointer to an SDP-interface structure to clone into

Definition at line 1579 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

Note
As the SDP-constraint-matrices are symmetric, only the upper triangular part of them must be specified.
There must be at least one variable, the SDP- and/or LP-part may be empty.
Parameters
sdpiSDP-interface structure
nvarsnumber of variables
objobjective function values of variables
lblower bounds of variables
ubupper bounds of variables
nsdpblocksnumber of SDP-blocks
sdpblocksizessizes of the SDP-blocks (may be NULL if nsdpblocks = sdpconstnnonz = sdpnnonz = 0)
sdpnblockvarsnumber of variables in each SDP-block (may be NULL if nsdpblocks = sdpconstnnonz = sdpnnonz = 0)
sdpconstnnonznumber of nonzero elements in the constant matrices of the SDP-blocks
sdpconstnblocknonznumber 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]
sdpconstrowpointer to row-indices of constant matrix for each block (may be NULL if sdpconstnnonz = 0)
sdpconstcolpointer to column-indices of constant matrix for each block (may be NULL if sdpconstnnonz = 0)
sdpconstvalpointer to values of entries of constant matrix for each block (may be NULL if sdpconstnnonz = 0)
sdpnnonznumber of nonzero elements in the SDP-constraint-matrices
sdpnblockvarnonzsdpnblockvarnonz[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]
sdpvarsdpvar[i][j] gives the global index of the j-th variable (according to the sorting for row/col/val) in the i-th block
sdprowpointer 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)
sdpcolpointer to the column-indices for each block and variable in this block (may be NULL if sdpnnonz = 0)
sdpvalpointer to the values of the nonzeros for each block and variable in this block (may be NULL if sdpnnonz = 0)
nlpconsnumber of LP-constraints
lplhsleft-hand sides of LP rows (may be NULL if nlpcons = 0)
lprhsright-hand sides of LP rows (may be NULL if nlpcons = 0)
lpnnonznumber of nonzero elements in the LP-constraint-matrix
lprowrow-index for each entry in lpval-array (may be NULL if lpnnonz = 0)
lpcolcolumn-index for each entry in lpval-array (may be NULL if lpnnonz = 0)
lpvalvalues of LP-constraint matrix entries (may be NULL if lpnnonz = 0)

Definition at line 1699 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

Note
Arrays are not checked for duplicates, problems may appear if indices are added more than once.
Parameters
sdpiSDP-interface structure
nrowsnumber of rows to be added
lhsleft-hand sides of new rows
rhsright-hand sides of new rows
nnonznumber of nonzero elements to be added to the LP constraint matrix
rowrow-indices of constraint-matrix entries, going from 0 to nrows - 1, these will be changed to nlpcons + i
colcolumn-indices of constraint-matrix entries
valvalues of constraint-matrix entries

Definition at line 1919 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

Parameters
sdpiSDP-interface structure
firstrowfirst row to be deleted
lastrowlast row to be deleted

Definition at line 1984 of file sdpi.c.

References BMS_CALL.

Referenced by putLpDataInInterface(), and SCIPsdpiDelLPRowset().

SCIP_RETCODE SCIPsdpiDelLPRowset ( SCIP_SDPI sdpi,
int *  dstat 
)

deletes LP-rows from SDP-interface

Parameters
sdpiSDP-interface structure
dstatdeletion 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 2094 of file sdpi.c.

References SCIPsdpiDelLPRows().

SCIP_RETCODE SCIPsdpiClear ( SCIP_SDPI sdpi)

clears the whole SDP

Parameters
sdpiSDP-interface structure

Definition at line 2136 of file sdpi.c.

References SCIPsdpiSolverResetCounter().

Referenced by SCIP_DECL_RELAXEXITSOL().

SCIP_RETCODE SCIPsdpiChgObj ( SCIP_SDPI sdpi,
int  nvars,
const int *  ind,
const SCIP_Real *  obj 
)

changes objective coefficients of variables

Parameters
sdpiSDP-interface structure
nvarsnumber of variables to change objective coefficients for
indvariables indices
objnew objective coefficients

Definition at line 2152 of file sdpi.c.

Referenced by putLpDataInInterface().

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

Parameters
sdpiSDP-interface structure
nvarsnumber of variables to change bounds for
indvariables indices
lbvalues for the new lower bounds
ubvalues for the new upper bounds

Definition at line 2181 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 
)

changes left- and right-hand sides of LP rows

Parameters
sdpiSDP-interface structure
nrowsnumber of LP rows to change right hand sides for
indrow indices between 1 and nlpcons
lhsnew values for left-hand sides
rhsnew values for right-hand sides

Definition at line 2215 of file sdpi.c.

SCIP_RETCODE SCIPsdpiGetNLPRows ( SCIP_SDPI sdpi,
int *  nlprows 
)

gets the number of LP-rows in the SDP

Parameters
sdpiSDP-interface structure
nlprowspointer to store the number of rows

Definition at line 2259 of file sdpi.c.

Referenced by putLpDataInInterface().

SCIP_RETCODE SCIPsdpiGetNSDPBlocks ( SCIP_SDPI sdpi,
int *  nsdpblocks 
)

gets the number of SDP-Blocks in the SDP

Parameters
sdpiSDP-interface structure
nsdpblockspointer to store the number of blocks

Definition at line 2273 of file sdpi.c.

SCIP_RETCODE SCIPsdpiGetNVars ( SCIP_SDPI sdpi,
int *  nvars 
)

gets the number of variables in the SDP

Parameters
sdpiSDP-interface structure
nvarspointer to store the number of variables

Definition at line 2287 of file sdpi.c.

SCIP_RETCODE SCIPsdpiGetSDPNNonz ( SCIP_SDPI sdpi,
int *  nnonz 
)

gets the number of nonzero elements in the SDP-constraint-matrices

Parameters
sdpiSDP-interface structure
nnonzpointer to store the number of nonzeros in the SDP-constraint-matrices

Definition at line 2301 of file sdpi.c.

SCIP_RETCODE SCIPsdpiGetConstNNonz ( SCIP_SDPI sdpi,
int *  nnonz 
)

gets the number of nonzero elements in the constant matrices of the SDP-Blocks

Parameters
sdpiSDP-interface structure
nnonzpointer to store the number of nonzeros in the constant matrices of the SDP-Blocks

Definition at line 2315 of file sdpi.c.

SCIP_RETCODE SCIPsdpiGetLPNNonz ( SCIP_SDPI sdpi,
int *  nnonz 
)

gets the number of nonzero elements in the LP-Matrix

Parameters
sdpiSDP-interface structure
nnonzpointer to store the number of nonzeros in the LP Matrix

Definition at line 2329 of file sdpi.c.

SCIP_RETCODE SCIPsdpiGetObj ( SCIP_SDPI sdpi,
int  firstvar,
int  lastvar,
SCIP_Real *  vals 
)

gets objective coefficients from SDP-interface

Parameters
sdpiSDP-interface structure
firstvarfirst variable to get objective coefficient for
lastvarlast variable to get objective coefficient for
valspointer to store objective coefficients (memory of size lastvar - firstvar + 1 needs to be allocated)

Definition at line 2343 of file sdpi.c.

SCIP_RETCODE SCIPsdpiGetBounds ( SCIP_SDPI sdpi,
int  firstvar,
int  lastvar,
SCIP_Real *  lbs,
SCIP_Real *  ubs 
)

gets current variable lower and/or upper bounds from SDP-interface

Parameters
sdpiSDP-interface structure
firstvarfirst variable to get bounds for
lastvarlast variable to get bounds for
lbspointer to store lower bound values (memory of size lastvar - firstvar + 1 needs to be allocated), or NULL
ubspointer to store upper bound values (memory of size lastvar - firstvar + 1 needs to be allocated), or NULL

Definition at line 2365 of file sdpi.c.

SCIP_RETCODE SCIPsdpiGetLhSides ( SCIP_SDPI sdpi,
int  firstrow,
int  lastrow,
SCIP_Real *  lhss 
)

gets current left-hand sides from SDP-interface

Parameters
sdpiSDP-interface structure
firstrowfirst row to get sides for
lastrowlast row to get sides for
lhsspointer to store left-hand side values (memory of size lastvar - firstvar + 1 needs to be allocated)

Definition at line 2393 of file sdpi.c.

SCIP_RETCODE SCIPsdpiGetRhSides ( SCIP_SDPI sdpi,
int  firstrow,
int  lastrow,
SCIP_Real *  rhss 
)

gets current right-hand sides from SDP-interface

Parameters
sdpiSDP-interface structure
firstrowfirst row to get sides for
lastrowlast row to get sides for
rhsspointer to store right-hand side values (memory of size lastvar - firstvar + 1 needs to be allocated)

Definition at line 2415 of file sdpi.c.

SCIP_RETCODE SCIPsdpiSolve ( SCIP_SDPI sdpi,
SCIP_Real *  starty,
int *  startZnblocknonz,
int **  startZrow,
int **  startZcol,
SCIP_Real **  startZval,
int *  startXnblocknonz,
int **  startXrow,
int **  startXcol,
SCIP_Real **  startXval,
SCIP_SDPSOLVERSETTING  startsettings,
SCIP_Bool  enforceslatercheck,
SCIP_Real  timelimit 
)

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

Note
starting point needs to be given with original indices (before any local presolving), last block should be the LP block with indices lhs(row0), rhs(row0), lhs(row1), ..., lb(var1), ub(var1), lb(var2), ... independent of some lhs/rhs being infinity (the starting point will later be adjusted accordingly)
Parameters
sdpiSDP-interface structure
startyNULL or dual vector y as starting point for the solver, this should have length nvars
startZnblocknonzdual matrix Z = sum Ai yi as starting point for the solver: number of nonzeros for each block, also length of corresponding row/col/val-arrays; or NULL
startZrowdual matrix Z = sum Ai yi as starting point for the solver: row indices for each block; may be NULL if startZnblocknonz = NULL
startZcoldual matrix Z = sum Ai yi as starting point for the solver: column indices for each block; may be NULL if startZnblocknonz = NULL
startZvaldual matrix Z = sum Ai yi as starting point for the solver: values for each block; may be NULL if startZnblocknonz = NULL
startXnblocknonzprimal matrix X as starting point for the solver: number of nonzeros for each block, also length of corresponding row/col/val-arrays; or NULL
startXrowprimal matrix X as starting point for the solver: row indices for each block; may be NULL if startXnblocknonz = NULL
startXcolprimal matrix X as starting point for the solver: column indices for each block; may be NULL if startXnblocknonz = NULL
startXvalprimal matrix X as starting point for the solver: values for each block; may be NULL if startXnblocknonz = NULL
startsettingssettings used to start with in SDPA, currently not used for DSDP or MOSEK, set this to SCIP_SDPSOLVERSETTING_UNSOLVED to ignore it and start from scratch
enforceslatercheckalways check for Slater condition in case the problem could not be solved and printf the solution of this check
timelimitafter this many seconds solving will be aborted (currently only implemented for DSDP and MOSEK)

Definition at line 2453 of file sdpi.c.

References BMS_CALL, checkAllFixed(), checkFixedFeasibilitySdp(), checkSlaterCondition(), compConstMatAfterFixings(), computeLpLhsRhsAfterFixings(), findEmptyRowColsSDP(), MIN_GAPTOL, SCIP_CALL_PARAM, SCIP_SDPPAR_GAPTOL, SCIP_SDPSLATER_NOINFO, SCIP_SDPSOLVERSETTING_UNSOLVED, SCIPsdpiInfinity(), SCIPsdpiIsInfinity(), SCIPsdpiSolverGetIterations(), SCIPsdpiSolverGetObjval(), SCIPsdpiSolverGetSdpCalls(), SCIPsdpiSolverIncreaseCounter(), SCIPsdpiSolverInfinity(), SCIPsdpiSolverIsAcceptable(), SCIPsdpiSolverIsDualInfeasible(), SCIPsdpiSolverIsOptimal(), SCIPsdpiSolverIsTimelimExc(), SCIPsdpiSolverLoadAndSolve(), SCIPsdpiSolverLoadAndSolveWithPenalty(), SCIPsdpiSolverSetRealpar(), and SCIPsdpiSolverWasSolved().

Referenced by calcRelax(), and SCIPrelaxSdpComputeAnalyticCenters().

SCIP_Bool SCIPsdpiWasSolved ( SCIP_SDPI sdpi)

returns whether a solve method was successfully called after the last modification of the SDP

Parameters
sdpiSDP-interface structure

Definition at line 2850 of file sdpi.c.

References SCIPsdpiSolverWasSolved().

Referenced by calcRelax(), SCIPrelaxSdpComputeAnalyticCenters(), and SCIPsdpiSolvedOrig().

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

Parameters
sdpiSDP-interface structure

Definition at line 2860 of file sdpi.c.

References SCIPsdpiWasSolved().

Referenced by calcRelax(), SCIPrelaxSdpComputeAnalyticCenters(), 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 does not know anything about the feasibility status and thus the functions IsPrimalFeasible etc. should not be used

Parameters
sdpiSDP-interface structure

Definition at line 2872 of file sdpi.c.

References CHECK_IF_SOLVED_BOOL, and SCIPsdpiSolverFeasibilityKnown().

Referenced by calcRelax().

SCIP_RETCODE SCIPsdpiGetSolFeasibility ( SCIP_SDPI sdpi,
SCIP_Bool *  primalfeasible,
SCIP_Bool *  dualfeasible 
)

gets information about primal and dual feasibility of the current SDP-solution

Parameters
sdpiSDP-interface structure
primalfeasiblepointer to store the primal feasibility status
dualfeasiblepointer to store the dual feasibility status

Definition at line 2886 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 could not determine feasibility

Parameters
sdpiSDP-interface structure

Definition at line 2915 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 could not determine feasibility

Parameters
sdpiSDP-interface structure

Definition at line 2938 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 could not determine feasibility

Parameters
sdpiSDP-interface structure

Definition at line 2961 of file sdpi.c.

References CHECK_IF_SOLVED_BOOL, and SCIPsdpiSolverIsPrimalFeasible().

Referenced by calcRelax(), and SCIPrelaxSdpComputeAnalyticCenters().

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 could not determine feasibility

Parameters
sdpiSDP-interface structure

Definition at line 2984 of file sdpi.c.

References CHECK_IF_SOLVED_BOOL, and SCIPsdpiSolverIsDualUnbounded().

Referenced by calcRelax(), and SCIP_DECL_RELAXEXEC().

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 could not determine feasibility

Parameters
sdpiSDP-interface structure

Definition at line 3007 of file sdpi.c.

References CHECK_IF_SOLVED_BOOL, and SCIPsdpiSolverIsDualInfeasible().

Referenced by calcRelax().

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 could not determine feasibility

Parameters
sdpiSDP-interface structure

Definition at line 3030 of file sdpi.c.

References CHECK_IF_SOLVED_BOOL, and SCIPsdpiSolverIsDualFeasible().

Referenced by calcRelax(), and SCIPrelaxSdpComputeAnalyticCenters().

SCIP_Bool SCIPsdpiIsConverged ( SCIP_SDPI sdpi)

returns TRUE iff the solver converged

Parameters
sdpiSDP-interface structure

Definition at line 3052 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

Parameters
sdpiSDP-interface structure

Definition at line 3074 of file sdpi.c.

References CHECK_IF_SOLVED_BOOL, and SCIPsdpiSolverIsObjlimExc().

Referenced by calcRelax().

SCIP_Bool SCIPsdpiIsIterlimExc ( SCIP_SDPI sdpi)

returns TRUE iff the iteration limit was reached

Parameters
sdpiSDP-interface structure

Definition at line 3096 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

Parameters
sdpiSDP-interface structure

Definition at line 3118 of file sdpi.c.

References SCIPsdpiSolverIsTimelimExc().

Referenced by calcRelax().

int SCIPsdpiGetInternalStatus ( SCIP_SDPI sdpi)

returns the internal solution status of the solver, which has the following meaning:
-1: solver was not 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

Parameters
sdpiSDP-interface structure

Definition at line 3153 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

Parameters
sdpiSDP-interface structure

Definition at line 3179 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

Parameters
sdpiSDP-interface structure

Definition at line 3202 of file sdpi.c.

References SCIPsdpiSolverIsAcceptable().

Referenced by calcRelax().

SCIP_RETCODE SCIPsdpiGetObjval ( SCIP_SDPI sdpi,
SCIP_Real *  objval 
)

gets objective value of solution

Parameters
sdpiSDP-interface structure
objvalpointer to store the objective value

Definition at line 3228 of file sdpi.c.

References CHECK_IF_SOLVED, and SCIPsdpiSolverGetObjval().

Referenced by SCIPsdpiGetSol().

SCIP_RETCODE SCIPsdpiGetLowerObjbound ( SCIP_SDPI sdpi,
SCIP_Real *  objlb 
)

gets the best lower bound on the objective (this is equal to objval, if the problem was solved successfully, but can also give a bound if we did not get a feasible solution using the penalty approach)

Parameters
sdpiSDP-interface structure
objlbpointer to store the lower bound on the objective value

Definition at line 3263 of file sdpi.c.

References SCIPsdpiInfinity(), and SCIPsdpiSolverGetObjval().

Referenced by calcRelax().

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

Parameters
sdpiSDP-interface structure
objvalpointer to store the objective value, may be NULL if not needed
dualsolpointer to store the dual solution vector, may be NULL if not needed
dualsollengthlength of the dualsol vector, must be 0 if dualsol is NULL, if this is less than the number of variables in the SDP, a debug-message will be thrown and this is set to the needed value

Definition at line 3312 of file sdpi.c.

References CHECK_IF_SOLVED, SCIPsdpiGetObjval(), and SCIPsdpiSolverGetSol().

Referenced by calcRelax(), SCIP_DECL_RELAXEXEC(), SCIPrelaxSdpComputeAnalyticCenters(), and SCIPrelaxSdpGetRelaxSol().

SCIP_RETCODE SCIPsdpiGetPreoptimalPrimalNonzeros ( SCIP_SDPI sdpi,
int  nblocks,
int *  startXnblocknonz 
)

return number of nonzeros for each block of the primal solution matrix X for the preoptimal solution

Parameters
sdpipointer to an SDP-interface structure
nblockslength of startXnblocknonz (should be nsdpblocks + 1)
startXnblocknonzpointer to store number of nonzeros for row/col/val-arrays in each block or first entry -1 if no primal solution is available

Definition at line 3363 of file sdpi.c.

References SCIPsdpiSolverGetPreoptimalPrimalNonzeros().

Referenced by calcRelax().

SCIP_RETCODE SCIPsdpiGetPreoptimalSol ( SCIP_SDPI sdpi,
SCIP_Bool *  success,
SCIP_Real *  dualsol,
int *  dualsollength,
int  nblocks,
int *  startXnblocknonz,
int **  startXrow,
int **  startXcol,
SCIP_Real **  startXval 
)

gets preoptimal dual solution vector and primal matrix for warmstarting purposes

Note
last block will be the LP block (if one exists) with indices lhs(row0), rhs(row0), lhs(row1), ..., lb(var1), ub(var1), lb(var2), ... independent of some lhs/rhs being infinity
If dualsollength isn't equal to the number of variables this will return the needed length and a debug message is thrown.
If the allocated memory for row/col/val is insufficient, a debug message will be thrown and the neccessary amount is returned in startXnblocknonz
Parameters
sdpiSDP-interface structure
successcould a preoptimal solution be returned ?
dualsolpointer to store the dual solution vector, may be NULL if not needed
dualsollengthlength of the dual sol 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
nblockslength of startXnblocknonz (should be nsdpblocks + 1) or -1 if no primal matrix should be returned
startXnblocknonzinput: allocated memory for row/col/val-arrays in each block (or NULL if nblocks = -1) output: number of nonzeros in each block or first entry -1 if no primal solution is available
startXrowpointer to store row indices of X (or NULL if nblocks = -1)
startXcolpointer to store column indices of X (or NULL if nblocks = -1)
startXvalpointer to store values of X (or NULL if nblocks = -1)

Definition at line 3401 of file sdpi.c.

References SCIPsdpiSolverGetPreoptimalSol().

Referenced by calcRelax().

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

Note
If a variable is either fixed or unbounded in the dual problem, a zero will be returned for the non-existent primal variable.
Parameters
sdpipointer to an SDP-interface structure
lbvarspointer to store the values of the variables corresponding to lower bounds in the dual problems
ubvarspointer to store the values of the variables corresponding to upper bounds in the dual problems
arraylengthinput: length of lbvars and ubvars
output: number of elements inserted into lbvars/ubvars (or needed length if it was not sufficient)

Definition at line 3472 of file sdpi.c.

References CHECK_IF_SOLVED, and SCIPsdpiSolverGetPrimalBoundVars().

Referenced by SCIPrelaxSdpGetPrimalBoundVars().

SCIP_RETCODE SCIPsdpiGetPrimalNonzeros ( SCIP_SDPI sdpi,
int  nblocks,
int *  startXnblocknonz 
)

return number of nonzeros for each block of the primal solution matrix X

Parameters
sdpipointer to an SDP-interface structure
nblockslength of startXnblocknonz (should be nsdpblocks + 1)
startXnblocknonzpointer to store number of nonzeros for row/col/val-arrays in each block

Definition at line 3504 of file sdpi.c.

References SCIPsdpiSolverGetPrimalNonzeros().

Referenced by calcRelax(), and SCIPrelaxSdpComputeAnalyticCenters().

SCIP_RETCODE SCIPsdpiGetPrimalMatrix ( SCIP_SDPI sdpi,
int  nblocks,
int *  startXnblocknonz,
int **  startXrow,
int **  startXcol,
SCIP_Real **  startXval 
)

returns the primal matrix X

Note
last block will be the LP block (if one exists) with indices lhs(row0), rhs(row0), lhs(row1), ..., lb(var1), ub(var1), lb(var2), ... independent of some lhs/rhs being infinity
If the allocated memory for row/col/val is insufficient, a debug message will be thrown and the neccessary amount is returned in startXnblocknonz
Parameters
sdpipointer to an SDP-interface structure
nblockslength of startXnblocknonz (should be nsdpblocks + 1)
startXnblocknonzinput: allocated memory for row/col/val-arrays in each block output: number of nonzeros in each block
startXrowpointer to store row indices of X
startXcolpointer to store column indices of X
startXvalpointer to store values of X

Definition at line 3532 of file sdpi.c.

References SCIPsdpiSolverGetPrimalMatrix().

Referenced by calcRelax(), and SCIPrelaxSdpComputeAnalyticCenters().

SCIP_Real SCIPsdpiGetMaxPrimalEntry ( SCIP_SDPI sdpi)

return the maximum absolute value of the optimal primal matrix

Parameters
sdpipointer to an SDP-interface structure

Definition at line 3561 of file sdpi.c.

References SCIPsdpiSolverGetMaxPrimalEntry().

Referenced by calcRelax().

SCIP_RETCODE SCIPsdpiGetIterations ( SCIP_SDPI sdpi,
int *  iterations 
)

gets the number of SDP-iterations of the last solve call

Parameters
sdpiSDP-interface structure
iterationspointer to store the number of iterations of the last solve call

Definition at line 3571 of file sdpi.c.

Referenced by calcRelax(), and SCIPrelaxSdpComputeAnalyticCenters().

SCIP_RETCODE SCIPsdpiGetSdpCalls ( SCIP_SDPI sdpi,
int *  calls 
)

gets the number of calls to the SDP-solver for the last solve call

Parameters
sdpiSDP-interface structure
callspointer to store the number of calls to the SDP-solver for the last solve call

Definition at line 3585 of file sdpi.c.

Referenced by calcRelax(), and SCIPrelaxSdpComputeAnalyticCenters().

SCIP_RETCODE SCIPsdpiSettingsUsed ( SCIP_SDPI sdpi,
SCIP_SDPSOLVERSETTING usedsetting 
)

returns which settings the SDP-solver used in the last solve call

Parameters
sdpiSDP-interface structure
usedsettingthe setting used by the SDP-solver

Definition at line 3599 of file sdpi.c.

References SCIP_SDPSOLVERSETTING_PENALTY, SCIP_SDPSOLVERSETTING_UNSOLVED, and SCIPsdpiSolverSettingsUsed().

Referenced by calcRelax(), and SCIPrelaxSdpComputeAnalyticCenters().

SCIP_RETCODE SCIPsdpiSlaterSettings ( SCIP_SDPI sdpi,
SCIP_SDPSLATERSETTING slatersetting 
)
SCIP_RETCODE SCIPsdpiSlater ( SCIP_SDPI sdpi,
SCIP_SDPSLATER primalslater,
SCIP_SDPSLATER dualslater 
)

returns whether primal and dual Slater condition held for last solved SDP

Parameters
sdpiSDP-interface structure
primalslaterpointer to save whether primal Slater condition held
dualslaterpointer to save whether dual Slater condition held

Definition at line 3941 of file sdpi.c.

References SCIP_SDPSLATER_NOINFO.

Referenced by calcRelax(), and SCIPrelaxSdpComputeAnalyticCenters().

SCIP_Real SCIPsdpiInfinity ( SCIP_SDPI sdpi)

returns value treated as infinity in the SDP-solver

Parameters
sdpiSDP-interface structure

Definition at line 3985 of file sdpi.c.

References SCIPsdpiSolverInfinity().

Referenced by calcRelax(), computeLpLhsRhsAfterFixings(), SCIP_DECL_RELAXINITSOL(), SCIPsdpiGetLowerObjbound(), SCIPsdpiIsInfinity(), and SCIPsdpiSolve().

SCIP_Bool SCIPsdpiIsInfinity ( SCIP_SDPI sdpi,
SCIP_Real  val 
)

checks if given value is treated as (plus or minus) infinity in the SDP-solver

Parameters
sdpiSDP-interface structure
valvalue to be checked for infinity

Definition at line 3995 of file sdpi.c.

References SCIPsdpiInfinity().

Referenced by checkSlaterCondition(), and SCIPsdpiSolve().

SCIP_RETCODE SCIPsdpiGetRealpar ( SCIP_SDPI sdpi,
SCIP_SDPPARAM  type,
SCIP_Real *  dval 
)

gets floating point parameter of SDP-interface

Parameters
sdpiSDP-interface structure
typeparameter number
dvalpointer to store the parameter value

Definition at line 4006 of file sdpi.c.

References SCIP_CALL_PARAM, SCIP_SDPPAR_EPSILON, SCIP_SDPPAR_FEASTOL, SCIP_SDPPAR_GAPTOL, SCIP_SDPPAR_LAMBDASTAR, SCIP_SDPPAR_MAXPENALTYPARAM, SCIP_SDPPAR_OBJLIMIT, SCIP_SDPPAR_PENALTYPARAM, SCIP_SDPPAR_PENINFEASADJUST, SCIP_SDPPAR_SDPSOLVERFEASTOL, SCIP_SDPPAR_WARMSTARTPOGAP, and SCIPsdpiSolverGetRealpar().

Referenced by SCIP_DECL_RELAXINITSOL().

SCIP_RETCODE SCIPsdpiSetRealpar ( SCIP_SDPI sdpi,
SCIP_SDPPARAM  type,
SCIP_Real  dval 
)
SCIP_RETCODE SCIPsdpiGetIntpar ( SCIP_SDPI sdpi,
SCIP_SDPPARAM  type,
int *  ival 
)

gets integer parameter of SDP-interface

Parameters
sdpiSDP-interface structure
typeparameter number
ivalpointer to store the parameter value

Definition at line 4108 of file sdpi.c.

References SCIP_CALL_PARAM, SCIP_SDPPAR_NPENALTYINCR, SCIP_SDPPAR_NTHREADS, SCIP_SDPPAR_SDPINFO, SCIP_SDPPAR_SLATERCHECK, and SCIPsdpiSolverGetIntpar().

SCIP_RETCODE SCIPsdpiSetIntpar ( SCIP_SDPI sdpi,
SCIP_SDPPARAM  type,
int  ival 
)

sets integer parameter of SDP-interface

Parameters
sdpiSDP-interface structure
typeparameter number
ivalparameter value

Definition at line 4138 of file sdpi.c.

References SCIP_CALL_PARAM, SCIP_SDPPAR_NPENALTYINCR, SCIP_SDPPAR_NTHREADS, SCIP_SDPPAR_SDPINFO, SCIP_SDPPAR_SLATERCHECK, and SCIPsdpiSolverSetIntpar().

Referenced by SCIP_DECL_RELAXINITSOL().

SCIP_RETCODE SCIPsdpiComputeLambdastar ( SCIP_SDPI sdpi,
SCIP_Real  maxguess 
)

compute and set lambdastar (only used for SDPA)

Parameters
sdpiSDP-interface structure
maxguessmaximum guess for lambda star of all SDP-constraints

Definition at line 4170 of file sdpi.c.

References SCIPsdpiSolverComputeLambdastar().

Referenced by SCIP_DECL_RELAXINITSOL().

SCIP_RETCODE SCIPsdpiComputePenaltyparam ( SCIP_SDPI sdpi,
SCIP_Real  maxcoeff,
SCIP_Real *  penaltyparam 
)

compute and set the penalty parameter

Parameters
sdpiSDP-interface structure
maxcoeffmaximum objective coefficient
penaltyparamthe computed penalty parameter

Definition at line 4179 of file sdpi.c.

References SCIPsdpiSolverComputePenaltyparam().

Referenced by SCIP_DECL_RELAXINITSOL().

SCIP_RETCODE SCIPsdpiComputeMaxPenaltyparam ( SCIP_SDPI sdpi,
SCIP_Real  penaltyparam,
SCIP_Real *  maxpenaltyparam 
)

compute and set the maximum penalty parameter

Parameters
sdpiSDP-interface structure
penaltyparamthe initial penalty parameter
maxpenaltyparamthe computed maximum penalty parameter

Definition at line 4193 of file sdpi.c.

References SCIPsdpiSolverComputeMaxPenaltyparam().

Referenced by SCIP_DECL_RELAXINITSOL().

SCIP_RETCODE SCIPsdpiReadSDP ( SCIP_SDPI sdpi,
const char *  fname 
)

reads SDP from a file

Parameters
sdpiSDP-interface structure
fnamefile name

Definition at line 4227 of file sdpi.c.

SCIP_RETCODE SCIPsdpiWriteSDP ( SCIP_SDPI sdpi,
const char *  fname 
)

writes SDP to a file

Parameters
sdpiSDP-interface structure
fnamefile name

Definition at line 4237 of file sdpi.c.