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

Constraint handler for SDP-constraints. More...

Go to the source code of this file.

Macros

#define CONSHDLR_NAME   "SDP"
 
#define CONSHDLR_DESC   "SDP constraints of the form \\sum_{j} A_j y_j - A_0 psd"
 
#define CONSHDLR_SEPAPRIORITY   +1000000
 
#define CONSHDLR_ENFOPRIORITY   -2000000
 
#define CONSHDLR_CHECKPRIORITY   -2000000
 
#define CONSHDLR_SEPAFREQ   1
 
#define CONSHDLR_EAGERFREQ   100
 
#define CONSHDLR_MAXPREROUNDS   -1
 
#define CONSHDLR_DELAYSEPA   FALSE
 
#define CONSHDLR_NEEDSCONS   TRUE
 
#define CONSHDLR_PRESOLTIMING   SCIP_PRESOLTIMING_FAST
 
#define PARSE_STARTSIZE   1
 
#define PARSE_SIZEFACTOR   10
 

Functions

static int compLowerTriangPos (int i, int j)
 
static SCIP_RETCODE expandSymMatrix (int size, SCIP_Real *symMat, SCIP_Real *fullMat)
 
static SCIP_RETCODE computeSdpMatrix (SCIP *scip, SCIP_CONS *cons, SCIP_SOL *y, SCIP_Real *matrix)
 
static SCIP_RETCODE multiplyConstraintMatrix (SCIP_CONS *cons, int j, SCIP_Real *v, SCIP_Real *vAv)
 
static SCIP_RETCODE setMaxRhsEntry (SCIP_CONS *cons)
 
static SCIP_RETCODE cutUsingEigenvector (SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Real *coeff, SCIP_Real *lhs)
 
SCIP_RETCODE SCIPconsSdpCheckSdpCons (SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool printreason, SCIP_RESULT *result)
 
static SCIP_RETCODE separateSol (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_RESULT *result)
 
static SCIP_RETCODE diagGEzero (SCIP *scip, SCIP_CONS **conss, int nconss, int *naddconss)
 
static SCIP_RETCODE move_1x1_blocks_to_lp (SCIP *scip, SCIP_CONS **conss, int nconss, int *naddconss, int *ndelconss, SCIP_RESULT *result)
 
static SCIP_RETCODE multiaggrVar (SCIP *scip, SCIP_CONS *cons, int *v, SCIP_VAR **aggrvars, SCIP_Real *scalars, int naggrvars, SCIP_Real constant, int *savedcol, int *savedrow, SCIP_Real *savedval, int *nfixednonz, int *vararraylength)
 
static SCIP_RETCODE fixAndAggrVars (SCIP *scip, SCIP_CONS **conss, int nconss, SCIP_Bool aggregate)
 
static SCIP_DECL_CONSINITPRE (consInitpreSdp)
 
static SCIP_DECL_CONSLOCK (consLockSdp)
 
static SCIP_DECL_CONSEXITPRE (consExitpreSdp)
 
static SCIP_DECL_CONSPRESOL (consPresolSdp)
 
static SCIP_DECL_CONSTRANS (consTransSdp)
 
static SCIP_DECL_CONSCHECK (consCheckSdp)
 
static SCIP_DECL_CONSENFOPS (consEnfopsSdp)
 
static SCIP_DECL_CONSENFOLP (consEnfolpSdp)
 
static SCIP_DECL_CONSSEPASOL (consSepasolSdp)
 
static SCIP_DECL_CONSSEPALP (consSepalpSdp)
 
static SCIP_DECL_CONSDELETE (consDeleteSdp)
 
static SCIP_DECL_CONSFREE (consFreeSdp)
 
static SCIP_DECL_CONSHDLRCOPY (conshdlrCopySdp)
 
static SCIP_DECL_CONSCOPY (consCopySdp)
 
static SCIP_DECL_CONSPRINT (consPrintSdp)
 
static SCIP_DECL_CONSPARSE (consParseSdp)
 
static SCIP_DECL_CONSGETVARS (consGetVarsSdp)
 
static SCIP_DECL_CONSGETNVARS (consGetNVarsSdp)
 
