From f017bfbcbd6a6af80e7d2ce7303572e80a42196f Mon Sep 17 00:00:00 2001 From: astrojhgu Date: Sun, 4 Apr 2010 09:36:15 +0000 Subject: git-svn-id: file:///home/svn/opt_utilities@112 ed2142bd-67ad-457f-ba7c-d818d4011675 --- dynamical_fit/dynamical_fit.cpp | 63 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 dynamical_fit/dynamical_fit.cpp (limited to 'dynamical_fit') diff --git a/dynamical_fit/dynamical_fit.cpp b/dynamical_fit/dynamical_fit.cpp new file mode 100644 index 0000000..2ab33ce --- /dev/null +++ b/dynamical_fit/dynamical_fit.cpp @@ -0,0 +1,63 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace std; +using namespace opt_utilities; + + +int main(int argc,char* argv[]) +{ + if(argc!=2) + { + cerr<<"Usage: "<"<,double,std::string> fit; + fit.set_opt_method(powell_method >()); + fit.set_statistic(chisq,double,string>()); + std::string model_so_name; + cfg_file>>model_so_name; + cerr<<"loading model shared object "<,string>(model_so_name.c_str())); + + string data_file_name; + cfg_file>>data_file_name; + cerr<<"setting initializational values:"<>p>>v; + if(!cfg_file.good()) + { + break; + } + istringstream oss(v); + + double dvp=0; + oss>>dvp; + cerr< dl; + dl.load_from(data_file); + data_file.close(); + + fit.load_data(dl.get_data_set()); + + vector p=fit.fit(); + cout<