Changeset 1345 for trunk/MagicSoft
- Timestamp:
- 06/04/02 14:22:16 (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhist/MHMatrix.cc
r1336 r1345 106 106 return; 107 107 } 108 109 108 fData->Add(&chain); 110 109 111 TNamed *name = new TNamed(rule, "");110 TNamed *name = new TNamed(rule, rule); // Fimxe, in 3.02/07 the title can't be "", why? 112 111 fRules->Add(name); 113 112 } … … 298 297 const TMatrix *MHMatrix::InvertPosDef() 299 298 { 300 /* 301 ---------------------------------- 302 Substract Mean of Rows from Rows 303 ---------------------------------- 304 305 const Int_t rows = fM.GetNrows(); 306 const Int_t cols = fM.GetNcols(); 307 308 for (int i=0; i<rows; i++) 309 { 310 Double_t mean = 0; 311 for (int j=0; j<cols; j++) 312 mean += fM(i, j); 313 mean /= cols; 314 315 for (int j=0; j<cols; j++) 316 fM(i, j) -= mean; 317 } 318 */ 319 /* 320 ---------------------------------- 321 Substract Mean of Cols from Cols 322 ---------------------------------- 323 324 const Int_t rows = fM.GetNrows(); 325 const Int_t cols = fM.GetNcols(); 299 TMatrix m(fM); 300 301 const Int_t rows = m.GetNrows(); 302 const Int_t cols = m.GetNcols(); 326 303 327 304 for (int i=0; i<cols; i++) 328 305 { 329 Double_t mean= 0;306 Double_t avg = 0; 330 307 for (int j=0; j<rows; j++) 331 mean += fM(j, i); 332 mean /= rows; 308 avg += fM(j, i); 309 310 avg /= rows; 333 311 334 312 for (int j=0; j<rows; j++) 335 fM(j, i) -= mean; 336 } 337 */ 338 339 TMatrix *m2 = new TMatrix(fM, TMatrix::kTransposeMult, fM); 313 m(j, i) -= avg; 314 } 315 316 TMatrix *m2 = new TMatrix(m, TMatrix::kTransposeMult, m); 340 317 341 318 Double_t det;
Note:
See TracChangeset
for help on using the changeset viewer.