38 int char_reco_cost,
LangModEdge *edge,
int col_idx);
68 inline int ColIdx() {
return col_idx_; }
76 return (*(reinterpret_cast<SearchNode * const *>(node1)))->best_cost_ -
77 (*(
reinterpret_cast<SearchNode *
const *
>(node2)))->best_cost_;
91 int mean_char_reco_cost_ ;
94 int best_path_reco_cost_;
112 memset(bin_size_array_, 0,
sizeof(bin_size_array_));
121 unsigned int edge_hash = lang_mod_edge->
Hash();
122 unsigned int parent_hash = (srch_node->
ParentNode() == NULL ?
124 unsigned int hash_bin = (edge_hash + parent_hash) % kSearchNodeHashBins;
127 if (bin_size_array_[hash_bin] >= kMaxSearchNodePerBin) {
131 bin_array_[hash_bin][bin_size_array_[hash_bin]++] = srch_node;
140 unsigned int edge_hash = lang_mod_edge->
Hash();
141 unsigned int parent_hash = (parent_node == NULL ?
143 unsigned int hash_bin = (edge_hash + parent_hash) % kSearchNodeHashBins;
146 for (
int node_idx = 0; node_idx < bin_size_array_[hash_bin]; node_idx++) {
150 bin_array_[hash_bin][node_idx]->ParentNode(), parent_node) ==
true) {
151 return bin_array_[hash_bin][node_idx];
161 static const int kSearchNodeHashBins = 4096;
162 static const int kMaxSearchNodePerBin = 512;
163 int bin_size_array_[kSearchNodeHashBins];
164 SearchNode *bin_array_[kSearchNodeHashBins][kMaxSearchNodePerBin];
168 #endif // SEARCH_NODE_H bool UpdateParent(SearchNode *new_parent, int new_reco_cost, LangModEdge *new_edge)
static bool IdenticalPath(SearchNode *node1, SearchNode *node2)
SearchNode * ParentNode()
void SetString(char_32 *str)
bool Insert(LangModEdge *lang_mod_edge, SearchNode *srch_node)
virtual bool IsIdentical(LangModEdge *edge) const =0
LangModEdge * LangModelEdge()
virtual unsigned int Hash() const =0
SearchNode * Lookup(LangModEdge *lang_mod_edge, SearchNode *parent_node)
static int SearchNodeComparer(const void *node1, const void *node2)
const char_32 * NodeString()
SearchNode(CubeRecoContext *cntxt, SearchNode *parent_node, int char_reco_cost, LangModEdge *edge, int col_idx)