An instance of data type Matrix is a matrix of variables of number type NT. The types Matrix and Vector together realize many functions of basic linear algebra.
There also constant versions of the above iterators: const_iterator, row_const_iterator, and column_const_iterator.
Matrix::Identity | |
a tag class for identity initialization
| |
Matrix::Vector | |
the vector type used.
|
Matrix M; | |||
creates an instance M of type
Matrix.
| |||
Matrix M ( int n); | |||
creates an instance M of type
Matrix of dimension n × n initialized to the zero matrix.
| |||
Matrix M ( int m, int n); | |||
creates an instance M of
type Matrix of dimension m × n initialized to the zero
matrix.
| |||
Matrix M ( std::pair<int,int> p); | |||
creates an instance
M of type Matrix of dimension
p.first × p.second initialized to the zero matrix.
| |||
Matrix M ( int n, Identity, NT x = NT(1)); | |||
creates an
instance M of type Matrix of dimension n × n
initialized to the identity matrix (times x).
| |||
Matrix M ( int m, int n, NT x); | |||
creates an instance M
of type Matrix of dimension m × n initialized to the
matrix with x entries.
| |||
template <class Forward_iterator> | |||
Matrix M ( Forward_iterator first, Forward_iterator last); | |||
creates an
instance M of type Matrix. Let S be the ordered set of
n column-vectors of common dimension m as given by the iterator
range [first,last). M is initialized to an m × n
matrix with the columns as specified by S.
| |||
Matrix M ( std::vector< Vector > A); | |||
creates an instance
M of type Matrix. Let A be an array of n
column-vectors of common dimension m. M is initialized to an
m × n matrix with the columns as specified by A.
|
int | M.row_dimension () | returns n, the number of rows of M. | ||
int | M.column_dimension () | returns m, the number of columns of M. | ||
std::pair<int,int> | M.dimension () | returns (m,n), the dimension pair of M. | ||
Vector | M.row ( int i) |
returns the i-th row of M (an
m - vector).
| ||
Vector | M.column ( int i) |
returns the i-th column of M
(an n - vector).
| ||
NT& | M ( int i , int j ) |
returns Mi,j.
| ||
void | M.swap_rows ( int i, int j) |
swaps rows i and j.
| ||
void | M.swap_columns ( int i, int j) |
swaps columns i and
j.
| ||
row_iterator | M.row_begin ( int i) |
an iterator pointing to the
first entry of the ith row.
| ||
row_iterator | M.row_end ( int i) |
an iterator pointing beyond
the last entry of the ith row.
| ||
column_iterator | M.column_begin ( int i) |
an iterator pointing
to the first entry of the ith column.
| ||
column_iterator | M.column_end ( int i) |
an iterator pointing
beyond the last entry of the ith column.
| ||
iterator | M.begin () | an iterator pointing to the first entry of M. | ||
terator | M.end () | an iterator pointing beyond the last entry of M. |
The same operations exist for row_const_iterator, column_const_iterator and const_iterator.
bool | M == M1 | Test for equality. |
bool | M != M1 | Test for inequality. |
Matrix | M + M1 |
Addition.
| ||
Matrix | M - M1 |
Subtraction.
| ||
Matrix | - M | Negation. | ||
Matrix | M * M1 |
Multiplication.
| ||
Vector | M * Vector vec |
Multiplication with
vector.
| ||
Matrix | NT x * M | Multiplication of every entry with x. | ||
Matrix | M * NT x | Multiplication of every entry with x. |