Logo ROOT   6.16/01
Reference Guide
TMatrixTLazy.h
Go to the documentation of this file.
1// @(#)root/matrix:$Id$
2// Authors: Fons Rademakers, Eddy Offermann Nov 2003
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOT_TMatrixTLazy
13#define ROOT_TMatrixTLazy
14
15//////////////////////////////////////////////////////////////////////////
16// //
17// Templates of Lazy Matrix classes. //
18// //
19// TMatrixTLazy //
20// TMatrixTSymLazy //
21// THaarMatrixT //
22// THilbertMatrixT //
23// THilbertMatrixTSym //
24// //
25//////////////////////////////////////////////////////////////////////////
26
27#include "TMatrixTBase.h"
28
29template<class Element> class TVectorT;
30template<class Element> class TMatrixTBase;
31template<class Element> class TMatrixT;
32template<class Element> class TMatrixTSym;
33
34//////////////////////////////////////////////////////////////////////////
35// //
36// TMatrixTLazy //
37// //
38// Class used to make a lazy copy of a matrix, i.e. only copy matrix //
39// when really needed (when accessed). //
40// //
41//////////////////////////////////////////////////////////////////////////
42
43template<class Element> class TMatrixTLazy : public TObject {
44
45friend class TMatrixTBase<Element>;
46friend class TMatrixT <Element>;
47friend class TVectorT <Element>;
48
49protected:
54
57
58private:
59 virtual void FillIn(TMatrixT<Element> &m) const = 0;
60
61public:
63 TMatrixTLazy(Int_t nrows, Int_t ncols)
64 : fRowUpb(nrows-1),fRowLwb(0),fColUpb(ncols-1),fColLwb(0) { }
65 TMatrixTLazy(Int_t row_lwb,Int_t row_upb,Int_t col_lwb,Int_t col_upb)
66 : fRowUpb(row_upb),fRowLwb(row_lwb),fColUpb(col_upb),fColLwb(col_lwb) { }
67 virtual ~TMatrixTLazy() {}
68
69 inline Int_t GetRowLwb() const { return fRowLwb; }
70 inline Int_t GetRowUpb() const { return fRowUpb; }
71 inline Int_t GetColLwb() const { return fColLwb; }
72 inline Int_t GetColUpb() const { return fColUpb; }
73
74 ClassDef(TMatrixTLazy,3) // Template of Lazy Matrix class
75};
76
77//////////////////////////////////////////////////////////////////////////
78// //
79// TMatrixTSymLazy //
80// //
81// Class used to make a lazy copy of a matrix, i.e. only copy matrix //
82// when really needed (when accessed). //
83// //
84//////////////////////////////////////////////////////////////////////////
85
86template<class Element> class TMatrixTSymLazy : public TObject {
87
88friend class TMatrixTBase<Element>;
89friend class TMatrixTSym <Element>;
90friend class TVectorT <Element>;
91
92protected:
95
98
99private:
100 virtual void FillIn(TMatrixTSym<Element> &m) const = 0;
101
102public:
105 : fRowUpb(nrows-1),fRowLwb(0) { }
106 TMatrixTSymLazy(Int_t row_lwb,Int_t row_upb)
107 : fRowUpb(row_upb),fRowLwb(row_lwb) { }
108 virtual ~TMatrixTSymLazy() {}
109
110 inline Int_t GetRowLwb() const { return fRowLwb; }
111 inline Int_t GetRowUpb() const { return fRowUpb; }
112
113 ClassDef(TMatrixTSymLazy,2) // Template of Lazy Symmeytric class
114};
115
116//////////////////////////////////////////////////////////////////////////
117// //
118// THaarMatrixT //
119// //
120//////////////////////////////////////////////////////////////////////////
121
122template<class Element> class THaarMatrixT: public TMatrixTLazy<Element> {
123
124private:
125 void FillIn(TMatrixT<Element> &m) const;
126
127public:
129 THaarMatrixT(Int_t n,Int_t no_cols = 0);
130 virtual ~THaarMatrixT() {}
131
132 ClassDef(THaarMatrixT,2) // Template of Haar Matrix class
133};
134
135//////////////////////////////////////////////////////////////////////////
136// //
137// THilbertMatrixT //
138// //
139//////////////////////////////////////////////////////////////////////////
140
141template<class Element> class THilbertMatrixT : public TMatrixTLazy<Element> {
142
143private:
144 void FillIn(TMatrixT<Element> &m) const;
145
146public:
148 THilbertMatrixT(Int_t no_rows,Int_t no_cols);
149 THilbertMatrixT(Int_t row_lwb,Int_t row_upb,Int_t col_lwb,Int_t col_upb);
150 virtual ~THilbertMatrixT() {}
151
152 ClassDef(THilbertMatrixT,2) // Template of Hilbert Matrix class
153};
154
155//////////////////////////////////////////////////////////////////////////
156// //
157// THilbertMatrixTSym //
158// //
159//////////////////////////////////////////////////////////////////////////
160
161template<class Element> class THilbertMatrixTSym : public TMatrixTSymLazy<Element> {
162
163private:
164 void FillIn(TMatrixTSym<Element> &m) const;
165
166public:
168 THilbertMatrixTSym(Int_t no_rows);
169 THilbertMatrixTSym(Int_t row_lwb,Int_t row_upb);
171
172 ClassDef(THilbertMatrixTSym,2) // Template of Symmetric Hilbert Matrix class
173};
174
175#endif
int Int_t
Definition: RtypesCore.h:41
#define ClassDef(name, id)
Definition: Rtypes.h:324
virtual ~THaarMatrixT()
Definition: TMatrixTLazy.h:130
void FillIn(TMatrixT< Element > &m) const
virtual ~THilbertMatrixTSym()
Definition: TMatrixTLazy.h:170
void FillIn(TMatrixTSym< Element > &m) const
void FillIn(TMatrixT< Element > &m) const
virtual ~THilbertMatrixT()
Definition: TMatrixTLazy.h:150
Linear Algebra Package.
Definition: TMatrixTBase.h:85
Templates of Lazy Matrix classes.
Definition: TMatrixTLazy.h:43
TMatrixTLazy(const TMatrixTLazy< Element > &)
Definition: TMatrixTLazy.h:55
Int_t GetColUpb() const
Definition: TMatrixTLazy.h:72
Int_t GetRowUpb() const
Definition: TMatrixTLazy.h:70
Int_t GetColLwb() const
Definition: TMatrixTLazy.h:71
TMatrixTLazy(Int_t nrows, Int_t ncols)
Definition: TMatrixTLazy.h:63
Int_t GetRowLwb() const
Definition: TMatrixTLazy.h:69
virtual ~TMatrixTLazy()
Definition: TMatrixTLazy.h:67
virtual void FillIn(TMatrixT< Element > &m) const =0
void operator=(const TMatrixTLazy< Element > &)
Definition: TMatrixTLazy.h:56
TMatrixTLazy(Int_t row_lwb, Int_t row_upb, Int_t col_lwb, Int_t col_upb)
Definition: TMatrixTLazy.h:65
TMatrixTSymLazy(Int_t row_lwb, Int_t row_upb)
Definition: TMatrixTLazy.h:106
void operator=(const TMatrixTSymLazy< Element > &)
Definition: TMatrixTLazy.h:97
TMatrixTSymLazy(const TMatrixTSymLazy< Element > &)
Definition: TMatrixTLazy.h:96
virtual ~TMatrixTSymLazy()
Definition: TMatrixTLazy.h:108
Int_t GetRowUpb() const
Definition: TMatrixTLazy.h:111
TMatrixTSymLazy(Int_t nrows)
Definition: TMatrixTLazy.h:104
Int_t GetRowLwb() const
Definition: TMatrixTLazy.h:110
virtual void FillIn(TMatrixTSym< Element > &m) const =0
TMatrixTSym.
Definition: TMatrixTSym.h:34
TMatrixT.
Definition: TMatrixT.h:39
Mother of all ROOT objects.
Definition: TObject.h:37
TVectorT.
Definition: TVectorT.h:27
const Int_t n
Definition: legend1.C:16
auto * m
Definition: textangle.C:8