Commit 95240fac authored by stefanow's avatar stefanow
Browse files

Type mistake

parent 6c8f6ecc
......@@ -22,7 +22,7 @@ ifdef USE_FLOATS
$(info using floats)
macroDefines += -DUSE_FLOATS
else
$(info using numeric_ts)
$(info using double)
endif
ifdef USE_BRENTS_METHOD
......
......@@ -9,6 +9,7 @@
#include "likelihood.hpp"
#include <omp.h>
#include <ctime>
#include <cstdint>
#ifdef __APPLE__
#include "stefFenv.h"
......@@ -18,9 +19,10 @@
int main(){
//feenableexcept(FE_ALL_EXCEPT & ~FE_INEXACT & ~FE_UNDERFLOW);
const std::uint64_t seedToUse = std::time(NULL);
#pragma omp parallel
{
GEN.seed(std::time(NULL), omp_get_thread_num());
GEN.seed(seedToUse, omp_get_thread_num());
}
/// Initialization
std::cout << "Using the " << PotentialName<POTENTIAL>::value << " potential\n";
......@@ -39,12 +41,12 @@ int main(){
WeightVector likelihoods_old(POP_SIZE);
CountVector resample_count(POP_SIZE);
std::vector<WeightVector> best_thetas;
std::vector<ThetaVector> best_thetas;
CovMat sample_cov_mat;
ThetaVector sample_mean;
numeric_t evidence_s = 1.0;
const auto likelihood = get_likelihood_function_from_data("data.txt");
/// Compute likelihoods
#pragma omp parallel for schedule(static)
for(index_t i = 0; i < POP_SIZE; ++i){
......@@ -97,7 +99,7 @@ int main(){
if(rck > 0){
#pragma omp task firstprivate(ct, rck)
{
thetas_new.middleCols(ct, rck) = mcmc(sample, thetas.col(k), rck,
thetas_new.middleCols(ct, rck) = mcmc(sample, thetas.col(k), rck,
sample_mean, sample_cov_mat, rho_curr, likelihoods, likelihoods_old, likelihood, k, ct);
}
ct += rck;
......
......@@ -48,7 +48,7 @@ struct PotentialName<Potential::BUCKINGHAM> {
};
constexpr index_t POP_SIZE = 400000;
constexpr index_t POP_SIZE = 1000;
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;
......@@ -57,7 +57,7 @@ typedef Eigen::Matrix<numeric_t, N_DIM, 1> ThetaVector;
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;
typedef Eigen::Matrix<numeric_t, N_DIM, EIGEN_NUM_ROWS_FOR_POP> PopMatrix;
typedef numeric_t (*PotentialFunction)(const numeric_t r, const ThetaVector& theta);
......
Markdown is supported
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