IMP  2.2.0
The Integrative Modeling Platform
PartitionalClustering.h
Go to the documentation of this file.
1 /**
2  * \file IMP/statistics/PartitionalClustering.h
3  * \brief Compute a distance metric between two points
4  *
5  * Copyright 2007-2014 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPSTATISTICS_PARTITIONAL_CLUSTERING_H
10 #define IMPSTATISTICS_PARTITIONAL_CLUSTERING_H
11 
12 #include <IMP/statistics/statistics_config.h>
13 #include <IMP/macros.h>
14 #include <IMP/base_types.h>
15 #include <IMP/base/Object.h>
16 
17 IMPSTATISTICS_BEGIN_NAMESPACE
18 
19 //! A base class for clustering results where each item is in one cluster
20 /** Data items are represented by an index. In a partitional clustering
21  each item can only be contained on one cluster. The indexes used refer
22  to the index used in the Metric or Embedding used to generate the
23  clustering.
24 */
25 class IMPSTATISTICSEXPORT PartitionalClustering : public IMP::base::Object {
26  public:
27  PartitionalClustering(std::string name) : Object(name) {}
28  virtual unsigned int get_number_of_clusters() const = 0;
29  /** Return the list of indexes in the ith cluster.
30  */
31  virtual const Ints& get_cluster(unsigned int cluster_index) const = 0;
32  /** Return the index of an item that "typifies" the ith cluster.
33  */
34  virtual int get_cluster_representative(unsigned int cluster_index) const = 0;
36 };
37 
38 /** Check that the clustering is a valid clustering of n elements. An
39  exception is thrown if it is not, if the build is not a fast build.*/
40 IMPSTATISTICSEXPORT void validate_partitional_clustering(
41  PartitionalClustering* pc, unsigned int n);
42 
43 IMPSTATISTICS_END_NAMESPACE
44 #endif /* IMPSTATISTICS_PARTITIONAL_CLUSTERING_H */
Import IMP/kernel/base_types.h in the namespace.
void validate_partitional_clustering(PartitionalClustering *pc, unsigned int n)
Import IMP/kernel/macros.h in the namespace.
Object(std::string name)
Construct an object with the given name.
#define IMP_REF_COUNTED_NONTRIVIAL_DESTRUCTOR(Name)
Common base class for heavy weight IMP objects.
Definition: base/Object.h:106
A shared base class to help in debugging and things.
A base class for clustering results where each item is in one cluster.