libvot  0.1.3
A C++11 multithread library for image retrieval
Public Member Functions | Public Attributes | List of all members
vot::TreeLeafNode Class Reference

The leaf node class of the tree. More...

#include <vocab_tree.h>

Inheritance diagram for vot::TreeLeafNode:
vot::TreeNode

Public Member Functions

 TreeLeafNode ()
 
virtual ~TreeLeafNode ()
 
virtual bool RecursiveBuild (size_t num_keys, int dim, int depth, int depth_curr, int bf, DTYPE **p, double *means, int *assign, int thread_num=1)
 
virtual bool ClearNode (int bf)
 
virtual bool WriteNode (FILE *f, int branch_num, int dim) const
 
virtual bool ReadNode (FILE *f, int branch_num, int dim)
 
virtual size_t CountNodes (int branch_num) const
 
virtual size_t CountLeaves (int branch_num) const
 
virtual bool Compare (TreeNode *leaf, int branch_num, int dim) const
 
virtual bool ClearScores (int bf)
 refresh the temporary score for this tree More...
 
virtual size_t DescendFeature (float *q, DTYPE *v, size_t image_index, int branch_num, int dim, bool add=true)
 
virtual double ComputeImageVectorMagnitude (int bf, DistanceType dt)
 
virtual bool SetConstantWeight (int bf)
 set a constant weight to the leaf nodes More...
 
virtual bool ComputeTFIDFWeight (int bf, size_t n)
 compute TF-IDF weight and pre-apply weight adjusting to inverted lists More...
 
virtual bool ComputeDatabaseMagnitude (int bf, DistanceType dis_type, size_t start_id, std::vector< float > &database_mag)
 compute the vector magnitude of all images in the database More...
 
virtual bool NormalizeDatabase (int bf, size_t start_id, std::vector< float > &database_mag)
 normalize the inverted list score by the magnitude of image vector More...
 
virtual bool IndexLeaves (int branch_num)
 
virtual bool FillQueryVector (float *q, int branch_num, float normalize_factor)
 fill the query vector More...
 
virtual bool ScoreQuery (float *q, int branch_num, DistanceType dt, float *scores)
 score each image in the database More...
 
- Public Member Functions inherited from vot::TreeNode
 TreeNode ()
 
virtual ~TreeNode ()
 

Public Attributes

float score
 temporary score, for querying and computing magnitude use More...
 
float weight
 weight for this node More...
 
std::vector< ImageCountinv_list
 image inverted list More...
 
std::mutex add_lock
 a mutex used for multithreaded AddImage2Tree More...
 
- Public Attributes inherited from vot::TreeNode
DTYPEdes
 the descriptor vector More...
 
size_t id
 the id of the node More...
 

Detailed Description

The leaf node class of the tree.

Constructor & Destructor Documentation

vot::TreeLeafNode::TreeLeafNode ( )
inline
vot::TreeLeafNode::~TreeLeafNode ( )
virtual

Member Function Documentation

bool vot::TreeLeafNode::ClearNode ( int  bf)
virtual

Implements vot::TreeNode.

bool vot::TreeLeafNode::ClearScores ( int  bf)
virtual

refresh the temporary score for this tree

Implements vot::TreeNode.

bool vot::TreeLeafNode::Compare ( TreeNode leaf,
int  branch_num,
int  dim 
) const
virtual

Implements vot::TreeNode.

bool vot::TreeLeafNode::ComputeDatabaseMagnitude ( int  bf,
DistanceType  dis_type,
size_t  start_id,
std::vector< float > &  database_mag 
)
virtual

compute the vector magnitude of all images in the database

Implements vot::TreeNode.

double vot::TreeLeafNode::ComputeImageVectorMagnitude ( int  bf,
DistanceType  dt 
)
virtual

Implements vot::TreeNode.

bool vot::TreeLeafNode::ComputeTFIDFWeight ( int  bf,
size_t  n 
)
virtual

compute TF-IDF weight and pre-apply weight adjusting to inverted lists

Implements vot::TreeNode.

size_t vot::TreeLeafNode::CountLeaves ( int  branch_num) const
virtual

Implements vot::TreeNode.

size_t vot::TreeLeafNode::CountNodes ( int  branch_num) const
virtual

Implements vot::TreeNode.

size_t vot::TreeLeafNode::DescendFeature ( float *  q,
DTYPE v,
size_t  image_index,
int  branch_num,
int  dim,
bool  add = true 
)
virtual

Implements vot::TreeNode.

bool vot::TreeLeafNode::FillQueryVector ( float *  q,
int  branch_num,
float  normalize_factor 
)
virtual

fill the query vector

Implements vot::TreeNode.

bool vot::TreeLeafNode::IndexLeaves ( int  branch_num)
virtual

Implements vot::TreeNode.

bool vot::TreeLeafNode::NormalizeDatabase ( int  bf,
size_t  start_id,
std::vector< float > &  database_mag 
)
virtual

normalize the inverted list score by the magnitude of image vector

Implements vot::TreeNode.

bool vot::TreeLeafNode::ReadNode ( FILE *  f,
int  branch_num,
int  dim 
)
virtual

Implements vot::TreeNode.

bool vot::TreeLeafNode::RecursiveBuild ( size_t  num_keys,
int  dim,
int  depth,
int  depth_curr,
int  bf,
DTYPE **  p,
double *  means,
int *  assign,
int  thread_num = 1 
)
virtual

Implements vot::TreeNode.

bool vot::TreeLeafNode::ScoreQuery ( float *  q,
int  branch_num,
DistanceType  dt,
float *  scores 
)
virtual

score each image in the database

Implements vot::TreeNode.

bool vot::TreeLeafNode::SetConstantWeight ( int  bf)
virtual

set a constant weight to the leaf nodes

Implements vot::TreeNode.

bool vot::TreeLeafNode::WriteNode ( FILE *  f,
int  branch_num,
int  dim 
) const
virtual

Implements vot::TreeNode.

Member Data Documentation

std::mutex vot::TreeLeafNode::add_lock

a mutex used for multithreaded AddImage2Tree

std::vector<ImageCount> vot::TreeLeafNode::inv_list

image inverted list

float vot::TreeLeafNode::score

temporary score, for querying and computing magnitude use

float vot::TreeLeafNode::weight

weight for this node


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