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

## Detailed Description

Internal SDPCone data structures and routines.

Definition in file dsdpsdp.h.

## Function Documentation

## DSDPAddSDP()

int DSDPAddSDP | ( | DSDP | dsdp,
|  | SDPCone | sdpcone
| ) |  |

extern

Pass a semidefinite cone to the solver.

Parameters

  dsdp | solver
  sdpcone | semidefinite cone

Definition at line 331 of file sdpkcone.c.

## DSDPBlockAddDataMatrix()

int DSDPBlockAddDataMatrix | ( | DSDPBlockData * | ADATA,
|  | int | vari,
|  | struct DSDPDataMat_Ops * | dsdpdataops,
|  | void * | data
| ) |  |

extern

Add data matrix into SDP block.

Parameters

  ADATA | block of data.
  vari | the variable to which the matrix corresponds.
  dsdpdataops | function pointers
  data | opaque pointer to matrix.

Definition at line 381 of file dsdpblock.c.

Referenced by DSDPBlockSetDataMatrix().

## DSDPBlockADot()

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

extern

Compute inner product of XX with data matrices.

Parameters

  ADATA | block of data.
  aa | scalar
  Alpha | scalar.
  X | Dense symmetric matrix
  AX | Set AX[i] to aa * Alpha[i] * Dot( A[i] * X)

Definition at line 49 of file dsdpblock.c.

Referenced by SDPConeComputeHessian(), SDPConeComputeRHS(), and SDPConeComputeXDot().

## DSDPBlockASum()

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

extern

Sum the data matrices.

Parameters

  ADATA | block of data.
  aa | scalar
  Yk | scalar.
  XX | equals aa * sum ( YK[i]* A[i] )

Definition at line 20 of file dsdpblock.c.

Referenced by SDPConeComputeSS(), and SDPConeMultiply().

## DSDPBlockCountNonzeroMatrices()

int DSDPBlockCountNonzeroMatrices | ( | DSDPBlockData * | ADATA,
|  | int * | nzmats
| ) |  |

extern

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

Parameters

  ADATA | block of data.
  nzmats | set 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(), SDPConeComputeRHS(), SDPConeComputeXX(), and SDPConeMultiply().

## DSDPBlockDataAllocate()

int DSDPBlockDataAllocate | ( | DSDPBlockData * | ADATA,
|  | int | nnz
| ) |  |

extern

Allocate some structures.

Parameters

  ADATA | block of data.
  nnz | number of data matrices to allocate space

Definition at line 221 of file dsdpblock.c.

Referenced by DSDPBlockAddDataMatrix().

## DSDPBlockDataDestroy()

int DSDPBlockDataDestroy | ( | DSDPBlockData * | ADATA | ) |

extern

Free the data matrices.

Parameters

  ADATA | block of data.

Definition at line 195 of file dsdpblock.c.

Referenced by SDPConeDestroy().

## DSDPBlockDataInitialize()

int DSDPBlockDataInitialize | ( | DSDPBlockData * | ADATA | ) |

extern

Set pointers to null.

Parameters

  ADATA | block of data.

Definition at line 163 of file dsdpblock.c.

Referenced by DSDPBlockDataDestroy(), and DSDPBlockInitialize().

## DSDPBlockDataMarkNonzeroMatrices()

int DSDPBlockDataMarkNonzeroMatrices | ( | DSDPBlockData * | ADATA,
|  | int * | annz
| ) |  |

extern

Mark which variable in block have a data matrix.

Parameters

  ADATA | block of data.
  annz | array 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
| ) |  |

extern

Determine sparsity pattern of data.

Parameters

  ADATA | block of data.
  row | from 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.
  n | dimension of block.

Definition at line 330 of file dsdpblock.c.

## DSDPBlockFactorData()

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

extern

Factor the data matrices.

Parameters

  ADATA | block of data.
  X | work array
  W | Work vector

Definition at line 113 of file dsdpblock.c.

Referenced by DSDPBlockSetup().

## DSDPBlockGetMatrix()

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

extern

Get a data matrix from a block of data.

Parameters

  ADATA | block of data.
  id | identfier of the matrices, numbered consecutively from 0.
  vari | set to variable number corresponding to A.
  scl | scaling
  A | data matrix.

Definition at line 307 of file dsdpblock.c.

Referenced by DSDPBlockFactorData(), DSDPDataTransposeSetup(), SDPConeComputeHessian(), SDPConeComputeRHS(), SDPConeComputeXX(), and SDPConeMultiply().