SCIP_RETCODE SCIPincludeConshdlrSdp (SCIP *scip)
 
SCIP_RETCODE SCIPconsSdpGetData (SCIP *scip, SCIP_CONS *cons, int *nvars, int *nnonz, int *blocksize, int *arraylength, int *nvarnonz, int **col, int **row, SCIP_Real **val, SCIP_VAR **vars, int *constnnonz, int *constcol, int *constrow, SCIP_Real *constval)
 
SCIP_RETCODE SCIPconsSdpGetNNonz (SCIP *scip, SCIP_CONS *cons, int *nnonz, int *constnnonz)
 
SCIP_RETCODE SCIPconsSdpGetFullAj (SCIP *scip, SCIP_CONS *cons, int j, SCIP_Real *Aj)
 
SCIP_RETCODE SCIPconsSdpGetFullConstMatrix (SCIP *scip, SCIP_CONS *cons, SCIP_Real *mat)
 
SCIP_RETCODE SCIPconsSdpGetLowerTriangConstMatrix (SCIP *scip, SCIP_CONS *cons, SCIP_Real *mat)
 
SCIP_RETCODE SCIPconsSdpGuessInitialPoint (SCIP *scip, SCIP_CONS *cons, SCIP_Real *lambdastar)
 
SCIP_RETCODE SCIPcreateConsSdp (SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, int nnonz, int blocksize, int *nvarnonz, int **col, int **row, SCIP_Real **val, SCIP_VAR **vars, int constnnonz, int *constcol, int *constrow, SCIP_Real *constval)
 

Detailed Description

Constraint handler for SDP-constraints.

Author
Sonja Mars
Lars Schewe
Tristan Gally

Constraint handler for semidefinite constraints of the form $ \sum_{j=1}^n A_j y_j - A_0 \succeq 0 $, where the matrices $A_j$ and $A_0$ need to be symmetric. Only the nonzero entries of the matrices are stored.

Definition in file cons_sdp.c.

Macro Definition Documentation

#define CONSHDLR_NAME   "SDP"
#define CONSHDLR_DESC   "SDP constraints of the form \\sum_{j} A_j y_j - A_0 psd"

Definition at line 70 of file cons_sdp.c.

Referenced by SCIPincludeConshdlrSdp().

#define CONSHDLR_SEPAPRIORITY   +1000000

priority of the constraint handler for separation

Definition at line 71 of file cons_sdp.c.

Referenced by SCIPincludeConshdlrSdp().

#define CONSHDLR_ENFOPRIORITY   -2000000

priority of the constraint handler for constraint enforcing

Definition at line 72 of file cons_sdp.c.

Referenced by SCIPincludeConshdlrSdp().

#define CONSHDLR_CHECKPRIORITY   -2000000

priority of the constraint handler for checking feasibility

Definition at line 73 of file cons_sdp.c.

Referenced by SCIPincludeConshdlrSdp().

#define CONSHDLR_SEPAFREQ   1

frequency for separating cuts; zero means to separate only in the root node

Definition at line 74 of file cons_sdp.c.

Referenced by SCIPincludeConshdlrSdp().

#define CONSHDLR_EAGERFREQ   100

frequency for using all instead of only the useful constraints in separation, propagation and enforcement, -1 for no eager evaluations, 0 for first only

Definition at line 75 of file cons_sdp.c.

Referenced by SCIPincludeConshdlrSdp().

#define CONSHDLR_MAXPREROUNDS   -1

maximal number of presolving rounds the constraint handler participates in (-1: no limit)

Definition at line 78 of file cons_sdp.c.

Referenced by SCIPincludeConshdlrSdp().

#define CONSHDLR_DELAYSEPA   FALSE

should separation method be delayed, if other separators found cuts?

Definition at line 79 of file cons_sdp.c.

Referenced by SCIPincludeConshdlrSdp().

#define CONSHDLR_NEEDSCONS   TRUE

should the constraint handler be skipped, if no constraints are available?

Definition at line 80 of file cons_sdp.c.

Referenced by SCIPincludeConshdlrSdp().

#define CONSHDLR_PRESOLTIMING   SCIP_PRESOLTIMING_FAST

Definition at line 82 of file cons_sdp.c.

