Main Page | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals

TDSPMatrix Class Reference

#include <TDSPMatrix.h>

Inheritance diagram for TDSPMatrix:

TDSPVector TDSPSignal TDSPStochasticSignal

Public Member Functions

 TDSPMatrix ()
 TDSPMatrix (Int_t rows, Int_t cols)
 ~TDSPMatrix ()
TComplexSwap (Int_t, Int_t, Int_t, Int_t)
 Swap two elements and return the first indexed (after exchanging!).

void SetSize (Int_t rows, Int_t cols)
UInt_t GetRows () const
UInt_t GetCols () const
void SetRows (UInt_t, Bool_t savedata=kFALSE)
 Set the number of rows in the matrix.

void SetCols (UInt_t, Bool_t savedata=kFALSE)
 Set the number of cols in the matrix.

virtual void SetLen (Int_t num, Bool_t savedata=kFALSE)
Int_t Clo () const
 for later extensions to index ranges

Int_t Chi () const
Int_t Rlo () const
Int_t Rhi () const
TDSPMatrixDup ()
TDSPMatrixCopy (TDSPMatrix *n)
 Copy the Matrix to n (=NULL - create a new Matrix ).

TDSPVectorApply (TDSPVector *, TDSPVector *out=NULL, eMatrixApplyMode m=kMatrixApplyReal)
TDSPVectorRightApply (TDSPVector *, TDSPVector *out=NULL)
 A.RightApply(B,C) : C=A*B.

TDSPMatrixRightApply (TDSPMatrix *, TDSPMatrix *out=NULL)
 A.RightApply(B,C) : C=A*B.

TDSPVectorLeftApply (TDSPVector *, TDSPVector *out=NULL)
 A.LeftApply(B,C) : C=B*A.

TDSPMatrixLeftApply (TDSPMatrix *, TDSPMatrix *out=NULL)
 A.LeftApply(B,C) : C=B*A.

TDSPVectorAdjointRightApply (TDSPVector *, TDSPVector *out=NULL)
 A.AdjointRightApply(B,C) : C=A^* *B.

TDSPMatrixAdjointRightApply (TDSPMatrix *, TDSPMatrix *out=NULL)
 A.AdjointRightApply(B,C) : C=A^* *B.

TDSPVectorAdjointLeftApply (TDSPVector *, TDSPVector *out=NULL)
 A.AdjointLeftApply(B,C) : C=B*A^*.

TDSPMatrixAdjointLeftApply (TDSPMatrix *, TDSPMatrix *out=NULL)
 A.AdjointLeftApply(B,C) : C=B*A^*.

TDSPVectorTransposedRightApply (TDSPVector *, TDSPVector *out=NULL)
 A.TransposedRightApply(B,C) : C=A^T*B.

TDSPVectorTransposedLeftApply (TDSPVector *, TDSPVector *out=NULL)
 A.TransposedRightApply(B,C) : C=A^T*B.

TDSPMatrixTransform (TDSPMatrix *H, TDSPMatrix *result=NULL)
 Transform the Matrix A=this : result=Transform(H)=HAH^*.

TDSPMatrixAdjointTransform (TDSPMatrix *H, TDSPMatrix *result=NULL)
 result=AdjointTransform(H) = H^* A H

TDSPMatrixTransposed (TDSPMatrix *r=NULL)
 Creates the Transposed Matrix into r (r=NULL, create new matrix).

void TransposeMe ()
 Transpose me.

TDSPMatrixAdjoint (TDSPMatrix *r=NULL)
 Creates the Adjoint Matrix into r (r=NULL, create new matrix).

TComplex Trace ()
 returns the trace of the matrix

Double_t Trace2 ()
 returns the sum of abs-squared diagonal-entries of the matrix

Bool_t DiagZero ()
 Test for 1 Zero on the Diagonal.

Bool_t DiagZeros ()
 Test for Zeros on the complete Diagonal.

Bool_t IsDiag ()
 Test for a Diagonal Matrix.

Bool_t IsSquare () const
Bool_t IsHermitian ()
 Test for Hermitian Matrix.

TDSPMatrixReversedColumns (TDSPMatrix *r=NULL)
 return the column-reversed matrix

TDSPMatrixReversedRows (TDSPMatrix *r=NULL)
 return the row-reversed matrix

void ReverseColumns ()
 reverse my columns

