// file: tr_tr_path_0.cc
//

// isip include files
//
#include "train_trace.h"
#include "train_trace_constants.h"

// method: project_trace_cc
//
// arguments:
//  Train_Trace* trace : (input) the trace so far
//  float_8 score : (input) the incremental score
//
// return: a logical_1 indicating status
//
// this method projects the trace onwards and updates the score
//
logical_1 Train_Trace::project_trace_cc(Train_Trace* trace_a, float_8 score_a) {

  // make sure the input trace is valid
  //
  if (trace_a == (Train_Trace*)NULL) {
    return ISIP_FALSE;
  }

  // initialize values in the current trace
  //
  score_d = score_a;
  ref_count_d = (int_4)0;
  active_d = ISIP_FALSE;
  
  // copy the parameters
  //
  lat_node_d = trace_a->lat_node_d;
  lex_node_d = trace_a->lex_node_d;
  
  level_d = trace_a->level_d;
  phone_index_d = trace_a->phone_index_d;  

  max_mixture_d = trace_a->max_mixture_d;
  frame_index_d = trace_a->frame_index_d;
  score_d += trace_a->score_d;

  // clear the back-pointer array
  //
  if (back_ptr_d != (Train_Trace**)NULL) {
    delete [] back_ptr_d;
  }
  back_ptr_d = (Train_Trace**)NULL;

  // exit gracefully
  //
  return ISIP_TRUE;
}
