DSDP
Functions
dsdpcops.c File Reference

Applies conic operations to each cone in the solver. More...

Go to the source code of this file.

Functions

int DSDPAddCone (DSDP dsdp, struct DSDPCone_Ops *dsdpops, void *dsdpcone)
 Apply DSDP to a conic structure.
 
int DSDPAddSchurRow (DSDP, int, DSDPVec)
 Add a row to the Schur matrix.
 
int DSDPComputeANorm2 (DSDP dsdp, DSDPVec Anorm2)
 Compute norm of A and C.
 
int DSDPComputeG (DSDP dsdp, DSDPVec vt, DSDPVec vrhs1, DSDPVec vrhs2)
 Compute the gradient of the barrier for each cone.
 
int DSDPComputeHessian (DSDP dsdp, DSDPSchurMat M, DSDPVec vrhs1, DSDPVec vrhs2)
 Compute the Schur complement, or Gram, matrix for each cone.
 
int DSDPComputeLogSDeterminant (DSDP dsdp, double *logdet)
 Compute the logarithmic barrier function for the dual varialbe S.
 
int DSDPComputeMaxStepLength (DSDP dsdp, DSDPVec DY, DSDPDualFactorMatrix flag, double *maxsteplength)
 Compute the maximum step length for the given step direction.
 
int DSDPComputeSS (DSDP dsdp, DSDPVec Y, DSDPDualFactorMatrix flag, DSDPTruth *ispsdefinite)
 Compute the dual variables S in each cone.
 
int DSDPComputeXVariables (DSDP dsdp, double xmakermu, DSDPVec xmakery, DSDPVec xmakerdy, DSDPVec AX, double *tracexs)
 Compute the X variables in each cone.
 
int DSDPDestroyCones (DSDP dsdp)
 Each cone shoudl free its data structures.
 
int DSDPGetConicDimension (DSDP dsdp, double *n)
 Get the total dimension of the cones.
 
int DSDPHessianMultiplyAdd (DSDP dsdp, DSDPVec v, DSDPVec vv)
 Add the product of Schur matrix with v.
 
int DSDPInvertS (DSDP dsdp)
 Invert the S variables in each cone.
 
int DSDPMonitorCones (DSDP dsdp, int tag)
 This routine is called once per iteration.
 
int DSDPPassXVectors (DSDP dsdp, double mu, DSDPVec Y, DSDPVec DY)
 Pass the information needed to compute the variables X in each cone but do not compute X.
 
int DSDPSchurSparsity (DSDP dsdp, int row, int rnnz[], int m)
 Each cone should print its state.
 
int DSDPSetCone (DSDP dsdp, DSDPCone tcone)
 Pass a cone to the DSDP solver.
 
int DSDPSetSchurMatOps (DSDP, struct DSDPSchurMat_Ops *, void *)
 Set the Schur complement matrix.
 
int DSDPSetUpCones (DSDP dsdp)
 Each cone should factor data or allocate internal data structures.
 
int DSDPSetUpCones2 (DSDP dsdp, DSDPVec yy0, DSDPSchurMat M)
 Each cone should allocate its data structures .
 
int DSDPViewCones (DSDP dsdp)
 Each cone should print its state.
 

Detailed Description

Applies conic operations to each cone in the solver.

Definition in file dsdpcops.c.

Function Documentation

◆ DSDPAddCone()

int DSDPAddCone ( DSDP  dsdp,
struct DSDPCone_Ops *  dsdpops,
void *  dsdpcone 
)

Apply DSDP to a conic structure.

Parameters
dsdpthe solver
dsdpopsaddress of a structure with function pointers
dsdpconeaddress of a cone structure

DSDP operates on cones such as the semidefinite cone and nonnegative orthant. Given variables y from the solver, each cone implements operations such as computing S, maximum step length, computing the Newton matrix, and computing the Hessian. Each operation is well defined by the dual-scaling algorithm. A cone that implements these operations can be added to the DSDP solver.

See also
DSDPCreateSDPCone()
DSDPCreateLPCone()
DSDPCreateBCone()
Todo:
Add SOCP cone and application-specific cones.

Definition at line 569 of file dsdpcops.c.

Referenced by DSDPAddLUBounds(), DSDPAddRCone(), and DSDPAddSDP().

◆ DSDPAddSchurRow()

