DSDP
Functions
dsdpdatamat.c File Reference

Call an implementation of the data matrix operations. More...

Go to the source code of this file.

Functions

int DSDPDataMatAddMultiple (DSDPDataMat A, double ytmp, double *v, int nn, int n)
 Add a multiple the data matrix to the array.
 
int DSDPDataMatCountNonzeros (DSDPDataMat A, int *nnz, int n)
 Compute the square of the Frobenius norm.
 
int DSDPDataMatDestroy (DSDPDataMat *A)
 Free the data structures.
 
int DSDPDataMatDot (DSDPDataMat A, double x[], int nn, int n, double *v)
 Compute inner product of data with a dense matrix.
 
int DSDPDataMatFactor (DSDPDataMat A, SDPConeVec W, double *dworknn, int nn0, double *dwork3n, int nd, int *iwork, int ni)
 Do eigenvalue/vector or other factorization.
 
int DSDPDataMatFNorm2 (DSDPDataMat A, int n, double *fnorm2)
 Compute the square of the Frobenius norm.
 
int DSDPDataMatGetEig (DSDPDataMat A, int rr, SDPConeVec V, DSDPIndex S, double *eigenvalue)
 Get an eigenvalue/vector pair.
 
int DSDPDataMatGetRank (DSDPDataMat A, int *rank, int n)
 Get the number of nonzero eigenvalues/eigenvectors for the matrix.
 
int DSDPDataMatGetRowNonzeros (DSDPDataMat A, int nrow, int nmax, int *nz, int *nnz)
 Get sparsity pattern of a row of the matrix.
 
int DSDPDataMatInitialize (DSDPDataMat *A)
 Set pointers to NULL;.
 
int DSDPDataMatOpsInitialize (struct DSDPDataMat_Ops *dops)
 Initialize the table of function pointers for SDP Data matrices.
 
int DSDPDataMatSetData (DSDPDataMat *A, struct DSDPDataMat_Ops *ops, void *data)
 Set the opaque pointer and function pointers to the matrix.
 
int DSDPDataMatTest (DSDPDataMat A)
 Test validity of matrix.
 
int DSDPDataMatVecVec (DSDPDataMat A, SDPConeVec W, double *v)
 Compute w' A w.
 
int DSDPDataMatView (DSDPDataMat A)
 Print matrix.
 

Detailed Description

Call an implementation of the data matrix operations.

Definition in file dsdpdatamat.c.

Function Documentation

◆ DSDPDataMatAddMultiple()

int DSDPDataMatAddMultiple ( DSDPDataMat  A,
double  ytmp,
double *  v,
int  nn,
int  n 
)

Add a multiple the data matrix to the array.

Parameters
Asymmetric data matrix
ytmpscalar multiple
vdense array matrix
nndimension of array
ndimension of matrix
See also
SDPConeSetStorageFormat()
DSDPVMatGetArray()

Definition at line 402 of file dsdpdatamat.c.

Referenced by DSDPBlockASum(), and DSDPDataMatCheck().

◆ DSDPDataMatCountNonzeros()

int DSDPDataMatCountNonzeros ( DSDPDataMat  A,
int *  nnz,
int  n 
)

Compute the square of the Frobenius norm.

Parameters
Asymmetric data matrix.
ndimension of the matrix.
*nnznonzeros in matrix.

Used to identify which of a few strategies to compute Hessian.

Definition at line 152 of file dsdpdatamat.c.

◆ DSDPDataMatDestroy()

int DSDPDataMatDestroy ( DSDPDataMat A)

Free the data structures.

Parameters
Asymmetric data matrix

Definition at line 444 of file dsdpdatamat.c.

Referenced by DSDPBlockAddDataMatrix(), DSDPBlockDataDestroy(), and DSDPBlockRemoveDataMatrix().

◆ DSDPDataMatDot()

int DSDPDataMatDot ( DSDPDataMat  A,
double  x[],
int  nn,
int  n,
double *  v 
)

Compute inner product of data with a dense matrix.

Parameters
Asymmetric data matrix
xdense array matrix
nnlength of array
ndimension of matrix.
vthe inner product
See also
SDPConeSetStorageFormat()
DSDPVMatGetArray()

Definition at line 273 of file dsdpdatamat.c.

Referenced by DSDPBlockADot(), and DSDPDataMatCheck().

◆ DSDPDataMatFactor()

int DSDPDataMatFactor ( DSDPDataMat  A,
SDPConeVec  W,
double *  dworknn,
int  nn0,
double *  dwork3n,
int  nd,
int *  iwork,
int  ni 
)

Do eigenvalue/vector or other factorization.

