Semidefinite Blocks (Advanced Data)


Detailed Description

Less frequently used routines to set data into the SDPCone object and operate on the variables.

#include dsdp5.h 

In DSDP Standard Form, a semidefinite program is given by the pair of problems

\[ \begin{array}{llllllllll} (P) \ \ \ & \mbox{minimize} & {\displaystyle \sum_{j=0}^{n_b-1} C_j \bullet X_j } &\mbox{subject to}& {\displaystyle \sum_{j=0}^{n_b-1} A_{i,j} \bullet X_{j} = b_i } ,& i=1,\ldots, m, & & X_j \succeq 0, \\ \end{array} \]

\[ \begin{array}{lllllllll} (D) \ \ \ & \mbox{maximize} & {\displaystyle \sum_{i=1}^m b_i \ y_i } &\mbox{subject to}&{\displaystyle \sum_{i=1}^m A_{i,j}y_i + S_{j} } = C_{j}, & j=0, \ldots, n_b-1, & S_j \succeq 0 \\ \end{array} \]

where the data $A_{i,j}$ and $C_j$ are symmetric matrices of the same dimension and the inner product of two $n \times n$ matrices $C=(c_{k,l})$ and $X=(x_{k,l})$ is defined by $ C \bullet X := trace (C^T X) = \sum_{k,l}c_{k,l} x_{k,l} $.

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 $ A_{0,j}$.

Return values:
0 if successful


Functions

int SDPConeAddADenseVecMat (SDPCone sdpcone, int blockj, int vari, int n, double alpha, double val[], int nnz)
 Add a matrix $A_{i,j}$ in a dense format.
int SDPConeAddARankOneMat (SDPCone sdpcone, int blockj, int vari, int n, double alpha, int ishift, const int ind[], const double val[], int nnz)
 Add data matrix $A_{i,j}= alpha * v * v^T $ where v is a sparse vector.
int SDPConeAddASparseVecMat (SDPCone sdpcone, int blockj, int vari, int n, double alpha, int ishift, const int ind[], const double val[], int nnz)
 Add data matrix $A_{i,j}$ in a sparse format.
int SDPConeAddConstantMat (SDPCone sdpcone, int blockj, int vari, int n, double value)
 Add a matrix $A_{i,j}$ whose elements are all the same.
int SDPConeAddDataMatrix (SDPCone sdpcone, int blockj, int vari, int n, char format, struct DSDPDataMat_Ops *dsdpdataops, void *data)
 Add a data matrix $A_{i,j}$.
int SDPConeAddIdentity (SDPCone sdpcone, int blockj, int vari, int n, double val)
 Add a matrix $A_{i,j}$ that is a multiple of the identity matrix.
int SDPConeCheckData (SDPCone sdpcone)
 Check the matrix operations on a data matrix;.
int SDPConeGetStorageFormat (SDPCone sdpcone, int blockj, char *format)
 Get the storage format for the block.
int SDPConeRemoveDataMatrix (SDPCone sdpcone, int blockj, int vari)
 Remove the data matrix $A_{i,j}$ from the cone.
int SDPConeSetARankOneMat (SDPCone sdpcone, int blockj, int vari, int n, double alpha, int ishift, const int ind[], const double val[], int nnz)
 Set data matrix $A_{i,j}= alpha * v * v^T $ where v is a sparse vector.
int SDPConeSetConstantMat (SDPCone sdpcone, int blockj, int vari, int n, double value)
 Set a matrix $A_{i,j}$ whose elements are all the same.
int SDPConeSetIdentity (SDPCone sdpcone, int blockj, int vari, int n, double val)
 Set a matrix $A_{i,j}$ to be a multiple of the identity matrix.
int SDPConeSetStorageFormat (SDPCone sdpcone, int blockj, char format)
 Set the dense storage format of a block in the semidefinite cone.
int SDPConeSetZeroMat (SDPCone sdpcone, int blockj, int vari, int n)
 Set a matrix $A_{i,j}$ whose elements are all equal zero.
int SDPConeUseFullSymmetricFormat (SDPCone sdpcone, int blockj)
 Use full symmetric format for the dense array.
int SDPConeUsePackedFormat (SDPCone sdpcone, int blockj)
 Use packed symmetric format for the dense array.
int SDPConeView2 (SDPCone sdpcone)
 Print the SDP cone to the screen in a second way.
