#include <mia/core/gsl_matrix.hh>
|
matrix_iterator | begin () |
|
const_matrix_iterator | begin () const |
|
size_t | cols () const |
|
Matrix | column_covariance () const |
|
double | dot_column (int c, const Vector &col) const |
|
double | dot_row (int r, const Vector &v) const |
|
matrix_iterator | end () |
|
const_matrix_iterator | end () const |
|
VectorView | get_column (int c) |
|
ConstVectorView | get_column (int c) const |
|
VectorView | get_row (int r) |
|
ConstVectorView | get_row (int r) const |
|
| Matrix () |
|
| Matrix (size_t rows, size_t columns, bool clean) |
|
| Matrix (size_t rows, size_t columns, double init) |
|
| Matrix (size_t rows, size_t columns, const double *init) |
|
| Matrix (const Matrix &other) |
|
| Matrix (gsl_matrix *m) |
|
| Matrix (const gsl_matrix *m) |
|
| operator const gsl_matrix * () const |
|
| operator gsl_matrix * () |
|
double | operator() (size_t i, size_t j) const |
|
Matrix & | operator*= (double rhs) |
|
Matrix & | operator+= (const Matrix &rhs) |
|
Matrix & | operator-= (const Matrix &rhs) |
|
Matrix & | operator= (const Matrix &other) |
|
void | print (std::ostream &os) const |
|
void | reset (size_t rows, size_t columns, bool clean) |
|
void | reset (size_t rows, size_t columns, double init) |
|
Matrix | row_covariance () const |
|
size_t | rows () const |
|
void | set (size_t i, size_t j, double x) |
|
void | set_column (int c, const Vector &col) |
|
void | set_row (int r, const Vector &row) |
|
Matrix | transposed () const |
|
| ~Matrix () |
|
This is a wrapper class around the GSL matrix type. It provides a compatibility to avoid handling de-alloction manually.
Definition at line 158 of file gsl_matrix.hh.
§ const_iterator
§ iterator
§ Matrix() [1/7]
§ Matrix() [2/7]
gsl::Matrix::Matrix |
( |
size_t |
rows, |
|
|
size_t |
columns, |
|
|
bool |
clean |
|
) |
| |
Create a matrix of size rows \(\times\) columns,
- Parameters
-
rows | |
columns | |
clean | allocate zeroing out all elements |
§ Matrix() [3/7]
gsl::Matrix::Matrix |
( |
size_t |
rows, |
|
|
size_t |
columns, |
|
|
double |
init |
|
) |
| |
Create a matrix of size rows \(\times\) columns,
- Parameters
-
rows | |
columns | |
init | set the matrix elements to this value |
§ Matrix() [4/7]
gsl::Matrix::Matrix |
( |
size_t |
rows, |
|
|
size_t |
columns, |
|
|
const double * |
init |
|
) |
| |
Create a matrix of size rows \(\times\) columns and initialize it with the given data
- Parameters
-
rows | |
columns | |
init | the input data in row major format |
§ Matrix() [5/7]
gsl::Matrix::Matrix |
( |
const Matrix & |
other | ) |
|
Copy constructor that executes a deep copy
§ Matrix() [6/7]
gsl::Matrix::Matrix |
( |
gsl_matrix * |
m | ) |
|
Wrap an existing GSL matrix
- Parameters
-
§ Matrix() [7/7]
gsl::Matrix::Matrix |
( |
const gsl_matrix * |
m | ) |
|
Wrap an existing GSL constant matrix
- Parameters
-
§ ~Matrix()
§ begin() [1/2]
Iterator over the matrix elements of the matrix, column indices are the fastest changing indices.
- Returns
- the begin of the range
§ begin() [2/2]
Read only iterator over the matrix elements of the matrix, column indices are the fastest changing indices.
- Returns
- the begin of the range
§ cols()
size_t gsl::Matrix::cols |
( |
| ) |
const |
- Returns
- the number of columns in the matrix
§ column_covariance()
Matrix gsl::Matrix::column_covariance |
( |
| ) |
const |
Evaluate the covariance matrix between the columns of this matrix
- Returns
- the covariance matrix
§ dot_column()
double gsl::Matrix::dot_column |
( |
int |
c, |
|
|
const Vector & |
col |
|
) |
| const |
Evaluate the dot product between a column of the matrix and a given vector
- Parameters
-
c | index of column, must be in [0, this->cols()-1] |
col | vector to evaluate the dot product with. The vector's size must be equal to the number of matrix rows. |
- Returns
- the dot product of the row vector and the input vector
§ dot_row()
double gsl::Matrix::dot_row |
( |
int |
r, |
|
|
const Vector & |
v |
|
) |
| const |
Evaluate the dot product between a row of the matrix and a given vector
- Parameters
-
r | index of row, must be in [0, this->rows()-1] |
v | vector to evaluate the dot product with. The vector's size must be equal to the number of matrix columns. |
- Returns
- the dot product of the row vector and the input vector
§ end() [1/2]
Iterator over the matrix elements of the matrix, column indices are the fastest changing indices.
- Returns
- the end of the range
§ end() [2/2]
Read only iterator over the matrix elements of the matrix, column indices are the fastest changing indices.
- Returns
- the end of the range
§ get_column() [1/2]
Get a read-write view of a matrix column
- Parameters
-
c | index of the matrix column |
- Returns
- view
§ get_column() [2/2]
Get a read-only view of a matrix column
- Parameters
-
c | index of the matrix column |
- Returns
- view
§ get_row() [1/2]
Get a read-write view of a matrix row
- Parameters
-
- Returns
- view
§ get_row() [2/2]
Get a read-only view of a matrix row
- Parameters
-
- Returns
- constant view
§ operator const gsl_matrix *()
gsl::Matrix::operator const gsl_matrix * |
( |
| ) |
const |
operator to get the underlying const gsl_matrix pointer
§ operator gsl_matrix *()
gsl::Matrix::operator gsl_matrix * |
( |
| ) |
|
operator to get the underlying gsl_matrix pointer
§ operator()()
double gsl::Matrix::operator() |
( |
size_t |
i, |
|
|
size_t |
j |
|
) |
| const |
Get a value of the matrix
- Parameters
-
- Returns
- the value
§ operator*=()
Matrix& gsl::Matrix::operator*= |
( |
double |
rhs | ) |
|
|
inline |
§ operator+=()
Element wise matrix addition
- Parameters
-
- Returns
- reference of this matrix
Definition at line 399 of file gsl_matrix.hh.
§ operator-=()
Element wise matrix subtraction
- Parameters
-
- Returns
- reference of this matrix
Definition at line 389 of file gsl_matrix.hh.
§ operator=()
Copy operator that executes a deep copy
§ print()
void gsl::Matrix::print |
( |
std::ostream & |
os | ) |
const |
Print matrix to a ostream
- Parameters
-
os | output stream to write to |
Referenced by gsl::operator<<().
§ reset() [1/2]
void gsl::Matrix::reset |
( |
size_t |
rows, |
|
|
size_t |
columns, |
|
|
bool |
clean |
|
) |
| |
Reset the matrix with the new dimensions.
- Parameters
-
rows | |
columns | |
clean | - set all values to zero |
§ reset() [2/2]
void gsl::Matrix::reset |
( |
size_t |
rows, |
|
|
size_t |
columns, |
|
|
double |
init |
|
) |
| |
Reset the matrix with the new dimensions.
- Parameters
-
rows | |
columns | |
init | - set all values to init |
§ row_covariance()
Matrix gsl::Matrix::row_covariance |
( |
| ) |
const |
Evaluate the covariance matrix between the rows of this matrix
- Returns
- the covariance matrix
§ rows()
size_t gsl::Matrix::rows |
( |
| ) |
const |
- Returns
- the number of rows in the matrix
§ set()
void gsl::Matrix::set |
( |
size_t |
i, |
|
|
size_t |
j, |
|
|
double |
x |
|
) |
| |
Set a value of the matrix
- Parameters
-
§ set_column()
void gsl::Matrix::set_column |
( |
int |
c, |
|
|
const Vector & |
col |
|
) |
| |
Set a matrix column
- Parameters
-
c | index of column to be set, must be in [0, this->cols()-1] |
col | vector containing the new values. It's size must be equal to the number of rows of the matrix |
§ set_row()
void gsl::Matrix::set_row |
( |
int |
r, |
|
|
const Vector & |
row |
|
) |
| |
Set a matrix row
- Parameters
-
r | index of row to be set, must be in [0, this->rows()-1] |
row | vector containing the new values. It's size must be equal to the number of columns of the matrix |
§ transposed()
Matrix gsl::Matrix::transposed |
( |
| ) |
const |
Acquire the transposed matrix.
- Returns
- transposed matrix as newly created object
The documentation for this class was generated from the following file: