mirror of
https://github.com/boostorg/histogram.git
synced 2025-05-09 23:04:07 +00:00
simplification
This commit is contained in:
parent
aaf672d9a3
commit
f2b51bcb11
@ -197,6 +197,8 @@ public:
|
||||
const std::string& operator[](int idx) const
|
||||
{ return categories_[idx]; }
|
||||
|
||||
inline bool uoflow() const { return false; }
|
||||
|
||||
bool operator==(const category_axis&) const;
|
||||
private:
|
||||
std::vector<std::string> categories_;
|
||||
|
@ -30,6 +30,8 @@ public:
|
||||
~basic_histogram() {}
|
||||
|
||||
unsigned dim() const { return axes_.size(); }
|
||||
unsigned bins(unsigned i) const { return size_[i]; }
|
||||
unsigned shape(unsigned i) const { return size_[i] + 2 * uoflow_[i]; }
|
||||
|
||||
template <typename T>
|
||||
T& axis(unsigned i)
|
||||
@ -41,9 +43,6 @@ public:
|
||||
{ if (is_same<T, axis_type>::value) return axes_[i];
|
||||
return boost::get<const T&>(axes_[i]); }
|
||||
|
||||
unsigned bins(unsigned i) const { return size_[i]; }
|
||||
unsigned shape(unsigned i) const { return size_[i] + 2 * uoflow_[i]; }
|
||||
|
||||
protected:
|
||||
basic_histogram() {}
|
||||
explicit basic_histogram(const axes_type& axes);
|
||||
@ -61,8 +60,6 @@ protected:
|
||||
BOOST_PP_REPEAT_FROM_TO(1, BOOST_HISTOGRAM_AXIS_LIMIT, BOOST_HISTOGRAM_BASE_CTOR, nil)
|
||||
|
||||
bool operator==(const basic_histogram&) const;
|
||||
bool operator!=(const basic_histogram& o) const
|
||||
{ return !operator==(o); }
|
||||
|
||||
template <typename Array>
|
||||
inline
|
||||
|
@ -16,16 +16,12 @@ namespace detail {
|
||||
|
||||
struct fields_visitor : public static_visitor<unsigned>
|
||||
{
|
||||
unsigned operator()(const category_axis& a) const { return a.bins(); }
|
||||
|
||||
template <typename A>
|
||||
unsigned operator()(const A& a) const { return a.bins() + 2 * a.uoflow(); }
|
||||
};
|
||||
|
||||
struct uoflow_visitor : public static_visitor<bool>
|
||||
{
|
||||
bool operator()(const category_axis& a) const { return false; }
|
||||
|
||||
template <typename A>
|
||||
bool operator()(const A& a) const { return a.uoflow(); }
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user