DSDPCreateSDPCone(DSDP dsdp,int nblocks,SDPCone *newsdpcone)can be used to create a new object that describes a semidefinite cone with
All subroutines that pass data to the semidefinite cone use this SDPCone variable
in the first argument. The second argument often refers to a specific block. The
blocks will be labeled from to nblocks-1.
The subroutine
SDPConeSetBlockSize(SDPCone sdpcone, int blockj, int n) can be used
to specify the dimension of each block and
the subroutine
SDPConeSetSparsity( SDPCone sdpcone, int blockj, int nnzmat) can be
used to specify the number of nonzero matrices
in each block. These subroutines are optional, but using them can improve
error checking on the data matrices and perform a more efficient allocation of memory.
The data matrices can be specified by any of the following commands. The choice of
data structures is up to the user, and the performance of the problem depends upon this
choice of data structures. In each of these subroutines, the first four arguments are
a pointer to the SDPCone object, the block number, and the number of variable associated with it,
and the number of rows and columns in the matrix. The blocks
must be numbered consecutively, beginning with the number . The
variables are numbered
consecutively from
to
. The objective matrices in (P)
are specified as
constraint number
. The data that is passed to the
SDPCone
object will be used in the solver,
but not modified. The user is responsible for freeing the arrays of data
it passes to DSDP
after solving the problem.
The square symmetric data matrices and
can be represented with a single
array of numbers. DSDP supports the symmetric packed storage format.
In symmetric packaged storage format,
the elements of a matrix with
rows and columns
are ordered as follows:
This array can be passed to the solver using the subroutine
SDPConeSetDenseVecMat(SDPCone sdpcone,int blockj, int vari, int n, const double val[], int nnz);The first argument point to a semidefinite cone object, the second argument specifies the block number
DSDP
will directly access this array in the course of the solving the problem, so it should not
be freed until the solver is finished.
A matrix can be passed to the solver in sparse format using the subroutine
SDPConeSetSparseVecMat(SDPCone sdpcone,int blockj, int vari, int n, int ishift const int ind[], const double val[], int nnz);In this subroutine, the first four arguments are the same as in the subroutine for dense matrices. The sixth and seventh arguments are an array an integers and an array of double precision variables. The final argument states the length of these two arrays, which should equal the number of nonzeros in the lower triangular part of the matrix. The array of integers specifies which elements of the array (9) are included in the array of doubles. For example, the matrix
SDPConeSetSparseVecMat(sdpcone,j,i,3,0,ind1,val1,3); SDPConeSetSparseVecMat(sdpcone,j,i,3,1,ind2,val2,3); SDPConeSetSparseVecMat(sdpcone,j,i,3,3,ind3,val3,4);where
As these examples suggest, there are many other ways to represent the sparse matrix.
The nonzeros in the
matrix do not have to be ordered, but ordering them may improve the efficiency of the solver.
DSDP
assumes that all matrices and
that are not explicitly defined
and passed to the SDPCone structure will equal the zero matrix.
To check whether the matrix passed into the cone matches the one intended, the subroutine
SDPConeViewDataMatrix(SDPCone sdpcone,int blockj, int vari)can be used to print out the the matrix to the screen. The output prints the row and column numbers, indexed from
After the DSDP solver has been applied to the data and the solution matrix
have been computed (See DSDPComputeX(), the matrix can be accessed using the command
SDPConeGetXArray(SDPCone sdpcone, int blockj, double *xmat[], int *nn);The third argument is the address of a pointer that will be set to the array containing the solution. The integer whose address is passed in the fourth argument will be set to the length of this array,
DSDP
solver object when it is destroyed.
The array used to store SDPConeComputeX(SDPCone sdpcone, int blockj, int n, double xmat[], int nn)recomputes the matrix
The dimension of each block can be found using the routine
SDPConeGetBlockSize(SDPCone sdpcone, int blockj, int *n)where the second arguments is the block number and the third arguments are the address of a variable.
The matrix in (D) can be computed and copied into an array using the
command
SDPConeComputeS(SDPCone sdpcone, int blockj, double c, double y[], int m, double r, int n, double smat[], int nn);The second argument specifies which block to use, the fourth argument is an array containing the variables
The memory required for the matrix can be significant for large problems. If the application
has an array of double precision variables of length
available for use by the solver,
the subroutine
SDPConeSetXArray(SDPCone sdpcone,int blockj, int n, double xmat[], int nn)can be used to pass it to the cone. The second argument specifies the block number whose solution will be placed into the array xmat. The third argument is the dimension of the block. The dimension specified in the fifth argument nn refers to the length of the array. The
DSDP
solver
will use this array as a buffer for its computations and store the solution
DSDP also supports the symmetric full storage format.
In symmetric full storage format,
an matrix is stored in an array of
elements in row major order.
That is, the elements of a matrix with
rows and columns are ordered
DSDP5
used the packed format exclusively,
but this format has been added because its more convenient for some applications. The routines
SDPConeSetStorageFormat(SDPCone sdpcone,int blockj, char UPLQ) SDPConeGetStorageFormat(SDPCone sdpcone, int blockj, char *UPLQ)set and get the storage format for a block. The second argument specifies the block number and the third argument should be 'P' for packed storage format and 'U' for full storage format. The default value is 'P'. These storage formats correspond the LAPACK storage formats for the upper half matrices in column major ordering. All of the above commands apply to the symmetric full storage format. One difference in their use, however, is that the size of the arrays in the arguments should be
SDPConeSetSparseVecMat(sdpcone,j,i,3,0,ind1,val1,3);where