latn_add_4.cc
来自「这是处理语音信号的程序」· CC 代码 · 共 55 行
CC
55 行
// file: latn_add_4.cc//// isip include files//#include "lattice_node.h"#include "lattice_node_constants.h"// method: add_ac_score_cc//// arguments:// float_4 ac_score: (input) ac score to be added//// return: logical_1 indicating status//// this method adds the ac score for the node just created//logical_1 Lattice_node::add_ac_score_cc(float_4 ac_score_a) { // define a temporary array // float_4* new_list = new float_4[num_arcs_out_d]; // check if the ac_scores array exists // if ((num_arcs_out_d > 1) && (ac_scores_d != (float_4*)NULL)) { // copy old data to new array // memcpy(new_list, ac_scores_d, (num_arcs_out_d - 1) * sizeof(float_4)); } // add the new value to the end of the array // new_list[(num_arcs_out_d - 1)] = ac_score_a; // free old memory and reset pointers // if (ac_scores_d != (float_4*)NULL) { delete [] ac_scores_d; ac_scores_d = (float_4*)NULL; } ac_scores_d = new_list; // exit gracefully // return ISIP_TRUE;}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?