Changeset 4955
- Timestamp:
- 09/12/04 20:27:19 (20 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r4950 r4955 19 19 20 20 -*-*- END OF LINE -*-*- 21 22 2004/09/11: Markus Gaug 23 24 * mbase/MArray.[h,cc] 25 - moved function StripZeros(TArrayD &arr) to MArrayD 26 - moved function StripZeros(TArrayF &arr) to MArrayF 27 28 * mbase/MArrayD.[h,cc] 29 - new function StripZeros() 30 31 * mbase/MArrayF.[h,cc] 32 * mbase/Makefile 33 * mbase/BaseLinkDef.h 34 - new class analogously to MArrayD 35 21 36 22 37 2004/09/10: Markus Gaug -
trunk/MagicSoft/Mars/mbase/MArray.cc
r4954 r4955 37 37 ////////////////////////////////////////////////////////////////////////////// 38 38 #include "MArray.h" 39 #include "TArray.h"40 39 41 40 ClassImp(MArray); 42 41 43 // --------------------------------------------------------------------------44 //45 // Cuts the last entries of an array containing only zeros.46 //47 void MArray::StripZeros(TArray &arr)48 {49 50 const Int_t n = arr.GetSize();51 52 for (Int_t i=n-1; i>=0; i--)53 if (arr[i] != 0)54 {55 arr.Set(i+1);56 break;57 }58 }59 60 // --------------------------------------------------------------------------61 //62 // Cuts the last entries of an array containing only zeros.63 //64 void MArray::StripZeros(MArray &arr)65 {66 const Int_t n = arr.GetSize();67 68 for (Int_t i=n-1; i>=0; i--)69 if (arr[i] != 0)70 {71 arr.Set(i+1);72 break;73 }74 }75 -
trunk/MagicSoft/Mars/mbase/MArray.h
r4952 r4955 14 14 #endif 15 15 16 class TArray;17 16 class MArray : public TObject 18 17 { … … 31 30 virtual void Set(UInt_t n) = 0; 32 31 33 static void StripZeros(TArray &arr);34 static void StripZeros(MArray &arr);35 36 32 ClassDef(MArray, 1) //Abstract array base class for TObject derived Arrays 37 33 }; -
trunk/MagicSoft/Mars/mbase/MArrayD.cc
r4752 r4955 35 35 ////////////////////////////////////////////////////////////////////////////// 36 36 #include "MArrayD.h" 37 #include "TArrayD.h" 37 38 38 39 ClassImp(MArrayD); 39 40 41 // -------------------------------------------------------------------------- 42 // 43 // Cuts the last entries of an array containing only zeros. 44 // 45 void MArrayD::StripZeros(TArrayD &arr) 46 { 47 48 const Int_t n = arr.GetSize(); 49 50 for (Int_t i=n-1; i>=0; i--) 51 if (arr[i] != 0) 52 { 53 arr.Set(i+1); 54 break; 55 } 56 } 57 58 // -------------------------------------------------------------------------- 59 // 60 // Cuts the last entries of an array containing only zeros. 61 // 62 void MArrayD::StripZeros() 63 { 64 const Int_t n = GetSize(); 65 66 for (Int_t i=n-1; i>=0; i--) 67 if ((*this)[i] != 0) 68 { 69 Set(i+1); 70 break; 71 } 72 } 73 -
trunk/MagicSoft/Mars/mbase/MArrayD.h
r4915 r4955 8 8 #include <string.h> 9 9 10 class TArrayD; 10 11 class MArrayD : public MArray 11 12 { … … 156 157 } 157 158 159 static void StripZeros(TArrayD &arr); 160 void StripZeros(); 161 158 162 ClassDef(MArrayD, 1) //Array of Double_t 159 163 }; -
trunk/MagicSoft/Mars/mbase/MArrayF.cc
r4954 r4955 35 35 ////////////////////////////////////////////////////////////////////////////// 36 36 #include "MArrayF.h" 37 #include "TArrayF.h" 37 38 38 39 ClassImp(MArrayF); 39 40 41 // -------------------------------------------------------------------------- 42 // 43 // Cuts the last entries of an array containing only zeros. 44 // 45 void MArrayF::StripZeros(TArrayF &arr) 46 { 47 48 const Int_t n = arr.GetSize(); 49 50 for (Int_t i=n-1; i>=0; i--) 51 if (arr[i] != 0) 52 { 53 arr.Set(i+1); 54 break; 55 } 56 } 57 58 // -------------------------------------------------------------------------- 59 // 60 // Cuts the last entries of an array containing only zeros. 61 // 62 void MArrayF::StripZeros() 63 { 64 const Int_t n = GetSize(); 65 66 for (Int_t i=n-1; i>=0; i--) 67 if ((*this)[i] != 0) 68 { 69 Set(i+1); 70 break; 71 } 72 } 73 -
trunk/MagicSoft/Mars/mbase/MArrayF.h
r4954 r4955 8 8 #include <string.h> 9 9 10 class TArrayF; 10 11 class MArrayF : public MArray 11 12 { … … 156 157 } 157 158 159 static void StripZeros(TArrayF &arr); 160 void StripZeros(); 161 158 162 ClassDef(MArrayF, 1) //Array of Float_t 159 163 };
Note:
See TracChangeset
for help on using the changeset viewer.