25 #include <queso/ScalarCdf.h>
36 m_prefix ((std::string)(prefix)+
""),
37 m_minHorizontal(-INFINITY),
38 m_maxHorizontal( INFINITY)
75 const std::string& varNamePrefix,
76 const std::string& fileName,
77 const std::string& fileType,
78 const std::set<unsigned int>& allowedSubEnvIds)
const
80 std::cerr <<
"WARNING: BaseScalarCdf<T>::subWriteContents() being used..."
100 double maxDistance = 0.;
101 double xForMaxDistance = 0.;
103 double x1 = cdf1.
inverse(epsilon*.5);
104 double x2 = cdf1.
inverse(1.-epsilon*.5);
107 <<
", cdf1.prefix() = " << cdf1.
prefix()
108 <<
", cdf2.prefix() = " << cdf2.
prefix()
109 <<
", epsilon = " << epsilon
121 double numEvaluationPoints = 1001.;
122 for (
double i = 0.; i < numEvaluationPoints; ++i) {
123 double ratio = i/(numEvaluationPoints-1.);
124 double x = (1.-ratio)*x1 + ratio*x2;
126 double d = fabs(x-y);
131 <<
", cdf1.value(x) = " << cdf1.
value(x)
134 <<
", currentMaxDistance = " << maxDistance
137 if (maxDistance < d) {
143 <<
", NOW maxDistance = " << maxDistance
144 <<
", xForMaxDistance = " << xForMaxDistance
152 <<
", cdf1.prefix() = " << cdf1.
prefix()
153 <<
", cdf2.prefix() = " << cdf2.
prefix()
154 <<
", epsilon = " << epsilon
155 <<
": maxDistance = " << maxDistance
156 <<
", xForMaxDistance = " << xForMaxDistance
BaseScalarCdf(const BaseEnvironment &env, const char *prefix)
Default constructor.
virtual void subWriteContents(const std::string &varNamePrefix, const std::string &fileName, const std::string &fileType, const std::set< unsigned int > &allowedSubEnvIds) const
Writes the CDF of an allowed sub-environment to a file.
const BaseEnvironment & env() const
Environment. Access to private attribute m_env.
This (virtual) class sets up the environment underlying the use of the QUESO library by an executable...
double horizontalDistance(const BaseScalarCdf< T > &cdf1, const BaseScalarCdf< T > &cdf2, double epsilon)
It calculated the maximum horizontal distance between two CDFs.
const BaseEnvironment & m_env
A templated (base) class for handling CDFs.
const std::string & prefix() const
Access to private attribute m_prefix.
virtual double value(T paramValue) const =0
Returns the value of the CDF at paramValue. See template specialization.
virtual T inverse(double cdfValue) const =0
Returns the position of a given value of CDF. See template specialization.
unsigned int displayVerbosity() const
virtual ~BaseScalarCdf()
Virtual destructor.
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).