// file: ht_state_1.cc
//
// isip include files
//
#include "hmm_train.h"
#include "hmm_train_constants.h"

// method: get_state_ind_cc
//
// arguments:
//  Train_Trace* trace : (input) the trace need to update the mean and variance
//  int_4& st_ind : (output) the index of the current trace
//  int_4* mod_map : (input) the mapping from the phone index to model index
//  int_4** st_map : (input) the mapping from the model index and temp state
//                           index to the state index
//
// return: a logical_1 flag indicating success
//
// this method compute the index of the state for the current trace according
// to the state file
//
logical_1 get_ind_st_cc(Train_Trace* trace_a, int_4& st_ind, int_4* mod_map_a,
			int_4** st_map_a) {

  // variable to compute the index
  //
  int_4 ph_ind;
  int_4 state_ind;
  
  // get the phone index
  //
  ph_ind = trace_a->get_phone_ind_cc();
  state_ind = (int_4)trace_a->get_state_ind_cc();

  st_ind = st_map_a[mod_map_a[ph_ind]][state_ind];

  // exit gracefully
  //
  return ISIP_TRUE;
}

		     
    
 
 
