40 :
TMatrixTLazy<Element>(1<<order, no_cols == 0 ? 1<<order : no_cols)
43 Error(
"THaarMatrixT",
"Haar order(%d) should be > 0",order);
45 Error(
"THaarMatrixT",
"#cols(%d) in Haar should be >= 0",no_cols);
58 template<
class Element>
65 if (no_rows < no_cols) {
66 Error(
"MakeHaarMat",
"#rows(%d) should be >= #cols(%d)",no_rows,no_cols);
70 Error(
"MakeHaarMat",
"#cols(%d) should be > 0",no_cols);
81 Element norm_factor = 1/
TMath::Sqrt((Element)no_rows);
85 for (j = 0; j < no_rows; j++)
92 Int_t step_length = no_rows/2;
93 while (cp < m_end && step_length > 0) {
94 for (
Int_t step_position = 0; cp < m_end && step_position < no_rows;
95 step_position += 2*step_length, cp += no_rows) {
96 Element *ccp = cp+step_position;
97 for (j = 0; j < step_length; j++)
99 for (j = 0; j < step_length; j++)
100 *ccp++ = -norm_factor;
106 R__ASSERT(step_length != 0 || cp == m_end);
107 R__ASSERT(no_rows != no_cols || step_length == 0);
114 template<
class Element>
122 template<
class Element>
127 Error(
"THilbertMatrixT",
"#rows(%d) in Hilbert should be > 0",no_rows);
129 Error(
"THilbertMatrixT",
"#cols(%d) in Hilbert should be > 0",no_cols);
134 template<
class Element>
136 :
TMatrixTLazy<Element>(row_lwb,row_upb,col_lwb,col_upb)
138 if (row_upb < row_lwb)
139 Error(
"THilbertMatrixT",
"row_upb(%d) in Hilbert should be >= row_lwb(%d)",row_upb,row_lwb);
140 if (col_upb < col_lwb)
141 Error(
"THilbertMatrixT",
"col_upb(%d) in Hilbert should be >= col_lwb(%d)",col_upb,col_lwb);
148 template<
class Element>
156 Error(
"MakeHilbertMat",
"#rows(%d) should be > 0",no_rows);
160 Error(
"MakeHilbertMat",
"#cols(%d) should be > 0",no_cols);
165 for (
Int_t i = 0; i < no_rows; i++)
166 for (
Int_t j = 0; j < no_cols; j++)
167 *cp++ = 1.0/(i+j+1.0);
172 template<
class Element>
180 template<
class Element>
185 Error(
"THilbertMatrixTSym",
"#rows(%d) in Hilbert should be > 0",no_rows);
190 template<
class Element>
194 if (row_upb < row_lwb)
195 Error(
"THilbertMatrixTSym",
"row_upb(%d) in Hilbert should be >= row_lwb(%d)",row_upb,row_lwb);
202 template<
class Element>
208 Error(
"MakeHilbertMat",
"#rows(%d) should be > 0",no_rows);
213 for (
Int_t i = 0; i < no_rows; i++)
214 for (
Int_t j = 0; j < no_rows; j++)
215 *cp++ = 1.0/(i+j+1.0);
220 template<
class Element>
TMatrixT< Element > & Transpose(const TMatrixT< Element > &source)
Transpose matrix source.
Small helper to encapsulate whether to return the value pointed to by the iterator or its address...
void MakeHilbertMat(TMatrixT< Element > &m)
Make a Hilbert matrix.
void FillIn(TMatrixT< Element > &m) const
void FillIn(TMatrixTSym< Element > &m) const
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
void Error(const char *location, const char *msgfmt,...)
virtual const Element * GetMatrixArray() const
void MakeHaarMat(TMatrixT< Element > &m)
Create an orthonormal (2^n)*(no_cols) Haar (sub)matrix, whose columns are Haar functions.
virtual const Element * GetMatrixArray() const
templateClassImp(TMatrixTLazy) templateClassImp(TMatrixTSymLazy) templateClassImp(THaarMatrixT) templateClassImp(THilbertMatrixT) templateClassImp(THilbertMatrixTSym) template< class Element > THaarMatrixT< Element >
void FillIn(TMatrixT< Element > &m) const
Double_t Sqrt(Double_t x)