## DSDPBlockInitialize()

int DSDPBlockInitialize | ( | SDPblk * | blk | ) |

extern

Initialize data structures in one block of the cone.

Parameters

  blk | block of semidefinite cone

Definition at line 279 of file sdpconesetup.c.

## DSDPBlockRemoveDataMatrix()

int DSDPBlockRemoveDataMatrix | ( | DSDPBlockData * | ADATA,
|  | int | vari
| ) |  |

extern

Remove a data matrix.

Parameters

  ADATA | block of data.
  vari | variable corresponding the matrix.

Definition at line 351 of file dsdpblock.c.

Referenced by DSDPBlockSetDataMatrix(), and SDPConeSetRMatrix().

## DSDPBlockSetDataMatrix()

int DSDPBlockSetDataMatrix | ( | DSDPBlockData * | ADATA,
|  | int | vari,
|  | struct DSDPDataMat_Ops * | dsdpdataops,
|  | void * | data
| ) |  |

extern

Set data matrix into SDP block.

Parameters

  ADATA | block of data.
  vari | the variable to which the matrix corresponds.
  dsdpdataops | function pointers
  data | opaque pointer to matrix.

Definition at line 406 of file dsdpblock.c.

Referenced by SDPConeSetRMatrix().

## DSDPBlockTakeDown()

int DSDPBlockTakeDown | ( | SDPblk * | blk | ) |

extern

Free data structures in one block of the cone.

Parameters

  blk | block of semidefinite cone

Definition at line 305 of file sdpconesetup.c.

Referenced by DSDPConeTakeDown().

## DSDPBlockTakeDownData()

int DSDPBlockTakeDownData | ( | DSDPBlockData * | ADATA | ) |

extern

Free structures in block of data.

Parameters

  ADATA | block 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
| ) |  |

extern

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

Parameters

  ADATA | block of data.
  aa | scalar
  Alpha | scalar.
  V | vecotr
  VAV | the product

Definition at line 84 of file dsdpblock.c.

Referenced by SDPConeComputeHessian().

## DSDPBlockView()

int DSDPBlockView | ( | DSDPBlockData * | ADATA | ) |

extern

Print the structure of the block.

Parameters

  ADATA | block of data.

Definition at line 454 of file dsdpblock.c.

## DSDPBlockView2()

int DSDPBlockView2 | ( | DSDPBlockData * | ADATA | ) |

extern

Print the data.

Parameters

  ADATA | block of data.

Definition at line 474 of file dsdpblock.c.

## DSDPDataMatCheck()

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

extern

Check correctness of operations on the data.

Parameters

  AA | data matrix.
  W | work vector
  IS | work array
  XX | work array

Definition at line 498 of file dsdpblock.c.

## DSDPDataTransposeInitialize()

int DSDPDataTransposeInitialize | ( | DSDPDataTranspose * | ATranspose | ) |

extern

Initialize transpose structure for data.

Parameters

  ATranspose | transpose 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
| ) |  |

extern

Set up transpose structure for data.

Parameters

  ATranspose | transpose structure for data.
  blk | semidefinite blocks
  nblocks | number of blocks
  m | dimension of Y vector.

Definition at line 36 of file sdpconesetup.c.

Referenced by SDPConeSetup().

## DSDPDataTransposeTakeDown()

int DSDPDataTransposeTakeDown | ( | DSDPDataTranspose * | ATranspose | ) |

extern

Free transpose structure for data.

Parameters

  ATranspose | transpose structure for data.

Definition at line 89 of file sdpconesetup.c.

Referenced by DSDPConeTakeDown(), and DSDPDataTransposeSetup().

## DSDPMakeVMat()

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

extern

Allocate V matrix.

Parameters

  UPLQ | format
  n | dimension
  X | new 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
| ) |  |

extern

Allocate V matrix using the given array.

Parameters

  UPLQ | format
  xx | array
  nnz | length of the array
  n | dimension
  X | new matrix.

See also
  SDPConeSetStorageFormat()
  SDPConeGetXArray()

Definition at line 381 of file sdpsss.c.

## DSDPSetDataMatZero()

int DSDPSetDataMatZero | ( | DSDPDataMat * | A | ) |

extern

Make a data matrix a zero matrix.

Parameters

  A | data matrix.

Definition at line 537 of file dsdpadddatamat.c.

Referenced by DSDPBlockRemoveDataMatrix().

## SDPConeCheckJ()

int SDPConeCheckJ | ( | SDPCone | sdpcone,
|  | int | blockj
| ) |  |

extern

