// file: dt_logl_0.cc
//

// isip include files
//
#include "decision_tree.h"
#include "decision_tree_constants.h"

// method: compute_likelihood_cc
//
// arguments: none
// 
// return: a float_4 likelihood value 
//
// this method computes the likelihood of the tree
//
float_4 Decision_tree::compute_likelihood_cc() {

  // local variables
  //
  float_4 likelihood = 0.0;
  Dt_node* dt_node = (Dt_node*)NULL;
  
  // get the head of the leaf nodes list
  //
  Link_node* link_nd = leaf_nodes_d->get_head_cc();
  
  // loop through the leaf nodes
  //
  while(link_nd != (Link_node*)NULL) {    
    dt_node = (Dt_node*)(link_nd->get_item_cc());    
    likelihood += dt_node->get_likelihood_cc();
    link_nd = link_nd->get_next_cc();
  }

  // exit gracefully
  //
  return likelihood;
}