void ReverseRows ()
 reverse my rows

TDSPVectorGetDiag (TDSPVector *a=NULL)
 Return the diagonal as a vector.

void SetDiag (TDSPVector *a)
 Set the diagonal to the vector.

void SetDiag (TComplex a)
 Set all diagonal elements to a.

void SetNonDiag (TComplex a)
 Set all non-diagonal elements to a.

void AddDiag (TComplex a)
 Add a onto the diagonal elements of the matrix.

void AddDiag (TDSPVector *a)
 Add the vector onto the diagonal elements of the matrix.

void MultDiag (TComplex a)
 Multiplies a onto the diagonal elements of the matrix.

void MultDiag (TDSPVector *a)
 Multiplies the vector onto the diagonal elements of the matrix.

Double_t Redundancy () const
TDSPMatrixSubMatrix (Int_t atRow, Int_t atCol, Int_t m, Int_t n, TDSPMatrix *out=NULL)
 extracts the mxn submatrix at (atRow,atCol)

TDSPMatrixTransposedSubMatrix (Int_t atRow, Int_t atCol, Int_t m, Int_t n, TDSPMatrix *out=NULL)
 extracts the mxn submatrix at (atRow,atCol) and tranpose it

TComplexMoveVec (Int_t m, Int_t n)
 Move the pointer in the data at (m,n).

TDSPVectorGetColumn (Int_t c=0, TDSPVector *out=NULL)
 extract column "c" to a vector

TDSPVectorGetRow (Int_t r=0, TDSPVector *out=NULL)
 extract row "r" to a vector

void SetColumn (UInt_t c, TDSPVector *in, UInt_t ifrom=0, UInt_t ito=0)
 Set column "c" from a vector content (ifrom:ito).

void SetRow (UInt_t r, TDSPVector *in, UInt_t ifrom=0, UInt_t ito=0)
 Set row "r" from a vector content (ifrom:ito).

void RowConvolute (TComplex *inp, TComplex *out, Int_t N=0, Bool_t cyclic=kTRUE)
 Low-Level-RowConvolution of inp to out by this maximal N elements (cyclic?).

TDSPVectorRowConvolute (TDSPVector *inp, TDSPVector *out=NULL, Bool_t cyclic=kTRUE, Bool_t zerosbefore=kTRUE)
 Convolutes "inp" with the rows of "this" to "out".

TH2 * Draw (Option_t *option="hist surf4", Double_t dx=1, Double_t xoff=0, Double_t dy=1, Double_t yoff=0, TH2 *h=NULL)
void SetZTitle (char *name)
 Set the name of the ztitle.

void FFTShiftMe (Int_t dim)
 Rearrange rows(dim=1) cols(dim=2) after an fft operation.

TDSPMatrixoperator= (TDSPMatrix &x)
 some operators

void Print ()
void Input ()
void Unit (TComplex diag=1.0)
void Delta (TComplex diag=1.0)
 Unit/Kronecker-Delta Matrix.

void Fourier ()
 Init the Matrix with a Fourier-Matrix.

void Hilbert ()
 Init the Matrix with a Hilbert-Matrix.

TComplexElement (Int_t i, Int_t j)
TComplexoperator() (UInt_t row, UInt_t col)
void LUDecompose (TArrayI &Index, Int_t &d)
void LUBacksubst (TArrayI &Index, TDSPVector &B)
void LUBacksubst (TArrayI &Index, TDSPMatrix &B)
void LUSolveLinear (TDSPVector &B)
 Solve the linear equation system A*x=b, The result x overwrites b, (this) is destroyed !!

void LUSolveLinear (TDSPMatrix &B)
 Solve the linear equation system (this) * X = B, X = A.Inverse * B is returned in B,(this) is destroyed !!

TDSPMatrixInverse (TDSPMatrix *result=NULL)
 Inverse Matrix.

TComplex Det ()
 Determinant.

TDSPMatrixPseudoInverse (TDSPMatrix *result=NULL)
TDSPVectorSVD (TDSPVector *S=NULL, TDSPMatrix *U=NULL, TDSPMatrix *VStar=NULL)
 does USV^* = (this) - the svd of this matrix


Protected Attributes

UInt_t fRows
 Number of Rows of the Matrix.

UInt_t fCols
 Number of Columns of the Matrix.


Friends

