34 typename std::vector<double>;
47 template <
typename InputIterator>
48 Histogram(InputIterator first, InputIterator last,
const int nr_bins = 16,
49 const bool computeHistogram =
true)
52 init(computeHistogram);
61 explicit Histogram(std::vector<T> data,
const unsigned int nr_bins = 16,
62 const bool computeHistogram =
true)
65 init(computeHistogram);
87 auto it =
data_.begin();
88 for (
unsigned int bin = 0; bin <
nr_bins_; bin++)
90 auto itEnd = std::upper_bound(it,
data_.end(),
117 const unsigned int line_width = 16)
const;
119 int write(std::string
const& file_name, std::string
const& data_set_name,
120 std::string
const& param_name)
const;
125 void init(
const bool computeHistogram =
true)
134 if (computeHistogram)
159extern template std::ostream&
operator<<(std::ostream& os,
const T & getBinWidth() const
const T & getMinimum() const
bool dirty_
When set update() will recompute histogram.
void setMaximum(const T &maximum)
T max_
Minimum and maximum input data values.
const Data & getSortedData() const
const unsigned int & getNumberOfBins() const
const std::vector< std::size_t > & getBinCounts() const
typename std::vector< double > Data
void init(const bool computeHistogram=true)
void prettyPrint(std::ostream &os, const unsigned int line_width=16) const
Histogram(std::vector< T > data, const unsigned int nr_bins=16, const bool computeHistogram=true)
const T & getMaximum() const
std::vector< std::size_t > histogram_
Histogram(InputIterator first, InputIterator last, const int nr_bins=16, const bool computeHistogram=true)
Underlying input data vector type.
void setMinimum(const T &minimum)
const unsigned int nr_bins_
int write(std::string const &file_name, std::string const &data_set_name, std::string const ¶m_name) const
std::ostream & operator<<(std::ostream &os, const Histogram< T > &h)