DSDP
Typedefs | Functions
dsdpcone.h File Reference

The public interface between the cones and the solver. More...

Go to the source code of this file.

Typedefs

typedef struct DSDPCone_C DSDPCone
 This object holds the data of a SDP, LP, or other cone. Its structure is opaque to the DSDP Solver, but it must implement the interface below and provide a structure of function pointers.
 

Functions

int DSDPConeANorm2 (DSDPCone, DSDPVec)
 Add square of 2-norm of data correponding to each variable y.
 
int DSDPConeComputeHessian (DSDPCone, double, DSDPSchurMat, DSDPVec, DSDPVec)
 Compute Hessian and gradient of barrier function.
 
int DSDPConeComputeLogSDeterminant (DSDPCone, double *, double *)
 Evaluate logrithmic barrier function.
 
int DSDPConeComputeMaxStepLength (DSDPCone, DSDPVec, DSDPDualFactorMatrix, double *)
 Determine distance to the edge of the cone.
 
int DSDPConeComputeRHS (DSDPCone, double, DSDPVec, DSDPVec, DSDPVec)
 Compute gradient of barrier function.
 
int DSDPConeComputeS (DSDPCone, DSDPVec, DSDPDualFactorMatrix, DSDPTruth *)
 Given y, compute S and determine whether its in the cone.
 
int DSDPConeComputeX (DSDPCone, double, DSDPVec, DSDPVec, DSDPVec, double *)
 Given y,dy, and mu, construct X and add its inner product with the data and S.
 
int DSDPConeDestroy (DSDPCone *)
 Free the internal memory of the cone.
 
int DSDPConeGetDimension (DSDPCone, double *)
 Provide the dimension of the cone.
 
int DSDPConeInitialize (DSDPCone *)
 Initialize the pointers to 0.
 
int DSDPConeInvertS (DSDPCone)
 Invert the dual matrix S.
 
int DSDPConeMonitor (DSDPCone, int)
 Do anything at in the cone at each iteration.
 
int DSDPConeMultiplyAdd (DSDPCone, double, DSDPVec, DSDPVec, DSDPVec)
 Multiply Hessian by a vector and add the result.
 
int DSDPConeSetData (DSDPCone *, struct DSDPCone_Ops *, void *)
 Initialize the pointers to 0.
 
int DSDPConeSetUp (DSDPCone, DSDPVec)
 Factor the data and allocate data structures.
 
int DSDPConeSetUp2 (DSDPCone, DSDPVec, DSDPSchurMat)
 Factor the data and allocate data structures.
 
int DSDPConeSetXMaker (DSDPCone, double, DSDPVec, DSDPVec)
 Pass information needed to construct X.
 
int DSDPConeSparsityInSchurMat (DSDPCone, int, int[], int)
 Identify sparsity pattern in a row of the Hessian term.
 
int DSDPConeView (DSDPCone)
 View contents of the cone.
 
int DSDPGetConeName (DSDPCone, char *, int)
 Get name of the cone.
 

Detailed Description

The public interface between the cones and the solver.

Definition in file dsdpcone.h.

Typedef Documentation

◆ DSDPCone

This object holds the data of a SDP, LP, or other cone. Its structure is opaque to the DSDP Solver, but it must implement the interface below and provide a structure of function pointers.

Definition at line 27 of file dsdpcone.h.

Function Documentation

◆ DSDPConeANorm2()

int DSDPConeANorm2 ( DSDPCone  K,
DSDPVec  anorm2 
)

Add square of 2-norm of data correponding to each variable y.

Parameters
Kthe cone
anorm2norm of constraint data for each varibles
See also
DSDPBlockANorm2

Definition at line 168 of file dsdpcone.c.

Referenced by DSDPComputeANorm2().

◆ DSDPConeComputeHessian()

int DSDPConeComputeHessian ( DSDPCone  K,
double  mu,
DSDPSchurMat  M,
DSDPVec  vrhs1,
DSDPVec  vrhs2 
)

