dsdpschurmat.h File Reference

Methods of a Schur Matrix. More...

Go to the source code of this file.

## Data Structures

struct | DSDPSchurMat_C
| Schur complement matrix whose solution is the Newton direction. More...

## Typedefs

typedef struct DSDPSchurMat_C | DSDPSchurMat
| This object represents the Schur Matrix. Its structure is opaque to the DSDP solver, but it must implement the interface below and provide a structure of function pointers.

## Functions

int | DSDPSchurMatAddDiagonal (DSDPSchurMat, DSDPVec)
| Add elements to a row of the Schur matrix.
int | DSDPSchurMatAddDiagonalElement (DSDPSchurMat, int, double)
| Determine with the cone should compute this diagonal element of M and RHS.
int | DSDPSchurMatAddR (DSDPSchurMat, int, double)
| Add an element to the Schur matrix correponding the variable r.
int | DSDPSchurMatAddRow (DSDPSchurMat, int, double, DSDPVec)
| Add elements to a row of the Schur matrix.
int | DSDPSchurMatAssemble (DSDPSchurMat)
| Final assembly of M.
int | DSDPSchurMatDestroy (DSDPSchurMat *)
| Free the memory in the data structure.
int | DSDPSchurMatDiagonalScaling (DSDPSchurMat, DSDPVec)
| Get the scaling and nonzero pattern of each diagonal element of the matrix.
int | DSDPSchurMatFactor (DSDPSchurMat, DSDPTruth *)
| Factor M.
int | DSDPSchurMatInitialize (DSDPSchurMat *)
| Initialize pointers to null.
int | DSDPSchurMatInParallel (DSDPSchurMat, DSDPTruth *)
| Determine whether M is computed in parallel.
int | DSDPSchurMatMultiply (DSDPSchurMat, DSDPVec, DSDPVec)
| Multiply M by a vector. y = M x.
int | DSDPSchurMatReducePVec (DSDPSchurMat, DSDPVec)
| Collect elements of the vector.
int | DSDPSchurMatRowColumnScaling (DSDPSchurMat, int, DSDPVec, int *)
| Get the scaling and nonzero pattern of each column in this row of the matrix.
int | DSDPSchurMatRowScaling (DSDPSchurMat, DSDPVec)
| Identify which rows on on this processor.
int | DSDPSchurMatSetData (DSDPSchurMat *, struct DSDPSchurMat_Ops *, void *)
| Set the Schur matrix with an opaque pointer and structure of function pointers.
int | DSDPSchurMatSetR (DSDPSchurMat, double)
| Set up the data structure.
int | DSDPSchurMatSetup (DSDPSchurMat, DSDPVec)
| Set up the data structure.
int | DSDPSchurMatShiftDiagonal (DSDPSchurMat, double)
| Add a scalar to each diagonal element of the matrix.
int | DSDPSchurMatSolve (DSDPSchurMat, DSDPVec, DSDPVec)
| Solve the linear system.
int | DSDPSchurMatVariableCompute (DSDPSchurMat, int, double *)
| Determine with the cone should compute this diagonal element of M and RHS.
int | DSDPSchurMatVariableComputeR (DSDPSchurMat, double *)
| Add an element to the Schur matrix correponding the variable r.
int | DSDPSchurMatView (DSDPSchurMat)
| Print the matrix.
int | DSDPSchurMatZeroEntries (DSDPSchurMat)
| Zero all element in the matrix.

## Detailed Description

Methods of a Schur Matrix.

Definition in file dsdpschurmat.h.

## Typedef Documentation

## DSDPSchurMat

struct DSDPSchurMat_C DSDPSchurMat

This object represents the Schur Matrix. 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 49 of file dsdpschurmat.h.

## Function Documentation

## DSDPSchurMatAddDiagonal()

int DSDPSchurMatAddDiagonal | ( | DSDPSchurMat | M,
|  | DSDPVec | D
| ) |  |

extern

Add elements to a row of the Schur matrix.

Parameters

  M | matrix
  D | diagonal elements.

Conic object call this routine when evaluating the Hessian of the barrier term.

See also
  DSDPSchurMatDiagonalScaling()

Definition at line 272 of file dsdpschurmatadd.c.

## DSDPSchurMatAddDiagonalElement()

int DSDPSchurMatAddDiagonalElement | ( | DSDPSchurMat | M,
|  | int | row,
|  | double | dd
| ) |  |

extern

Determine with the cone should compute this diagonal element of M and RHS.

Parameters

  M | matrix
  row | correponding the y variable
  dd | zero or one..

See also
  DSDPSchurMatVariableCompute()

