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

SDP relaxator. More...

Go to the source code of this file.

Macros

#define RELAX_NAME   "SDP"
 
#define RELAX_DESC   "SDP relaxator"
 
#define RELAX_PRIORITY   1
 
#define RELAX_FREQ   1
 
#define DEFAULT_SDPSOLVEREPSILON   1e-5
 
#define DEFAULT_SDPSOLVERFEASTOL   1e-4
 
#define DEFAULT_OBJLIMIT   FALSE
 

Functions

static SCIP_RETCODE putSdpDataInInterface (SCIP *scip, SCIP_SDPI *sdpi, SdpVarmapper *varmapper)
 
static SCIP_RETCODE putLpDataInInterface (SCIP *scip, SCIP_SDPI *sdpi, SdpVarmapper *varmapper)
 
static SCIP_RETCODE calc_relax (SCIP *scip, SCIP_RELAXDATA *relaxdata, SCIP_RESULT *result, SCIP_Real *lowerbound)
 
static SCIP_Bool allVarsFixed (SCIP *scip)
 
static SCIP_DECL_RELAXEXEC (relaxExecSdp)
 
static SCIP_DECL_RELAXINIT (relaxInitSolSdp)
 
static SCIP_DECL_RELAXCOPY (relaxCopySdp)
 
static SCIP_DECL_RELAXEXIT (relaxExitSdp)
 
static SCIP_DECL_RELAXFREE (relaxFreeSdp)
 
SCIP_RETCODE SCIPincludeRelaxSdp (SCIP *scip)
 
SCIP_RETCODE SCIPrelaxSdpGetPrimalBoundVars (SCIP_RELAX *relax, SCIP_Real *lbvars, SCIP_Real *ubvars, int *arraylength)
 
SCIP_RETCODE SCIPrelaxSdpRelaxVal (SCIP_RELAX *relax, SCIP_Bool *success, SCIP_Real *objval)
 
SCIP_RETCODE SCIPrelaxSdpGetRelaxSol (SCIP *scip, SCIP_RELAX *relax, SCIP_Bool *success, SCIP_Real *solarray, int *sollength)
 
long int SCIPrelaxSdpGetSdpNode (SCIP_RELAX *relax)
 
SCIP_Bool SCIPrelaxSdpSolvedOrig (SCIP_RELAX *relax)
 
int SCIPrelaxSdpGetNIterations (SCIP_RELAX *relax)
 
int SCIPrelaxSdpGetNSdpCalls (SCIP_RELAX *relax)
 

Detailed Description

SDP relaxator.

Author
Sonja Mars
Tristan Gally

Definition in file relax_sdp.c.

Macro Definition Documentation

#define RELAX_NAME   "SDP"

Definition at line 55 of file relax_sdp.c.

Referenced by SCIP_DECL_RELAXCOPY(), and SCIPincludeRelaxSdp().

#define RELAX_DESC   "SDP relaxator"

Definition at line 56 of file relax_sdp.c.

Referenced by SCIPincludeRelaxSdp().

#define RELAX_PRIORITY   1

Definition at line 57 of file relax_sdp.c.

Referenced by SCIPincludeRelaxSdp().

#define RELAX_FREQ   1

Definition at line 58 of file relax_sdp.c.

Referenced by SCIPincludeRelaxSdp().

#define DEFAULT_SDPSOLVEREPSILON   1e-5

the stopping criterion for the duality gap the sdpsolver should use

Definition at line 60 of file relax_sdp.c.

Referenced by SCIPincludeRelaxSdp().

#define DEFAULT_SDPSOLVERFEASTOL   1e-4

the feasibility tolerance the SDP solver should use for the SDP constraints

Definition at line 61 of file relax_sdp.c.

Referenced by SCIPincludeRelaxSdp().

#define DEFAULT_OBJLIMIT   FALSE

should an objective limit be given to the SDP-Solver ?

Definition at line 65 of file relax_sdp.c.

Referenced by SCIPincludeRelaxSdp().

