From 896a67e280d41df613092279f76913f8372faba1 Mon Sep 17 00:00:00 2001 From: astrojhgu Date: Sun, 11 Oct 2009 16:24:22 +0000 Subject: git-svn-id: file:///home/svn/opt_utilities@79 ed2142bd-67ad-457f-ba7c-d818d4011675 --- methods/aga/aga.hpp | 24 +++++++++++++++++++----- methods/powell/powell_method.hpp | 16 +++++++++++----- 2 files changed, 30 insertions(+), 10 deletions(-) (limited to 'methods') diff --git a/methods/aga/aga.hpp b/methods/aga/aga.hpp index cf0b4a6..77c5700 100644 --- a/methods/aga/aga.hpp +++ b/methods/aga/aga.hpp @@ -69,7 +69,7 @@ namespace opt_utilities pT reproduction_box; std::vector > samples; std::vector buffer; - + mutable bool bstop; private: typename element_type_trait::element_type uni_rand (typename element_type_trait::element_type x1, @@ -216,7 +216,7 @@ namespace opt_utilities } pT lb(get_size(samples[0].p)); pT ub(get_size(samples[0].p)); - for(int i=0;ip; } + + void do_stop() + { + bstop=true; + } }; 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* p_fo; optimizer* p_optimizer; - + mutable bool bstop; //typedef blitz::Array 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