DSDP
Data Structures | Functions
dsdpsdp.h File Reference

Internal SDPCone data structures and routines. More...

Go to the source code of this file.

Data Structures

struct  DSDPBlockData
 Internal structure for data in one block of semidefintie. More...
 
struct  DSDPDataTranspose
 Internal structure for transpose of data. More...
 
struct  SDPblk
 Internal structure for block of semidefinite cone. More...
 
struct  SDPCone_C
 Internal structure for semidefinite cone. More...
 

Functions

int DSDPAddSDP (DSDP, SDPCone)
 Pass a semidefinite cone to the solver. More...
 
int DSDPBlockADot (DSDPBlockData *, double, DSDPVec, DSDPVMat, DSDPVec)
 Compute inner product of XX with data matrices. More...
 
int DSDPBlockASum (DSDPBlockData *, double, DSDPVec, DSDPVMat)
 Sum the data matrices. More...
 
int DSDPBlockCountNonzeroMatrices (DSDPBlockData *, int *)
 Count how many data matrices are in a block of data. More...
 
int DSDPBlockDataAllocate (DSDPBlockData *, int)
 Allocate some structures. More...
 
int DSDPBlockDataDestroy (DSDPBlockData *)
 Free the data matrices. More...
 
int DSDPBlockDataInitialize (DSDPBlockData *)
 Set pointers to null. More...
 
int DSDPBlockDataMarkNonzeroMatrices (DSDPBlockData *, int *)
 Mark which variable in block have a data matrix. More...
 
int DSDPBlockDataRowSparsity (DSDPBlockData *, int, int[], int[], int)
 Determine sparsity pattern of data. More...
 
int DSDPBlockFactorData (DSDPBlockData *, DSDPVMat, SDPConeVec)
 Factor the data matrices. More...
 
int DSDPBlockGetMatrix (DSDPBlockData *, int, int *, double *, DSDPDataMat *)
 Get a data matrix from a block of data. More...
 
int DSDPBlockInitialize (SDPblk *)
 Initialize data structures in one block of the cone. More...
 
int DSDPBlockRemoveDataMatrix (DSDPBlockData *, int)
 Remove a data matrix. More...
 
int DSDPBlockTakeDown (SDPblk *)
 Free data structures in one block of the cone. More...
 
int DSDPBlockTakeDownData (DSDPBlockData *)
 Free structures in block of data. More...
 
int DSDPBlockvAv (DSDPBlockData *, double, DSDPVec, SDPConeVec, DSDPVec)
 Set VAV[i] to aa * Alpha[i] * V' A[i] V. More...
 
int DSDPBlockView (DSDPBlockData *)
 Print the structure of the block. More...
 
int DSDPBlockView2 (DSDPBlockData *)
 Print the data. More...
 
int DSDPDataMatCheck (DSDPDataMat, SDPConeVec, DSDPIndex, DSDPVMat)
 Check correctness of operations on the data. More...
 
int DSDPDataTransposeInitialize (DSDPDataTranspose *)
 Initialize transpose structure for data. More...
 
int DSDPDataTransposeSetup (DSDPDataTranspose *, SDPblk *, int, int)
 Set up transpose structure for data. More...
 
int DSDPDataTransposeTakeDown (DSDPDataTranspose *)
 Free transpose structure for data. More...
 
int DSDPMakeVMat (char, int, DSDPVMat *)
 Allocate V matrix. More...
 
int DSDPMakeVMatWithArray (char, double[], int, int, DSDPVMat *)
 Allocate V matrix using the given array. More...
 
int DSDPSetDataMatZero (DSDPDataMat *)
 Make a data matrix a zero matrix. More...
 
int SDPConeCheckJ (SDPCone, int)
 Check validity of parameter. More...
 
int SDPConeCheckM (SDPCone, int)
 Check validity of parameter. More...
 
int SDPConeCheckN (SDPCone, int, int)
 Check validity of parameter. More...
 
int SDPConeCheckStorageFormat (SDPCone, int, char)
 Check validity of parameters. More...
 
int SDPConeComputeHessian (SDPCone, double, DSDPSchurMat, DSDPVec, DSDPVec)
 Compute the Hessian to the barrier term. More...
 
