dsdpxmat.c File Reference

Call an implementation of the basic dense matrix array operations. More...

Go to the source code of this file.

## Functions

int | DSDPVMatAddOuterProduct (DSDPVMat X, double alpha, SDPConeVec V)
| Add outer product of a vector to the matrix.
int | DSDPVMatCheck (DSDPVMat X, SDPConeVec W1, SDPConeVec W2)
| Test correctness of operations.
int | DSDPVMatDestroy (DSDPVMat *X)
| Deallocate matrix.
int | DSDPVMatExist (DSDPVMat X, int *flag)
| Answer whether the array has been allocated or not.
int | DSDPVMatGetArray (DSDPVMat X, double **v, int *nn)
| Get the array that stores the matrix.
int | DSDPVMatGetSize (DSDPVMat X, int *n)
| Get number of rows and columns.
int | DSDPVMatInitialize (DSDPVMat *B)
| Set pointers to null.
int | DSDPVMatMult (DSDPVMat X, SDPConeVec Z, SDPConeVec Y)
| Multiply X by a vector.
int | DSDPVMatNormF2 (DSDPVMat X, double *normf2)
| Compute square of Frobenius norm of matrix.
int | DSDPVMatOpsInitialize (struct DSDPVMat_Ops *aops)
| Set function pointers to null.
int | DSDPVMatRestoreArray (DSDPVMat X, double **v, int *nn)
| Restore the array that stores the matrix.
int | DSDPVMatScaleDiagonal (DSDPVMat X, double dscale)
| Scaling diagonal is useful for inner products and norms.
int | DSDPVMatSetData (DSDPVMat *X, struct DSDPVMat_Ops *ops, void *data)
| Set opaque pointer an function pointers.
int | DSDPVMatShiftDiagonal (DSDPVMat X, double dadd)
| Add something to diagonal elements.
int | DSDPVMatTest (DSDPVMat X)
| Test validity of matrix.
int | DSDPVMatView (DSDPVMat X)
| Print matrix.
int | DSDPVMatZeroEntries (DSDPVMat X)
| Zero matrix.

## Detailed Description

Call an implementation of the basic dense matrix array operations.

Definition in file dsdpxmat.c.

## Function Documentation

## DSDPVMatAddOuterProduct()

int DSDPVMatAddOuterProduct | ( | DSDPVMat | X,
|  | double | alpha,
|  | SDPConeVec | V
| ) |  |

Add outer product of a vector to the matrix.

Parameters

  X | dense symmetric matrix
  alpha | scalar multiple of outer product
  V | vector.

Definition at line 275 of file dsdpxmat.c.

Referenced by DSDPDataMatCheck(), DSDPVMatCheck(), SDPConeComputeHessian(), and SDPConeComputeXX().

## DSDPVMatCheck()

int DSDPVMatCheck | ( | DSDPVMat | X,
|  | SDPConeVec | W1,
|  | SDPConeVec | W2
| ) |  |

Test correctness of operations.

Parameters

  X | dense symmetric matrix
  W1 | work vector
  W2 | work vector

Definition at line 327 of file dsdpxmat.c.

## DSDPVMatDestroy()

int DSDPVMatDestroy | ( | DSDPVMat * | X | ) |

Deallocate matrix.

Parameters

  X | dense symmetric matrix

Definition at line 86 of file dsdpxmat.c.

Referenced by DSDPBlockTakeDown(), and SDPConeClearVMatrix().

## DSDPVMatExist()

int DSDPVMatExist | ( | DSDPVMat | X,
|  | int * | flag
| ) |  |

Answer whether the array has been allocated or not.

Parameters

  X | dense symmetric matrix
  flag | true if the array has been allocated

Definition at line 440 of file dsdpxmat.c.

Referenced by DSDPBlockSetup().

## DSDPVMatGetArray()

int DSDPVMatGetArray | ( | DSDPVMat | X,
|  | double ** | v,
|  | int * | nn
| ) |  |

Get the array that stores the matrix.

Parameters

  X | dense symmetric matrix
  v | array representing the matrix.
  nn | length of the array

See also
  SDPConeSetStorageFormat()

Definition at line 211 of file dsdpxmat.c.

Referenced by DSDPBlockADot(), DSDPBlockASum(), DSDPBlockFactorData(), DSDPDataMatCheck(), DSDPDSMatSetArray(), DSDPDualMatInverseAdd(), DSDPDualMatSetArray(), DSDPVMatCheck(), and DSDPVMatNormF2().

## DSDPVMatGetSize()

int DSDPVMatGetSize | ( | DSDPVMat | X,
|  | int * | n
| ) |  |

Get number of rows and columns.

Parameters

  X | dense symmetric matrix
  n | number of rows and columns

Definition at line 65 of file dsdpxmat.c.

