xapian-core  1.5.0
Public Member Functions | List of all members
Xapian::Centroid Class Reference

Class to represent cluster centroids in the vector space. More...

+ Inheritance diagram for Xapian::Centroid:

Public Member Functions

 Centroid ()
 Default constructor.
 
 Centroid (const Point &point)
 Constructor with Point argument. More...
 
void divide (double cluster_size)
 Divide the weight of terms in the centroid by 'size' and recalculate the magnitude. More...
 
void clear ()
 Clear the terms and corresponding values of the centroid.
 
- Public Member Functions inherited from Xapian::PointType
 PointType ()
 Default constructor.
 
TermIterator termlist_begin () const
 Return a TermIterator to the beginning of the termlist.
 
TermIterator termlist_end () const noexcept
 Return a TermIterator to the end of the termlist.
 
bool contains (const std::string &term) const
 Validate whether a certain term exists in the termlist or not by performing a lookup operation in the existing values. More...
 
double get_weight (const std::string &term) const
 Return the TF-IDF weight associated with a certain term. More...
 
void add_weight (const std::string &term, double weight)
 Add the weight 'weight' to the mapping of a term. More...
 
double get_magnitude () const
 Return the pre-computed squared magnitude.
 
Xapian::termcount termlist_size () const
 Return the size of the termlist.
 
PointTyperelease ()
 Start reference counting this object. More...
 
const PointTyperelease () const
 Start reference counting this object. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Xapian::PointType
void set_weight (const std::string &term, double weight)
 Set the weight 'weight' to the mapping of a term. More...
 
- Protected Attributes inherited from Xapian::PointType
std::unordered_map< std::string, double > weights
 Implement a map to store the terms within a document and their pre-computed TF-IDF weights.
 
double magnitude
 Store the squared magnitude of the PointType.
 

Detailed Description

Class to represent cluster centroids in the vector space.

Constructor & Destructor Documentation

◆ Centroid()

Xapian::Centroid::Centroid ( const Point point)
explicit

Constructor with Point argument.

Parameters
pointPoint object to which Centroid object is initialised. The document vector and the magnitude are made equal

Member Function Documentation

◆ divide()

void Xapian::Centroid::divide ( double  cluster_size)

Divide the weight of terms in the centroid by 'size' and recalculate the magnitude.

Parameters
cluster_sizeValue by which Centroid document vector is divided

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