#include <search_node.h>
List of all members.
Detailed Description
Definition at line 109 of file search_node.h.
Constructor & Destructor Documentation
tesseract::SearchNodeHashTable::SearchNodeHashTable |
( |
| ) |
|
|
inline |
Definition at line 111 of file search_node.h.
{
memset(bin_size_array_, 0, sizeof(bin_size_array_));
}
tesseract::SearchNodeHashTable::~SearchNodeHashTable |
( |
| ) |
|
|
inline |
Member Function Documentation
Definition at line 119 of file search_node.h.
{
unsigned int edge_hash = lang_mod_edge->Hash();
unsigned int parent_hash = (srch_node->ParentNode() ==
NULL ?
0 : srch_node->ParentNode()->LangModelEdge()->Hash());
unsigned int hash_bin = (edge_hash + parent_hash) % kSearchNodeHashBins;
if (bin_size_array_[hash_bin] >= kMaxSearchNodePerBin) {
return false;
}
bin_array_[hash_bin][bin_size_array_[hash_bin]++] = srch_node;
return true;
}
Definition at line 137 of file search_node.h.
{
unsigned int edge_hash = lang_mod_edge->Hash();
unsigned int parent_hash = (parent_node ==
NULL ?
0 : parent_node->LangModelEdge()->Hash());
unsigned int hash_bin = (edge_hash + parent_hash) % kSearchNodeHashBins;
for (int node_idx = 0; node_idx < bin_size_array_[hash_bin]; node_idx++) {
if (lang_mod_edge->IsIdentical(
bin_array_[hash_bin][node_idx]->LangModelEdge()) == true &&
bin_array_[hash_bin][node_idx]->ParentNode(), parent_node) == true) {
return bin_array_[hash_bin][node_idx];
}
}
}
The documentation for this class was generated from the following file: