Changeset 1600 for trunk/MagicSoft/Mars/mhist/MHMatrix.cc
- Timestamp:
- 11/13/02 17:03:19 (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhist/MHMatrix.cc
r1593 r1600 614 614 return fData ? fData->GetDataMember() : TString(""); 615 615 } 616 617 // -------------------------------------------------------------------------- 618 // 619 // Return a comma seperated list of all data members used in the matrix. 620 // This is mainly used in MTask::AddToBranchList 621 // 622 void MHMatrix::ReduceNumberOfRows(UInt_t numrows, const TString opt) 623 { 624 UInt_t rows = fM.GetNrows(); 625 626 if (rows==numrows) 627 { 628 *fLog << warn << "Matrix has already the correct number of rows..." << endl; 629 return; 630 } 631 632 Float_t ratio = (Float_t)numrows/fM.GetNrows(); 633 634 if (ratio>=1) 635 { 636 *fLog << warn << "Matrix cannot be enlarged..." << endl; 637 return; 638 } 639 640 Double_t sum = 0; 641 642 UInt_t oldrow = 0; 643 UInt_t newrow = 0; 644 645 while (oldrow<rows) 646 { 647 sum += ratio; 648 649 if (newrow<=(unsigned int)sum) 650 { 651 TVector vold(fM.GetNcols()); 652 vold = TMatrixRow(fM, oldrow); 653 654 TMatrixRow rownew(fM, newrow); 655 rownew = vold; 656 newrow++; 657 } 658 659 oldrow++; 660 } 661 662 /* 663 664 TMatrix m(n, fM.GetNcols()); 665 for (int i=0; i<n; i++) 666 { 667 TVector vold(n); 668 vold = TMatrixRow(fM, idx[i]); 669 670 TMatrixRow rownew(m, i); 671 rownew = vold; 672 } 673 */ 674 675 }
Note:
See TracChangeset
for help on using the changeset viewer.