next up previous contents
Next: Software Support Up: SDPpack User's Guide Version Previous: The condition number

Support Routines

  Here we describe a number of support routines which are available. These routines are in the subdirectory support except where noted. More information is available by typing help routine_name from within Matlab.

export.m, import.m
These routines provide SDPpack's interface with ASCII data. The calling sequence for the first of these is

displaymath4895

where fname is the name of the file (string) to which the data must be exported. The data will be stored in one of the formats described in Appendix A. If the data was successfully exported, export.m returns 0, otherwise 1. The file name fname must have a period and an extension (other than the standard Matlab extensions mat, mex etc.) following the period (see Section 3.1). The calling sequence for import.m is

displaymath4896

where fname is the name of a file (string) containing an SQLP in one of the two formats described in Appendix A.

plotcomp.m, plotfeas.m, plotobj.m
Plot tex2html_wrap_inline4285 ; tex2html_wrap_inline4325 , tex2html_wrap_inline4329 ; and the primal and dual objective values, respectively, as a function of the iteration count.

blkeig.m
Returns the eigenvalues of a symmetric block diagonal matrix, computing them blockwise. The calling sequence is

displaymath4897

where M is a block diagonal matrix (not a structure), blk is a vector of block sizes, and sortflag is an optional input argument. The vector of eigenvalues, lam, is sorted blockwise in ascending or descending order depending on whether sortflag is 1 or -1. The matrix of eigenvectors, Q, has its columns permuted accordingly. The output parameter indef is set to 1 if the input matrix tex2html_wrap_inline4365 is not positive definite and 0 otherwise. For example, eigenvalue complementarity may be checked by typing

displaymath4898

where the structures tex2html_wrap_inline4293 and tex2html_wrap_inline4295 contain computed solutions of an SQLP. The routine blkeig.m is in the sdppack directory since it is used by the main routines.

qcfirst.m
Extract the special components tex2html_wrap_inline4939 and tex2html_wrap_inline4941 from the block vectors x and z (see (2)). The calling sequence is

displaymath4899

where x and z are block vectors with block sizes given by the vector blk, and the output vectors x0 and z0 have entries consisting of the first entries of each block of x and z respectively.

qcpos.m
Given a block vector x, this routine computes the vector of values given by the right-hand component of (8). The calling sequence is

displaymath4900

