|
| Matrix (void) |
| The default constructor. More...
|
|
| Matrix (const size_t &r, const size_t &c, double init_value=0) |
| Constructor allocating memory space for r times c elements, and sets all elements to init_value. More...
|
|
| Matrix (const Matrix &) |
| The copy constructor. More...
|
|
template<class T > |
| Matrix (const MatrixExpression< T > &other) |
|
| Matrix (std::istream &, char sep='\0') throw (utility::IO_error, std::exception) |
| The istream constructor. More...
|
|
| ~Matrix (void) |
| The destructor.
|
|
void | all (const double value) |
|
iterator | begin (void) |
|
const_iterator | begin (void) const |
|
iterator | begin_column (size_t i) |
|
const_iterator | begin_column (size_t i) const |
|
iterator | begin_row (size_t i) |
|
const_iterator | begin_row (size_t i) const |
|
VectorView | column_view (size_t i) |
|
const VectorConstView | column_const_view (size_t) const |
|
size_t | columns (void) const |
|
void | div (const Matrix &b) |
|
iterator | end (void) |
|
const_iterator | end (void) const |
|
iterator | end_column (size_t i) |
|
const_iterator | end_column (size_t i) const |
|
iterator | end_row (size_t i) |
|
const_iterator | end_row (size_t i) const |
|
bool | equal (const Matrix &, const double precision=0) const |
| Check whether matrices are equal within a user defined precision, set by precision. More...
|
|
const gsl_matrix * | gsl_matrix_p (void) const |
|
gsl_matrix * | gsl_matrix_p (void) |
|
void | mul (const Matrix &b) |
|
void | resize (size_t r, size_t c, double init_value=0) |
| Resize Matrix. More...
|
|
size_t | rows (void) const |
|
VectorView | row_view (size_t) |
|
const VectorConstView | row_const_view (size_t) const |
|
void | swap_columns (const size_t i, const size_t j) |
| Swap columns i and j. More...
|
|
void | swap_rowcol (const size_t i, const size_t j) |
| Swap row i and column j. More...
|
|
void | swap_rows (const size_t i, const size_t j) |
| Swap rows i and j. More...
|
|
void | transpose (void) |
| Transpose the matrix. More...
|
|
double & | operator() (size_t row, size_t column) |
| Element access operator. More...
|
|
const double & | operator() (size_t row, size_t column) const |
| Element access operator. More...
|
|
bool | operator== (const Matrix &other) const |
| Comparison operator. Takes squared time. More...
|
|
bool | operator!= (const Matrix &other) const |
| Comparison operator. Takes squared time. More...
|
|
const Matrix & | operator= (const Matrix &other) |
| The assignment operator. More...
|
|
template<class T > |
Matrix & | operator= (const MatrixExpression< T > &rhs) |
|
const Matrix & | operator+= (const Matrix &b) |
| Add and assign operator. More...
|
|
template<class T > |
Matrix & | operator+= (const MatrixExpression< T > &rhs) |
| Addition and assign operator. More...
|
|
const Matrix & | operator+= (const double d) |
| Add and assign operator. More...
|
|
const Matrix & | operator-= (const Matrix &) |
| Subtract and assign operator. More...
|
|
template<class T > |
Matrix & | operator-= (const MatrixExpression< T > &rhs) |
| Subtraction and assign operator. More...
|
|
const Matrix & | operator-= (const double d) |
| Subtract and assign operator. More...
|
|
const Matrix & | operator*= (const Matrix &) |
| Multiply and assignment operator. More...
|
|
const Matrix & | operator*= (double d) |
| Multiply and assignment operator. More...
|
|
|
(Note that these are not member functions.)
|
template<class Derived1 , class Derived2 > |
expression::MatrixBinary< Derived1, Derived2, expression::Plus > | operator+ (const BasicMatrix< Derived1 > &lhs, const BasicMatrix< Derived2 > &rhs) |
| Matrix addition operator. More...
|
|
template<class Derived1 , class Derived2 > |
expression::MatrixBinary< Derived1, Derived2, expression::Minus > | operator- (const BasicMatrix< Derived1 > &lhs, const BasicMatrix< Derived2 > &rhs) |
| Matrix subtraction operator. More...
|
|
template<class Derived1 , class Derived2 > |
expression::MatrixBinary< Derived1, Derived2, expression::Multiplies > | operator* (const BasicMatrix< Derived1 > &lhs, const BasicMatrix< Derived2 > &rhs) |
| Matrix multiplication operator. More...
|
|
template<class T > |
expression::ScaledMatrix< T > | operator* (const BasicMatrix< T > &A, double k) |
|
template<class T > |
expression::ScaledMatrix< T > | operator* (double k, const BasicMatrix< T > &A) |
|
template<typename T > |
expression::ScaledMatrix< T > | operator- (const BasicMatrix< T > &m) |
| negation operator More...
|
|
template<typename T > |
expression::TransposedMatrix< T > | transpose (const BasicMatrix< T > &A) |
| transpose function More...
|
|
void | inverse_svd (const Matrix &input, Matrix &result) |
|
bool | isnull (const Matrix &) |
| Check if all elements of the Matrix are zero. More...
|
|
double | max (const Matrix &) |
| Get the maximum value of the Matrix. More...
|
|
double | min (const Matrix &) |
| Get the minimum value of the Matrix. More...
|
|
void | minmax_index (const Matrix &, std::pair< size_t, size_t > &min, std::pair< size_t, size_t > &max) |
| Locate the maximum and minimum element in the Matrix. More...
|
|
bool | nan (const Matrix &templat, Matrix &flag) |
| Create a Matrix flag indicating NaN's in another Matrix templat. More...
|
|
void | swap (Matrix &, Matrix &) |
| Exchange all elements between the matrices by copying. More...
|
|
std::ostream & | operator<< (std::ostream &s, const Matrix &) |
| The output operator for the Matrix class.
|
|
double | trace (const Matrix &) |
| Trace of matrix. More...
|
|
Interface to GSL matrix.
For the time being 'double' is the only type supported.
- [File streams] Reading and writing vectors to file streams
- are of course supported. These are implemented without using GSL functionality, and thus binary read and write to streams are not supported.
- Note
- All GSL matrix related functions are not implement but most functionality defined for GSL matrices can be achieved with this interface class. Most notable GSL functionality not supported are no binary file support and views on arrays, utility::vectors, gsl_vectors, diagonals, subdiagonals, and superdiagonals.
Constructor from a matrix expression. A matrix expression is result operator+
, operator-
, and operator*, or combinations of them.
A typical usage looks like
where B, C, and D are all instances of class Matrix.
Typically this constructor is not used, if rvalues are enabled.
- See also
- Matrix(MatrixExpression<T>&&).
- Since
- new in yat 0.15
theplu::yat::utility::Matrix::Matrix |
( |
std::istream & |
, |
|
|
char |
sep = '\0' |
|
) |
| |
throw | ( | utility::IO_error, |
| | std::exception |
| ) | | |
|
explicit |
The istream constructor.
The std::istream will be interpreted as outlined here:
Missing values, i.e. empty elements, are treated as NaN values (std::numeric_limits<double>::quiet_NaN() to be specific).
Matrix rows are separated with the new line character.
Column element separation has two modes depending on the value of sep.
- If sep is the default '\0' value then column elements are separated with white space characters except the new line character. Multiple sequential white space characters are treated as one separator.
- Setting sep to something else than the default value will change the behaviour to use the sep character as the separator between column elements. Multiple sequential sep characters will be treated as separating elements with missing values.
End of input is the end of file marker and this treatment cannot be redefined using the provided API.
- Exceptions
-
GSL_error | if memory allocation fails, IO_error if unexpected input is found in the input stream. |
Assignment from a matrix expression. A matrix expression is the result of operator+
, operator-
, and operator*, or combinations of them.
A typical usage looks like
where A, B, C, and D are all instances of class Matrix.
Typically this constructor is not used, if rvalues are enabled.
- See also
- Matrix(MatrixExpression<T>&&).
- Since
- new in yat 0.15