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 ==
nullptr &&
"Element operator can only be used on non-array element. Missing an operator[] level?");
145 return fData[linidx];
150 return fData[linidx];
156 return fData[linidx];
161 fData[linidx] = (T) value;
166 fData[linidx] += (T) value;
int Int_t
Signed integer 4 bytes (int).
double Double_t
Double 8 bytes.
long long Long64_t
Portable signed long integer 8 bytes.
unsigned long long ULong64_t
Portable unsigned long integer 8 bytes.
const char Option_t
Option string (const char).
#define ClassDefNV(name, id)
#define ClassDefOverride(name, id)
#define R__ASSERT(e)
Checks condition e and reports a fatal error if it's false.
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.
Double_t AtAsDouble(ULong64_t linidx) const override
void Reset(Option_t *="") override
TNDArrayRef< T > operator[](Int_t idx) const
void Streamer(TBuffer &) override
Stream an object of class TObject.
void SetAsDouble(ULong64_t linidx, Double_t value) override
void Init(Int_t ndim, const Int_t *nbins, bool addOverflow=false) override
TNDArrayT(Int_t ndim, const Int_t *nbins, bool addOverflow=false)
T At(ULong64_t linidx) const
void AddAt(ULong64_t linidx, Double_t value) override
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
TObject()
TObject constructor.