qpOASES  3.0.1
Public Member Functions | Protected Attributes
SymDenseMat Class Reference

Interfaces matrix-vector operations tailored to symmetric dense matrices. More...

#include <Matrices.hpp>

Inheritance diagram for SymDenseMat:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 SymDenseMat ()
 SymDenseMat (int m, int n, int lD, real_t *v)
virtual Matrixduplicate () const
virtual SymmetricMatrixduplicateSym () const
virtual returnValue bilinear (const Indexlist *const icols, int xN, const real_t *x, int xLD, real_t *y, int yLD) const
virtual void free ()
virtual real_t diag (int i) const
virtual BooleanType isDiag () const
virtual real_t getNorm (int type=2) const
virtual real_t getRowNorm (int rNum, int type=2) const
virtual returnValue getRow (int rNum, const Indexlist *const icols, real_t alpha, real_t *row) const
virtual returnValue getCol (int cNum, const Indexlist *const irows, real_t alpha, real_t *col) const
returnValue times (int xN, real_t alpha, const real_t *x, int xLD, real_t beta, real_t *y, int yLD) const
virtual returnValue times (const Indexlist *const irows, const Indexlist *const icols, int xN, real_t alpha, const real_t *x, int xLD, real_t beta, real_t *y, int yLD, BooleanType yCompr=BT_TRUE) const
returnValue transTimes (int xN, real_t alpha, const real_t *x, int xLD, real_t beta, real_t *y, int yLD) const
virtual returnValue transTimes (const Indexlist *const irows, const Indexlist *const icols, int xN, real_t alpha, const real_t *x, int xLD, real_t beta, real_t *y, int yLD) const
virtual returnValue addToDiag (real_t alpha)
virtual real_tfull () const
virtual returnValue print (const char *name=0) const
BooleanType needToFreeMemory () const
void doFreeMemory ()
void doNotFreeMemory ()

Protected Attributes

int nRows
int nCols
int leaDim
real_tval
BooleanType freeMemory

Detailed Description

Symmetric dense matrix class.

Author:
Andreas Potschka, Christian Kirches, Hans Joachim Ferreau
Version:
3.0
Date:
2011-2014

Constructor & Destructor Documentation

Default constructor.

Referenced by duplicateSym().

SymDenseMat::SymDenseMat ( int  m,
int  n,
int  lD,
real_t v 
) [inline]

Constructor from vector of values.

Parameters:
mNumber of rows.
nNumber of columns.
lDLeading dimension.
vValues.

Member Function Documentation

returnValue DenseMatrix::addToDiag ( real_t  alpha) [virtual, inherited]

Adds given offset to diagonal of matrix.

Returns:
SUCCESSFUL_RETURN
RET_NO_DIAGONAL_AVAILABLE
Parameters:
alphaDiagonal offset.

Implements Matrix.

References DenseMatrix::leaDim, DenseMatrix::nCols, DenseMatrix::nRows, SUCCESSFUL_RETURN, and DenseMatrix::val.

returnValue SymDenseMat::bilinear ( const Indexlist *const  icols,
int  xN,
const real_t x,
int  xLD,
real_t y,
int  yLD 
) const [virtual]

Compute bilinear form y = x'*H*x using submatrix given by index list.

Returns:
SUCCESSFUL_RETURN
Parameters:
icolsIndex list specifying columns of x.
xNNumber of vectors to multiply.
xInput vector to be multiplied (uncompressed).
xLDLeading dimension of input x.
yOutput vector of results (compressed).
yLDLeading dimension of output y.

Implements SymmetricMatrix.

References DenseMatrix::leaDim, Indexlist::length, Indexlist::number, real_t, SUCCESSFUL_RETURN, and DenseMatrix::val.

real_t DenseMatrix::diag ( int  i) const [virtual, inherited]

Returns i-th diagonal entry.

Returns:
i-th diagonal entry
Parameters:
iIndex.

Implements Matrix.

References DenseMatrix::leaDim, and DenseMatrix::val.

void Matrix::doFreeMemory ( ) [inline, inherited]
void Matrix::doNotFreeMemory ( ) [inline, inherited]
Matrix * SymDenseMat::duplicate ( ) const [virtual]

Returns a deep-copy of the Matrix object.

