This is a matrix class for general matrices. More...
#include <fixed_general_matrix.h>
Public Member Functions | |
Matrix (Noinit) | |
Matrix (Init ini=INIT, const AT &a=0) | |
Matrix (Eye ini, const AT &a=1) | |
Matrix (int m, int n, Noinit) | |
Matrix (int m, int n, Init ini=INIT, const AT &a=0) | |
Matrix (int m, int n, Eye ini, const AT &a=1) | |
template<class Row , class Col > | |
Matrix (const Matrix< General, Row, Col, AT > &A) | |
template<class Type , class Row , class Col > | |
Matrix (const Matrix< Type, Row, Col, AT > &A) | |
Matrix (const char *str) | |
String Constructor. More... | |
template<class Type , class Row , class Col > | |
Matrix< General, Fixed< M > , Fixed< N >, AT > & | operator= (const Matrix< Type, Row, Col, AT > &A) |
AT & | operator() (int i, int j) |
Element operator. More... | |
const AT & | operator() (int i, int j) const |
Element operator. More... | |
AT & | e (int i, int j) |
const AT & | e (int i, int j) const |
Element operator. More... | |
AT * | operator() () |
Pointer operator. More... | |
const AT * | operator() () const |
Pointer operator. More... | |
int | rows () const |
Number of rows. More... | |
int | cols () const |
Number of columns. More... | |
int | ldim () const |
Leading dimension. More... | |
const CBLAS_TRANSPOSE | blasTrans () const |
Transposed status. More... | |
const CBLAS_ORDER | blasOrder () const |
Storage convention. More... | |
const Matrix< General, Var, Var, AT > | operator() (const Range< Var, Var > &I, const Range< Var, Var > &J) const |
Submatrix operator. More... | |
template<int M1, int M2, int N1, int N2> | |
const Matrix< General, Fixed < M2-M1+1 >, Fixed< N2-N1+1 > , AT > | operator() (const Range< Fixed< M1 >, Fixed< M2 > > &I, const Range< Fixed< N1 >, Fixed< N2 > > &J) const |
template<int M1, int M2> | |
const Matrix< General, Fixed < M2-M1+1 >, Var, AT > | operator() (const Range< Fixed< M1 >, Fixed< M2 > > &I, const Range< Var, Var > &J) const |
template<int N1, int N2> | |
const Matrix< General, Var, Fixed< N2-N1+1 >, AT > | operator() (const Range< Var, Var > &I, const Range< Fixed< N1 >, Fixed< N2 > > &J) const |
const RowVector< Fixed< N >, AT > | row (int j) const |
const Vector< Fixed< M >, AT > | col (int i) const |
Matrix< General, Fixed< M > , Fixed< N >, AT > & | init (const AT &a=0) |
Initialization. More... | |
Matrix< General, Fixed< M > , Fixed< N >, AT > & | init (Init, const AT &a=0) |
Matrix< General, Fixed< M > , Fixed< N >, AT > & | init (Eye, const AT &a=1) |
Matrix< General, Fixed< M > , Fixed< N >, AT > & | init (Noinit, const AT &a=0) |
operator std::vector< std::vector< AT > > () | |
Cast to std::vector<std::vector<AT> >. More... | |
Matrix (std::vector< std::vector< AT > > m) | |
std::vector<std::vector<AT> > Constructor. Constructs and initializes a matrix with a std::vector<std::vector<AT> > object. An assert checks for constant length of each row. More... | |
const Matrix< General, Fixed < N >, Fixed< M >, AT > | T () const |
template<class Row > | |
void | set (int j, const Vector< Row, AT > &x) |
set Column j of matrix to given Vector | |
template<class Col > | |
void | set (int i, const RowVector< Col, AT > &x) |
set Row i of matrix to given RowVector | |
template<class Type , class Row , class Col > | |
void | set (const Range< Var, Var > &I, const Range< Var, Var > &J, const Matrix< Type, Row, Col, AT > &A) |
set the submatrix - specified by the Range operators - to the values of A More... | |
template<class Row > | |
void | add (int j, const Vector< Row, AT > &x) |
add to Column j of the matrix the given Vector | |
template<class Col > | |
void | add (int i, const RowVector< Col, AT > &x) |
add to Row i of the matrix the given RowVector | |
template<class Type , class Row , class Col > | |
void | add (const Range< Var, Var > &I, const Range< Var, Var > &J, const Matrix< Type, Row, Col, AT > &A) |
This is a matrix class for general matrices.
Template class Matrix with shape type General, Fixed and atomic type AT. The storage form is dense. The template parameter AT defines the atomic type of the matrix. Valid types are int, float, double, complex<float> and complex<double>
fmatvec::Matrix< General, Fixed< M >, Fixed< N >, AT >::Matrix | ( | const char * | str | ) |
String Constructor.
Constructs and initializes a matrix with a string in a matlab-like notation. The rows are seperated by semicolons, the columns by commas. For example
constructs the matrix
str | The string the matrix will be initialized with. |
|
inline |
std::vector<std::vector<AT> > Constructor. Constructs and initializes a matrix with a std::vector<std::vector<AT> > object. An assert checks for constant length of each row.
m | The std::vector<std::vector<AT> > the matrix will be initialized with. |
|
inline |
Storage convention.
Returns the blas-conform storage convention. The elements are stored in columnmajor form, i.e. the elements are stored columnwise.
|
inline |
Transposed status.
Returns the blas-conform transposed status.
|
inline |
Number of columns.
|
inline |
Element operator.
See e(int,int)
|
inline |
Initialization.
Initializes all elements of the calling matrix with the value given by a.
a | Value all elements will be initialized with. |
|
inline |
Leading dimension.
|
inline |
Cast to std::vector<std::vector<AT> >.
|
inline |
Element operator.
Returns a reference to the element in the i-th row and the j-th column.
i | The i-th row of the matrix |
j | The j-th column of the matrix |
|
inline |
Element operator.
|
inline |
Pointer operator.
Returns the pointer to the first element.
|
inline |
Pointer operator.
See operator()()
|
inline |
Submatrix operator.
Returns a submatrix of the calling matrix.
i1 | The starting row. |
j1 | The starting column. |
i2 | The ending row. |
j2 | The ending column. |
Submatrix operator.
See operator()(int,int,int,int);
Submatrix operator.
Returns a submatrix of the calling matrix. For example
yields
I | Range<Var,Var> containing the starting and the ending row. |
J | Range<Var,Var> containing the starting and the ending column. |
Submatrix operator.
See operator()(const Range<Var,Var>&, const Range<Var,Var>&)
|
inline |
Number of rows.