Referenced by SCIPincludeConshdlrSdp().

#define PARSE_STARTSIZE   1

initial size of the consdata-arrays when parsing a problem

Definition at line 83 of file cons_sdp.c.

Referenced by SCIP_DECL_CONSPARSE().

#define PARSE_SIZEFACTOR   10

size of consdata-arrays is increased by this factor when parsing a problem

Definition at line 84 of file cons_sdp.c.

Referenced by SCIP_DECL_CONSPARSE().

Function Documentation

static int compLowerTriangPos ( int  i,
int  j 
)
static

for given row and column (i,j) computes the position in the lower triangular part, if these positions are numbered from 0 to n(n+1)/2 - 1, this needs to be called for i >= j

Parameters
irow index
jcolumn index

Definition at line 124 of file cons_sdp.c.

Referenced by computeSdpMatrix(), diagGEzero(), expandSymMatrix(), and SCIPconsSdpGetLowerTriangConstMatrix().

static SCIP_RETCODE expandSymMatrix ( int  size,
SCIP_Real *  symMat,
SCIP_Real *  fullMat 
)
static

takes a 0.5*n*(n+1) array of a symmetric matrix and expands it to an n*n array of the full matrix to input into LAPACK

Parameters
sizesize of the matrix, named n above
symMatsymmetric matrix indexed via compLowerTriangPos that should be expanded
fullMatpointer to store the n*n matrix, that is the symmetric expansion of symMat

Definition at line 140 of file cons_sdp.c.

References compLowerTriangPos().

Referenced by cutUsingEigenvector(), and SCIPconsSdpCheckSdpCons().

static SCIP_RETCODE computeSdpMatrix ( SCIP *  scip,
SCIP_CONS *  cons,
SCIP_SOL *  y,
SCIP_Real *  matrix 
)
static

For a given vector $ y $ computes the (length of y) * (length of y + 1) /2 -long array of the lower-triangular part of the SDP-Matrix $ \sum_{j=1}^m A_j y_j - A_0 $ for this SDP block, indexed by compLowerTriangPos.

Parameters
scipSCIP data structure
consthe constraint for which the Matrix should be assembled
ysolution to separate
matrixpointer to store the SDP-Matrix

Definition at line 173 of file cons_sdp.c.

References compLowerTriangPos().

Referenced by cutUsingEigenvector(), and SCIPconsSdpCheckSdpCons().

static SCIP_RETCODE multiplyConstraintMatrix ( SCIP_CONS *  cons,
int  j,
SCIP_Real *  v,
SCIP_Real *  vAv 
)
static

For a given variable-index j and a Vector v computes $ v^T A_j v $.

Parameters
consthe SDP constraint that includes the Matrix $ A_j $
jvariable-index of the matrix to multiply with
vvector to multiply with
vAvpointer to store the the resulting scalar $ v^T A_j v $

Definition at line 215 of file cons_sdp.c.

Referenced by cutUsingEigenvector().

static SCIP_RETCODE setMaxRhsEntry ( SCIP_CONS *  cons)
static

Set the maximum absolute value of an entry of the constant matrix. This must be done before presolving, because otherwise this is influenced by variable fixings (which might lead to solutions being feasible in presolving no longer being feasible afterwards)

Parameters
consthe SDP constraint that includes the Matrix $ A_j $

Definition at line 255 of file cons_sdp.c.

Referenced by SCIP_DECL_CONSPARSE(), and SCIPcreateConsSdp().

static SCIP_RETCODE cutUsingEigenvector ( SCIP *  scip,
SCIP_CONS *  cons,
SCIP_SOL *  sol,
SCIP_Real *  coeff,
SCIP_Real *  lhs 
)
static

separate current solution with a cut using the eigenvectors and -values of the solution matrix

This function computes the eigenvectors of the matrix, takes the one corresponding to the smallest eigenvalue and multiplies the matrix with it such that $ coeff[i] = x^TA_ix , lhs = x^TA_0x $.

Parameters
scipSCIP data structure
consthe constraint to compute the cut for
solsolution to separate
coeffpointer to store the coefficients of the computed cut
lhspointer to store the lhs of the computed cut

Definition at line 288 of file cons_sdp.c.

