|
DACE 2.0 API Manual
Differential Algebra Core Engine
|
#include <dace/AlgebraicMatrix.h>
Public Member Functions | |
| AlgebraicMatrix () | |
| AlgebraicMatrix (const int size) | |
| Default Constructor. More... | |
| AlgebraicMatrix (const int nrows, const int ncols) | |
| AlgebraicMatrix (const int nrows, const int ncols, const T &d) | |
| unsigned int | ncols () const |
| unsigned int | nrows () const |
| unsigned int | size () const |
| void | resize (int size) |
| void | resize (int rows, int cols) |
| T & | at (const unsigned int irow, const unsigned int icol) |
| Reading/Writing single element. More... | |
| const T & | at (const unsigned int irow, const unsigned int icol) const |
| Reading/Writing single element. More... | |
| std::vector< T > | getrow (const unsigned int irow) const |
| Reading row. More... | |
| std::vector< T > | getcol (const unsigned int icol) const |
| Reading column. More... | |
| void | setrow (const unsigned int irow, const std::vector< T > &obj) |
| Set row equal to std::vector. More... | |
| void | setcol (const unsigned int icol, const std::vector< T > &obj) |
| Set column equal to std::vector. More... | |
| AlgebraicMatrix< T > | submat (const unsigned int first_row, const unsigned int first_col, const unsigned int last_row, const unsigned int last_col) const |
| Extract submatrix. More... | |
| AlgebraicMatrix< T > | submat (const unsigned int last_row, const unsigned int last_col) const |
| Extract submatrix, starting from position (0,0) More... | |
| AlgebraicMatrix< T > | transpose () const |
| Matrix transpose. More... | |
| T | det () const |
| Matrix determinant. More... | |
| AlgebraicMatrix< T > | inv () const |
| Matrix inverse XXX: name. More... | |
| AlgebraicMatrix< double > | cons () const |
| Return the costant part of a AlgebraicMatrix<T> More... | |
Class to handle matrices and their operations.
|
inline |
|
inlineexplicit |
Default Constructor.
Constructor for square matrices.
| [in] | size | size of the matrix, i.e. the number of rows and columns. |
|
inline |
Constructor for rectangular matrices.
| [in] | nrows | number of rows of the matrix |
| [in] | ncols | number of columns of the matrix |
|
inline |
Constructor for rectangular matrices that allows to set all elements equal to a variable.
| [in] | nrows | number of rows of the matrix |
| [in] | ncols | number of columns of the matrix |
| [in] | d | matrix elements value |
| T & DACE::AlgebraicMatrix< T >::at | ( | const unsigned int | irow, |
| const unsigned int | icol | ||
| ) |
Reading/Writing single element.
Reads/write element from/to AlgebraicMatrix.
| [in] | irow | row index. |
| [in] | icol | column index. |
| const T & DACE::AlgebraicMatrix< T >::at | ( | const unsigned int | irow, |
| const unsigned int | icol | ||
| ) | const |
Reading/Writing single element.
Reads/write element from/to AlgebraicMatrix.
| [in] | irow | row index. |
| [in] | icol | column index. |
| AlgebraicMatrix< double > DACE::AlgebraicMatrix< T >::cons | ( | ) | const |
Return the costant part of a AlgebraicMatrix<T>
Extract the constant part of a AlgebraicMatrix The result is copied in a new AlgebraicMatrix.
| T DACE::AlgebraicMatrix< T >::det | ( | ) | const |
Matrix determinant.
Compute the determinant of an AlgebraicMatrix
| std::vector< T > DACE::AlgebraicMatrix< T >::getcol | ( | const unsigned int | icol | ) | const |
Reading column.
Extracts a column of an AlgebraicMatrix. The result is copied in a new std::vector.
| [in] | icol | index of the column to be extracted |
| std::vector< T > DACE::AlgebraicMatrix< T >::getrow | ( | const unsigned int | irow | ) | const |
Reading row.
Extracts a row of an AlgebraicMatrix. The result is copied in a new std::vector.
| [in] | irow | index of the row to be extracted |
| AlgebraicMatrix< T > DACE::AlgebraicMatrix< T >::inv | ( | ) | const |
Matrix inverse XXX: name.
Compute the inverse of an AlgebraicMatrix Algorithm based on the Gauss elimination with full pivot (from the Numerical Cookbook) The result is copied in a new AlgebraicMatrix.
|
inline |
Returns the number of columns of the matrix
|
inline |
Returns the number of rows of the matrix
| void DACE::AlgebraicMatrix< T >::resize | ( | int | size | ) |
Resize AlgeraicMatrix to a square AlgebraicMatrix of size. The original values are kept at the original location if they are inside bounds of the new matrix.
| [in] | size | Size of the matrix (number of rows/columns). |
| void DACE::AlgebraicMatrix< T >::resize | ( | int | rows, |
| int | cols | ||
| ) |
Resize AlgeraicMatrix to a rectangular AlgebraicMatrix with size rows \(\times\) cols. The original values are kept at the original location if they are inside bounds of the new matrix.
| [in] | rows | Number of rows of the resized AlgebraicMatrix. |
| [in] | cols | Number of columns of the resized AlgebraicMatrix. |
| void DACE::AlgebraicMatrix< T >::setcol | ( | const unsigned int | icol, |
| const std::vector< T > & | obj | ||
| ) |
Set column equal to std::vector.
Insert std::vector into column of AlgebraicMatrix of the same type.
| [in] | icol | column to be written |
| [in] | obj | std::vector to be written |
| void DACE::AlgebraicMatrix< T >::setrow | ( | const unsigned int | irow, |
| const std::vector< T > & | obj | ||
| ) |
Set row equal to std::vector.
Insert std::vector into row of AlgebraicMatrix of the same type.
| [in] | irow | row to be written |
| [in] | obj | std::vector to be inserted as a row |
|
inline |
Returns the number of elements of the matrix
| AlgebraicMatrix< T > DACE::AlgebraicMatrix< T >::submat | ( | const unsigned int | first_row, |
| const unsigned int | first_col, | ||
| const unsigned int | last_row, | ||
| const unsigned int | last_col | ||
| ) | const |
Extract submatrix.
Extracts submatrix of AlgebraicMatrix. The result is stored into a new AlgebraicMatrix.
| [in] | first_row | index of the first row to be extracted. |
| [in] | last_row | index of the last row to be extracted. |
| [in] | first_col | index of the first column to be extracted. |
| [in] | last_col | index of the last column to be extracted. |
| AlgebraicMatrix< T > DACE::AlgebraicMatrix< T >::submat | ( | const unsigned int | last_row, |
| const unsigned int | last_col | ||
| ) | const |
Extract submatrix, starting from position (0,0)
Extracts submatrix of AlgebraicMatrix, starting from element (0,0). The result is stored into a new AlgebraicMatrix.
| [in] | last_row | index of the last row to be extracted. |
| [in] | last_col | index of the last column to be extracted. |
| AlgebraicMatrix< T > DACE::AlgebraicMatrix< T >::transpose | ( | ) | const |
Matrix transpose.
Transpose matrix. The result is copied into a new AlgebraicMatrix.
1.8.13