// file: dtn_cstr_2.cc
//

// isip include files
//
#include "dt_node.h"
#include "dt_node_constants.h"

// method: constructor
//
// arguments:
//  const Dt_node& node: (input) the dt_node to copy
//
// return: none
//
// this is a copy constructor
//
Dt_node::Dt_node(const Dt_node& node_a) {
  
  // set the parent and children information
  //
  parent_d = node_a.parent_d;
  
  if (node_a.l_child_d != (Dt_node*)NULL) {
    l_child_d = new Dt_node(*(node_a.l_child_d));
  }
  else {
    l_child_d = (Dt_node*)NULL;
  }
  
  if (node_a.r_child_d != (Dt_node*)NULL) {
    r_child_d = new Dt_node(*(node_a.r_child_d));
  }
  else {
    r_child_d = (Dt_node*)NULL;
  }
  
  // set the optimal question
  //
  opt_question_d = node_a.opt_question_d;
  
  // initialize the state indices at this node
  //
  num_states_d = node_a.num_states_d;
  state_index_d = new int_4[num_states_d];
  memcpy(state_index_d, node_a.state_index_d, num_states_d*sizeof(int_4));
  
  // initialize the score information
  //
  likelihood_d = node_a.likelihood_d;
  split_lk_inc_d = node_a.split_lk_inc_d;
  
  // set the label value
  //  
  label_d = node_a.label_d;
  
  // set the flag value
  //
  flag_leaf_d = node_a.flag_leaf_d ;
  flag_visit_d = node_a.flag_visit_d;  
  
  // exit gracefully
  //
}