istream & operator>> (istream &, TDSPMatrix &)
ostream & operator<< (ostream &, TDSPMatrix &)
istream & operator>> (istream &, TDSPMatrix *)
ostream & operator<< (ostream &, TDSPMatrix *)

Constructor & Destructor Documentation

TDSPMatrix::TDSPMatrix  ) 
 

Referenced by Adjoint(), Copy(), and Transposed().

TDSPMatrix::TDSPMatrix Int_t  rows,
Int_t  cols
 

TDSPMatrix::~TDSPMatrix  ) 
 


Member Function Documentation

void TDSPMatrix::AddDiag TDSPVector a  ) 
 

Add the vector onto the diagonal elements of the matrix.

void TDSPMatrix::AddDiag TComplex  a  ) 
 

Add a onto the diagonal elements of the matrix.

TDSPMatrix * TDSPMatrix::Adjoint TDSPMatrix r = NULL  )  [inline]
 

Creates the Adjoint Matrix into r (r=NULL, create new matrix).

cols/rows switched !!

Definition at line 317 of file TDSPMatrix.h.

References Element(), fCols, TComplex::fIm, TComplex::fRe, fRows, and TDSPMatrix().

00317                                                     {
00318   
00319   if (!r) r=new TDSPMatrix(fCols,fRows); 
00320 
00321   for(register UInt_t i=0;i<fRows;++i)
00322     for(register UInt_t j=0;j<fCols;++j) {
00323       r->Element(j,i).fRe = Element(i,j).fRe;
00324       r->Element(j,i).fIm = -Element(i,j).fIm;
00325     }
00326 
00327   return r;
00328 
00329 }

TDSPMatrix* TDSPMatrix::AdjointLeftApply TDSPMatrix ,
TDSPMatrix out = NULL
 

A.AdjointLeftApply(B,C) : C=B*A^*.

TDSPVector* TDSPMatrix::AdjointLeftApply TDSPVector ,
TDSPVector out = NULL
 

A.AdjointLeftApply(B,C) : C=B*A^*.

Referenced by Transform().

TDSPMatrix* TDSPMatrix::AdjointRightApply TDSPMatrix ,
TDSPMatrix out = NULL
 

A.AdjointRightApply(B,C) : C=A^* *B.

TDSPVector* TDSPMatrix::AdjointRightApply TDSPVector ,
TDSPVector out = NULL
 

A.AdjointRightApply(B,C) : C=A^* *B.

Referenced by AdjointTransform(), and Apply().

TDSPMatrix * TDSPMatrix::AdjointTransform TDSPMatrix H,
TDSPMatrix result = NULL
[inline]
 

result=AdjointTransform(H) = H^* A H

This we will optimize later on

Definition at line 231 of file TDSPMatrix.h.

References AdjointRightApply(), and LeftApply().

Referenced by AdjointTransform().

00231                                                                                  {
00233   
00234   TDSPMatrix* b = H->AdjointRightApply(this);
00235   result = H->LeftApply(b,result);
00236   delete b;
00237   return result;
00238 
00239 }

TDSPVector * TDSPMatrix::Apply TDSPVector ,
TDSPVector out = NULL,
eMatrixApplyMode  m = kMatrixApplyReal
[inline]
 

Definition at line 200 of file TDSPMatrix.h.

References AdjointRightApply(), kMatrixApplyConjA, kMatrixApplyConjAB, kMatrixApplyConjB, kMatrixApplyReal, and RightApply().

00200                                                                                          {
00201   switch(m) {
00202   case kMatrixApplyReal :
00203     return RightApply(inp,out);
00204   case kMatrixApplyConjA :
00205     return AdjointRightApply(inp,out);
00206   case kMatrixApplyConjB :
00207     Error("Apply","error");
00208     return NULL;
00209   case  kMatrixApplyConjAB :
00210     Error("Apply","error");
00211     return NULL;
00212   }
00213   return NULL;
00214 }

Int_t TDSPMatrix::Chi  )  const [inline]
 

Definition at line 75 of file TDSPMatrix.h.

References fCols.

00075 { return fCols-1;};

Int_t TDSPMatrix::Clo  )  const [inline]
 

for later extensions to index ranges

Definition at line 74 of file TDSPMatrix.h.

00074 { return 0;};

TDSPMatrix * TDSPMatrix::Copy TDSPMatrix n  )  [inline]
 