Returns:
Deep-copy of Matrix object

Reimplemented from DenseMatrix.

References duplicateSym().

Returns a deep-copy of the SymmetricMatrix object.

Returns:
Deep-copy of SymmetricMatrix object

Implements SymmetricMatrix.

References BT_TRUE, Matrix::doFreeMemory(), DenseMatrix::nCols, Matrix::needToFreeMemory(), DenseMatrix::nRows, real_t, SymDenseMat(), and DenseMatrix::val.

Referenced by duplicate().

void DenseMatrix::free ( ) [virtual, inherited]

Frees all internal memory.

Implements Matrix.

References DenseMatrix::val.

Referenced by DenseMatrix::~DenseMatrix().

real_t * DenseMatrix::full ( ) const [virtual, inherited]

Allocates and creates dense matrix array in row major format.

Note: Calling function has to free allocated memory!

Returns:
Pointer to matrix array.

Implements Matrix.

References DenseMatrix::nCols, DenseMatrix::nRows, real_t, and DenseMatrix::val.

returnValue DenseMatrix::getCol ( int  cNum,
const Indexlist *const  irows,
real_t  alpha,
real_t col 
) const [virtual, inherited]

Retrieve indexed entries of matrix column multiplied by alpha.

Returns:
SUCCESSFUL_RETURN
Parameters:
cNumColumn number.
irowsIndex list specifying rows.
alphaScalar factor.
colOutput column vector.

Implements Matrix.

References BT_TRUE, isEqual(), DenseMatrix::leaDim, Indexlist::length, Indexlist::number, SUCCESSFUL_RETURN, and DenseMatrix::val.

real_t DenseMatrix::getNorm ( int  type = 2) const [virtual, inherited]

Get the N-norm of the matrix

Returns:
N-norm of the matrix
Parameters:
typeNorm type, 1: one-norm, 2: Euclidean norm.

Implements Matrix.

References DenseMatrix::nCols, DenseMatrix::nRows, REFER_NAMESPACE_QPOASES, and DenseMatrix::val.

Referenced by DenseMatrix::getRowNorm().

returnValue DenseMatrix::getRow ( int  rNum,
const Indexlist *const  icols,
real_t  alpha,
real_t row 
) const [virtual, inherited]

Retrieve indexed entries of matrix row multiplied by alpha.

Returns:
SUCCESSFUL_RETURN
Parameters:
rNumRow number.
icolsIndex list specifying columns.
alphaScalar factor.
rowOutput row vector.

Implements Matrix.

References BT_TRUE, isEqual(), DenseMatrix::leaDim, Indexlist::length, DenseMatrix::nCols, Indexlist::number, SUCCESSFUL_RETURN, and DenseMatrix::val.

real_t DenseMatrix::getRowNorm ( int  rNum,
int  type = 2 
) const [virtual, inherited]

Get the N-norm of a row

Returns:
N-norm of row rNum
Parameters:
rNumRow number.
typeNorm type, 1: one-norm, 2: Euclidean norm.

Implements Matrix.

References DenseMatrix::getNorm(), DenseMatrix::leaDim, DenseMatrix::nCols, REFER_NAMESPACE_QPOASES, and DenseMatrix::val.

BooleanType DenseMatrix::isDiag ( ) const [virtual, inherited]

Checks whether matrix is square and diagonal.

Returns:
BT_TRUE iff matrix is square and diagonal;
BT_FALSE otherwise.

Implements Matrix.

References BT_FALSE, BT_TRUE, EPS, getAbs(), DenseMatrix::leaDim, DenseMatrix::nCols, DenseMatrix::nRows, and DenseMatrix::val.

BooleanType Matrix::needToFreeMemory ( ) const [inline, inherited]

Returns whether internal memory needs to be de-allocated.

Returns:
BT_TRUE iff internal memory needs to be de-allocated,
BT_FALSE otherwise

References Matrix::freeMemory.

Referenced by DenseMatrix::duplicate(), duplicateSym(), DenseMatrix::~DenseMatrix(), SparseMatrix::~SparseMatrix(), and SparseMatrixRow::~SparseMatrixRow().

returnValue DenseMatrix::print ( const char *  name = 0) const [virtual, inherited]

