Skip to content

Commit

Permalink
debug that forced a number of noses > number of dimensions.
Browse files Browse the repository at this point in the history
  • Loading branch information
Christophe Hugon committed Jul 4, 2017
1 parent 97dd8d0 commit db18df4
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion programs/test_annealing.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ int main (int argc_, char ** argv_) {
ma.set_starts (starts);
ma.set_limits (limits);

cout << "research of the minimum at more than 99.9999% of confidence...please wait." << endl;
cout << "research of the minimum...please wait." << endl;

ma.set_starts (starts);

Expand Down
5 changes: 3 additions & 2 deletions src/amoeba.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ namespace icedcode
__counter=0;

while ((__PQR[0].get_value () - __PQR[2].get_value () > __delta_val ||
fabs((__PQR[0] - __PQR[2]).get_r ()) > __delta_pos) ||
(__PQR[0] - __PQR[2]).get_r () > __delta_pos) ||
!user_accept_ending ())
{
point M_QR=__reflectP ();
Expand All @@ -92,10 +92,11 @@ namespace icedcode
}

}

__classify();

if (user_work ())
__classify();

__counter++;

}
Expand Down
5 changes: 1 addition & 4 deletions src/annealing.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,10 @@ namespace icedcode
__uniform_distribution.param(p);
double alea=__uniform_distribution (__generator);

//cout << alea << ">" << exp(-(val2-val1)/__temperature) << endl;

if (alea > exp(-(val2-val1)/__temperature))
{
if (__minimal_met.get_value () > val2)
__minimal_met=p2_;
//cout << "has been kept " << endl;
return true;
}

Expand All @@ -88,7 +85,7 @@ namespace icedcode
{
if (__temperature > (__max-__min)*0.001)
return false;
if (__minimal_met.get_value () < get_PQR(2).get_value ())
if (__minimal_met.get_value () <= get_PQR(2).get_value ())
{
set_PQR(__minimal_met, 2);
return false;
Expand Down
8 changes: 4 additions & 4 deletions src/nosy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,20 @@ namespace icedcode
bool nosy::user_work ()
{
bool has_changed = false;
int sit=0;
for (list<point>::iterator nit=__noses.begin();
nit!=__noses.end();
nit++)
{
double_1d pos;
if (__normal && __sigma.size ())
{
int sit=0;
for (double_1d_cit lmean=get_PQR(2).begin(); lmean!=get_PQR(2).end (); lmean++)
{
normal_distribution<double>::param_type p(*lmean, __sigma[sit]);
__normal_distribution.param(p);
double val= __normal_distribution (__generator);
pos.push_back (val);
sit++;
}
}
else
Expand All @@ -92,12 +91,13 @@ namespace icedcode
double rPQR2=get_PQR(2).get_r();
double rPQR0=get_PQR(0).get_r();
if ( fabs(rnit - rPQR2) > fabs(rPQR2-rPQR0) &&
((*nit).get_value()<get_PQR(2).get_value () ||
accept (*nit,get_PQR(2))))
(((*nit).get_value()<get_PQR(2).get_value () ||
accept (*nit,get_PQR(2)))))
{
set_PQR(*nit,2);
has_changed = true;
}
sit++;
}

return has_changed;
Expand Down

0 comments on commit db18df4

Please sign in to comment.