diff options
author | astrojhgu <astrojhgu@ed2142bd-67ad-457f-ba7c-d818d4011675> | 2012-04-07 16:01:03 +0000 |
---|---|---|
committer | astrojhgu <astrojhgu@ed2142bd-67ad-457f-ba7c-d818d4011675> | 2012-04-07 16:01:03 +0000 |
commit | 78d84eebe69da1d008c1f7a07628846b3e039d65 (patch) | |
tree | ce3fa48c4f8cfe73641dfd31030c103cb6921c7d | |
parent | 308a7b53b1c1e5fbb3e2b1c1471a138bbd4fd71f (diff) | |
download | opt-utilities-78d84eebe69da1d008c1f7a07628846b3e039d65.tar.bz2 |
git-svn-id: file:///home/svn/opt_utilities@232 ed2142bd-67ad-457f-ba7c-d818d4011675
-rw-r--r-- | test/test_cg.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/test/test_cg.cpp b/test/test_cg.cpp index a080cc5..cb89f71 100644 --- a/test/test_cg.cpp +++ b/test/test_cg.cpp @@ -17,7 +17,7 @@ class foo { static int call_cnt=0; ++call_cnt; - cerr<<call_cnt<<endl; + //cerr<<call_cnt<<endl; double result=0; for(int i=0;i<p.size();++i) { @@ -44,11 +44,14 @@ class foo int main() { optimizer<double,vector<double> > opt; - //opt.set_opt_method(conjugate_gradient<double,vector<double> >()); - opt.set_opt_method(powell_method<double,vector<double> >()); + opt.set_opt_method(conjugate_gradient<double,vector<double> >()); + //opt.set_opt_method(powell_method<double,vector<double> >()); opt.set_func_obj(foo()); - std::vector<double> p(2); - p[0]=p[1]=4; + std::vector<double> p(30); + for(int i=0;i<p.size();++i) + { + p[i]=100; + } opt.set_start_point(p); p=opt.optimize(); cout<<p[0]<<"\t"<<p[1]<<endl; |