|
DSDP
|
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 | DSDPBlockAddDataMatrix (DSDPBlockData *, int, struct DSDPDataMat_Ops *, void *) |
| Add data matrix into SDP block. 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 | DSDPBlockSetDataMatrix (DSDPBlockData *, int, struct DSDPDataMat_Ops *, void *) |
| Set data matrix into SDP block. 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... | |
Internal SDPCone data structures and routines.
Definition in file dsdpsdp.h.
Pass a semidefinite cone to the solver.
| dsdp | solver |
| sdpcone | semidefinite cone |
Definition at line 331 of file sdpkcone.c.
| int DSDPBlockAddDataMatrix | ( | DSDPBlockData * | ADATA, |
| int | vari, | ||
| struct DSDPDataMat_Ops * | dsdpdataops, | ||
| void * | data | ||
| ) |
Add data matrix into SDP block.
| 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(), and SDPConeAddDataMatrix().
| int DSDPBlockADot | ( | DSDPBlockData * | ADATA, |
| double | aa, | ||
| DSDPVec | Alpha, | ||
| DSDPVMat | X, | ||
| DSDPVec | AX | ||
| ) |
Compute inner product of XX with data matrices.
| 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 SDPConeAddADotX(), SDPConeComputeHessian(), SDPConeComputeRHS(), and SDPConeComputeXDot().
| int DSDPBlockASum | ( | DSDPBlockData * | ADATA, |
| double | aa, | ||
| DSDPVec | Yk, | ||
| DSDPVMat | XX | ||
| ) |
Sum the data matrices.
| 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().
| int DSDPBlockCountNonzeroMatrices | ( | DSDPBlockData * | ADATA, |
| int * | nzmats | ||
| ) |
Count how many data matrices are in a block of data.
| 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(), SDPConeCheckData(), SDPConeComputeRHS(), SDPConeComputeXX(), SDPConeMultiply(), SDPConeView3(), and SDPConeViewDataMatrix().
| int DSDPBlockDataAllocate | ( | DSDPBlockData * | ADATA, |
| int | nnz | ||
| ) |
Allocate some structures.
| ADATA | block of data. |
| nnz | number of data matrices to allocate space |
Definition at line 221 of file dsdpblock.c.
Referenced by DSDPBlockAddDataMatrix(), and SDPConeSetSparsity().
| int DSDPBlockDataDestroy | ( | DSDPBlockData * | ADATA | ) |
Free the data matrices.
| ADATA | block of data. |
Definition at line 195 of file dsdpblock.c.
Referenced by SDPConeDestroy().
| int DSDPBlockDataInitialize | ( | DSDPBlockData * | ADATA | ) |
Set pointers to null.
| ADATA | block of data. |
Definition at line 163 of file dsdpblock.c.
Referenced by DSDPBlockDataDestroy(), and DSDPBlockInitialize().
| int DSDPBlockDataMarkNonzeroMatrices | ( | DSDPBlockData * | ADATA, |
| int * | annz | ||
| ) |
Mark which variable in block have a data matrix.
| ADATA | block of data. |
| annz | array of integers to mark. |
Definition at line 254 of file dsdpblock.c.
Referenced by DSDPDataTransposeSetup().
| int DSDPBlockDataRowSparsity | ( | DSDPBlockData * | ADATA, |
| int | row, | ||
| int | ai[], | ||
| int | rnnz[], | ||
| int | n | ||
| ) |
Determine sparsity pattern of data.
| 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.
| int DSDPBlockFactorData | ( | DSDPBlockData * | ADATA, |
| DSDPVMat | X, | ||
| SDPConeVec | W | ||
| ) |
Factor the data matrices.
| ADATA | block of data. |
| X | work array |
| W | Work vector |
Definition at line 113 of file dsdpblock.c.
Referenced by DSDPBlockSetup().
| int DSDPBlockGetMatrix | ( | DSDPBlockData * | ADATA, |
| int | id, | ||
| int * | vari, | ||
| double * | scl, | ||
| DSDPDataMat * | A | ||
| ) |
Get a data matrix from a block of data.
| 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(), SDPConeCheckData(), SDPConeComputeHessian(), SDPConeComputeRHS(), SDPConeComputeXX(), SDPConeMultiply(), and SDPConeViewDataMatrix().
| int DSDPBlockInitialize | ( | SDPblk * | blk | ) |
Initialize data structures in one block of the cone.
| blk | block of semidefinite cone |
Definition at line 279 of file sdpconesetup.c.
| int DSDPBlockRemoveDataMatrix | ( | DSDPBlockData * | ADATA, |
| int | vari | ||
| ) |
Remove a data matrix.
| ADATA | block of data. |
| vari | variable corresponding the matrix. |
Definition at line 351 of file dsdpblock.c.
Referenced by DSDPBlockSetDataMatrix(), SDPConeRemoveDataMatrix(), and SDPConeSetRMatrix().
| int DSDPBlockSetDataMatrix | ( | DSDPBlockData * | ADATA, |
| int | vari, | ||
| struct DSDPDataMat_Ops * | dsdpdataops, | ||
| void * | data | ||
| ) |
Set data matrix into SDP block.
| 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().
| int DSDPBlockTakeDown | ( | SDPblk * | blk | ) |
Free data structures in one block of the cone.
| blk | block of semidefinite cone |
Definition at line 305 of file sdpconesetup.c.
Referenced by DSDPConeTakeDown().
| int DSDPBlockTakeDownData | ( | DSDPBlockData * | ADATA | ) |
Free structures in block of data.
| ADATA | block of data. |
Definition at line 182 of file dsdpblock.c.
Referenced by DSDPBlockDataDestroy(), and DSDPBlockTakeDown().
| int DSDPBlockvAv | ( | DSDPBlockData * | ADATA, |
| double | aa, | ||
| DSDPVec | Alpha, | ||
| SDPConeVec | V, | ||
| DSDPVec | VAV | ||
| ) |
Set VAV[i] to aa * Alpha[i] * V' A[i] V.
| ADATA | block of data. |
| aa | scalar |
| Alpha | scalar. |
| V | vecotr |
| VAV | the product |
Definition at line 84 of file dsdpblock.c.
Referenced by SDPConeAddXVAV(), and SDPConeComputeHessian().
| int DSDPBlockView | ( | DSDPBlockData * | ADATA | ) |
Print the structure of the block.
| ADATA | block of data. |
Definition at line 454 of file dsdpblock.c.
Referenced by SDPConeView().
| int DSDPBlockView2 | ( | DSDPBlockData * | ADATA | ) |
Print the data.
| ADATA | block of data. |
Definition at line 474 of file dsdpblock.c.
Referenced by SDPConeView2().
| int DSDPDataMatCheck | ( | DSDPDataMat | AA, |
| SDPConeVec | W, | ||
| DSDPIndex | IS, | ||
| DSDPVMat | XX | ||
| ) |
Check correctness of operations on the data.
| AA | data matrix. |
| W | work vector |
| IS | work array |
| XX | work array |
Definition at line 498 of file dsdpblock.c.
Referenced by SDPConeCheckData().
| int DSDPDataTransposeInitialize | ( | DSDPDataTranspose * | ATranspose | ) |
Initialize transpose structure for data.
| ATranspose | transpose structure for data. |
Definition at line 15 of file sdpconesetup.c.
Referenced by DSDPDataTransposeTakeDown().
| int DSDPDataTransposeSetup | ( | DSDPDataTranspose * | ATranspose, |
| SDPblk * | blk, | ||
| int | nblocks, | ||
| int | m | ||
| ) |
Set up transpose structure for data.
| 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().
| int DSDPDataTransposeTakeDown | ( | DSDPDataTranspose * | ATranspose | ) |
Free transpose structure for data.
| ATranspose | transpose structure for data. |
Definition at line 89 of file sdpconesetup.c.
Referenced by DSDPConeTakeDown(), and DSDPDataTransposeSetup().
| int DSDPMakeVMat | ( | char | UPLQ, |
| int | n, | ||
| DSDPVMat * | X | ||
| ) |
Allocate V matrix.
| UPLQ | format |
| n | dimension |
| X | new matrix. |
Definition at line 351 of file sdpsss.c.
Referenced by DSDPBlockSetup(), and SDPConeSetXMat().
| int DSDPMakeVMatWithArray | ( | char | UPLQ, |
| double | xx[], | ||
| int | nnz, | ||
| int | n, | ||
| DSDPVMat * | X | ||
| ) |
Allocate V matrix using the given array.
| UPLQ | format |
| xx | array |
| nnz | length of the array |
| n | dimension |
| X | new matrix. |
Definition at line 381 of file sdpsss.c.
Referenced by SDPConeAddADotX(), SDPConeComputeS(), SDPConeComputeX(), SDPConeSetXArray(), and SDPConeViewX().
| int DSDPSetDataMatZero | ( | DSDPDataMat * | A | ) |
Make a data matrix a zero matrix.
| A | data matrix. |
Definition at line 537 of file dsdpadddatamat.c.
Referenced by DSDPBlockRemoveDataMatrix().
| int SDPConeCheckJ | ( | SDPCone | sdpcone, |
| int | blockj | ||
| ) |
Check validity of parameter.
| sdpcone | SDP cone |
| blockj | from 0 to nblocks |
Definition at line 31 of file dsdpadddata.c.
Referenced by SDPConeAddADotX(), SDPConeAddDataMatrix(), SDPConeCheckN(), SDPConeCheckStorageFormat(), SDPConeComputeRHS(), SDPConeComputeXV(), SDPConeComputeXX(), SDPConeGetBlockSize(), SDPConeGetStorageFormat(), SDPConeGetXArray(), SDPConeMatrixView(), SDPConeMultiply(), SDPConeRemoveDataMatrix(), SDPConeRestoreXArray(), SDPConeSetBlockSize(), SDPConeSetRMatrix(), SDPConeSetSparsity(), SDPConeSetStorageFormat(), SDPConeSetXArray(), and SDPConeViewDataMatrix().
| int SDPConeCheckM | ( | SDPCone | sdpcone, |
| int | m | ||
| ) |
Check validity of parameter.
| sdpcone | SDP cone |
| m | number of y variables |
Definition at line 68 of file dsdpadddata.c.
Referenced by SDPConeAddADotX(), and SDPConeComputeS().
| int SDPConeCheckN | ( | SDPCone | sdpcone, |
| int | blockj, | ||
| int | n | ||
| ) |
Check validity of parameter.
| sdpcone | SDP cone |
| blockj | block number |
| n | dimension of block. |
Definition at line 48 of file dsdpadddata.c.
Referenced by SDPConeAddDataMatrix(), SDPConeAddXVAV(), SDPConeComputeS(), SDPConeComputeX(), SDPConeSetRMatrix(), SDPConeSetXArray(), SDPConeViewX(), and SDPConeXVMultiply().
| int SDPConeCheckStorageFormat | ( | SDPCone | sdpcone, |
| int | blockj, | ||
| char | format | ||
| ) |
Check validity of parameters.
| sdpcone | SDP cone |
| blockj | block number |
| format | such as packed symmetric or upper full symmetric |
Definition at line 101 of file dsdpadddata.c.
| int SDPConeComputeHessian | ( | SDPCone | sdpcone, |
| double | mu, | ||
| DSDPSchurMat | M, | ||
| DSDPVec | vrhs1, | ||
| DSDPVec | vrhs2 | ||
| ) |
Compute the Hessian to the barrier term.
| 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.
| int SDPConeComputeRHS | ( | SDPCone | sdpcone, |
| int | blockj, | ||
| double | mu, | ||
| DSDPVec | vrow, | ||
| DSDPVec | vrhs1, | ||
| DSDPVec | vrhs2 | ||
| ) |
Compute the gradient to the barrier term.
| 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.
Sum the data matrices.
| 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 SDPConeComputeS(), SDPConeComputeX3(), and SDPConeComputeXV().
Compute the matrix X with the given information.
| sdpcone | semidefinite cone |
| blockj | block number |
| mu | barrier parameter |
| Y | dual solution |
| DY | Newton direction |
| X | destination |
Definition at line 140 of file sdpcone.c.
Referenced by SDPConeComputeX().
| 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.
| 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.
Referenced by SDPConeComputeX().
| int SDPConeComputeXX | ( | SDPCone | sdpcone, |
| int | blockj, | ||
| DSDPVec | DY, | ||
| double | mu, | ||
| DSDPDualMat | S, | ||
| DSDPVMat | X | ||
| ) |
Compute X.
| 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().
| int SDPConeDestroy | ( | SDPCone | sdpcone | ) |
Free data structure of the cone.
| sdpcone | semidefinite cone |
Definition at line 350 of file sdpconesetup.c.
| int SDPConeMultiply | ( | SDPCone | sdpcone, |
| int | blockj, | ||
| double | mu, | ||
| DSDPVec | vrow, | ||
| DSDPVec | vin, | ||
| DSDPVec | vout | ||
| ) |
Compute the gradient to the barrier term.
| 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.
| int SDPConeSetRIdentity | ( | SDPCone | sdpcone, |
| int | blockj, | ||
| int | n, | ||
| double | rr | ||
| ) |
Add identify matrix to dual matrix.
| 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().
Allocate data structure of the cone.
| sdpcone | semidefinite cone |
| yy0 | variable vector |
Definition at line 249 of file sdpconesetup.c.
| int SDPConeSetup2 | ( | SDPCone | sdpcone, |
| DSDPVec | yy0, | ||
| DSDPSchurMat | M | ||
| ) |
Allocate data structure of the cone.
| sdpcone | semidefinite cone |
| yy0 | variable vector |
| M | Schur matrix. |
Definition at line 224 of file sdpconesetup.c.