49 else offDiag.
Use(nRows,work);
80 Int_t off_n1 = (n-1)*n;
81 for (j = 0; j < n; j++)
86 for (i = n-1; i > 0; i--) {
87 const Int_t off_i1 = (i-1)*n;
88 const Int_t off_i = i*n;
94 for (k = 0; k < i; k++)
95 scale = scale+TMath::Abs(pD[k]);
98 for (j = 0; j < i; j++) {
99 const Int_t off_j = j*n;
100 pD[j] = pV[off_i1+j];
108 for (k = 0; k < i; k++) {
112 Double_t f = pD[i-1];
119 for (j = 0; j < i; j++)
124 for (j = 0; j < i; j++) {
125 const Int_t off_j = j*n;
128 g = pE[j]+pV[off_j+j]*f;
129 for (k = j+1; k <= i-1; k++) {
130 const Int_t off_k = k*n;
131 g += pV[off_k+j]*pD[k];
132 pE[k] += pV[off_k+j]*f;
137 for (j = 0; j < i; j++) {
141 Double_t hh = f/(h+h);
142 for (j = 0; j < i; j++)
144 for (j = 0; j < i; j++) {
147 for (k = j; k <= i-1; k++) {
148 const Int_t off_k = k*n;
149 pV[off_k+j] -= (f*pE[k]+g*pD[k]);
151 pD[j] = pV[off_i1+j];
160 for (i = 0; i < n-1; i++) {
161 const Int_t off_i = i*n;
162 pV[off_n1+i] = pV[off_i+i];
164 Double_t h = pD[i+1];
166 for (k = 0; k <= i; k++) {
167 const Int_t off_k = k*n;
168 pD[k] = pV[off_k+i+1]/h;
170 for (j = 0; j <= i; j++) {
172 for (k = 0; k <= i; k++) {
173 const Int_t off_k = k*n;
174 g += pV[off_k+i+1]*pV[off_k+j];
176 for (k = 0; k <= i; k++) {
177 const Int_t off_k = k*n;
178 pV[off_k+j] -= g*pD[k];
182 for (k = 0; k <= i; k++) {
183 const Int_t off_k = k*n;
187 for (j = 0; j < n; j++) {
188 pD[j] = pV[off_n1+j];
191 pV[off_n1+n-1] = 1.0;
210 for (i = 1; i < n; i++)
217 for (l = 0; l < n; l++) {
221 tst1 = TMath::Max(tst1,TMath::Abs(pD[l])+TMath::Abs(pE[l]));
226 if (TMath::Abs(pE[m]) <= eps*tst1) {
239 Error(
"MakeEigenVectors",
"too many iterations");
246 Double_t p = (pD[l+1]-g)/(2.0*pE[l]);
251 pD[l+1] = pE[l]*(p+r);
252 Double_t dl1 = pD[l+1];
253 Double_t h = g-pD[l];
254 for (i = l+2; i < n; i++)
264 Double_t el1 = pE[l+1];
267 for (i = m-1; i >= l; i--) {
278 pD[i+1] = h+s*(c*g+s*pD[i]);
282 for (k = 0; k < n; k++) {
283 const Int_t off_k = k*n;
285 pV[off_k+i+1] = s*pV[off_k+i]+c*h;
286 pV[off_k+i] = c*pV[off_k+i]-s*h;
289 p = -s*s2*c3*el1*pE[l]/dl1;
295 }
while (TMath::Abs(pE[l]) > eps*tst1);
303 for (i = 0; i < n-1; i++) {
306 for (j = i+1; j < n; j++) {
315 for (j = 0; j < n; j++) {
316 const Int_t off_j = j*n;
318 pV[off_j+i] = pV[off_j+k];
330 if (
this != &source) {
TVectorT< Element > & ResizeTo(Int_t lwb, Int_t upb)
Resize the vector to [lwb:upb] .
static void MakeEigenVectors(TMatrixD &v, TVectorD &d, TVectorD &e)
Symmetric tridiagonal QL algorithm.
virtual const Element * GetMatrixArray() const
TMatrixDSymEigen & operator=(const TMatrixDSymEigen &source)
Assignment operator.
virtual TMatrixTBase< Element > & ResizeTo(Int_t nrows, Int_t ncols, Int_t=-1)
Set size of the matrix to nrows x ncols New dynamic elements are created, the overlapping part of the...
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
TVectorT< Element > & Use(Int_t lwb, Int_t upb, Element *data)
Use the array data to fill the vector lwb..upb].
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t Int_t m
Element * GetMatrixArray()
static void MakeTridiagonal(TMatrixD &v, TVectorD &d, TVectorD &e)
This is derived from the Algol procedures tred2 by Bowdler, Martin, Reinsch, and Wilkinson, Handbook for Auto.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
Double_t Hypot(Double_t x, Double_t y)
Double_t Sqrt(Double_t x)