DSDP
Functions
DSDP Basics

Functions

int DSDPComputeX (DSDP dsdp)
 Compute the X variables. More...
 
int DSDPCreate (int m, DSDP *dsdpnew)
 Create a DSDP solver. FIRST DSDP routine! More...
 
int DSDPDestroy (DSDP dsdp)
 Free the internal data structures of the solver and the cones associated with it. More...
 
int DSDPGetSolutionType (DSDP dsdp, DSDPSolutionType *pdfeasible)
 Solutions can be bounded, infeasible, or unbounded. More...
 
int DSDPGetY (DSDP dsdp, double y[], int m)
 Copies the variables y into an array. More...
 
int DSDPSetDualObjective (DSDP dsdp, int i, double bi)
 Set the objective vector b in (D). More...
 
int DSDPSetOptions (DSDP dsdp, char *runargs[], int nargs)
 Read command line arguments to set options in DSDP. More...
 
int DSDPSetStandardMonitor (DSDP dsdp, int k)
 Print at every kth iteration. More...
 
int DSDPSetup (DSDP dsdp)
 Set up data structures in the solver and the cones associated with it. More...
 
int DSDPSolve (DSDP dsdp)
 Apply DSDP to the problem. More...
 
int DSDPView (DSDP dsdp)
 Print many of the parameters currently set in DSDP. More...
 

Detailed Description

DSDP can be used within a C application through a set of subroutines.

The subroutines listed below use DSDP to solve problems in DSDP Standard Form. Several examples of applications that use the DSDP application program interface are included in the distribution.

Each of these applications includes the header

#include dsdp5.h

and link to the DSDP library.

Return values
0if successful

The documentation of DSDP subroutines in this chapter will not show the return integer, but we highly recommend that applications check for errors after each subroutine.

Function Documentation

◆ DSDPComputeX()

int DSDPComputeX ( DSDP  dsdp)

Compute the X variables.

This routine explicitly computes X and determines the feasibility and unboundedness of the solution. This routine should be called after DSDPSolve().

The cost of the dual-scaling direction is less than the cost of other interior-point directions because the X matrix does not have to be computed explicitly at each iteration.

Parameters
dsdpthe solver
See also
DSDPSolve()
DSDPGetSolutionType()
DSDPGetPObjective()

These four routines can usually be called together.

DSDP dsdp;
DSDPSetup(dsdp);
DSDPSolve(dsdp);
DSDPGetSolutionType(dsdp,&type);

Definition at line 55 of file dsdpx.c.

◆ DSDPCreate()

int DSDPCreate ( int  m,
DSDP dsdpnew 
)

Create a DSDP solver. FIRST DSDP routine!

Parameters
mthe number of variables y
*dsdpnewwill be set to a new solver object
See also
DSDPSetDualObjective()
DSDPSetup()
DSDPSolve()
DSDPDestroy()

For example, to create a DSDP solver for a problem with 10 y variables,

int m=10;
DSDP dsdp;
DSDPCreate(m,&dsdp);

Definition at line 30 of file dsdpsetup.c.

Referenced by MaxCut(), and mexFunction().

◆ DSDPDestroy()

int DSDPDestroy ( DSDP  dsdp)

Free the internal data structures of the solver and the cones associated with it.

Parameters
dsdpthe solver
See also
DSDPCreate()
DSDPSolve()
DSDPSetup()

Definition at line 496 of file dsdpsetup.c.

◆ DSDPGetSolutionType()

int DSDPGetSolutionType ( DSDP  dsdp,
DSDPSolutionType pdfeasible 
)

Solutions can be bounded, infeasible, or unbounded.

Parameters
dsdpis the solver
*pdfeasiblewill be set to the proper enumerated type.
See also
DSDPSetPenaltyParameter()
DSDPSetYBounds()
DSDPStopReason()

Definition at line 254 of file dsdpx.c.

Referenced by DSDPView().

◆ DSDPGetY()

int DSDPGetY ( DSDP  dsdp,
double  y[],
int  m 
)

Copies the variables y into an array.

Parameters
dsdpis the solver
yis an array
mis the length of the array and the dimension of y
See also
DSDPSetY0()
DSDPComputeX()

Definition at line 100 of file dsdpsetdata.c.

Referenced by DSDPPrintSolution().

◆ DSDPSetDualObjective()

int DSDPSetDualObjective ( DSDP  dsdp,
int  i,
double  bi 
)

Set the objective vector b in (D).

Parameters
dsdpis the solver
iis the variable number from 1 through m
biis the objective value associated with variable i
See also
DSDPSetY0()
DSDPGetDObjective()