int DSDPAddSchurRow ( DSDP  dsdp,
int  row,
DSDPVec  R 
)

Add a row to the Schur matrix.

Parameters
dsdpthe solver
rowcorresponding to which variable y.
Rthe elements of the row.

This routine is called by the conic routines that compute the Hessian matrix.

Definition at line 622 of file dsdpcops.c.

◆ DSDPComputeANorm2()

int DSDPComputeANorm2 ( DSDP  dsdp,
DSDPVec  Anorm2 
)

Compute norm of A and C.

Parameters
dsdpthe solver
Anorm2norm of data corresponding to each variable y.

Definition at line 246 of file dsdpcops.c.

Referenced by DSDPComputeDataNorms().

◆ DSDPComputeG()

int DSDPComputeG ( DSDP  dsdp,
DSDPVec  vt,
DSDPVec  vrhs1,
DSDPVec  vrhs2 
)

Compute the gradient of the barrier for each cone.

Parameters
dsdpthe solver
vtscaling for each element in the next two vectors
vrhs1scaled gradient of the objective function
vrhs2scaled gradient of the barrier function

Definition at line 215 of file dsdpcops.c.

Referenced by DSDPComputeDualStepDirections(), and DSDPSolveDynamicRho().

◆ DSDPComputeHessian()

int DSDPComputeHessian ( DSDP  dsdp,
DSDPSchurMat  M,
DSDPVec  vrhs1,
DSDPVec  vrhs2 
)

Compute the Schur complement, or Gram, matrix for each cone.

Parameters
dsdpthe solver
Mmatrix
vrhs1gradient of objective (b)
vrhs2gradient of barrier

Definition at line 142 of file dsdpcops.c.

Referenced by DSDPComputeDualStepDirections().

◆ DSDPComputeLogSDeterminant()

int DSDPComputeLogSDeterminant ( DSDP  dsdp,
double *  logdet 
)

Compute the logarithmic barrier function for the dual varialbe S.

Parameters
dsdpthe solver
logdetevaluated barrier function
See also
DSDPComputeSS()

Definition at line 495 of file dsdpcops.c.

Referenced by DSDPInitializeVariables(), DSDPResetY0(), DSDPYStepLineSearch(), and DSDPYStepLineSearch2().

◆ DSDPComputeMaxStepLength()

int DSDPComputeMaxStepLength ( DSDP  dsdp,
DSDPVec  DY,
DSDPDualFactorMatrix  flag,
double *  maxsteplength 
)

Compute the maximum step length for the given step direction.

Parameters
dsdpthe solver
DYstep direction
flagprimal or dual structure
maxsteplengththe minumum of maximums on each cone.
See also
DSDPComputeSS()

Definition at line 336 of file dsdpcops.c.

Referenced by DSDPChooseBarrierParameter(), DSDPYStepLineSearch(), and DSDPYStepLineSearch2().

◆ DSDPComputeSS()

int DSDPComputeSS ( DSDP  dsdp,
DSDPVec  Y,
DSDPDualFactorMatrix  flag,
DSDPTruth ispsdefinite 
)

Compute the dual variables S in each cone.

Parameters
dsdpthe solver
Yvariables
flagprimal or dual structure
ispsdefiniteDSDP_TRUE if a member of the cone, DSDP_FALSE otherwise.

Definition at line 272 of file dsdpcops.c.

Referenced by DSDPChooseBarrierParameter(), DSDPInitializeVariables(), DSDPResetY0(), DSDPSolveDynamicRho(), DSDPYStepLineSearch(), and DSDPYStepLineSearch2().

◆ DSDPComputeXVariables()

int DSDPComputeXVariables ( DSDP  dsdp,
double  xmakermu,
DSDPVec  xmakery,
DSDPVec  xmakerdy,
DSDPVec  AX,
double *  tracexs 
)

Compute the X variables in each cone.

Parameters
dsdpthe solver
xmakermubarrier parameter
xmakeryinput y variables
xmakerdyinput step direction
AXoutput product of X and the data
tracexsouput inner product of X and S.

Definition at line 654 of file dsdpcops.c.

◆ DSDPDestroyCones()

int DSDPDestroyCones ( DSDP  dsdp)

Each cone shoudl free its data structures.

Parameters
dsdpthe solver

