dsdpblock.c File Reference

Operations on a single SDP block. More...

Go to the source code of this file.

## Functions

int | DSDPBlockAddDataMatrix (DSDPBlockData *ADATA, int vari, struct DSDPDataMat_Ops *dsdpdataops, void *data)
| Add data matrix into SDP block.
int | DSDPBlockADot (DSDPBlockData *ADATA, double aa, DSDPVec Alpha, DSDPVMat X, DSDPVec AX)
| Compute inner product of XX with data matrices.
int | DSDPBlockASum (DSDPBlockData *ADATA, double aa, DSDPVec Yk, DSDPVMat XX)
| Sum the data matrices.
int | DSDPBlockCountNonzeroMatrices (DSDPBlockData *ADATA, int *nzmats)
| Count how many data matrices are in a block of data.
int | DSDPBlockDataAllocate (DSDPBlockData *ADATA, int nnz)
| Allocate some structures.
int | DSDPBlockDataDestroy (DSDPBlockData *ADATA)
| Free the data matrices.
int | DSDPBlockDataInitialize (DSDPBlockData *ADATA)
| Set pointers to null.
int | DSDPBlockDataMarkNonzeroMatrices (DSDPBlockData *ADATA, int *annz)
| Mark which variable in block have a data matrix.
int | DSDPBlockDataRowSparsity (DSDPBlockData *ADATA, int row, int ai[], int rnnz[], int n)
| Determine sparsity pattern of data.
int | DSDPBlockFactorData (DSDPBlockData *ADATA, DSDPVMat X, SDPConeVec W)
| Factor the data matrices.
int | DSDPBlockGetMatrix (DSDPBlockData *ADATA, int id, int *vari, double *scl, DSDPDataMat *A)
| Get a data matrix from a block of data.
int | DSDPBlockRemoveDataMatrix (DSDPBlockData *ADATA, int vari)
| Remove a data matrix.
int | DSDPBlockSetDataMatrix (DSDPBlockData *ADATA, int vari, struct DSDPDataMat_Ops *dsdpdataops, void *data)
| Set data matrix into SDP block.
int | DSDPBlockTakeDownData (DSDPBlockData *ADATA)
| Free structures in block of data.
int | DSDPBlockvAv (DSDPBlockData *ADATA, double aa, DSDPVec Alpha, SDPConeVec V, DSDPVec VAV)
| Set VAV[i] to aa * Alpha[i] * V' A[i] V.
int | DSDPBlockView (DSDPBlockData *ADATA)
| Print the structure of the block.
int | DSDPBlockView2 (DSDPBlockData *ADATA)
| Print the data.
int | DSDPDataMatCheck (DSDPDataMat AA, SDPConeVec W, DSDPIndex IS, DSDPVMat XX)
| Check correctness of operations on the data.

## Detailed Description

Operations on a single SDP block.

Definition in file dsdpblock.c.

## Function Documentation

## DSDPBlockAddDataMatrix()

int DSDPBlockAddDataMatrix | ( | DSDPBlockData * | ADATA,
|  | int | vari,
|  | struct DSDPDataMat_Ops * | dsdpdataops,
|  | void * | data
| ) |  |

Add data matrix into SDP block.

Parameters

  ADATA | block of data.
  vari | the variable to which the matrix corresponds.
  dsdpdataops | function pointers
  data | opaque pointer to matrix.

Definition at line 381 of file dsdpblock.c.

Referenced by DSDPBlockSetDataMatrix().

## DSDPBlockADot()

int DSDPBlockADot | ( | DSDPBlockData * | ADATA,
|  | double | aa,
|  | DSDPVec | Alpha,
|  | DSDPVMat | X,
|  | DSDPVec | AX
| ) |  |

Compute inner product of XX with data matrices.

Parameters

  ADATA | block of data.
  aa | scalar
  Alpha | scalar.
  X | Dense symmetric matrix
  AX | Set AX[i] to aa * Alpha[i] * Dot( A[i] * X)

Definition at line 49 of file dsdpblock.c.

Referenced by SDPConeComputeHessian(), SDPConeComputeRHS(), and SDPConeComputeXDot().

## DSDPBlockASum()

int DSDPBlockASum | ( | DSDPBlockData * | ADATA,
|  | double | aa,
|  | DSDPVec | Yk,
|  | DSDPVMat | XX
| ) |  |

Sum the data matrices.

Parameters

  ADATA | block of data.
  aa | scalar
  Yk | scalar.
  XX | equals aa * sum ( YK[i]* A[i] )

Definition at line 20 of file dsdpblock.c.

Referenced by SDPConeComputeSS(), and SDPConeMultiply().

## DSDPBlockCountNonzeroMatrices()

int DSDPBlockCountNonzeroMatrices | ( | DSDPBlockData * | ADATA,
|  | int * | nzmats
| ) |  |

Count how many data matrices are in a block of data.

Parameters

  ADATA | block of data.
  nzmats | set to number of nonzero matrices. Numbers from 0 to this number can be used as a matrix id in DSDPBlockGetMatrix()

Definition at line 272 of file dsdpblock.c.

Referenced by DSDPDataTransposeSetup(), SDPConeComputeRHS(), SDPConeComputeXX(), and SDPConeMultiply().

## DSDPBlockDataAllocate()

int DSDPBlockDataAllocate | ( | DSDPBlockData * | ADATA,
|  | int | nnz
| ) |  |

Allocate some structures.

Parameters

  ADATA | block of data.
  nnz | number of data matrices to allocate space

Definition at line 221 of file dsdpblock.c.

