10 #define DSDPNoOperationError(a); { DSDPSETERR1(10,"Cone type: %s, Operation not defined\n",(a).dsdpops->name); } 11 #define DSDPChkConeError(a,b); { if (b){DSDPSETERR1(b,"Cone type: %s,\n",(a).dsdpops->name); } } 21 #define __FUNCT__ "DSDPConeSetUp" 25 if (K.dsdpops->conesetup){
26 info=K.dsdpops->conesetup(K.conedata,y);DSDPChkConeError(K,info);
28 DSDPNoOperationError(K);
30 DSDPFunctionReturn(0);
42 #define __FUNCT__ "DSDPConeSetUp2" 46 if (K.dsdpops->conesetup2){
47 info=K.dsdpops->conesetup2(K.conedata,yy0,M);DSDPChkConeError(K,info);
49 DSDPNoOperationError(K);
51 DSDPFunctionReturn(0);
63 #define __FUNCT__ "DSDPConeDestroy" 67 if ((*K).dsdpops->conedestroy){
68 info=(*K).dsdpops->conedestroy((*K).conedata);DSDPChkConeError(*K,info);
71 DSDPNoOperationError(*K);
73 DSDPFunctionReturn(0);
91 #define __FUNCT__ "DSDPConeComputeHessian" 95 if (K.dsdpops->conehessian){
96 info=K.dsdpops->conehessian(K.conedata,mu,M,vrhs1,vrhs2);DSDPChkConeError(K,info);
98 DSDPNoOperationError(K);
100 DSDPFunctionReturn(0);
118 #define __FUNCT__ "DSDPConeMultiplyAdd" 122 if (K.dsdpops->conehmultiplyadd){
123 info=K.dsdpops->conehmultiplyadd(K.conedata,mu,vrow,v,vv);DSDPChkConeError(K,info);
125 DSDPNoOperationError(K);
127 DSDPFunctionReturn(0);
146 #define __FUNCT__ "DSDPConeComputeRHS" 150 if (K.dsdpops->conerhs){
151 info=K.dsdpops->conerhs(K.conedata,mu,vrow,rhs1,rhs2);DSDPChkConeError(K,info);
153 DSDPNoOperationError(K);
155 DSDPFunctionReturn(0);
167 #define __FUNCT__ "DSDPConeANorm2" 171 if (K.dsdpops->coneanorm2){
172 info=K.dsdpops->coneanorm2(K.conedata,anorm2);DSDPChkConeError(K,info);
174 DSDPNoOperationError(K);
176 DSDPFunctionReturn(0);
190 #define __FUNCT__ "DSDPConeSetXMaker" 194 if (K.dsdpops->conesetxmaker){
195 info=K.dsdpops->conesetxmaker(K.conedata,mu,y,dy);DSDPChkConeError(K,info);
197 DSDPNoOperationError(K);
199 DSDPFunctionReturn(0);
215 #define __FUNCT__ "DSDPConeComputeX" 220 if (K.dsdpops->conecomputex){
222 info=K.dsdpops->conecomputex(K.conedata,mu,y,dy,AX,&trxs);DSDPChkConeError(K,info);
225 DSDPNoOperationError(K);
227 DSDPFunctionReturn(0);
241 #define __FUNCT__ "DSDPConeComputeS" 245 if (K.dsdpops->conecomputes){
246 info=K.dsdpops->conecomputes(K.conedata,Y,flag,ispsdefinite);DSDPChkConeError(K,info);
248 DSDPNoOperationError(K);
250 DSDPFunctionReturn(0);
264 #define __FUNCT__ "DSDPConeInvertS" 268 if (K.dsdpops->coneinverts){
269 info=K.dsdpops->coneinverts(K.conedata);DSDPChkConeError(K,info);
271 DSDPNoOperationError(K);
273 DSDPFunctionReturn(0);
287 #define __FUNCT__ "DSDPConeComputeMaxStepLength" 290 double conesteplength=1.0e20;
292 conesteplength=1.0e30;
293 if (K.dsdpops->conemaxsteplength){
294 info=K.dsdpops->conemaxsteplength(K.conedata,DY,flag,&conesteplength);DSDPChkConeError(K,info);
296 DSDPNoOperationError(K);
298 *maxsteplength=conesteplength;
299 DSDPFunctionReturn(0);
311 #define __FUNCT__ "DSDPConeGetDimension" 316 if (K.dsdpops->conesize){
317 info=K.dsdpops->conesize(K.conedata,&nn);DSDPChkConeError(K,info);
319 DSDPNoOperationError(K);
322 DSDPFunctionReturn(0);
337 #define __FUNCT__ "DSDPSparsityInSchurMat" 341 if (K.dsdpops->conesparsity){
342 info=K.dsdpops->conesparsity(K.conedata,row,&tt,rnnz,m);DSDPChkConeError(K,info);
344 DSDPNoOperationError(K);
346 DSDPFunctionReturn(0);
357 #define __FUNCT__ "DSDPConeView" 361 if (K.dsdpops->coneview){
362 info=K.dsdpops->coneview(K.conedata);DSDPChkConeError(K,info);
364 DSDPNoOperationError(K);
366 DSDPFunctionReturn(0);
379 #define __FUNCT__ "DSDPConeMonitor" 383 if (K.dsdpops->conemonitor){
384 info=K.dsdpops->conemonitor(K.conedata,tag);DSDPChkConeError(K,info);
386 DSDPNoOperationError(K);
388 DSDPFunctionReturn(0);
402 #define __FUNCT__ "DSDPConeComputeLogSDeterminant" 405 double conepotential1=0,conepotential2=0;
407 if (K.dsdpops->conelogpotential){
408 info=K.dsdpops->conelogpotential(K.conedata,&conepotential1,&conepotential2);DSDPChkConeError(K,info);
410 DSDPNoOperationError(K);
412 *logdetobj=conepotential1;
413 *logdet=conepotential2;
414 DSDPFunctionReturn(0);
426 #define __FUNCT__ "DSDPGetConeName" 429 strncpy(cname,K.dsdpops->name,maxlength);
430 DSDPFunctionReturn(0);
442 #define __FUNCT__ "DSDPConeOpsInitialize" 445 if (dops==NULL)
return 0;
452 dops->conehmultiplyadd=0;
454 dops->conesetxmaker=0;
455 dops->conecomputex=0;
456 dops->conecomputes=0;
458 dops->conemaxsteplength=0;
459 dops->conesparsity=0;
460 dops->conelogpotential=0;
464 DSDPFunctionReturn(0);
476 #define __FUNCT__ "DSDPConeSetData" 477 int DSDPConeSetData(
DSDPCone *K,
struct DSDPCone_Ops* ops,
void* data){
481 DSDPFunctionReturn(0);
485 static struct DSDPCone_Ops dsdpcops;
494 #define __FUNCT__ "DSDPConeOpsInitialize" 499 info=DSDPConeSetData(K,&dsdpcops,0); DSDPCHKERR(info);
500 DSDPFunctionReturn(0);
DSDPTruth
Boolean variables.
int DSDPConeComputeS(DSDPCone K, DSDPVec Y, DSDPDualFactorMatrix flag, DSDPTruth *ispsdefinite)
Given y, compute S and determine whether its in the cone.
int DSDPConeInvertS(DSDPCone K)
Invert the dual matrix S.
struct DSDPVec_C DSDPVec
This object hold m+2 variables: a scaling of C, the y variables, and r.
Schur complement matrix whose solution is the Newton direction.
int DSDPConeANorm2(DSDPCone K, DSDPVec anorm2)
Add square of 2-norm of data correponding to each variable y.
Error handling, printing, and profiling.
int DSDPConeSetXMaker(DSDPCone K, double mu, DSDPVec y, DSDPVec dy)
Pass information needed to construct X.
int DSDPConeMonitor(DSDPCone K, int tag)
Do anything at in the cone at each iteration.
int DSDPConeInitialize(DSDPCone *K)
Initialize the pointers to 0.
int DSDPConeView(DSDPCone K)
View contents of the cone.
int DSDPConeDestroy(DSDPCone *K)
Free the internal memory of the cone.
int DSDPConeComputeRHS(DSDPCone K, double mu, DSDPVec vrow, DSDPVec rhs1, DSDPVec rhs2)
Compute gradient of barrier function.
int DSDPConeComputeMaxStepLength(DSDPCone K, DSDPVec DY, DSDPDualFactorMatrix flag, double *maxsteplength)
Determine distance to the edge of the cone.
int DSDPGetConeName(DSDPCone K, char *cname, int maxlength)
Get name of the cone.
int DSDPConeSetUp2(DSDPCone K, DSDPVec yy0, DSDPSchurMat M)
Factor the data and allocate data structures.
struct DSDPCone_C DSDPCone
This object holds the data of a SDP, LP, or other cone. Its structure is opaque to the DSDP Solver,...
The public interface between the cones and the solver.
int DSDPConeMultiplyAdd(DSDPCone K, double mu, DSDPVec vrow, DSDPVec v, DSDPVec vv)
Multiply Hessian by a vector and add the result.
int DSDPConeSetUp(DSDPCone K, DSDPVec y)
Factor the data and allocate data structures.
int DSDPConeGetDimension(DSDPCone K, double *n)
Provide the dimension of the cone.
Implementations of a cone (SDP,LP,...) must provide a structure of function pointers.
int DSDPConeSparsityInSchurMat(DSDPCone K, int row, int rnnz[], int m)
Identify sparsity pattern in a row of the Hessian term.
DSDPDualFactorMatrix
DSDP requires two instances of the data structures S.
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.
int DSDPConeComputeLogSDeterminant(DSDPCone K, double *logdetobj, double *logdet)
Evaluate logrithmic barrier function.
int DSDPConeOpsInitialize(struct DSDPCone_Ops *dops)
Initialize the function pointers to 0.
int DSDPConeComputeHessian(DSDPCone K, double mu, DSDPSchurMat M, DSDPVec vrhs1, DSDPVec vrhs2)
Compute Hessian and gradient of barrier function.