Check validity of parameter.

Parameters

  sdpcone | SDP cone
  blockj | from 0 to nblocks

Definition at line 31 of file dsdpadddata.c.

Referenced by SDPConeCheckN(), SDPConeCheckStorageFormat(), SDPConeComputeRHS(), SDPConeComputeXX(), SDPConeMultiply(), and SDPConeSetRMatrix().

## SDPConeCheckM()

int SDPConeCheckM | ( | SDPCone | sdpcone,
|  | int | m
| ) |  |

extern

Check validity of parameter.

Parameters

  sdpcone | SDP cone
  m | number of y variables

Definition at line 68 of file dsdpadddata.c.

## SDPConeCheckN()

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

extern

Check validity of parameter.

Parameters

  sdpcone | SDP cone
  blockj | block number
  n | dimension of block.

Definition at line 48 of file dsdpadddata.c.

Referenced by SDPConeSetRMatrix().

## SDPConeCheckStorageFormat()

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

extern

Check validity of parameters.

Parameters

  sdpcone | SDP cone
  blockj | block number
  format | such 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
| ) |  |

extern

Compute the Hessian to the barrier term.

Parameters

  sdpcone | cone
  mu | barrier parameter
  M | Schur matrix to insert elements.
  vrhs1 | dual objectvive gradient.
  vrhs2 | barrier gradient

Definition at line 30 of file sdpcompute.c.

## SDPConeComputeRHS()

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

extern

Compute the gradient to the barrier term.

Parameters

  sdpcone | semidefinite cone
  blockj | block of the cone.
  mu | barrier parameter
  vrow | scalar to multiply each element of gradient.
  vrhs1 | dual objectvive gradient.
  vrhs2 | barrier gradient

Definition at line 125 of file sdpcompute.c.

## SDPConeComputeSS()

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

extern

Sum the data matrices.

Parameters

  sdpcone | semidefinite cone object
  blockj | block number
  Y | scalar multiples of A matrices.
  SS | destination array.

Definition at line 18 of file sdpcone.c.

Referenced by SDPConeComputeX3().

## SDPConeComputeX3()

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

extern

Compute the matrix X with the given information.

Parameters

  sdpcone | semidefinite cone
  blockj | block number
  mu | barrier parameter
  Y | dual solution
  DY | Newton direction
  X | destination

See also
  DSDPComputeX()

Definition at line 140 of file sdpcone.c.

## SDPConeComputeXDot()

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

extern

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

Parameters

  sdpcone | semidefinite cone
  blockj | block number
  Y | dual solution
  X | dense array matrix
  AX | inner products
  xtrace | trace of X
  xnorm | norm of X
  tracexs | inner product of X and S

Definition at line 111 of file sdpcone.c.

## SDPConeComputeXX()

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

extern

Compute X.

Parameters

  sdpcone | cone
  blockj | block number in SDP cone.
  DY | step direction vector
  mu | barrier parameter
  S | dual matrix alread inverted.
  X | the result.

Definition at line 235 of file sdpcompute.c.

Referenced by SDPConeComputeX3().

## SDPConeDestroy()

int SDPConeDestroy | ( | SDPCone | sdpcone | ) |

extern

Free data structure of the cone.

Parameters

  sdpcone | semidefinite cone

Definition at line 350 of file sdpconesetup.c.

## SDPConeMultiply()

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

extern

Compute the gradient to the barrier term.

Parameters

  sdpcone | semidefinite cone
  blockj | block of cone
  mu | barrier parameter
  vrow | scalar to multiply each element of the product
  vin | in vector.
  vout | product

Definition at line 182 of file sdpcompute.c.

## SDPConeSetRIdentity()

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

extern

Add identify matrix to dual matrix.

Parameters

  sdpcone | SDP cone
  blockj | block number j from 0 to nblocks
  n | dimension of the matrix
  rr | multiple of identity matrix.

Definition at line 438 of file dsdpadddatamat.c.

Referenced by SDPConeSetup().

## SDPConeSetup()

int SDPConeSetup | ( | SDPCone | sdpcone,
|  | DSDPVec | yy0
| ) |  |

extern

Allocate data structure of the cone.

Parameters

  sdpcone | semidefinite cone
  yy0 | variable vector

Definition at line 249 of file sdpconesetup.c.

## SDPConeSetup2()

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

extern

Allocate data structure of the cone.

Parameters

  sdpcone | semidefinite cone
  yy0 | variable vector
  M | Schur matrix.

Definition at line 224 of file sdpconesetup.c.