int SDPConeView3 (SDPCone sdpcone)
 Print the SDP cone to the screen in a third way.


Function Documentation

int SDPConeAddADenseVecMat ( SDPCone  sdpcone,
int  blockj,
int  vari,
int  n,
double  alpha,
double  val[],
int  nnz 
)

Add a matrix $A_{i,j}$ in a dense format.

Parameters:
sdpcone SDP cone
blockj block number j from 0 to nblocks
vari variable i from 0 through m
n dimension of the matrix
alpha multiple of data (usually 1.0)
val array of elements in the matrix
nnz length of the previous two arrays
Note:
DSDP will use the val array in many routines, but it will not modify or delete it until finished with DSDP.
The matrix
img208.gif
can be inserted into the cone in symmetric packed format as follows
double val[]={3,2,0,0,6,0};
SDPConeAddADenseVecMat(sdpcone,j,i,3,1.0,val,6);

See also:
SDPConeViewDataMatrix()

SDPConeSetASparseVecMat()

SDPConeSetADenseVecMat()

Definition at line 203 of file dsdpadddatamat.c.

Referenced by SDPConeSetADenseVecMat().

int SDPConeAddARankOneMat ( SDPCone  sdpcone,
int  blockj,
int  vari,
int  n,
double  alpha,
int  ishift,
const int  ind[],
const double  val[],
int  nnz 
)

Add data matrix $A_{i,j}= alpha * v * v^T $ where v is a sparse vector.

Parameters:
sdpcone SDP cone
blockj block number j from 0 to nblocks
vari variable i from 0 through m
n dimension of the matrix
alpha multiple of the outer product
ishift index of first element in a dense vector (usually 0)
val array of elements in the vector
ind array of indices representing the location of the nonzeros
nnz length of the previous two arrays
Note:
DSDP will use the two arrays throughout in many routines, but it will not modify or delete them.
See also:
DSDPCreateSDPCone()

SDPConeViewDataMatrix()

SDPConeAddASparseVecMat()

Definition at line 478 of file dsdpadddatamat.c.

Referenced by SDPConeSetARankOneMat(), and SetStableSetData().

int SDPConeAddASparseVecMat ( SDPCone  sdpcone,
int  blockj,
int  vari,
int  n,
double  alpha,
int  ishift,
const int  ind[],
const double  val[],
int  nnz 
)

Add data matrix $A_{i,j}$ in a sparse format.

Parameters:
sdpcone SDP cone
blockj block number j from 0 to nblocks
vari variable i from 0 through m
n dimension of the matrix
ishift index of first element (usually 0)
alpha multiple of the data (usually 1)
val array of elements in the matrix
ind array of indices representing the location of the elements
nnz length of the previous two arrays
Note:
DSDP will use the two arrays throughout in many routines, but it will not modify or delete them until finished with DSDP.
See also:
DSDPCreateSDPCone()

SDPConeGetStorageFormat()

SDPConeViewDataMatrix()

SDPConeSetBlockSize()

Definition at line 49 of file dsdpadddatamat.c.

Referenced by MaxCut(), SDPConeSetASparseVecMat(), and SetStableSetData().

int SDPConeAddConstantMat ( SDPCone  sdpcone,
int  blockj,
int  vari,
int  n,
double  value 
)

Add a matrix $A_{i,j}$ whose elements are all the same.

Parameters:
sdpcone SDP cone
blockj block number j from 0 to nblocks
vari variable i from 0 through m
n dimension of the matrix
value the value of each element in the matrix
See also:
SDPConeAddADenseVecMat()

Definition at line 356 of file dsdpadddatamat.c.

Referenced by SDPConeSetConstantMat().

int SDPConeAddDataMatrix ( SDPCone  sdpcone,
int  blockj,
int  vari,
int  n,
char  format,
struct DSDPDataMat_Ops dsdpdataops,
void *  data 
)

Add a data matrix $A_{i,j}$.

Parameters:
sdpcone SDP cone
blockj block number j from 0 to nblocks
vari variable i from 0 through m
n dimension of the matrix
format storage format 'P' (default) or 'U'
data address of a structure ( cast to void* ) with matrix data.
dsdpdataops address of a structure of function pointers that operate on the matrix data
See also:
SDPConeSetASparseVecMat()

SDPConeSetStorageFormat()

SDPConeSetBlockSize()