The dual objective function is $ \mbox{maximize} \ \ {\displaystyle \sum_{i=1}^m b_i \ y_i } $.

Definition at line 25 of file dsdpsetdata.c.

Referenced by SetStableSetData().

◆ DSDPSetOptions()

int DSDPSetOptions ( DSDP  dsdp,
char *  runargs[],
int  nargs 
)

Read command line arguments to set options in DSDP.

Parameters
dsdpis the solver
runargsis the array of strings representing the options
nargsis the number of arguments
See also
DSDPReadOptions()
DSDPPrintOptions()
DSDPSetGapTolerance()
DSDPSetStandardMonitor()
DSDPSetPenaltyParameter()
DSDPSetMaxIts()
DSDPSetR0()
DSDPSetYBounds()
DSDPSetPotentialParameter()

Definition at line 46 of file dsdpsetoptions.c.

Referenced by DSDPReadOptions().

◆ DSDPSetStandardMonitor()

int DSDPSetStandardMonitor ( DSDP  dsdp,
int  k 
)

Print at every kth iteration.

Parameters
dsdpis the solver
kis the frequency to print information.
Iter   PP Objective      DD Objective    PInfeas   DInfeas     Nu     StepLength   Pnrm
---------------------------------------------------------------------------------------
0     1.00000000e+02   -1.13743137e+05   2.2e+00   3.8e+02   1.1e+05  0.00  0.00   0.00
1     1.36503342e+06   -6.65779055e+04   5.1e+00   2.2e+02   1.1e+04  1.00  0.33   4.06
2     1.36631922e+05   -6.21604409e+03   5.4e+00   1.9e+01   4.5e+02  1.00  1.00   7.85
3     5.45799174e+03   -3.18292092e+03   1.5e-03   9.1e+00   7.5e+01  1.00  1.00  17.63
4     1.02930559e+03   -5.39166166e+02   1.1e-05   5.3e-01   2.7e+01  1.00  1.00   7.58
5     4.30074471e+02   -3.02460061e+01   3.3e-09   0.0e+00   5.6e+00  1.00  1.00  11.36
...
11    8.99999824e+00    8.99999617e+00   1.1e-16   0.0e+00   1.7e-08  1.00  1.00   7.03
12    8.99999668e+00    8.99999629e+00   2.9e-19   0.0e+00   3.4e-09  1.00  1.00  14.19
  • Iter - the current iteration number,
  • PP Objective - the current objective value in (PP),
  • DD Objective - the current objective value in (DD),
  • PInfeas - is the largest number $(x^u - x^l)_i$ in (PP),
  • DInfeas - the variable r in (DD) that corresponds to the infeasibility of y and S in (D).
  • Nu - the current barrier parameter $\frac{\bar{z} - b^Ty}{\rho}$. This parameter decreases to zero as the points get closer to the solution,
  • StepLength - the multiple of the step-directions in (PP) and (DD),
  • Pnrm - the proximity to a point on the central path: $\sqrt{-\nabla \psi^T(y^k,\bar{z}^k ) \Delta y}$.
See also
DSDPGetIts()
DSDPGetDDObjective()
DSDPGetPPObjective()
DSDPGetR()
DSDPGetPInfeasibility()
DSDPGetBarrierParameter()
DSDPGetStepLengths()
DSDPGetPnorm()

Definition at line 153 of file dsdpprintout.c.

◆ DSDPSetup()

int DSDPSetup ( DSDP  dsdp)

Set up data structures in the solver and the cones associated with it.

Parameters
dsdpthe solver
See also
DSDPCreate()
DSDPSolve()
DSDPDestroy()

This routine must be called before DSDPSolve(). Do not create SDP, LP or other cones after calling this routines, and do not set data into the cones after calling this routine.

Definition at line 193 of file dsdpsetup.c.

◆ DSDPSolve()

int DSDPSolve ( DSDP  dsdp)

Apply DSDP to the problem.

Call this routine after DSDPCreate() and DSDPSetup(), and after setting the data.

Parameters
dsdpis the solver
See also
DSDPCreate()
DSDPGetSolutionType()
DSDPGetDObjective()
DSDPGetY()
DSDPStopReason()

Definition at line 343 of file dsdpsetup.c.

◆ DSDPView()

int DSDPView ( DSDP  dsdp)

Print many of the parameters currently set in DSDP.

Parameters
dsdpis the solver
See also
DSDPSetOptions()
DSDPGetPenaltyParameter()
DSDPGetSolutionType()
DSDPGetGapTolerance()

Definition at line 190 of file dsdpsetoptions.c.