PIPS-NLP
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
DenseSymMatrix Class Reference

#include <DenseSymMatrix.h>

Inheritance diagram for DenseSymMatrix:
SymMatrix DoubleMatrix IotrRefCount

Public Member Functions

 DenseSymMatrix (int size)
 
 DenseSymMatrix (double Q[], int size)
 
virtual int isKindOf (int matrixType)
 
virtual void mult (double beta, double y[], int incy, double alpha, double x[], int incx)
 
virtual void mult (double beta, OoqpVector &y, double alpha, OoqpVector &x)
 
virtual void transMult (double beta, double y[], int incy, double alpha, double x[], int incx)
 
virtual void transMult (double beta, OoqpVector &y, double alpha, OoqpVector &x)
 
virtual void getSize (long long &m, long long &n)
 
virtual void getSize (int &m, int &n)
 
virtual double abmaxnorm ()
 
virtual void writeToStream (std::ostream &out) const
 
virtual void randomizePSD (double *seed)
 
virtual void fromGetDense (int row, int col, double *A, int lda, int rowExtent, int colExtent)
 
virtual void fromGetSpRow (int row, int col, double A[], int lenA, int jcolA[], int &nnz, int rowExtent, int &info)
 
virtual void SymmetricScale (OoqpVector &vec)
 
virtual void ColumnScale (OoqpVector &vec)
 
virtual void RowScale (OoqpVector &vec)
 
virtual void scalarMult (double num)
 
virtual void symAtPutSpRow (int col, double A[], int lenA, int irowA[], int &info)
 
virtual void symAtPutDense (int row, int col, double *A, int lda, int rowExtent, int colExtent)
 
virtual void symAtPutZeros (int row, int col, int rowExtent, int colExtent)
 
virtual void putSparseTriple (int irow[], int len, int jcol[], double A[], int &info)
 
virtual void atAddOuterProductOf (int row, int col, double alpha, double *x, int incx, int nx)
 
virtual void symAtPutSubmatrix (int destRow, int destCol, DoubleMatrix &M, int srcRow, int srcCol, int rowExtent, int colExtent)
 
virtual void symAtAddSubmatrix (int destRow, int destCol, DoubleMatrix &M, int srcRow, int srcCol, int rowExtent, int colExtent)
 
virtual void getDiagonal (OoqpVector &vec)
 
virtual void setToDiagonal (OoqpVector &vec)
 
virtual void atPutDiagonal (int idiag, OoqpVector &v)
 
virtual void fromGetDiagonal (int idiag, OoqpVector &v)
 
double * operator[] (int index)
 
const double * operator[] (int index) const
 
double * elements ()
 
double ** Mat ()
 
virtual long long size ()
 
DenseStoragegetStorageRef ()
 
DenseStoragegetStorage ()
 
void matMult (double alpha, GenMatrix &A_, int transA, GenMatrix &B_, int transB, double beta)
 
virtual void symAtPutSubmatrix (int destRow, int destCol, DoubleMatrix &M, int srcRow, int srcCol, int rowExtent, int colExtent, int forceSymUpdate)
 
virtual void symAtAddSubmatrix (int destRow, int destCol, DoubleMatrix &M, int srcRow, int srcCol, int rowExtent, int colExtent, int forceSymUpdate)
 
void atRankkUpdate (double alpha, double beta, DenseGenMatrix &U, int trans)
 
virtual void symAtSetSubmatrix (int destRow, int destCol, DoubleMatrix &M, int srcRow, int srcCol, int rowExtent, int colExtent, bool firstCall, std::map< int, int > &ValIdxMap)
 
- Public Member Functions inherited from DoubleMatrix
 DoubleMatrix ()
 
virtual void fromAddDense (int row, int col, double *A, int lda, int rowExtent, int colExtent)
 
virtual ~DoubleMatrix ()
 
virtual void copyMtxFromDouble (int copyLength, double *values)
 
virtual void setAdditiveDiagonal (OoqpVector &additiveDiag_)
 
virtual void copyDiagonalVal_From (int idiag, OoqpVector &x, bool firstCall, std::map< int, int > &ValIdxMap)
 
virtual void fromGetSpRow_WithRowStart (int row, int col, double A[], int lenA, int jcolA[], int &nnz, int colExtent, int &info, int &rowStart)
 
virtual void fromGetDense_withMap (int row, int col, double *A, int lda, int rowExtent, int colExtent, int const FirstCall, std::map< int, int > &ValIdxMap)
 
virtual double * getMatVal ()
 
virtual int * krowM ()
 
virtual int * jcolM ()
 
virtual double * M ()
 
- Public Member Functions inherited from IotrRefCount
int refs ()
 
 IotrRefCount ()
 

Static Public Member Functions

static DenseSymMatrixrandomPSD (int n, double *seed)
 
- Static Public Member Functions inherited from IotrRefCount
static void release (IotrRefCount **obj)
 