References computeSdpMatrix(), expandSymMatrix(), multiplyConstraintMatrix(), SCIPconsSdpGetFullConstMatrix(), SCIPlapackComputeIthEigenvalue(), and SCIPlapackMatrixVectorMult().

Referenced by SCIP_DECL_CONSENFOLP(), and separateSol().

SCIP_RETCODE SCIPconsSdpCheckSdpCons ( SCIP *  scip,
SCIP_CONS *  cons,
SCIP_SOL *  sol,
SCIP_Bool  checkintegrality,
SCIP_Bool  checklprows,
SCIP_Bool  printreason,
SCIP_RESULT *  result 
)

checks feasibility for a single SDP constraint

Parameters
scipSCIP data structure
consthe constraint which should be checked
solthe solution to check feasibility for
checkintegralityhas integrality to be checked?
checklprowshave current LP rows to be checked?
printreasonshould the reason for the violation be printed?
resultpointer to store the result of the feasibility checking call

Definition at line 357 of file cons_sdp.c.

References computeSdpMatrix(), expandSymMatrix(), and SCIPlapackComputeIthEigenvalue().

Referenced by SCIP_DECL_CONSCHECK(), SCIP_DECL_CONSENFOLP(), and SCIP_DECL_CONSENFOPS().

static SCIP_RETCODE separateSol ( SCIP *  scip,
SCIP_CONSHDLR *  conshdlr,
SCIP_CONS *  cons,
SCIP_SOL *  sol,
SCIP_RESULT *  result 
)
static

separates the current solution

Parameters
scipSCIP data structure
conshdlrthe constraint handler itself
consconstraint to process
solprimal solution that should be separated
resultpointer to store the result of the separation call

Definition at line 421 of file cons_sdp.c.

References cutUsingEigenvector().

Referenced by SCIP_DECL_CONSSEPALP(), and SCIP_DECL_CONSSEPASOL().

static SCIP_RETCODE diagGEzero ( SCIP *  scip,
SCIP_CONS **  conss,
int  nconss,
int *  naddconss 
)
static

approximates the sdpcone using the fact that every diagonal entry must be non-negative, so it adds the LP-cut $ \sum_{j = 1}^m (A_j)_{kk} y_j - (A_0)_{kk} \geq 0 \quad \forall k \leq n $

Parameters
scipSCIP data structure
conssarray of constraints to add cuts for
nconssnumber of constraints to add cuts for
naddconsspointer to store how many constraints were added

Definition at line 511 of file cons_sdp.c.

References compLowerTriangPos(), and SCIPconsSdpGetLowerTriangConstMatrix().

Referenced by SCIP_DECL_CONSPRESOL().

static SCIP_RETCODE move_1x1_blocks_to_lp ( SCIP *  scip,
SCIP_CONS **  conss,
int  nconss,
int *  naddconss,
int *  ndelconss,
SCIP_RESULT *  result 
)
static

detects if there are blocks with size one and transfers them to lp-rows

Parameters
scipSCIP data structure
conssarray of constraints to check
nconssnumber of constraints to check
naddconsspointer to store how many constraints were added
ndelconsspointer to store how many constraints were deleted
resultpointer to store if this routine was successfull or if it detected infeasibility

Definition at line 766 of file cons_sdp.c.

Referenced by SCIP_DECL_CONSPRESOL().

static SCIP_RETCODE multiaggrVar ( SCIP *  scip,
SCIP_CONS *  cons,
int *  v,
SCIP_VAR **  aggrvars,
SCIP_Real *  scalars,
int  naggrvars,
SCIP_Real  constant,
int *  savedcol,
int *  savedrow,
SCIP_Real *  savedval,
int *  nfixednonz,
int *  vararraylength 
)
static

local function to perform (parts of) multiaggregation of a single variable within fixAndAggrVars

Parameters
scipSCIP pointer
consconstraint to multiaggregate for
vposition of the variable that gets (multi-)aggregated
aggrvarsvariables this has to be (multi-)aggregated to
scalarsscalar parts to multiply with for each variable this is aggregated to
naggrvarsnumber of variables this is (multi-)aggregated to
constantthe constant part for the (multi-)aggregation
savedcolarray of columns for nonzeros that need to be added to the constant part
savedrowarray of rows for nonzeros that need to be added to the constant part
savedvalarray of values for nonzeros that need to be added to the constant part
nfixednonzlength of the arrays of saved nonzeros for the constant part
vararraylengthlength of the variable array

