source: branches/removing_cpp11_features/mbase/MArrayD.cc@ 18227

Last change on this file since 18227 was 5088, checked in by moralejo, 20 years ago
*** empty log message ***
File size: 2.0 KB
Line 
1/* ======================================================================== *\
2!
3! *
4! * This file is part of MARS, the MAGIC Analysis and Reconstruction
5! * Software. It is distributed to you in the hope that it can be a useful
6! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
7! * It is distributed WITHOUT ANY WARRANTY.
8! *
9! * Permission to use, copy, modify and distribute this software and its
10! * documentation for any purpose is hereby granted without fee,
11! * provided that the above copyright notice appear in all copies and
12! * that both that copyright notice and this permission notice appear
13! * in supporting documentation. It is provided "as is" without express
14! * or implied warranty.
15! *
16!
17!
18! Author(s): Thomas Bretz 12/2000 <mailto:tbretz@astro.uni-wuerzburg.de>
19!
20! Copyright: MAGIC Software Development, 2000-2004
21!
22!
23\* ======================================================================== */
24
25
26//////////////////////////////////////////////////////////////////////////////
27//
28// MArrayD
29//
30// Array of Double_t. It is almost the same than TArrayD but derives from
31// TObject
32//
33// Another advantage is: operator[] has no range check!
34//
35//////////////////////////////////////////////////////////////////////////////
36#include "MArrayD.h"
37#include "TArrayD.h"
38
39ClassImp(MArrayD);
40
41// --------------------------------------------------------------------------
42//
43// Cuts the last entries of an array containing only zeros.
44//
45void 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//
62void 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
Note: See TracBrowser for help on using the repository browser.