csdp {Rcsdp} | R Documentation |
Interface to CSDP semidefinite programming library. The general statement of the primal problem is
max tr(CX)
s.t. A(X) = b
X >= 0
with A(X)_i = tr(A_iX) where X >= 0 means X is positive semidefinite, C and all A_i are symmetric matrices of the same size and b is a vector of length m.
The dual of the problem is
min b'y
s.t. A'(y) - C = Z
Z >= 0
where A'(y) = ∑_{i=1}^m y_i A_i.
Matrices C and A_i are assumed to be block diagonal structured, and must be specified that way (see Details).
csdp(C, A, b, K,control=csdp.control())
C |
A list defining the block diagonal cost matrix C. |
A |
A list of length m containing block diagonal constraint matrices A_i. Each constraint matrix A_i is specified by a list of blocks as explained in the Details section. |
b |
A numeric vector of length m containg 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:
|
control |
Control parameters passed to csdp. See CSDP documentation. |
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 j
th 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 j
th 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.
X |
Optimal primal solution X. A list containing blocks in the
same structure as explained above. Each element is of class
|
Z |
Optimal dual solution Z. A list containing blocks in the same
structure as explained above. Each element is of class
|
y |
Optimal dual solution y. A vector of the same length as
argument |
pobj |
Optimal primal objective value |
dobj |
Optimal dual objective value |
status |
Status of returned solution.
|
Hector Corrada Bravo. CSDP written by Brian Borchers.
Borchers, B.:
CSDP, A C Library for Semidefinite Programming Optimization Methods and Software 11(1):613-623, 1999
http://euler.nmt.edu/~brian/csdppaper.pdf
Lu, F., Lin, Y., and Wahba, G.:
Robust Manifold Unfolding with Kernel Regularization TR
1108, October, 2005.
http://www.stat.wisc.edu/~wahba/ftp1/tr1108rr.pdf
C <- list(matrix(c(2,1, 1,2),2,2,byrow=TRUE), matrix(c(3,0,1, 0,2,0, 1,0,3),3,3,byrow=TRUE), c(0,0)) A <- list(list(matrix(c(3,1, 1,3),2,2,byrow=TRUE), matrix(0,3,3), c(1,0)), list(matrix(0,2,2), matrix(c(3,0,1, 0,4,0, 1,0,5),3,3,byrow=TRUE), c(0,1))) b <- c(1,2) K <- list(type=c("s","s","l"),size=c(2,3,2)) csdp(C,A,b,K) # Manifold Unrolling broken stick example # using simple triplet symmetric matrices X <- matrix(c(-1,-1, 0,0, 1,-1),nc=2,byrow=TRUE); d <- as.vector(dist(X)^2); d <- d[-2] C <- list(.simple_triplet_diag_sym_matrix(1,3)) A <- list(list(simple_triplet_sym_matrix(i=c(1,2,2),j=c(1,1,2),v=c(1,-1,1),n=3)), list(simple_triplet_sym_matrix(i=c(2,3,3),j=c(2,2,3),v=c(1,-1,1),n=3)), list(matrix(1,3,3))) K <- list(type="s",size=3) csdp(C,A,c(d,0),K)