|
(Note that these are not member functions.)
|
template<index_t DIM, class FT > |
std::ostream & | operator<< (std::ostream &output, const Matrix< DIM, FT > &m) |
| Writes a matrix to a stream. More...
|
|
template<index_t DIM, class FT > |
std::istream & | operator>> (std::istream &input, Matrix< DIM, FT > &m) |
| Reads a matrix from a stream. More...
|
|
template<index_t DIM, class FT > |
void | mult (const Matrix< DIM, FT > &M, const FT *x, FT *y) |
| Multiplies a matrix by a vector. More...
|
|
template<index_t DIM, class FT>
class GEO::Matrix< DIM, FT >
A matrix type.
Matrix implements a square matrix of dimension DIM
. containing coefficients of type T
. Type T
is expected to be a numeric type. Matrix provides the classical matrix operations.
- Template Parameters
-
FT | type of the matrix elements |
DIM | dimension of the matrix |
Definition at line 66 of file matrix.h.
template<index_t DIM, class FT >
void GEO::Matrix< DIM, FT >::get_lower_triangle |
( |
FT * |
store | ) |
const |
|
inline |
Gets the lower triangle of the matrix.
Gets all the coefficients of the matrix under the diagonal (included) to array store
, Array store
must be large enough to contain (DIM * (DIM+1))/2 values.
- Parameters
-
[in] | store | an array of at least (DIM * (DIM+1))/2 values |
Definition at line 442 of file matrix.h.
template<index_t DIM, class FT >
Gets a modifiable element.
Gets element at row i
and column j
in the matrix. If indices are out of range, the function calls abort().
- Parameters
-
[in] | i | row index of the element |
[in] | j | column index of the element |
- Returns
- a reference to the element at coordinates (
i
, j
).
Definition at line 178 of file matrix.h.
template<index_t DIM, class FT >
Gets a non-modifiable element.
Gets element at row i
and column j
in the matrix. If indices are out of range, the function calls abort().
- Parameters
-
[in] | i | row index of the element |
[in] | j | column index of the element |
- Returns
- a const reference to the element at coordinates (
i
, j
).
Definition at line 192 of file matrix.h.
template<index_t DIM, class FT >
void mult |
( |
const Matrix< DIM, FT > & |
M, |
|
|
const FT * |
x, |
|
|
FT * |
y |
|
) |
| |
|
related |
Multiplies a matrix by a vector.
Multiplies matrix M
by vector x
and stores the result in vector y. Vectors x
and y
are given as arrays of elements and must at least contain DIM
elements, otherwise the result is undefined.
- Parameters
-
[in] | M | a DIM x DIM matrix |
[in] | x | the input vector |
[in] | y | the result of the multiplication |
- Template Parameters
-
FT | the type of the matrix elements |
DIM | the dimension of the matrix |
Definition at line 516 of file matrix.h.
template<index_t DIM, class FT >
std::ostream & operator<< |
( |
std::ostream & |
output, |
|
|
const Matrix< DIM, FT > & |
m |
|
) |
| |
|
related |
Writes a matrix to a stream.
This writes the coefficients of matrix m
separated by a space character to the output stream output
.
- Parameters
-
[in] | output | the output stream |
[in] | m | the matrix to write |
- Returns
- a reference to the output stream
output
Definition at line 466 of file matrix.h.