IMP  2.1.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 
11 #include <IMP/statistics/statistics_config.h>
13 #include <IMP/base_types.h>
14 #include <vector>
15 
16 IMPSTATISTICS_DEPRECATED_HEADER(2.0, "Use statistics/HistogramD.h");
17 
18 IMPSTATISTICS_BEGIN_NAMESPACE
19 
20 //! Histogram
21 /** Keeps a set of values within a range
22  the range is arranged into some number of bins
23  specified during construction.
24  \deprecated_at{2.1} Use HistogramD instead.
25 */
26 class IMPSTATISTICSEXPORT Histogram {
27  public:
28  //! Constructor
29  /**
30  \param[in] start the start value of the range
31  \param[in] end the end value of the range
32  \param[in] num_bins the number of bins [start,end] is divided to
33  */
34  IMPSTATISTICS_DEPRECATED_VALUE_DECL(2.0)
35  Histogram(double start, double end, unsigned int num_bins);
36  //! Increase the count for the bin that holds a
37  // value that is in range for this histogram.
38  void add(double x);
39  //! Get the sum of all counts in the histogram.
40  unsigned int get_total_count() const;
41  //! Get the lowest value for which X% of the histogram data is lower from
42  /**
43  \param percentage the percenrage (between 0 to 1)
44  The name of this function will change to be more accurate.
45  \unstable{get_top}
46  */
47  double get_top(double percentage) const;
49 
50  private:
51  double start_, end_, interval_size_;
52  Ints freq_;
53 };
54 
56 
57 IMPSTATISTICS_END_NAMESPACE
58 #endif /* IMPSTATISTICS_HISTOGRAM_H */
Import IMP/kernel/base_types.h in the namespace.
#define IMP_VALUES(Name, PluralName)
Define the type for storing sets of values.
Control display of deprecation information.
#define IMP_SHOWABLE(Name)