27 #include <queso/GammaVectorRealizer.h>
28 #include <queso/GslVector.h>
29 #include <queso/GslMatrix.h>
34 template<
class V,
class M>
41 BaseVectorRealizer<V,M>(((std::string)(prefix)+
"gen").c_str(),unifiedImageSet,std::numeric_limits<unsigned int>::max()),
58 template<
class V,
class M>
63 template<
class V,
class M>
72 double smallerOfMaxValues = imageBox->
maxValues().getMinValue();
73 double smallerOfMinValues = imageBox->
minValues().getMinValue();
76 if( smallerOfMinValues < 0 )
78 std::cerr <<
"In GammaVectorRealizer<V,M>::realization()\n"
79 <<
"Gamma distribution is only defined in (0, infinity).\n"
80 <<
"The data provided is: \n"
82 <<
"Sampling will not cover all interval.\n"
86 queso_require_greater_equal_msg(smallerOfMaxValues, 0,
"invalid input: Gamma distribution is only defined in (0, infinity), and min(m_maxValues)<0. ");
98 bool outOfSupport =
true;
101 nextValues.cwSetGamma(m_a,m_b);
102 outOfSupport = !(this->m_unifiedImageSet.contains(nextValues));
104 }
while (outOfSupport);
GammaVectorRealizer(const char *prefix, const VectorSet< V, M > &unifiedImageSet, const V &a, const V &b)
Constructor.
A templated (base) class for handling sampling from vector RVs.
const BaseEnvironment & m_env
A class for handling sampling from a Gamma probability density distribution.
~GammaVectorRealizer()
Destructor.
void realization(V &nextValues) const
Draws a realization.
A templated class for handling sets.
const V & minValues() const
Vector of the minimum values of the box subset.
Class representing a subset of a vector space shaped like a hypercube.
unsigned int displayVerbosity() const
const V & maxValues() const
Vector of the maximum values of the box subset.
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).