55 virtual void Init(
Int_t ndim,
const Int_t* nbins,
bool addOverflow =
false) {
59 Int_t overBins = addOverflow ? 2 : 0;
61 for (
Int_t i = 0; i < ndim; ++i) {
62 fSizes[ndim - i - 1] =
fSizes[ndim - i] * (nbins[ndim - i - 1] + overBins);
75 for (
unsigned int d = 0;
d <
fSizes.size() - 2; ++
d) {
102 if (!
fData)
return T();
103 R__ASSERT(
fSizes == 0 &&
"Element operator can only be used on non-array element. Missing an operator[] level?");
147 return fData[linidx];
152 return fData[linidx];
158 return fData[linidx];
163 fData[linidx] = (T) value;
168 fData[linidx] += (T) value;
unsigned long long ULong64_t
#define ClassDef(name, id)
Buffer base class used for serializing objects.
TClass instances represent classes, structs and namespaces in the ROOT type system.
gives access to a sub-dimension, e.g.
TNDArrayRef< T > operator[](Int_t idx) const
TNDArrayRef(const T *data, const Long64_t *sizes)
const Long64_t * fSizes
Pointer into TNDArray's fSizes.
const T * fData
Pointer into TNDArray's fData.
ClassDefNV(TNDArrayRef, 0)
Subdimension of a TNDArray.
void Reset(Option_t *="")
TNDArrayRef< T > operator[](Int_t idx) const
void AddAt(ULong64_t linidx, Double_t value)
void Streamer(TBuffer &R__b)
Double_t AtAsDouble(ULong64_t linidx) const
TNDArrayT(Int_t ndim, const Int_t *nbins, bool addOverflow=false)
void Init(Int_t ndim, const Int_t *nbins, bool addOverflow=false)
T At(ULong64_t linidx) const
void SetAsDouble(ULong64_t linidx, Double_t value)
T At(const Int_t *idx) const
TNDArray(Int_t ndim, const Int_t *nbins, bool addOverflow=false)
virtual void AddAt(ULong64_t linidx, Double_t value)=0
virtual Double_t AtAsDouble(ULong64_t linidx) const =0
Long64_t GetNbins() const
std::vector< Long64_t > fSizes
bin count
Long64_t GetCellSize(Int_t dim) const
Long64_t GetBin(const Int_t *idx) const
virtual void Init(Int_t ndim, const Int_t *nbins, bool addOverflow=false)
virtual void Reset(Option_t *option="")=0
virtual void SetAsDouble(ULong64_t linidx, Double_t value)=0
Int_t GetNdimensions() const
Mother of all ROOT objects.