IMP
2.0.1
The Integrative Modeling Platform
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
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-2013 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/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;
35
IMP_REF_COUNTED_NONTRIVIAL_DESTRUCTOR
(
PartitionalClustering
);
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
41
void
validate_partitional_clustering
(
PartitionalClustering
*pc,
42
unsigned
int
n);
43
44
IMPSTATISTICS_END_NAMESPACE
45
#endif
/* IMPSTATISTICS_PARTITIONAL_CLUSTERING_H */