Definition at line 157 of file dsdpschurmatadd.c.

## DSDPSchurMatAddR()

int DSDPSchurMatAddR | ( | DSDPSchurMat | M,
|  | int | row,
|  | double | dd
| ) |  |

extern

Add an element to the Schur matrix correponding the variable r.

Parameters

  M | matrix
  row | corresponding to variable y.
  dd | element

Definition at line 198 of file dsdpschurmatadd.c.

## DSDPSchurMatAddRow()

int DSDPSchurMatAddRow | ( | DSDPSchurMat | M,
|  | int | row,
|  | double | alpha,
|  | DSDPVec | R
| ) |  |

extern

Add elements to a row of the Schur matrix.

Parameters

  M | matrix
  row | correponding to variable y
  alpha | multiply elements in R by this scalar.
  R | a row of elements.

Conic object call this routine when evaluating the Hessian of the barrier term. This routine is to be used with DSDPSchurMatRowColumnScaling().

See also
  DSDPSchurMatRowColumnScaling()

Definition at line 76 of file dsdpschurmatadd.c.

Referenced by DSDPAddSchurRow(), and SDPConeComputeHessian().

## DSDPSchurMatAssemble()

int DSDPSchurMatAssemble | ( | DSDPSchurMat | M | ) |

extern

Final assembly of M.

Parameters

  M | matrix

Important in parallel implementation.

Definition at line 174 of file dsdpschurmat.c.

Referenced by DSDPComputeHessian().

## DSDPSchurMatDestroy()

int DSDPSchurMatDestroy | ( | DSDPSchurMat * | M | ) |

extern

Free the memory in the data structure.

Parameters

  M | matrix

Definition at line 414 of file dsdpschurmat.c.

Referenced by DSDPTakeDown().

## DSDPSchurMatDiagonalScaling()

int DSDPSchurMatDiagonalScaling | ( | DSDPSchurMat | M,
|  | DSDPVec | D
| ) |  |

extern

Get the scaling and nonzero pattern of each diagonal element of the matrix.

Parameters

  M | matrix
  D | multply each element of the diagonal by this quantity.

Conic object call this routine when evaluating the Hessian of the barrier term. The elements will be a 0 or a 1. Important for parallel version.

See also
  DSDPSchurMatAddDiagonal()

Definition at line 235 of file dsdpschurmatadd.c.

Referenced by DSDPSchurMatRowScaling().

## DSDPSchurMatFactor()

int DSDPSchurMatFactor | ( | DSDPSchurMat | M,
|  | DSDPTruth * | successful
| ) |  |

extern

Factor M.

Parameters

  M | matrix
  successful | false if factorization failed.

Definition at line 196 of file dsdpschurmat.c.

Referenced by DSDPComputeDualStepDirections().

## DSDPSchurMatInitialize()

int DSDPSchurMatInitialize | ( | DSDPSchurMat * | M | ) |

extern

Initialize pointers to null.

Parameters

  M | Schur matrix object

Definition at line 79 of file dsdpschurmat.c.

## DSDPSchurMatInParallel()

int DSDPSchurMatInParallel | ( | DSDPSchurMat | M,
|  | DSDPTruth * | flag
| ) |  |

extern

Determine whether M is computed in parallel.

Parameters

  M | matrix
  flag | true or false

Important in parallel implementation.

Definition at line 149 of file dsdpschurmat.c.

Referenced by DSDPSchurMatDiagonalScaling(), DSDPSchurMatReducePVec(), and DSDPSchurMatVariableCompute().

## DSDPSchurMatMultiply()

int DSDPSchurMatMultiply | ( | DSDPSchurMat | M,
|  | DSDPVec | x,
|  | DSDPVec | y
| ) |  |

extern

Multiply M by a vector. y = M x.

Parameters

  M | matrix
  x | in vector.
  y | product.

Definition at line 231 of file dsdpschurmat.c.

## DSDPSchurMatReducePVec()

int DSDPSchurMatReducePVec | ( | DSDPSchurMat | M,
|  | DSDPVec | x
| ) |  |

extern

Collect elements of the vector.

Parameters

  M | matrix
  x | vector.

Important in parallel implementation. Otherwise does nothing.

Definition at line 307 of file dsdpschurmat.c.

Referenced by DSDPComputeG(), DSDPComputeHessian(), and DSDPHessianMultiplyAdd().

## DSDPSchurMatRowColumnScaling()

int DSDPSchurMatRowColumnScaling | ( | DSDPSchurMat | M,
|  | int | row,
|  | DSDPVec | V,
|  | int * | nzcols
| ) |  |

extern