Compute Hessian and gradient of barrier function.

Parameters
Kthe cone
mubarrier parameter
MSchur matrix
vrhs1objective gradient
vrhs2barrier gradient

This routine assumes that the dual matrix has already been factored and inverted.

See also
SDPConeComputeHessian()

Definition at line 92 of file dsdpcone.c.

Referenced by DSDPComputeHessian().

◆ DSDPConeComputeLogSDeterminant()

int DSDPConeComputeLogSDeterminant ( DSDPCone  K,
double *  logdetobj,
double *  logdet 
)

Evaluate logrithmic barrier function.

Parameters
Kthe cone
logdetobjused term.
logdetlogarithmic barrier of cone Assumes S is in cone.

Definition at line 403 of file dsdpcone.c.

Referenced by DSDPComputeLogSDeterminant().

◆ DSDPConeComputeMaxStepLength()

int DSDPConeComputeMaxStepLength ( DSDPCone  K,
DSDPVec  DY,
DSDPDualFactorMatrix  flag,
double *  maxsteplength 
)

Determine distance to the edge of the cone.

Parameters
Kthe cone
DYstep direction
flagidentifies which of two S matrix structures should be used.
maxsteplengthdistance to the edge of the cone.

Definition at line 288 of file dsdpcone.c.

Referenced by DSDPComputeMaxStepLength().

◆ DSDPConeComputeRHS()

int DSDPConeComputeRHS ( DSDPCone  K,
double  mu,
DSDPVec  vrow,
DSDPVec  rhs1,
DSDPVec  rhs2 
)

Compute gradient of barrier function.

Parameters
Kthe cone
mubarrier parameter
vrowscaling for each element in the gradient.
rhs1objective gradient
rhs2barrier gradient

This routine assumes that the dual matrix has already been factored and inverted. Define rhs2 += mu * vrow .* A(S^{-1})

See also
SDPConeComputeRHS()

Definition at line 147 of file dsdpcone.c.

Referenced by DSDPComputeG().

◆ DSDPConeComputeS()

int DSDPConeComputeS ( DSDPCone  K,
DSDPVec  Y,
DSDPDualFactorMatrix  flag,
DSDPTruth ispsdefinite 
)

Given y, compute S and determine whether its in the cone.

Parameters
Kthe cone
Ysolution
flagidentifies which of two S matrix structures should be used.
ispsdefinitetrue if S is positive definite or an element of the cone.

Definition at line 242 of file dsdpcone.c.

Referenced by DSDPComputeSS().

◆ DSDPConeComputeX()

int DSDPConeComputeX ( DSDPCone  K,
double  mu,
DSDPVec  y,
DSDPVec  dy,
DSDPVec  AX,
double *  tracexs 
)

Given y,dy, and mu, construct X and add its inner product with the data and S.

Parameters
Kthe cone
mubarrier parameter
ysolution
dystep direction
AXadd the inner product of the data with X
tracexsinner product of X and S.
See also
SDPConeComputeXX()

Definition at line 216 of file dsdpcone.c.

Referenced by DSDPComputeXVariables().

◆ DSDPConeDestroy()

int DSDPConeDestroy ( DSDPCone K)

Free the internal memory of the cone.

Parameters
Kthe cone

Definition at line 64 of file dsdpcone.c.

Referenced by DSDPDestroyCones().

◆ DSDPConeGetDimension()

int DSDPConeGetDimension ( DSDPCone  K,
double *  n 
)

Provide the dimension of the cone.

Parameters
Kthe cone
nconic dimension (an integer value)

Definition at line 312 of file dsdpcone.c.

Referenced by DSDPGetConicDimension().

◆ DSDPConeInitialize()

int DSDPConeInitialize ( DSDPCone K)

Initialize the pointers to 0.

Parameters
Kthe cone

Definition at line 495 of file dsdpcone.c.

Referenced by DSDPAddCone(), DSDPConeDestroy(), and DSDPDestroyCones().