Definition at line 971 of file cons_sdp.c.

References SCIPsdpVarfixerMergeArrays(), and SCIPsdpVarfixerSortRowCol().

Referenced by fixAndAggrVars().

static SCIP_RETCODE fixAndAggrVars ( SCIP *  scip,
SCIP_CONS **  conss,
int  nconss,
SCIP_Bool  aggregate 
)
static

presolve routine that looks through the data and handles fixed, (multi-)aggregated and negated variables

Parameters
scipSCIP data structure
conssarray with constraints to check
nconssnumber of constraints to check
aggregatedo we want to (mutli-)aggregate variables ?

Definition at line 1175 of file cons_sdp.c.

References multiaggrVar(), and SCIPsdpVarfixerMergeArrays().

Referenced by SCIP_DECL_CONSCOPY(), and SCIP_DECL_CONSEXITPRE().

static SCIP_DECL_CONSINITPRE ( consInitpreSdp  )
static

informs constraint handler that the presolving process is being started

Definition at line 1393 of file cons_sdp.c.

static SCIP_DECL_CONSLOCK ( consLockSdp  )
static

locks a variable up if the corresponding constraint matrix is not positive semidefinite, locks it down if it is not negative semidefinite

Definition at line 1412 of file cons_sdp.c.

References SCIPconsSdpGetFullAj(), and SCIPlapackComputeIthEigenvalue().

static SCIP_DECL_CONSEXITPRE ( consExitpreSdp  )
static

after presolving variables are fixed and multiaggregated

Definition at line 1468 of file cons_sdp.c.

References fixAndAggrVars().

static SCIP_DECL_CONSPRESOL ( consPresolSdp  )
static

presolving method of constraint handler

Definition at line 1482 of file cons_sdp.c.

References diagGEzero(), and move_1x1_blocks_to_lp().

static SCIP_DECL_CONSTRANS ( consTransSdp  )
static

creates transformed constraint

Definition at line 1504 of file cons_sdp.c.

static SCIP_DECL_CONSCHECK ( consCheckSdp  )
static

checks feasiblity of constraint, e.g. the positive semidefiniteness

Definition at line 1582 of file cons_sdp.c.

References SCIPconsSdpCheckSdpCons().

static SCIP_DECL_CONSENFOPS ( consEnfopsSdp  )
static

enforce pseudo solution method

Returns didnotrun if objinfeasible, computes feasibility otherwise.

Definition at line 1606 of file cons_sdp.c.

References SCIPconsSdpCheckSdpCons().

static SCIP_DECL_CONSENFOLP ( consEnfolpSdp  )
static

constraint enforcing method of constraint handler for LP solutions

Enforce lp solution method, if some block is not psd an eigenvector cut is added.

Definition at line 1645 of file cons_sdp.c.

References cutUsingEigenvector(), and SCIPconsSdpCheckSdpCons().

static SCIP_DECL_CONSSEPASOL ( consSepasolSdp  )
static

separates a solution using constraint specific ideas, gives cuts to SCIP

Definition at line 1738 of file cons_sdp.c.

References separateSol().

static SCIP_DECL_CONSSEPALP ( consSepalpSdp  )
static

separation method of constraint handler for LP solution

Definition at line 1755 of file cons_sdp.c.

References separateSol().

static SCIP_DECL_CONSDELETE ( consDeleteSdp  )
static

delete method of SDP constrainthandler

Definition at line 1772 of file cons_sdp.c.

static SCIP_DECL_CONSFREE ( consFreeSdp  )
static

free method of SDP constrainthandler

Definition at line 1809 of file cons_sdp.c.

static SCIP_DECL_CONSHDLRCOPY ( conshdlrCopySdp  )
static

copy an SDP constraint handler

Definition at line 1824 of file cons_sdp.c.

References CONSHDLR_NAME, and SCIPincludeConshdlrSdp().

