xapian-core  1.5.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...

Public Member Functions

 Cluster (const Cluster &other)
 Copying is allowed. More...
 
Clusteroperator= (const Cluster &other)
 Assignment is allowed. More...
 
 Cluster (Cluster &&other)
 Move constructor. More...
 
Clusteroperator= (Cluster &&other)
 Move assignment operator. More...
 
 Cluster (const Centroid &centroid)
 Constructor. More...
 
 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. More...
 
void clear ()
 Clear the cluster weights.
 
Pointoperator[] (Xapian::doccount i)
 Return the point at the given index in the cluster.
 
const Pointoperator[] (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 Centroidget_centroid () const
 Return the current centroid of the cluster.
 
void set_centroid (const Centroid &centroid)
 Set the centroid of the Cluster to 'centroid'. More...
 
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
otherThe object to copy.

◆ Cluster() [2/3]

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

Move constructor.

Parameters
otherThe object to move.

◆ Cluster() [3/3]

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

Constructor.

Parameters
centroidThe 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
pointThe 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
otherThe object to move.

◆ operator=() [2/2]

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

Assignment is allowed.

The internals are reference counted, so assignment is cheap.

Parameters
otherThe object to copy.

◆ set_centroid()

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

Set the centroid of the Cluster to 'centroid'.

Parameters
centroidCentroid object for the Cluster

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