diff options
author | astrojhgu <astrojhgu@ed2142bd-67ad-457f-ba7c-d818d4011675> | 2010-10-14 17:32:33 +0000 |
---|---|---|
committer | astrojhgu <astrojhgu@ed2142bd-67ad-457f-ba7c-d818d4011675> | 2010-10-14 17:32:33 +0000 |
commit | 28fcd862c8831dd4e29f744d162f9181a6e14ac8 (patch) | |
tree | 686bcc01ddb1724336df26b6e52c713e68303ba4 /statistics | |
parent | aa3e3a1d67927d338dc62125c342f06d27c8d91e (diff) | |
download | opt-utilities-28fcd862c8831dd4e29f744d162f9181a6e14ac8.tar.bz2 |
git-svn-id: file:///home/svn/opt_utilities@137 ed2142bd-67ad-457f-ba7c-d818d4011675
Diffstat (limited to 'statistics')
-rw-r--r-- | statistics/cstat.hpp | 5 |
1 files changed, 4 insertions, 1 deletions
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 <core/fitter.hpp>
+#include <math/vector_operation.hpp>
#include <iostream>
+#include <cassert>
+
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)
|