#include <mia/core/gsl_matrix.hh>
Public Types | |
typedef const_matrix_iterator | const_iterator |
typedef matrix_iterator | iterator |
Public Member Functions | |
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.
Definition at line 161 of file gsl_matrix.hh.
typedef matrix_iterator gsl::Matrix::iterator |
Definition at line 160 of file gsl_matrix.hh.
gsl::Matrix::Matrix | ( | ) |
gsl::Matrix::Matrix | ( | size_t | rows, |
size_t | columns, | ||
bool | clean | ||
) |
Create a matrix of size rows \(\times\) columns,
rows | |
columns | |
clean | allocate zeroing out all elements |
gsl::Matrix::Matrix | ( | size_t | rows, |
size_t | columns, | ||
double | init | ||
) |
Create a matrix of size rows \(\times\) columns,
rows | |
columns | |
init | set the matrix elements to this value |
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
rows | |
columns | |
init | the input data in row major format |
gsl::Matrix::Matrix | ( | const Matrix & | other | ) |
Copy constructor that executes a deep copy
gsl::Matrix::Matrix | ( | gsl_matrix * | m | ) |
Wrap an existing GSL matrix
m | the GSL matrix |
gsl::Matrix::Matrix | ( | const gsl_matrix * | m | ) |
Wrap an existing GSL constant matrix
m | the GSL matrix |
gsl::Matrix::~Matrix | ( | ) |
matrix_iterator gsl::Matrix::begin | ( | ) |
Iterator over the matrix elements of the matrix, column indices are the fastest changing indices.
const_matrix_iterator gsl::Matrix::begin | ( | ) | const |
Read only iterator over the matrix elements of the matrix, column indices are the fastest changing indices.
size_t gsl::Matrix::cols | ( | ) | const |
Matrix gsl::Matrix::column_covariance | ( | ) | const |
Evaluate the covariance matrix between the columns of this matrix
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
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. |
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
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. |
matrix_iterator gsl::Matrix::end | ( | ) |
Iterator over the matrix elements of the matrix, column indices are the fastest changing indices.
const_matrix_iterator gsl::Matrix::end | ( | ) | const |
Read only iterator over the matrix elements of the matrix, column indices are the fastest changing indices.
VectorView gsl::Matrix::get_column | ( | int | c | ) |
Get a read-write view of a matrix column
c | index of the matrix column |
ConstVectorView gsl::Matrix::get_column | ( | int | c | ) | const |
Get a read-only view of a matrix column
c | index of the matrix column |
VectorView gsl::Matrix::get_row | ( | int | r | ) |
Get a read-write view of a matrix row
r | index of the matrix row |
ConstVectorView gsl::Matrix::get_row | ( | int | r | ) | const |
Get a read-only view of a matrix row
r | index of the matrix row |
gsl::Matrix::operator const gsl_matrix * | ( | ) | const |
operator to get the underlying const gsl_matrix pointer
gsl::Matrix::operator gsl_matrix * | ( | ) |
operator to get the underlying gsl_matrix pointer
double gsl::Matrix::operator() | ( | size_t | i, |
size_t | j | ||
) | const |
Get a value of the matrix
i | row |
j | column |
|
inline |
Scale elements with a factor
rhs | scaling factor |
Definition at line 409 of file gsl_matrix.hh.
References EXPORT_GSL, gsl::operator*(), gsl::operator+(), and gsl::operator-().
Element wise matrix addition
rhs | matrix to add |
Definition at line 399 of file gsl_matrix.hh.
Element wise matrix subtraction
rhs | matrix to subtract |
Definition at line 389 of file gsl_matrix.hh.
void gsl::Matrix::print | ( | std::ostream & | os | ) | const |
void gsl::Matrix::reset | ( | size_t | rows, |
size_t | columns, | ||
bool | clean | ||
) |
Reset the matrix with the new dimensions.
rows | |
columns | |
clean | - set all values to zero |
void gsl::Matrix::reset | ( | size_t | rows, |
size_t | columns, | ||
double | init | ||
) |
Reset the matrix with the new dimensions.
rows | |
columns | |
init | - set all values to init |
Matrix gsl::Matrix::row_covariance | ( | ) | const |
Evaluate the covariance matrix between the rows of this matrix
size_t gsl::Matrix::rows | ( | ) | const |
void gsl::Matrix::set | ( | size_t | i, |
size_t | j, | ||
double | x | ||
) |
Set a value of the matrix
i | row |
j | column |
x | value |
void gsl::Matrix::set_column | ( | int | c, |
const Vector & | col | ||
) |
Set a matrix column
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 |
void gsl::Matrix::set_row | ( | int | r, |
const Vector & | row | ||
) |
Set a matrix row
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 |
Matrix gsl::Matrix::transposed | ( | ) | const |
Acquire the transposed matrix.