// file: $isip/class/pr/RegressionDecisionTreeNode/rdtnod_05.cc
// version: $Id: rdtnod_05.cc 9460 2004-04-19 22:27:11Z gao $
//

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

// method: assign
//
// arguments:
//  const RegressionDecisionTreeNode& copy_node: (input) node to copy
//
// return: logical error status
//
// assign RegressionDecisionTreeNode from the copy
//
boolean RegressionDecisionTreeNode::assign(const RegressionDecisionTreeNode&
					 copy_node_a) {

  // copy the values
  //
  gaussian_models_d.assign(copy_node_a.gaussian_models_d);
  
  average_mean_d.assign(copy_node_a.average_mean_d);
  cluster_score_d.assign(copy_node_a.cluster_score_d);
  cluster_accumulate_d.assign(copy_node_a.cluster_accumulate_d);
  number_components_d = copy_node_a.number_components_d;
  node_index_d.assign(copy_node_a.node_index_d);
  average_covariance_d.assign(copy_node_a.average_covariance_d);
  
  parent_node_index_d = copy_node_a.parent_node_index_d;
  speech_flag_d.assign(copy_node_a.speech_flag_d);
  split_flag_d.assign(copy_node_a.split_flag_d);
  w_transform_d.assign(copy_node_a.w_transform_d);
  
  //  typical_index_d.assign(copy_node_a.typical_index_d);
  //  actual_index_d.assign(copy_node_a.actual_index_d);
  //  typical_stat_model_d.assign(copy_node_a.typical_stat_model_d);
  //  flag_exists_d.assign(copy_node_a.flag_exists_d);
  
  
  // exit gracefully
  //
  return true;
}

// method: clear
//
// arguments:
//  Integral::CMODE cmode: (input) clear mode
//
// return: logical error status
//
// clear the contents of the RegressionDecisionTreeNode
//
boolean RegressionDecisionTreeNode::clear(Integral::CMODE cmode_a) {

  // reset the values
  //
  gaussian_models_d.clear(cmode_a);
  average_mean_d.clear(cmode_a);

  average_covariance_d.clear(cmode_a);
  
  // exit gracefully
  //
  return true;
}

// method: eq
//
// arguments:
//  const RegressionDecisionTreeNode& arg: (input) node to compare
//
// return: true if the RegressionDecisionTreeNodes are equivalent, else false
//
boolean RegressionDecisionTreeNode::eq(const RegressionDecisionTreeNode&
				       arg_a) const {

  // compare the data members
  //
  if ((!gaussian_models_d.eq(arg_a.gaussian_models_d)) ||
      (!average_mean_d.eq(arg_a.average_mean_d)) ||
      (cluster_score_d != arg_a.cluster_score_d) ||
      (cluster_accumulate_d != arg_a.cluster_accumulate_d) ||
      (number_components_d != arg_a.number_components_d) ||
      (node_index_d != arg_a.node_index_d) ||
      (!average_covariance_d.eq(arg_a.average_covariance_d))) {

    return false;
  }
  
  // exit gracefully
  //
  return true;
}