static SCIP_DECL_CONSCOPY ( consCopySdp  )
static

copy an SDP constraint

Definition at line 1839 of file cons_sdp.c.

References CONSHDLR_NAME, fixAndAggrVars(), and SCIPcreateConsSdp().

static SCIP_DECL_CONSPRINT ( consPrintSdp  )
static

print an SDP constraint

Definition at line 1903 of file cons_sdp.c.

static SCIP_DECL_CONSPARSE ( consParseSdp  )
static

parse an SDP constraint

Definition at line 2029 of file cons_sdp.c.

References PARSE_SIZEFACTOR, PARSE_STARTSIZE, and setMaxRhsEntry().

static SCIP_DECL_CONSGETVARS ( consGetVarsSdp  )
static

constraint method of constraint handler which returns the variables (if possible)

Definition at line 2217 of file cons_sdp.c.

static SCIP_DECL_CONSGETNVARS ( consGetNVarsSdp  )
static

constraint method of constraint handler which returns the number of variables (if possible)

Definition at line 2251 of file cons_sdp.c.

SCIP_RETCODE SCIPincludeConshdlrSdp ( SCIP *  scip)

creates the handler for SDP constraints and includes it in SCIP

Parameters
scipSCIP data structure

Definition at line 2270 of file cons_sdp.c.

References CONSHDLR_CHECKPRIORITY, CONSHDLR_DELAYSEPA, CONSHDLR_DESC, CONSHDLR_EAGERFREQ, CONSHDLR_ENFOPRIORITY, CONSHDLR_MAXPREROUNDS, CONSHDLR_NAME, CONSHDLR_NEEDSCONS, CONSHDLR_PRESOLTIMING, CONSHDLR_SEPAFREQ, and CONSHDLR_SEPAPRIORITY.

Referenced by runSCIP(), and SCIP_DECL_CONSHDLRCOPY().

SCIP_RETCODE SCIPconsSdpGetData ( SCIP *  scip,
SCIP_CONS *  cons,
int *  nvars,
int *  nnonz,
int *  blocksize,
int *  arraylength,
int *  nvarnonz,
int **  col,
int **  row,
SCIP_Real **  val,
SCIP_VAR **  vars,
int *  constnnonz,
int *  constcol,
int *  constrow,
SCIP_Real *  constval 
)

get the data belonging to a single SDP-constraint

In arraylength the length of the nvarnonz, col, row and val arrays has to be given, if it is not sufficient to store all block-pointers that need to be inserted, a debug message will be thrown and this variable will be set to the needed length. constnnonz should give the length of the const arrays, if it is too short it will also give the needed number and a debug message is thrown.

Parameters
scipSCIP data structure
consSDP constraint to get data of
nvarspointer to store the number of variables in this SDP constraint
nnonzpointer to store the number of nonzeros in this SDP constraint
blocksizepointer to store the size of this SDP-block
arraylengthlength of the given nvarnonz, col, row and val arrays, if this is too short this will return the needed length
nvarnonzpointer to store the number of nonzeros for each variable, also length of the arrays col/row/val are pointing to
colpointer to store the column indices of the nonzeros for each variable
rowpointer to store the row indices of the nonzeros for each variable
valpointer to store the values of the nonzeros for each variable
varspointer to store the SCIP variables present in this constraint that correspond to the indices in col/row/val
constnnonzpointer to store the number of nonzeros in the constant part of this SDP constraint, also length of the const arrays
constcolpointer to store the column indices of the constant nonzeros
constrowpointer to store the row indices of the constant nonzeros
constvalpointer to store the values of the constant nonzeros

Definition at line 2319 of file cons_sdp.c.

Referenced by putSdpDataInInterface().

SCIP_RETCODE SCIPconsSdpGetNNonz ( SCIP *  scip,
SCIP_CONS *  cons,
int *  nnonz,
int *  constnnonz 
)

gets the number of nonzeros and constant nonzeros for this SDP constraint

Either nnonz or constnnonz may be NULL if only the other one is needed.

Parameters
scipSCIP data structure
consSDP constraint to get data of
nnonzpointer to store the number of nonzeros in this SDP constraint
constnnonzpointer to store the number of nonzeros in the constant part of this SDP constraint

