IMP  2.0.0
The Integrative Modeling Platform
Histogram.h
Go to the documentation of this file.
1 /**
2  * \file IMP/statistics/Histogram.h \brief Holds a histogram
3  *
4  * Copyright 2007-2013 IMP Inventors. All rights reserved.
5  *
6  */
7 
8 #ifndef IMPSTATISTICS_HISTOGRAM_H
9 #define IMPSTATISTICS_HISTOGRAM_H
10 #include <IMP/statistics/statistics_config.h>
11 #include <IMP/base_types.h>
12 #include <vector>
13 IMPSTATISTICS_BEGIN_NAMESPACE
14 #if IMP_HAS_DEPRECATED
15 //! Histogram
16 /** Keeps a set of values within a range
17  the range is arranged into some number of bins
18  specified during construction.
19  \deprecated{Use HistogramD instead.}
20 */
21 class IMPSTATISTICSEXPORT Histogram {
22  public:
23  //! Constructor
24  /**
25  \param[in] start the start value of the range
26  \param[in] end the end value of the range
27  \param[in] num_bins the number of bins [start,end] is divided to
28  */
29  Histogram(double start, double end,
30  unsigned int num_bins);
31  //! Increase the count for the bin that holds a
32  // value that is in range for this histogram.
33  void add(double x);
34  //! Get the sum of all counts in the histogram.
35  unsigned int get_total_count() const;
36  //! Get the lowest value for which X% of the histogram data is lower from
37  /**
38  \param percentage the percenrage (between 0 to 1)
39  The name of this function will change to be more accurate.
40  \unstable{get_top}
41  */
42  double get_top(double percentage)const;
44  private:
45  double start_,end_,interval_size_;
46  Ints freq_;
47 };
48 
50 #endif
51 
52 IMPSTATISTICS_END_NAMESPACE
53 #endif /* IMPSTATISTICS_HISTOGRAM_H */