// file: st_set_2.cc
//

// isip include files
//
#include "state.h"
#include "state_constants.h"
 
// method: set_scale_cc
//
// arguments:
//  float_4* scale : (input) scale factors
//
// return: a logical_1 indicating success
//
// this method sets the scale factors
//
logical_1 State::set_scale_cc(float_4* scale_a) {

  // delete existing memory
  //
  if (scale_d != (float_4*)NULL) {
    delete [] scale_d;
  }
  scale_d = (float_4*)NULL;
  
  // allocate memory for scale factors and copy data
  //
  scale_d = new float_4[num_mixtures_d];
  memcpy(scale_d, scale_a, num_mixtures_d * sizeof(float_4));

  // exit gracefully
  //
  return ISIP_TRUE;
}