Definition at line 107 of file dsdpcops.c.

Referenced by DSDPTakeDown().

◆ DSDPGetConicDimension()

int DSDPGetConicDimension ( DSDP  dsdp,
double *  n 
)

Get the total dimension of the cones.

Parameters
dsdpthe solver
ndimension

Definition at line 401 of file dsdpcops.c.

Referenced by DSDPCheckConvergence(), and DSDPTakeDown().

◆ DSDPHessianMultiplyAdd()

int DSDPHessianMultiplyAdd ( DSDP  dsdp,
DSDPVec  v,
DSDPVec  vv 
)

Add the product of Schur matrix with v.

Parameters
dsdpthe solver
vinput vector.
vvproduct gradient of barrier

Definition at line 188 of file dsdpcops.c.

◆ DSDPInvertS()

int DSDPInvertS ( DSDP  dsdp)

Invert the S variables in each cone.

Parameters
dsdpthe solver
See also
DSDPComputeSS()

Definition at line 307 of file dsdpcops.c.

Referenced by DSDPComputeDualStepDirections(), and DSDPSolveDynamicRho().

◆ DSDPMonitorCones()

int DSDPMonitorCones ( DSDP  dsdp,
int  tag 
)

This routine is called once per iteration.

Parameters
dsdpthe solver
tagallow for multiple monitors

The cone can print statistics, visualize data, terminate solver, or whatever it wants.

Definition at line 450 of file dsdpcops.c.

Referenced by DSDPCheckConvergence().

◆ DSDPPassXVectors()

int DSDPPassXVectors ( DSDP  dsdp,
double  mu,
DSDPVec  Y,
DSDPVec  DY 
)

Pass the information needed to compute the variables X in each cone but do not compute X.

Parameters
dsdpthe solver
mubarrier parameter
Yinput y variables
DYinput step direction
See also
DSDPComputeXVariables()

Definition at line 378 of file dsdpcops.c.

Referenced by DSDPSaveYForX().

◆ DSDPSchurSparsity()

int DSDPSchurSparsity ( DSDP  dsdp,
int  row,
int  rnnz[],
int  m 
)

Each cone should print its state.

Parameters
dsdpthe solver
rowcorresponding to the variable y.
rnnznonzeros indicate a nonzero in the Shur matrix at that column.
msize of Schur matrix and the arrow.

Definition at line 474 of file dsdpcops.c.

Referenced by DSDPSparsityInSchurMat().

◆ DSDPSetCone()

int DSDPSetCone ( DSDP  dsdp,
DSDPCone  tcone 
)

Pass a cone to the DSDP solver.

Parameters
dsdpthe solver
tconea cone object.

Definition at line 522 of file dsdpcops.c.

Referenced by DSDPAddCone().

◆ DSDPSetSchurMatOps()

int DSDPSetSchurMatOps ( DSDP  dsdp,
struct DSDPSchurMat_Ops *  sops,
void *  mdata 
)

Set the Schur complement matrix.

Parameters
dsdpthe solver
sopsaddress of a structure with function pointers
mdataaddress of a matrix object

The step direction in DSDP is the solution to a set of linear equations. The cones used by DSDP compute the elements of the matrix and the right-hand side vectors. Any matrix that implements the Schur complement matrix interface can be used by DSDP. In addition to factoring a matrix and solving it, this interface also provides matrix assembly routines for the cones.

See also
DSDPAddCone()
Todo:
Use SCALAPACK to assemble, factor, and solve the matrix in parallel.

Definition at line 602 of file dsdpcops.c.

◆ DSDPSetUpCones()

int DSDPSetUpCones ( DSDP  dsdp)

Each cone should factor data or allocate internal data structures.

Parameters
dsdpthe solver

Definition at line 58 of file dsdpcops.c.

◆ DSDPSetUpCones2()

int DSDPSetUpCones2 ( DSDP  dsdp,
DSDPVec  yy0,
DSDPSchurMat  M 
)

Each cone should allocate its data structures .

Parameters
dsdpthe solver
yy0variable vector
MShur Matrix

Definition at line 84 of file dsdpcops.c.

◆ DSDPViewCones()

int DSDPViewCones ( DSDP  dsdp)

Each cone should print its state.

Parameters
dsdpthe solver

Definition at line 424 of file dsdpcops.c.