dsdpsdp.h
Go to the documentation of this file.
#ifndef __TAO_DSDPSDP_H
#define __TAO_DSDPSDP_H
#include "dsdpschurmat.h"
#include "dsdpbasictypes.h"
#include "dsdpvec.h"
#include "sdpconevec.h"
#include "dsdpdatamat.h"
#include "dsdpdualmat.h"
#include "dsdpxmat.h"
#include "dsdpdsmat.h"
#include "dsdplanczos.h"
typedef enum { SDPCONEEXIST=1, SDPCONESETUP1=2 } SDPConeStatus;
typedef struct{
int m;
int *nnzblocks;
int **nzblocks;
int *ttnzmat;
int **nnzmats;
int **idA;
int *idAP;
} DSDPDataTranspose;
typedef struct{
int maxnnzmats;
int nnzmats;
int *nzmat;
DSDPDataMat *A;
double r; /* Multiple of Identity added to S to make it psd */
double scl;
} DSDPBlockData;
typedef struct{
DSDPBlockData ADATA;
DSDPLanczosStepLength Lanczos; /* For Lanczos steplength routine */
int n; /* Dimensions */
double gammamu; /* Scale Barrier, used only by user option */
double bmu; /* For LMI, not used */
char format; /* Packed Symmetric, Full Symmetric, Lower,Upper */
int nnz;
SDPConeStatus status;
SDPConeVec W;
SDPConeVec W2;
DSDPIndex IS;
DSDPDualMat S; /* Dual variable matrices */
DSDPDualMat SS; /* Compute primal variable matrices */
DSDPDSMat DS; /* Dual variable step matrices */
DSDPVMat T; /* Work Array and Primal variable matrice X */
} SDPblk;
struct SDPCone_C {
int keyid;
/* Dimensions */
int m, nn;
/* Data in block format */
int nblocks;
SDPblk *blk;
/* Transpose of Data */
DSDPDataTranspose ATR;
/* Work space */
DSDPVec Work, Work2;
/* Current Solution */
DSDPVec YY,YX,DYX;
double xmakermu;
int optype;
DSDP dsdp;
};
#define SDPCONEKEY 5438
#define SDPConeValid(a) {if (!(a)||((a)->keyid!=SDPCONEKEY)){ DSDPSETERR(101,"DSDPERROR: Invalid SDPCone object\n");}}
#define DSDPCHKBLOCKERR(a,b); { if (b){ DSDPSETERR1(b,"Block Number: %d,\n",a);} }
#define DSDPCHKVARERR(a,b); { if (b){ DSDPSETERR1(b,"Variable Number: %d,\n",a);} }
extern int DSDPSetDataMatZero(DSDPDataMat*);
#include "dsdp5.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Operations on the Data */
extern int DSDPBlockDataInitialize(DSDPBlockData*);
extern int DSDPBlockDataAllocate(DSDPBlockData*, int);
extern int DSDPBlockAddDataMatrix(DSDPBlockData*,int, struct DSDPDataMat_Ops*, void*);
extern int DSDPBlockSetDataMatrix(DSDPBlockData*,int, struct DSDPDataMat_Ops*, void*);
extern int DSDPBlockRemoveDataMatrix(DSDPBlockData*,int);
extern int DSDPBlockDataMarkNonzeroMatrices(DSDPBlockData*,int*);
extern int DSDPBlockDataRowSparsity(DSDPBlockData*,int,int[],int[],int);
extern int DSDPBlockASum(DSDPBlockData*,double,DSDPVec,DSDPVMat);
extern int DSDPBlockADot(DSDPBlockData*,double,DSDPVec,DSDPVMat,DSDPVec);
extern int DSDPBlockvAv(DSDPBlockData*,double,DSDPVec,SDPConeVec,DSDPVec);
extern int DSDPBlockDataDestroy(DSDPBlockData*);
extern int DSDPBlockCheck(DSDPBlockData*,SDPConeVec,DSDPVMat);
extern int DSDPBlockANorm2(DSDPBlockData*, DSDPVec, int);
extern int DSDPBlockView(DSDPBlockData*);
extern int DSDPBlockView2(DSDPBlockData*);
extern int DSDPBlockCountNonzeroMatrices(DSDPBlockData *,int*);
extern int DSDPBlockGetMatrix(DSDPBlockData*,int,int*,double*,DSDPDataMat*);
extern int DSDPBlockFactorData(DSDPBlockData*,DSDPVMat,SDPConeVec);
extern int DSDPBlockTakeDownData(DSDPBlockData*);
extern int DSDPBlockDataRank(DSDPBlockData*,int*,int);
extern int DSDPBlockTakeDown(SDPblk*);
extern int DSDPBlockInitialize(SDPblk*);
extern int DSDPBlockEventInitialize(void);
extern int DSDPBlockEventZero(void);
extern int DSDPDataMatCheck(DSDPDataMat,SDPConeVec,DSDPIndex,DSDPVMat);
/* Operations on the Transpose of the Data */
extern int DSDPDataTransposeInitialize(DSDPDataTranspose*);
extern int DSDPDataTransposeTakeDown(DSDPDataTranspose*);
extern int DSDPDataTransposeSetup(DSDPDataTranspose*,SDPblk*,int,int);
extern int DSDPUseDefaultDualMatrix(SDPCone);
extern int SDPConeSetup(SDPCone,DSDPVec);
extern int SDPConeSetup2(SDPCone,DSDPVec,DSDPSchurMat);
extern int SDPConeComputeHessian(SDPCone,double,DSDPSchurMat,DSDPVec,DSDPVec);
extern int SDPConeMultiply(SDPCone,int,double,DSDPVec,DSDPVec,DSDPVec);
extern int SDPConeComputeRHS(SDPCone, int, double, DSDPVec, DSDPVec,DSDPVec);
extern int SDPConeComputeXX(SDPCone,int,DSDPVec,double,DSDPDualMat, DSDPVMat);
extern int SDPConeDestroy(SDPCone);
extern int SDPConeCheckJ(SDPCone,int);
extern int SDPConeCheckN(SDPCone,int, int);
extern int SDPConeCheckM(SDPCone,int);
extern int SDPConeCheckStorageFormat(SDPCone,int, char);
extern int SDPConeComputeSS(SDPCone, int, DSDPVec, DSDPVMat);
extern int SDPConeComputeXDot(SDPCone,int,DSDPVec,DSDPVMat,DSDPVec,double*,double*, double *);
extern int SDPConeComputeX3(SDPCone,int,double,DSDPVec,DSDPVec,DSDPVMat);
/* extern int DSDPPrintSDPA(TAO_DSDP *); */
extern int DSDPMakeVMat(char, int, DSDPVMat*);
extern int DSDPMakeVMatWithArray(char, double[], int, int, DSDPVMat*);
extern int DSDPSetDualMatrix(SDPCone sdpcone,int (*createdualmatrix)(DSDPBlockData*,DSDPVec,DSDPVMat,DSDPVec,DSDPVec,DSDPDualMat*,DSDPDualMat*,DSDPDSMat*,void*),void*);
extern int DSDPAddSDP(DSDP,SDPCone);
#ifdef __cplusplus
}
#endif
extern int SDPConeSetRIdentity(SDPCone,int,int,double);
extern int DSDPDualMatEventInitialize(void);
extern int DSDPVMatEventInitialize(void);
extern int DSDPDualMatEventZero(void);
extern int DSDPVMatEventZero(void);
#endif
dsdp5.h
The API to DSDP for those applications using DSDP as a subroutine library.
dsdpbasictypes.h
Solver, solution types, termination codes,.
dsdpdatamat.h
The interface between the SDPCone and the data matrices.
dsdpdsmat.h
The interface between the SDPCone and the Delta S matrix.
dsdpdualmat.h
The interface between the SDPCone and the matrix S.
dsdplanczos.h
Lanczos procedure determines the maximum step length.
dsdpschurmat.h
Methods of a Schur Matrix.
DSDPBlockvAv
int DSDPBlockvAv(DSDPBlockData *, double, DSDPVec, SDPConeVec, DSDPVec)
Set VAV[i] to aa * Alpha[i] * V' A[i] V.
Definition dsdpblock.c:84
SDPConeCheckStorageFormat
int SDPConeCheckStorageFormat(SDPCone, int, char)
Check validity of parameters.
Definition dsdpadddata.c:101
DSDPDataMatCheck
int DSDPDataMatCheck(DSDPDataMat, SDPConeVec, DSDPIndex, DSDPVMat)
Check correctness of operations on the data.
Definition dsdpblock.c:498
DSDPDataTransposeInitialize
int DSDPDataTransposeInitialize(DSDPDataTranspose *)
Initialize transpose structure for data.
Definition sdpconesetup.c:15
DSDPMakeVMatWithArray
int DSDPMakeVMatWithArray(char, double[], int, int, DSDPVMat *)
Allocate V matrix using the given array.
Definition sdpsss.c:381
SDPConeMultiply
int SDPConeMultiply(SDPCone, int, double, DSDPVec, DSDPVec, DSDPVec)
Compute the gradient to the barrier term.
Definition sdpcompute.c:182
DSDPBlockAddDataMatrix
int DSDPBlockAddDataMatrix(DSDPBlockData *, int, struct DSDPDataMat_Ops *, void *)
Add data matrix into SDP block.
Definition dsdpblock.c:381
DSDPBlockView
int DSDPBlockView(DSDPBlockData *)
Print the structure of the block.
Definition dsdpblock.c:454
SDPConeComputeX3
int SDPConeComputeX3(SDPCone, int, double, DSDPVec, DSDPVec, DSDPVMat)
Compute the matrix X with the given information.
Definition sdpcone.c:140
SDPConeComputeRHS
int SDPConeComputeRHS(SDPCone, int, double, DSDPVec, DSDPVec, DSDPVec)
Compute the gradient to the barrier term.
Definition sdpcompute.c:125
DSDPBlockView2
int DSDPBlockView2(DSDPBlockData *)
Print the data.
Definition dsdpblock.c:474
DSDPBlockDataMarkNonzeroMatrices
int DSDPBlockDataMarkNonzeroMatrices(DSDPBlockData *, int *)
Mark which variable in block have a data matrix.
Definition dsdpblock.c:254
DSDPBlockDataAllocate
int DSDPBlockDataAllocate(DSDPBlockData *, int)
Allocate some structures.
Definition dsdpblock.c:221
SDPConeCheckJ
int SDPConeCheckJ(SDPCone, int)
Check validity of parameter.
Definition dsdpadddata.c:31
SDPConeComputeHessian
int SDPConeComputeHessian(SDPCone, double, DSDPSchurMat, DSDPVec, DSDPVec)
Compute the Hessian to the barrier term.
Definition sdpcompute.c:30
DSDPBlockADot
int DSDPBlockADot(DSDPBlockData *, double, DSDPVec, DSDPVMat, DSDPVec)
Compute inner product of XX with data matrices.
Definition dsdpblock.c:49
DSDPBlockASum
int DSDPBlockASum(DSDPBlockData *, double, DSDPVec, DSDPVMat)
Sum the data matrices.
Definition dsdpblock.c:20
DSDPDataTransposeSetup
int DSDPDataTransposeSetup(DSDPDataTranspose *, SDPblk *, int, int)
Set up transpose structure for data.
Definition sdpconesetup.c:36
SDPConeComputeXX
int SDPConeComputeXX(SDPCone, int, DSDPVec, double, DSDPDualMat, DSDPVMat)
Compute X.
Definition sdpcompute.c:235
SDPConeSetup2
int SDPConeSetup2(SDPCone, DSDPVec, DSDPSchurMat)
Allocate data structure of the cone.
Definition sdpconesetup.c:224
DSDPBlockDataInitialize
int DSDPBlockDataInitialize(DSDPBlockData *)
Set pointers to null.
Definition dsdpblock.c:163
DSDPBlockDataRowSparsity
int DSDPBlockDataRowSparsity(DSDPBlockData *, int, int[], int[], int)
Determine sparsity pattern of data.
Definition dsdpblock.c:330
DSDPBlockSetDataMatrix
int DSDPBlockSetDataMatrix(DSDPBlockData *, int, struct DSDPDataMat_Ops *, void *)
Set data matrix into SDP block.
Definition dsdpblock.c:406
DSDPDataTransposeTakeDown
int DSDPDataTransposeTakeDown(DSDPDataTranspose *)
Free transpose structure for data.
Definition sdpconesetup.c:89
SDPConeSetRIdentity
int SDPConeSetRIdentity(SDPCone, int, int, double)
Add identify matrix to dual matrix.
Definition dsdpadddatamat.c:438
DSDPBlockFactorData
int DSDPBlockFactorData(DSDPBlockData *, DSDPVMat, SDPConeVec)
Factor the data matrices.
Definition dsdpblock.c:113
DSDPBlockGetMatrix
int DSDPBlockGetMatrix(DSDPBlockData *, int, int *, double *, DSDPDataMat *)
Get a data matrix from a block of data.
Definition dsdpblock.c:307
DSDPBlockDataDestroy
int DSDPBlockDataDestroy(DSDPBlockData *)
Free the data matrices.
Definition dsdpblock.c:195
SDPConeDestroy
int SDPConeDestroy(SDPCone)
Free data structure of the cone.
Definition sdpconesetup.c:350
SDPConeCheckN
int SDPConeCheckN(SDPCone, int, int)
Check validity of parameter.
Definition dsdpadddata.c:48
DSDPSetDataMatZero
int DSDPSetDataMatZero(DSDPDataMat *)
Make a data matrix a zero matrix.
Definition dsdpadddatamat.c:537
SDPConeSetup
int SDPConeSetup(SDPCone, DSDPVec)
Allocate data structure of the cone.
Definition sdpconesetup.c:249
SDPConeCheckM
int SDPConeCheckM(SDPCone, int)
Check validity of parameter.
Definition dsdpadddata.c:68
DSDPBlockCountNonzeroMatrices
int DSDPBlockCountNonzeroMatrices(DSDPBlockData *, int *)
Count how many data matrices are in a block of data.
Definition dsdpblock.c:272
SDPConeComputeSS
int SDPConeComputeSS(SDPCone, int, DSDPVec, DSDPVMat)
Sum the data matrices.
Definition sdpcone.c:18
DSDPBlockInitialize
int DSDPBlockInitialize(SDPblk *)
Initialize data structures in one block of the cone.
Definition sdpconesetup.c:279
DSDPBlockTakeDownData
int DSDPBlockTakeDownData(DSDPBlockData *)
Free structures in block of data.
Definition dsdpblock.c:182
DSDPBlockTakeDown
int DSDPBlockTakeDown(SDPblk *)
Free data structures in one block of the cone.
Definition sdpconesetup.c:305
SDPConeComputeXDot
int SDPConeComputeXDot(SDPCone, int, DSDPVec, DSDPVMat, DSDPVec, double *, double *, double *)
Compute inner product of X with the Data, S, and norm of X.
Definition sdpcone.c:111
DSDPBlockRemoveDataMatrix
int DSDPBlockRemoveDataMatrix(DSDPBlockData *, int)
Remove a data matrix.
Definition dsdpblock.c:351
DSDPAddSDP
int DSDPAddSDP(DSDP, SDPCone)
Pass a semidefinite cone to the solver.
Definition sdpkcone.c:331
DSDPMakeVMat
int DSDPMakeVMat(char, int, DSDPVMat *)
Allocate V matrix.
Definition sdpsss.c:351
dsdpvec.h
Vector operations used by the solver.
DSDPVec
struct DSDPVec_C DSDPVec
This object hold m+2 variables: a scaling of C, the y variables, and r.
Definition dsdpvec.h:25
dsdpxmat.h
The interface between the SDPCone and the dense matrix array.
sdpconevec.h
Each block of the SDPCone has two vectors of appropriate size.
DSDPBlockData
Internal structure for data in one block of semidefintie.
Definition dsdpsdp.h:39
DSDPDSMat_C
Symmetric Delta S matrix for one block in the semidefinite cone.
Definition dsdpdsmat.h:23
DSDPDataMat_C
Symmetric data matrix for one block in the semidefinite cone.
Definition dsdpdatamat.h:15
DSDPDataMat_Ops
Table of function pointers that operate on the data matrix.
Definition dsdpdatamat_impl.h:15
DSDPDataTranspose
Internal structure for transpose of data.
Definition dsdpsdp.h:25
DSDPDualMat_C
Represents an S matrix for one block in the semidefinite cone.
Definition dsdpdualmat.h:18
DSDPLanczosStepLength
Apply Lanczos prodedure to find distance to boundary.
Definition dsdplanczos.h:13
DSDPSchurMat_C
Schur complement matrix whose solution is the Newton direction.
Definition dsdpschurmat.h:35
DSDPVMat_C
Dense symmetric matrix for one block in the semidefinite cone.
Definition dsdpxmat.h:17
DSDP_C
Internal structures for the DSDP solver.
Definition dsdp.h:65
SDPConeVec_C
Vector whose length corresponds to dimension of a block in a cone.
Definition sdpconevec.h:13
SDPCone_C
Internal structure for semidefinite cone.
Definition dsdpsdp.h:80
SDPblk
Internal structure for block of semidefinite cone.
Definition dsdpsdp.h:52