Referenced by DSDPBlockADot(), DSDPBlockASum(), DSDPBlockFactorData(), DSDPDSMatSetArray(), DSDPDualMatInverseAdd(), DSDPDualMatSetArray(), and DSDPVMatCheck().

## DSDPVMatInitialize()

int DSDPVMatInitialize | ( | DSDPVMat * | B | ) |

Set pointers to null.

Parameters

  B | dense symmetric matrix

Definition at line 424 of file dsdpxmat.c.

Referenced by DSDPBlockInitialize(), DSDPVMatDestroy(), and SDPConeClearVMatrix().

## DSDPVMatMult()

int DSDPVMatMult | ( | DSDPVMat | X,
|  | SDPConeVec | Z,
|  | SDPConeVec | Y
| ) |  |

Multiply X by a vector.

Parameters

  X | dense symmetric matrix
  Z | input vector
  Y | equals X * Z

Definition at line 301 of file dsdpxmat.c.

Referenced by DSDPVMatCheck().

## DSDPVMatNormF2()

int DSDPVMatNormF2 | ( | DSDPVMat | X,
|  | double * | normf2
| ) |  |

Compute square of Frobenius norm of matrix.

Parameters

  X | dense symmetric matrix
  normf2 | square of Frobenious norm.

Definition at line 186 of file dsdpxmat.c.

Referenced by DSDPDataMatCheck(), DSDPVMatCheck(), and SDPConeComputeXDot().

## DSDPVMatOpsInitialize()

int DSDPVMatOpsInitialize | ( | struct DSDPVMat_Ops * | aops | ) |

Set function pointers to null.

Parameters

  aops | pointer to a structure of function pointers.

Definition at line 377 of file dsdpxmat.c.

Referenced by DSDPVMatInitialize().

## DSDPVMatRestoreArray()

int DSDPVMatRestoreArray | ( | DSDPVMat | X,
|  | double ** | v,
|  | int * | nn
| ) |  |

Restore the array that stores the matrix.

Parameters

  X | dense symmetric matrix
  v | array representing the matrix.
  nn | length of the array

See also
  SDPConeSetStorageFormat()

Definition at line 233 of file dsdpxmat.c.

Referenced by DSDPBlockADot(), DSDPBlockASum(), DSDPBlockFactorData(), DSDPDataMatCheck(), DSDPDSMatSetArray(), DSDPDualMatInverseAdd(), DSDPDualMatSetArray(), DSDPVMatCheck(), and DSDPVMatNormF2().

## DSDPVMatScaleDiagonal()

int DSDPVMatScaleDiagonal | ( | DSDPVMat | X,
|  | double | dscale
| ) |  |

Scaling diagonal is useful for inner products and norms.

Parameters

  X | dense symmetric matrix
  dscale | Semidefinite blocks scale the diagonal by half before taking the dot product with the data matrices.

Definition at line 147 of file dsdpxmat.c.

Referenced by DSDPBlockADot(), DSDPDataMatCheck(), DSDPVMatCheck(), and SDPConeComputeX3().

## DSDPVMatSetData()

int DSDPVMatSetData | ( | DSDPVMat * | X,
|  | struct DSDPVMat_Ops * | ops,
|  | void * | data
| ) |  |

Set opaque pointer an function pointers.

Parameters

  X | dense symmetric matrix
  ops | function pointers
  data | pointer to a matrix structure.

Definition at line 39 of file dsdpxmat.c.

Referenced by DSDPMakeVMat(), DSDPMakeVMatWithArray(), and DSDPVMatInitialize().

## DSDPVMatShiftDiagonal()

int DSDPVMatShiftDiagonal | ( | DSDPVMat | X,
|  | double | dadd
| ) |  |

Add something to diagonal elements.

Parameters

  X | dense symmetric matrix
  dadd |

Definition at line 166 of file dsdpxmat.c.

Referenced by DSDPVMatCheck(), and SDPConeComputeX3().

## DSDPVMatTest()

int DSDPVMatTest | ( | DSDPVMat | X | ) |

Test validity of matrix.

Parameters

  X | dense symmetric matrix

Definition at line 402 of file dsdpxmat.c.

Referenced by DSDPVMatSetData().

## DSDPVMatView()

int DSDPVMatView | ( | DSDPVMat | X | ) |

Print matrix.

Parameters

  X | dense symmetric matrix

Definition at line 107 of file dsdpxmat.c.

Referenced by DSDPDataMatCheck().

## DSDPVMatZeroEntries()

int DSDPVMatZeroEntries | ( | DSDPVMat | X | ) |

Zero matrix.

Parameters

  X | dense symmetric matrix

Definition at line 125 of file dsdpxmat.c.

Referenced by DSDPDataMatCheck(), DSDPVMatCheck(), SDPConeComputeHessian(), SDPConeComputeRHS(), SDPConeComputeSS(), SDPConeComputeXX(), and SDPConeMultiply().