From 28fcd862c8831dd4e29f744d162f9181a6e14ac8 Mon Sep 17 00:00:00 2001 From: astrojhgu Date: Thu, 14 Oct 2010 17:32:33 +0000 Subject: git-svn-id: file:///home/svn/opt_utilities@137 ed2142bd-67ad-457f-ba7c-d818d4011675 --- statistics/cstat.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'statistics') diff --git a/statistics/cstat.hpp b/statistics/cstat.hpp index 4a647e1..7193a93 100644 --- a/statistics/cstat.hpp +++ b/statistics/cstat.hpp @@ -6,7 +6,10 @@ #define CSTAT_HPP #define OPT_HEADER #include +#include #include +#include + using std::cout;using std::endl; namespace opt_utilities @@ -50,7 +53,7 @@ namespace opt_utilities for(int i=(this->get_data_set()).size()-1;i>=0;--i) { Ty model_y=eval_model(this->get_data_set().get_data(i).get_x(),p); - result-=this->get_data_set().get_data(i).get_y()*std::log(model_y); + result-=contract(this->get_data_set().get_data(i).get_y(),std::log(model_y),result); } if(verb) -- cgit v1.2.2