Copy the Matrix to n (=NULL - create a new Matrix ).

Definition at line 358 of file TDSPMatrix.h.

References fCols, fRows, TDSPVector::fVec, TDSPVector::GetVec(), TDSPVector::Num, SetSize(), and TDSPMatrix().

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

00358                                                       {
00359   
00360   if (!output) output = new TDSPMatrix();
00361   output->SetSize(fRows,fCols);
00362 
00363   TComplex *ovec = output->GetVec();
00364 
00365   for(register Int_t i=0;i<Num;++i)  
00366     ovec[i] = fVec[i];
00367 
00368   return output;  
00369 }

void TDSPMatrix::Delta TComplex  diag = 1.0  ) 
 

Unit/Kronecker-Delta Matrix.

Referenced by Unit().

TComplex TDSPMatrix::Det  ) 
 

Determinant.

Referenced by Det().

Bool_t TDSPMatrix::DiagZero  )  [inline]
 

Test for 1 Zero on the Diagonal.

Definition at line 261 of file TDSPMatrix.h.

References Element(), fRows, and IsSquare().

00261                                    {
00262   if (!IsSquare()) return kTRUE;
00263   for(register UInt_t i=0;i<fRows; ++i) 
00264     if (Element(i,i)==0.0) return kTRUE;
00265   return kFALSE;
00266 }

Bool_t TDSPMatrix::DiagZeros  )  [inline]
 

Test for Zeros on the complete Diagonal.

Definition at line 268 of file TDSPMatrix.h.

References Element(), fCols, and fRows.

00268                                     {
00269   Int_t min=TMath::Min(fRows,fCols);
00270   for(register Int_t i=0;i<min; ++i) 
00271     if (Element(i,i)!=0.0) return kFALSE;
00272   return kTRUE;
00273 }

TH2* TDSPMatrix::Draw Option_t *  option = "hist surf4",
Double_t  dx = 1,
Double_t  xoff = 0,
Double_t  dy = 1,
Double_t  yoff = 0,
TH2 *  h = NULL
 

TDSPMatrix* TDSPMatrix::Dup  )  [inline]
 

Reimplemented from TDSPVector.

Definition at line 80 of file TDSPMatrix.h.

References Copy().

00080 { return Copy(NULL);};                

TComplex& TDSPMatrix::Element Int_t  i,
Int_t  j
[inline]
 

Definition at line 169 of file TDSPMatrix.h.

References fCols, and TDSPVector::fVec.

Referenced by Adjoint(), DiagZero(), DiagZeros(), GetDiag(), IsDiag(), operator()(), and Transposed().

00169 { return fVec[i*fCols+j];};

void TDSPMatrix::FFTShiftMe Int_t  dim  ) 
 

Rearrange rows(dim=1) cols(dim=2) after an fft operation.

void TDSPMatrix::Fourier  ) 
 

Init the Matrix with a Fourier-Matrix.

UInt_t TDSPMatrix::GetCols  )  const [inline]
 

Definition at line 68 of file TDSPMatrix.h.

References fCols.

Referenced by TDSPLinearSolver::GetNumInputs().

00068 { return fCols; }; 

TDSPVector* TDSPMatrix::GetColumn Int_t  c = 0,
TDSPVector out = NULL
 

extract column "c" to a vector

TDSPVector * TDSPMatrix::GetDiag TDSPVector a = NULL  )  [inline]
 

Return the diagonal as a vector.

Definition at line 282 of file TDSPMatrix.h.

References Element(), TDSPVector::Element(), fCols, fRows, TDSPVector::SetLen(), and TDSPVector::TDSPVector().

00282                                                     {
00283   Int_t m=TMath::Min(fRows,fCols);
00284   if (!a) a=new TDSPVector();
00285   a->SetLen(m);
00286   for(register Int_t i=0;i<m;++i)
00287     a->Element(i)=Element(i,i);
00288   return a;
00289 }

TDSPVector* TDSPMatrix::GetRow Int_t  r = 0,
TDSPVector out = NULL
 

extract row "r" to a vector

UInt_t TDSPMatrix::GetRows  )  const [inline]
 

Definition at line 67 of file TDSPMatrix.h.

References fRows.

Referenced by TDSPLinearSolver::GetNumOutputs().

00067 { return fRows; }; 

