MINT2
BinningBase.cpp
Go to the documentation of this file.
1 #include "Mint/BinningBase.h"
2 
4  _dimension (0 ),
5  _axisNames (0 ),
6  _binningType("")
7 {
8 
9 
10 }
11 
12 bool BinningBase::isSameBinningType( const BinningBase& other ) const{
13  return (other._binningType == _binningType);
14 }
15 
16 void BinningBase::setBinningType(TString binningType){
17  _binningType = binningType;
18 }
19 
20 
22  _axisNames = names;
23 }
24 
26  return _axisNames;
27 }
28 
29 
30 const int& BinningBase::getDimension () const{
31  return _dimension;
32 }
33 
34 void BinningBase::setDimension (int dimension){
35  if (_dimension == 0){
36  _dimension = dimension;
37  _axisNames = HyperName (dimension);
38  }
39 }
40 
41 
42 double BinningBase::getMin(int dimension) const{
43  return getLimits().getLowCorner().at(dimension);
44 }
45 
46 double BinningBase::getMax(int dimension) const{
47  return getLimits().getHighCorner().at(dimension);
48 }
49 
51  return _binningType;
52 }
53 
55  return false;
56 }
57 TString BinningBase::filename() const{
58  return "";
59 }
60 
61 void BinningBase::reserveCapacity(int nElements){
62  nElements++;
63 }
64 
65 std::vector<int> BinningBase::getBinNum(const HyperPointSet& coords) const{
66  std::vector<int> binNums;
67  binNums.reserve(coords.size());
68 
69  for (unsigned i = 0; i < coords.size(); i++){
70  binNums.push_back( getBinNum(coords.at(i)) );
71  }
72  return binNums;
73 }
74 
75 
77 
78 }
virtual bool isDiskResident() const
Definition: BinningBase.cpp:54
double getMax(int dimension) const
Definition: BinningBase.cpp:46
virtual TString filename() const
Definition: BinningBase.cpp:57
bool isSameBinningType(const BinningBase &other) const
Definition: BinningBase.cpp:12
void setNames(HyperName names)
Definition: BinningBase.cpp:21
HyperName getNames() const
Definition: BinningBase.cpp:25
double getMin(int dimension) const
Definition: BinningBase.cpp:42
TString getBinningType() const
Definition: BinningBase.cpp:50
virtual void setDimension(int dimension)
Definition: BinningBase.cpp:34
int _dimension
Definition: BinningBase.h:31
const HyperPoint & at(int i) const
virtual int getBinNum(const HyperPoint &coords) const =0
void setBinningType(TString binningType)
Definition: BinningBase.cpp:16
virtual ~BinningBase()
Definition: BinningBase.cpp:76
const HyperPoint & getHighCorner() const
Definition: HyperCuboid.h:89
TString _binningType
Definition: BinningBase.h:41
const int & getDimension() const
Definition: BinningBase.cpp:30
HyperName _axisNames
Definition: BinningBase.h:36
const double & at(int i) const
Definition: HyperPoint.cpp:433
virtual void reserveCapacity(int nElements)
Definition: BinningBase.cpp:61
const HyperPoint & getLowCorner() const
Definition: HyperCuboid.h:87
unsigned int size() const
virtual HyperCuboid getLimits() const =0