int SDPConeComputeRHS (SDPCone, int, double, DSDPVec, DSDPVec, DSDPVec)
 Compute the gradient to the barrier term. More...
 
int SDPConeComputeSS (SDPCone, int, DSDPVec, DSDPVMat)
 Sum the data matrices. More...
 
int SDPConeComputeX3 (SDPCone, int, double, DSDPVec, DSDPVec, DSDPVMat)
 Compute the matrix X with the given information. More...
 
int SDPConeComputeXDot (SDPCone, int, DSDPVec, DSDPVMat, DSDPVec, double *, double *, double *)
 Compute inner product of X with the Data, S, and norm of X. More...
 
int SDPConeComputeXX (SDPCone, int, DSDPVec, double, DSDPDualMat, DSDPVMat)
 Compute X. More...
 
int SDPConeDestroy (SDPCone)
 Free data structure of the cone. More...
 
int SDPConeMultiply (SDPCone, int, double, DSDPVec, DSDPVec, DSDPVec)
 Compute the gradient to the barrier term. More...
 
int SDPConeSetRIdentity (SDPCone, int, int, double)
 Add identify matrix to dual matrix. More...
 
int SDPConeSetup (SDPCone, DSDPVec)
 Allocate data structure of the cone. More...
 
int SDPConeSetup2 (SDPCone, DSDPVec, DSDPSchurMat)
 Allocate data structure of the cone. More...
 

Detailed Description

Internal SDPCone data structures and routines.

Definition in file dsdpsdp.h.

Function Documentation

◆ DSDPAddSDP()

int DSDPAddSDP ( DSDP  dsdp,
SDPCone  sdpcone 
)

Pass a semidefinite cone to the solver.

Parameters
dsdpsolver
sdpconesemidefinite cone

Definition at line 331 of file sdpkcone.c.

◆ DSDPBlockADot()

int DSDPBlockADot ( DSDPBlockData ADATA,
double  aa,
DSDPVec  Alpha,
DSDPVMat  X,
DSDPVec  AX 
)

Compute inner product of XX with data matrices.

Parameters
ADATAblock of data.
aascalar
Alphascalar.
XDense symmetric matrix
AXSet AX[i] to aa * Alpha[i] * Dot( A[i] * X)

Definition at line 49 of file dsdpblock.c.

◆ DSDPBlockASum()

int DSDPBlockASum ( DSDPBlockData ADATA,
double  aa,
DSDPVec  Yk,
DSDPVMat  XX 
)

Sum the data matrices.

Parameters
ADATAblock of data.
aascalar
Ykscalar.
XXequals aa * sum ( YK[i]* A[i] )

Definition at line 20 of file dsdpblock.c.

Referenced by SDPConeComputeSS().

◆ DSDPBlockCountNonzeroMatrices()

int DSDPBlockCountNonzeroMatrices ( DSDPBlockData ADATA,
int *  nzmats 
)

Count how many data matrices are in a block of data.

Parameters
ADATAblock of data.
nzmatsset to number of nonzero matrices. Numbers from 0 to this number can be used as a matrix id in DSDPBlockGetMatrix()

Definition at line 272 of file dsdpblock.c.

Referenced by DSDPDataTransposeSetup(), and SDPConeViewDataMatrix().

◆ DSDPBlockDataAllocate()

int DSDPBlockDataAllocate ( DSDPBlockData ADATA,
int  nnz 
)

Allocate some structures.

Parameters
ADATAblock of data.
nnznumber of data matrices to allocate space

Definition at line 221 of file dsdpblock.c.

Referenced by SDPConeSetSparsity().

◆ DSDPBlockDataDestroy()

int DSDPBlockDataDestroy ( DSDPBlockData ADATA)

Free the data matrices.

Parameters
ADATAblock of data.

Definition at line 195 of file dsdpblock.c.

Referenced by SDPConeDestroy().

◆ DSDPBlockDataInitialize()

int DSDPBlockDataInitialize ( DSDPBlockData ADATA)

Set pointers to null.

Parameters
ADATAblock of data.

Definition at line 163 of file dsdpblock.c.

Referenced by DSDPBlockDataDestroy(), and DSDPBlockInitialize().

◆ DSDPBlockDataMarkNonzeroMatrices()

