#include <kmeantree.h>
Public Member Functions | |
node_t () | |
bool | is_leaf () |
unsigned | count_leafs () |
void | recursive_split (int max_level, int min_elem, int level=0) |
bool | run_and_split () |
bool | save (const char *filename) |
unsigned | get_id (descriptor_t *d, node_t **node=0, int depth=0) |
void | print_summary (int depth=0) |
void | cmp_scores (std::multimap< double, int > &scores, descriptor_t *data) |
bool | load (FILE *f) |
bool | save (FILE *f) |
bool | save_to_database (const char *fn) |
open a sqlite3 database to store the node and its children. | |
void | assign_leaf_ids (unsigned *id_ptr) |
Public Attributes | |
mean_t | mean |
unsigned | id |
node_t * | clusters [nb_branches] |
descriptor_array | data |
Protected Member Functions | |
void | run_kmean (int nb_iter=32) |
bool | save (sqlite3 *db, sqlite3_stmt *insert_node, sqlite3_stmt *insert_child) |
Definition at line 61 of file kmeantree.h.
node_t::node_t | ( | ) |
void node_t::assign_leaf_ids | ( | unsigned * | id_ptr | ) |
Definition at line 136 of file kmeantree.cpp.
References assign_leaf_ids(), clusters, id, is_leaf(), and kmean_tree::nb_branches.
Referenced by assign_leaf_ids(), and kmean_tree::build_from_data().
void node_t::cmp_scores | ( | std::multimap< double, int > & | scores, | |
descriptor_t * | data | |||
) |
Definition at line 152 of file kmeantree.cpp.
References clusters, kmean_tree::mean_t::distance(), mean, and kmean_tree::nb_branches.
Referenced by get_id(), and run_kmean().
unsigned kmean_tree::node_t::count_leafs | ( | ) | [inline] |
Definition at line 79 of file kmeantree.h.
References clusters, count_leafs(), and kmean_tree::nb_branches.
Referenced by count_leafs().
unsigned node_t::get_id | ( | descriptor_t * | d, | |
node_t ** | node = 0 , |
|||
int | depth = 0 | |||
) |
Definition at line 106 of file kmeantree.cpp.
References clusters, cmp_scores(), get_id(), id, and is_leaf().
Referenced by get_id(), load_patch_track(), and kpt_tracker::traverse_tree().
bool kmean_tree::node_t::is_leaf | ( | ) | [inline] |
Definition at line 73 of file kmeantree.h.
References clusters, and kmean_tree::nb_branches.
Referenced by assign_leaf_ids(), get_id(), print_summary(), recursive_split(), and run_and_split().
bool node_t::load | ( | FILE * | f | ) |
Definition at line 589 of file kmeantree.cpp.
References clusters, mean, and kmean_tree::nb_branches.
Referenced by kmean_tree::load().
void node_t::print_summary | ( | int | depth = 0 |
) |
Definition at line 576 of file kmeantree.cpp.
References clusters, is_leaf(), kmean_tree::mean_t::mean, mean, kmean_tree::nb_branches, and print_summary().
Referenced by print_summary().
void node_t::recursive_split | ( | int | max_level, | |
int | min_elem, | |||
int | level = 0 | |||
) |
Definition at line 68 of file kmeantree.cpp.
References clusters, data, is_leaf(), kmean_tree::nb_branches, recursive_split(), and run_and_split().
Referenced by kmean_tree::build_from_data(), and recursive_split().
bool node_t::run_and_split | ( | ) |
Definition at line 121 of file kmeantree.cpp.
References clusters, data, is_leaf(), kmean_tree::nb_branches, and run_kmean().
Referenced by recursive_split().
void node_t::run_kmean | ( | int | nb_iter = 32 |
) | [protected] |
Definition at line 165 of file kmeantree.cpp.
References kmean_tree::mean_t::accumulate(), clusters, cmp_scores(), data, kmean_tree::descriptor_size, kmean_tree::mean_t::mean, mean, and kmean_tree::nb_branches.
Referenced by run_and_split().
bool node_t::save | ( | sqlite3 * | db, | |
sqlite3_stmt * | insert_node, | |||
sqlite3_stmt * | insert_child | |||
) | [protected] |
Definition at line 622 of file kmeantree.cpp.
References clusters, mean, kmean_tree::nb_branches, and save().
bool node_t::save | ( | FILE * | f | ) |
Definition at line 650 of file kmeantree.cpp.
References clusters, mean, kmean_tree::nb_branches, and save().
bool node_t::save | ( | const char * | filename | ) |
bool node_t::save_to_database | ( | const char * | fn | ) |
open a sqlite3 database to store the node and its children.
Clears previously stored tree.
Definition at line 327 of file kmeantree.cpp.
References save().
Referenced by main().
Definition at line 67 of file kmeantree.h.
Referenced by assign_leaf_ids(), cmp_scores(), count_leafs(), get_id(), is_leaf(), load(), kmean_tree::load(), node_t(), print_summary(), recursive_split(), run_and_split(), run_kmean(), save(), and save_node_images().
Definition at line 69 of file kmeantree.h.
Referenced by kmean_tree::build_from_data(), recursive_split(), run_and_split(), run_kmean(), and save_node_images().
unsigned kmean_tree::node_t::id |
Definition at line 65 of file kmeantree.h.
Referenced by assign_leaf_ids(), get_id(), and kmean_tree::load().
Definition at line 64 of file kmeantree.h.
Referenced by cmp_scores(), load(), kmean_tree::load(), print_summary(), run_kmean(), save(), and save_node_images().