|
fmatvec
0.0.0
|
This is a matrix class for general matrices. More...
#include <var_fixed_general_matrix.h>
Public Types | |
| using | value_type = AT |
| using | shape_type = General |
| using | iterator = AT * |
| using | const_iterator = const AT * |
Public Member Functions | |
| Matrix (int m, Noinit) | |
| Matrix (int m, Init ini=INIT, const AT &a=AT()) | |
| Matrix (int m, Eye ini, const AT &a=1) | |
| Matrix (int m, int n, Noinit) | |
| Matrix (int m, int n, Init ini=INIT, const AT &a=AT()) | |
| Matrix (int m, int n, Eye ini, const AT &a=1) | |
| Matrix (Matrix< General, Var, Fixed< N >, AT > &&src) noexcept | |
|
Matrix< General, Var, Fixed< N > , AT > & | operator= (Matrix< General, Var, Fixed< N >, AT > &&src) noexcept |
| Matrix (const Matrix< General, Var, Fixed< N >, AT > &A) | |
| Copy Constructor. More... | |
| template<class Row , class Col > | |
| Matrix (const Matrix< General, Row, Col, AT > &A) | |
| Copy Constructor. More... | |
| template<class Type , class Row , class Col > | |
| Matrix (const Matrix< Type, Row, Col, AT > &A) | |
| Copy Constructor. More... | |
| Matrix (const std::string &strs) | |
| String Constructor. More... | |
| Matrix (const char *strs) | |
| iterator | begin () |
| iterator | end () |
| const_iterator | begin () const |
| const_iterator | end () const |
| ~Matrix () | |
| Destructor. | |
|
Matrix< General, Var, Fixed< N > , AT > & | resize (int m, Noinit) |
|
Matrix< General, Var, Fixed< N > , AT > & | resize (int m, Init ini=INIT, const AT &a=AT()) |
|
Matrix< General, Var, Fixed< N > , AT > & | resize (int m, Eye ini, const AT &a=1) |
| void | resize (int m, int n) |
| Matrix< General, Var, Fixed< N > , AT > & | operator= (const Matrix< General, Var, Fixed< N >, AT > &A) |
| Assignment operator. More... | |
| template<class Type , class Row , class Col > | |
| Matrix< General, Var, Fixed< N > , AT > & | operator= (const Matrix< Type, Row, Col, AT > &A) |
| Assignment operator. More... | |
| template<class Type , class Row , class Col > | |
| Matrix< General, Var, Fixed< N > , AT > & | operator<<= (const Matrix< Type, Row, Col, AT > &A) |
| Matrix assignment. More... | |
|
Matrix< General, Var, Fixed< N > , AT > & | operator<<= (Matrix< General, Var, Fixed< N >, AT > &&src) |
| 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 & | e (int i) |
| const AT & | e (int i) const |
| Element operator. More... | |
| AT * | operator() () |
| Pointer operator. More... | |
| const AT * | operator() () const |
| Pointer operator. More... | |
| constexpr int | rows () const |
| Number of rows. More... | |
| constexpr 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 |
| const RowVector< Fixed< N >, AT > | row (int i) const |
| const Vector< Var, AT > | col (int j) const |
| Matrix< General, Var, Fixed< N > , AT > & | init (const AT &val=AT()) |
| Initialization. More... | |
|
Matrix< General, Var, Fixed< N > , AT > & | init (Init, const AT &a=AT()) |
|
Matrix< General, Var, Fixed< N > , AT > & | init (Eye, const AT &val=1) |
|
Matrix< General, Var, Fixed< N > , AT > & | init (Noinit, const AT &a=AT()) |
| operator std::vector< std::vector< AT >> () const | |
| Cast to std::vector<std::vector<AT>>. More... | |
| Matrix (const 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 FMATVEC_ASSERT checks for constant length of each row. More... | |
| const Matrix< General, Fixed < N >, Var, AT > | T () const |
| Cast to AT. More... | |
| template<class Row > | |
| void | set (int j, const Vector< Row, AT > &x) |
| template<class Col > | |
| void | set (int i, const RowVector< Col, AT > &x) |
| 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) |
| template<class Row > | |
| void | add (int j, const Vector< Row, AT > &x) |
| template<class Col > | |
| void | add (int i, const RowVector< Col, AT > &x) |
| 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) |
Static Public Attributes | |
| static constexpr bool | isVector {false} |
This is a matrix class for general matrices.
Template class Matrix with shape type GeneralFixed 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>
|
inline |
Copy Constructor.
Constructs a copy to the matrix A.
| A | The matrix that will be copied. |
|
inline |
Copy Constructor.
Constructs a copy to the matrix A.
| A | The matrix that will be copied. |
|
inlineexplicit |
Copy Constructor.
Constructs a copy to the matrix A.
| A | The matrix that will be copied. |
| fmatvec::Matrix< General, Var, Fixed< N >, AT >::Matrix | ( | const std::string & | strs | ) |
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
\[ A=\begin{pmatrix}3 & 2\\ 1 & 2\end{pmatrix} \]
| str | The string the matrix will be initialized with. |
|
inlineexplicit |
std::vector<std::vector<AT>> Constructor. Constructs and initializes a matrix with a std::vector<std::vector<AT>> object. An FMATVEC_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 |
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.
|
inlineexplicit |
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 |
Matrix assignment.
Copies the matrix given by A.
| A | The matrix to be copied. |
|
inline |
Assignment operator.
Copies the matrix given by A.
| A | The matrix to be assigned. |
|
inline |
Assignment operator.
Copies the matrix given by A.
| A | The matrix to be assigned. |
|
inline |
Resize a var-fixed matrix. Throw if the fixed dimension is different and resize the var dimension
|
inline |
Number of rows.
|
inline |
Cast to AT.
AT Constructor. Constructs and initializes a matrix with a AT object.
| x | The AT the matrix will be initialized with. |