Matrices C and Ai are assumed to be block diagonal structured, and must be specified that way (see Details).
Description
Interface to CSDP semidefinite programming library. The general statement of the primal problem is
maxtr(CX)maxtr(CX)s.t.A(X)=bs.t.A(X)=bX⪰0X>=0
with A(X)i=tr(AiX)
where X>=0 means X is positive semidefinite, C and all Ai are symmetric matrices of the same size and b is a vector of length m.
The dual of the problem is
minb′yminb′ys.t.A′(y)−C=Zs.t.A′(y)−C=ZZ⪰0Z>=0
where A′(y)=∑i=1myiAi.
Matrices C and Ai are assumed to be block diagonal structured, and must be specified that way (see Details).
csdp(C, A, b, K,control=csdp.control())
Arguments
C: A list defining the block diagonal cost matrix C.
A: A list of length m containing block diagonal constraint matrices Ai. Each constraint matrix Ai is specified by a list of blocks as explained in the Details section.
b: A numeric vector of length m containing the right hand side of the constraints.
K: Describes the domain of each block of the sdp problem. It is a list with the following elements:
type:: A character vector with entries "s" or "l" indicating the type of each block. If the jth entry is "s", then the jth block is a positive semidefinite matrix. otherwise, it is a vector with non-negative entries.
size:: A vector of integers indicating the dimension of each block.
control: Control parameters passed to csdp. See CSDP documentation.
Details
All problem matrices are assumed to be of block diagonal structure, and must be specified as follows:
If there are nblocks blocks specified by K, then the matrix must be a list with nblocks components.
If K$type == "s" then the jth element of the list must define a symmetric matrix of size K$size. It can be an object of class "matrix", "simple_triplet_sym_matrix", or a valid class from the class hierarchy in the "Matrix" package.
If K$type == "l" then the jth element of the list must be a numeric vector of length K$size.
This function checks that the blocks in arguments C and A agree with the sizes given in argument K. It also checks that the lengths of arguments b and A
are equal. It does not check for symmetry in the problem data.
csdp_minimal is a minimal wrapper to the C code underlying csdp. It assumes that the arguments sum.block.sizes, nconstraints, nblocks, block.types, and block.sizes
are provided as if they were created by Rcsdp:::prob.info and that the arguments C, A, and b are provided as if they were created by Rcsdp:::prepare.data. This function may be useful when calling the csdp functionality iteratively and most of the optimization details stays the same. For example, when the control file created by Rcsdp:::write.control.file stays the same across iterations, but it would be recreated on each iteration by csdp.
Returns
X: Optimal primal solution X. A list containing blocks in the same structure as explained above. Each element is of class "matrix" or a numeric vector as appropriate.
Z: Optimal dual solution Z. A list containing blocks in the same structure as explained above. Each element is of class "matrix"
or a numeric vector as appropriate.
y: Optimal dual solution y. A vector of the same length as argument b
pobj: Optimal primal objective value
dobj: Optimal dual objective value
status: Status of returned solution.
0:: Success. Problem solved to full accuracy
1:: Success. Problem is primal infeasible
2:: Success. Problem is dual infeasible
3:: Partial Success. Solution found but full accuracy was not achieved
4:: Failure. Maximum number of iterations reached
5:: Failure. Stuck at edge of primal feasibility
6:: Failure. Stuch at edge of dual infeasibility
7:: Failure. Lack of progress
8:: Failure. X or Z (or Newton system O) is singular