SDPConeCheckData()

Definition at line 154 of file dsdpadddata.c.

Referenced by SDPConeAddADenseVecMat(), SDPConeAddARankOneMat(), SDPConeAddASparseVecMat(), SDPConeAddConstantMat(), SDPConeAddIdentity(), SDPConeSetZeroMat(), and SetThetaData().

int SDPConeAddIdentity ( SDPCone  sdpcone,
int  blockj,
int  vari,
int  n,
double  val 
)

Add a matrix $A_{i,j}$ that is a multiple of the identity matrix.

Parameters:
sdpcone SDP cone
blockj block number j from 0 to nblocks
vari variable i from 0 through m
n dimension of the matrix
val multiple of identity matrix
See also:
SDPConeAddASparseVecMat()

Definition at line 299 of file dsdpadddatamat.c.

Referenced by SDPConeSetIdentity().

int SDPConeCheckData ( SDPCone  sdpcone  ) 

Check the matrix operations on a data matrix;.

Parameters:
sdpcone the cone
See also:
SDPConeView

Definition at line 692 of file dsdpadddata.c.

Referenced by LovaszTheta(), ReadSDPAFile(), and StableSet().

int SDPConeGetStorageFormat ( SDPCone  sdpcone,
int  blockj,
char *  format 
)

Get the storage format for the block.

Parameters:
sdpcone semidefinite cone object
blockj block number
format format the block
See also:
SDPConeSetStorageFormat()

SDPConeGetXArray()

SDPConeSetASparseVecMat()

SDPConeSetADenseVecMat()

The default format is 'P' (packed symmetric format).

Definition at line 505 of file dsdpadddata.c.

Referenced by DSDPPrintData(), DSDPPrintSolution(), SDPConeAddADenseVecMat(), SDPConeAddADotX(), SDPConeAddARankOneMat(), SDPConeAddASparseVecMat(), SDPConeAddConstantMat(), SDPConeAddIdentity(), SDPConeComputeS(), SDPConeComputeX(), SDPConeSetRIdentity(), SDPConeSetXArray(), SDPConeSetXMat(), SDPConeSetZeroMat(), and SDPConeViewX().

int SDPConeRemoveDataMatrix ( SDPCone  sdpcone,
int  blockj,
int  vari 
)

Remove the data matrix $A_{i,j}$ from the cone.

Parameters:
sdpcone SDP cone
blockj block number j from 0 to nblocks
vari variable i from 0 through m
See also:
SDPConeView()

Definition at line 127 of file dsdpadddata.c.

Referenced by SDPConeSetADenseVecMat(), SDPConeSetARankOneMat(), SDPConeSetASparseVecMat(), SDPConeSetConstantMat(), SDPConeSetIdentity(), and SDPConeSetZeroMat().

int SDPConeSetARankOneMat ( SDPCone  sdpcone,
int  blockj,
int  vari,
int  n,
double  alpha,
int  ishift,
const int  ind[],
const double  val[],
int  nnz 
)

Set data matrix $A_{i,j}= alpha * v * v^T $ where v is a sparse vector.

Parameters:
sdpcone SDP cone
blockj block number j from 0 to nblocks
vari variable i from 0 through m
n dimension of the matrix
alpha multiple of the outer product
ishift index of first element in a dense vector (usually 0)
val array of elements in the vector
ind array of indices representing the location of the nonzeros
nnz length of the previous two arrays
Note:
DSDP will use the two arrays throughout in many routines, but it will not modify or delete them.
See also:
SDPConeViewDataMatrix()

SDPConeAddARankOneMat()

Definition at line 519 of file dsdpadddatamat.c.

int SDPConeSetConstantMat ( SDPCone  sdpcone,
int  blockj,
int  vari,
int  n,
double  value 
)

Set a matrix $A_{i,j}$ whose elements are all the same.

Parameters:
sdpcone SDP cone
blockj block number j from 0 to nblocks
vari variable i from 0 through m
n dimension of the matrix
value the value of each element in the matrix
See also:
SDPConeSetADenseVecMat()

Definition at line 391 of file dsdpadddatamat.c.

Referenced by mexFunction(), and ReadSDPAFile().

int SDPConeSetIdentity ( SDPCone  sdpcone,
int  blockj,
int  vari,
int  n,
double  val 
)

Set a matrix $A_{i,j}$ to be a multiple of the identity matrix.

