// file: tr_tr_cstr_2.cc
//

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

// method: constructor
//
// arguments:
//  Train_Trace* trace : (input) the back pointer trace
//  float_8 score : (input) the incremental score
//
// return: none
//
// this is an overloaded constructor
//
Train_Trace::Train_Trace(Train_Trace* trace_a, float_8 score_a) {

  // set the parameters
  //  
  ref_count_d = (int_4)0;
  active_d = ISIP_FALSE;

  // copy other attributes if okay
  //
  if (trace_a == (Train_Trace*)NULL) {
    lat_node_d = (Train_Lattice_node*)NULL;
    lex_node_d = (Train_Lex_node*)NULL;

    level_d = TRAIN_TRACE_DEFAULT_INDEX;
    phone_index_d = TRAIN_TRACE_DEFAULT_INDEX;
    state_index_d = TRAIN_TRACE_DEFAULT_INDEX;

    max_mixture_d = (int_4)0;
    frame_index_d = (int_4)0;
    score_d = score_a;

    backptr_size_d = (int_4)0;
    back_ptr_d = (Train_Trace**)NULL;
  }
  
  else {
    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;
    state_index_d = trace_a->state_index_d;  

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

    backptr_size_d = trace_a->backptr_size_d;
    back_ptr_d = trace_a->back_ptr_d;
  }
  
  // exit gracefully
  //
}

