CosmoBolognaLib
Free Software C++/Python libraries for cosmological calculations
PriorDistribution.h
Go to the documentation of this file.
1 /********************************************************************
2  * Copyright (C) 2014 by Federico Marulli and Alfonso Veropalumbo *
3  * federico.marulli3@unibo.it *
4  * *
5  * This program is free software; you can redistribute it and/or *
6  * modify it under the terms of the GNU General Public License as *
7  * published by the Free Software Foundation; either version 2 of *
8  * the License, or (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public *
16  * License along with this program; if not, write to the Free *
17  * Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ********************************************************************/
20 
33 #ifndef __PRIORDIST__
34 #define __PRIORDIST__
35 
36 #include "CombinedDistribution.h"
37 
38 
39 // ===================================================================================================
40 
41 
42 namespace cbl {
43 
44  namespace statistics {
45 
53  class PriorDistribution : public glob::CombinedDistribution {
54 
55  public:
56 
61 
67  PriorDistribution () : CombinedDistribution () {}
68 
77  PriorDistribution (const glob::DistributionType priorType, const double value) : CombinedDistribution(priorType, value) {}
78 
91  PriorDistribution (const glob::DistributionType priorType, const double xmin, const double xmax, const int seed=1) : CombinedDistribution(priorType, xmin, xmax, seed) {}
92 
108  PriorDistribution (const glob::DistributionType priorType, const std::vector<double> prior_params, const double xmin, const double xmax, const int seed=1) :
109  CombinedDistribution(priorType, prior_params, xmin, xmax, seed) {}
110 
129  PriorDistribution (const glob::DistributionType priorType, const distribution_func prior_func, const std::shared_ptr<void> prior_fixed_pars, const std::vector<double> prior_pars, const double xmin, const double xmax, const int seed=1)
130  : CombinedDistribution(priorType, prior_func, prior_fixed_pars, prior_pars, xmin, xmax, seed) {}
131 
144  PriorDistribution (const glob::DistributionType priorType, const std::vector<double> discrete_values, const std::vector<double> weights, const int seed=1)
145  : CombinedDistribution(priorType, discrete_values, weights, seed) {}
146 
163  PriorDistribution (const glob::DistributionType priorType, const std::vector<double> var, const std::vector<double> dist, const int nbin, const std::string interpolationType, const int seed=1)
164  : CombinedDistribution(priorType, var, dist, nbin, interpolationType, seed) {}
165 
166 
184  PriorDistribution (const glob::DistributionType priorType, const std::vector<double> meanVec, const std::vector<std::vector<double>> covMat, const std::vector<double> xMinVec, const std::vector<double> xMaxVec, const int seed=3213)
185  : CombinedDistribution(priorType, meanVec, covMat, xMinVec, xMaxVec, seed) {}
186 
219  PriorDistribution (const std::string filename, const std::string path, const std::vector<int> columns_to_read, const int skip_nlines=0, const int type_data=0, const bool normalize=true, const int distNum=200, const double rMAX=2, const double cell_size=2)
220  : CombinedDistribution(filename, path, columns_to_read, skip_nlines, type_data, normalize, distNum, rMAX, cell_size) {}
221 
227  ~PriorDistribution () = default;
228 
230 
231  };
232  }
233 }
234 
235 #endif
The class CombinedDistribution.
double xmax() const
return the private member m_xmax
Definition: Distribution.h:441
double xmin() const
return the private member m_xmin
Definition: Distribution.h:434
The class PriorDistribution.
PriorDistribution(const glob::DistributionType priorType, const std::vector< double > meanVec, const std::vector< std::vector< double >> covMat, const std::vector< double > xMinVec, const std::vector< double > xMaxVec, const int seed=3213)
constructor of multidimensional distributions
~PriorDistribution()=default
default destructor
PriorDistribution()
default constructor
PriorDistribution(const std::string filename, const std::string path, const std::vector< int > columns_to_read, const int skip_nlines=0, const int type_data=0, const bool normalize=true, const int distNum=200, const double rMAX=2, const double cell_size=2)
constructor of multidimensional distributions from external chains
PriorDistribution(const glob::DistributionType priorType, const double xmin, const double xmax, const int seed=1)
constructor of a flat distribution
PriorDistribution(const glob::DistributionType priorType, const distribution_func prior_func, const std::shared_ptr< void > prior_fixed_pars, const std::vector< double > prior_pars, const double xmin, const double xmax, const int seed=1)
constructor
PriorDistribution(const glob::DistributionType priorType, const double value)
constructor of a constant distribution
PriorDistribution(const glob::DistributionType priorType, const std::vector< double > prior_params, const double xmin, const double xmax, const int seed=1)
constructor
PriorDistribution(const glob::DistributionType priorType, const std::vector< double > discrete_values, const std::vector< double > weights, const int seed=1)
constructor
PriorDistribution(const glob::DistributionType priorType, const std::vector< double > var, const std::vector< double > dist, const int nbin, const std::string interpolationType, const int seed=1)
constructor
DistributionType
the distribution type
Definition: Distribution.h:51
The global namespace of the CosmoBolognaLib
Definition: CAMB.h:38
std::function< double(double, std::shared_ptr< void >, std::vector< double >)> distribution_func
generic distribution function
Definition: RandomNumbers.h:50