Get the scaling and nonzero pattern of each column in this row of the matrix.

Parameters

  M | matrix
  row | correponding to variable y
  V | multply each element of the row by this quantity.
  nzcols | how many nonzeros. Check for a 0! Conic object call this routine when evaluating the Hessian of the barrier term. The vector V identifies sparsity, whether its using upper or lower half of Schur, and also used to distribute rows over processros The elements will be a 0 or a 1. This routine is to be used with DSDPSchurMatAddRow().

See also
  DSDPSchurMatAddRow()

Definition at line 33 of file dsdpschurmatadd.c.

Referenced by SDPConeComputeHessian().

## DSDPSchurMatRowScaling()

int DSDPSchurMatRowScaling | ( | DSDPSchurMat | M,
|  | DSDPVec | D
| ) |  |

extern

Identify which rows on on this processor.

Parameters

  M | matrix
  D | Variables marked with 0 or 1.

Definition at line 399 of file dsdpschurmat.c.

Referenced by DSDPComputeG(), and DSDPHessianMultiplyAdd().

## DSDPSchurMatSetData()

int DSDPSchurMatSetData | ( | DSDPSchurMat * | M,
|  | struct DSDPSchurMat_Ops * | ops,
|  | void * | data
| ) |  |

extern

Set the Schur matrix with an opaque pointer and structure of function pointers.

Parameters

  M | Schur matrix object
  ops | address of a structure of function pointers.
  data | opaque pointer to its internal data structure.

Definition at line 28 of file dsdpschurmat.c.

Referenced by DSDPSchurMatDestroy(), DSDPSchurMatInitialize(), and DSDPSetSchurMatOps().

## DSDPSchurMatSetR()

int DSDPSchurMatSetR | ( | DSDPSchurMat | M,
|  | double | rr
| ) |  |

extern

Set up the data structure.

Parameters

  M | matrix
  rr | residual

Definition at line 338 of file dsdpschurmat.c.

Referenced by DSDPComputeG(), DSDPComputeHessian(), and DSDPComputeNewY().

## DSDPSchurMatSetup()

int DSDPSchurMatSetup | ( | DSDPSchurMat | M,
|  | DSDPVec | Y
| ) |  |

extern

Set up the data structure.

Parameters

  M | matrix
  Y | variable vector.

Definition at line 352 of file dsdpschurmat.c.

## DSDPSchurMatShiftDiagonal()

int DSDPSchurMatShiftDiagonal | ( | DSDPSchurMat | M,
|  | double | dd
| ) |  |

extern

Add a scalar to each diagonal element of the matrix.

Parameters

  M | matrix
  dd | diagonal shift

Definition at line 120 of file dsdpschurmat.c.

Referenced by DSDPComputeDualStepDirections().

## DSDPSchurMatSolve()

int DSDPSchurMatSolve | ( | DSDPSchurMat | M,
|  | DSDPVec | b,
|  | DSDPVec | x
| ) |  |

extern

Solve the linear system.

Parameters

  M | matrix
  b | the right-hand side
  x | solution

Definition at line 466 of file dsdpschurmat.c.

Referenced by DSDPCGSolve().

## DSDPSchurMatVariableCompute()

int DSDPSchurMatVariableCompute | ( | DSDPSchurMat | M,
|  | int | row,
|  | double * | rcv
| ) |  |

extern

Determine with the cone should compute this diagonal element of M and RHS.

Parameters

  M | matrix
  row | correponding the y variable
  rcv |

Used to evaluate M. Important in parallel implementation.

See also
  DSDPSchurMatAddDiagonalElement()

Definition at line 120 of file dsdpschurmatadd.c.

Referenced by DSDPObjectiveGH().

## DSDPSchurMatVariableComputeR()

int DSDPSchurMatVariableComputeR | ( | DSDPSchurMat | M,
|  | double * | rcv
| ) |  |

extern

Add an element to the Schur matrix correponding the variable r.

Parameters

  M | matrix
  *rcv | zero or one

Definition at line 181 of file dsdpschurmatadd.c.

## DSDPSchurMatView()

int DSDPSchurMatView | ( | DSDPSchurMat | M | ) |

extern

Print the matrix.

Parameters

  M | matrix

Definition at line 376 of file dsdpschurmat.c.

Referenced by DSDPComputeDualStepDirections().

## DSDPSchurMatZeroEntries()

int DSDPSchurMatZeroEntries | ( | DSDPSchurMat | M | ) |

extern

Zero all element in the matrix.

Parameters

  M | matrix

Definition at line 97 of file dsdpschurmat.c.

Referenced by DSDPComputeHessian().