latn_add_3.cc

来自「这是处理语音信号的程序」· CC 代码 · 共 55 行

CC
55
字号
// file: latn_add_3.cc//// isip include files//#include "lattice_node.h"#include "lattice_node_constants.h"// method: add_lm_score_cc//// arguments://  float_4 lm_score: (input) lm score to be added//// return: logical_1 indicating status//// this method adds the lm score for the node just created//logical_1 Lattice_node::add_lm_score_cc(float_4 lm_score_a) {  // define a temporary array  //  float_4* new_list = new float_4[num_arcs_out_d];  // check if the lm_scores array exists  //  if ((num_arcs_out_d > 1) && (lm_scores_d != (float_4*)NULL)) {        // copy old data to new array    //    memcpy(new_list, lm_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] = lm_score_a;    // free old memory and reset pointers  //  if (lm_scores_d != (float_4*)NULL) {    delete [] lm_scores_d;    lm_scores_d = (float_4*)NULL;  }  lm_scores_d = new_list;        // exit gracefully  //  return ISIP_TRUE;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?