DSDP
Data Structures | Typedefs | Functions
dsdpxmat.h File Reference

The interface between the SDPCone and the dense matrix array. More...

Go to the source code of this file.

Data Structures

struct  DSDPVMat_C
 Dense symmetric matrix for one block in the semidefinite cone. More...
 

Typedefs

typedef struct DSDPVMat_C DSDPVMat
 Represents a dense symmetric matrix for one block in the semidefinite cone. More...
 

Functions

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

Detailed Description

The interface between the SDPCone and the dense matrix array.

Definition in file dsdpxmat.h.

Typedef Documentation

Represents a dense symmetric matrix for one block in the semidefinite cone.

Definition at line 26 of file dsdpxmat.h.

Function Documentation

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

Add outer product of a vector to the matrix.

Parameters
Xdense symmetric matrix
alphascalar multiple of outer product
Vvector.

Definition at line 275 of file dsdpxmat.c.

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

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

Test correctness of operations.

Parameters
Xdense symmetric matrix
W1work vector
W2work vector

Definition at line 327 of file dsdpxmat.c.

Referenced by SDPConeCheckData().

int DSDPVMatDestroy ( DSDPVMat X)

Deallocate matrix.

Parameters
Xdense symmetric matrix

Definition at line 86 of file dsdpxmat.c.

Referenced by DSDPBlockTakeDown(), SDPConeAddADotX(), SDPConeClearVMatrix(), SDPConeComputeS(), SDPConeComputeX(), and SDPConeViewX().

int DSDPVMatExist ( DSDPVMat  X,
int *  flag 
)

Answer whether the array has been allocated or not.

Parameters
Xdense symmetric matrix
flagtrue if the array has been allocated

Definition at line 440 of file dsdpxmat.c.

Referenced by DSDPBlockSetup(), SDPConeGetXArray(), and SDPConeRestoreXArray().

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

Get the array that stores the matrix.

Parameters
Xdense symmetric matrix
varray representing the matrix.
nnlength of the array
See also
SDPConeSetStorageFormat()

Definition at line 211 of file dsdpxmat.c.

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

int DSDPVMatGetSize ( DSDPVMat  X,
int *  n 
)

Get number of rows and columns.

Parameters
Xdense symmetric matrix
nnumber of rows and columns

Definition at line 65 of file dsdpxmat.c.

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

int DSDPVMatInitialize ( DSDPVMat B)

Set pointers to null.

Parameters
Bdense symmetric matrix

Definition at line 424 of file dsdpxmat.c.

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

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

Multiply X by a vector.

Parameters
Xdense symmetric matrix
Zinput vector
Yequals X * Z

Definition at line 301 of file dsdpxmat.c.

Referenced by DSDPVMatCheck().

int DSDPVMatNormF2 ( DSDPVMat  X,
double *  normf2 
)

Compute square of Frobenius norm of matrix.

Parameters
Xdense symmetric matrix
normf2square of Frobenious norm.

Definition at line 186 of file dsdpxmat.c.

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

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

Restore the array that stores the matrix.

Parameters
Xdense symmetric matrix
varray representing the matrix.
nnlength of the array
See also
SDPConeSetStorageFormat()

Definition at line 233 of file dsdpxmat.c.

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

int DSDPVMatScaleDiagonal ( DSDPVMat  X,
double  dscale 
)

Scaling diagonal is useful for inner products and norms.

Parameters
Xdense symmetric matrix
dscaleSemidefinite 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().

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

Set opaque pointer an function pointers.

Parameters
Xdense symmetric matrix
opsfunction pointers
datapointer to a matrix structure.

Definition at line 39 of file dsdpxmat.c.

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

int DSDPVMatShiftDiagonal ( DSDPVMat  X,
double  dadd 
)

Add something to diagonal elements.

Parameters
Xdense symmetric matrix
dadd

Definition at line 166 of file dsdpxmat.c.

Referenced by DSDPVMatCheck(), and SDPConeComputeX3().

int DSDPVMatTest ( DSDPVMat  X)

Test validity of matrix.

Parameters
Xdense symmetric matrix

Definition at line 402 of file dsdpxmat.c.

Referenced by DSDPVMatSetData().

int DSDPVMatView ( DSDPVMat  X)

Print matrix.

Parameters
Xdense symmetric matrix

Definition at line 107 of file dsdpxmat.c.

Referenced by DSDPDataMatCheck(), SDPConeMatrixView(), and SDPConeViewX().

int DSDPVMatZeroEntries ( DSDPVMat  X)

Zero matrix.

Parameters
Xdense symmetric matrix

Definition at line 125 of file dsdpxmat.c.

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