📄 ssrch_08.cc
字号:
// file: $isip/class/search/StackSearch/ssrch_08.cc// version: $Id: ssrch_08.cc,v 1.3 2002/08/02 02:07:17 jelinek Exp $//// isip include files//#include "StackSearch.h"// method: clear//// arguments:// Integral::CMODE cmode: (input) clear mode//// return: a boolean value indicating status//// clear the contents of the search//boolean StackSearch::clear(Integral::CMODE cmode_a) { // if in retain mode then call initializeDecode and return // if (cmode_a == Integral::RETAIN) { // clean trace lists, search node lists and generate initial traces // return initializeLinearDecoder(); } // clear all of the data members // else { features_d.clear(cmode_a); search_levels_d.clear(cmode_a); max_frame_scores_d.clear(cmode_a); max_stack_scores_d.clear(cmode_a); stat_model_scores_d.clear(cmode_a); // clear the trace lists // clearTraceStorage(); // clear the frame number // current_frame_d = START_FRAME; // exit gracefully // return true; }}// method: clearTraceStorage//// arguments: none//// return: logical error status//// clear the trace storage//boolean StackSearch::clearTraceStorage() { // define local variables // Trace* tmp_trace; long num_levels = trace_lists_d.length(); // use the valid_hyps_d list as temporary storage // for (long i = 0; i < num_levels; i++) { while (!trace_lists_d(i).isEmpty()) { trace_lists_d(i).removeFirst(tmp_trace); valid_hyps_d.insertLast(tmp_trace); } } // loop over all traces in the valid hypotheses list // while (!valid_hyps_d.isEmpty()) { // remove this trace from the list. if it is not referenced, then delete it // valid_hyps_d.removeFirst(tmp_trace); if (tmp_trace->getRefCount() < 1) { Trace::deleteTrace(tmp_trace, true, true); } else { valid_hyps_d.insertLast(tmp_trace); } } // exit gracefully // return true;}// method: clearValidHypsTrace//// arguments: none//// return: logical error status//// clear the traces stored in the valid hypothesis list//boolean StackSearch::clearValidHypsTrace() { // define local variables // Trace* tmp_trace; // use the valid_hyps_d list as temporary storage // while (valid_hyps_d.removeFirst(tmp_trace)) { if (tmp_trace != (Trace*)NULL) { Trace::deleteTrace(tmp_trace, true); } } // exit gracefully // return true;}// method: clearSearchNodesTraceLists//// arguments: none//// return: logical error status//// clear the list of traces from all the search nodes//boolean StackSearch::clearSearchNodesTraceLists() { // define local variables // long num_levels = getNumLevels(); DiGraph<SearchNode>* sub_graph; SearchNode* snode; // loop through all levels // for (long level_num = 0; level_num < num_levels; level_num++) { long num_sub_graphs = getSearchLevel(level_num).getNumSubGraphs(); // loop through all subgraphs // for (long sub_ind = 0; sub_ind < num_sub_graphs; sub_ind++) { sub_graph = &(getSearchLevel(level_num).getSubGraph(sub_ind)); // loop through all vertices // for (boolean more_vertices = sub_graph->gotoFirst(); more_vertices; more_vertices = sub_graph->gotoNext()) { snode = const_cast< SearchNode* >(sub_graph->getCurr()->getItem()); snode->clearTraceList(); } } } // exit gracefully // return true;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -