// file: $PDSP/class/fourier_transform/v3.0/ft_cstr_0.cc
//

// isip include files
//
#include "fourier_transform.h"

// method: destructor
//
// arguments: none
//
// return: none
//
// this is the default destructor
//
Fourier_transform::~Fourier_transform() {

  // clean up memory and reset
  //
  
  // for discrete fourier transform
  //
  df_last_order_d = (int_4)-1;
  
  if (df_wi_d != (float_8*)NULL) {
    delete [] df_wi_d;
  }
  if (df_wr_d != (float_8*)NULL) {
    delete [] df_wr_d;
  }

  // for radix-2 algorithm
  //
  rad2_last_order_d = (int_4)-1;

  if (rad2_wi_d != (float_8*)NULL) {
    delete [] rad2_wi_d;
  }
  if (rad2_wr_d != (float_8*)NULL) {
    delete [] rad2_wr_d;
  }
  if (rad2_temp_d != (float_8*)NULL) {
    delete [] rad2_temp_d;
  }
  
  // for radix-4 algorithm
  //
  rad4_last_order_d = (int_4)-1;
  
  if (rad4_wi_d != (float_8*)NULL) {
    delete [] rad4_wi_d;
  }
  if (rad4_wr_d != (float_8*)NULL) {
    delete [] rad4_wr_d;
  }
  if (rad4_temp_d != (float_8*)NULL) {
    delete [] rad4_temp_d;
  }

  // for split-radix algorithm
  //
  sr_last_order_d = (int_4)-1;

  if (sr_wi_d != (float_8*)NULL) {
    delete [] sr_wi_d;
  }
  if (sr_wr_d != (float_8*)NULL) {
    delete [] sr_wr_d;
  }
  if (sr_temp_d != (float_8*)NULL) {
    delete [] sr_temp_d;
  }
  
  // for fast-hartley algorithm
  //
  fh_last_order_d = (int_4)-1;
  
  if (fh_temp_d != (float_8*)NULL) {
    delete [] fh_temp_d;
  }
  if (fh_temp_input_d != (float_8*)NULL) {
    delete [] fh_temp_input_d;
  }
  if (fh_temp_output_d != (float_8*)NULL) {
    delete [] fh_temp_output_d;
  }


  // for quick-fourier-transform algorithm
  //
  qf_last_order_d = (int_4)-1;

  if (qf_real_temp_d != (float_8*)NULL) {
    delete [] qf_real_temp_d;
  }
  if (qf_imag_temp_d != (float_8*)NULL) {
    delete [] qf_imag_temp_d;
  }
  if (qf_real_coeff_d != (float_8*)NULL) {
    delete [] qf_real_coeff_d;
  }
  if (qf_imag_coeff_d != (float_8*)NULL) {
    delete [] qf_imag_coeff_d;
  }
  if (qf_comp_real_temp_d != (float_8*)NULL) {
    delete [] qf_comp_real_temp_d;
  }
  if (qf_comp_imag_temp_d != (float_8*)NULL) {
    delete [] qf_comp_imag_temp_d;
  }
  if (qf_comp_real_coeff_d != (float_8*)NULL) {
    delete [] qf_comp_real_coeff_d;
  }
  if (qf_comp_imag_coeff_d != (float_8*)NULL) {
    delete [] qf_comp_imag_coeff_d;
  }
  
  // for decimation-in-time-frequency algorithm
  //
  ditf_last_order_d = (int_4)-1;

  if (ditf_wi_d != (float_8*)NULL) {
    delete [] ditf_wi_d;
  }
  if (ditf_wr_d != (float_8*)NULL) {
    delete [] ditf_wr_d;
  }
  if (ditf_temp_d != (float_8*)NULL) {
    delete [] ditf_temp_d;
  }
  if (ditf_trans_factor_indices_d != (int_4*)NULL) {
    delete [] ditf_trans_factor_indices_d;
  }
  if (ditf_indices_d != (int_4*)NULL) {
    delete [] ditf_indices_d;
  }
  

  
  // for prime-factor algorithm
  //
  
  // exit gracefully
  //
}
