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
-
_L An object of class likelihood. range_min Vector of doubles holding the minimun value for each parameter. range_max Vector of doubles holding the maximun value for each parameter. num_samples Vector of integers holding the number of divisions for each parameter. output_file A 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_precision Sets 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_batches Integer value. Number of regions of parameter space handled by different cpu groups. num_likelihood Integer 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:
- sampling/sampler_grid_search.h
- sampling/sampler_grid_search.cpp