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

Interface for matrices in Diana analysis. More...

Inheritance diagram for QMatrix:
QObject

Public Member Functions

 QMatrix ()
 default constructor More...
 
 QMatrix (UInt_t nrow, UInt_t ncol)
 constructor nrow x ncol More...
 
 QMatrix (const QVector &vec)
 constructor from QVector More...
 
 QMatrix (const QMatrix &orig)
 copy constructor More...
 
virtual ~QMatrix ()
 destructor More...
 
void Resize (UInt_t nrow, UInt_t ncol)
 resize a QMatrix More...
 
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 (double val=0)
 initialize all elements (default to 0) More...
 
void SetToIdentity ()
 initialize to identity More...
 
void SetCol (UInt_t ncol, const QVector &vec)
 set column to specific vector More...
 
void SetRow (UInt_t nrow, const QVector &vec)
 set row to specific vectors More...
 
void Set (const std::map< int, int > &p)
 get a QMatrix from a map More...
 
QVector GetCol (UInt_t ncol)
 get column More...
 
QVector GetCol (UInt_t ncol) const
 get column More...
 
QVector GetRow (UInt_t nrow)
 get row More...
 
QVector GetRow (UInt_t nrow) const
 get row More...
 
QVector GetDiaganol ()
 Get the diaganol. More...
 
QVector GetDiaganol () const
 Get the diaganol. More...
 