Parameters
Asymmetric data matrix
Wwork vector
dworknnwork array
nn0length of dworknn array.
dwork3nwork array
ndlength of work array
iworkwork array
nilength of iwork array

This routine is called once during the DSDPSetUp routine.

See also
DSDPDataMatGetRank()
DSDPDataMatGetEig()

Definition at line 240 of file dsdpdatamat.c.

Referenced by DSDPBlockFactorData().

◆ DSDPDataMatFNorm2()

int DSDPDataMatFNorm2 ( DSDPDataMat  A,
int  n,
double *  fnorm2 
)

Compute the square of the Frobenius norm.

Parameters
Asymmetric data matrix.
ndimension of the matrix.
fnorm2square of norm.

Used to scale the problem

Definition at line 175 of file dsdpdatamat.c.

Referenced by DSDPDataMatCheck().

◆ DSDPDataMatGetEig()

int DSDPDataMatGetEig ( DSDPDataMat  A,
int  rr,
SDPConeVec  V,
DSDPIndex  S,
double *  eigenvalue 
)

Get an eigenvalue/vector pair.

Parameters
Asymmetric data matrix
rridentifies which pair of eigs, (0 <= rr < rank)
VEigenvector
SIndentifies sparsity pattern in V.
eigenvaluethe scalar associated with the vector. These pairs do not have to be eigenvalues and eigenvectors. What matters is that the matrix is a sum of the outer products of these vectors. That is, A = sum (rr * V *V')
See also
DSDPDataMatGetRank()

Definition at line 204 of file dsdpdatamat.c.

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

◆ DSDPDataMatGetRank()

int DSDPDataMatGetRank ( DSDPDataMat  A,
int *  rank,
int  n 
)

Get the number of nonzero eigenvalues/eigenvectors for the matrix.

Parameters
Asymmetric data matrix
ranknumber of nonzero eigenvalues and vectors.
nrows and columns in matrix.

Definition at line 129 of file dsdpdatamat.c.

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

◆ DSDPDataMatGetRowNonzeros()

int DSDPDataMatGetRowNonzeros ( DSDPDataMat  A,
int  nrow,
int  nmax,
int *  nz,
int *  nnz 
)

Get sparsity pattern of a row of the matrix.

Parameters
Asymmetric data matrix.
nrownumber >=0 and < n.
nmaxdimension of the matrix.
nzarray used to mark nonzeros.
nnznumber of nonzeros in row. Used to create sparse data structure for S and Delta S.

Definition at line 355 of file dsdpdatamat.c.

Referenced by DSDPBlockDataRowSparsity().

◆ DSDPDataMatInitialize()

int DSDPDataMatInitialize ( DSDPDataMat A)

Set pointers to NULL;.

Parameters
Asymmetric data matrix

Definition at line 78 of file dsdpdatamat.c.

Referenced by DSDPBlockDataAllocate(), and DSDPDataMatDestroy().

◆ DSDPDataMatOpsInitialize()

int DSDPDataMatOpsInitialize ( struct DSDPDataMat_Ops dops)

Initialize the table of function pointers for SDP Data matrices.

Parameters
dopspointer to a structure of function pointers.

Definition at line 47 of file dsdpdatamat.c.

Referenced by DSDPDataMatInitialize(), and DSDPDataMatSetData().

◆ DSDPDataMatSetData()

int DSDPDataMatSetData ( DSDPDataMat A,
struct DSDPDataMat_Ops ops,
void *  data 
)

Set the opaque pointer and function pointers to the matrix.

Parameters
Asymmetric data matrix
opspointer to a structure of function pointers
datapointer to a matrix structure

Definition at line 25 of file dsdpdatamat.c.

Referenced by DSDPBlockAddDataMatrix(), DSDPDataMatInitialize(), and DSDPSetDataMatZero().

◆ DSDPDataMatTest()

int DSDPDataMatTest ( DSDPDataMat  A)

Test validity of matrix.

Parameters
Asymmetric data matrix

Definition at line 96 of file dsdpdatamat.c.

Referenced by DSDPDataMatSetData().

◆ DSDPDataMatVecVec()

int DSDPDataMatVecVec ( DSDPDataMat  A,
SDPConeVec  W,
double *  v 
)

Compute w' A w.

Parameters
Asymmetric data matrix
Wvector
vthe inner product

Definition at line 297 of file dsdpdatamat.c.

Referenced by DSDPBlockvAv(), and DSDPDataMatCheck().

◆ DSDPDataMatView()

int DSDPDataMatView ( DSDPDataMat  A)

Print matrix.

Parameters
Asymmetric data matrix

Definition at line 423 of file dsdpdatamat.c.

Referenced by DSDPBlockView2().