where x is the block vector, blk is the vector of block sizes, v is the vector on the right-hand side of (8) and dist is the minimum entry in v (possibly negative or zero, if x is outside the quadratic cone or on its boundary. Using this routine together with qcfirst.m, one can conveniently check strict complementarity for the quadratic part of an SQLP, explicitly displaying the pairs of vectors in (7) and (8) by

   [x0,z0] = qcfirst(X.q,Z.q,blk.q);
   [distx,vx] = qcpos(X.q,blk.q);
   [distz,vz] = qcpos(Z.q,blk.q);
   [ x0  vz ]  % check one complementary pair (x=0, z on boundary)
   [ z0  vx ]  % check other complementary pair (z=0, x on boundary)
This routine is in the sdppack directory since it is used by the main routines.

arw.m
This routine computes the ``arrow matrix" [2] which is used to derive the search direction for the quadratic part. The calling sequence is

displaymath4901

This routine is called only by sqlcond.m.

svec.m, smat.m
These routines convert a symmetric block diagonal matrix into its vector representation and vice versa. See Section 3.1. These routines are in the sdppack directory.

skron.m
This routine computes the symmetric Kronecker product [1] of two block diagonal matrices. The calling sequence is

displaymath4902

This routine is called only by sqlcond.m.

preproc.m
This routine can be used to detect inconsistency of the constraints, or to identify and eliminate redundant constraints. The calling sequence is:

displaymath4903

where tol is a tolerance (e.g. tex2html_wrap_inline4855 ) used to determine the rank of tex2html_wrap_inline4553 .

makeA.m
This routine is used to construct the matrix tex2html_wrap_inline4137 , the semidefinite part of the primal linear constraints. The calling sequence is

displaymath4129

where blk.s is as above and Amat is a cell array storing the block diagonal matrices tex2html_wrap_inline4949 (see Section 3.1).

The package also provides routines to create a variety of randomlygif generated test problems. There is also a routine to create SQLP's with solutions having prescribed properties. These routines are discussed below.

sqlrnd.m
This script assumes that blk and m are available in the Matlab environment, and generates a random primal and dual feasible SQLP with block structure specified by blk and with m primal constraints. The script init.m must be called to initialize the variables to default (and generally infeasible) values, before calling sql.m or fsql.m to solve the problem. This routine is in the main sdppack directory.

drnd.m
This script assumes that n is available in the the Matlab workspace, and randomly generates the vector b and matrix tex2html_wrap_inline4057 defining a diagonally constrained SDP (see Section 5.1), stored in tex2html_wrap_inline4167 and tex2html_wrap_inline4175 respectively. The script dinit.m must be called to initialize the variables to default (and generally infeasible) values, before calling the specialized routines dsdp.m or fdsdp.m to solve the diagonally constrained SDP (see Section 5.1). This routine is in the special subdirectory.

lrnd.m
This script assumes that n and dsty are available in the workspace, and generates a random graph with n vertices and expected edge density approximately dsty, with edge list stored in G. The vertices are given random weights, stored in w. A warning is printed if the graph is disconnected. The variables G and w may then be used as input to the routines which compute a Lovász tex2html_wrap_inline4031 function. The script linit.m must be called to initialize the variables to default (and generally infeasible) values, before calling the specialized routines lsdp.m or flsdp.m to solve the SDP which defines the Lovász tex2html_wrap_inline4031 function (see Section 5.2). This routine is in the special subdirectory.

snrnd.m
This script assumes that integers M, N and d are available in the workspace, and generates a random ``sum of norms" problem: the ``dual" is

displaymath4905

and the ``primal" is

displaymath4906

where the vectors tex2html_wrap_inline4967 and tex2html_wrap_inline4969 are of length d and the vector y is of length M (so the matrices tex2html_wrap_inline4973 have size M by d). The routine converts this to a quadratically constrained linear program expressed in SQLP format, so it can then be solved by sql.m. This provides an interesting class of problems, since the blocks in the resulting block vector tex2html_wrap_inline4405 must always be on the cone boundary at the solution, i.e. with the right-hand component of (7) always zero. See the comments in the code for further details. This routine is in the special subdirectory.

makesql.m
This script assumes that integer m and structures blk, rx and rz are available in the Matlab workspace, and creates an SQLP having a primal and a dual solution with prescribed ``rank'' properties. The structure blk is as before. The structure rx has three fields, rx.s, rx.q and rx.l. The field rx.s is a vector specifying the desired rank of each block of the solution tex2html_wrap_inline4039 . The field rx.q is a vector of values, giving a number 0, 1 or 2 for each block of tex2html_wrap_inline4049 , specifying, respectively, whether the corresponding block of the solution tex2html_wrap_inline4049 is to be zero, a nonzero vector on the boundary of the quadratic cone, or a vector in the interior of the quadratic cone. The scalar rx.l specifies the desired number of nonzero components in the solution vector tex2html_wrap_inline4053 . The structure rz with fields rz.s, rz.q and rz.l specifies the corresponding information for the dual solution ( tex2html_wrap_inline4395 , tex2html_wrap_inline4405 , tex2html_wrap_inline4415 ). This routine is useful for creating test problems for which the strict complementarity or primal and dual nondegeneracy conditions do not hold. However, the prescribed rank structures must not violate the complementarity conditions. See the comments in the routine for further explanation.

In addition, scripts sql2sdp and sdp2sql convert SDP's in SQLP format to the SDP format required by SDPpack Version 0.8 and vice versa, and sql2qc and qc2sql likewise convert QCLP's from SQLP format to a QCLP-only format and vice versa.


next up previous contents
Next: Software Support Up: SDPpack User's Guide Version Previous: The condition number

Madhu Nayakkankuppam
Wed Jun 25 18:01:54 EDT 1997