ARB
|
#include "gb_data.h"
#include "gb_tune.h"
#include "gb_hashindex.h"
#include <arb_strbuf.h>
#include <arb_sort.h>
#include <climits>
#include <cfloat>
#include <cctype>
Go to the source code of this file.
Classes | |
struct | gbs_hash_entry |
struct | GB_HASH |
struct | numhash_entry |
struct | GB_NUMHASH |
Macros | |
#define | KNOWN_PRIMES 279 |
Variables | |
static size_t | sorted_primes [KNOWN_PRIMES] |
#define KNOWN_PRIMES 279 |
Definition at line 52 of file adhash.cxx.
Referenced by gbs_get_a_prime().
Definition at line 193 of file adhash.cxx.
References gb_assert, and KNOWN_PRIMES.
Referenced by GB_create_index(), GBS_optimize_hash(), and hash_size().
Definition at line 245 of file adhash.cxx.
References gbs_get_a_prime().
Referenced by GBS_create_hash(), GBS_create_numhash(), GBT_begin_rename_session(), and GBT_open().
Create a hash
estimated_elements | estimated number of elements added to hash (if you add more elements, hash will still work, but get slow) |
case_sens | GB_IGNORE_CASE or GB_MIND_CASE Uses linked lists to avoid collisions. |
Definition at line 253 of file adhash.cxx.
References ARB_calloc(), GB_HASH::case_sens, GB_HASH::entries, GB_HASH::freefun, hash_size(), GB_HASH::nelem, NULp, and GB_HASH::size.
Referenced by an_get_prefix_hash(), arb_prm_primer(), aw_install_xkeys(), aw_question(), AW_xfig::AW_xfig(), AWT_translator::AWT_translator(), AWTC_pars_names(), ST_ML::calc_st_ml(), callDelay(), DI_MATRIX::compress(), AW_xfig::create_gcs(), create_item_hash(), create_ref_hash(), MO_Liste::fill_marked_bakts(), g_bs_add_value_tag_to_hash(), gb_cache::gb_cache(), GB_DbScanner::GB_DbScanner(), gb_read_bin(), GB_remove_on_exit(), GBP_add_callback(), GBS_create_dynaval_hash(), GBS_merge_tagged_strings(), GBS_modify_tagged_string_with_ACI(), GBT_check_data(), GBT_link_tree_using_species_hash(), GDE_popup_filename_browser(), GEN_create_pseudo_species_hash(), GEN_testAndRemoveTranslations(), MO_Liste::get_all_species(), get_cached_taxonomy(), get_short(), getIcon(), BI_helix::initFromData(), AP_tree::mark_duplicates(), MatrixOrder::MatrixOrder(), mg_transfer_listed_species(), nt_add(), nt_add_partial(), nt_build_sai_string(), nt_create_configuration(), Package::Package(), PT_build_species_hash(), QUERY::search_duplicated_field_content(), Sondentopf::Sondentopf(), species_rename_join(), SpeciesSpace::SpeciesSpace(), ST_Container::ST_Container(), AW_selection_list::to_hash(), and UniqueNameDetector::UniqueNameDetector().
GB_HASH* GBS_create_dynaval_hash | ( | long | estimated_elements, |
GB_CASE | case_sens, | ||
void(*)(long) | freefun | ||
) |
like GBS_create_hash, but values stored in hash get freed using 'freefun' when hash gets destroyed
Definition at line 271 of file adhash.cxx.
References GB_HASH::freefun, and GBS_create_hash().
Referenced by aw_help_search(), QUERY::create_query_box(), DefinedCommands::DefinedCommands(), g_bs_get_string_of_tag_hash(), GBT_begin_rename_session(), get_cached_taxonomy(), and st_ml_check_sequence_quality().
void GBS_dynaval_free | ( | long | val | ) |
Definition at line 278 of file adhash.cxx.
Referenced by aw_help_search(), DefinedCommands::DefinedCommands(), g_bs_get_string_of_tag_hash(), GBT_begin_rename_session(), get_cached_taxonomy(), and DefinedCommands::set().
void GBS_optimize_hash | ( | const GB_HASH * | hs | ) |
Definition at line 316 of file adhash.cxx.
References ARB_calloc(), GB_HASH::case_sens, GB_HASH::entries, GB_CALC_HASH_INDEX, gbs_get_a_prime(), gbs_hash_entry::key, GB_HASH::nelem, gbs_hash_entry::next, and GB_HASH::size.
Referenced by an_add_short(), GBP_add_callback(), get_short(), and MG_export_fields().
Definition at line 357 of file adhash.cxx.
References GBS_strstruct::nput(), GBS_strstruct::put(), and GBS_strstruct::putlong().
Referenced by GBS_hashtab_2_string().
Definition at line 368 of file adhash.cxx.
References GBS_hash_do_const_loop(), gbs_hash_to_strstruct(), and GBS_strstruct::release().
Referenced by GEN_testAndRemoveTranslations().
|
static |
Definition at line 375 of file adhash.cxx.
References GB_HASH::case_sens, GB_HASH::entries, GB_CALC_HASH_INDEX_CASE_IGNORED, GB_CALC_HASH_INDEX_CASE_SENSITIVE, GB_IGNORE_CASE, gbs_hash_entry::key, gbs_hash_entry::next, NULp, and GB_HASH::size.
Referenced by GBS_hash_next_element_that(), GBS_incr_hash(), GBS_read_hash(), and write_hash().
Definition at line 392 of file adhash.cxx.
References find_hash_entry(), and gbs_hash_entry::val.
Referenced by an_find_shrt_prefix(), ap_mark_duplicates_rek(), arb_reduce_primer_len(), are_not_in_tree(), AW_window::at(), AW_window::at_ifdef(), aw_create_shell(), AW_forget_all_window_geometry(), aw_help_search(), aw_question(), aw_xkey_2_awkey(), AW_root::awar_no_error(), AWTC_create_numbered_suffix(), awtc_mark_hits(), callDelay(), AWT_translator::codon2aa(), AP_tree::colorize(), compare_hits(), QUERY::copy_selection_list_2_query_box(), AW_xfig::create_gcs(), ST_ML::find_node_by_name(), find_SAI_candidates(), find_species_candidates(), flush_cache_entry(), g_bs_add_value_tag_to_hash(), gb_write_key(), GBP_add_callback(), GBP_remove_callback(), GBT_check_alignment(), GBT_check_data(), GBT_commit_rename_session(), gbt_link_tree_to_hash_rek(), GBT_remove_leafs(), GBT_rename_species(), gbt_rename_tree_rek(), GDE_popup_filename_browser(), GEN_find_origin_organism(), GEN_read_pseudo_species_from_hash(), DefinedCommands::get(), ST_Container::get_cached_sonde(), get_cached_taxonomy(), ST_ML::get_color_string(), MatrixOrder::get_index(), MO_Liste::get_index_by_entry(), ST_ML::get_ml_vectors(), get_short(), SpecSetRegistry::get_species_index(), SpeciesSpace::get_species_index(), get_taxonomy(), get_taxonomy_string(), getHitInfo(), getIcon(), BI_helix::initFromData(), key2quark(), MERGE_sequences_simple(), MG_export_fields(), MG_transfer_one_species(), MP_mark_probes_in_tree(), UniqueNameDetector::name_known(), Package::not_defined(), nt_build_conf_marked(), nt_extract_configuration(), perform_query_cb(), ptpd_read_names(), QUERY::search_duplicated_field_content(), AW_root::search_remote_command(), species_rename_join(), st_ml_add_quality_string_to_species(), st_ml_add_sequence_part_to_stat(), and ST_ML::update_ml_likelihood().
|
static |
Definition at line 399 of file adhash.cxx.
References GB_HASH::entries, GB_HASH::freefun, GB_internal_error(), gbm_free_mem(), GBM_HASH_INDEX, gbs_hash_entry::key, GB_HASH::nelem, gbs_hash_entry::next, and gbs_hash_entry::val.
Referenced by GBS_hash_do_loop(), GBS_incr_hash(), and write_hash().
Definition at line 420 of file adhash.cxx.
References ARB_strdup(), delete_from_list(), GB_HASH::entries, find_hash_entry(), gbm_get_mem(), GBM_HASH_INDEX, gbs_hash_entry::key, GB_HASH::nelem, gbs_hash_entry::next, and gbs_hash_entry::val.
Referenced by GBS_write_hash(), and GBS_write_hash_no_strdup().
Definition at line 454 of file adhash.cxx.
References write_hash().
Referenced by UniqueNameDetector::add_name(), an_add_short(), an_remove_short(), ap_mark_duplicates_rek(), arb_reduce_primer_len(), aw_create_shell(), aw_help_search(), aw_question(), AW_xfig::AW_xfig(), AW_root::awar_float(), AW_root::awar_int(), AW_root::awar_pointer(), AW_root::awar_string(), build_taxonomy_rek(), ST_Container::cache_Sonde(), ST_ML::calc_st_ml(), callDelay(), CLEAR_QUERIED(), DI_MATRIX::compress(), AW_xfig::create_gcs(), create_ref_hash(), AW_root::define_remote_command(), flush_cache_entry(), flush_taxonomy_cb(), GB_MAIN_TYPE::free_all_keys(), g_bs_add_value_tag_to_hash(), g_bs_read_tagged_hash(), gb_create_key(), GB_remove_on_exit(), gbcmc_read_keys(), GBP_add_callback(), GBP_remove_callback(), GBS_hash_do_sorted_loop(), GBT_add_item_to_hash(), GBT_check_alignment(), gbt_link_tree_to_hash_rek(), GBT_rename_species(), GDE_popup_filename_browser(), GEN_add_pseudo_species_to_hash(), Sondentopf::gen_color_hash(), get_cached_taxonomy(), get_short(), getIcon(), BI_helix::initFromData(), map_awXKey(), Package::mark_function_defined(), MERGE_sequences_simple(), MG_transfer_one_species(), nt_add(), nt_add_partial(), nt_build_conf_string_rek(), nt_build_sai_string(), NT_remove_species_in_tree_from_hash(), PT_build_species_hash(), MO_Liste::put_entry(), QUERY::search_duplicated_field_content(), DefinedCommands::set(), SET_QUERIED(), species_rename_join(), SpeciesSpace::SpeciesSpace(), st_ml_add_sequence_part_to_stat(), AW_selection_list::to_hash(), and UniqueNameDetector::UniqueNameDetector().
Definition at line 459 of file adhash.cxx.
References write_hash().
Referenced by an_get_prefix_hash().
Definition at line 467 of file adhash.cxx.
References ARB_strdup(), delete_from_list(), GB_HASH::entries, find_hash_entry(), gbm_get_mem(), GBM_HASH_INDEX, gbs_hash_entry::key, GB_HASH::nelem, gbs_hash_entry::next, result, and gbs_hash_entry::val.
Referenced by arb_prm_primer(), AWTC_pars_names(), flush_cache_entry(), GBT_check_data(), gbt_scan_db_rek(), GEN_testAndRemoveTranslations(), and MG_export_fields().
|
static |
Definition at line 493 of file adhash.cxx.
References GB_HASH::entries, GB_HASH::freefun, gb_assert, GB_warningf(), GBK_dump_backtrace(), gbm_free_mem(), GBM_HASH_INDEX, GB_HASH::nelem, gbs_hash_entry::next, NULp, and GB_HASH::size.
Referenced by GBS_free_hash().
void GBS_free_hash | ( | GB_HASH * | hs | ) |
Definition at line 538 of file adhash.cxx.
References GB_HASH::entries, gb_assert, and GBS_erase_hash().
Referenced by ARB_main(), arb_prm_primer(), aw_uninstall_xkeys(), AWTC_pars_names(), KeySorter::bubble_sort(), ST_ML::calc_st_ml(), ST_ML::cleanup(), probe_struct_global::cleanup(), DI_MATRIX::compress(), QUERY::copy_selection_list_2_query_box(), AW_xfig::create_gcs(), exit_removal(), find_SAI_candidates(), find_species_candidates(), free_cached_taxonomy(), g_bs_free_hash_of_hashes(), g_bs_free_hash_of_hashes_elem(), g_bs_get_string_of_tag_hash(), GBT_check_data(), gbt_free_rename_session_data(), GBT_link_tree(), GBT_link_tree_using_species_hash(), GEN_testAndRemoveTranslations(), getIcon(), BI_helix::initFromData(), insert_all_species_into_tree(), AP_tree::mark_duplicates(), mark_gene_species_of_marked_genes(), mark_genes_of_marked_gene_species(), MERGE_sequences_simple(), mg_transfer_listed_species(), nt_add(), nt_add_partial(), NT_alltree_remove_leafs(), nt_build_sai_string(), nt_create_configuration(), nt_extract_configuration(), NT_pseudo_species_to_organism(), perform_query_cb(), QUERY::search_duplicated_field_content(), species_rename_join(), st_ml_check_sequence_quality(), AW_root_Motif::~AW_root_Motif(), AW_xfig::~AW_xfig(), AWT_translator::~AWT_translator(), QUERY::DbQuery::~DbQuery(), DefinedCommands::~DefinedCommands(), EG2PS_data::~EG2PS_data(), gb_cache::~gb_cache(), GB_DbScanner::~GB_DbScanner(), GB_MAIN_TYPE::~GB_MAIN_TYPE(), MatrixOrder::~MatrixOrder(), MO_Liste::~MO_Liste(), Package::~Package(), Sondentopf::~Sondentopf(), SpeciesSpace::~SpeciesSpace(), SpecSetRegistry::~SpecSetRegistry(), ST_Container::~ST_Container(), ST_ML::~ST_ML(), and UniqueNameDetector::~UniqueNameDetector().
void GBS_hash_do_loop | ( | GB_HASH * | hs, |
gb_hash_loop_type | func, | ||
void * | client_data | ||
) |
Definition at line 545 of file adhash.cxx.
References delete_from_list(), GB_HASH::entries, gbs_hash_entry::next, GB_HASH::size, and gbs_hash_entry::val.
Referenced by arb_prm_primer(), ST_ML::calc_st_ml(), g_bs_free_hash_of_hashes(), BI_helix::initFromData(), insert_all_species_into_tree(), nt_add(), and AW_xfig::~AW_xfig().
void GBS_hash_do_const_loop | ( | const GB_HASH * | hs, |
gb_hash_const_loop_type | func, | ||
void * | client_data | ||
) |
Definition at line 559 of file adhash.cxx.
References GB_HASH::entries, gbs_hash_entry::next, and GB_HASH::size.
Referenced by AW_root::apply_focus_policy(), arb_prm_primer(), AW_forget_all_window_geometry(), aw_update_all_window_geometry_awars(), QUERY::DbQuery_update_list(), AW_root::dont_save_awars_with_default_value(), exit_removal(), GBS_hashtab_2_string(), GBT_check_data(), GBT_scan_db(), BI_helix::initFromData(), nt_add_partial(), AW_root::unlink_awars_from_DB(), and gb_cache::~gb_cache().
Definition at line 570 of file adhash.cxx.
References GB_HASH::nelem.
Referenced by AWT_translator::AWT_translator(), QUERY::copy_selection_list_2_query_box(), find_SAI_candidates(), find_species_candidates(), gb_create_key(), insert_all_species_into_tree(), nt_add(), nt_extract_configuration(), and perform_query_cb().
const char* GBS_hash_next_element_that | ( | const GB_HASH * | hs, |
const char * | last_key, | ||
bool(*)(const char *key, long val, void *cd) | condition, | ||
void * | cd | ||
) |
Definition at line 574 of file adhash.cxx.
References GB_HASH::entries, find_hash_entry(), gbs_hash_entry::key, gbs_hash_entry::next, NULp, GB_HASH::size, gbs_hash_entry::val, and while().
Referenced by tree_of_cached_taxonomy().
|
static |
Definition at line 605 of file adhash.cxx.
References gbs_hash_entry::key, and gbs_hash_entry::val.
Referenced by get_sorted_hash_values().
|
static |
Definition at line 612 of file adhash.cxx.
References ARB_calloc(), GB_HASH::entries, GB_sort(), GB_HASH::nelem, gbs_hash_entry::next, GB_HASH::size, and wrap_hashCompare4gb_sort().
Referenced by GBS_hash_do_const_sorted_loop(), and GBS_hash_do_sorted_loop().
void GBS_hash_do_sorted_loop | ( | GB_HASH * | hs, |
gb_hash_loop_type | func, | ||
gbs_hash_compare_function | sorter, | ||
void * | client_data | ||
) |
Definition at line 629 of file adhash.cxx.
References GBS_write_hash(), and get_sorted_hash_values().
Referenced by insert_all_species_into_tree().
void GBS_hash_do_const_sorted_loop | ( | const GB_HASH * | hs, |
gb_hash_const_loop_type | func, | ||
gbs_hash_compare_function | sorter, | ||
void * | client_data | ||
) |
Definition at line 641 of file adhash.cxx.
References get_sorted_hash_values().
Referenced by g_bs_get_string_of_tag_hash(), g_bs_read_tagged_hash(), nt_build_sai_string(), and gb_cache::~gb_cache().
Definition at line 653 of file adhash.cxx.
Referenced by g_bs_get_string_of_tag_hash(), g_bs_read_tagged_hash(), nt_build_sai_string(), and gb_cache::~gb_cache().
Definition at line 660 of file adhash.cxx.
References long.
Referenced by GBS_read_numhash(), and GBS_write_numhash().
GB_NUMHASH* GBS_create_numhash | ( | size_t | estimated_elements | ) |
Definition at line 668 of file adhash.cxx.
References ARB_calloc(), GB_NUMHASH::entries, hash_size(), GB_NUMHASH::nelem, and GB_NUMHASH::size.
Referenced by aw_install_xkeys(), and GB_MAIN_TYPE::login_remote().
long GBS_read_numhash | ( | GB_NUMHASH * | hs, |
long | key | ||
) |
Definition at line 679 of file adhash.cxx.
References GB_NUMHASH::entries, gbs_numhash_index(), numhash_entry::next, and GB_NUMHASH::size.
Referenced by aw_xkey_2_awkey(), gbcmc_begin_transaction(), GBCMC_find(), and gbcmc_unfold_list().
long GBS_write_numhash | ( | GB_NUMHASH * | hs, |
long | key, | ||
long | val | ||
) |
Definition at line 687 of file adhash.cxx.
References GB_NUMHASH::entries, gb_assert, gbm_free_mem(), gbm_get_mem(), GBM_HASH_INDEX, gbs_numhash_index(), numhash_entry::key, GB_NUMHASH::nelem, numhash_entry::next, GB_NUMHASH::size, and numhash_entry::val.
Referenced by gb_pre_delete_entry(), gbcm_read_bin(), gbcmc_end_sendupdate(), gbcmc_init_transaction(), and map_awXKey().
|
static |
Definition at line 727 of file adhash.cxx.
References GB_NUMHASH::entries, gbm_free_mem(), GBM_HASH_INDEX, GB_NUMHASH::nelem, numhash_entry::next, and GB_NUMHASH::size.
Referenced by GBS_free_numhash().
void GBS_free_numhash | ( | GB_NUMHASH * | hs | ) |
Definition at line 742 of file adhash.cxx.
References GB_NUMHASH::entries, and GBS_erase_numhash().
Referenced by aw_uninstall_xkeys(), and GB_MAIN_TYPE::~GB_MAIN_TYPE().
|
static |
Definition at line 53 of file adhash.cxx.