Function Documentation

static SCIP_RETCODE putSdpDataInInterface ( SCIP *  scip,
SCIP_SDPI sdpi,
SdpVarmapper varmapper 
)
static

inserts all the SDP data into the corresponding SDP Interface

Parameters
scipSCIP data structure
sdpiSDP interface structure
varmappermaps SCIP variables to their global SDP indices and vice versa

Definition at line 93 of file relax_sdp.c.

References SCIPconsSdpGetData(), SCIPconsSdpGetNNonz(), SCIPsdpiLoadSDP(), and SCIPsdpVarmapperGetSdpIndex().

Referenced by SCIP_DECL_RELAXINIT().

static SCIP_RETCODE putLpDataInInterface ( SCIP *  scip,
SCIP_SDPI sdpi,
SdpVarmapper varmapper 
)
static

inserts all the LP data into the corresponding SDP Interface

Parameters
scipSCIP data structure
sdpiSDP interface structure
varmapperdata about fixed variables

Definition at line 286 of file relax_sdp.c.

References SCIPsdpiAddLPRows(), SCIPsdpiChgBounds(), SCIPsdpiDelLPRows(), SCIPsdpiGetNLPRows(), and SCIPsdpVarmapperGetSdpIndex().

Referenced by SCIP_DECL_RELAXEXEC().

static SCIP_RETCODE calc_relax ( SCIP *  scip,
SCIP_RELAXDATA *  relaxdata,
SCIP_RESULT *  result,
SCIP_Real *  lowerbound 
)
static

calculate relaxation and process the relaxation results

Parameters
scipSCIP data structure
relaxdatadata of the relaxator
resultpointer to store result of relaxation process
lowerboundpointer to store lowerbound

Definition at line 423 of file relax_sdp.c.

References SCIP_SDPPAR_OBJLIMIT, SCIPsdpiFeasibilityKnown(), SCIPsdpiGetSol(), SCIPsdpiInfinity(), SCIPsdpiIsAcceptable(), SCIPsdpiIsDualFeasible(), SCIPsdpiIsDualInfeasible(), SCIPsdpiIsDualUnbounded(), SCIPsdpiIsObjlimExc(), SCIPsdpiIsPrimalFeasible(), SCIPsdpiSetRealpar(), SCIPsdpiSolve(), SCIPsdpiSolvedOrig(), SCIPsdpiWasSolved(), and SCIPsdpVarmapperGetSCIPvar().

Referenced by SCIP_DECL_RELAXEXEC().

static SCIP_Bool allVarsFixed ( SCIP *  scip)
static

checks whether all variables are fixed

Parameters
scipSCIP data structure

Definition at line 647 of file relax_sdp.c.

Referenced by SCIP_DECL_RELAXEXEC().

static SCIP_DECL_RELAXEXEC ( relaxExecSdp  )
static

execution method of relaxator

Definition at line 671 of file relax_sdp.c.

References allVarsFixed(), calc_relax(), and putLpDataInInterface().

static SCIP_DECL_RELAXINIT ( relaxInitSolSdp  )
static

this method is called after presolving is finished, at this point the varmapper is prepared and the SDP Interface is initialized and gets the SDP information from the constraints

Definition at line 791 of file relax_sdp.c.

References putSdpDataInInterface(), SCIP_SDPPAR_EPSILON, SCIP_SDPPAR_FEASTOL, SCIP_SDPPAR_SDPINFO, SCIP_SDPPAR_SLATERCHECK, SCIPsdpiGetSolverName(), SCIPsdpiSetIntpar(), SCIPsdpiSetRealpar(), SCIPsdpVarmapperAddVars(), and SCIPsdpVarmapperCreate().

static SCIP_DECL_RELAXCOPY ( relaxCopySdp  )
static

copy method for sdp relaxation handler (called when SCIP copies plugins)

Definition at line 901 of file relax_sdp.c.

References RELAX_NAME, and SCIPincludeRelaxSdp().

