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

The virtual class of tree node. More...

#include <vocab_tree.h>

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

Public Member Functions

 TreeNode ()
 
virtual ~TreeNode ()
 
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)=0
 
virtual bool ClearNode (int bf)=0
 
virtual bool WriteNode (FILE *f, int branch_num, int dim) const =0
 
virtual bool ReadNode (FILE *f, int branch_num, int dim)=0
 
virtual size_t CountNodes (int branch_num) const =0
 
virtual size_t CountLeaves (int branch_num) const =0
 
virtual bool Compare (TreeNode *in, int branch_num, int dim) const =0
 
virtual bool ClearScores (int bf)=0
 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)=0
 
virtual double ComputeImageVectorMagnitude (int bf, DistanceType dt)=0
 
virtual bool SetConstantWeight (int bf)=0
 set a constant weight to the leaf nodes More...
 
virtual bool ComputeTFIDFWeight (int bf, size_t n)=0
 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)=0
 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)=0
 normalize the inverted list score by the magnitude of image vector More...
 
virtual bool IndexLeaves (int branch_num)=0
 
virtual bool FillQueryVector (float *q, int branch_num, float normalize_factor)=0
 fill the query vector More...
 
virtual bool ScoreQuery (float *q, int branch_num, DistanceType dt, float *scores)=0
 score each image in the database More...
 

Public Attributes

DTYPEdes
 the descriptor vector More...
 
size_t id
 the id of the node More...
 

Detailed Description

The virtual class of tree node.

Constructor & Destructor Documentation

vot::TreeNode::TreeNode ( )
inline
virtual vot::TreeNode::~TreeNode ( )
inlinevirtual

Member Function Documentation

virtual bool vot::TreeNode::ClearNode ( int  bf)
pure virtual

Implemented in vot::TreeLeafNode, and vot::TreeInNode.

virtual bool vot::TreeNode::ClearScores ( int  bf)
pure virtual

refresh the temporary score for this tree

Implemented in vot::TreeLeafNode, and vot::TreeInNode.

virtual bool vot::TreeNode::Compare ( TreeNode in,
int  branch_num,
int  dim 
) const
pure virtual

Implemented in vot::TreeLeafNode, and vot::TreeInNode.

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

compute the vector magnitude of all images in the database

Implemented in vot::TreeLeafNode, and vot::TreeInNode.

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

Implemented in vot::TreeLeafNode, and vot::TreeInNode.

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

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

Implemented in vot::TreeLeafNode, and vot::TreeInNode.

virtual size_t vot::TreeNode::CountLeaves ( int  branch_num) const
pure virtual

Implemented in vot::TreeLeafNode, and vot::TreeInNode.

virtual size_t vot::TreeNode::CountNodes ( int  branch_num) const
pure virtual

Implemented in vot::TreeLeafNode, and vot::TreeInNode.

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

Implemented in vot::TreeLeafNode, and vot::TreeInNode.

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

fill the query vector

Implemented in vot::TreeLeafNode, and vot::TreeInNode.

virtual bool vot::TreeNode::IndexLeaves ( int  branch_num)
pure virtual

Implemented in vot::TreeLeafNode, and vot::TreeInNode.

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

normalize the inverted list score by the magnitude of image vector

Implemented in vot::TreeLeafNode, and vot::TreeInNode.

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

Implemented in vot::TreeLeafNode, and vot::TreeInNode.

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

Implemented in vot::TreeLeafNode, and vot::TreeInNode.

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

score each image in the database

Implemented in vot::TreeLeafNode, and vot::TreeInNode.

virtual bool vot::TreeNode::SetConstantWeight ( int  bf)
pure virtual

set a constant weight to the leaf nodes

Implemented in vot::TreeLeafNode, and vot::TreeInNode.

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

Implemented in vot::TreeLeafNode, and vot::TreeInNode.

Member Data Documentation

DTYPE* vot::TreeNode::des

the descriptor vector

size_t vot::TreeNode::id

the id of the node


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