34template<
class Element>
36 :
TMatrixTLazy<Element>(1<<order, no_cols == 0 ? 1<<order : no_cols)
39 Error(
"THaarMatrixT",
"Haar order(%d) should be > 0",order);
41 Error(
"THaarMatrixT",
"#cols(%d) in Haar should be >= 0",no_cols);
54template<
class Element>
58 const Int_t no_rows =
m.GetNrows();
59 const Int_t no_cols =
m.GetNcols();
61 if (no_rows < no_cols) {
62 Error(
"MakeHaarMat",
"#rows(%d) should be >= #cols(%d)",no_rows,no_cols);
66 Error(
"MakeHaarMat",
"#cols(%d) should be > 0",no_cols);
77 Element norm_factor = 1/
TMath::Sqrt((Element)no_rows);
81 for (j = 0; j < no_rows; j++)
88 Int_t step_length = no_rows/2;
89 while (cp < m_end && step_length > 0) {
90 for (
Int_t step_position = 0; cp < m_end && step_position < no_rows;
91 step_position += 2*step_length, cp += no_rows) {
92 Element *ccp = cp+step_position;
93 for (j = 0; j < step_length; j++)
95 for (j = 0; j < step_length; j++)
96 *ccp++ = -norm_factor;
102 R__ASSERT(step_length != 0 || cp == m_end);
103 R__ASSERT(no_rows != no_cols || step_length == 0);
110template<
class Element>
118template<
class Element>
123 Error(
"THilbertMatrixT",
"#rows(%d) in Hilbert should be > 0",no_rows);
125 Error(
"THilbertMatrixT",
"#cols(%d) in Hilbert should be > 0",no_cols);
130template<
class Element>
132 :
TMatrixTLazy<Element>(row_lwb,row_upb,col_lwb,col_upb)
134 if (row_upb < row_lwb)
135 Error(
"THilbertMatrixT",
"row_upb(%d) in Hilbert should be >= row_lwb(%d)",row_upb,row_lwb);
136 if (col_upb < col_lwb)
137 Error(
"THilbertMatrixT",
"col_upb(%d) in Hilbert should be >= col_lwb(%d)",col_upb,col_lwb);
144template<
class Element>
148 const Int_t no_rows =
m.GetNrows();
149 const Int_t no_cols =
m.GetNcols();
152 Error(
"MakeHilbertMat",
"#rows(%d) should be > 0",no_rows);
156 Error(
"MakeHilbertMat",
"#cols(%d) should be > 0",no_cols);
160 Element *cp =
m.GetMatrixArray();
161 for (
Int_t i = 0; i < no_rows; i++)
162 for (
Int_t j = 0; j < no_cols; j++)
163 *cp++ = 1.0/(i+j+1.0);
168template<
class Element>
176template<
class Element>
181 Error(
"THilbertMatrixTSym",
"#rows(%d) in Hilbert should be > 0",no_rows);
186template<
class Element>
190 if (row_upb < row_lwb)
191 Error(
"THilbertMatrixTSym",
"row_upb(%d) in Hilbert should be >= row_lwb(%d)",row_upb,row_lwb);
198template<
class Element>
202 const Int_t no_rows =
m.GetNrows();
204 Error(
"MakeHilbertMat",
"#rows(%d) should be > 0",no_rows);
208 Element *cp =
m.GetMatrixArray();
209 for (
Int_t i = 0; i < no_rows; i++)
210 for (
Int_t j = 0; j < no_rows; j++)
211 *cp++ = 1.0/(i+j+1.0);
216template<
class Element>
222template class TMatrixTLazy <Float_t>;
223template class TMatrixTSymLazy <Float_t>;
224template class THaarMatrixT <Float_t>;
225template class THilbertMatrixT <Float_t>;
228template class TMatrixTLazy <Double_t>;
229template class TMatrixTSymLazy <Double_t>;
230template class THaarMatrixT <Double_t>;
231template class THilbertMatrixT <Double_t>;
int Int_t
Signed integer 4 bytes (int).
Error("WriteTObject","The current directory (%s) is not associated with a file. The object (%s) has not been written.", GetName(), objname)
#define R__ASSERT(e)
Checks condition e and reports a fatal error if it's false.
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 override
void FillIn(TMatrixTSym< Element > &m) const override
void FillIn(TMatrixT< Element > &m) const override
TMatrixTLazy(const TMatrixTLazy< Element > &)
TMatrixTSymLazy(const TMatrixTSymLazy< Element > &)
const Element * GetMatrixArray() const override
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Double_t Sqrt(Double_t x)
Returns the square root of x.