static void addRef (IotrRefCount *const *obj)
 

Public Attributes

DenseStorageHandle mStorage
 

Additional Inherited Members

- Static Public Attributes inherited from IotrRefCount
static int instances = 0
 
- Protected Member Functions inherited from IotrRefCount
virtual ~IotrRefCount ()
 

Detailed Description

A class representing dense, symmetric matrices

Constructor & Destructor Documentation

DenseSymMatrix::DenseSymMatrix ( int  size)
DenseSymMatrix::DenseSymMatrix ( double  Q[],
int  size 
)

Member Function Documentation

double DenseSymMatrix::abmaxnorm ( )
virtual

the magnitude of the element in this matrix with largest absolute value.

Implements DoubleMatrix.

void DenseSymMatrix::atAddOuterProductOf ( int  row,
int  col,
double  alpha,
double *  x,
int  incx,
int  nx 
)
virtual
void DenseSymMatrix::atPutDiagonal ( int  idiag,
OoqpVector x 
)
virtual

Set some of the diagonal elements of this matrix.

Parameters
idiagthe index of the first diagonal element to be modified.
xthe new values for the diagonal elements.

The length of x is the number of diagonal elements to be modified. Typically x will have length less than the length of the diagonal.

Implements DoubleMatrix.

void DenseSymMatrix::atRankkUpdate ( double  alpha,
double  beta,
DenseGenMatrix U,
int  trans 
)

Performs a rank-k update. Depending on the value of 'trans', i.e.,

  • this=alpha*this + beta*U*U' if trans=0
  • this=alpha*this + beta*U'*U if trans<>0
void DenseSymMatrix::ColumnScale ( OoqpVector vec)
virtual

Implements DoubleMatrix.

double* DenseSymMatrix::elements ( )
inline

Return a pointer to the first element in the matrix

void DenseSymMatrix::fromGetDense ( int  row,
int  col,
double *  A,
int  lda,
int  rowExtent,
int  colExtent 
)
virtual

Get the value of some of the elements of this matrix.

Parameters
rowstart reading the elements of this matrix from row number "row".
colstart reading the elements of this matrix from column number "col".
AAny array to hold the values from this matrix.
ldAthe leading dimension of A.
rowExtentget rowExtent rows from this matrix.
colExtentget colExtent columns from this matrix.

Implements DoubleMatrix.

void DenseSymMatrix::fromGetDiagonal ( int  idiag,
OoqpVector x 
)
virtual

Get some of the diagonal elements of this matrix.

Parameters
idiagthe index of the first diagonal element to be read.
xa vector to hold the diagonal elements

The length of x is the number of diagonal elements to be gotten. Typically x will have length less than the length of the diagonal.

Implements DoubleMatrix.

void DenseSymMatrix::fromGetSpRow ( int  row,
int  col,
double  A[],
int  lenA,
int  jcolA[],
int &  nnz,
int  colExtent,
int &  info 
)
virtual

Get one sparse row from this matrix.

Parameters
rowget row number "row"
colignore all elements of the row before column "col"
Astore the values of the sparse row in A
lenAthe length of A
jcolAan array of length lenA containing the column index of each element in the sparse row
colExtentignore all elements of the row that have column indices greater than or equal to col + colExtent
infoinfo is 0 if and only if the sparse row can fit into A.

Implements DoubleMatrix.

void DenseSymMatrix::getDiagonal ( OoqpVector vec)
virtual

Place the diagonal elements of this matrix in the vector vec

Implements DoubleMatrix.

void DenseSymMatrix::getSize ( long long &  m,
long long &  n 
)
virtual

Implements DoubleMatrix.

void DenseSymMatrix::getSize ( int &  m,
int &  n 
)
virtual

Implements DoubleMatrix.

DenseStorage* DenseSymMatrix::getStorage ( )
inline
DenseStorage& DenseSymMatrix::getStorageRef ( )
inline
int DenseSymMatrix::isKindOf ( int  matrixType)
virtual

True if this matrix identifies itself to be of type matrixType.

Implements DoubleMatrix.

double** DenseSymMatrix::Mat ( )
inline

Return mMat, an

void DenseSymMatrix::matMult ( double  alpha,
GenMatrix A_,
int  transA,
GenMatrix B_,
int  transB,
double  beta 
)
void DenseSymMatrix::mult ( double  beta,
double  y[],
int  incy,
double  alpha,
double  x[],
int  incx 
)
virtual
void DenseSymMatrix::mult ( double  beta,
OoqpVector y,
double  alpha,
OoqpVector x 
)
virtual

y = beta * y + alpha * this * x

Implements DoubleMatrix.

double* DenseSymMatrix::operator[] ( int  index)
inline
const double* DenseSymMatrix::operator[] ( int  index) const
inline
void DenseSymMatrix::putSparseTriple ( int  irow[],
int  len,
int  jcol[],
double  A[],
int &  info 
)
virtual

