1 #if !defined(__DSDP_INTERFACE_H)
2 #define __DSDP_INTERFACE_H
29 extern FILE *dsdpoutputfile;
49 extern int BConeScaleBarrier(
BCone,
double);
50 extern int BConeView(
BCone);
51 extern int BConeSetXArray(
BCone,
double[],
int);
54 extern int DSDPBoundDualVariables(
DSDP,
double,
double);
62 extern int LPConeScaleBarrier(
LPCone,
double);
64 extern int LPConeGetSArray(
LPCone,
double*[],
int*);
70 extern int DSDPCreateSDPCone(
DSDP,
int, SDPCone*);
98 extern int SDPConeAddSparseVecMat(SDPCone,
int,
int,
int,
int,
const int[],
const double[],
int);
99 extern int SDPConeAddDenseVecMat(SDPCone,
int,
int,
int,
double[],
int);
100 extern int SDPConeSetSparseVecMat(SDPCone,
int,
int,
int,
int,
const int[],
const double[],
int);
101 extern int SDPConeSetDenseVecMat(SDPCone,
int,
int,
int,
double[],
int);
110 extern int SDPConeComputeS(SDPCone,
int,
double,
double[],
int,
double,
int,
double[],
int);
112 extern int SDPConeAddADotX(SDPCone,
int,
double,
double[],
int,
double[],
int);
114 extern int SDPConeSetLanczosIterations(SDPCone,
int);
115 extern int SDPConeScaleBarrier(SDPCone,
int,
double);
119 extern int SDPConeUseLAPACKForDualMatrix(SDPCone,
int);
131 #define DSDPGetDualObjective DSDPGetDDObj
132 #define DSDPGetPrimalObjective DSDPGetPPObj
137 extern int DSDPGetPenalty(
DSDP,
double*);
151 #define DSDPSetInitialBarrierParameter DSDPSetBarrierParameter
152 #define DSDPGetInitialBarrierParameter DSDPGetBarrierParameter
180 extern int DSDPUseLAPACKForSchur(
DSDP,
int);
190 extern int DSDPSetFileMonitor(
DSDP,
int);
193 extern int DSDPPrintLogInfo(
int);
194 extern int DSDPComputeMinimumXEigenvalue(
DSDP,
double*);
197 extern int DSDPSetDualLowerBound(
DSDP,
double);
204 extern int DSDPGetFixedYX(
DSDP,
int,
double*);
int DSDPSetBarrierParameter(DSDP dsdp, double mu)
Set the current barrier parameter.
int DSDPCreate(int m, DSDP *dsdpnew)
Create a DSDP solver. FIRST DSDP routine!
int LPConeGetDimension(LPCone lpcone, int *n)
Get the dimension is the number of variables x, which equals the number of slack variables s...
int DSDPGetFinalErrors(DSDP dsdp, double err[6])
Copy six different error measurements into an array.
DSDPTruth
Boolean variables.
int DSDPGetDualBound(DSDP dsdp, double *dbound)
Get the termination parameter.
int DSDPDestroy(DSDP dsdp)
Free the internal data structures of the solver and the cones associated with it. ...
int DSDPGetStepTolerance(DSDP dsdp, double *steptol)
Get the current tolerance.
int LPConeView2(LPCone lpcone)
Print the data in the LP cone to the screen.
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 DSDPGetDYMakeX(DSDP dsdp, double dy[], int m)
Copies the variables dy used to construct X into an array.
int DSDPGetPPObjective(DSDP dsdp, double *ppobj)
Copy the objective value (PP).
int DSDPAddObjectiveConstant(DSDP dsdp, double c)
Add a constant to the objective.
int DSDPReadOptions(DSDP dsdp, char filename[])
Read DSDP parameters from a file.
int DSDPGetRHistory(DSDP dsdp, double hist[], int length)
Copy a history of the infeasibility in (D) into an array.
int DSDPSetDualBound(DSDP dsdp, double dbound)
Terminate the solver if the objective value in (DD) is greater than this tolerance.
int SDPConeSetARankOneMat(SDPCone sdpcone, int blockj, int vari, int n, double alpha, int ishift, const int ind[], const double val[], int nnz)
Set data matrix where v is a sparse vector.
int DSDPGetPenaltyParameter(DSDP dsdp, double *Gamma)
Copy the penalty parameter Gamma.
int DSDPCreateBCone(DSDP dsdp, BCone *dspcone)
Create a new cone that represents bounds on the y variables.
int DSDPSetOptions(DSDP dsdp, char *runargs[], int nargs)
Read command line arguments to set options in DSDP.
Error handling, printing, and profiling.
int SDPConeSetStorageFormat(SDPCone sdpcone, int blockj, char format)
Set the dense storage format of a block in the semidefinite cone.
int DSDPGetGapTolerance(DSDP dsdp, double *gaptol)
Get the termination tolerance.
int SDPConeGetBlockSize(SDPCone sdpcone, int blockj, int *n)
Get the dimension of one block in the semidefinite cone.
int BConeSetUpperBound(BCone bcone, int vari, double ubound)
Set an upper bound on a variable y.
int DSDPSetZBar(DSDP dsdp, double ppobj)
Set an upper bound on the objective value at the solution.
int DSDPSetDestroyRoutine(DSDP dsdp, int(*fd)(void *), void *ctx)
Set a routine that will be called during DSDPDestroy().
int DSDPGetPTolerance(DSDP dsdp, double *inftol)
Copy the feasibility tolerance.
int DSDPComputeAndFactorS(DSDP dsdp, DSDPTruth *psdefinite)
Compute and factor the dual matrix variables.
int DSDPSetDualObjective(DSDP dsdp, int i, double bi)
Set the objective vector b in (D).
int DSDPSetScale(DSDP dsdp, double scale)
Set the internal scaling factor.
int SDPConeCheckData(SDPCone sdpcone)
Check the matrix operations on a data matrix;.
int DSDPUseDynamicRho(DSDP dsdp, int yesorno)
Use a dynamic strategy to choose parameter rho.
int DSDPGetPnorm(DSDP dsdp, double *pnorm)
Copy the proximity of the solution to the central path.
int SDPConeComputeX(SDPCone sdpcone, int blockj, int n, double x[], int nn)
Compute the matrix X.
int SDPConeSetXArray(SDPCone sdpcone, int blockj, int n, double xx[], int nn)
Provide an array for the SDPCone object can use to store dense matrices.
int SDPConeAddConstantMat(SDPCone sdpcone, int blockj, int vari, int n, double value)
Add a matrix whose elements are all the same.
int DSDPPrintSolution(FILE *fp, DSDP dsdp, SDPCone sdpcone, LPCone lpcone)
Print solution in SDPA format.
Internal structures for the DSDP solver.
int DSDPCreateLPCone(DSDP dsdp, LPCone *dspcone)
Create a new object for linear programs and scalar inequalities.
int SDPConeAddADenseVecMat(SDPCone sdpcone, int blockj, int vari, int n, double alpha, double val[], int nnz)
Add a matrix in a dense format.
DSDPTerminationReason
There are many reasons to terminate the solver.
int DSDPSetGapTolerance(DSDP dsdp, double gaptol)
Terminate the solver when the relative duality gap is less than this tolerance.
int LPConeCopyS(LPCone lpcone, double s[], int n)
Copy the variables s into the spedified array.
int SDPConeRestoreXArray(SDPCone sdpcone, int blockj, double *xx[], int *nn)
Restore the dense array and set these pointers to null.
int DSDPPrintData(DSDP dsdp, SDPCone sdpcone, LPCone lpcone)
Print data in SDPA format to a file named "output.sdpa".
int SDPConeGetXArray(SDPCone sdpcone, int blockj, double *xx[], int *nn)
After applying the solver, set a pointer to the array in the object with the solution X...
int DSDPGetDataNorms(DSDP dsdp, double dnorm[3])
Copy the norms of the data C, A, and b into an array.
int SDPConeUseFullSymmetricFormat(SDPCone sdpcone, int blockj)
Use full symmetric format for the dense array.
int LPConeGetXArray(LPCone lpcone, double *x[], int *n)
Get the array used to store the x variables.
int BConeSetLowerBound(BCone bcone, int vari, double lbound)
Set a lower bound on a variable y.
int DSDPSetMonitor(DSDP dsdp, int(*monitor)(DSDP, void *), void *monitorctx)
Monitor each iteration of the solver.
int DSDPSetRTolerance(DSDP dsdp, double inftol)
Classify (D) as feasible only if the variable r is less than this tolerance.
int DSDPSetPTolerance(DSDP dsdp, double inftol)
Classify (P) as feasible only if the infeasibility is less than this tolerance.
int SDPConeSetConstantMat(SDPCone sdpcone, int blockj, int vari, int n, double value)
Set a matrix whose elements are all the same.
int DSDPSetMaxTrustRadius(DSDP dsdp, double rad)
Set a maximum trust radius on the step direction.
int SDPConeAddXVAV(SDPCone sdpcone, int blockj, double vin[], int n, double sum[], int mm)
Compute for i = 0 through m.
int LPConeSetData(LPCone lpcone, int n, const int ik[], const int cols[], const double vals[])
Set data into the LP cone.
int DSDPGetSolutionType(DSDP dsdp, DSDPSolutionType *pdfeasible)
Solutions can be bounded, infeasible, or unbounded.
int DSDPGetDimension(DSDP dsdp, double *n)
Copy the dimension of the cones, or the number of constraints in (D).
int SDPConeViewDataMatrix(SDPCone sdpcone, int blockj, int vari)
Print a data matrix to the screen.
int DSDPSetup(DSDP dsdp)
Set up data structures in the solver and the cones associated with it.
int DSDPReuseMatrix(DSDP dsdp, int rm)
Reuse the Hessian of the barrier function multiple times at each DSDP iteration.
int SDPConeGetNumberOfBlocks(SDPCone sdpcone, int *nblocks)
Get the number of blocks in the semidefinite cone.
Solver, solution types, termination codes,.
int BConeCopyX(BCone bcone, double xl[], double xu[], int m)
Copy the variables into arrays.
int BConeAllocateBounds(BCone bcone, int nnz)
Set a surplus variable in constraint in (P).
int DSDPSetPenaltyParameter(DSDP dsdp, double Gamma)
Set the penalty parameter Gamma.
int DSDPGetReuseMatrix(DSDP dsdp, int *rm)
Copy this parameter.
int SDPConeSetZeroMat(SDPCone sdpcone, int blockj, int vari, int n)
Set a matrix whose elements are all equal zero.
int LPConeGetData(LPCone lpcone, int vari, double vv[], int n)
Get one column (or row) of the LP data.
int SDPConeRemoveDataMatrix(SDPCone sdpcone, int blockj, int vari)
Remove the data matrix from the cone.
int SDPConeAddADotX(SDPCone sdpcone, int blockj, double alpha, double x[], int nn, double adotx[], int m)
Compute the inner products of a dense matrix X with the data matrices.
int DSDPGetPInfeasibility(DSDP dsdp, double *pperror)
Copy the infeasibility in (P).
int SDPConeAddARankOneMat(SDPCone sdpcone, int blockj, int vari, int n, double alpha, int ishift, const int ind[], const double val[], int nnz)
Add data matrix where v is a sparse vector.
int DSDPGetMaxTrustRadius(DSDP dsdp, double *rad)
Copy the current radius of the trust region.
int BConeSetPSlackVariable(BCone bcone, int vari)
Set a slack variable to a constraint in (P).
int DSDPGetDObjective(DSDP dsdp, double *dobj)
Copy the objective value (D).
int SDPConeAddASparseVecMat(SDPCone sdpcone, int blockj, int vari, int n, double alpha, int ishift, const int ind[], const double val[], int nnz)
Add data matrix in a sparse format.
int DSDPGetPotential(DSDP dsdp, double *potential)
Copy the potential of the current solution.
int DSDPSetFixedVariables(DSDP dsdp, double vars[], double vals[], double xout[], int nvars)
Fix variable y to exact values.
int DSDPSetPotentialParameter(DSDP dsdp, double rho)
Set the potential parameter.
int DSDPStopReason(DSDP dsdp, DSDPTerminationReason *reason)
Copy the reason why the solver terminated.
int SDPConeSetIdentity(SDPCone sdpcone, int blockj, int vari, int n, double val)
Set a matrix to be a multiple of the identity matrix.
int SDPConeCheckStorageFormat(SDPCone sdpcone, int blockj, char format)
Check validity of parameters.
int DSDPPrintOptions()
Print runtime options;.
int SDPConeSetXMat(SDPCone sdpcone, int blockj, int n)
Create X matrix.
int SDPConeComputeXV(SDPCone sdpcone, int blockj, int *derror)
Compute a factor V such that .
int DSDPGetPObjective(DSDP dsdp, double *pobj)
Copy the objective value (P).
int DSDPSetY0(DSDP dsdp, int i, double yi0)
Set the initial values of variables y in (D).
int DSDPSetStepTolerance(DSDP dsdp, double steptol)
Terminate the solver if the step length in (DD) is below this tolerance.
int SDPConeUsePackedFormat(SDPCone sdpcone, int blockj)
Use packed symmetric format for the dense array.
int DSDPGetIts(DSDP dsdp, int *its)
Copy the current iteration number.
int SDPConeView2(SDPCone sdpcone)
Print the SDP cone to the screen in a second way.
int SDPConeView(SDPCone sdpcone)
Print the SDPCone to the screen;.
int DSDPView(DSDP dsdp)
Print many of the parameters currently set in DSDP.
int LPConeView(LPCone lpcone)
Print the data in the LP cone to the screen.
int BConeSetPSurplusVariable(BCone bcone, int vari)
Set a surplus variable in constraint in (P).
int SDPConeMatrixView(SDPCone sdpcone, int blockj)
Print the dense array to the screen.
int DSDPSetPNormTolerance(DSDP dsdp, double ptol)
Terminate the solver when the relative duality gap is suffiently small and the PNorm is less than thi...
int SDPConeView3(SDPCone sdpcone)
Print the SDP cone to the screen in a third way.
int SDPConeXVMultiply(SDPCone sdpcone, int blockj, double vin[], double vout[], int n)
Multiply an array by a factor V such that .
int DSDPGetMuMakeX(DSDP dsdp, double *mu)
Copies the value of mu used to construct X.
int DSDPGetYMaxNorm(DSDP dsdp, double *ynorm)
Copy the the infinity norm of the variables y.
int DSDPSolve(DSDP dsdp)
Apply DSDP to the problem.
struct SDPCone_C * SDPCone
The SDPCone object points to blocks of data that specify semidefinite matrix inequalities.
int SDPConeSetBlockSize(SDPCone sdpcone, int blockj, int n)
Set the dimension of one block in the semidefinite cone.
Internal structure for semidefinite cone.
int DSDPGetY(DSDP dsdp, double y[], int m)
Copies the variables y into an array.
int SDPConeSetSparsity(SDPCone sdpcone, int blockj, int nnz)
Set the number of nonzero matrices in a block of the semidefinite cone.
int DSDPGetNumberOfVariables(DSDP dsdp, int *m)
Copy the number of variables y.
int DSDPUsePenalty(DSDP dsdp, int yesorno)
Use penalty parameter to enforce feasibility.
int SDPConeGetStorageFormat(SDPCone sdpcone, int blockj, char *format)
Get the storage format for the block.
int DSDPGetDDObjective(DSDP dsdp, double *ddobj)
Copy the objective value (DD).
int DSDPGetPNormTolerance(DSDP dsdp, double *ptol)
Get the termination tolerance.
int DSDPGetRTolerance(DSDP dsdp, double *inftol)
Copy the maximum infeasibility allowed (D).
int DSDPGetTraceX(DSDP dsdp, double *tracex)
Copy the trace of the variables X in (P).
int DSDPGetR(DSDP dsdp, double *res)
Copy the infeasibility in (D), or the variable r in (DD).
int DSDPComputeX(DSDP dsdp)
Compute the X variables.
int DSDPGetScale(DSDP dsdp, double *scale)
Copy the internal scaling factor from the solver.
int DSDPGetMaxIts(DSDP dsdp, int *its)
Copy the maximum number of iterations from the solver.
int SDPConeAddIdentity(SDPCone sdpcone, int blockj, int vari, int n, double val)
Add a matrix that is a multiple of the identity matrix.
int SDPConeSetASparseVecMat(SDPCone sdpcone, int blockj, int vari, int n, double alpha, int ishift, const int ind[], const double val[], int nnz)
Set data matrix in a sparse format.
int DSDPGetDualityGap(DSDP dsdp, double *dgap)
Copy the difference between the objective values.
struct BCone_C * BCone
The BCone object points to lower and upper bounds on the variable y in (D).
int SDPConeSetADenseVecMat(SDPCone sdpcone, int blockj, int vari, int n, double alpha, double val[], int nnz)
Set a matrix in a dense format.
int DSDPSetYBounds(DSDP dsdp, double lbound, double ubound)
Bound the variables y.
int SDPConeComputeS(SDPCone sdpcone, int blockj, double cc, double y[], int nvars, double r, int n, double s[], int nn)
Compute the dual matrix S.
int DSDPGetPotentialParameter(DSDP dsdp, double *rho)
Copy the potential parameter.
int DSDPGetYBounds(DSDP dsdp, double *lbound, double *ubound)
Copy the bounds on the variables y.
int LPConeSetData2(LPCone lpcone, int n, const int ik[], const int cols[], const double vals[])
Set data A and into the LP cone.
int DSDPCopyB(DSDP dsdp, double bb[], int m)
Copies the variables b from solver into an array.
int DSDPSetR0(DSDP dsdp, double res)
Set an initial value for the variable r in (DD)
int DSDPSetMaxIts(DSDP dsdp, int its)
Terminate the solver after this number of iterations.
int DSDPGetGapHistory(DSDP dsdp, double hist[], int length)
Copy a history of the duality gap into an array.
int DSDPGetYMakeX(DSDP dsdp, double y[], int m)
Copies the variables y used to construct X into an array.
int DSDPSetFixedVariable(DSDP dsdp, int vari, double val)
Fix variable y to exact value.
int DSDPSetStandardMonitor(DSDP dsdp, int k)
Print at every kth iteration.
struct LPCone_C * LPCone
The LPCone object points to blocks of data that specify linear scalar inequality constraints.
DSDPSolutionType
Formulations (P) and (D) can be feasible and bounded, feasible and unbounded, or infeasible.
int SDPConeViewX(SDPCone sdpcone, int blockj, int n, double x[], int nn)
Print a dense array X to the screen.