1 #ifndef NPSTAT_UNIFORMAXIS_HH_
2 #define NPSTAT_UNIFORMAXIS_HH_
20 #include "geners/ClassId.hh"
31 UniformAxis(
unsigned nCoords,
double min,
double max,
35 inline unsigned nCoords()
const {
return npt_;}
36 inline double min()
const {
return min_;}
37 inline double max()
const {
return max_;}
38 inline const std::string& label()
const {
return label_;}
39 inline bool usesLogSpace()
const {
return false;}
52 std::pair<unsigned,double> getInterval(
double coordinate)
const;
56 std::pair<unsigned,double> linearInterval(
double coordinate)
const;
59 std::vector<double> coords()
const;
60 double coordinate(
unsigned i)
const;
61 inline double length()
const {
return max_ - min_;}
62 inline bool isUniform()
const {
return true;}
63 inline unsigned nIntervals()
const {
return npt_ - 1;}
64 inline double intervalWidth(
unsigned)
const {
return bw_;}
68 {
return !(*
this == r);}
71 bool isClose(
const UniformAxis& r,
double tol)
const;
74 inline void setLabel(
const char* newlabel)
75 {label_ = newlabel ? newlabel :
"";}
78 inline gs::ClassId classId()
const {
return gs::ClassId(*
this);}
79 bool write(std::ostream& of)
const;
81 static inline const char* classname() {
return "npstat::UniformAxis";}
82 static inline unsigned version() {
return 1;}
83 static UniformAxis* read(
const gs::ClassId&
id, std::istream& in);
94 inline std::pair<double,double> range()
const
95 {
return std::pair<double,double>(min_, max_);}
98 inline UniformAxis() : min_(0.), max_(0.), bw_(0.), npt_(0) {}
Definition: AbsArrayProjector.hh:14