Public Member Functions | Protected Attributes
Matrix Class Reference

Abstract base class for interfacing tailored matrix-vector operations. More...

#include <Matrices.hpp>

Inheritance diagram for Matrix:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual returnValue addToDiag (real_t alpha)=0
virtual real_t diag (int i) const =0
void doFreeMemory ()
void doNotFreeMemory ()
virtual Matrixduplicate () const =0
virtual void free ()=0
virtual returnValue getCol (int cNum, const Indexlist *const irows, real_t alpha, real_t *col) const =0
virtual returnValue getRow (int rNum, const Indexlist *const icols, real_t alpha, real_t *row) const =0
virtual BooleanType isDiag () const =0
 Matrix ()
BooleanType needToFreeMemory () const
virtual returnValue print () const =0
virtual returnValue times (int xN, real_t alpha, const real_t *x, int xLD, real_t beta, real_t *y, int yLD) const =0
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 =0
virtual returnValue transTimes (int xN, real_t alpha, const real_t *x, int xLD, real_t beta, real_t *y, int yLD) const =0
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 =0
virtual ~Matrix ()

Protected Attributes

BooleanType freeMemory

Detailed Description

Abstract base class for interfacing tailored matrix-vector operations.

Abstract base matrix class. Supplies interface to matrix vector products, including products with submatrices given by (ordered) working set index lists (see SubjectTo).

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

Definition at line 112 of file Matrices.hpp.


Constructor & Destructor Documentation

Matrix::Matrix ( ) [inline]

Default constructor.

Definition at line 116 of file Matrices.hpp.

virtual Matrix::~Matrix ( ) [inline, virtual]

Destructor.

Definition at line 119 of file Matrices.hpp.


Member Function Documentation

virtual returnValue Matrix::addToDiag ( real_t  alpha) [pure virtual]

Adds given offset to diagonal of matrix.

Returns:
SUCCESSFUL_RETURN
RET_NO_DIAGONAL_AVAILABLE
Parameters:
alphaDiagonal offset.

Implemented in SparseMatrix, and DenseMatrix.

virtual real_t Matrix::diag ( int  i) const [pure virtual]

Returns i-th diagonal entry.

Returns:
i-th diagonal entry
Parameters:
iIndex.

Implemented in SparseMatrix, and DenseMatrix.

void Matrix::doFreeMemory ( ) [inline]

Enables de-allocation of internal memory.

Definition at line 224 of file Matrices.hpp.

void Matrix::doNotFreeMemory ( ) [inline]

Disables de-allocation of internal memory.

Definition at line 227 of file Matrices.hpp.

virtual Matrix* Matrix::duplicate ( ) const [pure virtual]

Returns a deep-copy of the Matrix object.

Returns:
Deep-copy of Matrix object

Implemented in SymSparseMat, SparseMatrix, SymDenseMat, and DenseMatrix.

virtual void Matrix::free ( ) [pure virtual]

Frees all internal memory.

Implemented in SparseMatrix, and DenseMatrix.

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

Retrieve indexed entries of matrix column multiplied by alpha.

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

Implemented in SparseMatrix, and DenseMatrix.

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

Retrieve indexed entries of matrix row multiplied by alpha.

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

Implemented in SparseMatrix, and DenseMatrix.

virtual BooleanType Matrix::isDiag ( ) const [pure virtual]

Checks whether matrix is square and diagonal.

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

Implemented in SparseMatrix, and DenseMatrix.

Returns whether internal memory needs to be de-allocated.

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

Definition at line 221 of file Matrices.hpp.

virtual returnValue Matrix::print ( ) const [pure virtual]

Prints matrix to screen.

Returns:
SUCCESSFUL_RETURN
RET_NOT_YET_IMPLEMENTED

Implemented in SparseMatrix, and DenseMatrix.

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

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.

Implemented in SparseMatrix, and DenseMatrix.

virtual returnValue Matrix::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 [pure virtual]

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.

Implemented in SparseMatrix, and DenseMatrix.

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

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.

Implemented in SparseMatrix, and DenseMatrix.

virtual returnValue Matrix::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 [pure virtual]

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.

Implemented in SparseMatrix, and DenseMatrix.


Member Data Documentation

Indicating whether internal memory needs to be de-allocated.

Definition at line 227 of file Matrices.hpp.


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


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Sat Jun 8 2019 19:40:24