#include dsdp5.h
In DSDP Standard Form, a semidefinite program is given by the pair of problems
where the data and
are symmetric matrices of the same dimension and the inner product of two
matrices
and
is defined by
.
Blocks are labelled from 0 to nblocks, where nblocks is the total number of blocks in the SDPCone object.
Variables y are numbered 1 through m. Variable 0 designates the C matrices, which are also denoted .
By default, this cone represents symmetric matrices in packed symmetric format. This format uses an array of length
and orders the the elements of the matrix as follows:
0 | if successful |
Functions | |
int | DSDPCreateSDPCone (DSDP, int, SDPCone *) |
Create a semidefinite matrix cone with one or more blocks. | |
int | SDPConeGetXArray (SDPCone sdpcone, int blockj, double *xx[], int *nn) |
After applying the solver, set a pointer to the array in the object with the solution X. | |
int | SDPConeSetADenseVecMat (SDPCone sdpcone, int blockj, int vari, int n, double alpha, double val[], int nnz) |
Set a matrix ![]() | |
int | SDPConeSetASparseVecMat (SDPCone sdpcone, int blockj, int vari, int n, double alpha, int ishift, const int ind[], const double val[], int nnz) |
Set data matrix ![]() | |
int | SDPConeViewDataMatrix (SDPCone sdpcone, int blockj, int vari) |
Print a data matrix to the screen. | |
int | SDPConeViewX (SDPCone sdpcone, int blockj, int n, double x[], int nn) |
Print a dense array X to the screen. |
|
Create a semidefinite matrix cone with one or more blocks.
Definition at line 113 of file sdpconesetup.c. Referenced by LovaszTheta(), MaxCut(), mexFunction(), MinColoring(), ReadSDPAFile(), and StableSet(). |
|
After applying the solver, set a pointer to the array in the object with the solution X.
DSDP dsdp; SDPCone sdpcone; double *xx; int nn; DSDPSolve(dsdp); DSDPComputeX(dsdp); SDPConeGetXArray(sdpcone,0,&xx,&nn); SDPConeViewX(sdpcone,0,xx,nn); SDPConeRestoreXArray(sdpcone,0,&xx,&nn); DSDP uses a single dense array to add data matrices, compute the matrix X, and take the inner product of X with the data matrices. Therefore, the ordering of elements in this array must also be used in the data matrices. Definition at line 328 of file dsdpadddata.c. Referenced by DSDPPrintData(), DSDPPrintSolution(), LovaszTheta(), MaxCut(), and StableSet(). |
|
Set a matrix
![]() double val[]={3,2,0,0,6,0};
SDPConeSetDenseAVecMat(sdpcone,j,i,3,1.0,val,6);
Definition at line 265 of file dsdpadddatamat.c. Referenced by mexFunction(), and ReadSDPAFile(). |
|
Set data matrix
![]()
Using the ordering of the packed symmetric format, we can index each element of the matrix with an integer between 0 and n(n+1)/2-1 (inclusive). If the first element in the double val1[]={3,2,6}; int ind1[]={0,1,4}; SDPConeSetASparseVecMat(sdpcone,j,i,3,1.0,0,ind1,val1,3); double val2[]={3,2,6}; int ind2[]={1,2,5}; SDPConeSetASparseVecMat(sdpcone,j,i,3,1.0,1,ind2,val2,3); double val3[]={6,3,0,2}; int ind3[]={4,0,2,1}; SDPConeSetASparseVecMat(sdpcone,j,i,3,1.0,0,ind3,val3,4); double val1[]={6,4,12}; int ind1[]={0,1,4}; SDPConeSetASparseVecMat(sdpcone,j,i,3,0.5,0,ind1,val1,3);
Definition at line 152 of file dsdpadddatamat.c. Referenced by MaxCut(), mexFunction(), MinColoring(), ReadSDPAFile(), and SetStableSetData(). |
|
Print a data matrix to the screen.
Definition at line 205 of file dsdpadddata.c. Referenced by MaxCut(), ReadSDPAFile(), and SetStableSetData(). |
|
Print a dense array X to the screen.
|