|
|
Subscript | lbound () const |
| |
|
| operator T** () |
| |
|
| operator const T ** () const |
| |
| Subscript | size () const |
| |
|
| Matrix (const Matrix< T > &A) |
| |
| | Matrix (Subscript M, Subscript N, const T &value=T(0)) |
| |
| | Matrix (Subscript M, Subscript N, const T *v) |
| |
| | Matrix (Subscript M, Subscript N, const char *s) |
| |
| Matrix< T > & | newsize (Subscript M, Subscript N) |
| |
| Matrix< T > & | operator= (const Matrix< T > &B) |
| |
|
Matrix< T > & | operator= (const T &scalar) |
| |
|
Subscript | dim (Subscript d) const |
| |
|
Subscript | num_rows () const |
| |
|
Subscript | num_cols () const |
| |
|
T * | operator[] (Subscript i) |
| |
|
const T * | operator[] (Subscript i) const |
| |
|
reference | operator() (Subscript i) |
| |
|
const_reference | operator() (Subscript i) const |
| |
|
reference | operator() (Subscript i, Subscript j) |
| |
|
const_reference | operator() (Subscript i, Subscript j) const |
| |
|
Vector< T > | diag () const |
| |
|
Matrix< T > | upper_triangular () const |
| |
|
Matrix< T > | lower_triangular () const |
| |
template<class T>
class TNT::Matrix< T >
Dense matrix class for basic linear algebra operations.
Ordering: row major.
Elements begin at (1,1) or [0][0].
Can be interfaced with C multidimentionsal arrays (e.g. double **)
copy-by-value semantics.
Optional range checking at compile time via TNT_BOUNDS_CHECK macro.
Change size of matrix to MxN, reallocating memory if necessary.
NOTE: This operations occurs in place, i.e. when resizing to a new matrix, original matrix elements are NOT retained. Instead, one must explicit create a new matrix of this size and manually copy the elements, e.g.
Matrix double B(M, N);
int min_M = M < A.num_rows() ? M : A.num_rows();
int min_N = N < A.num_cols() ? N : A.num_cols();
for (int i=1; i<=min_M; i++)
for (int j=1; j<=min_N; j++)
B(i,j) = A(i,j);
A.destroy();
- Parameters
-
| M | the number of rows of new size. |
| N | the number of columns of new size. |