◆ DSDPConeInvertS()

int DSDPConeInvertS ( DSDPCone  K)

Invert the dual matrix S.

Parameters
Kthe cone

Assumes that the matrix has already been factored.

Definition at line 265 of file dsdpcone.c.

Referenced by DSDPInvertS().

◆ DSDPConeMonitor()

int DSDPConeMonitor ( DSDPCone  K,
int  tag 
)

Do anything at in the cone at each iteration.

Parameters
Kthe cone
tagallows for multiple types of monitors.

This routine has be used to visualize data, print some statistics, ...

Definition at line 380 of file dsdpcone.c.

Referenced by DSDPMonitorCones().

◆ DSDPConeMultiplyAdd()

int DSDPConeMultiplyAdd ( DSDPCone  K,
double  mu,
DSDPVec  vrow,
DSDPVec  v,
DSDPVec  vv 
)

Multiply Hessian by a vector and add the result.

Parameters
Kthe cone
mubarrier parameter
vrowscaling for each element in the product.
vinput vector gradient
vvoutput vector

This routine assumes that the dual matrix has already been factored and inverted. If M is the hessian, then vv += vrow .* Mv

Definition at line 119 of file dsdpcone.c.

Referenced by DSDPHessianMultiplyAdd().

◆ DSDPConeSetData()

int DSDPConeSetData ( DSDPCone K,
struct DSDPCone_Ops *  ops,
void *  data 
)

Initialize the pointers to 0.

Parameters
Kthe cone
opsaddress of a structure of function pointers.
dataaddress of a structure representing a cone

Definition at line 477 of file dsdpcone.c.

Referenced by DSDPAddCone(), and DSDPConeInitialize().

◆ DSDPConeSetUp()

int DSDPConeSetUp ( DSDPCone  K,
DSDPVec  y 
)

Factor the data and allocate data structures.

Parameters
Kthe cone
yinitial solution vector

Definition at line 22 of file dsdpcone.c.

Referenced by DSDPSetUpCones().

◆ DSDPConeSetUp2()

int DSDPConeSetUp2 ( DSDPCone  K,
DSDPVec  yy0,
DSDPSchurMat  M 
)

Factor the data and allocate data structures.

Parameters
Kthe cone
yy0initial solution vector
MSchur matrix

Definition at line 43 of file dsdpcone.c.

Referenced by DSDPSetUpCones2().

◆ DSDPConeSetXMaker()

int DSDPConeSetXMaker ( DSDPCone  K,
double  mu,
DSDPVec  y,
DSDPVec  dy 
)

Pass information needed to construct X.

Parameters
Kthe cone
mubarrier parameter
ysolution
dystep direction

Definition at line 191 of file dsdpcone.c.

Referenced by DSDPPassXVectors().

◆ DSDPConeSparsityInSchurMat()

int DSDPConeSparsityInSchurMat ( DSDPCone  K,
int  row,
int  rnnz[],
int  m 
)

Identify sparsity pattern in a row of the Hessian term.

Parameters
Kthe cone
rowbetween 1 and m
rnnzmark elements nonzero for nonzeros in Hessian of barrier.
mnumber of y variables, length of array, and size of M matrix
See also
DSDPSparsityInSchurMat()
DSDPSchurSparsity()

Definition at line 338 of file dsdpcone.c.

Referenced by DSDPSchurSparsity().

◆ DSDPConeView()

int DSDPConeView ( DSDPCone  K)

View contents of the cone.

Parameters
Kthe cone

Definition at line 358 of file dsdpcone.c.

Referenced by DSDPViewCones().

◆ DSDPGetConeName()

int DSDPGetConeName ( DSDPCone  K,
char *  cname,
int  maxlength 
)

Get name of the cone.

Parameters
Kthe cone
cnamestring to copy the string
maxlengthmaximum length of the string.

Definition at line 427 of file dsdpcone.c.

Referenced by DSDPSetCone().