]>
Commit | Line | Data |
---|---|---|
de34b538 | 1 | #ifndef ALIRECTMATRIX_H |
2 | #define ALIRECTMATRIX_H | |
3 | ||
339fbe23 | 4 | /*********************************************************************************/ |
5 | /* */ | |
6 | /* Class for rectangular matrix used for */ | |
7 | /* millepede2 operation. */ | |
8 | /* Author: ruben.shahoyan@cern.ch */ | |
9 | /* */ | |
10 | /*********************************************************************************/ | |
11 | ||
de34b538 | 12 | #include "TObject.h" |
13 | class TString; | |
14 | ||
15 | class AliRectMatrix : public TObject { | |
16 | // | |
17 | public: | |
18 | AliRectMatrix(); | |
19 | AliRectMatrix(Int_t nrow,Int_t ncol); | |
20 | AliRectMatrix(const AliRectMatrix &src); | |
21 | virtual ~AliRectMatrix(); | |
22 | // | |
23 | Int_t GetNRows() const {return fNRows;} | |
24 | Int_t GetNCols() const {return fNCols;} | |
25 | // | |
26 | Double_t Query(Int_t rown, Int_t coln) const {return operator()(rown,coln);} | |
27 | ||
28 | AliRectMatrix& operator=(const AliRectMatrix& src); | |
29 | Double_t operator()(Int_t rown, Int_t coln) const; | |
30 | Double_t& operator()(Int_t rown, Int_t coln); | |
31 | Double_t* operator()(Int_t row) const {return GetRow(row);} | |
32 | Double_t* GetRow(Int_t row) const {return fRows[row];} | |
33 | // | |
339fbe23 | 34 | void Reset() const; |
de34b538 | 35 | // |
36 | virtual void Print(Option_t* option="") const; | |
37 | // | |
38 | protected: | |
39 | // | |
40 | Int_t fNRows; // Number of rows | |
41 | Int_t fNCols; // Number of columns | |
42 | Double_t **fRows; // pointers on rows | |
43 | // | |
44 | ClassDef(AliRectMatrix,0) //Rectangular Matrix Class | |
45 | }; | |
46 | ||
47 | //___________________________________________________________ | |
48 | inline Double_t AliRectMatrix::operator()(Int_t row, Int_t col) const | |
49 | { | |
50 | return (const Double_t&) GetRow(row)[col]; | |
51 | } | |
52 | ||
53 | //___________________________________________________________ | |
54 | inline Double_t& AliRectMatrix::operator()(Int_t row, Int_t col) | |
55 | { | |
56 | return (Double_t&) fRows[row][col]; | |
57 | } | |
58 | ||
59 | ||
60 | #endif |