Copy elements from sparse triple format into this matrix

Parameters
lenthe number of elements
irowan array containing the row number of the elements
jcolan array containing the column number of the elements
Aan array containing the values for the elements.
infoon return, info will be zero if and only if the insertion was successful.

Implements DoubleMatrix.

void DenseSymMatrix::randomizePSD ( double *  seed)
virtual

Randomize the elements of this matrix in a manner that makes the matrix positive semi-definite.

Implements SymMatrix.

static DenseSymMatrix* DenseSymMatrix::randomPSD ( int  n,
double *  seed 
)
static
void DenseSymMatrix::RowScale ( OoqpVector vec)
virtual

Implements DoubleMatrix.

void DenseSymMatrix::scalarMult ( double  num)
virtual

Implements DoubleMatrix.

void DenseSymMatrix::setToDiagonal ( OoqpVector vec)
virtual

Set the matrix to the diagoanl matrix whose diagonal is vec

Implements DoubleMatrix.

long long DenseSymMatrix::size ( )
virtual

the size of this square matrix

Implements SymMatrix.

void DenseSymMatrix::symAtAddSubmatrix ( int  destRow,
int  destCol,
DoubleMatrix M,
int  srcRow,
int  srcCol,
int  rowExtent,
int  colExtent 
)
virtual
void DenseSymMatrix::symAtAddSubmatrix ( int  destRow,
int  destCol,
DoubleMatrix M,
int  srcRow,
int  srcCol,
int  rowExtent,
int  colExtent,
int  forceSymUpdate 
)
virtual

exec

void DenseSymMatrix::symAtPutDense ( int  row,
int  col,
double *  A,
int  lda,
int  rowExtent,
int  colExtent 
)
virtual

Insert the dense array symmetrically (the part that winds up in the lower triangle of this matrix is significant.)

void DenseSymMatrix::symAtPutSpRow ( int  col,
double  A[],
int  lenA,
int  irowA[],
int &  info 
)
virtual

Put a sparse row into this matrix symmetrically.

Elements of the row that would lie above the diagonal are ignored. The matrix is symmetrized by reflection across the diagonal.

The meaning of the parmameters is the same as in fromGetSpRow.

See also
DoubleMatrix::fromGetSpRow

Implements SymMatrix.

void DenseSymMatrix::symAtPutSubmatrix ( int  destRow,
int  destCol,
DoubleMatrix M,
int  srcRow,
int  srcCol,
int  rowExtent,
int  colExtent 
)
virtual

Put a submatrix of M into this matrix.

The submatrix is placed into this matrix in a manner that preserves the symmetry of this matrix. The element of M whose destination is in the lower triangle of this matrix are placed there without change, and the upper triangle is taken to be the reflection across the diagonal.

Parameters
destRowThe top row of the submatrix of M is placed at destRow.
destColThe leftmost column of the submatrix of M is placed at destCol.
srcRowThe first row of the submatrix of M is srcRow.
srcColThe first column of the submatrix of M is srcCol.
rowExtentrowExtent rows are copied from M.
colExtentcolExtent columns are copied from M.

Implements SymMatrix.

void DenseSymMatrix::symAtPutSubmatrix ( int  destRow,
int  destCol,
DoubleMatrix M,
int  srcRow,
int  srcCol,
int  rowExtent,
int  colExtent,
int  forceSymUpdate 
)
virtual

exec

void DenseSymMatrix::symAtPutZeros ( int  row,
int  col,
int  rowExtent,
int  colExtent 
)
virtual

Put a block of zeros into this matrix symmetrically (the part that winds up in the lower triangle of this matrix is significant.)

void DenseSymMatrix::symAtSetSubmatrix ( int  destRow,
int  destCol,
DoubleMatrix M,
int  srcRow,
int  srcCol,
int  rowExtent,
int  colExtent,
bool  firstCall,
std::map< int, int > &  ValIdxMap 
)
virtual

set sub matrix symmetrically (val only).

Reimplemented from SymMatrix.

void DenseSymMatrix::SymmetricScale ( OoqpVector vec)
virtual

Get the number of rows and columns in the matrix

Parameters
mthe number of rows
nthe number of columns

Implements DoubleMatrix.

void DenseSymMatrix::transMult ( double  beta,
double  y[],
int  incy,
double  alpha,
double  x[],
int  incx 
)
virtual
void DenseSymMatrix::transMult ( double  beta,
OoqpVector y,
double  alpha,
OoqpVector x 
)
virtual

y = beta * y + alpha * this^T * x

Implements DoubleMatrix.

void DenseSymMatrix::writeToStream ( std::ostream &  out) const
virtual

Write this element to a C++ stream

Implements DoubleMatrix.

Member Data Documentation

DenseStorageHandle DenseSymMatrix::mStorage

The documentation for this class was generated from the following files: