Commit d822c2a5 authored by chbauman's avatar chbauman
Browse files

conflicts resolved

parents 291491d3 2bc5a24c
......@@ -16,7 +16,7 @@ static inline numeric_t lennard_jones_potential_function(const numeric_t r, cons
}
static inline numeric_t buckingham_potential_function(const numeric_t r, const ThetaVector& theta) {
return theta(0) * std::exp(-theta(1) * r) - theta(2) / std::pow(r, 6);
return std::exp(theta(0) - theta(1) * r) - std::exp(theta(2)) / std::pow(r, 6);
}
......
......@@ -9,16 +9,14 @@
#include "likelihood.hpp"
#include <omp.h>
#ifndef NDEBUG
//#include "stefFenv.h"
#endif
int main(){
#ifndef NDEBUG
//feenableexcept(FE_ALL_EXCEPT & ~FE_INEXACT & ~FE_UNDERFLOW);
//StefFenv_RegisterFloatingPointExceptionHandler();
#endif
#pragma omp parallel
{
GEN.seed(std::time(NULL), omp_get_thread_num());
}
/// Initialization
std::cout << "Using the " << PotentialName<POTENTIAL>::value << " potential\n";
std::cout << "Prior stddev = " << NORMAL_PRIOR_STDDEV << "\n";
......
#include "typedefs_and_globals.hpp"
XoroshiroRandomNumberEngine GEN(42);
XoroshiroRandomNumberEngine GEN;
......@@ -41,12 +41,17 @@ struct PotentialName<Potential::BUCKINGHAM> {
};
<<<<<<< HEAD
constexpr index_t POP_SIZE = 100000;
=======
constexpr index_t POP_SIZE = 10000000;
>>>>>>> 2bc5a24cedb4a967aa8347b0c738037d1352df9d
constexpr index_t N_DIM = (POTENTIAL == Potential::LENNARD_JONES? 2: 3) + 1;// + 1 for the unknown standard deviation
constexpr int MAX_POP_SIZE_FOR_STACK = 5000;
constexpr int EIGEN_NUM_ROWS_FOR_POP = (POP_SIZE > MAX_POP_SIZE_FOR_STACK? Eigen::Dynamic: POP_SIZE);
typedef Eigen::Matrix<numeric_t, N_DIM, 1> ThetaVector;
typedef Eigen::Matrix<numeric_t, POP_SIZE, 1> WeightVector;
typedef Eigen::Matrix<index_t, POP_SIZE, 1> CountVector;
typedef Eigen::Matrix<numeric_t, EIGEN_NUM_ROWS_FOR_POP, 1> WeightVector;
typedef Eigen::Matrix<index_t, EIGEN_NUM_ROWS_FOR_POP, 1> CountVector;
typedef Eigen::Matrix<numeric_t, N_DIM, N_DIM> CovMat;
typedef Eigen::Matrix<numeric_t, N_DIM, -1> PopMatrix;
......@@ -62,6 +67,10 @@ constexpr numeric_t BETA = 0.2;
/// RNG
extern XoroshiroRandomNumberEngine GEN;
//#define UNIF_PRIOR
//#define USE_BRENTS_METHOD
constexpr numeric_t BOUND = 10e10;
#pragma omp threadprivate(GEN)
......@@ -56,7 +56,7 @@ Eigen::Matrix<numeric_t, N_DIM - 1, 1> get_exact_solution() {
}
case Potential::BUCKINGHAM: {
exact_solution << 8.508e7, 1 / 0.273, 5.13979e5;
exact_solution << std::log(8.508e7), 1 / 0.273, std::log(5.13979e5);
break;
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment