IMP  2.0.1
The Integrative Modeling Platform
PairContainerStatistics.h
Go to the documentation of this file.
1 /**
2  * \file IMP/container/PairContainerStatistics.h
3  * \brief A container for Pairs.
4  *
5  * WARNING This file was generated from PairContainerStatistics.h
6  * in /tmp/nightly-build-36540/imp-2.0.1/tools/build/container_templates/container
7  * by tools/maintenance/setup_containers.py.
8  *
9  * Copyright 2007-2013 IMP Inventors. All rights reserved.
10  */
11 
12 #ifndef IMPCONTAINER_PAIR_CONTAINER_STATISTICS_H
13 #define IMPCONTAINER_PAIR_CONTAINER_STATISTICS_H
14 
15 #include <IMP/container/container_config.h>
16 #include <IMP/PairContainer.h>
17 #include <IMP/ScoreState.h>
18 #include <IMP/score_state_macros.h>
19 #include <IMP/compatibility/set.h>
20 
21 IMPCONTAINER_BEGIN_NAMESPACE
22 
23 //! Track statistics on a PairContainer
24 /** The current statistics are average and min/max occupancy. Other
25  statistics can be added on request, but we probably want to
26  restrict it to ones that are cheap to gather. */
27 class IMPCONTAINEREXPORT PairContainerStatistics : public ScoreState
28 {
30  unsigned int total_;
31  unsigned int checks_;
32  unsigned int max_;
33  unsigned int min_;
34  bool track_unique_;
35  IMP::compatibility::set<ParticlePair> unique_;
36 public:
37  PairContainerStatistics(PairContainerAdaptor c);
38  void show_statistics(std::ostream &out) const;
39  /** Keeping track of the number of unique entries seen is
40  expensive, so it is not done by default.
41  */
42  void set_track_unique(bool tf);
44 };
45 
46 
47 IMPCONTAINER_END_NAMESPACE
48 
49 #endif /* IMPCONTAINER_PAIR_CONTAINER_STATISTICS_H */