7 static int dsdpprintlevel=0;
8 static int dsdpprintlevel2=0;
11 #define __FUNCT__ "DSDPPrintStats" 12 int 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);
23 info =
DSDPGetIts(dsdp,&iter);DSDPCHKERR(info);
28 info =
DSDPGetR(dsdp,&res); 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" 53 int DSDPSetFileMonitor(
DSDP dsdp,
int printlevel){
55 dsdpprintlevel2=printlevel;
56 info=DSDPSetMonitor(dsdp,DSDPPrintStatsFile,0); DSDPCHKERR(info);
70 #define __FUNCT__ "DSDPPrintStats" 73 double ppobj,ddobj,pstp,dstp,mu,res,pinfeas,pnorm;
75 int printlevel=dsdpprintlevel;
78 if(printlevel<=0)
return(0);
81 info =
DSDPGetIts(dsdp,&iter);DSDPCHKERR(info);
86 info =
DSDPGetR(dsdp,&res); 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" int DSDPGetStepLengths(DSDP dsdp, double *pstep, double *dstep)
Copy the step sizes in the current iteration.
int DSDPGetBarrierParameter(DSDP dsdp, double *mu)
Copy the current barrier parameter.
int DSDPGetPPObjective(DSDP dsdp, double *ppobj)
Copy the objective value (PP).
int DSDPGetPnorm(DSDP dsdp, double *pnorm)
Copy the proximity of the solution to the central path.
Internal structures for the DSDP solver.
int DSDPPrintStats(DSDP dsdp, void *dummy)
Print statistics about the current solution to standard output.
DSDPTerminationReason
There are many reasons to terminate the solver.
The API to DSDP for those applications using DSDP as a subroutine library.
int DSDPGetPInfeasibility(DSDP dsdp, double *pperror)
Copy the infeasibility in (P).
int DSDPStopReason(DSDP dsdp, DSDPTerminationReason *reason)
Copy the reason why the solver terminated.
int DSDPGetIts(DSDP dsdp, int *its)
Copy the current iteration number.
int DSDPGetDDObjective(DSDP dsdp, double *ddobj)
Copy the objective value (DD).
int DSDPGetR(DSDP dsdp, double *res)
Copy the infeasibility in (D), or the variable r in (DD).
int DSDPSetStandardMonitor(DSDP dsdp, int k)
Print at every kth iteration.