10 #ifndef __QMATRIXC_HH_
11 #define __QMATRIXC_HH_
14 #include <gsl/gsl_complex.h>
15 #include <gsl/gsl_matrix_complex_double.h>
38 explicit QMatrixC(
const UInt_t nrow,
const UInt_t ncol);
65 void Resize(
const UInt_t nrow,
const UInt_t ncol);
72 for(UInt_t i=0;i<nI;i++){
73 for(UInt_t j=i;j<nJ;j++){
74 (*this)(i,j)=
QComplex(10*(i+j)*(i+j)+1,3.*(1.*i-1.*j));
75 (*this)(j,i)=(*
this)(i,j).Conj();
417 UInt_t startJ=0)
const;
430 void Print(
const char *opt=
"")
const;
437 QMatrixC (
const gsl_matrix_complex* mat);
440 QMatrixC(gsl_complex *data,
const UInt_t nrow,
const UInt_t ncol,
448 std::stringstream stream;
449 stream<<
"N row: "<<
GetNRow()<<
" Index: "<<i;
450 stream<<
"N col: "<<
fNCol<<
" Index: "<<j;
457 std::stringstream stream;
458 stream<<
"N row: "<<
GetNRow()<<
" Index: "<<i;
459 stream<<
"N col: "<<
fNCol<<
" Index: "<<j;
468 static void MatrixCopy(
double *orig,UInt_t nrow,UInt_t ncol,
double *dest,
469 UInt_t origTda=0,UInt_t destTda=0);
480 mutable gsl_matrix_complex *
fMat;
499 std::ostream&
operator<<(std::ostream&s,
const Diana::QMatrixC& m);
#define Q_BEGIN_NAMESPACE
Q_END_NAMESPACE std::ostream & operator<<(std::ostream &s, const Diana::QMatrixC &m)
scalar times QMatrix
error class with error type and description
An array of complex matrices that have been laid out in memory.
Interface for complex matrices in Diana analysis.
UInt_t GetNRow() const
get number rows
void SetMat() const
Fill the GSL matrix data.
const QMatrixC & operator-=(const QMatrixC &mat)
subtract a QMatrixC
const QMatrixC & operator/=(const QComplex &t)
division by scalar
QComplex GetElement(const UInt_t i, const UInt_t j)
QMatrixC GetSubMatrix(UInt_t nI, UInt_t nJ, UInt_t startI=0, UInt_t startJ=0)
Get a sub matrix of the matrix.
void Initialize(const QComplex &val)
initialize all elements (default to 0)
virtual ~QMatrixC()
destructor
const QMatrixC & operator+=(const QMatrixC &mat)
add a QMatrixC
virtual const QMatrixC & CholeskyDecompose()
Cholesky Decomposition.
QVectorC GetRow(const UInt_t nrow) const
get row
QMatrixC GetSummedAreaMatrix() const
Create a summed area matrix.
void Initialize(const double re=0, const double im=0)
initialize all elements (default to 0)
gsl_matrix_complex * fMat
QVectorC GetDiagonal() const
get matrix diagonal
void Resize(const UInt_t nrow, const UInt_t ncol)
resize a QMatrixC
const QComplex GetElement(const UInt_t i, const UInt_t j) const
UInt_t GetNCol() const
get number of columns
QVector HermitianEigenValues()
Get a vector of the eigenvalues.
QMatrix Magnitude() const
return magnitude of each element
void SetRow(const UInt_t nrow, const QVectorC &vec)
set row to specific vectors
QMatrixC GetConjugate() const
return conjugate matrix
UInt_t MemRowCElements() const
QMatrixC()
default constructor
static void MatrixCopy(double *orig, UInt_t nrow, UInt_t ncol, double *dest, UInt_t origTda=0, UInt_t destTda=0)
QMatrixC Inv() const
inverse
UInt_t Size() const
Return the number of complex numbers.
QMatrixC operator/(const QComplex &t) const
Division by scalar.
void BuildTest(UInt_t nI, UInt_t nJ)
void Clear()
reset members to default values
const QMatrixC & operator*=(const QComplex &t)
multiplication by scalar
const QMatrixC & Mult(const QMatrixC &mat)
Multiply element by element.
QMatrixC operator*(const QMatrixC &mat) const
MatrixC product.
void SetToIdentity()
initialize to identity
QMatrixC operator+(const QMatrixC &mat) const
sum matrix
QMatrixC(const double *orig)
const QMatrixC & operator=(const QMatrixC &orig)
copy the content of another matrix
QVectorC GetCol(const UInt_t ncol) const
get a QMatrix from a map
QMatrixC GetH() const
compute hermitian conjugate
QMatrixC T() const
transpose
virtual void CholeskySolveX(const QVectorC &Y, QVectorC &X) const
Return the inverse, using Cholesky decomposition.
virtual QMatrixC GetCholeskyDecomposition() const
Cholesky Decomposition.
QComplex operator()(const UInt_t i, const UInt_t j)
get row matching the integer value val in column col if more than one value is found in column the fi...
const QMatrixC & H()
compute hermitian conjugate
void HermitianEigenSystem(QVector &Val, QMatrixC &Vec)
Get the eigen values and vectors.
QComplex Det() const
Determinant.
const QMatrixC & Transpose()
transpose
const QMatrixC & Div(const QMatrixC &mat)
Divide element by element.
const QMatrixC & Invert()
inverse
const QMatrixC & Conjugate()
conjugate this matrix
QMatrixC operator-() const
revert sign to alla components
void SetCol(const UInt_t ncol, const QVectorC &vec)
set column to specific vector
Interface for matrices in Diana analysis.
base class for objects handled by QEvent and QGlobalDataManager.
virtual void Print() const
print content on screen
Interface for complex vectors in Diana analysis.
Interface for vectors in Diana analysis.