Every class written within the CUORE framework should use this class for matrix handling
Public Member Functions | |
QMatrix () | |
default constructor | |
QMatrix (int nrow, int ncol) | |
constructor nrow x ncol | |
QMatrix (const QVector &vec) | |
constructor from QVector | |
QMatrix (const QMatrix &orig) | |
copy constructor | |
virtual | ~QMatrix () |
destructor | |
void | Resize (int nrow, int ncol) |
resize a QMatrix | |
int | GetNRow () const |
get number rows | |
int | GetNCol () const |
get number of columns | |
void | Initialize (double val=0) |
initialize all elements (default to 0) | |
void | SetToIdentity () |
initialize to identity | |
void | SetCol (int ncol, const QVector &vec) |
set column to specific vector | |
void | SetRow (int nrow, const QVector &vec) |
set row to specific vectors | |
void | Set (const std::map< int, int > &p) |
get a QMatrix from a map | |
QVector | GetCol (int ncol) const |
get column | |
QVector | GetRow (int nrow) const |
get row | |
QVector | GetRowByColumnIntValue (int col, int val) const |
get row matching the integer value val in column col if more than one value is found in column the first matching row is returned | |
double & | operator() (int i, int j) |
retrieve an element | |
double | operator() (int i, int j) const |
retrieve an element | |
const QMatrix & | operator= (const QMatrix &orig) |
copy the content of another matrix | |
QMatrix | operator- () |
revert sign to alla components | |
const QMatrix & | operator*= (double t) |
multiplication by scalar | |
const QMatrix & | operator*= (const QMatrix &other) |
multiplication by another QMatrix | |
const QMatrix & | operator/= (double t) |
division by scalar | |
const QMatrix & | operator+= (const QMatrix &mat) |
add a QMatrix | |
const QMatrix & | operator-= (const QMatrix &mat) |
subtract a QMatrix | |
const QMatrix & | Mult (const QMatrix &mat) |
Multiply element by element. | |
const QMatrix & | Div (const QMatrix &mat) |
Divide element by element. | |
QMatrix | operator* (const QMatrix &mat) |
Matrix product. | |
QMatrix | operator* (double t) |
Multiplication by scalar. | |
QMatrix | operator/ (double t) |
Division by scalar. | |
QMatrix | operator+ (const QMatrix &mat) |
sum matrix | |
QMatrix | operator- (const QMatrix &mat) |
subtract matrix | |
QVector | operator* (const QVector &vec) |
matrix-vector product | |
QMatrix | T () const |
transpose | |
const QMatrix & | Transpose () |
transpose | |
QMatrix | Inv () const |
inverse | |
const QMatrix & | Invert () |
inverse | |
double | Det () const |
Determinant. | |
Protected Member Functions | |
QMatrix (const gsl_matrix *mat) | |
constructor from gsl_matrix | |
Private Attributes | |
gsl_matrix * | m |
Friends | |
class | QVector |
QMatrix::QMatrix | ( | int | nrow, | |
int | ncol | |||
) |
constructor nrow x ncol
nrow | number of rows | |
ncol | number of columns |
QMatrix::QMatrix | ( | const QVector & | vec | ) |
constructor from QVector
vec | QVector of origin |
References QVector::fMathVec, and QVector::Size().
QMatrix::QMatrix | ( | const QMatrix & | orig | ) |
QMatrix::QMatrix | ( | const gsl_matrix * | mat | ) | [protected] |
constructor from gsl_matrix
mat | gsl_matrix of origin |
void QMatrix::Resize | ( | int | nrow, | |
int | ncol | |||
) |
int QMatrix::GetNRow | ( | ) | const [inline] |
get number rows
Referenced by GetCol(), GetRowByColumnIntValue(), Invert(), operator*=(), operator=(), QMatrix(), QVector::QVector(), and Resize().
int QMatrix::GetNCol | ( | ) | const [inline] |
get number of columns
Referenced by GetRow(), Invert(), operator*=(), operator=(), QMatrix(), and Resize().
void QMatrix::Initialize | ( | double | val = 0 |
) |
initialize all elements (default to 0)
val | initialization value |
void QMatrix::SetCol | ( | int | ncol, | |
const QVector & | vec | |||
) |
set column to specific vector
ncol | column index | |
vec | initialization vector |
References QVector::fMathVec.
void QMatrix::SetRow | ( | int | nrow, | |
const QVector & | vec | |||
) |
set row to specific vectors
nrow | row index | |
vec | initialization vector |
References QVector::fMathVec.
Referenced by QVector::T().
void QMatrix::Set | ( | const std::map< int, int > & | p | ) |
QVector QMatrix::GetCol | ( | int | ncol | ) | const |
get column
ncol | col index |
References QVector::fMathVec, and GetNRow().
QVector QMatrix::GetRow | ( | int | nrow | ) | const |
get row
nrow | row index |
References QVector::fMathVec, and GetNCol().
Referenced by GetRowByColumnIntValue().
QVector QMatrix::GetRowByColumnIntValue | ( | int | col, | |
int | val | |||
) | const |
double & QMatrix::operator() | ( | int | i, | |
int | j | |||
) |
double QMatrix::operator() | ( | int | i, | |
int | j | |||
) | const |
const QMatrix & QMatrix::operator*= | ( | double | t | ) |
multiplication by scalar
t |
Referenced by operator-(), and operator/=().
const QMatrix & QMatrix::operator/= | ( | double | t | ) |
Multiply element by element.
multiply element by element (a'_ij=a_ij*b_ij) --> NOT product between matrices
mat |
References m.
Divide element by element.
divide element by element (a'_ij=a_ij/b_ij) --> NOT division between matrices
mat |
References m.
Matrix product.
mat | right element |
QMatrix QMatrix::operator* | ( | double | t | ) |
Multiplication by scalar.
t | scalar |
QMatrix QMatrix::operator/ | ( | double | t | ) |
Division by scalar.
t | scalar |
sum matrix
mat | right element |
subtract matrix
mat | right element |
matrix-vector product
vec | right element |
QMatrix QMatrix::T | ( | ) | const |
const QMatrix & QMatrix::Transpose | ( | ) |
const QMatrix & QMatrix::Invert | ( | ) |
double QMatrix::Det | ( | ) | const |
Determinant.