![]() |
SynAPSE
0.6.0
Synergistic Analysis of Phase Space Evolution
|
Object that can host any type of data in an matrix arrangement. More...
#include <Matrix.hh>
Public Member Functions | |
| Matrix () | |
| Default constructor, initilizes an empty matrix of dimension 0x0. More... | |
| Matrix (const size_t n) | |
| Square constructor, initializes an empty nxn square matrix. More... | |
| Matrix (const size_t m, const size_t n) | |
| Size constructor, initializes an empty mxn matrix. More... | |
| Matrix (const size_t m, const size_t n, const T &value) | |
| Constant constructor, initializes an mxn matrix filled with value. More... | |
| Matrix (const std::vector< T > &v) | |
| Column vector constructor, initializes an nx1 matrix filled with v. More... | |
| Matrix (const std::vector< std::vector< T >> &mat) | |
| Std constructor, sets the underlying std matrix. More... | |
| Matrix (const Matrix &mat) | |
| Copy constructor. More... | |
| ~Matrix () | |
| Destructor. More... | |
| Matrix & | operator= (const Matrix &mat) |
| Equality operator. More... | |
| operator bool () const | |
| Boolean operator. More... | |
| bool | operator! () const |
| Boolean not operator. More... | |
| Matrix | operator- () const |
| Overload the unary minus for matrix algebra. More... | |
| Matrix | operator+ (const Matrix &mat) const |
| Overload the matrix sum. More... | |
| void | operator+= (const Matrix &mat) |
| Overload the matrix sum. More... | |
| Matrix | operator- (const Matrix &mat) const |
| Overload the matrix substraction. More... | |
| void | operator-= (const Matrix &mat) |
| Overload the matrix substraction. More... | |
| Matrix | operator* (const Matrix &mat) const |
| Overload the matrix product. More... | |
| void | operator*= (const Matrix &mat) |
| Overload the matrix product equality. More... | |
| Matrix | operator* (const T &factor) const |
| Overload the matrix product with a scalar. More... | |
| void | operator*= (const T &factor) |
| Overload the matrix product with a scalar. More... | |
| Vector< T > | operator* (const Vector< T > &vec) const |
| Overload the matrix product with a vector, returns a vector. More... | |
| Matrix | operator/ (const T &factor) const |
| Overload the matrix ratio with a scalar. More... | |
| void | operator/= (const T &factor) |
| Overload the matrix ratio with a scalar. More... | |
| const std::vector< T > & | operator[] (const size_t i) const |
| Overload the subscript operator, return an std::vector row. More... | |
| std::vector< T > & | operator[] (const size_t i) |
| Overload the subscript operator, return an std::vector row, allows mods. More... | |
| T | Cofactor (const size_t i, const size_t j) const |
| Returns the ith-jth cofactor of the matrix. More... | |
| Matrix< T > | CofactorMatrix () const |
| Returns the inverse of the matrix. More... | |
| T | Determinant () const |
| Returns the deterimant of the matrix. More... | |
| std::vector< T > | Column (const size_t i) const |
| Returns the i^th column of the matrix as a vector. More... | |
| Matrix< T > | EigenVectors (std::vector< T > &lambdas, const double eps=1e-6) const |
| Returns the matrix of which the columns are the eigenvectors of the matrix. More... | |
| void | Fill (const T &value) |
| Fills the matrix with a certain value. More... | |
| void | Identity () |
| Sets the matrix to an identity matrix. More... | |
| Matrix< T > | Inverse () const |
| Returns the inverse of the matrix. More... | |
| void | Invert () |
| Inverts the matrix in place. More... | |
| bool | IsSymmetric () const |
| Checks whether the matrix is symmetric or not. More... | |
| const size_t | Nrows () const |
| Returns the number of rows. More... | |
| const size_t | Ncols () const |
| Returns the number of columns. More... | |
| void | Print () const |
| Print the matrix. More... | |
| void | RemoveColumn (const size_t i) |
| Removes the i^th column of the matrix. More... | |
| void | RemoveRow (const size_t i) |
| Removes the i^th row of the matrix. More... | |
| void | Resize (const size_t m, const size_t n) |
| Resizes the matrix to chosen dimension. More... | |
| const std::vector< T > & | Row (const size_t i) const |
| Returns the i^th row of the matrix as a vector. More... | |
| std::vector< T > & | Row (const size_t i) |
| Returns the i^th row of the matrix as a vector, allows mods. More... | |
| std::vector< T > | Solve (const std::vector< T > &b) const |
| Solves A*x=b, provided with b. More... | |
| const std::vector< std::vector < T > > & | std () const |
| Returns the underlying std vector. More... | |
| Matrix< T > | Transpose () const |
| Returns the matrix transpose. More... | |
Private Attributes | |
| std::vector< std::vector< T > > | _mat |
| Underlying std::vector<std::vector>> More... | |
Object that can host any type of data in an matrix arrangement.
The class definition also contains a multitude of linear algrebra methods that are useful to work with matrices.
Default constructor, initilizes an empty matrix of dimension 0x0.
Square constructor, initializes an empty nxn square matrix.
Size constructor, initializes an empty mxn matrix.
Constant constructor, initializes an mxn matrix filled with value.
Column vector constructor, initializes an nx1 matrix filled with v.
Std constructor, sets the underlying std matrix.
| T Matrix< T >::Cofactor | ( | const size_t | i, |
| const size_t | j | ||
| ) | const |
Returns the ith-jth cofactor of the matrix.
| i | Row index |
| j | Column index |
Returns the inverse of the matrix.
| std::vector< T > Matrix< T >::Column | ( | const size_t | i | ) | const |
Returns the i^th column of the matrix as a vector.
| T Matrix< T >::Determinant | ( | ) | const |
Returns the deterimant of the matrix.
| Matrix< T > Matrix< T >::EigenVectors | ( | std::vector< T > & | lambdas, |
| const double | eps = 1e-6 |
||
| ) | const |
Returns the matrix of which the columns are the eigenvectors of the matrix.
| lambdas | Eigenvalues |
| eps | Precision criterion to stop the iteration |
| void Matrix< T >::Fill | ( | const T & | value | ) |
Fills the matrix with a certain value.
| value | Value to fill the matrix with |
| void Matrix< T >::Identity | ( | ) |
Sets the matrix to an identity matrix.
Returns the inverse of the matrix.
| void Matrix< T >::Invert | ( | ) |
Inverts the matrix in place.
| bool Matrix< T >::IsSymmetric | ( | ) | const |
Checks whether the matrix is symmetric or not.
| const size_t Matrix< T >::Ncols | ( | ) | const |
Returns the number of columns.
| const size_t Matrix< T >::Nrows | ( | ) | const |
Returns the number of rows.
|
explicit |
Boolean operator.
| bool Matrix< T >::operator! | ( | ) | const |
Boolean not operator.
Overload the matrix product.
Overload the matrix product with a scalar.
Overload the matrix product with a vector, returns a vector.
Overload the matrix product equality.
| void Matrix< T >::operator*= | ( | const T & | factor | ) |
Overload the matrix product with a scalar.
Overload the matrix sum.
Overload the matrix sum.
Overload the unary minus for matrix algebra.
Overload the matrix substraction.
Overload the matrix substraction.
Overload the matrix ratio with a scalar.
| void Matrix< T >::operator/= | ( | const T & | factor | ) |
Overload the matrix ratio with a scalar.
Equality operator.
| const std::vector< T > & Matrix< T >::operator[] | ( | const size_t | i | ) | const |
Overload the subscript operator, return an std::vector row.
| std::vector< T > & Matrix< T >::operator[] | ( | const size_t | i | ) |
Overload the subscript operator, return an std::vector row, allows mods.
| void Matrix< T >::Print | ( | ) | const |
Print the matrix.
| void Matrix< T >::RemoveColumn | ( | const size_t | i | ) |
Removes the i^th column of the matrix.
| void Matrix< T >::RemoveRow | ( | const size_t | i | ) |
Removes the i^th row of the matrix.
| void Matrix< T >::Resize | ( | const size_t | m, |
| const size_t | n | ||
| ) |
Resizes the matrix to chosen dimension.
| m | Number of rows |
| n | Number of columns |
| const std::vector< T > & Matrix< T >::Row | ( | const size_t | i | ) | const |
Returns the i^th row of the matrix as a vector.
| std::vector< T > & Matrix< T >::Row | ( | const size_t | i | ) |
Returns the i^th row of the matrix as a vector, allows mods.
| std::vector< T > Matrix< T >::Solve | ( | const std::vector< T > & | b | ) | const |
Solves A*x=b, provided with b.
| const std::vector< std::vector< T > > & Matrix< T >::std | ( | ) | const |
Returns the underlying std vector.
Returns the matrix transpose.
|
private |
Underlying std::vector<std::vector>>
1.8.6