Xapian: API Documentation: Xapian::Cluster Class Reference

xapian-core 2.0.0

Public Member Functions | List of all members
Xapian::Cluster Class Reference

Class to represents a Cluster which contains Points and Centroid of the Cluster. More...

`#include <cluster.h>`

## Public Member Functions
| Cluster (const Cluster &other)
| Copying is allowed.
Cluster & | operator= (const Cluster &other)
| Assignment is allowed.
| Cluster (Cluster &&other)
| Move constructor.
Cluster & | operator= (Cluster &&other)
| Move assignment operator.
| Cluster (const Centroid &centroid)
| Constructor.
| Cluster ()
| Default constructor.
| ~Cluster ()
| Destructor.
Xapian::doccount | size () const
| Return size of the cluster.
void | add_point (const Point &point)
| Add a document to the Cluster.
void | clear ()
| Clear the cluster weights.
const Point & | operator[] (Xapian::doccount i) const
| Return the point at the given index in the cluster.
DocumentSet | get_documents () const
| Return the documents that are contained within the cluster.
const Centroid & | get_centroid () const
| Return the current centroid of the cluster.
void | set_centroid (const Centroid &centroid)
| Set the centroid of the Cluster to 'centroid'.
void | recalculate ()
| Recalculate the centroid of the Cluster after each iteration of the KMeans algorithm by taking the mean of all document vectors (Points) that belong to the Cluster.

## Detailed Description

Class to represents a Cluster which contains Points and Centroid of the Cluster.

## Constructor & Destructor Documentation

## ◆ Cluster() [1/3]

Xapian::Cluster::Cluster | ( | const Cluster & | other | ) |

Copying is allowed.

The internals are reference counted, so copying is cheap.

Parameters

  other | The object to copy.

References Cluster().

Referenced by Cluster(), Cluster(), operator=(), and operator=().

## ◆ Cluster() [2/3]

Xapian::Cluster::Cluster | ( | Cluster && | other | ) |

Move constructor.

Parameters

  other | The object to move.

References Cluster().

## ◆ Cluster() [3/3]

Xapian::Cluster::Cluster | ( | const Centroid & | centroid | ) |
| explicit

Constructor.

Parameters

  centroid | The centroid of the cluster object is assigned to 'centroid'

## Member Function Documentation

## ◆ add_point()

void Xapian::Cluster::add_point | ( | const Point & | point | ) |

Add a document to the Cluster.

Parameters

  point | The Point object representing the document which needs to be added to the cluster

## ◆ operator=() [1/2]

Cluster & Xapian::Cluster::operator= | ( | Cluster && | other | ) |

Move assignment operator.

Parameters

  other | The object to move.

References Cluster().

## ◆ operator=() [2/2]

Cluster & Xapian::Cluster::operator= | ( | const Cluster & | other | ) |

Assignment is allowed.

The internals are reference counted, so assignment is cheap.

Parameters

  other | The object to copy.

References Cluster().

## ◆ set_centroid()

void Xapian::Cluster::set_centroid | ( | const Centroid & | centroid | ) |

Set the centroid of the Cluster to 'centroid'.

Parameters

  centroid | Centroid object for the Cluster

The documentation for this class was generated from the following file:

- xapian/cluster.h