Definition at line 2415 of file cons_sdp.c.

Referenced by putSdpDataInInterface().

SCIP_RETCODE SCIPconsSdpGetFullAj ( SCIP *  scip,
SCIP_CONS *  cons,
int  j,
SCIP_Real *  Aj 
)

gets the full constraint Matrix $ A_j $ for a given variable j

Parameters
scipSCIP data structure
consSDP constraint to get data of
jthe variable j to get the corresponding matrix $ A_j $ for
Ajpointer to store the full matrix $ A_j $

Definition at line 2440 of file cons_sdp.c.

Referenced by SCIP_DECL_CONSLOCK().

SCIP_RETCODE SCIPconsSdpGetFullConstMatrix ( SCIP *  scip,
SCIP_CONS *  cons,
SCIP_Real *  mat 
)

gives an n*n-long array with the full constant matrix

Parameters
scipSCIP data structure
consSDP constraint to get data of
matpointer to store the full constant matrix

Definition at line 2475 of file cons_sdp.c.

Referenced by cutUsingEigenvector().

SCIP_RETCODE SCIPconsSdpGetLowerTriangConstMatrix ( SCIP *  scip,
SCIP_CONS *  cons,
SCIP_Real *  mat 
)

gives a 0.5*n*(n+1)-long array with the lower triangular part of the constant matrix indexed by compLowerTriangPos

Parameters
scipSCIP data structure
consSDP constraint to get data of
matpointer to store the lower triangular part of the constant matrix

Definition at line 2509 of file cons_sdp.c.

References compLowerTriangPos().

Referenced by diagGEzero().

SCIP_RETCODE SCIPconsSdpGuessInitialPoint ( SCIP *  scip,
SCIP_CONS *  cons,
SCIP_Real *  lambdastar 
)

Compute a heuristic guess for a good starting solution $ \lambda ^* \cdot I $.

The solution is computed as

\[ \lambda^* = \max \Bigg\{S \cdot \max_{i \in [m]} \{|u_i|, |l_i|\} \cdot \max_{i \in [m]} \|A_i\|_\infty + \|C\|_\infty, \frac{\max_{i \in [m]} b_i}{S \cdot \min_{i \in [m]} \min_{j, \ell \in [n]} (A_i)_{j\ell} } \Bigg\}, \]

where $ S = \frac{ | \text{nonzero-entries of all } A_i | }{0.5 \cdot \text{ blocksize } (\text{ blocksize } + 1)} $ measures the sparsity of the matrices.

Parameters
scipSCIP data structure
consthe constraint for which the Matrix should be assembled
lambdastarpointer to store the guess for the initial point

Definition at line 2548 of file cons_sdp.c.

References CONSHDLR_NAME.

Referenced by SCIP_DECL_RELAXINITSOL().

SCIP_RETCODE SCIPcreateConsSdp ( SCIP *  scip,
SCIP_CONS **  cons,
const char *  name,
int  nvars,
int  nnonz,
int  blocksize,
int *  nvarnonz,
int **  col,
int **  row,
SCIP_Real **  val,
SCIP_VAR **  vars,
int  constnnonz,
int *  constcol,
int *  constrow,
SCIP_Real *  constval 
)

creates an SDP-constraint

Parameters
scipSCIP data structure
conspointer to hold the created constraint
namename of constraint
nvarsnumber of variables in this SDP constraint
nnonznumber of nonzeros in this SDP constraint
blocksizesize of this SDP-block
nvarnonznumber of nonzeros for each variable, also length of the arrays col/row/val point to
colpointer to column indices of the nonzeros for each variable
rowpointer to row indices of the nonzeros for each variable
valpointer to values of the nonzeros for each variable
varsSCIP_VARiables present in this SDP constraint that correspond to the indices in col/row/val
constnnonznumber of nonzeros in the constant part of this SDP constraint
constcolcolumn indices of the constant nonzeros
constrowrow indices of the constant nonzeros
constvalvalues of the constant nonzeros

Definition at line 2634 of file cons_sdp.c.

References setMaxRhsEntry().

Referenced by SCIP_DECL_CONSCOPY(), and scip::ObjReaderSDPA::scip_read().