sampler_grid_search Class Reference

Implements a Grid Search Sampler. More...

#include "sampling/sampler_grid_search.h"

Public Member Functions

 sampler_grid_search ()
 Grid Search Sampler class constructor.
 
void run_sampler (likelihood _L, std::vector< double > &range_min, std::vector< double > &range_max, std::vector< int > &num_samples, std::string output_file, int output_precision=6)
 
void set_cpu_distribution (int num_batches, int num_likelihood)
 Function to set the distribution of processors in different layers of parallelization. More...
 

Private Attributes

int BNum
 
int LNum
 
bool default_cpu_distribution = true
 

Detailed Description

Runs a grid search sampler.

Member Function Documentation

void run_sampler ( likelihood  _L,
std::vector< double > &  range_min,
std::vector< double > &  range_max,
std::vector< int > &  num_samples,
std::string  output_file,
int  output_precision = 6 
)

/brief Runs the grid search sampler.

Parameters
_LAn object of class likelihood.
range_minVector of doubles holding the minimun value for each parameter.
range_maxVector of doubles holding the maximun value for each parameter.
num_samplesVector of integers holding the number of divisions for each parameter.
output_fileA string holding the name of the output file. The output has a column for each parameter and the last column is the chi squared value associated to the parameters in that row.
output_precisionSets the output precision – the number of significant digits used to represent a number in the sampler output files. The defaul precision is 6.

Here is the call graph for this function:

void set_cpu_distribution ( int  num_batches,
int  num_likelihood 
)
Parameters
num_batchesInteger value. Number of regions of parameter space handled by different cpu groups.
num_likelihoodInteger value. Number of cpus allocated to each region of parameter space. These processes evaluate every single likelihood in parallel.

The documentation for this class was generated from the following files: