Diana Software
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends | List of all members
QMatrixC Class Reference

Interface for complex matrices in Diana analysis. More...

Inheritance diagram for QMatrixC:
QObject

Public Member Functions

 QMatrixC ()
 default constructor More...
 
 QMatrixC (const UInt_t nrow, const UInt_t ncol)
 constructor nrow x ncol More...
 
 QMatrixC (const QVectorC &vec)
 constructor from QVectorC More...
 
 QMatrixC (const QMatrixC &orig)
 copy constructor More...
 
 QMatrixC (const QMatrix &orig)
 copy constructor More...
 
virtual ~QMatrixC ()
 destructor More...
 
void Resize (const UInt_t nrow, const UInt_t ncol)
 resize a QMatrixC More...
 
UInt_t Size () const
 Return the number of complex numbers. More...
 
void BuildTest (UInt_t nI, UInt_t nJ)
 
void Clear ()
 reset members to default values More...
 
UInt_t GetNRow () const
 get number rows More...
 
UInt_t GetNCol () const
 get number of columns More...
 
void Initialize (const QComplex &val)
 initialize all elements (default to 0) More...
 
void Initialize (const double re=0, const double im=0)
 initialize all elements (default to 0) More...
 
void SetToIdentity ()
 initialize to identity More...
 
void SetCol (const UInt_t ncol, const QVectorC &vec)
 set column to specific vector More...
 
void SetRow (const UInt_t nrow, const QVectorC &vec)
 set row to specific vectors More...
 
QVectorC GetCol (const UInt_t ncol) const
 get a QMatrix from a map More...
 
QVectorC GetRow (const UInt_t nrow) const
 get row More...
 
QVectorC GetDiagonal () const
 get matrix diagonal More...
 
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 first matching row is returned More...
 
const QComplex operator() (const UInt_t i, const UInt_t j) const
 retrieve an element More...
 
const QMatrixCoperator= (const QMatrixC &orig)
 copy the content of another matrix More...
 
QMatrixC operator- () const
 revert sign to alla components More...
 
const QMatrixCoperator*= (const QComplex &t)
 multiplication by scalar More...
 
const QMatrixCoperator*= (const double t)
 
const QMatrixCoperator*= (const QMatrixC &other)
 multiplication by another QMatrixC More...
 
const QMatrixCoperator/= (const QComplex &t)
 division by scalar More...
 
const QMatrixCoperator/= (const double t)
 
const QMatrixCoperator+= (const QMatrixC &mat)
 add a QMatrixC More...
 
const QMatrixCoperator-= (const QMatrixC &mat)
 subtract a QMatrixC More...
 
const QMatrixCMult (const QMatrixC &mat)
 Multiply element by element. More...
 
const QMatrixCDiv (const QMatrixC &mat)
 Divide element by element. More...
 
QMatrixC operator* (const QMatrixC &mat) const
 MatrixC product. More...
 
QMatrixC operator* (const QComplex &t) const
 Multiplication by scalar. More...
 
QMatrixC operator* (const double t) const
 
QMatrixC operator/ (const QComplex &t) const
 Division by scalar. More...
 
QMatrixC operator/ (const double t) const
 
QMatrixC operator+ (const QMatrixC &mat) const
 sum matrix More...
 
QMatrixC operator- (const QMatrixC &mat) const
 subtract matrix More...
 
QVectorC operator* (const QVectorC &vec) const
 matrix-vector product More...
 
QMatrixC T () const
 transpose More...
 
const QMatrixCTranspose ()
 transpose More...
 
const QMatrixCH ()
 compute hermitian conjugate More...
 
QMatrixC GetH () const
 compute hermitian conjugate More...
 
const QMatrixCConjugate ()
 conjugate this matrix More...
 
QMatrixC GetConjugate () const
 return conjugate matrix More...
 
QMatrix Magnitude () const
 return magnitude of each element More...
 
QMatrixC Inv () const
 inverse More...
 
const QMatrixCInvert ()
 inverse More...
 
QComplex Det () const
 Determinant. More...
 
QVector HermitianEigenValues ()
 Get a vector of the eigenvalues. More...
 
void HermitianEigenSystem (QVector &Val, QMatrixC &Vec)
 Get the eigen values and vectors. More...
 
virtual const QMatrixCCholeskyDecompose ()
 Cholesky Decomposition. More...
 
virtual QMatrixC GetCholeskyDecomposition () const
 Cholesky Decomposition. More...
 
virtual void CholeskySolveX (const QVectorC &Y, QVectorC &X) const
 Return the inverse, using Cholesky decomposition. More...
 
QMatrixC GetSubMatrix (UInt_t nI, UInt_t nJ, UInt_t startI=0, UInt_t startJ=0)
 Get a sub matrix of the matrix. More...
 
const QMatrixC GetSubMatrix (UInt_t nI, UInt_t nJ, UInt_t startI=0, UInt_t startJ=0) const
 Get a sub matrix of the matrix. More...
 
QMatrixC GetSummedAreaMatrix () const
 Create a summed area matrix. More...
 
void Print (const char *opt="") const
 
- Public Member Functions inherited from QObject
 QObject ()
 default constructor More...
 
virtual ~QObject ()
 destructor More...
 
QObjectoperator= (const QObject &rhs)
 operator= More...
 
void Validate ()
 make object valid More...
 
void InValidate ()
 make object non valid More...
 
bool IsValid () const
 check wheter object is valid More...
 
void SetWrite (bool write=true)
 write or not this object More...
 
bool GetWrite () const
 check wheter write or not this object More...
 
bool IsRequired () const
 check wheter this object is required by some module More...
 
void SetIsRequired (bool required=true)
 set that this object is required
More...
 
bool IsJustAdded () const
 check wheter this object has been just added by some module More...
 
void SetIsJustAdded (bool added=true)
 set that this object has been just added
More...
 
void Reset ()
 set object to non valid and calls Clear() More...
 
virtual bool Fill (QObject *evData) const =0
 calls operator= of inheriting classes. Validity flag and bits are not copied. This function is automatically declared/implemented in derived classes by QObjectDef/QObjectImp. If evData type mismatches returns false, true otherwise. More...
 
void FullyFill (QObject *evData) const
 calls Fill(QObject*) if this QObject IsValid(). Copies Validity flag and bits More...
 
virtual QObjectDuplicate () const =0
 create object of same type, this function is automatically declared/implemented in derived classes by QObjectDef/QObjectImp More...
 
virtual void Dump (std::ostream &o) const
 print content to stream (intended for screen print or log files) More...
 
virtual void Print () const
 print content on screen More...
 
virtual QError WriteOnStream (std::ostream &o) const
 print content to stream (intended for storage in text files) More...
 
virtual QError ReadFromStream (std::istream &o)
 fill content from stream (intended for storage in text files) More...
 
void CopyBits (QObject *obj) const
 copy validity and temporary bits to another QObject More...
 
virtual void Draw (Option_t *option="")
 

Protected Member Functions

 QMatrixC (const gsl_matrix_complex *mat)
 constructor from gsl_matrix More...
 
 QMatrixC (const double *orig)
 
 QMatrixC (gsl_complex *data, const UInt_t nrow, const UInt_t ncol, const UInt_t tda=0)
 
void SetMat () const
 Fill the GSL matrix data. More...
 
QComplex GetElement (const UInt_t i, const UInt_t j)
 
const QComplex GetElement (const UInt_t i, const UInt_t j) const
 
UInt_t MemRowCElements () const
 
 QObjectDef (QMatrixC, 4)
 

Static Protected Member Functions

static void MatrixCopy (double *orig, UInt_t nrow, UInt_t ncol, double *dest, UInt_t origTda=0, UInt_t destTda=0)
 

Protected Attributes

Bool_t fDataOwner
 
UInt_t fSize
 
UInt_t fNCol
 
UInt_t fTda
 
UInt_t fAllocSize
 
double * fData
 
gsl_matrix_complex * fMat
 

Friends

class QVectorC
 
class QMatrixCArray
 

Additional Inherited Members

- Public Types inherited from QObject
enum  { kIsValid = BIT(15) , kWrite = BIT(0) , kIsRequired = BIT(1) , kIsJustAdded = BIT(2) }
 TObject bits. More...
 
- Static Public Member Functions inherited from QObject
static QObjectNew (const char *object)
 

Detailed Description

Interface for complex matrices in Diana analysis.

Known issue: The matrix may not be contiguous in memory which makes writing to a TTree difficult.

Definition at line 27 of file QMatrixC.hh.

Constructor & Destructor Documentation

◆ QMatrixC() [1/8]

QMatrixC::QMatrixC ( )

default constructor

Definition at line 51 of file QMatrixC.cc.

◆ QMatrixC() [2/8]

QMatrixC::QMatrixC ( const UInt_t  nrow,
const UInt_t  ncol 
)
explicit

constructor nrow x ncol

Parameters
nrownumber of rows
ncolnumber of columns

Definition at line 62 of file QMatrixC.cc.

References Resize().

◆ QMatrixC() [3/8]

QMatrixC::QMatrixC ( const QVectorC vec)
explicit

constructor from QVectorC

Parameters
vecQVectorC of origin

Definition at line 74 of file QMatrixC.cc.

References QVector::ArrayCopy(), fAllocSize, fData, QVector::fData, QVector::fStride, Resize(), QVector::Size(), and vec.

◆ QMatrixC() [4/8]

QMatrixC::QMatrixC ( const QMatrixC orig)

copy constructor

Parameters
origQMatrixC of origin

Definition at line 92 of file QMatrixC.cc.

References fData, GetNCol(), GetNRow(), MatrixCopy(), MemRowCElements(), and Resize().

◆ QMatrixC() [5/8]

QMatrixC::QMatrixC ( const QMatrix orig)

copy constructor

Parameters
origQMatrix of origin

Definition at line 106 of file QMatrixC.cc.

References QMatrix::GetNCol(), QMatrix::GetNRow(), operator()(), Resize(), QComplex::SetIm(), and QComplex::SetRe().

◆ ~QMatrixC()

QMatrixC::~QMatrixC ( )
virtual

destructor

Definition at line 151 of file QMatrixC.cc.

References Clear().

◆ QMatrixC() [6/8]

QMatrixC::QMatrixC ( const gsl_matrix_complex *  mat)
protected

constructor from gsl_matrix

Parameters
matgsl_matrix of origin

Definition at line 123 of file QMatrixC.cc.

References fData, GetNCol(), GetNRow(), MatrixCopy(), MemRowCElements(), and Resize().

◆ QMatrixC() [7/8]

QMatrixC::QMatrixC ( const double *  orig)
protected

◆ QMatrixC() [8/8]

QMatrixC::QMatrixC ( gsl_complex *  data,
const UInt_t  nrow,
const UInt_t  ncol,
const UInt_t  tda = 0 
)
protected

Definition at line 136 of file QMatrixC.cc.

References fNCol, and fTda.

Member Function Documentation

◆ BuildTest()

void QMatrixC::BuildTest ( UInt_t  nI,
UInt_t  nJ 
)
inline

Definition at line 70 of file QMatrixC.hh.

References Resize().

◆ CholeskyDecompose()

const QMatrixC & QMatrixC::CholeskyDecompose ( )
virtual

Cholesky Decomposition.

Perform a Cholesky decomposition of a matrix, A, IN PLACE.

A=LL^*

Where L is a lower triangular, with positive real values along the diagonal.

The input matrix must be positive definite, otherwise the function will return an error.

The output matrix has the components of the matrix L in the lower triangle and the components of L^* in the upper triangle. The elements in the diagonal (the overlap) are the same for both L and L^*.

Definition at line 537 of file QMatrixC.cc.

References DianaThrow, err, fMat, GetNCol(), GetNRow(), QERR_SIZE_NOT_MATCH, and SetMat().

Referenced by QMatrixCArray::CholeskyDecompose(), and GetCholeskyDecomposition().

◆ CholeskySolveX()

void QMatrixC::CholeskySolveX ( const QVectorC Y,
QVectorC X 
) const
virtual

Return the inverse, using Cholesky decomposition.

Invert using Cholesky decomposition

Use Cholesky decomposition to solve for X

Solve the system AX=Y for X, using a Cholesky decomposition. This does not require actually inverting A.

The method assumes that the matrix is ALREADY cholesky decomposed!

Definition at line 552 of file QMatrixC.cc.

References err, fMat, GetNRow(), QERR_SIZE_NOT_MATCH, QVectorC::Resize(), SetMat(), and QVectorC::Size().

◆ Clear()

void QMatrixC::Clear ( )
virtual

reset members to default values

Implements QObject.

Definition at line 155 of file QMatrixC.cc.

References QVector::ArrayFree(), fAllocSize, fData, fDataOwner, fMat, fNCol, fSize, and fTda.

Referenced by ~QMatrixC().

◆ Conjugate()

const QMatrixC & QMatrixC::Conjugate ( )

conjugate this matrix

Definition at line 421 of file QMatrixC.cc.

References fData, GetNCol(), GetNRow(), and MemRowCElements().

Referenced by MNoiseCrossFrequencyCovariance::Do(), GetConjugate(), and H().

◆ Det()

QComplex QMatrixC::Det ( ) const

Determinant.

Returns
the matrix determinant

Definition at line 470 of file QMatrixC.cc.

References err, fMat, fNCol, GetNRow(), and SetMat().

◆ Div()

const QMatrixC & QMatrixC::Div ( const QMatrixC mat)

Divide element by element.

