Interfaces matrix-vector operations tailored to general dense matrices. More...
#include <Matrices.hpp>
Public Member Functions | |
virtual returnValue | addToDiag (real_t alpha) |
DenseMatrix () | |
DenseMatrix (int m, int n, int lD, real_t *v) | |
virtual real_t | diag (int i) const |
virtual Matrix * | duplicate () const |
virtual void | free () |
virtual returnValue | getCol (int cNum, const Indexlist *const irows, real_t alpha, real_t *col) const |
virtual returnValue | getRow (int rNum, const Indexlist *const icols, real_t alpha, real_t *row) const |
virtual BooleanType | isDiag () const |
virtual returnValue | print () 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 | ~DenseMatrix () |
Protected Attributes | |
int | leaDim |
int | nCols |
int | nRows |
real_t * | val |
Interfaces matrix-vector operations tailored to general dense matrices.
Dense matrix class (row major format).
Definition at line 273 of file Matrices.hpp.
DenseMatrix::DenseMatrix | ( | ) | [inline] |
Default constructor.
Definition at line 277 of file Matrices.hpp.
DenseMatrix::DenseMatrix | ( | int | m, |
int | n, | ||
int | lD, | ||
real_t * | v | ||
) | [inline] |
Constructor from vector of values. Caution: Data pointer must be valid throughout lifetime
m | Number of rows. |
n | Number of columns. |
lD | Leading dimension. |
v | Values. |
Definition at line 282 of file Matrices.hpp.
DenseMatrix::~DenseMatrix | ( | ) | [virtual] |
Destructor.
Definition at line 51 of file Matrices.cpp.
returnValue DenseMatrix::addToDiag | ( | real_t | alpha | ) | [virtual] |
Adds given offset to diagonal of matrix.
alpha | Diagonal offset. |
Implements Matrix.
Definition at line 406 of file Matrices.cpp.
real_t DenseMatrix::diag | ( | int | i | ) | const [virtual] |
Returns i-th diagonal entry.
i | Index. |
Implements Matrix.
Definition at line 83 of file Matrices.cpp.
Matrix * DenseMatrix::duplicate | ( | ) | const [virtual] |
Returns a deep-copy of the Matrix object.
Implements Matrix.
Reimplemented in SymDenseMat.
Definition at line 64 of file Matrices.cpp.
void DenseMatrix::free | ( | ) | [virtual] |
returnValue DenseMatrix::getCol | ( | int | cNum, |
const Indexlist *const | irows, | ||
real_t | alpha, | ||
real_t * | col | ||
) | const [virtual] |
Retrieve indexed entries of matrix column multiplied by alpha.
cNum | Column number. |
irows | Index list specifying rows. |
alpha | Scalar factor. |
col | Output column vector. |
Implements Matrix.
Definition at line 134 of file Matrices.cpp.
returnValue DenseMatrix::getRow | ( | int | rNum, |
const Indexlist *const | icols, | ||
real_t | alpha, | ||
real_t * | row | ||
) | const [virtual] |
Retrieve indexed entries of matrix row multiplied by alpha.
rNum | Row number. |
icols | Index list specifying columns. |
alpha | Scalar factor. |
row | Output row vector. |
Implements Matrix.
Definition at line 104 of file Matrices.cpp.
BooleanType DenseMatrix::isDiag | ( | ) | const [virtual] |
Checks whether matrix is square and diagonal.
Implements Matrix.
Definition at line 89 of file Matrices.cpp.
returnValue DenseMatrix::print | ( | ) | const [virtual] |
Prints matrix to screen.
Implements Matrix.
Definition at line 416 of file Matrices.cpp.
returnValue DenseMatrix::times | ( | int | xN, |
real_t | alpha, | ||
const real_t * | x, | ||
int | xLD, | ||
real_t | beta, | ||
real_t * | y, | ||
int | yLD | ||
) | const [virtual] |
Evaluate Y=alpha*A*X + beta*Y.
xN | Number of vectors to multiply. |
alpha | Scalar factor for matrix vector product. |
x | Input vector to be multiplied. |
xLD | Leading dimension of input x. |
beta | Scalar factor for y. |
y | Output vector of results. |
yLD | Leading dimension of output y. |
Implements Matrix.
Definition at line 151 of file Matrices.cpp.
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] |
Evaluate matrix vector product with submatrix given by Indexlist.
irows | Index list specifying rows. |
icols | Index list specifying columns. |
xN | Number of vectors to multiply. |
alpha | Scalar factor for matrix vector product. |
x | Input vector to be multiplied. |
xLD | Leading dimension of input x. |
beta | Scalar factor for y. |
y | Output vector of results. |
yLD | Leading dimension of output y. |
yCompr | Compressed storage for y. |
Implements Matrix.
Definition at line 167 of file Matrices.cpp.
returnValue DenseMatrix::transTimes | ( | int | xN, |
real_t | alpha, | ||
const real_t * | x, | ||
int | xLD, | ||
real_t | beta, | ||
real_t * | y, | ||
int | yLD | ||
) | const [virtual] |
Evaluate Y=alpha*A'*X + beta*Y.
xN | Number of vectors to multiply. |
alpha | Scalar factor for matrix vector product. |
x | Input vector to be multiplied. |
xLD | Leading dimension of input x. |
beta | Scalar factor for y. |
y | Output vector of results. |
yLD | Leading dimension of output y. |
Implements Matrix.
Definition at line 159 of file Matrices.cpp.
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] |
Evaluate matrix transpose vector product.
irows | Index list specifying rows. |
icols | Index list specifying columns. |
xN | Number of vectors to multiply. |
alpha | Scalar factor for matrix vector product. |
x | Input vector to be multiplied. |
xLD | Leading dimension of input x. |
beta | Scalar factor for y. |
y | Output vector of results. |
yLD | Leading dimension of output y. |
Implements Matrix.
Definition at line 351 of file Matrices.cpp.
int DenseMatrix::leaDim [protected] |
Leading dimension.
Definition at line 390 of file Matrices.hpp.
int DenseMatrix::nCols [protected] |
Number of columns.
Definition at line 389 of file Matrices.hpp.
int DenseMatrix::nRows [protected] |
Number of rows.
Definition at line 388 of file Matrices.hpp.
real_t* DenseMatrix::val [protected] |
Vector of entries.
Definition at line 391 of file Matrices.hpp.