dsdpcops.c
Go to the documentation of this file.
#include "dsdp.h"
#include "dsdpsys.h"
#define DSDPCHKCONEERR(a,b); { if (b){ DSDPSETERR1(b,"Cone Number: %d,\n",a);} }
static int ConeSetup=0,ConeComputeS=0,ConeComputeSS=0,ConeComputeH=0,ConeHMultiplyAdd=0,ConeMaxPStep=0,ConeMaxDStep=0,ConePotential=0,ConeComputeX=0,ConeView=0,ConeDestroy=0,ConeXEigs=0,ConeRHS=0,ConeInvertS=0;
static int DSDPRegisterConeEvents(void);
int DSDPSetSchurMatOps(DSDP,struct DSDPSchurMat_Ops*, void*);
int DSDPAddSchurRow(DSDP,int, DSDPVec);
/*
int DSDPIdentifySchurColumns(DSDP,int, int*, int*, int);
*/
#undef __FUNCT__
#define __FUNCT__ "DSDPZeroConeEvents"
static int DSDPZeroConeEvents(){
DSDPFunctionBegin;
ConeSetup=0;ConeComputeS=0;ConeComputeSS=0;ConeComputeH=0;ConeHMultiplyAdd=0;ConeMaxPStep=0;ConeMaxDStep=0;ConePotential=0;ConeComputeX=0;ConeView=0;ConeDestroy=0;ConeXEigs=0;ConeRHS=0;ConeInvertS=0;
DSDPFunctionReturn(0);
}
#undef __FUNCT__
#define __FUNCT__ "DSDPRegisterConeEvents"
static int DSDPRegisterConeEvents(){
DSDPFunctionBegin;
DSDPEventLogRegister("Cone Setup 1&2",&ConeSetup);
DSDPEventLogRegister("Cone Invert S",&ConeInvertS);
DSDPEventLogRegister("Cone RHS",&ConeRHS);
DSDPEventLogRegister("Cone Compute Newton Eq.",&ConeComputeH);
DSDPEventLogRegister("Cone Newton Multiply-Add",&ConeHMultiplyAdd);
DSDPEventLogRegister("Cone Max P Step Length",&ConeMaxPStep);
DSDPEventLogRegister("Cone Compute and Factor SP",&ConeComputeSS);
DSDPEventLogRegister("Cone Max D Step Length",&ConeMaxDStep);
DSDPEventLogRegister("Cone Compute and Factor S",&ConeComputeS);
DSDPEventLogRegister("Cone Potential",&ConePotential);
DSDPEventLogRegister("Cone View",&ConeView);
DSDPEventLogRegister("Cone Compute X",&ConeComputeX);
DSDPEventLogRegister("Cone X Residuals",&ConeXEigs);
DSDPEventLogRegister("Cone Destroy",&ConeDestroy);
DSDPFunctionReturn(0);
}
#undef __FUNCT__
#define __FUNCT__ "DSDPSetUpCones"
int DSDPSetUpCones(DSDP dsdp){
int info,kk;
DSDPVec yy0=dsdp->y;
DSDPFunctionBegin;
info=DSDPRegisterConeEvents();
DSDPEventLogBegin(ConeSetup);
for (kk=0;kk<dsdp->ncones;kk++){
DSDPEventLogBegin(dsdp->K[kk].coneid);
info=DSDPConeSetUp(dsdp->K[kk].cone,yy0);DSDPCHKCONEERR(kk,info);
DSDPEventLogEnd(dsdp->K[kk].coneid);
}
DSDPEventLogEnd(ConeSetup);
DSDPFunctionReturn(0);
}
#undef __FUNCT__
#define __FUNCT__ "DSDPSetUpCones2"
int DSDPSetUpCones2(DSDP dsdp, DSDPVec yy0, DSDPSchurMat M){
int info,kk;
DSDPFunctionBegin;
DSDPEventLogBegin(ConeSetup);
for (kk=0;kk<dsdp->ncones;kk++){
DSDPEventLogBegin(dsdp->K[kk].coneid);
info=DSDPConeSetUp2(dsdp->K[kk].cone,yy0,M);DSDPCHKCONEERR(kk,info);
DSDPEventLogEnd(dsdp->K[kk].coneid);
}
DSDPEventLogEnd(ConeSetup);
DSDPFunctionReturn(0);
}
#undef __FUNCT__
#define __FUNCT__ "DSDPDestroyCones"
int DSDPDestroyCones(DSDP dsdp){
int info,kk,ncones=dsdp->ncones;
DSDPFunctionBegin;
DSDPEventLogBegin(ConeDestroy);
for (kk=ncones-1;kk>=0; kk--){
DSDPEventLogBegin(dsdp->K[kk].coneid);
info=DSDPConeDestroy(&dsdp->K[kk].cone);DSDPCHKCONEERR(kk,info);
DSDPEventLogEnd(dsdp->K[kk].coneid);
info=DSDPConeInitialize(&dsdp->K[kk].cone);DSDPCHKCONEERR(kk,info);
dsdp->ncones--;
}
if (dsdp->maxcones>0){
DSDPFREE(&dsdp->K,&info);DSDPCHKERR(info);
dsdp->K=0;
dsdp->maxcones=0;
}
DSDPEventLogEnd(ConeDestroy);
info=DSDPZeroConeEvents();DSDPCHKERR(info);
DSDPFunctionReturn(0);
}
#undef __FUNCT__
#define __FUNCT__ "DSDPComputeHessian"
int DSDPComputeHessian( DSDP dsdp , DSDPSchurMat M, DSDPVec vrhs1, DSDPVec vrhs2){
int info,kk; double r;
DSDPFunctionBegin;
DSDPEventLogBegin(ConeComputeH);
dsdp->schurmu=dsdp->mutarget;
info=DSDPVecGetR(dsdp->y,&r);DSDPCHKERR(info);
info=DSDPSchurMatSetR(dsdp->M,r);DSDPCHKERR(info);
info=DSDPSchurMatZeroEntries(M);DSDPCHKERR(info);
info=DSDPVecZero(vrhs1);DSDPCHKERR(info);
info=DSDPVecZero(vrhs2);DSDPCHKERR(info);
info=DSDPVecZero(M.schur->rhs3);DSDPCHKERR(info);
info=DSDPObjectiveGH(dsdp,M,vrhs1); DSDPCHKERR(info);
for (kk=dsdp->ncones-1;kk>=0;kk--){
DSDPEventLogBegin(dsdp->K[kk].coneid);
info=DSDPConeComputeHessian(dsdp->K[kk].cone,dsdp->schurmu,M,vrhs1,vrhs2);DSDPCHKCONEERR(kk,info);
DSDPEventLogEnd(dsdp->K[kk].coneid);
}
info=DSDPSchurMatAssemble(M);DSDPCHKERR(info);
/* DSDPSchurMatView(M); */
info=DSDPSchurMatReducePVec(M,vrhs1);DSDPCHKERR(info);
info=DSDPSchurMatReducePVec(M,vrhs2);DSDPCHKERR(info);
info=DSDPSchurMatReducePVec(M,M.schur->rhs3);DSDPCHKERR(info);
if (0 && dsdp->UsePenalty==DSDPNever){
info=DSDPVecAXPY(1.0,M.schur->rhs3,vrhs2);DSDPCHKERR(info);
info=DSDPVecZero(M.schur->rhs3);DSDPCHKERR(info);
info=DSDPVecZero(M.schur->dy3);DSDPCHKERR(info);
info=DSDPVecSetR(vrhs1,0);DSDPCHKERR(info);
info=DSDPVecSetR(vrhs2,r);DSDPCHKERR(info);
}
DSDPEventLogEnd(ConeComputeH);
DSDPFunctionReturn(0);
}
#undef __FUNCT__
#define __FUNCT__ "DSDPHessianMultiplyAdd"
int DSDPHessianMultiplyAdd( DSDP dsdp , DSDPVec v, DSDPVec vv){
int info,kk;
DSDPVec vrow=dsdp->sles->BR;
DSDPFunctionBegin;
DSDPEventLogBegin(ConeHMultiplyAdd);
info=DSDPSchurMatRowScaling(dsdp->M,vrow);DSDPCHKERR(info);
for (kk=0;kk<dsdp->ncones;kk++){
DSDPEventLogBegin(dsdp->K[kk].coneid);
info=DSDPConeMultiplyAdd(dsdp->K[kk].cone,dsdp->schurmu,vrow,v,vv);DSDPCHKCONEERR(kk,info);
DSDPEventLogEnd(dsdp->K[kk].coneid);
}
info=DSDPSchurMatReducePVec(dsdp->M,vv);DSDPCHKERR(info);
DSDPEventLogEnd(ConeHMultiplyAdd);
DSDPFunctionReturn(0);
}
#undef __FUNCT__
#define __FUNCT__ "DSDPComputeG"
int DSDPComputeG( DSDP dsdp , DSDPVec vt, DSDPVec vrhs1, DSDPVec vrhs2){
int info,kk; double r;
DSDPFunctionBegin;
DSDPEventLogBegin(ConeRHS);
info=DSDPVecZero(vrhs1);DSDPCHKERR(info);
info=DSDPVecZero(vrhs2);DSDPCHKERR(info);
info=DSDPVecGetR(dsdp->y,&r);DSDPCHKERR(info);
info=DSDPSchurMatSetR(dsdp->M,r);DSDPCHKERR(info);
info=DSDPSchurMatRowScaling(dsdp->M,vt);DSDPCHKERR(info);
info=DSDPObjectiveGH(dsdp,dsdp->M,vrhs1); DSDPCHKERR(info);
if (0 && r==0){info=DSDPVecSetR(vrhs1,0);info=DSDPVecSetR(vrhs2,0);}
/* info=DSDPVecScale(1.0/dsdp->schurmu,vrhs1); DSDPCHKERR(info); */
for (kk=0;kk<dsdp->ncones;kk++){
DSDPEventLogBegin(dsdp->K[kk].coneid);
info=DSDPConeComputeRHS(dsdp->K[kk].cone,dsdp->schurmu,vt,vrhs1,vrhs2);DSDPCHKCONEERR(kk,info);
DSDPEventLogEnd(dsdp->K[kk].coneid);
}
DSDPEventLogEnd(ConeRHS);
info=DSDPSchurMatReducePVec(dsdp->M,vrhs1);DSDPCHKERR(info);
info=DSDPSchurMatReducePVec(dsdp->M,vrhs2);DSDPCHKERR(info);
DSDPFunctionReturn(0);
}
#undef __FUNCT__
#define __FUNCT__ "DSDPComputeANorm2"
int DSDPComputeANorm2( DSDP dsdp , DSDPVec Anorm2){
int info,kk;
DSDPFunctionBegin;
for (kk=0;kk<dsdp->ncones;kk++){
DSDPEventLogBegin(dsdp->K[kk].coneid);
info=DSDPConeANorm2(dsdp->K[kk].cone,Anorm2);DSDPCHKCONEERR(kk,info);
DSDPEventLogEnd(dsdp->K[kk].coneid);
}
DSDPFunctionReturn(0);
}
#undef __FUNCT__
#define __FUNCT__ "DSDPComputeSS"
int DSDPComputeSS(DSDP dsdp, DSDPVec Y, DSDPDualFactorMatrix flag, DSDPTruth *ispsdefinite){
int info,kk;
DSDPTruth psd=DSDP_TRUE;
DSDPFunctionBegin;
if (flag==DUAL_FACTOR){
DSDPEventLogBegin(ConeComputeS);
} else if (flag==PRIMAL_FACTOR){
DSDPEventLogBegin(ConeComputeSS);
}
for (kk=dsdp->ncones-1; kk>=0 && psd==DSDP_TRUE;kk--){
DSDPEventLogBegin(dsdp->K[kk].coneid);
info=DSDPConeComputeS(dsdp->K[kk].cone,Y,flag,&psd); DSDPCHKCONEERR(kk,info);
DSDPEventLogEnd(dsdp->K[kk].coneid);
}
*ispsdefinite=psd;
if (flag==DUAL_FACTOR){
DSDPEventLogEnd(ConeComputeS);
} else if (flag==PRIMAL_FACTOR){
DSDPEventLogEnd(ConeComputeSS);
}
DSDPFunctionReturn(0);
}
#undef __FUNCT__
#define __FUNCT__ "DSDPInvertS"
int DSDPInvertS(DSDP dsdp){
int info,kk;
DSDPFunctionBegin;
DSDPEventLogBegin(ConeInvertS);
for (kk=0;kk<dsdp->ncones;kk++){
DSDPEventLogBegin(dsdp->K[kk].coneid);
info=DSDPConeInvertS(dsdp->K[kk].cone); DSDPCHKCONEERR(kk,info);
DSDPEventLogEnd(dsdp->K[kk].coneid);
}
DSDPEventLogEnd(ConeInvertS);
DSDPFunctionReturn(0);
}
#undef __FUNCT__
#define __FUNCT__ "DSDPComputeMaxStepLength"
int DSDPComputeMaxStepLength(DSDP dsdp, DSDPVec DY, DSDPDualFactorMatrix flag, double *maxsteplength){
int info,kk;
double msteplength=1.0e30,conesteplength;
DSDPFunctionBegin;
if (flag==DUAL_FACTOR){
DSDPEventLogBegin(ConeMaxDStep);
} else if (flag==PRIMAL_FACTOR){
DSDPEventLogBegin(ConeMaxPStep);
}
for (kk=0;kk<dsdp->ncones;kk++){
DSDPEventLogBegin(dsdp->K[kk].coneid);
conesteplength=1.0e20;
info=DSDPConeComputeMaxStepLength(dsdp->K[kk].cone,DY,flag,&conesteplength);DSDPCHKCONEERR(kk,info);
msteplength=DSDPMin(msteplength,conesteplength);
DSDPEventLogEnd(dsdp->K[kk].coneid);
}
*maxsteplength=msteplength;
if (flag==DUAL_FACTOR){
DSDPEventLogEnd(ConeMaxDStep);
} else if (flag==PRIMAL_FACTOR){
DSDPEventLogEnd(ConeMaxPStep);
}
DSDPFunctionReturn(0);
}
#undef __FUNCT__
#define __FUNCT__ "DSDPPassXVectors"
int DSDPPassXVectors(DSDP dsdp, double mu, DSDPVec Y, DSDPVec DY){
int info,kk;
DSDPFunctionBegin;
for (kk=0;kk<dsdp->ncones;kk++){
DSDPEventLogBegin(dsdp->K[kk].coneid);
info=DSDPConeSetXMaker(dsdp->K[kk].cone,mu,Y,DY);DSDPCHKCONEERR(kk,info);
DSDPEventLogEnd(dsdp->K[kk].coneid);
}
DSDPFunctionReturn(0);
}
#undef __FUNCT__
#define __FUNCT__ "DSDPGetConicDimension"
int DSDPGetConicDimension(DSDP dsdp, double *n){
int info,kk;
double nn,nnn=0;
DSDPFunctionBegin;
for (kk=0;kk<dsdp->ncones;kk++){
nn=0;
info=DSDPConeGetDimension(dsdp->K[kk].cone,&nn);DSDPCHKCONEERR(kk,info);
nnn+=nn;
}
*n=nnn;
DSDPFunctionReturn(0);
}
#undef __FUNCT__
#define __FUNCT__ "DSDPViewCones"
int DSDPViewCones(DSDP dsdp){
int info,kk;
DSDPFunctionBegin;
DSDPEventLogBegin(ConeView);
for (kk=0;kk<dsdp->ncones;kk++){
DSDPEventLogBegin(dsdp->K[kk].coneid);
info=DSDPConeView(dsdp->K[kk].cone);DSDPCHKCONEERR(kk,info);
DSDPEventLogEnd(dsdp->K[kk].coneid);
}
DSDPEventLogEnd(ConeView);
DSDPFunctionReturn(0);
}
#undef __FUNCT__
#define __FUNCT__ "DSDPMonitorCones"
int DSDPMonitorCones(DSDP dsdp,int tag){
int info,kk;
DSDPFunctionBegin;
DSDPEventLogBegin(ConeView);
for (kk=0;kk<dsdp->ncones;kk++){
DSDPEventLogBegin(dsdp->K[kk].coneid);
info=DSDPConeMonitor(dsdp->K[kk].cone,tag);DSDPCHKCONEERR(kk,info);
DSDPEventLogEnd(dsdp->K[kk].coneid);
}
DSDPEventLogEnd(ConeView);
DSDPFunctionReturn(0);
}
#undef __FUNCT__
#define __FUNCT__ "DSDPSparsityInSchurMat"
int DSDPSchurSparsity(DSDP dsdp, int row, int rnnz[], int m){
int info,kk;
DSDPFunctionBegin;
for (kk=0;kk<dsdp->ncones;kk++){
/* DSDPEventLogBegin(dsdp->K[kk].coneid); */
info=DSDPConeSparsityInSchurMat(dsdp->K[kk].cone,row,rnnz,m+2);DSDPCHKCONEERR(kk,info);
/* DSDPEventLogEnd(dsdp->K[kk].coneid); */
}
DSDPFunctionReturn(0);
}
#undef __FUNCT__
#define __FUNCT__ "DSDPComputeLogSDeterminant"
int DSDPComputeLogSDeterminant(DSDP dsdp, double *logdet){
int info,kk;
double coneobjective,conepotential,llogdet=0;
DSDPFunctionBegin;
DSDPEventLogBegin(ConePotential);
for (kk=0;kk<dsdp->ncones;kk++){
DSDPEventLogBegin(dsdp->K[kk].coneid);
coneobjective=0;conepotential=0;
info=DSDPConeComputeLogSDeterminant(dsdp->K[kk].cone,&coneobjective,&conepotential);DSDPCHKCONEERR(kk,info);
llogdet+=conepotential;
DSDPEventLogEnd(dsdp->K[kk].coneid);
}
*logdet=llogdet;
DSDPEventLogEnd(ConePotential);
DSDPFunctionReturn(0);
}
#undef __FUNCT__
#define __FUNCT__ "DSDPSetCone"
int DSDPSetCone(DSDP dsdp,DSDPCone tcone){
int info,i,tc;
char conename[100];
DCone *ccones;
DSDPFunctionBegin;
if (dsdp->ncones>=dsdp->maxcones){
tc=2*dsdp->maxcones+4;
DSDPCALLOC2(&ccones,DCone,tc,&info);DSDPCHKERR(info);
for (i=0;i<dsdp->ncones;i++){ccones[i].cone=dsdp->K[i].cone;}
for (i=0;i<dsdp->ncones;i++){ccones[i].coneid=dsdp->K[i].coneid;}
DSDPFREE(&dsdp->K,&info);DSDPCHKERR(info);
dsdp->K=ccones;
dsdp->maxcones=tc;
}
info=DSDPGetConeName(tcone,conename,100);DSDPCHKERR(info);
DSDPEventLogRegister(conename,&tc);
dsdp->K[dsdp->ncones].cone=tcone;
dsdp->K[dsdp->ncones].coneid=tc;
dsdp->ncones++;
DSDPFunctionReturn(0);
}
#undef __FUNCT__
#define __FUNCT__ "DSDPAddCone"
int DSDPAddCone(DSDP dsdp,struct DSDPCone_Ops* dsdpops, void* dsdpcone){
int info;
DSDPCone K;
DSDPFunctionBegin;
info=DSDPConeInitialize(&K); DSDPCHKERR(info);
info=DSDPConeSetData(&K,dsdpops,dsdpcone); DSDPCHKERR(info);
info=DSDPSetCone(dsdp,K); DSDPCHKERR(info);
DSDPFunctionReturn(0);
}
#undef __FUNCT__
#define __FUNCT__ "DSDPSetSchurMatOps"
int DSDPSetSchurMatOps(DSDP dsdp,struct DSDPSchurMat_Ops* sops, void* mdata){
int info;
DSDPFunctionBegin;
info=DSDPSchurMatSetData(&dsdp->M,sops,mdata);DSDPCHKERR(info);
DSDPFunctionReturn(0);
}
#undef __FUNCT__
#define __FUNCT__ "DSDPSetSchurRow"
int DSDPAddSchurRow(DSDP dsdp,int row, DSDPVec R){
int info;
DSDPFunctionBegin;
info=DSDPSchurMatAddRow(dsdp->M,row,1.0,R);DSDPCHKERR(info);
DSDPFunctionReturn(0);
}
/*
#undef __FUNCT__
#define __FUNCT__ "DSDPIdentifySchurColumns"
int DSDPIdentifySchurColumns(DSDP dsdp,int row, int *mcol, int *ncols, int m){
DSDPFunctionBegin;
int info;
DSDPVec V;
info=DSDPSchurMatRowColumnScaling(dsdp->M,row,V,ncols); DSDPCHKERR(info);
DSDPFunctionReturn(1);
}
*/
#undef __FUNCT__
#define __FUNCT__ "DSDPComputeXVariables"
int DSDPComputeXVariables(DSDP dsdp, double xmakermu, DSDPVec xmakery, DSDPVec xmakerdy, DSDPVec AX, double *tracexs){
int kk,info;
double ttracexs=0,tttracexs=0,tracex;
DSDPFunctionBegin;
DSDPEventLogBegin(ConeComputeX);
info=DSDPVecZero(AX);DSDPCHKERR(info);
for (kk=0;kk<dsdp->ncones;kk++){
DSDPEventLogBegin(dsdp->K[kk].coneid);
tttracexs=0;
info=DSDPConeComputeX(dsdp->K[kk].cone,xmakermu,xmakery,xmakerdy,AX,&tttracexs);DSDPCHKCONEERR(kk,info);
ttracexs+=tttracexs;
DSDPEventLogEnd(dsdp->K[kk].coneid);
}
info=DSDPVecGetR(AX,&tracex); DSDPCHKERR(info);
DSDPLogInfo(0,2,"Trace(X): %4.2e\n",dsdp->tracex);
info=DSDPVecAXPY(-1.0,dsdp->b,AX); DSDPCHKERR(info);
info=DSDPComputeFixedYX(dsdp->M,AX); DSDPCHKERR(info);
*tracexs=ttracexs;
info=DSDPVecSetR(AX,tracex); DSDPCHKERR(info);
DSDPEventLogEnd(ConeComputeX);
DSDPFunctionReturn(0);
}
dsdp.h
Internal data structure for the DSDP solver.
DSDPObjectiveGH
int DSDPObjectiveGH(DSDP, DSDPSchurMat, DSDPVec)
Compute gradient of dual objective.
Definition dualimpl.c:381
DSDPDualFactorMatrix
DSDPDualFactorMatrix
DSDP requires two instances of the data structures S.
Definition dsdpbasictypes.h:25
PRIMAL_FACTOR
@ PRIMAL_FACTOR
Definition dsdpbasictypes.h:27
DUAL_FACTOR
@ DUAL_FACTOR
Definition dsdpbasictypes.h:26
DSDPTruth
DSDPTruth
Boolean variables.
Definition dsdpbasictypes.h:19
DSDP_TRUE
@ DSDP_TRUE
Definition dsdpbasictypes.h:19
DSDPConeView
int DSDPConeView(DSDPCone K)
View contents of the cone.
Definition dsdpcone.c:358
DSDPConeComputeX
int DSDPConeComputeX(DSDPCone K, double mu, DSDPVec y, DSDPVec dy, DSDPVec AX, double *tracexs)
Given y,dy, and mu, construct X and add its inner product with the data and S.
Definition dsdpcone.c:216
DSDPConeInitialize
int DSDPConeInitialize(DSDPCone *K)
Initialize the pointers to 0.
Definition dsdpcone.c:495
DSDPGetConeName
int DSDPGetConeName(DSDPCone K, char *cname, int maxlength)
Get name of the cone.
Definition dsdpcone.c:427
DSDPConeComputeMaxStepLength
int DSDPConeComputeMaxStepLength(DSDPCone K, DSDPVec DY, DSDPDualFactorMatrix flag, double *maxsteplength)
Determine distance to the edge of the cone.
Definition dsdpcone.c:288
DSDPConeComputeS
int DSDPConeComputeS(DSDPCone K, DSDPVec Y, DSDPDualFactorMatrix flag, DSDPTruth *ispsdefinite)
Given y, compute S and determine whether its in the cone.
Definition dsdpcone.c:242
DSDPConeSetXMaker
int DSDPConeSetXMaker(DSDPCone K, double mu, DSDPVec y, DSDPVec dy)
Pass information needed to construct X.
Definition dsdpcone.c:191
DSDPConeMonitor
int DSDPConeMonitor(DSDPCone K, int tag)
Do anything at in the cone at each iteration.
Definition dsdpcone.c:380
DSDPConeComputeLogSDeterminant
int DSDPConeComputeLogSDeterminant(DSDPCone K, double *logdetobj, double *logdet)
Evaluate logrithmic barrier function.
Definition dsdpcone.c:403
DSDPConeInvertS
int DSDPConeInvertS(DSDPCone K)
Invert the dual matrix S.
Definition dsdpcone.c:265
DSDPConeGetDimension
int DSDPConeGetDimension(DSDPCone K, double *n)
Provide the dimension of the cone.
Definition dsdpcone.c:312
DSDPConeSetUp
int DSDPConeSetUp(DSDPCone K, DSDPVec y)
Factor the data and allocate data structures.
Definition dsdpcone.c:22
DSDPConeDestroy
int DSDPConeDestroy(DSDPCone *K)
Free the internal memory of the cone.
Definition dsdpcone.c:64
DSDPConeComputeRHS
int DSDPConeComputeRHS(DSDPCone K, double mu, DSDPVec vrow, DSDPVec rhs1, DSDPVec rhs2)
Compute gradient of barrier function.
Definition dsdpcone.c:147
DSDPConeSparsityInSchurMat
int DSDPConeSparsityInSchurMat(DSDPCone K, int row, int rnnz[], int m)
Identify sparsity pattern in a row of the Hessian term.
Definition dsdpcone.c:338
DSDPConeComputeHessian
int DSDPConeComputeHessian(DSDPCone K, double mu, DSDPSchurMat M, DSDPVec vrhs1, DSDPVec vrhs2)
Compute Hessian and gradient of barrier function.
Definition dsdpcone.c:92
DSDPConeSetData
int DSDPConeSetData(DSDPCone *K, struct DSDPCone_Ops *ops, void *data)
Initialize the pointers to 0.
Definition dsdpcone.c:477
DSDPConeMultiplyAdd
int DSDPConeMultiplyAdd(DSDPCone K, double mu, DSDPVec vrow, DSDPVec v, DSDPVec vv)
Multiply Hessian by a vector and add the result.
Definition dsdpcone.c:119
DSDPConeSetUp2
int DSDPConeSetUp2(DSDPCone K, DSDPVec yy0, DSDPSchurMat M)
Factor the data and allocate data structures.
Definition dsdpcone.c:43
DSDPConeANorm2
int DSDPConeANorm2(DSDPCone K, DSDPVec anorm2)
Add square of 2-norm of data correponding to each variable y.
Definition dsdpcone.c:168
DSDPCone
struct DSDPCone_C DSDPCone
This object holds the data of a SDP, LP, or other cone. Its structure is opaque to the DSDP Solver,...
Definition dsdpcone.h:27
DSDPDestroyCones
int DSDPDestroyCones(DSDP dsdp)
Each cone shoudl free its data structures.
Definition dsdpcops.c:107
DSDPSetCone
int DSDPSetCone(DSDP dsdp, DSDPCone tcone)
Pass a cone to the DSDP solver.
Definition dsdpcops.c:522
DSDPViewCones
int DSDPViewCones(DSDP dsdp)
Each cone should print its state.
Definition dsdpcops.c:424
DSDPComputeLogSDeterminant
int DSDPComputeLogSDeterminant(DSDP dsdp, double *logdet)
Compute the logarithmic barrier function for the dual varialbe S.
Definition dsdpcops.c:495
DSDPSchurSparsity
int DSDPSchurSparsity(DSDP dsdp, int row, int rnnz[], int m)
Each cone should print its state.
Definition dsdpcops.c:474
DSDPAddCone
int DSDPAddCone(DSDP dsdp, struct DSDPCone_Ops *dsdpops, void *dsdpcone)
Apply DSDP to a conic structure.
Definition dsdpcops.c:569
DSDPComputeMaxStepLength
int DSDPComputeMaxStepLength(DSDP dsdp, DSDPVec DY, DSDPDualFactorMatrix flag, double *maxsteplength)
Compute the maximum step length for the given step direction.
Definition dsdpcops.c:336
DSDPSetUpCones
int DSDPSetUpCones(DSDP dsdp)
Each cone should factor data or allocate internal data structures.
Definition dsdpcops.c:58
DSDPPassXVectors
int DSDPPassXVectors(DSDP dsdp, double mu, DSDPVec Y, DSDPVec DY)
Pass the information needed to compute the variables X in each cone but do not compute X.
Definition dsdpcops.c:378
DSDPComputeHessian
int DSDPComputeHessian(DSDP dsdp, DSDPSchurMat M, DSDPVec vrhs1, DSDPVec vrhs2)
Compute the Schur complement, or Gram, matrix for each cone.
Definition dsdpcops.c:142
DSDPInvertS
int DSDPInvertS(DSDP dsdp)
Invert the S variables in each cone.
Definition dsdpcops.c:307
DSDPComputeXVariables
int DSDPComputeXVariables(DSDP dsdp, double xmakermu, DSDPVec xmakery, DSDPVec xmakerdy, DSDPVec AX, double *tracexs)
Compute the X variables in each cone.
Definition dsdpcops.c:654
DSDPAddSchurRow
int DSDPAddSchurRow(DSDP, int, DSDPVec)
Add a row to the Schur matrix.
Definition dsdpcops.c:622
DSDPComputeSS
int DSDPComputeSS(DSDP dsdp, DSDPVec Y, DSDPDualFactorMatrix flag, DSDPTruth *ispsdefinite)
Compute the dual variables S in each cone.
Definition dsdpcops.c:272
DSDPComputeANorm2
int DSDPComputeANorm2(DSDP dsdp, DSDPVec Anorm2)
Compute norm of A and C.
Definition dsdpcops.c:246
DSDPMonitorCones
int DSDPMonitorCones(DSDP dsdp, int tag)
This routine is called once per iteration.
Definition dsdpcops.c:450
DSDPSetSchurMatOps
int DSDPSetSchurMatOps(DSDP, struct DSDPSchurMat_Ops *, void *)
Set the Schur complement matrix.
Definition dsdpcops.c:602
DSDPSetUpCones2
int DSDPSetUpCones2(DSDP dsdp, DSDPVec yy0, DSDPSchurMat M)
Each cone should allocate its data structures .
Definition dsdpcops.c:84
DSDPGetConicDimension
int DSDPGetConicDimension(DSDP dsdp, double *n)
Get the total dimension of the cones.
Definition dsdpcops.c:401
DSDPHessianMultiplyAdd
int DSDPHessianMultiplyAdd(DSDP dsdp, DSDPVec v, DSDPVec vv)
Add the product of Schur matrix with v.
Definition dsdpcops.c:188
DSDPComputeG
int DSDPComputeG(DSDP dsdp, DSDPVec vt, DSDPVec vrhs1, DSDPVec vrhs2)
Compute the gradient of the barrier for each cone.
Definition dsdpcops.c:215
DSDPSchurMatReducePVec
int DSDPSchurMatReducePVec(DSDPSchurMat M, DSDPVec x)
Collect elements of the vector.
Definition dsdpschurmat.c:307
DSDPSchurMatSetR
int DSDPSchurMatSetR(DSDPSchurMat M, double rr)
Set up the data structure.
Definition dsdpschurmat.c:338
DSDPSchurMatZeroEntries
int DSDPSchurMatZeroEntries(DSDPSchurMat M)
Zero all element in the matrix.
Definition dsdpschurmat.c:97
DSDPSchurMatAssemble
int DSDPSchurMatAssemble(DSDPSchurMat M)
Final assembly of M.
Definition dsdpschurmat.c:174
DSDPSchurMatSetData
int DSDPSchurMatSetData(DSDPSchurMat *M, struct DSDPSchurMat_Ops *ops, void *data)
Set the Schur matrix with an opaque pointer and structure of function pointers.
Definition dsdpschurmat.c:28
DSDPSchurMatRowScaling
int DSDPSchurMatRowScaling(DSDPSchurMat M, DSDPVec D)
Identify which rows on on this processor.
Definition dsdpschurmat.c:399
DSDPSchurMatAddRow
int DSDPSchurMatAddRow(DSDPSchurMat, int, double, DSDPVec)
Add elements to a row of the Schur matrix.
Definition dsdpschurmatadd.c:76
dsdpsys.h
Error handling, printing, and profiling.
DSDPVec
struct DSDPVec_C DSDPVec
This object hold m+2 variables: a scaling of C, the y variables, and r.
Definition dsdpvec.h:25
DSDPSchurMat_C
Schur complement matrix whose solution is the Newton direction.
Definition dsdpschurmat.h:35
DSDP_C
Internal structures for the DSDP solver.
Definition dsdp.h:65