divide element by element (a'_ij=a_ij/b_ij) --> NOT division between matrices

Parameters
mat
Returns
the same object modified

Definition at line 342 of file QMatrixC.cc.

References fMat, and SetMat().

Referenced by MNoiseCrossFrequencyCovariance::Do().

◆ GetCholeskyDecomposition()

QMatrixC QMatrixC::GetCholeskyDecomposition ( ) const
virtual

Cholesky Decomposition.

Out of place version of CholeskyDecompose().

Definition at line 547 of file QMatrixC.cc.

References CholeskyDecompose().

◆ GetCol()

QVectorC QMatrixC::GetCol ( const UInt_t  ncol) const

get a QMatrix from a map

Parameters
std::map<int,int>@

get column

Parameters
ncolcol index
Returns
vec column with index ncol

Definition at line 223 of file QMatrixC.cc.

References fMat, GetNRow(), and SetMat().

Referenced by operator*().

◆ GetConjugate()

QMatrixC QMatrixC::GetConjugate ( ) const

return conjugate matrix

Definition at line 430 of file QMatrixC.cc.

References Conjugate().

◆ GetDiagonal()

QVectorC QMatrixC::GetDiagonal ( ) const

get matrix diagonal

Returns
vec

Definition at line 240 of file QMatrixC.cc.

References DianaThrow, GetNCol(), GetNRow(), operator()(), QERR_SIZE_NOT_MATCH, and SetMat().

Referenced by HermitianEigenSystem(), and HermitianEigenValues().

◆ GetElement() [1/2]

QComplex QMatrixC::GetElement ( const UInt_t  i,
const UInt_t  j 
)
inlineprotected

Definition at line 446 of file QMatrixC.hh.

References DianaThrow, fData, fNCol, GetNRow(), MemRowCElements(), Q_DOUBLE_DEFAULT, and QERR_OUT_OF_RANGE.

Referenced by operator()().

◆ GetElement() [2/2]

const QComplex QMatrixC::GetElement ( const UInt_t  i,
const UInt_t  j 
) const
inlineprotected

◆ GetH()

QMatrixC QMatrixC::GetH ( ) const

compute hermitian conjugate

Returns
new matrix

Definition at line 416 of file QMatrixC.cc.

References H().

◆ GetNCol()

UInt_t QMatrixC::GetNCol ( ) const
inline

◆ GetNRow()

UInt_t QMatrixC::GetNRow ( ) const
inline

◆ GetRow()

QVectorC QMatrixC::GetRow ( const UInt_t  nrow) const

get row

Parameters
nrowrow index
Returns
vec row with index nrow

Definition at line 232 of file QMatrixC.cc.

References fMat, GetNCol(), and SetMat().

◆ GetSubMatrix() [1/2]

QMatrixC QMatrixC::GetSubMatrix ( UInt_t  nI,
UInt_t  nJ,
UInt_t  startI = 0,
UInt_t  startJ = 0 
)

Get a sub matrix of the matrix.

Return an nI x nJ matrix starting at (startI,startJ). (Note that I corresponds to row, and J to column).

Definition at line 579 of file QMatrixC.cc.

References fData, fTda, GetNCol(), GetNRow(), MemRowCElements(), and QERR_SIZE_NOT_MATCH.

◆ GetSubMatrix() [2/2]

const QMatrixC QMatrixC::GetSubMatrix ( UInt_t  nI,
UInt_t  nJ,
UInt_t  startI = 0,
UInt_t  startJ = 0 
) const

Get a sub matrix of the matrix.

Return an nI x nJ matrix starting at (startI,startJ). (Note that I corresponds to row, and J to column).

Definition at line 592 of file QMatrixC.cc.

References fData, fTda, GetNCol(), GetNRow(), MemRowCElements(), and QERR_SIZE_NOT_MATCH.

◆ GetSummedAreaMatrix()

QMatrixC QMatrixC::GetSummedAreaMatrix ( ) const

Create a summed area matrix.

Returns the matrix given by

\[ \Sigma_{ij} = \sum_{i'=0}^i\sum_{j'=0}^j M_{i'j'} *\]

Definition at line 606 of file QMatrixC.cc.

References GetNCol(), and GetNRow().

◆ H()

const QMatrixC & QMatrixC::H ( )

compute hermitian conjugate

If the matrix is the data owner it will be resized. If the matrix is NOT the data owner, the matrix MUST be square to be transposed. Otherwise an error will be thrown.

Returns
matrix hermitian conjugated

Definition at line 410 of file QMatrixC.cc.

References Conjugate(), and Transpose().

Referenced by MNoiseCrossFrequencyCovariance::Do(), and GetH().

◆ HermitianEigenSystem()

void QMatrixC::HermitianEigenSystem ( QVector Val,
QMatrixC Vec 
)

Get the eigen values and vectors.

This determines the eigensystem of the matrix assuming the that matrix is hermitian. If the matrix is NOT hermitian, the algorithm will treat it as if it is hermitian. The algorithm only references the lower triangle and the real components of the diagonal.

The ith eigenvalue is stored in the ith place in Val, and the corresponding eigenvector is stored in the ith column of Vec. The eigenvectors are guaranteed to be mutually orthogonal and normalized to unity.

The algorithm destroys the lower triangular portion of the matrix and the diagonal, but these are rebuilt using the upper triangular.

Definition at line 511 of file QMatrixC.cc.

References DianaThrow, err, fMat, QVector::fMathVec, GetDiagonal(), GetNCol(), GetNRow(), QERR_SIZE_NOT_MATCH, QVector::Resize(), Resize(), SetMat(), and QVector::SetMathVector().

◆ HermitianEigenValues()

QVector QMatrixC::HermitianEigenValues ( )

Get a vector of the eigenvalues.

This determines the eigen values of the matrix assuming the that matrix is hermitian. If the matrix is NOT hermitian, the algorithm will treat it as if it is hermitian. The algorithm only references the lower triangle and the real components of the diagonal.

The algorithm destroys the lower triangular portion of the matrix and the diagonal, but these are rebuilt using the upper triangular.

Definition at line 486 of file QMatrixC.cc.

References DianaThrow, err, fMat, QVector::fMathVec, GetDiagonal(), GetNCol(), GetNRow(), QERR_SIZE_NOT_MATCH, SetMat(), QVector::SetMathVector(), and QVector::Sort().

◆ Initialize() [1/2]

void QMatrixC::Initialize ( const double  re = 0,
const double  im = 0 
)
inline

initialize all elements (default to 0)

Parameters
valinitialization value

Definition at line 102 of file QMatrixC.hh.

References Initialize().

Referenced by Initialize().

◆ Initialize() [2/2]

void QMatrixC::Initialize ( const QComplex val)

initialize all elements (default to 0)

Parameters
valinitialization value

Definition at line 187 of file QMatrixC.cc.

References fNCol, GetNRow(), and operator()().

◆ Inv()

QMatrixC QMatrixC::Inv ( ) const

inverse

Returns
the inverse matrix

Definition at line 447 of file QMatrixC.cc.

References Invert().

◆ Invert()

const QMatrixC & QMatrixC::Invert ( )

inverse

Returns
the same matrix inverted

Definition at line 453 of file QMatrixC.cc.

References err, fMat, fNCol, GetNRow(), and SetMat().

Referenced by Inv(), and QMatrixCArray::Invert().

◆ Magnitude()

QMatrix QMatrixC::Magnitude ( ) const

return magnitude of each element

Definition at line 436 of file QMatrixC.cc.

References QComplex::GetMagnitude(), GetNCol(), GetNRow(), operator()(), and SetMat().

Referenced by MNoiseCrossFrequencyCovariance::Do().

◆ MatrixCopy()

Q_BEGIN_NAMESPACE void QMatrixC::MatrixCopy ( double *  orig,
UInt_t  nrow,
UInt_t  ncol,
double *  dest,
UInt_t  origTda = 0,
UInt_t  destTda = 0 
)
staticprotected

Definition at line 26 of file QMatrixC.cc.

References DianaThrow, and QERR_SIZE_NOT_MATCH.

Referenced by operator=(), and QMatrixC().

◆ MemRowCElements()

UInt_t QMatrixC::MemRowCElements ( ) const
inlineprotected

Definition at line 464 of file QMatrixC.hh.

References fNCol, and fTda.

Referenced by Conjugate(), GetElement(), GetSubMatrix(), operator=(), and QMatrixC().

◆ Mult()

const QMatrixC & QMatrixC::Mult ( const QMatrixC mat)

Multiply element by element.

multiply element by element (a'_ij=a_ij*b_ij) --> NOT product between matrices

Parameters
mat
Returns
the same object modified

Definition at line 334 of file QMatrixC.cc.

References fMat, and SetMat().

Referenced by MNoiseCrossFrequencyCovariance::Do().

◆ operator()() [1/2]

QComplex QMatrixC::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 first matching row is returned

Parameters
colcolumn index
valvalue to be matched
Returns
QVectorC Row

retrieve an element

Parameters
iith row
jjth col
Returns
element i of the QVectorC

Definition at line 253 of file QMatrixC.cc.

References GetElement().

Referenced by GetDiagonal(), Initialize(), Magnitude(), and QMatrixC().

◆ operator()() [2/2]

const QComplex QMatrixC::operator() ( const UInt_t  i,
const UInt_t  j 
) const

retrieve an element

version for objects that cannot modify the QMatrixC

Parameters
iith row
jjth col
Returns
element i of the QVectorC

Definition at line 258 of file QMatrixC.cc.

References GetElement().

◆ operator*() [1/4]

QMatrixC QMatrixC::operator* ( const double  t) const

Definition at line 355 of file QMatrixC.cc.

◆ operator*() [2/4]

QMatrixC QMatrixC::operator* ( const QComplex t) const

Multiplication by scalar.

Parameters
tcomplex number
Returns
scaled complex matrix

Definition at line 361 of file QMatrixC.cc.

◆ operator*() [3/4]

QMatrixC QMatrixC::operator* ( const QMatrixC mat) const

MatrixC product.

Parameters
matright element
Returns
MatrixC product

Definition at line 349 of file QMatrixC.cc.

◆ operator*() [4/4]

QVectorC QMatrixC::operator* ( const QVectorC vec) const

matrix-vector product

Parameters
vecright element
Returns
vector

Definition at line 391 of file QMatrixC.cc.

References GetCol(), and vec.

◆ operator*=() [1/3]

const QMatrixC & QMatrixC::operator*= ( const double  t)

Definition at line 284 of file QMatrixC.cc.

References operator*=().

◆ operator*=() [2/3]

const QMatrixC & QMatrixC::operator*= ( const QComplex t)

multiplication by scalar

Parameters
t
Returns
the same object modified

Definition at line 278 of file QMatrixC.cc.

References fMat, QComplex::Get_gsl_complex(), and SetMat().

Referenced by operator*=(), and operator/=().

◆ operator*=() [3/3]

const QMatrixC & QMatrixC::operator*= ( const QMatrixC other)

multiplication by another QMatrixC

A*=B; replaces A with a matrix with the appropriate dimensions of A*B (complex matrix product)

Parameters
other
Returns
the same object modified

Definition at line 289 of file QMatrixC.cc.

References fMat, GetNCol(), GetNRow(), Resize(), and SetMat().

◆ operator+()

QMatrixC QMatrixC::operator+ ( const QMatrixC mat) const

sum matrix

Parameters
matright element
Returns
sum matrix

Definition at line 378 of file QMatrixC.cc.

◆ operator+=()

const QMatrixC & QMatrixC::operator+= ( const QMatrixC mat)

add a QMatrixC

Parameters
mat
Returns
the same object modified

Definition at line 318 of file QMatrixC.cc.

References fMat, and SetMat().

◆ operator-() [1/2]

QMatrixC QMatrixC::operator- ( ) const

revert sign to alla components

Definition at line 273 of file QMatrixC.cc.

◆ operator-() [2/2]

QMatrixC QMatrixC::operator- ( const QMatrixC mat) const

subtract matrix

Parameters
matright element
Returns
matrix

Definition at line 385 of file QMatrixC.cc.

◆ operator-=()

const QMatrixC & QMatrixC::operator-= ( const QMatrixC mat)

subtract a QMatrixC

Parameters
mat
Returns
the same object modified

Definition at line 326 of file QMatrixC.cc.

References fMat, and SetMat().

◆ operator/() [1/2]

QMatrixC QMatrixC::operator/ ( const double  t) const

Definition at line 371 of file QMatrixC.cc.

◆ operator/() [2/2]

QMatrixC QMatrixC::operator/ ( const QComplex t) const

Division by scalar.

Parameters
tcomplex number
Returns
scaled matrix

Definition at line 366 of file QMatrixC.cc.

◆ operator/=() [1/2]

const QMatrixC & QMatrixC::operator/= ( const double  t)

Definition at line 313 of file QMatrixC.cc.

References operator*=().

◆ operator/=() [2/2]

const QMatrixC & QMatrixC::operator/= ( const QComplex t)

division by scalar

Parameters
t
Returns
the same object modified

Definition at line 309 of file QMatrixC.cc.

References operator*=().

◆ operator=()

const QMatrixC & QMatrixC::operator= ( const QMatrixC orig)

copy the content of another matrix

Parameters
origQMatrix of origin
Returns
the same object modified

Definition at line 263 of file QMatrixC.cc.

References fData, fMat, fNCol, GetNCol(), GetNRow(), MatrixCopy(), MemRowCElements(), and Resize().

◆ Print()

void QMatrixC::Print ( const char *  opt = "") const

Definition at line 618 of file QMatrixC.cc.

References fData, fNCol, fSize, fTda, GetNCol(), and GetNRow().

◆ QObjectDef()

QMatrixC::QObjectDef ( QMatrixC  ,
 
)
protected

◆ Resize()

void QMatrixC::Resize ( const UInt_t  nrow,
const UInt_t  ncol 
)

resize a QMatrixC

Parameters
nrownew number of rows
ncolnew number of cols
Returns
none

Definition at line 167 of file QMatrixC.cc.

References QVector::ArrayAlloc(), QVector::ArrayFree(), DianaThrow, fAllocSize, fData, fDataOwner, fMat, fNCol, fSize, fTda, GetNCol(), GetNRow(), and QERR_SIZE_NOT_MATCH.

Referenced by BuildTest(), HermitianEigenSystem(), operator*=(), operator=(), QMatrixC(), and Transpose().

◆ SetCol()

void QMatrixC::SetCol ( const UInt_t  ncol,
const QVectorC vec 
)

set column to specific vector

Parameters
ncolcolumn index
vecinitialization vector

Definition at line 200 of file QMatrixC.cc.

References DianaThrow, fMat, QVector::fMathVec, GetNRow(), QERR_SIZE_NOT_MATCH, SetMat(), QVector::SetMathVector(), QVector::Size(), and vec.

Referenced by QVectorC::operator*().

◆ SetMat()

void QMatrixC::SetMat ( ) const
protected

◆ SetRow()

void QMatrixC::SetRow ( const UInt_t  nrow,
const QVectorC vec 
)

set row to specific vectors

Parameters
nrowrow index
vecinitialization vector

Definition at line 212 of file QMatrixC.cc.

References DianaThrow, fMat, QVector::fMathVec, GetNCol(), QERR_SIZE_NOT_MATCH, SetMat(), QVector::SetMathVector(), QVector::Size(), and vec.

Referenced by QVectorC::H().

◆ SetToIdentity()

void QMatrixC::SetToIdentity ( )

initialize to identity

Definition at line 195 of file QMatrixC.cc.

References fMat, and SetMat().

◆ Size()

UInt_t QMatrixC::Size ( ) const
inline

Return the number of complex numbers.

Definition at line 67 of file QMatrixC.hh.

References fSize.

◆ T()

QMatrixC QMatrixC::T ( ) const

transpose

Returns
transposed matrix

Definition at line 397 of file QMatrixC.cc.

References Transpose().

◆ Transpose()

const QMatrixC & QMatrixC::Transpose ( )

transpose

If the matrix is the data owner it will be resized. If the matrix is NOT the data owner, the matrix MUST be square to be transposed. Otherwise an error will be thrown.

Returns
the same matrix transposed

Definition at line 403 of file QMatrixC.cc.

References fMat, GetNCol(), GetNRow(), Resize(), and SetMat().

Referenced by H(), and T().

Friends And Related Function Documentation

◆ QMatrixCArray

friend class QMatrixCArray
friend

Definition at line 483 of file QMatrixC.hh.

◆ QVectorC

friend class QVectorC
friend

Definition at line 482 of file QMatrixC.hh.

Member Data Documentation

◆ fAllocSize

UInt_t QMatrixC::fAllocSize
protected

Definition at line 477 of file QMatrixC.hh.

Referenced by Clear(), QMatrixC(), and Resize().

◆ fData

double* QMatrixC::fData
protected

◆ fDataOwner

Bool_t QMatrixC::fDataOwner
protected

Definition at line 473 of file QMatrixC.hh.

Referenced by Clear(), and Resize().

◆ fMat

gsl_matrix_complex* QMatrixC::fMat
mutableprotected

◆ fNCol

UInt_t QMatrixC::fNCol
protected

◆ fSize

UInt_t QMatrixC::fSize
protected

Definition at line 474 of file QMatrixC.hh.

Referenced by Clear(), GetNRow(), Print(), Resize(), and Size().

◆ fTda

UInt_t QMatrixC::fTda
protected

Definition at line 476 of file QMatrixC.hh.

Referenced by Clear(), GetSubMatrix(), MemRowCElements(), Print(), QMatrixC(), Resize(), and SetMat().


The documentation for this class was generated from the following files: