7static int dsdpprintlevel=0;
8static int dsdpprintlevel2=0;
11#define __FUNCT__ "DSDPPrintStats"
12int DSDPPrintStatsFile(
DSDP dsdp,
void *dummy){
14 double ppobj,ddobj,pstp,dstp,mu,res,pinfeas,pnorm;
16 int printlevel=dsdpprintlevel2;
19 if(printlevel<=0)
return(0);
20 if(!dsdpoutputfile)
return(0);
22 info = DSDPStopReason(dsdp,&reason);DSDPCHKERR(info);
23 info = DSDPGetIts(dsdp,&iter);DSDPCHKERR(info);
26 info = DSDPGetDDObjective(dsdp,&ddobj); DSDPCHKERR(info);
27 info = DSDPGetPPObjective(dsdp,&ppobj); DSDPCHKERR(info);
28 info = DSDPGetR(dsdp,&res); DSDPCHKERR(info);
29 info = DSDPGetPInfeasibility(dsdp,&pinfeas); DSDPCHKERR(info);
30 info = DSDPGetStepLengths(dsdp,&pstp,&dstp); DSDPCHKERR(info);
31 info = DSDPGetBarrierParameter(dsdp,&mu); DSDPCHKERR(info);
32 info = DSDPGetPnorm(dsdp,&pnorm); DSDPCHKERR(info);
36 fprintf(dsdpoutputfile,
"Iter PP Objective DD Objective PInfeas DInfeas Mu StepLength Pnrm\n");
37 fprintf(dsdpoutputfile,
"--------------------------------------------------------------------------------------\n");
39 fprintf(dsdpoutputfile,
"%-3d %16.8e %16.8e %9.1e %9.1e %9.1e",iter,ppobj,ddobj,pinfeas,res,mu);
40 fprintf(dsdpoutputfile,
" %4.2f %4.2f",pstp,dstp);
42 fprintf(dsdpoutputfile,
" %1.0e \n",pnorm);
44 fprintf(dsdpoutputfile,
" %5.2f \n",pnorm);
52#define __FUNCT__ "DSDPSetStandardMonitor"
53int DSDPSetFileMonitor(
DSDP dsdp,
int printlevel){
55 dsdpprintlevel2=printlevel;
56 info=DSDPSetMonitor(dsdp,DSDPPrintStatsFile,0); DSDPCHKERR(info);
70#define __FUNCT__ "DSDPPrintStats"
71int DSDPPrintStats(
DSDP dsdp,
void *dummy){
73 double ppobj,ddobj,pstp,dstp,mu,res,pinfeas,pnorm;
75 int printlevel=dsdpprintlevel;
78 if(printlevel<=0)
return(0);
80 info = DSDPStopReason(dsdp,&reason);DSDPCHKERR(info);
81 info = DSDPGetIts(dsdp,&iter);DSDPCHKERR(info);
84 info = DSDPGetDDObjective(dsdp,&ddobj); DSDPCHKERR(info);
85 info = DSDPGetPPObjective(dsdp,&ppobj); DSDPCHKERR(info);
86 info = DSDPGetR(dsdp,&res); DSDPCHKERR(info);
87 info = DSDPGetPInfeasibility(dsdp,&pinfeas); DSDPCHKERR(info);
88 info = DSDPGetStepLengths(dsdp,&pstp,&dstp); DSDPCHKERR(info);
89 info = DSDPGetBarrierParameter(dsdp,&mu); DSDPCHKERR(info);
90 info = DSDPGetPnorm(dsdp,&pnorm); DSDPCHKERR(info);
94 printf(
"Iter PP Objective DD Objective PInfeas DInfeas Nu StepLength Pnrm\n")
96 printf(
"---------------------------------------------------------------------------------------\n")
99 printf(
"%-3d %16.8e %16.8e %9.1e %9.1e %9.1e",iter,ppobj,ddobj,pinfeas,res,mu);
100 printf(
" %4.2f %4.2f",pstp,dstp);
102 printf(
" %1.0e \n",pnorm);
104 printf(
" %5.2f \n",pnorm);
152#define __FUNCT__ "DSDPSetStandardMonitor"
153int DSDPSetStandardMonitor(
DSDP dsdp,
int k){
155 info=DSDPSetMonitor(dsdp,DSDPPrintStats,0); DSDPCHKERR(info);
The API to DSDP for those applications using DSDP as a subroutine library.
DSDPTerminationReason
There are many reasons to terminate the solver.
Internal structures for the DSDP solver.