void TDSPMatrix::Hilbert  ) 
 

Init the Matrix with a Hilbert-Matrix.

void TDSPMatrix::Input  ) 
 

Reimplemented from TDSPVector.

TDSPMatrix* TDSPMatrix::Inverse TDSPMatrix result = NULL  ) 
 

Inverse Matrix.

Bool_t TDSPMatrix::IsDiag  )  [inline]
 

Test for a Diagonal Matrix.

Definition at line 275 of file TDSPMatrix.h.

References Element(), fCols, and fRows.

Referenced by IsDiag().

00275                                  {
00276   for(register UInt_t i=0;i<fRows;++i)
00277     for(register UInt_t j=0;j<fCols;++j)
00278       if ((i!=j)&&(Element(i,j)!=0.0)) return kFALSE;
00279   return kTRUE;
00280 }

Bool_t TDSPMatrix::IsHermitian  ) 
 

Test for Hermitian Matrix.

Bool_t TDSPMatrix::IsSquare  )  const [inline]
 

Definition at line 107 of file TDSPMatrix.h.

References fCols, and fRows.

Referenced by DiagZero().

00107 { return fRows==fCols;}; 

TDSPMatrix * TDSPMatrix::LeftApply TDSPMatrix ,
TDSPMatrix out = NULL
[inline]
 

A.LeftApply(B,C) : C=B*A.

Definition at line 241 of file TDSPMatrix.h.

References RightApply().

00241                                                                           {
00242   return inp->RightApply(this,out);
00243 }

TDSPVector* TDSPMatrix::LeftApply TDSPVector ,
TDSPVector out = NULL
 

A.LeftApply(B,C) : C=B*A.

Referenced by AdjointTransform(), and Transform().

void TDSPMatrix::LUBacksubst TArrayI &  Index,
TDSPMatrix B
 

void TDSPMatrix::LUBacksubst TArrayI &  Index,
TDSPVector B
 

void TDSPMatrix::LUDecompose TArrayI &  Index,
Int_t &  d
 

void TDSPMatrix::LUSolveLinear TDSPMatrix B  ) 
 

Solve the linear equation system (this) * X = B, X = A.Inverse * B is returned in B,(this) is destroyed !!

void TDSPMatrix::LUSolveLinear TDSPVector B  ) 
 

Solve the linear equation system A*x=b, The result x overwrites b, (this) is destroyed !!

TComplex* TDSPMatrix::MoveVec Int_t  m,
Int_t  n
 

Move the pointer in the data at (m,n).

void TDSPMatrix::MultDiag TDSPVector a  ) 
 

Multiplies the vector onto the diagonal elements of the matrix.

void TDSPMatrix::MultDiag TComplex  a  ) 
 

Multiplies a onto the diagonal elements of the matrix.

TComplex & TDSPMatrix::operator() UInt_t  row,
UInt_t  col
[inline]
 

Definition at line 250 of file TDSPMatrix.h.

References ComplexZero, Element(), fCols, fRows, and TDSPVector::fVec.

00250                                                               {
00251   if (fVec) {
00252     if ((row<fRows)&&(row>=0)&&(col<fCols)&&(col>=0))
00253       return Element(row,col);
00254     else 
00255       Error("operator()","index (%d,%d) out of bounds (%d..%d,%d..%d)",row,col,0,fRows-1,0,fCols-1);
00256   } else 
00257     Error("operator()","matrix not allocated (this->fVec=0x0)!");
00258   return ComplexZero;
00259 }

TDSPMatrix& TDSPMatrix::operator= TDSPMatrix x  )  [inline]
 

some operators

Definition at line 161 of file TDSPMatrix.h.

References Copy().

00161 { x.Copy(this);return *this;};

void TDSPMatrix::Print  ) 
 

TDSPMatrix* TDSPMatrix::PseudoInverse TDSPMatrix result = NULL  ) 
 

Double_t TDSPMatrix::Redundancy  )  const [inline]
 

Definition at line 124 of file TDSPMatrix.h.

References fCols, and fRows.

00124 { return ((Double_t)fRows)/((Double_t)fCols); };

void TDSPMatrix::ReverseColumns  ) 
 

reverse my columns

TDSPMatrix* TDSPMatrix::ReversedColumns TDSPMatrix r = NULL  ) 
 

return the column-reversed matrix

