CosmoBolognaLib
Free Software C++/Python libraries for cosmological calculations
Prior.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 __PRIOR__
34 #define __PRIOR__
35 
36 #include "Distribution.h"
37 
38 // ===================================================================================================
39 
40 
41 namespace cbl {
42 
43  namespace statistics {
44 
50  typedef std::function<double (const std::vector<double> , const std::shared_ptr<void>)> Prior_function;
51 
59  class Prior {
60 
61  protected:
62 
65 
67  std::shared_ptr<void> m_prior_function_inputs;
68 
69  public:
70 
75 
81  Prior () {}
82 
92  Prior (const Prior_function prior_function, const std::shared_ptr<void> prior_function_inputs);
93 
97  ~Prior () = default;
98 
100 
109  double operator () (const std::vector<double> parameters);
110 
119  double log (const std::vector<double> parameter);
120 
121  };
122  }
123 }
124 
125 #endif
The class Distribution.
The class Prior.
Definition: Prior.h:59
double operator()(const std::vector< double > parameters)
Definition: Prior.cpp:53
~Prior()=default
default destructor
std::shared_ptr< void > m_prior_function_inputs
inputs of the prior function
Definition: Prior.h:67
Prior_function m_prior_function
prior function
Definition: Prior.h:64
double log(const std::vector< double > parameter)
compute the logarithm of the prior for the input parameters
Definition: Prior.cpp:62
Prior()
default constructor
Definition: Prior.h:81
std::function< double(const std::vector< double >, const std::shared_ptr< void >)> Prior_function
definition of a function for computation of the Prior
Definition: Prior.h:50
The global namespace of the CosmoBolognaLib
Definition: CAMB.h:38