int DSDPBlockDataMarkNonzeroMatrices ( DSDPBlockData ADATA,
int *  annz 
)

Mark which variable in block have a data matrix.

Parameters
ADATAblock of data.
annzarray of integers to mark.

Definition at line 254 of file dsdpblock.c.

Referenced by DSDPDataTransposeSetup().

◆ DSDPBlockDataRowSparsity()

int DSDPBlockDataRowSparsity ( DSDPBlockData ADATA,
int  row,
int  ai[],
int  rnnz[],
int  n 
)

Determine sparsity pattern of data.

Parameters
ADATAblock of data.
rowfrom 0 to n.
ai(input) array of ones and zeros that identify which data matrices to check.
rnnz(output) array of length m where nonzeros indicate nonzero data.
ndimension of block.

Definition at line 330 of file dsdpblock.c.

◆ DSDPBlockFactorData()

int DSDPBlockFactorData ( DSDPBlockData ADATA,
DSDPVMat  X,
SDPConeVec  W 
)

Factor the data matrices.

Parameters
ADATAblock of data.
Xwork array
WWork vector

Definition at line 113 of file dsdpblock.c.

◆ DSDPBlockGetMatrix()

int DSDPBlockGetMatrix ( DSDPBlockData ADATA,
int  id,
int *  vari,
double *  scl,
DSDPDataMat A 
)

Get a data matrix from a block of data.

Parameters
ADATAblock of data.
ididentfier of the matrices, numbered consecutively from 0.
variset to variable number corresponding to A.
sclscaling
Adata matrix.

Definition at line 307 of file dsdpblock.c.

Referenced by DSDPBlockFactorData(), DSDPDataTransposeSetup(), and SDPConeViewDataMatrix().

◆ DSDPBlockInitialize()

int DSDPBlockInitialize ( SDPblk blk)

Initialize data structures in one block of the cone.

Parameters
blkblock of semidefinite cone

Definition at line 279 of file sdpconesetup.c.

◆ DSDPBlockRemoveDataMatrix()

int DSDPBlockRemoveDataMatrix ( DSDPBlockData ADATA,
int  vari 
)

Remove a data matrix.

Parameters
ADATAblock of data.
varivariable corresponding the matrix.

Definition at line 351 of file dsdpblock.c.

Referenced by SDPConeRemoveDataMatrix(), and SDPConeSetRMatrix().

◆ DSDPBlockTakeDown()

int DSDPBlockTakeDown ( SDPblk blk)

Free data structures in one block of the cone.

Parameters
blkblock of semidefinite cone

Definition at line 305 of file sdpconesetup.c.

Referenced by DSDPConeTakeDown().

◆ DSDPBlockTakeDownData()

int DSDPBlockTakeDownData ( DSDPBlockData ADATA)

Free structures in block of data.

Parameters
ADATAblock of data.

Definition at line 182 of file dsdpblock.c.

Referenced by DSDPBlockDataDestroy(), and DSDPBlockTakeDown().

◆ DSDPBlockvAv()

int DSDPBlockvAv ( DSDPBlockData ADATA,
double  aa,
DSDPVec  Alpha,
SDPConeVec  V,
DSDPVec  VAV 
)

Set VAV[i] to aa * Alpha[i] * V' A[i] V.

Parameters
ADATAblock of data.
aascalar
Alphascalar.
Vvecotr
VAVthe product

Definition at line 84 of file dsdpblock.c.

◆ DSDPBlockView()

int DSDPBlockView ( DSDPBlockData ADATA)

Print the structure of the block.

Parameters
ADATAblock of data.

Definition at line 454 of file dsdpblock.c.

Referenced by SDPConeView().

◆ DSDPBlockView2()

int DSDPBlockView2 ( DSDPBlockData ADATA)

Print the data.

Parameters
ADATAblock of data.

Definition at line 474 of file dsdpblock.c.

Referenced by SDPConeView2().

◆ DSDPDataMatCheck()

int DSDPDataMatCheck ( DSDPDataMat  AA,
SDPConeVec  W,
DSDPIndex  IS,
DSDPVMat  XX 
)

Check correctness of operations on the data.

Parameters
AAdata matrix.
Wwork vector
ISwork array
XXwork array