Prints matrix to screen.

Returns:
SUCCESSFUL_RETURN
Parameters:
nameName of matrix.

Implements Matrix.

References DenseMatrix::nCols, DenseMatrix::nRows, REFER_NAMESPACE_QPOASES, and DenseMatrix::val.

returnValue DenseMatrix::times ( int  xN,
real_t  alpha,
const real_t x,
int  xLD,
real_t  beta,
real_t y,
int  yLD 
) const [virtual, inherited]

Evaluate Y=alpha*A*X + beta*Y.

Returns:
SUCCESSFUL_RETURN.
Parameters:
xNNumber of vectors to multiply.
alphaScalar factor for matrix vector product.
xInput vector to be multiplied.
xLDLeading dimension of input x.
betaScalar factor for y.
yOutput vector of results.
yLDLeading dimension of output y.

Implements Matrix.

References GEMM, getMax(), DenseMatrix::nCols, DenseMatrix::nRows, SUCCESSFUL_RETURN, and DenseMatrix::val.

returnValue DenseMatrix::times ( const Indexlist *const  irows,
const Indexlist *const  icols,
int  xN,
real_t  alpha,
const real_t x,
int  xLD,
real_t  beta,
real_t y,
int  yLD,
BooleanType  yCompr = BT_TRUE 
) const [virtual, inherited]

Evaluate matrix vector product with submatrix given by Indexlist.

Returns:
SUCCESSFUL_RETURN
Parameters:
irowsIndex list specifying rows.
icolsIndex list specifying columns.
xNNumber of vectors to multiply.
alphaScalar factor for matrix vector product.
xInput vector to be multiplied.
xLDLeading dimension of input x.
betaScalar factor for y.
yOutput vector of results.
yLDLeading dimension of output y.
yComprCompressed storage for y.

Implements Matrix.

References BT_FALSE, BT_TRUE, isEqual(), Indexlist::iSort, isZero(), DenseMatrix::leaDim, Indexlist::length, DenseMatrix::nCols, Indexlist::number, SUCCESSFUL_RETURN, and DenseMatrix::val.

returnValue DenseMatrix::transTimes ( int  xN,
real_t  alpha,
const real_t x,
int  xLD,
real_t  beta,
real_t y,
int  yLD 
) const [virtual, inherited]

Evaluate Y=alpha*A'*X + beta*Y.

Returns:
SUCCESSFUL_RETURN.
Parameters:
xNNumber of vectors to multiply.
alphaScalar factor for matrix vector product.
xInput vector to be multiplied.
xLDLeading dimension of input x.
betaScalar factor for y.
yOutput vector of results.
yLDLeading dimension of output y.

Implements Matrix.

References GEMM, getMax(), DenseMatrix::nCols, DenseMatrix::nRows, SUCCESSFUL_RETURN, and DenseMatrix::val.

returnValue DenseMatrix::transTimes ( const Indexlist *const  irows,
const Indexlist *const  icols,
int  xN,
real_t  alpha,
const real_t x,
int  xLD,
real_t  beta,
real_t y,
int  yLD 
) const [virtual, inherited]

Evaluate matrix transpose vector product.

Returns:
SUCCESSFUL_RETURN
Parameters:
irowsIndex list specifying rows.
icolsIndex list specifying columns.
xNNumber of vectors to multiply.
alphaScalar factor for matrix vector product.
xInput vector to be multiplied.
xLDLeading dimension of input x.
betaScalar factor for y.
yOutput vector of results.
yLDLeading dimension of output y.

Implements Matrix.

References BT_FALSE, BT_TRUE, isEqual(), Indexlist::iSort, isZero(), DenseMatrix::leaDim, Indexlist::length, Indexlist::number, SUCCESSFUL_RETURN, and DenseMatrix::val.


Member Data Documentation

BooleanType Matrix::freeMemory [protected, inherited]

Indicating whether internal memory needs to be de-allocated.

Referenced by Matrix::doFreeMemory(), and Matrix::needToFreeMemory().

int DenseMatrix::leaDim [protected, inherited]
int DenseMatrix::nCols [protected, inherited]
int DenseMatrix::nRows [protected, inherited]
real_t* DenseMatrix::val [protected, inherited]

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