// file: $isip/class/pr/PhoneticDecisionTreeNode/pdtnod_05.cc
// version: $Id: pdtnod_05.cc 8863 2002-12-05 21:22:52Z parihar $
//

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

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

  // copy the values
  //
  datapoints_d.assign(copy_node_a.datapoints_d);
  best_attribute_d.assign(copy_node_a.best_attribute_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 PhoneticDecisionTreeNode
//
boolean PhoneticDecisionTreeNode::clear(Integral::CMODE cmode_a) {

  // reset the values
  //
  datapoints_d.clear(cmode_a);
  best_attribute_d.clear(cmode_a);
  typical_index_d = DEF_TYPICAL_INDEX;
  actual_index_d = DEF_ACTUAL_INDEX;
  typical_stat_model_d.clear(cmode_a);
  flag_exists_d = DEF_FLAG_EXISTS;
  
  // exit gracefully
  //
  return true;
}

// method: eq
//
// arguments: const PhoneticDecisionTreeNode& compare_node: (input)
//            PhoneticDecisionTreeNode to compare
//
// return: true if the PhoneticDecisionTreeNodes are equivalent, else false
//
boolean PhoneticDecisionTreeNode::eq(const PhoneticDecisionTreeNode&
				     arg_a) const {

  // compare the data members
  //
  if ((!datapoints_d.eq(arg_a.datapoints_d)) ||
      (!best_attribute_d.eq(arg_a.best_attribute_d)) ||
      (typical_index_d != arg_a.typical_index_d) ||
      (actual_index_d != arg_a.actual_index_d) ||
      (!typical_stat_model_d.eq(arg_a.typical_stat_model_d)) ||
      (flag_exists_d != arg_a.flag_exists_d)) {
    return false;
  }
  
  // exit gracefully
  //
  return true;
}