Definition at line 498 of file dsdpblock.c.

◆ DSDPDataTransposeInitialize()

int DSDPDataTransposeInitialize ( DSDPDataTranspose ATranspose)

Initialize transpose structure for data.

Parameters
ATransposetranspose structure for data.

Definition at line 15 of file sdpconesetup.c.

Referenced by DSDPDataTransposeTakeDown().

◆ DSDPDataTransposeSetup()

int DSDPDataTransposeSetup ( DSDPDataTranspose ATranspose,
SDPblk blk,
int  nblocks,
int  m 
)

Set up transpose structure for data.

Parameters
ATransposetranspose structure for data.
blksemidefinite blocks
nblocksnumber of blocks
mdimension of Y vector.

Definition at line 36 of file sdpconesetup.c.

◆ DSDPDataTransposeTakeDown()

int DSDPDataTransposeTakeDown ( DSDPDataTranspose ATranspose)

Free transpose structure for data.

Parameters
ATransposetranspose structure for data.

Definition at line 89 of file sdpconesetup.c.

Referenced by DSDPDataTransposeSetup().

◆ DSDPMakeVMat()

int DSDPMakeVMat ( char  UPLQ,
int  n,
DSDPVMat X 
)

Allocate V matrix.

Parameters
UPLQformat
ndimension
Xnew matrix.
See also
SDPConeSetStorageFormat()

Definition at line 351 of file sdpsss.c.

Referenced by DSDPBlockSetup(), and SDPConeSetXMat().

◆ DSDPMakeVMatWithArray()

int DSDPMakeVMatWithArray ( char  UPLQ,
double  xx[],
int  nnz,
int  n,
DSDPVMat X 
)

Allocate V matrix using the given array.

Parameters
UPLQformat
xxarray
nnzlength of the array
ndimension
Xnew matrix.
See also
SDPConeSetStorageFormat()
SDPConeGetXArray()

Definition at line 381 of file sdpsss.c.

Referenced by SDPConeComputeS(), SDPConeComputeX(), SDPConeSetXArray(), and SDPConeViewX().

◆ DSDPSetDataMatZero()

int DSDPSetDataMatZero ( DSDPDataMat A)

Make a data matrix a zero matrix.

Parameters
Adata matrix.

Definition at line 537 of file dsdpadddatamat.c.

Referenced by DSDPBlockRemoveDataMatrix().

◆ SDPConeCheckJ()

int SDPConeCheckJ ( SDPCone  sdpcone,
int  blockj 
)

◆ SDPConeCheckM()

int SDPConeCheckM ( SDPCone  sdpcone,
int  m 
)

Check validity of parameter.

Parameters
sdpconeSDP cone
mnumber of y variables

Definition at line 68 of file dsdpadddata.c.

Referenced by SDPConeAddADotX(), and SDPConeComputeS().

◆ SDPConeCheckN()

int SDPConeCheckN ( SDPCone  sdpcone,
int  blockj,
int  n 
)

Check validity of parameter.

Parameters
sdpconeSDP cone
blockjblock number
ndimension of block.

Definition at line 48 of file dsdpadddata.c.

Referenced by SDPConeAddDataMatrix(), SDPConeAddXVAV(), SDPConeComputeS(), SDPConeComputeX(), SDPConeSetRMatrix(), SDPConeSetXArray(), SDPConeViewX(), and SDPConeXVMultiply().

◆ SDPConeCheckStorageFormat()

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

Check validity of parameters.

Parameters
sdpconeSDP cone
blockjblock number
formatsuch as packed symmetric or upper full symmetric

Definition at line 101 of file dsdpadddata.c.

◆ SDPConeComputeHessian()

int SDPConeComputeHessian ( SDPCone  sdpcone,
double  mu,
DSDPSchurMat  M,
DSDPVec  vrhs1,
DSDPVec  vrhs2 
)

Compute the Hessian to the barrier term.

Parameters
sdpconecone
mubarrier parameter
MSchur matrix to insert elements.
vrhs1dual objectvive gradient.
vrhs2barrier gradient

Definition at line 30 of file sdpcompute.c.

◆ SDPConeComputeRHS()

