Skip to content

Commit

Permalink
Re #10031. Make it work with older versions of boost.
Browse files Browse the repository at this point in the history
  • Loading branch information
mantid-roman committed Aug 21, 2014
1 parent 9a38b75 commit 52050c4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Code/Mantid/Framework/CurveFitting/src/FABADAMinimizer.cpp
Expand Up @@ -21,7 +21,9 @@
#include "MantidKernel/Logger.h"

#include <boost/random/normal_distribution.hpp>
#include <boost/random/uniform_real.hpp>
#include <boost/random/mersenne_twister.hpp>
#include <boost/version.hpp>

#include <iostream>
#include <ctime>
Expand Down Expand Up @@ -166,6 +168,7 @@ FABADAMinimizer::~FABADAMinimizer()
/// Do one iteration. Returns true if iterations to be continued, false if they must stop.
bool FABADAMinimizer::iterate(size_t)
{

if ( !m_leastSquares )
{
throw std::runtime_error("Cost function isn't set up.");
Expand All @@ -191,7 +194,8 @@ FABADAMinimizer::~FABADAMinimizer()
{
boost::mt19937 mt;
mt.seed(123*(int(m_counter)+45*int(i)));
boost::random::normal_distribution<> distr(0,std::abs(m_jump[i]));

boost::normal_distribution<> distr(0,std::abs(m_jump[i]));
step = distr(mt);

}
Expand Down Expand Up @@ -246,7 +250,7 @@ FABADAMinimizer::~FABADAMinimizer()
// Decide if changing or not
boost::mt19937 mt;
mt.seed(int(time_t())+48*(int(m_counter)+76*int(i)));
boost::random::uniform_real_distribution<> distr(0.0,1.0);
boost::uniform_real<> distr(0.0,1.0);
double p = distr(mt);
///std::cout << " Random number " << p << std::endl;// DELETE AT THE END
if (p<=prob)
Expand Down

0 comments on commit 52050c4

Please sign in to comment.