TDSPMatrix* TDSPMatrix::ReversedRows TDSPMatrix r = NULL  ) 
 

return the row-reversed matrix

void TDSPMatrix::ReverseRows  ) 
 

reverse my rows

Int_t TDSPMatrix::Rhi  )  const [inline]
 

Definition at line 78 of file TDSPMatrix.h.

References fRows.

00078 { return fRows-1;};  

TDSPMatrix* TDSPMatrix::RightApply TDSPMatrix ,
TDSPMatrix out = NULL
 

A.RightApply(B,C) : C=A*B.

TDSPVector* TDSPMatrix::RightApply TDSPVector ,
TDSPVector out = NULL
 

A.RightApply(B,C) : C=A*B.

Referenced by Apply(), TDSPLmmse::Estimate(), and LeftApply().

Int_t TDSPMatrix::Rlo  )  const [inline]
 

Definition at line 77 of file TDSPMatrix.h.

00077 { return 0;};

TDSPVector* TDSPMatrix::RowConvolute TDSPVector inp,
TDSPVector out = NULL,
Bool_t  cyclic = kTRUE,
Bool_t  zerosbefore = kTRUE
 

Convolutes "inp" with the rows of "this" to "out".

void TDSPMatrix::RowConvolute TComplex inp,
TComplex out,
Int_t  N = 0,
Bool_t  cyclic = kTRUE
 

Low-Level-RowConvolution of inp to out by this maximal N elements (cyclic?).

void TDSPMatrix::SetCols UInt_t  ,
Bool_t  savedata = kFALSE
 

Set the number of cols in the matrix.

void TDSPMatrix::SetColumn UInt_t  c,
TDSPVector in,
UInt_t  ifrom = 0,
UInt_t  ito = 0
 

Set column "c" from a vector content (ifrom:ito).

void TDSPMatrix::SetDiag TComplex  a  ) 
 

Set all diagonal elements to a.

void TDSPMatrix::SetDiag TDSPVector a  ) 
 

Set the diagonal to the vector.

virtual void TDSPMatrix::SetLen Int_t  num,
Bool_t  savedata = kFALSE
[virtual]
 

Set the size

Reimplemented from TDSPVector.

Referenced by TDSPFunction::Apply(), TDSPStochasticSignal::ChangeRepresentation(), TDSPHarmonicGenerator::SetSignalLength(), TDSPChop::SetSignalLength(), and TDSPOutput1::Update().

void TDSPMatrix::SetNonDiag TComplex  a  ) 
 

Set all non-diagonal elements to a.

void TDSPMatrix::SetRow UInt_t  r,
TDSPVector in,
UInt_t  ifrom = 0,
UInt_t  ito = 0
 

Set row "r" from a vector content (ifrom:ito).

void TDSPMatrix::SetRows UInt_t  ,
Bool_t  savedata = kFALSE
 

Set the number of rows in the matrix.

void TDSPMatrix::SetSize Int_t  rows,
Int_t  cols
 

Referenced by Copy(), and Transposed().

void TDSPMatrix::SetZTitle char *  name  ) 
 

Set the name of the ztitle.

TDSPMatrix* TDSPMatrix::SubMatrix Int_t  atRow,
Int_t  atCol,
Int_t  m,
Int_t  n,
TDSPMatrix out = NULL
 

extracts the mxn submatrix at (atRow,atCol)

TDSPVector* TDSPMatrix::SVD TDSPVector S = NULL,
TDSPMatrix U = NULL,
TDSPMatrix VStar = NULL
 

does USV^* = (this) - the svd of this matrix

TComplex & TDSPMatrix::Swap Int_t  ,
Int_t  ,
Int_t  ,
Int_t 
[inline]
 

Swap two elements and return the first indexed (after exchanging!).

Definition at line 373 of file TDSPMatrix.h.

References fCols, fRows, and TDSPVector::fVec.

Referenced by TransposeMe().

00373                                                                     {
00374 #ifdef LINALG_MAT_ROWWISE
00375   UInt_t    l1=i*fCols+j;
00376   UInt_t    l2=m*fCols+n;
00377 #else
00378   UInt_t    l1=j*fRows+i;
00379   UInt_t    l2=n*fRows+m;
00380 #endif
00381   TComplex tmp=fVec[l1];
00382   fVec[l1] = fVec[l2];
00383   fVec[l2] = tmp;
00384   return fVec[l2];
00385 }

