Xapian: API Documentation: Xapian::CosineDistance Class Reference

xapian-core 2.0.0

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

Class for calculating the cosine distance between two documents. More...

`#include <cluster.h>`

Inheritance diagram for Xapian::CosineDistance:
[legend]

## Public Member Functions
double | similarity (const PointType &a, const PointType &b) const override
| Calculates and returns the cosine similarity using the formula cos(theta) = a.b/(|a|*|b|).
std::string | get_description () const override
| Return a string describing this object.
Public Member Functions inherited from Xapian::Similarity
virtual | ~Similarity ()
| Destructor.

## Detailed Description

Class for calculating the cosine distance between two documents.

## Member Function Documentation

## ◆ get_description()

std::string Xapian::CosineDistance::get_description | ( |  | ) | const
| overridevirtual

Return a string describing this object.

Implements Xapian::Similarity.

## ◆ similarity()

double Xapian::CosineDistance::similarity | ( | const PointType & | a,
|  | const PointType & | b ) const
| overridevirtual

Calculates and returns the cosine similarity using the formula cos(theta) = a.b/(|a|*|b|).

Implements Xapian::Similarity.

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

- xapian/cluster.h