aboutsummaryrefslogtreecommitdiffstats
path: root/methods/aga/aga.hpp
diff options
context:
space:
mode:
authorastrojhgu <astrojhgu@ed2142bd-67ad-457f-ba7c-d818d4011675>2009-08-23 13:08:26 +0000
committerastrojhgu <astrojhgu@ed2142bd-67ad-457f-ba7c-d818d4011675>2009-08-23 13:08:26 +0000
commitf11adda11d1275bcff45b20c15194d7a76bb6b59 (patch)
treeb57521b8eeef3fe85130ebb32a964a3dbac7aebd /methods/aga/aga.hpp
parent1a63d3a669ebcff212e52ddb1e4efae473550f9f (diff)
downloadopt-utilities-f11adda11d1275bcff45b20c15194d7a76bb6b59.tar.bz2
git-svn-id: file:///home/svn/opt_utilities@54 ed2142bd-67ad-457f-ba7c-d818d4011675
Diffstat (limited to 'methods/aga/aga.hpp')
-rw-r--r--methods/aga/aga.hpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/methods/aga/aga.hpp b/methods/aga/aga.hpp
index f87d215..577e526 100644
--- a/methods/aga/aga.hpp
+++ b/methods/aga/aga.hpp
@@ -146,7 +146,6 @@ namespace opt_utilities
uni_rand(get_element(lower_bound,j),
get_element(upper_bound,j))
);
-
}
}
@@ -186,7 +185,7 @@ namespace opt_utilities
sum+=samples[i].v;
}
- std::sort(samples.begin(),samples.end(),vp_comp<double,std::vector<double> >());
+ std::sort(samples.begin(),samples.end(),vp_comp<rT,pT>());
if(sum2/samples.size()-pow(sum/samples.size(),2)<threshold)
{
return false;
@@ -240,16 +239,17 @@ namespace opt_utilities
buffer.resize(n2);
double n_per_dim=pow((double)n0,1./get_size(lower_bound));
resize(reproduction_box,get_size(lower_bound));
+
for(int i=0;i<get_size(lower_bound);++i)
{
-
+
set_element(reproduction_box,i,
(get_element(upper_bound,i)-
get_element(lower_bound,i))/n_per_dim);
}
-
+
while(iter()){}
-
+
return samples.begin()->p;
}