25 #include <queso/SampledVectorCdf.h>
30 template<
class V,
class M>
37 m_cdfs(m_pdfSupport.vectorSpace().map(),1)
46 for (
unsigned int i = 0; i < (
unsigned int)
m_cdfs.MyLength(); ++i) {
47 sprintf(strI,
"%u_",i);
49 ((std::string)(
m_prefix)+strI).c_str(),
61 template<
class V,
class M>
64 for (
unsigned int i = 0; i < (
unsigned int) m_cdfs.MyLength(); ++i) {
65 if (m_cdfs(i,0))
delete m_cdfs(i,0);
69 template<
class V,
class M>
75 queso_error_msg(
"incomplete code");
79 template<
class V,
class M>
83 queso_require_less_msg(rowId, m_pdfSupport.vectorSpace().dimLocal(),
"rowId is out of range");
86 return *(tmp->m_cdfs(rowId,0));
90 template <
class V,
class M>
95 for (
unsigned int i = 0; i < (
unsigned int) m_cdfs.MyLength(); ++i) {
103 template<
class V,
class M>
106 const std::string& varNamePrefix,
107 const std::string& fileName,
108 const std::string& fileType,
109 const std::set<unsigned int>& allowedSubEnvIds)
const
111 queso_require_greater_equal_msg(m_env.subRank(), 0,
"unexpected subRank");
115 for (
unsigned int i = 0; i < (
unsigned int) m_cdfs.MyLength(); ++i) {
116 sprintf(compId,
"%d",i);
117 tmp->m_cdfs(i,0)->subWriteContents(varNamePrefix+
"comp"+compId,fileName,fileType,allowedSubEnvIds);
Class to accommodate arrays of one-dimensional grid.
const BaseOneDGrid< double > & grid(unsigned int rowId) const
Returns the grid stored in the rowId-th position of the array of grids.
A class for handling sampled vector CDFs.
SampledVectorCdf(const char *prefix, const ArrayOfOneDGrids< V, M > &oneDGrids, const ArrayOfOneDTables< V, M > &cdfValues)
Default constructor.
Class to accommodate arrays of one-dimensional tables.
const BaseScalarCdf< double > & cdf(unsigned int rowId) const
Returns a scalar CDF stored at row rowId of the vector CDF.
DistArray< SampledScalarCdf< double > * > m_cdfs
A templated (base) class for handling CDFs of vector functions.
void print(std::ostream &os) const
Prints the vector CDF (values of the grid points and of the CDF at such grid points).
A class for handling sampled CDFs.
const std::vector< double > & oneDTable(unsigned int rowId) const
Returns the array located at position rowId of the one-dimensional table.
const BaseEnvironment & m_env
A templated (base) class for handling CDFs.
void values(const V ¶mValues, V &cdfVec) const
TODO: Returns the values of the vector CDF at each element of paramValues.
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.
unsigned int displayVerbosity() const
~SampledVectorCdf()
Destructor.
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).