DSDP
dsdpsetdata.c
Go to the documentation of this file.
1 
6 #include "dsdp.h"
7 #include "dsdp5.h"
8 #include "dsdpsys.h"
9 
23 #undef __FUNCT__
24 #define __FUNCT__ "DSDPSetDualObjective"
25 int DSDPSetDualObjective(DSDP dsdp,int i, double bi){
26  int info;
27  DSDPFunctionBegin;
28  DSDPValid(dsdp);
29  if (i>dsdp->m || i<=0){
30  DSDPSETERR2(1,"Invalid variable number: Is 1 <= %d <= %d?\n",i,dsdp->m);}
31  info=DSDPVecSetElement(dsdp->b,i,bi);DSDPCHKERR(info);
32  DSDPFunctionReturn(0);
33 }
34 
44 #undef __FUNCT__
45 #define __FUNCT__ "DSDPCopyB"
46 int DSDPCopyB(DSDP dsdp,double bb[], int m){
47  int i,info;
48  double *b;
49  DSDPFunctionBegin;
50  DSDPValid(dsdp);
51  if (dsdp->m < m) DSDPFunctionReturn(1);
52  info=DSDPVecGetArray(dsdp->b,&b);DSDPCHKERR(info);
53  for (i=0;i<m;i++) bb[i]=b[i+1];
54  info=DSDPVecRestoreArray(dsdp->b,&b);DSDPCHKERR(info);
55  DSDPFunctionReturn(0);
56 }
57 
58 
75 #undef __FUNCT__
76 #define __FUNCT__ "DSDPSetY0"
77 int DSDPSetY0(DSDP dsdp,int i, double yi0){
78  int info;double scale;
79  DSDPFunctionBegin;
80  DSDPValid(dsdp);
81  if (i>dsdp->m || i<=0){
82  DSDPSETERR2(1,"Invalid variable number: Is 1<= %d <= %d\n",i,dsdp->m);}
83  info=DSDPGetScale(dsdp,&scale);DSDPCHKERR(info);
84  info=DSDPVecSetElement(dsdp->y,i,scale*yi0);DSDPCHKERR(info);
85  DSDPFunctionReturn(0);
86 }
87 
98 #undef __FUNCT__
99 #define __FUNCT__ "DSDPGetY"
100 int DSDPGetY(DSDP dsdp,double y[], int m){
101  int i,info;
102  double scale,*yy;
103  DSDPFunctionBegin;
104  DSDPValid(dsdp);
105  if (dsdp->m < m-1) DSDPFunctionReturn(1);
106  if (dsdp->m > m) DSDPFunctionReturn(1);
107  info=DSDPVecCopy(dsdp->xmaker[0].y,dsdp->ytemp); DSDPCHKERR(info);
108  info=DSDPGetScale(dsdp,&scale);DSDPCHKERR(info);
109  info=DSDPVecGetArray(dsdp->ytemp,&yy);DSDPCHKERR(info);
110  for (i=0;i<m;i++) y[i]=yy[i+1]/scale;
111  info=DSDPVecRestoreArray(dsdp->ytemp,&yy);DSDPCHKERR(info);
112  DSDPFunctionReturn(0);
113 }
114 
115 
116 
126 #undef __FUNCT__
127 #define __FUNCT__ "DSDPGetScale"
128 int DSDPGetScale(DSDP dsdp,double *scale){
129  int info;double sscale;
130  DSDPFunctionBegin;
131  DSDPValid(dsdp);
132  info=DSDPVecGetC(dsdp->y,&sscale);DSDPCHKERR(info);
133  *scale=fabs(sscale);
134  if (sscale==0) *scale=1.0;
135  DSDPFunctionReturn(0);
136 }
137 
151 #undef __FUNCT__
152 #define __FUNCT__ "DSDPSetScale"
153 int DSDPSetScale(DSDP dsdp,double scale){
154  int info;double sscale;
155  DSDPFunctionBegin;
156  DSDPValid(dsdp);
157  scale=fabs(scale);
158  if (scale==0) scale=1.0;
159  info=DSDPGetScale(dsdp,&sscale);DSDPCHKERR(info);
160  sscale=scale/sscale;
161  info=DSDPVecScale(sscale,dsdp->y);
162  dsdp->mutarget*=sscale;
163  dsdp->pobj*=sscale;
164  dsdp->dobj*=sscale;
165  dsdp->ppobj*=sscale;
166  dsdp->ddobj*=sscale;
167  dsdp->mu*=sscale;
168  DSDPLogInfo(0,2,"Set DSDP C Scaling: %4.4e\n",scale);
169  DSDPFunctionReturn(0);
170 }
171 
183 #undef __FUNCT__
184 #define __FUNCT__ "DSDPAddObjectiveConstant"
185 int DSDPAddObjectiveConstant(DSDP dsdp,double c){
186  int info;
187  DSDPFunctionBegin;
188  DSDPValid(dsdp);
189  info=DSDPVecSetC(dsdp->b,-c);DSDPCHKERR(info);
190  DSDPLogInfo(0,2,"Add Objective Constant: %4.4e\n",c);
191  DSDPFunctionReturn(0);
192 }
193 
204 #undef __FUNCT__
205 #define __FUNCT__ "DSDPSetMaxIts"
206 int DSDPSetMaxIts(DSDP dsdp,int its){
207  DSDPFunctionBegin;
208  DSDPValid(dsdp);
209  if (its >= 0) dsdp->maxiter = its;
210  DSDPLogInfo(0,2,"Set Maximum Iterates: %4d\n",its);
211  DSDPFunctionReturn(0);
212 }
213 
223 #undef __FUNCT__
224 #define __FUNCT__ "DSDPGetMaxIts"
225 int DSDPGetMaxIts(DSDP dsdp,int *its){
226  DSDPFunctionBegin;
227  DSDPValid(dsdp);
228  *its=dsdp->maxiter;
229  DSDPFunctionReturn(0);
230 }
231 
232 
244 #undef __FUNCT__
245 #define __FUNCT__ "DSDPSetMaxTrustRadius"
246 int DSDPSetMaxTrustRadius(DSDP dsdp,double rad){
247  DSDPFunctionBegin;
248  DSDPValid(dsdp);
249  if (rad > 0) dsdp->maxtrustradius = rad;
250  DSDPLogInfo(0,2,"Set Maximum Trust Radius: %4.4e\n",rad);
251  DSDPFunctionReturn(0);
252 }
253 
263 #undef __FUNCT__
264 #define __FUNCT__ "DSDPGetMaxTrustRadius"
265 int DSDPGetMaxTrustRadius(DSDP dsdp,double *rad){
266  DSDPFunctionBegin;
267  DSDPValid(dsdp);
268  *rad=dsdp->maxtrustradius;
269  DSDPFunctionReturn(0);
270 }
271 
281 #undef __FUNCT__
282 #define __FUNCT__ "DSDPSetZBar"
283 int DSDPSetZBar(DSDP dsdp,double ppobj){
284  int info;
285  double scale;
286  DSDPFunctionBegin;
287  DSDPValid(dsdp);
288  info=DSDPGetScale(dsdp,&scale);DSDPCHKERR(info);
289  dsdp->ppobj=ppobj*scale;
290  DSDPLogInfo(0,2,"Set Primal Objective and Upper bound on solution: %4.4e. \n",ppobj);
291  DSDPFunctionReturn(0);
292 }
293 
309 #undef __FUNCT__
310 #define __FUNCT__ "DSDPSetR0"
311 int DSDPSetR0(DSDP dsdp,double res){
312  int info;
313  double scale;
314  DSDPFunctionBegin;
315  DSDPValid(dsdp);
316  info=DSDPGetScale(dsdp,&scale);DSDPCHKERR(info);
317  info=DSDPSetRR(dsdp,scale*res); DSDPCHKERR(info);
318  if (res>=0)dsdp->goty0=DSDP_TRUE;
319  DSDPLogInfo(0,2,"Set Dual Initial Infeasibility to %4.4e times Identity Matrix. \n",res);
320  DSDPFunctionReturn(0);
321 }
322 
338 #undef __FUNCT__
339 #define __FUNCT__ "DSDPSetBarrierParameter"
340 int DSDPSetBarrierParameter(DSDP dsdp,double mu){
341  int info;double scale;
342  DSDPFunctionBegin;
343  DSDPValid(dsdp);
344  info=DSDPGetScale(dsdp,&scale);DSDPCHKERR(info);
345  dsdp->mutarget = mu*scale;
346  DSDPLogInfo(0,2,"Set InitialBarrierParameter: %4.4e \n",mu);
347  DSDPFunctionReturn(0);
348 }
349 
362 #undef __FUNCT__
363 #define __FUNCT__ "DSDPGetBarrierParameter"
364 int DSDPGetBarrierParameter(DSDP dsdp, double *mu){
365  int info;double scale;
366  DSDPFunctionBegin;
367  info=DSDPGetScale(dsdp,&scale);DSDPCHKERR(info);
368  *mu=dsdp->mutarget/scale;
369  DSDPFunctionReturn(0);
370 }
371 
372 
381 #undef __FUNCT__
382 #define __FUNCT__ "DSDPUsePenalty"
383 int DSDPUsePenalty(DSDP dsdp,int yesorno){
384  DSDPPenalty UsePenalty;
385  int info;
386  DSDPFunctionBegin;
387  DSDPValid(dsdp);
388  if (yesorno>0){
389  UsePenalty=DSDPAlways;
390  } else if (yesorno<0){
391  UsePenalty=DSDPNever;
392  } else {
393  UsePenalty=DSDPInfeasible;
394  }
395  dsdp->UsePenalty=UsePenalty;
396  info=RConeSetType(dsdp->rcone,UsePenalty);DSDPCHKERR(info);
397  DSDPLogInfo(0,2,"Set UsePenalty: %d \n",yesorno);
398  DSDPFunctionReturn(0);
399 }
400 
416 #undef __FUNCT__
417 #define __FUNCT__ "DSDPSetPenaltyParameter"
418 int DSDPSetPenaltyParameter(DSDP dsdp,double Gamma){
419  int info;
420  double scale,ppenalty;
421  DSDPFunctionBegin;
422  DSDPValid(dsdp);
423  info=DSDPGetScale(dsdp,&scale);DSDPCHKERR(info);
424  ppenalty=fabs(Gamma*scale);
425  info=DSDPVecSetR(dsdp->b,ppenalty);DSDPCHKERR(info);
426  DSDPLogInfo(0,2,"Set Penalty Parameter: %4.4e\n",Gamma);
427  DSDPFunctionReturn(0);
428 }
429 
441 #undef __FUNCT__
442 #define __FUNCT__ "DSDPGetPenaltyParameter"
443 int DSDPGetPenaltyParameter(DSDP dsdp,double *Gamma){
444  int info;
445  double ppenalty;
446  DSDPFunctionBegin;
447  DSDPValid(dsdp);
448  info=DSDPVecGetR(dsdp->b,&ppenalty);DSDPCHKERR(info);
449  *Gamma=fabs(ppenalty);
450  DSDPFunctionReturn(0);
451 }
452 
453 /* Not current; not documented
454 */
455 #undef __FUNCT__
456 #define __FUNCT__ "DSDPGetPenalty"
457 int DSDPGetPenalty(DSDP dsdp,double *penalty){
458  int info;double ppenalty;
459  DSDPFunctionBegin;
460  DSDPValid(dsdp);
461  info=DSDPVecGetR(dsdp->b,&ppenalty);DSDPCHKERR(info);
462  *penalty=fabs(ppenalty);
463  DSDPFunctionReturn(0);
464 }
465 
466 
467 
477 #undef __FUNCT__
478 #define __FUNCT__ "DSDPGetPPObjective"
479 int DSDPGetPPObjective(DSDP dsdp,double *ppobj){
480  int info;
481  double scale;
482  DSDPFunctionBegin;
483  DSDPValid(dsdp);
484  info=DSDPGetScale(dsdp,&scale);DSDPCHKERR(info);
485  *ppobj=(dsdp->ppobj)/scale;
486  if (dsdp->cnorm==0) *ppobj=0;
487  DSDPFunctionReturn(0);
488 }
489 
500 #undef __FUNCT__
501 #define __FUNCT__ "DSDPGetDObjective"
502 int DSDPGetDObjective(DSDP dsdp,double *dobj){
503  int info; double scale;
504  DSDPFunctionBegin;
505  DSDPValid(dsdp);
506  info=DSDPGetScale(dsdp,&scale);DSDPCHKERR(info);
507  *dobj = (dsdp->dobj)/scale;
508  if (dsdp->cnorm==0) *dobj=-fabs(*dobj);
509  DSDPFunctionReturn(0);
510 }
521 #undef __FUNCT__
522 #define __FUNCT__ "DSDPGetDDObjective"
523 int DSDPGetDDObjective(DSDP dsdp,double *ddobj){
524  int info; double scale;
525  DSDPFunctionBegin;
526  DSDPValid(dsdp);
527  info=DSDPGetScale(dsdp,&scale);DSDPCHKERR(info);
528  *ddobj = (dsdp->ddobj)/scale;
529  if (dsdp->cnorm==0) *ddobj=-fabs(*ddobj);
530  DSDPFunctionReturn(0);
531 }
532 
543 #undef __FUNCT__
544 #define __FUNCT__ "DSDPGetDualityGap"
545 int DSDPGetDualityGap(DSDP dsdp,double *dgap){
546  int info; double scale;
547  DSDPFunctionBegin;
548  DSDPValid(dsdp);
549  info=DSDPGetScale(dsdp,&scale);DSDPCHKERR(info);
550  *dgap = (dsdp->dualitygap)/scale;
551  DSDPFunctionReturn(0);
552 }
553 
562 #undef __FUNCT__
563 #define __FUNCT__ "DSDPGetIts"
564 int DSDPGetIts(DSDP dsdp,int *its){
565  DSDPFunctionBegin;
566  DSDPValid(dsdp);
567  *its=dsdp->itnow;
568  DSDPFunctionReturn(0);
569 }
570 
580 #undef __FUNCT__
581 #define __FUNCT__ "DSDPStopReason"
583  DSDPFunctionBegin;
584  DSDPValid(dsdp);
585  *reason=dsdp->reason;
586  DSDPFunctionReturn(0);
587 }
588 
589 
599 #undef __FUNCT__
600 #define __FUNCT__ "DSDPGetR"
601 int DSDPGetR(DSDP dsdp, double *res){
602  int info;double rr,scale;
603  DSDPFunctionBegin;
604  DSDPValid(dsdp);
605  info=DSDPGetRR(dsdp,&rr);DSDPCHKERR(info);
606  info=DSDPGetScale(dsdp,&scale);DSDPCHKERR(info);
607  *res=rr/scale;
608  DSDPFunctionReturn(0);
609 }
610 
619 #undef __FUNCT__
620 #define __FUNCT__ "DSDPGetDataNorms"
621 int DSDPGetDataNorms(DSDP dsdp, double dnorm[3]){
622  int info;
623  DSDPFunctionBegin;
624  DSDPValid(dsdp);
625  if (dsdp->setupcalled==DSDP_FALSE){
626  info=DSDPComputeDataNorms(dsdp);DSDPCHKERR(info);
627  }
628  dnorm[0]=dsdp->cnorm;
629  dnorm[1]=dsdp->anorm;
630  dnorm[2]=dsdp->bnorm;
631  DSDPFunctionReturn(0);
632 }
633 
634 
643 #undef __FUNCT__
644 #define __FUNCT__ "DSDPGetMaxYElement"
645 int DSDPGetMaxYElement(DSDP dsdp,double* ymax){
646  int info;
647  DSDPFunctionBegin;
648  info=DSDPGetYMaxNorm(dsdp,ymax);DSDPCHKERR(info);
649  DSDPFunctionReturn(0);
650 }
651 
652 #undef __FUNCT__
653 #define __FUNCT__ "DSDPGetDimension"
654 
661 int DSDPGetDimension(DSDP dsdp, double *n){
662  int info;
663  DSDPFunctionBegin;
664  info=DSDPGetConicDimension(dsdp,n);DSDPCHKERR(info);
665  DSDPFunctionReturn(0);
666 }
667 
676 #undef __FUNCT__
677 #define __FUNCT__ "DSDPGetYMaxNorm"
678 int DSDPGetYMaxNorm(DSDP dsdp, double *ynorm){
679  int info;
680  double cc,rr,yy;
681  DSDPFunctionBegin;
682  DSDPValid(dsdp);
683  info=DSDPVecGetC(dsdp->y,&cc);DSDPCHKERR(info);
684  info=DSDPVecGetR(dsdp->y,&rr);DSDPCHKERR(info);
685  info=DSDPVecSetC(dsdp->y,0);DSDPCHKERR(info);
686  info=DSDPVecSetR(dsdp->y,0);DSDPCHKERR(info);
687  info=DSDPVecNormInfinity(dsdp->y,&yy);DSDPCHKERR(info);
688  info=DSDPVecSetC(dsdp->y,cc);DSDPCHKERR(info);
689  info=DSDPVecSetR(dsdp->y,rr);DSDPCHKERR(info);
690  if (cc) yy/=fabs(cc);
691  if (ynorm) *ynorm=yy;
692  DSDPFunctionReturn(0);
693 }
694 
705 #undef __FUNCT__
706 #define __FUNCT__ "DSDPGetNumberOfVariables"
707 int DSDPGetNumberOfVariables(DSDP dsdp, int *m){
708  DSDPFunctionBegin;
709  DSDPValid(dsdp);
710  *m=dsdp->m;
711  DSDPFunctionReturn(0);
712 }
713 
722 #undef __FUNCT__
723 #define __FUNCT__ "DSDPGetPnorm"
724 int DSDPGetPnorm(DSDP dsdp, double *pnorm){
725  DSDPFunctionBegin;
726  DSDPValid(dsdp);
727  *pnorm=dsdp->pnorm;
728  DSDPFunctionReturn(0);
729 }
730 
740 #undef __FUNCT__
741 #define __FUNCT__ "DSDPGetStepLengths"
742 int DSDPGetStepLengths(DSDP dsdp, double *pstep, double *dstep){
743  DSDPFunctionBegin;
744  DSDPValid(dsdp);
745  *dstep=dsdp->dstep;
746  *pstep=dsdp->pstep;
747  DSDPFunctionReturn(0);
748 }
749 
763 #undef __FUNCT__
764 #define __FUNCT__ "DSDPSetPotentialParameter"
765 int DSDPSetPotentialParameter(DSDP dsdp, double rho){
766  DSDPFunctionBegin;
767  DSDPValid(dsdp);
768  if (rho>1) dsdp->rhon=rho;
769  DSDPLogInfo(0,2,"Set Potential Parameter %4.4f\n",rho);
770  DSDPFunctionReturn(0);
771 }
772 
782 #undef __FUNCT__
783 #define __FUNCT__ "DSDPGetPotentialParameter"
784 int DSDPGetPotentialParameter(DSDP dsdp, double *rho){
785  DSDPFunctionBegin;
786  DSDPValid(dsdp);
787  *rho=dsdp->rhon;
788  DSDPFunctionReturn(0);
789 }
790 
801 #undef __FUNCT__
802 #define __FUNCT__ "DSDPGetPotential"
803 int DSDPGetPotential(DSDP dsdp, double *potential){
804  DSDPFunctionBegin;
805  DSDPValid(dsdp);
806  *potential=dsdp->potential;
807  DSDPFunctionReturn(0);
808 }
809 
819 #undef __FUNCT__
820 #define __FUNCT__ "DSDPUseDynamicRho"
821 int DSDPUseDynamicRho(DSDP dsdp, int yesorno){
822  DSDPFunctionBegin;
823  DSDPValid(dsdp);
824  if (yesorno) dsdp->usefixedrho=DSDP_FALSE;
825  else dsdp->usefixedrho=DSDP_TRUE;
826  DSDPLogInfo(0,2,"Set UseDynamicRho: %d \n",yesorno);
827  DSDPFunctionReturn(0);
828 }
829 
830 /* Not Current or documented
831 */
832 #undef __FUNCT__
833 #define __FUNCT__ "DSDPBoundDualVariables"
834 /* !
835 \fn int DSDPBoundDualVariables(DSDP dsdp, double lbound, double ubound)
836 \brief Bounds on the variables y.
837 
838 \param dsdp is the solver
839 \param lbound will be the lower bound of the variables y
840 \param ubound will be the upper bound of the variables y
841 \sa DSDPSetYBounds()
842 \ingroup DSDPSolver
843 */
844 int DSDPBoundDualVariables(DSDP dsdp,double lbound, double ubound){
845  int info;
846  double bbound;
847  DSDPFunctionBegin;
848  bbound=DSDPMax(fabs(lbound),fabs(ubound));
849  DSDPLogInfo(0,2,"Bound Variables between %4.4e and %4.4e \n",-bbound,bbound);
850  info = BoundYConeSetBounds(dsdp->ybcone,-bbound,bbound);DSDPCHKERR(info);
851  DSDPFunctionReturn(0);
852 }
853 
864 #undef __FUNCT__
865 #define __FUNCT__ "DSDPGetYBounds"
866 int DSDPGetYBounds(DSDP dsdp,double *lbound, double *ubound){
867  int info;
868  DSDPFunctionBegin;
869  info=BoundYConeGetBounds(dsdp->ybcone,lbound,ubound);DSDPCHKERR(info);
870  DSDPFunctionReturn(0);
871 }
872 
883 #undef __FUNCT__
884 #define __FUNCT__ "DSDPSetYBounds"
885 int DSDPSetYBounds(DSDP dsdp,double lbound, double ubound){
886  int info;
887  DSDPFunctionBegin;
888  info=BoundYConeSetBounds(dsdp->ybcone,lbound,ubound);DSDPCHKERR(info);
889  DSDPFunctionReturn(0);
890 }
891 
892 
893 
903 #undef __FUNCT__
904 #define __FUNCT__ "DSDPReuseMatrix"
905 int DSDPReuseMatrix(DSDP dsdp, int rm){
906  DSDPFunctionBegin;
907  DSDPValid(dsdp);
908  dsdp->reuseM=rm;
909  DSDPLogInfo(0,2,"Reuse the Schur Matrix: %d times\n",rm);
910  DSDPFunctionReturn(0);
911 }
912 
913 
923 #undef __FUNCT__
924 #define __FUNCT__ "DSDPGetReuseMatrix"
925 int DSDPGetReuseMatrix(DSDP dsdp, int *rm){
926  DSDPFunctionBegin;
927  DSDPValid(dsdp);
928  *rm=dsdp->reuseM;
929  DSDPFunctionReturn(0);
930 }
931 
932 
943 #undef __FUNCT__
944 #define __FUNCT__ "DSDPSetMonitor"
945 int DSDPSetMonitor(DSDP dsdp, int (*monitor)(DSDP,void*), void* monitorctx){
946  DSDPFunctionBegin;
947  DSDPValid(dsdp);
948  if (dsdp->nmonitors<MAX_DSDP_MONITORS){
949  DSDPLogInfo(0,2,"Set Monitor\n");
950  dsdp->dmonitor[dsdp->nmonitors].monitor=monitor;
951  dsdp->dmonitor[dsdp->nmonitors].monitorctx=monitorctx;
952  dsdp->nmonitors++;
953  }
954  DSDPFunctionReturn(0);
955 }
956 
966 #undef __FUNCT__
967 #define __FUNCT__ "DSDPSetConvergenceFlag"
969  DSDPFunctionBegin;
970  DSDPValid(dsdp);
971  dsdp->reason=reason;
972  if (reason==DSDP_INFEASIBLE_START){
973  DSDPLogInfo(0,2,"Initial Point Infeasible, Check variable bounds? \n",0);
974  }
975  DSDPFunctionReturn(0);
976 }
977 
int DSDPSetBarrierParameter(DSDP dsdp, double mu)
Set the current barrier parameter.
Definition: dsdpsetdata.c:340
int DSDPGetStepLengths(DSDP dsdp, double *pstep, double *dstep)
Copy the step sizes in the current iteration.
Definition: dsdpsetdata.c:742
int DSDPGetBarrierParameter(DSDP dsdp, double *mu)
Copy the current barrier parameter.
Definition: dsdpsetdata.c:364
int DSDPGetPPObjective(DSDP dsdp, double *ppobj)
Copy the objective value (PP).
Definition: dsdpsetdata.c:479
int DSDPAddObjectiveConstant(DSDP dsdp, double c)
Add a constant to the objective.
Definition: dsdpsetdata.c:185
int DSDPGetPenaltyParameter(DSDP dsdp, double *Gamma)
Copy the penalty parameter Gamma.
Definition: dsdpsetdata.c:443
Error handling, printing, and profiling.
int DSDPSetZBar(DSDP dsdp, double ppobj)
Set an upper bound on the objective value at the solution.
Definition: dsdpsetdata.c:283
int DSDPSetDualObjective(DSDP dsdp, int i, double bi)
Set the objective vector b in (D).
Definition: dsdpsetdata.c:25
int DSDPSetScale(DSDP dsdp, double scale)
Set the internal scaling factor.
Definition: dsdpsetdata.c:153
int DSDPUseDynamicRho(DSDP dsdp, int yesorno)
Use a dynamic strategy to choose parameter rho.
Definition: dsdpsetdata.c:821
int DSDPGetPnorm(DSDP dsdp, double *pnorm)
Copy the proximity of the solution to the central path.
Definition: dsdpsetdata.c:724
Internal structures for the DSDP solver.
Definition: dsdp.h:65
DSDPTerminationReason
There are many reasons to terminate the solver.
int DSDPSetRR(DSDP, double)
Set variable r.
Definition: dualimpl.c:345
int DSDPGetDataNorms(DSDP dsdp, double dnorm[3])
Copy the norms of the data C, A, and b into an array.
Definition: dsdpsetdata.c:621
The API to DSDP for those applications using DSDP as a subroutine library.
int DSDPSetMaxTrustRadius(DSDP dsdp, double rad)
Set a maximum trust radius on the step direction.
Definition: dsdpsetdata.c:246
int DSDPComputeDataNorms(DSDP)
Compute norms of A,C, and b.
Definition: dsdpsetup.c:283
int DSDPGetDimension(DSDP dsdp, double *n)
Copy the dimension of the cones, or the number of constraints in (D).
Definition: dsdpsetdata.c:661
int DSDPReuseMatrix(DSDP dsdp, int rm)
Reuse the Hessian of the barrier function multiple times at each DSDP iteration.
Definition: dsdpsetdata.c:905
int DSDPSetPenaltyParameter(DSDP dsdp, double Gamma)
Set the penalty parameter Gamma.
Definition: dsdpsetdata.c:418
Internal data structure for the DSDP solver.
int DSDPGetReuseMatrix(DSDP dsdp, int *rm)
Copy this parameter.
Definition: dsdpsetdata.c:925
int DSDPGetConicDimension(DSDP, double *)
Get the total dimension of the cones.
Definition: dsdpcops.c:401
int DSDPGetMaxTrustRadius(DSDP dsdp, double *rad)
Copy the current radius of the trust region.
Definition: dsdpsetdata.c:265
int DSDPGetDObjective(DSDP dsdp, double *dobj)
Copy the objective value (D).
Definition: dsdpsetdata.c:502
int DSDPGetPotential(DSDP dsdp, double *potential)
Copy the potential of the current solution.
Definition: dsdpsetdata.c:803
int DSDPSetPotentialParameter(DSDP dsdp, double rho)
Set the potential parameter.
Definition: dsdpsetdata.c:765
int DSDPStopReason(DSDP dsdp, DSDPTerminationReason *reason)
Copy the reason why the solver terminated.
Definition: dsdpsetdata.c:582
int DSDPSetY0(DSDP dsdp, int i, double yi0)
Set the initial values of variables y in (D).
Definition: dsdpsetdata.c:77
int DSDPGetIts(DSDP dsdp, int *its)
Copy the current iteration number.
Definition: dsdpsetdata.c:564
int DSDPGetRR(DSDP, double *)
Get variable r.
Definition: dualimpl.c:361
int DSDPGetYMaxNorm(DSDP dsdp, double *ynorm)
Copy the the infinity norm of the variables y.
Definition: dsdpsetdata.c:678
int DSDPGetY(DSDP dsdp, double y[], int m)
Copies the variables y into an array.
Definition: dsdpsetdata.c:100
int DSDPGetNumberOfVariables(DSDP dsdp, int *m)
Copy the number of variables y.
Definition: dsdpsetdata.c:707
int DSDPUsePenalty(DSDP dsdp, int yesorno)
Use penalty parameter to enforce feasibility.
Definition: dsdpsetdata.c:383
int DSDPGetDDObjective(DSDP dsdp, double *ddobj)
Copy the objective value (DD).
Definition: dsdpsetdata.c:523
int DSDPGetR(DSDP dsdp, double *res)
Copy the infeasibility in (D), or the variable r in (DD).
Definition: dsdpsetdata.c:601
int DSDPGetScale(DSDP dsdp, double *scale)
Copy the internal scaling factor from the solver.
Definition: dsdpsetdata.c:128
int DSDPGetMaxIts(DSDP dsdp, int *its)
Copy the maximum number of iterations from the solver.
Definition: dsdpsetdata.c:225
int DSDPGetDualityGap(DSDP dsdp, double *dgap)
Copy the difference between the objective values.
Definition: dsdpsetdata.c:545
int DSDPSetYBounds(DSDP dsdp, double lbound, double ubound)
Bound the variables y.
Definition: dsdpsetdata.c:885
int BoundYConeSetBounds(LUBounds lucone, double lb, double ub)
Set bounds on the variables.
Definition: allbounds.c:512
int DSDPGetPotentialParameter(DSDP dsdp, double *rho)
Copy the potential parameter.
Definition: dsdpsetdata.c:784
int DSDPGetYBounds(DSDP dsdp, double *lbound, double *ubound)
Copy the bounds on the variables y.
Definition: dsdpsetdata.c:866
int BoundYConeGetBounds(LUBounds lucone, double *lb, double *ub)
Get bounds on the variables.
Definition: allbounds.c:532
int DSDPSetConvergenceFlag(DSDP dsdp, DSDPTerminationReason reason)
Monitor each iteration of the solver.
Definition: dsdpsetdata.c:968
int DSDPCopyB(DSDP dsdp, double bb[], int m)
Copies the variables b from solver into an array.
Definition: dsdpsetdata.c:46
int DSDPSetR0(DSDP dsdp, double res)
Set an initial value for the variable r in (DD)
Definition: dsdpsetdata.c:311
int DSDPSetMaxIts(DSDP dsdp, int its)
Terminate the solver after this number of iterations.
Definition: dsdpsetdata.c:206
int DSDPGetMaxYElement(DSDP dsdp, double *ymax)
Copy the the infinity norm of the variables y.
Definition: dsdpsetdata.c:645