static SCIP_DECL_RELAXEXIT ( relaxExitSdp  )
static

reset the relaxator's data

Definition at line 914 of file relax_sdp.c.

References SCIPsdpiClear(), and SCIPsdpVarmapperFree().

static SCIP_DECL_RELAXFREE ( relaxFreeSdp  )
static

free the relaxator's data

Definition at line 943 of file relax_sdp.c.

References SCIPsdpiFree().

SCIP_RETCODE SCIPincludeRelaxSdp ( SCIP *  scip)

creates the SDP relaxator and includes it in SCIP

Parameters
scipSCIP data structure

Definition at line 964 of file relax_sdp.c.

References DEFAULT_OBJLIMIT, DEFAULT_SDPSOLVEREPSILON, DEFAULT_SDPSOLVERFEASTOL, RELAX_DESC, RELAX_FREQ, RELAX_NAME, RELAX_PRIORITY, SCIPsdpiCreate(), SCIPsdpiGetSolverDesc(), and SCIPsdpiGetSolverName().

Referenced by runSCIP(), and SCIP_DECL_RELAXCOPY().

SCIP_RETCODE SCIPrelaxSdpGetPrimalBoundVars ( SCIP_RELAX *  relax,
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
relaxSDP relaxator to information for
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 wasn't sufficient)

Definition at line 1025 of file relax_sdp.c.

References SCIPsdpiGetPrimalBoundVars().

Referenced by SCIP_DECL_PROPEXEC().

SCIP_RETCODE SCIPrelaxSdpRelaxVal ( SCIP_RELAX *  relax,
SCIP_Bool *  success,
SCIP_Real *  objval 
)

returns optimal objective value of the current SDP relaxation, if the last SDP relaxation was successfully solved

Parameters
relaxSDP relaxator to get objective value for
successpointer to store whether the last SDP relaxation solved successfully
objvalpointer to store the optimal objective value of the SDP relaxation

Definition at line 1050 of file relax_sdp.c.

Referenced by SCIP_DECL_PROPEXEC().

SCIP_RETCODE SCIPrelaxSdpGetRelaxSol ( SCIP *  scip,
SCIP_RELAX *  relax,
SCIP_Bool *  success,
SCIP_Real *  solarray,
int *  sollength 
)

returns values of all variables in the solution of the current SDP relaxation, if the last SDP relaxation was successfully solved

Parameters
scipSCIP pointer
relaxSDP relaxator to get solution for
successpointer to store whether the last SDP relaxation solved successfully
solarraypointer to store the solution, this has to be at least length nvars
sollengthlength of the solarray

Definition at line 1072 of file relax_sdp.c.

References SCIPsdpiGetSol().

long int SCIPrelaxSdpGetSdpNode ( SCIP_RELAX *  relax)

get the number of the SCIP-node to which the current SDP solution belongs

Parameters
relaxSDP relaxator to get solution for

Definition at line 1103 of file relax_sdp.c.

Referenced by SCIP_DECL_PROPEXEC().

SCIP_Bool SCIPrelaxSdpSolvedOrig ( SCIP_RELAX *  relax)

was the original problem solved for the last SDP-Node (or a penalty formulation) ?

Parameters
relaxSDP relaxator to get solution for

Definition at line 1114 of file relax_sdp.c.

References SCIPsdpiSolvedOrig().

Referenced by SCIP_DECL_PROPEXEC().

int SCIPrelaxSdpGetNIterations ( SCIP_RELAX *  relax)

returns total number of SDP iterations

Parameters
relaxSDP relaxator to get the iterations for

Definition at line 1131 of file relax_sdp.c.

Referenced by SCIP_DECL_DISPOUTPUT().

int SCIPrelaxSdpGetNSdpCalls ( SCIP_RELAX *  relax)

returns number of solved SDP relaxations

Parameters
relaxSDP relaxator to get the number of calls for

Definition at line 1142 of file relax_sdp.c.

Referenced by SCIP_DECL_DISPOUTPUT().