int SDPConeComputeRHS ( SDPCone  sdpcone,
int  blockj,
double  mu,
DSDPVec  vrow,
DSDPVec  vrhs1,
DSDPVec  vrhs2 
)

Compute the gradient to the barrier term.

Parameters
sdpconesemidefinite cone
blockjblock of the cone.
mubarrier parameter
vrowscalar to multiply each element of gradient.
vrhs1dual objectvive gradient.
vrhs2barrier gradient

Definition at line 125 of file sdpcompute.c.

◆ SDPConeComputeSS()

int SDPConeComputeSS ( SDPCone  sdpcone,
int  blockj,
DSDPVec  Y,
DSDPVMat  SS 
)

Sum the data matrices.

Parameters
sdpconesemidefinite cone object
blockjblock number
Yscalar multiples of A matrices.
SSdestination array.

Definition at line 18 of file sdpcone.c.

Referenced by SDPConeComputeS(), and SDPConeComputeX3().

◆ SDPConeComputeX3()

int SDPConeComputeX3 ( SDPCone  sdpcone,
int  blockj,
double  mu,
DSDPVec  Y,
DSDPVec  DY,
DSDPVMat  X 
)

Compute the matrix X with the given information.

Parameters
sdpconesemidefinite cone
blockjblock number
mubarrier parameter
Ydual solution
DYNewton direction
Xdestination
See also
DSDPComputeX()

Definition at line 140 of file sdpcone.c.

Referenced by SDPConeComputeX().

◆ SDPConeComputeXDot()

int SDPConeComputeXDot ( SDPCone  sdpcone,
int  blockj,
DSDPVec  Y,
DSDPVMat  X,
DSDPVec  AX,
double *  xtrace,
double *  xnorm,
double *  tracexs 
)

Compute inner product of X with the Data, S, and norm of X.

Parameters
sdpconesemidefinite cone
blockjblock number
Ydual solution
Xdense array matrix
AXinner products
xtracetrace of X
xnormnorm of X
tracexsinner product of X and S

Definition at line 111 of file sdpcone.c.

Referenced by SDPConeComputeX().

◆ SDPConeComputeXX()

int SDPConeComputeXX ( SDPCone  sdpcone,
int  blockj,
DSDPVec  DY,
double  mu,
DSDPDualMat  S,
DSDPVMat  X 
)

Compute X.

Parameters
sdpconecone
blockjblock number in SDP cone.
DYstep direction vector
mubarrier parameter
Sdual matrix alread inverted.
Xthe result.

Definition at line 235 of file sdpcompute.c.

Referenced by SDPConeComputeX3().

◆ SDPConeDestroy()

int SDPConeDestroy ( SDPCone  sdpcone)

Free data structure of the cone.

Parameters
sdpconesemidefinite cone

Definition at line 350 of file sdpconesetup.c.

◆ SDPConeMultiply()

int SDPConeMultiply ( SDPCone  sdpcone,
int  blockj,
double  mu,
DSDPVec  vrow,
DSDPVec  vin,
DSDPVec  vout 
)

Compute the gradient to the barrier term.

Parameters
sdpconesemidefinite cone
blockjblock of cone
mubarrier parameter
vrowscalar to multiply each element of the product
vinin vector.
voutproduct

Definition at line 182 of file sdpcompute.c.

◆ SDPConeSetRIdentity()

int SDPConeSetRIdentity ( SDPCone  sdpcone,
int  blockj,
int  n,
double  rr 
)

Add identify matrix to dual matrix.

Parameters
sdpconeSDP cone
blockjblock number j from 0 to nblocks
ndimension of the matrix
rrmultiple of identity matrix.

Definition at line 438 of file dsdpadddatamat.c.

◆ SDPConeSetup()

int SDPConeSetup ( SDPCone  sdpcone,
DSDPVec  yy0 
)

Allocate data structure of the cone.

Parameters
sdpconesemidefinite cone
yy0variable vector

Definition at line 249 of file sdpconesetup.c.

◆ SDPConeSetup2()

int SDPConeSetup2 ( SDPCone  sdpcone,
DSDPVec  yy0,
DSDPSchurMat  M 
)

Allocate data structure of the cone.

Parameters
sdpconesemidefinite cone
yy0variable vector
MSchur matrix.

Definition at line 224 of file sdpconesetup.c.