id_cluster_collection Class Reference

#include <idcluster.h>

Inheritance diagram for id_cluster_collection:

Inheritance graph
[legend]

List of all members.

Classes

struct  cluster_dist_t

Public Types

enum  query_flags {
  QUERY_FREQ = 0, QUERY_NORMALIZED_FREQ = 1, QUERY_IDF = 2, QUERY_MIN_FREQ = 4,
  QUERY_BIN_FREQ = 8, QUERY_IDF_NORMALIZED = 3
}
typedef std::set< id_cluster * > cluster_set
typedef vecmap< id_cluster
*, float > 
cluster_map
typedef std::map< unsigned,
cluster_map
id2cluster_map

Public Member Functions

 id_cluster_collection (query_flags flags)
virtual ~id_cluster_collection ()
void reduce (float threshold)
void add_cluster (id_cluster *c)
void remove_cluster (id_cluster *c)
void update_cluster (id_cluster *c, unsigned id, int amount)
void merge_clusters (id_cluster *a, id_cluster *b)
void cmp_best_clusters ()
unsigned get_best_cluster (unsigned id)
id_clusterget_best_cluster (id_cluster *c, float *dist)
void print ()
bool save (const char *fn)
bool save (FILE *f)
bool save (sqlite3 *db, const char *tablename=0)
bool load (const char *fn)
bool load (sqlite3 *db, const char *tablename=0)
void clear ()
float idf (unsigned id)
float idf (id2cluster_map::iterator &id_it)
void get_scores (id_cluster *c, cluster_score_map &scores, id_cluster **best_c=0, float *_best_s=0)
void set_query_rules (query_flags flags)
int get_version () const

Public Attributes

cluster_set clusters
id2cluster_map id2cluster
 id2cluster[i][j].second contains the value of dimension i of the j'th vector with non-0 value at dim i.
std::map< unsigned, id_cluster * > best_cluster

Protected Member Functions

void build_distance_matrix (float threshold)
void add_to_distance_matrix (id_cluster *c, float threshold)
void remove_from_distance_matrix (id_cluster *c)

Protected Attributes

std::set< cluster_dist_tdistance_matrix
int version

Friends

class incremental_query


Detailed Description

Definition at line 68 of file idcluster.h.


Member Typedef Documentation

Definition at line 73 of file idcluster.h.

Definition at line 71 of file idcluster.h.

Definition at line 75 of file idcluster.h.


Member Enumeration Documentation

Enumerator:
QUERY_FREQ 
QUERY_NORMALIZED_FREQ 
QUERY_IDF 
QUERY_MIN_FREQ 
QUERY_BIN_FREQ 
QUERY_IDF_NORMALIZED 

Definition at line 77 of file idcluster.h.


Constructor & Destructor Documentation

id_cluster_collection::id_cluster_collection ( id_cluster_collection::query_flags  flags  ) 

Definition at line 38 of file idcluster.cpp.

id_cluster_collection::~id_cluster_collection (  )  [virtual]

Definition at line 434 of file idcluster.cpp.

References clusters.


Member Function Documentation

void id_cluster_collection::add_cluster ( id_cluster c  ) 

void id_cluster_collection::add_to_distance_matrix ( id_cluster c,
float  threshold 
) [protected]

void id_cluster_collection::build_distance_matrix ( float  threshold  )  [protected]

Definition at line 567 of file idcluster.cpp.

References add_to_distance_matrix(), clusters, and distance_matrix.

Referenced by reduce().

void id_cluster_collection::clear (  ) 

Definition at line 669 of file idcluster.cpp.

References best_cluster, clusters, distance_matrix, id2cluster, and version.

void id_cluster_collection::cmp_best_clusters (  ) 

Definition at line 440 of file idcluster.cpp.

References best_cluster, and id2cluster.

Referenced by load().

id_cluster * id_cluster_collection::get_best_cluster ( id_cluster c,
float *  dist 
)

Definition at line 59 of file idcluster.cpp.

References get_scores().

unsigned id_cluster_collection::get_best_cluster ( unsigned  id  ) 

Definition at line 460 of file idcluster.cpp.

References best_cluster.

Referenced by query_frame().

void id_cluster_collection::get_scores ( id_cluster c,
cluster_score_map scores,
id_cluster **  best_c = 0,
float *  _best_s = 0 
)

int id_cluster_collection::get_version (  )  const [inline]

Definition at line 136 of file idcluster.h.

References version.

Referenced by init_query_with_frame().

float id_cluster_collection::idf ( id2cluster_map::iterator &  id_it  ) 

float id_cluster_collection::idf ( unsigned  id  ) 

bool id_cluster_collection::load ( sqlite3 *  db,
const char *  tablename = 0 
)

Definition at line 337 of file idcluster.cpp.

References id_cluster::add(), add_cluster(), clusters, and cmp_best_clusters().

bool id_cluster_collection::load ( const char *  fn  ) 

void id_cluster_collection::merge_clusters ( id_cluster a,
id_cluster b 
)

Definition at line 43 of file idcluster.cpp.

References id_cluster::add(), id_cluster::histo, id2cluster, remove_cluster(), and version.

Referenced by reduce().

void id_cluster_collection::print (  ) 

Definition at line 233 of file idcluster.cpp.

References clusters, and id2cluster.

void id_cluster_collection::reduce ( float  threshold  ) 

void id_cluster_collection::remove_cluster ( id_cluster c  ) 

Definition at line 521 of file idcluster.cpp.

References clusters, id_cluster::histo, id2cluster, and version.

Referenced by merge_clusters(), and visual_database::remove_object().

void id_cluster_collection::remove_from_distance_matrix ( id_cluster c  )  [protected]

Definition at line 579 of file idcluster.cpp.

References distance_matrix, and get_scores().

Referenced by reduce().

bool id_cluster_collection::save ( sqlite3 *  db,
const char *  tablename = 0 
)

Definition at line 286 of file idcluster.cpp.

References clusters.

bool id_cluster_collection::save ( FILE *  f  ) 

Definition at line 266 of file idcluster.cpp.

References clusters.

bool id_cluster_collection::save ( const char *  fn  ) 

Definition at line 254 of file idcluster.cpp.

Referenced by main(), and pic_randomizer::save_points().

void id_cluster_collection::set_query_rules ( id_cluster_collection::query_flags  _flags  ) 

void id_cluster_collection::update_cluster ( id_cluster c,
unsigned  id,
int  amount 
)


Friends And Related Function Documentation

friend class incremental_query [friend]

Definition at line 142 of file idcluster.h.

Referenced by visual_database::create_incremental_query().


Member Data Documentation

Definition at line 109 of file idcluster.h.

Referenced by clear(), cmp_best_clusters(), and get_best_cluster().

id2cluster[i][j].second contains the value of dimension i of the j'th vector with non-0 value at dim i.

Definition at line 108 of file idcluster.h.

Referenced by add_cluster(), clear(), cmp_best_clusters(), get_correspondences(), visual_object::get_correspondences_std(), get_scores(), idf(), merge_clusters(), incremental_query::modify(), print(), remove_cluster(), and update_cluster().


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

Generated on Tue Mar 30 15:53:25 2010 for Polyora by  doxygen 1.5.9