diff options
author | astrojhgu <astrojhgu@ed2142bd-67ad-457f-ba7c-d818d4011675> | 2009-10-11 16:24:22 +0000 |
---|---|---|
committer | astrojhgu <astrojhgu@ed2142bd-67ad-457f-ba7c-d818d4011675> | 2009-10-11 16:24:22 +0000 |
commit | 896a67e280d41df613092279f76913f8372faba1 (patch) | |
tree | ef5c2a83f1291d47dd56ee9969d244ceb1b7fc4c /methods/powell | |
parent | 3fcb4f104a8b81937f93ef4b298dd51e3c1eec94 (diff) | |
download | opt-utilities-896a67e280d41df613092279f76913f8372faba1.tar.bz2 |
git-svn-id: file:///home/svn/opt_utilities@79 ed2142bd-67ad-457f-ba7c-d818d4011675
Diffstat (limited to 'methods/powell')
-rw-r--r-- | methods/powell/powell_method.hpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/methods/powell/powell_method.hpp b/methods/powell/powell_method.hpp index 0ec095c..ee5adeb 100644 --- a/methods/powell/powell_method.hpp +++ b/methods/powell/powell_method.hpp @@ -31,7 +31,7 @@ namespace opt_utilities private: func_obj<rT,pT>* p_fo; optimizer<rT,pT>* p_optimizer; - + mutable bool bstop; //typedef blitz::Array<rT,2> array2d_type; @@ -99,13 +99,13 @@ namespace opt_utilities array1d_type ptt(n); array1d_type xit(n); fret=p_fo->eval(p); - + for(j=0;j<n;++j) { //get_element(pt,j)=get_element(p,j); set_element(pt,j,get_element(p,j)); } - for(iter=0;;++iter) + for(iter=0;!bstop;++iter) { fp=fret; ibig=0; @@ -238,7 +238,7 @@ namespace opt_utilities pT do_optimize() { - + bstop=false; init_xi((int)get_size(start_point)); @@ -255,7 +255,13 @@ namespace opt_utilities rT fret; powell(end_point,threshold,iter,fret); return end_point; - } + } + + void do_stop() + { + bstop=true; + } + }; } |