queso-0.51.1
BasicPdfsGsl.C
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // QUESO - a library to support the Quantification of Uncertainty
5 // for Estimation, Simulation and Optimization
6 //
7 // Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the Version 2.1 GNU Lesser General
11 // Public License as published by the Free Software Foundation.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc. 51 Franklin Street, Fifth Floor,
21 // Boston, MA 02110-1301 USA
22 //
23 //-----------------------------------------------------------------------el-
24 
25 #include <queso/BasicPdfsGsl.h>
26 #include <gsl/gsl_randist.h>
27 #include <mpi.h>
28 #include <math.h>
29 
30 namespace QUESO {
31 
32 // Default constructor ------------------------------
34  :
36 {
39  "BasicPdfsGsl::constructor(), default",
40  "should not be used by user");
41 }
42 
45  :
46  BasicPdfsBase(worldRank)
47 {
48 }
49 
50 // Destructor ---------------------------------------
52 {
53 }
54 
55 // --------------------------------------------------
56 double
57 BasicPdfsGsl::betaPdfActualValue(double x, double alpha, double beta) const
58 {
59  double result = gsl_ran_beta_pdf(x,alpha,beta);
60  if (isinf(result)) { // CSRI - 2013-aug-06, with Laura
61  std::cerr << "In BasicPdfsGsl::betaPdfActualValue(): hitting inf"
62  << ", x = " << x
63  << ", alpha = " << alpha
64  << ", beta = " << beta
65  << std::endl;
66  //result = gsl_ran_beta_pdf(x,alpha,beta);
67  result = 0.;
68  }
69  return result;
70 }
71 
72 // --------------------------------------------------
73 double
74 BasicPdfsGsl::gammaPdfActualValue(double x, double a, double b) const
75 {
76  return gsl_ran_gamma_pdf(x,a,b);
77 }
78 
79 } // End namespace QUESO
~BasicPdfsGsl()
Destructor.
Definition: BasicPdfsGsl.C:51
double betaPdfActualValue(double x, double alpha, double beta) const
TODO: Actual value of the Beta PDF.
Definition: BasicPdfsGsl.C:57
double gammaPdfActualValue(double x, double a, double b) const
TODO: Actual value of the Gamma PDF.
Definition: BasicPdfsGsl.C:74
BasicPdfsGsl()
Default constructor.
Definition: BasicPdfsGsl.C:33
TODO: Base class for basic PDFs (via either GSL or Boost).
Definition: BasicPdfsBase.h:44
#define UQ_FATAL_TEST_MACRO(test, givenRank, where, what)
Definition: Defines.h:223

Generated on Thu Apr 23 2015 19:26:15 for queso-0.51.1 by  doxygen 1.8.5