Parameters:
sdpcone SDP cone
blockj block number j from 0 to nblocks
vari variable i from 0 through m
n dimension of the matrix
val multiple of identity matrix
See also:
SDPConeAddASparseVecMat()

Definition at line 334 of file dsdpadddatamat.c.

int SDPConeSetStorageFormat ( SDPCone  sdpcone,
int  blockj,
char  format 
)

Set the dense storage format of a block in the semidefinite cone.

Parameters:
sdpcone semidefinite cone object
blockj block number
format format the block
See also:
SDPConeGetStorageFormat()

SDPConeUsePackedFormat()

SDPConeUseFullSymmetricFormat()

This routine determines the ordering of elements in the data matrices and the X matrix. The default format is 'P' (packed symmetric format), but the full symmetric format 'U' is also supported. The format used to factor the S matrix is independent of the format used for the data and X matrix.

Definition at line 479 of file dsdpadddata.c.

Referenced by ReadSDPAFile(), SDPConeUseFullSymmetricFormat(), and SDPConeUsePackedFormat().

int SDPConeSetZeroMat ( SDPCone  sdpcone,
int  blockj,
int  vari,
int  n 
)

Set a matrix $A_{i,j}$ whose elements are all equal zero.

Parameters:
sdpcone SDP cone
blockj block number j from 0 to nblocks
vari variable i from 0 through m
n dimension of the matrix
See also:
SDPConeSetASparseVecMat()

SDPConeSetConstantMat()

Definition at line 414 of file dsdpadddatamat.c.

int SDPConeUseFullSymmetricFormat ( SDPCone  sdpcone,
int  blockj 
)

Use full symmetric format for the dense array.

Parameters:
sdpcone semidefinite cone object
blockj block number
See also:
SDPConeGetXArray()

SDPConeSetASparseVecMat()

SDPConeSetADenseVecMat()

SDPConeSetStorageFormat()

SDPConeUsePackedFormat()

SDPConeCheckData()

In this format, an $n \times n$ symmetric matrix is represented by an array of length $ n^2 $. Each element of the array corresponds to an element of the matrix and the mapping is given below.

\[ \begin{array}{lllllllllll} [ a_{1,1} & \ldots & a_{1,n} & a_{2,1} & \ldots & a_{2,n} & \ldots & a_{n,1} & \ldots & a_{n,n} ] \\ \end{array} \]

but elements $a_{i,j}, i<j $ are not used.

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.

Note:
Since DSDP uses BLAS and LAPACK for many of its operations, we refer to the half of matrix in use as the 'upper' triangular matrix.

Definition at line 414 of file dsdpadddata.c.

int SDPConeUsePackedFormat ( SDPCone  sdpcone,
int  blockj 
)

Use packed symmetric format for the dense array.

Parameters:
sdpcone semidefinite cone object
blockj block number
See also:
SDPConeGetXArray()

SDPConeSetASparseVecMat()

SDPConeSetADenseVecMat()

In this format, an $n \times n$ symmetric matrix is represented by an array of length $\frac{n(n+1)}{2}$. Each element of the array corresponds to an element of the matrix and the mapping is given below.

\[ \begin{array}{llllllll} [ a_{1,1} & a_{2,1} & a_{2,2} & a_{3,1} & a_{3,2} & a_{3,3} & \ldots & a_{n,n} ] \\ \end{array} \]

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.

Note:
Since DSDP uses BLAS and LAPACK for many of its operations, we refer to the half of matrix in use as the 'upper' triangular matrix.

Definition at line 452 of file dsdpadddata.c.

Referenced by LovaszTheta(), mexFunction(), and StableSet().

int SDPConeView2 ( SDPCone  sdpcone  ) 

Print the SDP cone to the screen in a second way.

Parameters:
sdpcone the cone
See also:
SDPConeViewDataMatrix()

SDPConeView()

SDPConeView3()

Definition at line 637 of file dsdpadddata.c.

Referenced by ReadSDPAFile().

int SDPConeView3 ( SDPCone  sdpcone  ) 

Print the SDP cone to the screen in a third way.

Parameters:
sdpcone the cone
See also:
SDPConeViewDataMatrix()

SDPConeView()

SDPConeView2()

Definition at line 657 of file dsdpadddata.c.


Generated on Wed May 21 19:31:20 2008 for DSDP by  doxygen 1.5.5