Changeset 2328 for trunk/MagicSoft/Mars/mhist
- Timestamp:
- 09/10/03 13:38:45 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mhist
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhist/MHMatrix.cc
r2307 r2328 1120 1120 } 1121 1121 1122 // -------------------------------------------------------------------------- 1123 // 1124 // Reduces the number of rows to the given number num by cutting out the 1125 // last rows. 1126 // 1122 1127 void MHMatrix::ReduceRows(UInt_t num) 1123 1128 { … … 1135 1140 TMatrixRow(fM, irow) = tmp = TMatrixRow(m, irow); 1136 1141 } 1142 1143 // -------------------------------------------------------------------------- 1144 // 1145 // Remove rows which contains numbers not fullfilling TMath::Finite 1146 // 1147 Bool_t MHMatrix::RemoveInvalidRows() 1148 { 1149 TMatrix m(fM); 1150 1151 const Int_t ncol=fM.GetNcols(); 1152 TVector vold(ncol); 1153 int irow=0; 1154 1155 for (int i=0; i<m.GetNrows(); i++) 1156 { 1157 const TMatrixRow &row = TMatrixRow(m, i); 1158 1159 // finite (-> math.h) checks for NaN as well as inf 1160 int jcol; 1161 for (jcol=0; jcol<ncol; jcol++) 1162 if (!TMath::Finite(vold(jcol))) 1163 break; 1164 1165 if (jcol==ncol) 1166 TMatrixRow(fM, irow++) = vold = row; 1167 else 1168 *fLog << warn << "Warning - MHMatrix::RemoveInvalidRows: row #" << i<< " removed." << endl; 1169 } 1170 1171 // Do not use ResizeTo (in older root versions this doesn't save the contents 1172 ReduceRows(irow); 1173 1174 return kTRUE; 1175 } 1176 -
trunk/MagicSoft/Mars/mhist/MHMatrix.h
r2296 r2328 103 103 104 104 void ReduceNumberOfRows(UInt_t numrows, const TString opt); 105 Bool_t RemoveInvalidRows(); 105 106 106 107 Int_t Read(const char *name);
Note:
See TracChangeset
for help on using the changeset viewer.