QVector GetRowByColumnIntValue (UInt_t 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 More...
 
double & operator() (UInt_t i, UInt_t j)
 retrieve an element More...
 
const double & operator() (UInt_t i, UInt_t j) const
 retrieve an element More...
 
const QMatrixoperator= (const QMatrix &orig)
 copy the content of another matrix More...
 
QMatrix operator- ()
 revert sign to all components More...
 
const QMatrixoperator*= (double t)
 multiplication by scalar More...
 
const QMatrixoperator*= (const QMatrix &other)
 multiplication by another QMatrix More...
 
const QMatrixoperator/= (double t)
 division by scalar More...
 
const QMatrixoperator+= (const QMatrix &mat)
 add a QMatrix More...
 
const QMatrixoperator-= (const QMatrix &mat)
 subtract a QMatrix More...
 
const QMatrixMult (const QMatrix &mat)
 Multiply element by element. More...
 
const QMatrixDiv (const QMatrix &mat)
 Divide element by element. More...
 
QMatrix operator* (const QMatrix &mat) const
 Matrix product. More...
 
QMatrix operator* (double t) const
 Multiplication by scalar. More...
 
QMatrix operator/ (double t) const
 Division by scalar. More...
 
QMatrix operator+ (const QMatrix &mat) const
 sum matrix More...
 
QMatrix operator- (const QMatrix &mat) const
 subtract matrix More...
 
QVector operator* (const QVector &vec) const
 matrix-vector product More...
 
QMatrix T () const
 transpose returns a different matrix transposed wrt the original More...
 
const QMatrixTranspose ()
 transpose More...
 
QMatrix Inv () const
 inverse returns a different matrix inverted wrt the original More...
 
const QMatrixInvert ()
 inverse inverts the matrix itself More...
 
double Det () const
 Determinant. More...
 
QMatrix GetCholeskyDecomposition () const
 Cholesky Decomposition. More...
 
const QMatrixCholeskyDecompose ()
 Cholesky Decomposition. More...
 
void CholeskySolveX (const QVector &Y, QVector &X) const
 Solve for X using Cholesky decomposition. More...
 
QMatrix GetSubMatrix (UInt_t nI, UInt_t nJ, UInt_t startI=0, UInt_t startJ=0)
 Get a sub matrix of the matrix. More...
 
const QMatrix GetSubMatrix (UInt_t nI, UInt_t nJ, UInt_t startI=0, UInt_t startJ=0) const
 Get a sub matrix of the matrix. More...
 
QMatrix GetSummedAreaMatrix () const
 Create a summed area matrix. More...
 
void SetElement (UInt_t i, UInt_t j, Double_t val)
 
- 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

 QMatrix (const gsl_matrix *mat)
 constructor from gsl_matrix More...
 
 QMatrix (const double *orig)
 
 QMatrix (double *data, const UInt_t nrow, const UInt_t ncol, const UInt_t tda=0)
 
void SetMat () const
 
double & GetElement (UInt_t i, UInt_t j)
 
const double & GetElement (UInt_t i, UInt_t j) const
 
UInt_t MemRowElements () const
 

Static Protected Member Functions

static void MatrixCopy (const double *orig, const UInt_t Nrow, const UInt_t Ncol, double *dest, UInt_t origTda=0, UInt_t destTda=0)
 Static method to copy a matrix from one data location to another. More...
 

Private Member Functions

 QObjectDef (QMatrix, 3)
 

Private Attributes

Bool_t fDataOwner
 This owns the memory. More...
 
UInt_t fSize
 
UInt_t fNCol
 
UInt_t fTda
 
UInt_t fAllocSize
 
Double_t * fData
 
gsl_matrix * fMat
 

Friends

class QVector
 
class QMatrixC
 

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 matrices in Diana analysis.

Every class written within the DIANA framework should use this class for matrix handling

Definition at line 24 of file QMatrix.hh.

Constructor & Destructor Documentation

◆ QMatrix() [1/7]

QMatrix::QMatrix ( )

default constructor

Definition at line 51 of file QMatrix.cc.

◆ QMatrix() [2/7]

QMatrix::QMatrix ( UInt_t  nrow,
UInt_t  ncol 
)

constructor nrow x ncol

Parameters
nrownumber of rows
ncolnumber of columns

Definition at line 62 of file QMatrix.cc.

References Resize().

◆ QMatrix() [3/7]

QMatrix::QMatrix ( const QVector vec)

constructor from QVector

Parameters
vecQVector of origin

Definition at line 74 of file QMatrix.cc.

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

◆ QMatrix() [4/7]

QMatrix::QMatrix ( const QMatrix orig)

copy constructor

Parameters
origQMatrix of origin

Definition at line 87 of file QMatrix.cc.

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

◆ ~QMatrix()

QMatrix::~QMatrix ( )
virtual

destructor

Definition at line 129 of file QMatrix.cc.

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

◆ QMatrix() [5/7]

QMatrix::QMatrix ( const gsl_matrix *  mat)
protected

constructor from gsl_matrix

Parameters
matgsl_matrix of origin

Definition at line 101 of file QMatrix.cc.

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

◆ QMatrix() [6/7]

QMatrix::QMatrix ( const double *  orig)
protected

◆ QMatrix() [7/7]

QMatrix::QMatrix ( double *  data,
const UInt_t  nrow,
const UInt_t  ncol,
const UInt_t  tda = 0 
)
protected

Definition at line 113 of file QMatrix.cc.

References fMat, fNCol, and fTda.

Member Function Documentation

◆ CholeskyDecompose()

const QMatrix & QMatrix::CholeskyDecompose ( )

Cholesky Decomposition.

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

A=LL^T

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^T in the upper triangle. The elements in the diagonal (the overlap) are the same for both L and L^T.

The entire algorithm can be done in place. Resulting matrix resides in the same memory location as it did before.

Definition at line 470 of file QMatrix.cc.

References err, fMat, and SetMat().

Referenced by GetCholeskyDecomposition().

◆ CholeskySolveX()

void QMatrix::CholeskySolveX ( const QVector Y,
QVector X 
) const

Solve for X using Cholesky decomposition.

Solves the equation A*X=Y for X, using a Cholesky decomposition.

IMPORTANT: This ASSUMES that the matrix has already been cholesky decomposed. This is done to save memory, since Cholesky can be done in place.

Definition at line 482 of file QMatrix.cc.

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

◆ Clear()

void QMatrix::Clear ( )
virtual

reset members to default values

Implements QObject.

Definition at line 139 of file QMatrix.cc.

References Resize().

◆ Det()

double QMatrix::Det ( ) const

Determinant.

Calculates the determinant using LU decompositon. And requires enough memory for the decomposition.

Returns
the matrix determinant

Definition at line 454 of file QMatrix.cc.

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

◆ Div()

const QMatrix & QMatrix::Div ( const QMatrix mat)

Divide element by element.

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

Keeps memory the same.

Parameters
mat
Returns
the same object modified

Definition at line 359 of file QMatrix.cc.

References fMat, and SetMat().

◆ GetCholeskyDecomposition()

QMatrix QMatrix::GetCholeskyDecomposition ( ) const

Cholesky Decomposition.

Out of place version of CholeskyDecompose().

Definition at line 477 of file QMatrix.cc.

References CholeskyDecompose().

◆ GetCol() [1/2]

QVector QMatrix::GetCol ( UInt_t  ncol)

get column

Parameters
ncolcol index

Returns a new vector with its own memory

Returns
vec column with index ncol

Definition at line 221 of file QMatrix.cc.

References fData, GetNRow(), MemRowElements(), and QVector.

Referenced by MRawDataFilter::GetCuts(), operator*(), and LASCIIGlobalWriter::SetQMatrix().

◆ GetCol() [2/2]

QVector QMatrix::GetCol ( UInt_t  ncol) const

get column

Parameters
ncolcol index

Returns a new vector with its own memory

Returns
vec column with index ncol

Definition at line 225 of file QMatrix.cc.

References fMat, QVector::fMathVec, GetNRow(), SetMat(), and QVector::SetMathVector().

◆ GetDiaganol() [1/2]

QVector QMatrix::GetDiaganol ( )

Get the diaganol.

Returned a new vector with its own memory

Definition at line 246 of file QMatrix.cc.

References fData, GetNRow(), MemRowElements(), and QVector.

◆ GetDiaganol() [2/2]

QVector QMatrix::GetDiaganol ( ) const

Get the diaganol.

Returned a new vector with its own memory

Definition at line 250 of file QMatrix.cc.

References GetNCol().

◆ GetElement() [1/2]

double & QMatrix::GetElement ( UInt_t  i,
UInt_t  j 
)
protected

Definition at line 268 of file QMatrix.cc.

References DianaThrow, fData, GetNCol(), GetNRow(), MemRowElements(), QERR_OUT_OF_RANGE, and SetMat().

Referenced by operator()(), and SetElement().

◆ GetElement() [2/2]

const double & QMatrix::GetElement ( UInt_t  i,
UInt_t  j 
) const
protected

Definition at line 280 of file QMatrix.cc.

References DianaThrow, fData, GetNCol(), GetNRow(), MemRowElements(), QERR_OUT_OF_RANGE, and SetMat().

◆ GetNCol()

UInt_t QMatrix::GetNCol ( ) const
inline

◆ GetNRow()

UInt_t QMatrix::GetNRow ( ) const
inline

◆ GetRow() [1/2]

QVector QMatrix::GetRow ( UInt_t  nrow)

get row

Parameters
nrowrow index

Returns a new vector with its own memory

Returns
vec row with index nrow

Definition at line 234 of file QMatrix.cc.

References fData, fNCol, MemRowElements(), and QVector.

Referenced by MTestModule::Done(), and GetRowByColumnIntValue().

◆ GetRow() [2/2]

QVector QMatrix::GetRow ( UInt_t  nrow) const

get row

Parameters
nrowrow index

Returns a new vector with its own memory

Returns
vec row with index nrow

Definition at line 238 of file QMatrix.cc.

References fMat, QVector::fMathVec, GetNCol(), SetMat(), and QVector::SetMathVector().

◆ GetRowByColumnIntValue()

QVector QMatrix::GetRowByColumnIntValue ( UInt_t  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

Parameters
colcolumn index
valvalue to be matched
Returns
QVector Row

Definition at line 258 of file QMatrix.cc.

References GetNRow(), and GetRow().

◆ GetSubMatrix() [1/2]

QMatrix QMatrix::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 495 of file QMatrix.cc.

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

◆ GetSubMatrix() [2/2]

const QMatrix QMatrix::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 506 of file QMatrix.cc.

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

◆ GetSummedAreaMatrix()

QMatrix QMatrix::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 519 of file QMatrix.cc.

References GetNCol(), and GetNRow().

◆ Initialize()

void QMatrix::Initialize ( double  val = 0)

initialize all elements (default to 0)

Parameters
valinitialization value

Definition at line 163 of file QMatrix.cc.

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

◆ Inv()

QMatrix QMatrix::Inv ( ) const

inverse returns a different matrix inverted wrt the original

Returns
the inverse matrix

Definition at line 429 of file QMatrix.cc.

References Invert().

◆ Invert()

const QMatrix & QMatrix::Invert ( )

inverse inverts the matrix itself

Uses an LU decomposition. And requires enough memory for the LU decomposition matrix.

Inverted matrix is stored in same memory location.

Returns
the same matrix inverted

Definition at line 436 of file QMatrix.cc.

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

Referenced by Inv().

◆ MatrixCopy()

Q_BEGIN_NAMESPACE void QMatrix::MatrixCopy ( const double *  orig,
const UInt_t  Nrow,
const UInt_t  Ncol,
double *  dest,
UInt_t  origTda = 0,
UInt_t  destTda = 0 
)
staticprotected

Static method to copy a matrix from one data location to another.

Parameters
origThe location in memory of the original data
Nrow,NcolThe size of the original matrix
destThe memory location of the destination (must be already allocated).
origTda,destTdaThe trailing dimension of the origin/destination matrix. This is the number of memory locations following the last element of each row before the start of the next row. If destTda<Ncol, it defaults to origTda. If origTda<Ncol, it defaults to origNcol.

Definition at line 28 of file QMatrix.cc.

References DianaThrow, and QERR_SIZE_NOT_MATCH.

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

◆ MemRowElements()

UInt_t QMatrix::MemRowElements ( ) const
inlineprotected

Definition at line 451 of file QMatrix.hh.

References fNCol, and fTda.

Referenced by GetCol(), GetDiaganol(), GetElement(), GetRow(), GetSubMatrix(), Initialize(), operator=(), and QMatrix().

◆ Mult()

const QMatrix & QMatrix::Mult ( const QMatrix mat)

Multiply element by element.

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

Keeps memory the same

Parameters
mat
Returns
the same object modified

Definition at line 351 of file QMatrix.cc.

References fMat, and SetMat().

◆ operator()() [1/2]

double& QMatrix::operator() ( UInt_t  i,
UInt_t  j 
)
inline

retrieve an element

Parameters
iith row
jjth col
Returns
element i of the QVector

Definition at line 162 of file QMatrix.hh.

References GetElement().

◆ operator()() [2/2]

const double& QMatrix::operator() ( UInt_t  i,
UInt_t  j 
) const
inline

retrieve an element

version for objects that cannot modify the QMatrix

Parameters
iith row
jjth col
Returns
element i of the QVector

Definition at line 171 of file QMatrix.hh.

References GetElement().

◆ operator*() [1/3]

QMatrix QMatrix::operator* ( const QMatrix mat) const

Matrix product.

Parameters
matright element
Returns
Matrix product

Definition at line 367 of file QMatrix.cc.

◆ operator*() [2/3]

QVector QMatrix::operator* ( const QVector vec) const

matrix-vector product

Parameters
vecright element
Returns
vector

Definition at line 402 of file QMatrix.cc.

References GetCol(), and vec.

◆ operator*() [3/3]

QMatrix QMatrix::operator* ( double  t) const

Multiplication by scalar.

Parameters
tscalar
Returns
scaled matrix

Definition at line 374 of file QMatrix.cc.

◆ operator*=() [1/2]

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

multiplication by another QMatrix

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

Reallocates memory if resizing occurs.

Parameters
other
Returns
the same object modified

Definition at line 316 of file QMatrix.cc.

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

◆ operator*=() [2/2]

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

multiplication by scalar

Keeps memory the same

Parameters
tscaler multiplier
Returns
the same object modified

Definition at line 309 of file QMatrix.cc.

References fMat, and SetMat().

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

◆ operator+()

QMatrix QMatrix::operator+ ( const QMatrix mat) const

sum matrix

Parameters
matright element
Returns
sum matrix

Definition at line 388 of file QMatrix.cc.

◆ operator+=()

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

add a QMatrix

Keeps memory the same

Parameters
mat
Returns
the same object modified

Definition at line 335 of file QMatrix.cc.

References fMat, and SetMat().

◆ operator-() [1/2]

QMatrix QMatrix::operator- ( )

revert sign to all components

Definition at line 304 of file QMatrix.cc.

References operator*=().

◆ operator-() [2/2]

QMatrix QMatrix::operator- ( const QMatrix mat) const

subtract matrix

Parameters
matright element
Returns
matrix

Definition at line 395 of file QMatrix.cc.

◆ operator-=()

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

subtract a QMatrix

Keeps memory the same.

Parameters
mat
Returns
the same object modified

Definition at line 343 of file QMatrix.cc.

References fMat, and SetMat().

◆ operator/()

QMatrix QMatrix::operator/ ( double  t) const

Division by scalar.

Parameters
tscalar
Returns
scaled matrix

Definition at line 381 of file QMatrix.cc.

◆ operator/=()

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

division by scalar

Keeps memory the same.

Parameters
t
Returns
the same object modified

Definition at line 330 of file QMatrix.cc.

References operator*=().

◆ operator=()

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

copy the content of another matrix

Allocates new memory if needed.

Parameters
origQMatrix of origin
Returns
the same object modified

Definition at line 293 of file QMatrix.cc.

References fData, fMat, fSize, GetNCol(), GetNRow(), MatrixCopy(), MemRowElements(), and Resize().

◆ QObjectDef()

QMatrix::QObjectDef ( QMatrix  ,
 
)
private

◆ Resize()

void QMatrix::Resize ( UInt_t  nrow,
UInt_t  ncol 
)

resize a QMatrix

Parameters
nrownew number of rows
ncolnew number of cols
Returns
none

Definition at line 143 of file QMatrix.cc.

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

Referenced by Clear(), operator*=(), operator=(), QMatrix(), and Set().

◆ Set()

void QMatrix::Set ( const std::map< int, int > &  p)

get a QMatrix from a map

Parameters
std::map<int,int>@

Definition at line 205 of file QMatrix.cc.

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

◆ SetCol()

void QMatrix::SetCol ( UInt_t  ncol,
const QVector vec 
)

set column to specific vector

Parameters
ncolcolumn index
vecinitialization vector

Definition at line 179 of file QMatrix.cc.

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

Referenced by LASCIIGlobalReader::GetQObject().

◆ SetElement()

void QMatrix::SetElement ( UInt_t  i,
UInt_t  j,
Double_t  val 
)
inline

Definition at line 408 of file QMatrix.hh.

References GetElement().

◆ SetMat()

void QMatrix::SetMat ( ) const
protected

◆ SetRow()

void QMatrix::SetRow ( UInt_t  nrow,
const QVector vec 
)

set row to specific vectors

Parameters
nrowrow index
vecinitialization vector

Definition at line 192 of file QMatrix.cc.

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

Referenced by QVector::T().

◆ SetToIdentity()

void QMatrix::SetToIdentity ( )

initialize to identity

Definition at line 173 of file QMatrix.cc.

References fMat, and SetMat().

◆ T()

QMatrix QMatrix::T ( ) const

transpose returns a different matrix transposed wrt the original

Returns
transposed matrix

Definition at line 410 of file QMatrix.cc.

References Transpose().

◆ Transpose()

const QMatrix & QMatrix::Transpose ( )

transpose

transposes the matrix itself

If the matrix is the data owner, it will update fNCol and fTda. If the matrix is NOT the data owner, the matrix MUST be square, otherwise it will throw an error.

Returns
the same matrix transposed

Definition at line 417 of file QMatrix.cc.

References DianaThrow, fDataOwner, fMat, fNCol, fTda, GetNCol(), GetNRow(), QERR_SIZE_NOT_MATCH, and SetMat().

Referenced by T().

Friends And Related Function Documentation

◆ QMatrixC

friend class QMatrixC
friend

Definition at line 467 of file QMatrix.hh.

◆ QVector

friend class QVector
friend

Definition at line 466 of file QMatrix.hh.

Referenced by GetCol(), GetDiaganol(), and GetRow().

Member Data Documentation

◆ fAllocSize

UInt_t QMatrix::fAllocSize
private

Definition at line 462 of file QMatrix.hh.

Referenced by Resize(), and ~QMatrix().

◆ fData

Double_t* QMatrix::fData
private

◆ fDataOwner

Bool_t QMatrix::fDataOwner
private

This owns the memory.

Definition at line 456 of file QMatrix.hh.

Referenced by Resize(), Transpose(), and ~QMatrix().

◆ fMat

gsl_matrix* QMatrix::fMat
mutableprivate

◆ fNCol

UInt_t QMatrix::fNCol
private

◆ fSize

UInt_t QMatrix::fSize
private

Definition at line 458 of file QMatrix.hh.

Referenced by GetNRow(), operator=(), QMatrix(), Resize(), and ~QMatrix().

◆ fTda

UInt_t QMatrix::fTda
private

Definition at line 460 of file QMatrix.hh.

Referenced by GetSubMatrix(), MemRowElements(), QMatrix(), Resize(), SetMat(), Transpose(), and ~QMatrix().


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