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

  dsdp | the solver
  dsdpops | address of a structure with function pointers
  dsdpcone | address 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

  dsdp | the solver
  row | corresponding to which variable y.
  R | the 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

  dsdp | the solver
  Anorm2 | norm 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

  dsdp | the solver
  vt | scaling for each element in the next two vectors
  vrhs1 | scaled gradient of the objective function
  vrhs2 | scaled 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

  dsdp | the solver
  M | matrix
  vrhs1 | gradient of objective (b)
  vrhs2 | gradient 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

  dsdp | the solver
  logdet | evaluated 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

  dsdp | the solver
  DY | step direction
  flag | primal or dual structure
  maxsteplength | the 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

  dsdp | the solver
  Y | variables
  flag | primal or dual structure
  ispsdefinite | DSDP_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

  dsdp | the solver
  xmakermu | barrier parameter
  xmakery | input y variables
  xmakerdy | input step direction
  AX | output product of X and the data
  tracexs | ouput 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

  dsdp | the 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

  dsdp | the solver
  n | dimension

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

  dsdp | the solver
  v | input vector.
  vv | product gradient of barrier

Definition at line 188 of file dsdpcops.c.

## DSDPInvertS()

int DSDPInvertS | ( | DSDP | dsdp | ) |

Invert the S variables in each cone.

Parameters

  dsdp | the 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

  dsdp | the solver
  tag | allow 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

  dsdp | the solver
  mu | barrier parameter
  Y | input y variables
  DY | input 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

  dsdp | the solver
  row | corresponding to the variable y.
  rnnz | nonzeros indicate a nonzero in the Shur matrix at that column.
  m | size 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

  dsdp | the solver
  tcone | a 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

  dsdp | the solver
  sops | address of a structure with function pointers
  mdata | address 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

  dsdp | the 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

  dsdp | the solver
  yy0 | variable vector
  M | Shur Matrix

Definition at line 84 of file dsdpcops.c.

## DSDPViewCones()

int DSDPViewCones | ( | DSDP | dsdp | ) |

Each cone should print its state.

Parameters

  dsdp | the solver

Definition at line 424 of file dsdpcops.c.