39template<
class Element>
41 :
TMatrixTLazy<Element>(1<<order, no_cols == 0 ? 1<<order : no_cols)
44 Error(
"THaarMatrixT",
"Haar order(%d) should be > 0",order);
46 Error(
"THaarMatrixT",
"#cols(%d) in Haar should be >= 0",no_cols);
59template<
class Element>
63 const Int_t no_rows =
m.GetNrows();
64 const Int_t no_cols =
m.GetNcols();
66 if (no_rows < no_cols) {
67 Error(
"MakeHaarMat",
"#rows(%d) should be >= #cols(%d)",no_rows,no_cols);
71 Error(
"MakeHaarMat",
"#cols(%d) should be > 0",no_cols);
82 Element norm_factor = 1/
TMath::Sqrt((Element)no_rows);
86 for (j = 0; j < no_rows; j++)
93 Int_t step_length = no_rows/2;
94 while (cp < m_end && step_length > 0) {
95 for (
Int_t step_position = 0; cp < m_end && step_position < no_rows;
96 step_position += 2*step_length, cp += no_rows) {
97 Element *ccp = cp+step_position;
98 for (j = 0; j < step_length; j++)
100 for (j = 0; j < step_length; j++)
101 *ccp++ = -norm_factor;
107 R__ASSERT(step_length != 0 || cp == m_end);
108 R__ASSERT(no_rows != no_cols || step_length == 0);
115template<
class Element>
123template<
class Element>
128 Error(
"THilbertMatrixT",
"#rows(%d) in Hilbert should be > 0",no_rows);
130 Error(
"THilbertMatrixT",
"#cols(%d) in Hilbert should be > 0",no_cols);
135template<
class Element>
137 :
TMatrixTLazy<Element>(row_lwb,row_upb,col_lwb,col_upb)
139 if (row_upb < row_lwb)
140 Error(
"THilbertMatrixT",
"row_upb(%d) in Hilbert should be >= row_lwb(%d)",row_upb,row_lwb);
141 if (col_upb < col_lwb)
142 Error(
"THilbertMatrixT",
"col_upb(%d) in Hilbert should be >= col_lwb(%d)",col_upb,col_lwb);
149template<
class Element>
153 const Int_t no_rows =
m.GetNrows();
154 const Int_t no_cols =
m.GetNcols();
157 Error(
"MakeHilbertMat",
"#rows(%d) should be > 0",no_rows);
161 Error(
"MakeHilbertMat",
"#cols(%d) should be > 0",no_cols);
165 Element *cp =
m.GetMatrixArray();
166 for (
Int_t i = 0; i < no_rows; i++)
167 for (
Int_t j = 0; j < no_cols; j++)
168 *cp++ = 1.0/(i+j+1.0);
173template<
class Element>
181template<
class Element>
186 Error(
"THilbertMatrixTSym",
"#rows(%d) in Hilbert should be > 0",no_rows);
191template<
class Element>
195 if (row_upb < row_lwb)
196 Error(
"THilbertMatrixTSym",
"row_upb(%d) in Hilbert should be >= row_lwb(%d)",row_upb,row_lwb);
203template<
class Element>
207 const Int_t no_rows =
m.GetNrows();
209 Error(
"MakeHilbertMat",
"#rows(%d) should be > 0",no_rows);
213 Element *cp =
m.GetMatrixArray();
214 for (
Int_t i = 0; i < no_rows; i++)
215 for (
Int_t j = 0; j < no_rows; j++)
216 *cp++ = 1.0/(i+j+1.0);
221template<
class Element>
#define templateClassImp(name)
void Error(const char *location, const char *msgfmt,...)
void MakeHaarMat(TMatrixT< Element > &m)
Create an orthonormal (2^n)*(no_cols) Haar (sub)matrix, whose columns are Haar functions.
void MakeHilbertMat(TMatrixT< Element > &m)
Make a Hilbert matrix.
void FillIn(TMatrixT< Element > &m) const
void FillIn(TMatrixTSym< Element > &m) const
void FillIn(TMatrixT< Element > &m) const
Templates of Lazy Matrix classes.
virtual const Element * GetMatrixArray() const
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Double_t Sqrt(Double_t x)