// file: tr_st_set_1.cc
//

// isip include files
//
#include "train_state.h"
#include "train_state_constants.h"
 
// method: set_weights_cc
//
// arguments:
//  float_4* weights : (input) mixture weights 
//
// return: a logical_1 indicating success
//
// this method sets the mixture weights
//
logical_1 Train_State::set_weights_cc(float_4* weights_a) {

  // delete existing memory
  //
  if (weights_d != (float_4*)NULL) {
    delete [] weights_d;
  }
  weights_d = (float_4*)NULL;
  
  // allocate memory for mixture weights and copy data
  //
  weights_d = new float_4[num_mixtures_d];
  memcpy(weights_d, weights_a, num_mixtures_d * sizeof(float_4));

  // exit gracefully
  //
  return ISIP_TRUE;
}
