// file: st_set_3.cc
//

// isip include files
//
#include "state.h"
#include "state_constants.h"
 
// method: set_mean_cc
//
// arguments:
//  flaot_4** mean : (input) mean vectors
//
// return: a logical_1 indicating success
//
// this method sets the mean vectors of all the mixtures
//
logical_1 State::set_mean_cc(float_4** mean_a) {

  // free existing memory
  //
  if (mean_d != (float_4**)NULL) {
    for (int_4 i = 0; i < num_mixtures_d; i++) {
      delete [] mean_d[i];
    }
    delete [] mean_d;
  }
  
  // allocate memory for mean and copy data
  //
  mean_d = new float_4*[num_mixtures_d];
  for (int_4 i = 0; i < num_mixtures_d; i++) {
    mean_d[i] = new float_4[num_features_d];
    memcpy(mean_d[i], mean_a[i], num_features_d * sizeof(float_4));
  }
  
  // exit gracefully
  //
  return ISIP_TRUE;
}