TComplex TDSPMatrix::Trace  ) 
 

returns the trace of the matrix

Double_t TDSPMatrix::Trace2  ) 
 

returns the sum of abs-squared diagonal-entries of the matrix

TDSPMatrix * TDSPMatrix::Transform TDSPMatrix H,
TDSPMatrix result = NULL
[inline]
 

Transform the Matrix A=this : result=Transform(H)=HAH^*.

This we will optimize later on

Definition at line 218 of file TDSPMatrix.h.

References AdjointLeftApply(), and LeftApply().

Referenced by Transform().

00218                                                                           {
00220   
00221   TDSPMatrix* b = LeftApply(H);
00222   result=H->AdjointLeftApply(b,result);
00223   delete b;
00224   
00225   return result;
00226 
00227 }

TDSPMatrix * TDSPMatrix::Transposed TDSPMatrix r = NULL  )  [inline]
 

Creates the Transposed Matrix into r (r=NULL, create new matrix).

cols/rows switched !!

Definition at line 292 of file TDSPMatrix.h.

References Element(), fCols, fRows, SetSize(), and TDSPMatrix().

00292                                                        {
00293   
00294   if (r==this) { 
00295     Error("Transposed","Can not be the same matrix - use TDSPMatrix::TransposeMe() !");
00296     return NULL;
00297   }
00298 
00299   if (!r) r=new TDSPMatrix(); 
00300   r->SetSize(fCols,fRows);
00301   for(register UInt_t i=0;i<fRows;++i)
00302     for(register UInt_t j=0;j<fCols;++j)
00303       r->Element(j,i)=Element(i,j);
00304   return r;
00305 
00306 }

TDSPVector* TDSPMatrix::TransposedLeftApply TDSPVector ,
TDSPVector out = NULL
 

A.TransposedRightApply(B,C) : C=A^T*B.

TDSPVector* TDSPMatrix::TransposedRightApply TDSPVector ,
TDSPVector out = NULL
 

A.TransposedRightApply(B,C) : C=A^T*B.

TDSPMatrix* TDSPMatrix::TransposedSubMatrix Int_t  atRow,
Int_t  atCol,
Int_t  m,
Int_t  n,
TDSPMatrix out = NULL
 

extracts the mxn submatrix at (atRow,atCol) and tranpose it

void TDSPMatrix::TransposeMe  )  [inline]
 

Transpose me.

Definition at line 308 of file TDSPMatrix.h.

References fCols, fRows, and Swap().

00308                                     {
00309   if (fCols!=fRows) 
00310     Error("TransposeMe","non square matrix - use TDSPMatrix::Transposed()!");
00311   else
00312     for(register UInt_t i=0;    i<fRows;++i)
00313       for(register UInt_t j=i+1;j<fCols;++j)
00314     Swap(j,i,i,j);
00315 }

void TDSPMatrix::Unit TComplex  diag = 1.0  )  [inline]
 

Definition at line 164 of file TDSPMatrix.h.

References Delta().

00164 { Delta(diag);}; 


Friends And Related Function Documentation

ostream& operator<< ostream &  ,
TDSPMatrix
[friend]
 

ostream& operator<< ostream &  ,
TDSPMatrix
[friend]
 

istream& operator>> istream &  ,
TDSPMatrix
[friend]
 

istream& operator>> istream &  ,
TDSPMatrix
[friend]
 


Field Documentation

UInt_t TDSPMatrix::fCols [protected]
 

Number of Columns of the Matrix.

Definition at line 51 of file TDSPMatrix.h.

Referenced by Adjoint(), Chi(), Copy(), DiagZeros(), Element(), GetCols(), GetDiag(), IsDiag(), IsSquare(), operator()(), Redundancy(), Swap(), Transposed(), and TransposeMe().

UInt_t TDSPMatrix::fRows [protected]
 

Number of Rows of the Matrix.

Definition at line 50 of file TDSPMatrix.h.

Referenced by Adjoint(), Copy(), DiagZero(), DiagZeros(), GetDiag(), GetRows(), IsDiag(), IsSquare(), operator()(), Redundancy(), Rhi(), Swap(), Transposed(), and TransposeMe().


The documentation for this class was generated from the following file:
Generated on Fri Apr 23 16:24:01 2004 by doxygen 1.3.2