dsdpcone.c File Reference

Methods of a cone. More...

Go to the source code of this file.

## Functions

int | DSDPConeANorm2 (DSDPCone K, DSDPVec anorm2)
| Add square of 2-norm of data correponding to each variable y.
int | DSDPConeComputeHessian (DSDPCone K, double mu, DSDPSchurMat M, DSDPVec vrhs1, DSDPVec vrhs2)
| Compute Hessian and gradient of barrier function.
int | DSDPConeComputeLogSDeterminant (DSDPCone K, double *logdetobj, double *logdet)
| Evaluate logrithmic barrier function.
int | DSDPConeComputeMaxStepLength (DSDPCone K, DSDPVec DY, DSDPDualFactorMatrix flag, double *maxsteplength)
| Determine distance to the edge of the cone.
int | DSDPConeComputeRHS (DSDPCone K, double mu, DSDPVec vrow, DSDPVec rhs1, DSDPVec rhs2)
| Compute gradient of barrier function.
int | DSDPConeComputeS (DSDPCone K, DSDPVec Y, DSDPDualFactorMatrix flag, DSDPTruth *ispsdefinite)
| Given y, compute S and determine whether its in the cone.
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.
int | DSDPConeDestroy (DSDPCone *K)
| Free the internal memory of the cone.
int | DSDPConeGetDimension (DSDPCone K, double *n)
| Provide the dimension of the cone.
int | DSDPConeInitialize (DSDPCone *K)
| Initialize the pointers to 0.
int | DSDPConeInvertS (DSDPCone K)
| Invert the dual matrix S.
int | DSDPConeMonitor (DSDPCone K, int tag)
| Do anything at in the cone at each iteration.
int | DSDPConeMultiplyAdd (DSDPCone K, double mu, DSDPVec vrow, DSDPVec v, DSDPVec vv)
| Multiply Hessian by a vector and add the result.
int | DSDPConeOpsInitialize (struct DSDPCone_Ops *dops)
| Initialize the function pointers to 0.
int | DSDPConeSetData (DSDPCone *K, struct DSDPCone_Ops *ops, void *data)
| Initialize the pointers to 0.
int | DSDPConeSetUp (DSDPCone K, DSDPVec y)
| Factor the data and allocate data structures.
int | DSDPConeSetUp2 (DSDPCone K, DSDPVec yy0, DSDPSchurMat M)
| Factor the data and allocate data structures.
int | DSDPConeSetXMaker (DSDPCone K, double mu, DSDPVec y, DSDPVec dy)
| Pass information needed to construct X.
int | DSDPConeSparsityInSchurMat (DSDPCone K, int row, int rnnz[], int m)
| Identify sparsity pattern in a row of the Hessian term.
int | DSDPConeView (DSDPCone K)
| View contents of the cone.
int | DSDPGetConeName (DSDPCone K, char *cname, int maxlength)
| Get name of the cone.

## Detailed Description

Methods of a cone.

Definition in file dsdpcone.c.

## Function Documentation

## DSDPConeANorm2()

int DSDPConeANorm2 | ( | DSDPCone | K,
|  | DSDPVec | anorm2
| ) |  |

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

Parameters

  K | the cone
  anorm2 | norm 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

  K | the cone
  mu | barrier parameter
  M | Schur matrix
  vrhs1 | objective gradient
  vrhs2 | barrier 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

  K | the cone
  logdetobj | used term.
  logdet | logarithmic 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

  K | the cone
  DY | step direction
  flag | identifies which of two S matrix structures should be used.
  maxsteplength | distance 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

  K | the cone
  mu | barrier parameter
  vrow | scaling for each element in the gradient.
  rhs1 | objective gradient
  rhs2 | barrier 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

  K | the cone
  Y | solution
  flag | identifies which of two S matrix structures should be used.
  ispsdefinite | true 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

  K | the cone
  mu | barrier parameter
  y | solution
  dy | step direction
  AX | add the inner product of the data with X
  tracexs | inner 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

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

  K | the cone
  n | conic 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

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

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

  K | the cone
  tag | allows 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

  K | the cone
  mu | barrier parameter
  vrow | scaling for each element in the product.
  v | input vector gradient
  vv | output 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().

## DSDPConeOpsInitialize()

int DSDPConeOpsInitialize | ( | struct DSDPCone_Ops * | dops | ) |

Initialize the function pointers to 0.

Parameters

  dops | address of a structure of function pointers.

Definition at line 443 of file dsdpcone.c.

Referenced by DSDPConeInitialize().

## DSDPConeSetData()

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

Initialize the pointers to 0.

Parameters

  K | the cone
  ops | address of a structure of function pointers.
  data | address 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

  K | the cone
  y | initial 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

  K | the cone
  yy0 | initial solution vector
  M | Schur 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

  K | the cone
  mu | barrier parameter
  y | solution
  dy | step 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

  K | the cone
  row | between 1 and m
  rnnz | mark elements nonzero for nonzeros in Hessian of barrier.
  m | number 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

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

  K | the cone
  cname | string to copy the string
  maxlength | maximum length of the string.

Definition at line 427 of file dsdpcone.c.

Referenced by DSDPSetCone().