#include <TDSPMatrix.h>
Inheritance diagram for TDSPMatrix:

Public Member Functions | |
| TDSPMatrix () | |
| TDSPMatrix (Int_t rows, Int_t cols) | |
| ~TDSPMatrix () | |
| TComplex & | Swap (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 |
| TDSPMatrix * | Dup () |
| TDSPMatrix * | Copy (TDSPMatrix *n) |
| Copy the Matrix to n (=NULL - create a new Matrix ). | |
| TDSPVector * | Apply (TDSPVector *, TDSPVector *out=NULL, eMatrixApplyMode m=kMatrixApplyReal) |
| TDSPVector * | RightApply (TDSPVector *, TDSPVector *out=NULL) |
| A.RightApply(B,C) : C=A*B. | |
| TDSPMatrix * | RightApply (TDSPMatrix *, TDSPMatrix *out=NULL) |
| A.RightApply(B,C) : C=A*B. | |
| TDSPVector * | LeftApply (TDSPVector *, TDSPVector *out=NULL) |
| A.LeftApply(B,C) : C=B*A. | |
| TDSPMatrix * | LeftApply (TDSPMatrix *, TDSPMatrix *out=NULL) |
| A.LeftApply(B,C) : C=B*A. | |
| TDSPVector * | AdjointRightApply (TDSPVector *, TDSPVector *out=NULL) |
| A.AdjointRightApply(B,C) : C=A^* *B. | |
| TDSPMatrix * | AdjointRightApply (TDSPMatrix *, TDSPMatrix *out=NULL) |
| A.AdjointRightApply(B,C) : C=A^* *B. | |
| TDSPVector * | AdjointLeftApply (TDSPVector *, TDSPVector *out=NULL) |
| A.AdjointLeftApply(B,C) : C=B*A^*. | |
| TDSPMatrix * | AdjointLeftApply (TDSPMatrix *, TDSPMatrix *out=NULL) |
| A.AdjointLeftApply(B,C) : C=B*A^*. | |
| TDSPVector * | TransposedRightApply (TDSPVector *, TDSPVector *out=NULL) |
| A.TransposedRightApply(B,C) : C=A^T*B. | |
| TDSPVector * | TransposedLeftApply (TDSPVector *, TDSPVector *out=NULL) |
| A.TransposedRightApply(B,C) : C=A^T*B. | |
| TDSPMatrix * | Transform (TDSPMatrix *H, TDSPMatrix *result=NULL) |
| Transform the Matrix A=this : result=Transform(H)=HAH^*. | |
| TDSPMatrix * | AdjointTransform (TDSPMatrix *H, TDSPMatrix *result=NULL) |
| result=AdjointTransform(H) = H^* A H | |
| TDSPMatrix * | Transposed (TDSPMatrix *r=NULL) |
| Creates the Transposed Matrix into r (r=NULL, create new matrix). | |
| void | TransposeMe () |
| Transpose me. | |
| TDSPMatrix * | Adjoint (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. | |
| TDSPMatrix * | ReversedColumns (TDSPMatrix *r=NULL) |
| return the column-reversed matrix | |
| TDSPMatrix * | ReversedRows (TDSPMatrix *r=NULL) |
| return the row-reversed matrix | |
| void | ReverseColumns () |
| reverse my columns | |
| void | ReverseRows () |
| reverse my rows | |
| TDSPVector * | GetDiag (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 |
| TDSPMatrix * | SubMatrix (Int_t atRow, Int_t atCol, Int_t m, Int_t n, TDSPMatrix *out=NULL) |
| extracts the mxn submatrix at (atRow,atCol) | |
| 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 | |
| TComplex * | MoveVec (Int_t m, Int_t n) |
| Move the pointer in the data at (m,n). | |
| TDSPVector * | GetColumn (Int_t c=0, TDSPVector *out=NULL) |
| extract column "c" to a vector | |
| TDSPVector * | GetRow (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?). | |
| TDSPVector * | RowConvolute (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. | |
| TDSPMatrix & | operator= (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. | |
| TComplex & | Element (Int_t i, Int_t j) |
| TComplex & | operator() (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 !! | |
| TDSPMatrix * | Inverse (TDSPMatrix *result=NULL) |
| Inverse Matrix. | |
| TComplex | Det () |
| Determinant. | |
| TDSPMatrix * | PseudoInverse (TDSPMatrix *result=NULL) |
| TDSPVector * | SVD (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 *) |
|
|
Referenced by Adjoint(), Copy(), and Transposed(). |
|
||||||||||||
|
|
|
|
|
|
|
Add the vector onto the diagonal elements of the matrix.
|
|
|
Add a onto the diagonal elements of the matrix.
|
|
|
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().
|
|
||||||||||||
|
A.AdjointLeftApply(B,C) : C=B*A^*.
|
|
||||||||||||
|
A.AdjointLeftApply(B,C) : C=B*A^*.
Referenced by Transform(). |
|
||||||||||||
|
A.AdjointRightApply(B,C) : C=A^* *B.
|
|
||||||||||||
|
A.AdjointRightApply(B,C) : C=A^* *B.
Referenced by AdjointTransform(), and Apply(). |
|
||||||||||||
|
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 }
|
|
||||||||||||||||
|
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 }
|
|
|
Definition at line 75 of file TDSPMatrix.h. References fCols.
00075 { return fCols-1;};
|
|
|
for later extensions to index ranges
Definition at line 74 of file TDSPMatrix.h.
00074 { return 0;};
|
|
|
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=().
|
|
|
Unit/Kronecker-Delta Matrix.
Referenced by Unit(). |
|
|
Determinant.
Referenced by Det(). |
|
|
Test for 1 Zero on the Diagonal.
Definition at line 261 of file TDSPMatrix.h. References Element(), fRows, and IsSquare().
|
|
|
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 }
|
|
||||||||||||||||||||||||||||
|
|
|
|
Reimplemented from TDSPVector. Definition at line 80 of file TDSPMatrix.h. References Copy().
00080 { return Copy(NULL);};
|
|
||||||||||||
|
Definition at line 169 of file TDSPMatrix.h. References fCols, and TDSPVector::fVec. Referenced by Adjoint(), DiagZero(), DiagZeros(), GetDiag(), IsDiag(), operator()(), and Transposed().
|
|
|
Rearrange rows(dim=1) cols(dim=2) after an fft operation.
|
|
|
Init the Matrix with a Fourier-Matrix.
|
|
|
Definition at line 68 of file TDSPMatrix.h. References fCols. Referenced by TDSPLinearSolver::GetNumInputs().
00068 { return fCols; };
|
|
||||||||||||
|
extract column "c" to a vector
|
|
|
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 }
|
|
||||||||||||
|
extract row "r" to a vector
|
|
|
Definition at line 67 of file TDSPMatrix.h. References fRows. Referenced by TDSPLinearSolver::GetNumOutputs().
00067 { return fRows; };
|
|
|
Init the Matrix with a Hilbert-Matrix.
|
|
|
Reimplemented from TDSPVector. |
|
|
Inverse Matrix.
|
|
|
Test for a Diagonal Matrix.
Definition at line 275 of file TDSPMatrix.h. References Element(), fCols, and fRows. Referenced by IsDiag().
|
|
|
Test for Hermitian Matrix.
|
|
|
Definition at line 107 of file TDSPMatrix.h. Referenced by DiagZero().
|
|
||||||||||||
|
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 }
|
|
||||||||||||
|
A.LeftApply(B,C) : C=B*A.
Referenced by AdjointTransform(), and Transform(). |
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
|
Solve the linear equation system (this) * X = B, X = A.Inverse * B is returned in B,(this) is destroyed !!
|
|
|
Solve the linear equation system A*x=b, The result x overwrites b, (this) is destroyed !!
|
|
||||||||||||
|
Move the pointer in the data at (m,n).
|
|
|
Multiplies the vector onto the diagonal elements of the matrix.
|
|
|
Multiplies a onto the diagonal elements of the matrix.
|
|
||||||||||||
|
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 }
|
|
|
some operators
Definition at line 161 of file TDSPMatrix.h. References Copy().
00161 { x.Copy(this);return *this;};
|
|
|
|
|
|
|
|
|
Definition at line 124 of file TDSPMatrix.h.
|
|
|
reverse my columns
|
|
|
return the column-reversed matrix
|
|
|
return the row-reversed matrix
|
|
|
reverse my rows
|
|
|
Definition at line 78 of file TDSPMatrix.h. References fRows.
00078 { return fRows-1;};
|
|
||||||||||||
|
A.RightApply(B,C) : C=A*B.
|
|
||||||||||||
|
A.RightApply(B,C) : C=A*B.
Referenced by Apply(), TDSPLmmse::Estimate(), and LeftApply(). |
|
|
Definition at line 77 of file TDSPMatrix.h.
00077 { return 0;};
|
|
||||||||||||||||||||
|
Convolutes "inp" with the rows of "this" to "out".
|
|
||||||||||||||||||||
|
Low-Level-RowConvolution of inp to out by this maximal N elements (cyclic?).
|
|
||||||||||||
|
Set the number of cols in the matrix.
|
|
||||||||||||||||||||
|
Set column "c" from a vector content (ifrom:ito).
|
|
|
Set all diagonal elements to a.
|
|
|
Set the diagonal to the vector.
|
|
||||||||||||
|
Set the size Reimplemented from TDSPVector. Referenced by TDSPFunction::Apply(), TDSPStochasticSignal::ChangeRepresentation(), TDSPHarmonicGenerator::SetSignalLength(), TDSPChop::SetSignalLength(), and TDSPOutput1::Update(). |
|
|
Set all non-diagonal elements to a.
|
|
||||||||||||||||||||
|
Set row "r" from a vector content (ifrom:ito).
|
|
||||||||||||
|
Set the number of rows in the matrix.
|
|
||||||||||||
|
Referenced by Copy(), and Transposed(). |
|
|
Set the name of the ztitle.
|
|
||||||||||||||||||||||||
|
extracts the mxn submatrix at (atRow,atCol)
|
|
||||||||||||||||
|
does USV^* = (this) - the svd of this matrix
|
|
||||||||||||||||||||
|
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().
|
|
|
returns the trace of the matrix
|
|
|
returns the sum of abs-squared diagonal-entries of the matrix
|
|
||||||||||||
|
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 }
|
|
|
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 }
|
|
||||||||||||
|
A.TransposedRightApply(B,C) : C=A^T*B.
|
|
||||||||||||
|
A.TransposedRightApply(B,C) : C=A^T*B.
|
|
||||||||||||||||||||||||
|
extracts the mxn submatrix at (atRow,atCol) and tranpose it
|
|
|
Transpose me.
Definition at line 308 of file TDSPMatrix.h. References fCols, fRows, and Swap().
|
|
|
Definition at line 164 of file TDSPMatrix.h. References Delta().
00164 { Delta(diag);};
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
||||||||||||
|
|
|
|
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(). |
|
|
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(). |
1.3.2