Referenced by DSDPBlockAddDataMatrix().

## DSDPBlockDataDestroy()

int DSDPBlockDataDestroy | ( | DSDPBlockData * | ADATA | ) |

Free the data matrices.

Parameters

  ADATA | block of data.

Definition at line 195 of file dsdpblock.c.

Referenced by SDPConeDestroy().

## DSDPBlockDataInitialize()

int DSDPBlockDataInitialize | ( | DSDPBlockData * | ADATA | ) |

Set pointers to null.

Parameters

  ADATA | block of data.

Definition at line 163 of file dsdpblock.c.

Referenced by DSDPBlockDataDestroy(), and DSDPBlockInitialize().

## DSDPBlockDataMarkNonzeroMatrices()

int DSDPBlockDataMarkNonzeroMatrices | ( | DSDPBlockData * | ADATA,
|  | int * | annz
| ) |  |

Mark which variable in block have a data matrix.

Parameters

  ADATA | block of data.
  annz | array of integers to mark.

Definition at line 254 of file dsdpblock.c.

Referenced by DSDPDataTransposeSetup().

## DSDPBlockDataRowSparsity()

int DSDPBlockDataRowSparsity | ( | DSDPBlockData * | ADATA,
|  | int | row,
|  | int | ai[],
|  | int | rnnz[],
|  | int | n
| ) |  |

Determine sparsity pattern of data.

Parameters

  ADATA | block of data.
  row | from 0 to n.
  ai | (input) array of ones and zeros that identify which data matrices to check.
  rnnz | (output) array of length m where nonzeros indicate nonzero data.
  n | dimension of block.

Definition at line 330 of file dsdpblock.c.

## DSDPBlockFactorData()

int DSDPBlockFactorData | ( | DSDPBlockData * | ADATA,
|  | DSDPVMat | X,
|  | SDPConeVec | W
| ) |  |

Factor the data matrices.

Parameters

  ADATA | block of data.
  X | work array
  W | Work vector

Definition at line 113 of file dsdpblock.c.

Referenced by DSDPBlockSetup().

## DSDPBlockGetMatrix()

int DSDPBlockGetMatrix | ( | DSDPBlockData * | ADATA,
|  | int | id,
|  | int * | vari,
|  | double * | scl,
|  | DSDPDataMat * | A
| ) |  |

Get a data matrix from a block of data.

Parameters

  ADATA | block of data.
  id | identfier of the matrices, numbered consecutively from 0.
  vari | set to variable number corresponding to A.
  scl | scaling
  A | data matrix.

Definition at line 307 of file dsdpblock.c.

Referenced by DSDPBlockFactorData(), DSDPDataTransposeSetup(), SDPConeComputeHessian(), SDPConeComputeRHS(), SDPConeComputeXX(), and SDPConeMultiply().

## DSDPBlockRemoveDataMatrix()

int DSDPBlockRemoveDataMatrix | ( | DSDPBlockData * | ADATA,
|  | int | vari
| ) |  |

Remove a data matrix.

Parameters

  ADATA | block of data.
  vari | variable corresponding the matrix.

Definition at line 351 of file dsdpblock.c.

Referenced by DSDPBlockSetDataMatrix(), and SDPConeSetRMatrix().

## DSDPBlockSetDataMatrix()

int DSDPBlockSetDataMatrix | ( | DSDPBlockData * | ADATA,
|  | int | vari,
|  | struct DSDPDataMat_Ops * | dsdpdataops,
|  | void * | data
| ) |  |

Set data matrix into SDP block.

Parameters

  ADATA | block of data.
  vari | the variable to which the matrix corresponds.
  dsdpdataops | function pointers
  data | opaque pointer to matrix.

Definition at line 406 of file dsdpblock.c.

Referenced by SDPConeSetRMatrix().

## DSDPBlockTakeDownData()

int DSDPBlockTakeDownData | ( | DSDPBlockData * | ADATA | ) |

Free structures in block of data.

Parameters

  ADATA | block of data.

Definition at line 182 of file dsdpblock.c.

Referenced by DSDPBlockDataDestroy(), and DSDPBlockTakeDown().

## DSDPBlockvAv()

int int DSDPBlockvAv | ( | DSDPBlockData * | ADATA,
|  | double | aa,
|  | DSDPVec | Alpha,
|  | SDPConeVec | V,
|  | DSDPVec | VAV
| ) |  |

Set VAV[i] to aa * Alpha[i] * V' A[i] V.

Parameters

  ADATA | block of data.
  aa | scalar
  Alpha | scalar.
  V | vecotr
  VAV | the product

Definition at line 84 of file dsdpblock.c.

Referenced by SDPConeComputeHessian().

## DSDPBlockView()

int DSDPBlockView | ( | DSDPBlockData * | ADATA | ) |

Print the structure of the block.

Parameters

  ADATA | block of data.

Definition at line 454 of file dsdpblock.c.

## DSDPBlockView2()

int DSDPBlockView2 | ( | DSDPBlockData * | ADATA | ) |

Print the data.

Parameters

  ADATA | block of data.

Definition at line 474 of file dsdpblock.c.

## DSDPDataMatCheck()

int DSDPDataMatCheck | ( | DSDPDataMat | AA,
|  | SDPConeVec | W,
|  | DSDPIndex | IS,
|  | DSDPVMat | XX
| ) |  |

Check correctness of operations on the data.

Parameters

  AA | data matrix.
  W | work vector
  IS | work array
  XX | work array

Definition at line 498 of file dsdpblock.c.