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

// method: init_train_cc
//
// arguments:
//
// return: a logical flag to indicate success
//
logical_1 init_train_cc ( int_4 num_states_a, int_4 num_mix_a,
			 int_4 num_features_a, float_8*** train_mean_a,
			 float_8*** train_covar_a, int_4** count_a,
			 int_4 num_trans_a, int_4 state_num_a,
			 int_4*** trans_count_a, float_4*** transitions_a) {


  // initialize the arrays for TRAIN
  //
  for (int_4 i = 0; i < num_states_a; i++) {
    for (int_4 j = 0; j < num_mix_a; j++) {
      for (int_4 k = 0; k < num_features_a; k++) {
	train_mean_a[i][j][k] = (float_8)0.0;
      }
    }
  }

  for (int_4 i = 0; i < num_states_a; i++) {
    for (int_4 j = 0; j < num_mix_a; j++) {
      for (int_4 k = 0; k < num_features_a; k++) {
	train_covar_a[i][j][k] = (float_8)0.0;
      }
    }
  }

  for (int_4 i = 0; i < num_states_a; i++) {
    for (int_4 j = 0; j < num_mix_a; j++) {
      count_a[i][j] = (int_4)0;
    }
  }
  
  for (int_4 i = 0; i < num_trans_a; i++) {
    for (int_4 j = 0; j < state_num_a; j++) {
      for (int_4 k = 0; k < state_num_a; k++) {
	trans_count_a[i][j][k] = (int_4)0;
      }
    }
  }

  /*
  //for test don't update transitions
  
for (int_4 i = 1; i < num_trans_a; i++) {
    for (int_4 j = 0; j < state_num_a; j++) {
      for (int_4 k = 0; k < state_num_a; k++) {
	transitions_a[i][j][k] = log(transitions_a[i][j][k]);
      }
    }
  }

  */
  
 return ISIP_TRUE; 
  
}
