queso
queso copied to clipboard
Restructuring pdf/cdf/mgf
The way QUESO handles distributions is not extremely practical and not standard throughout the library. It certainly should be remanufactured, with a kind of wrapper around gsl or boost distributions. I'll be happy to do it if there is a consensus on how things should look. I was thinking along the lines of Antioch's kinetics models, with a class for each distribution that can handle boost or gsl (template, overload, other? I favor template, but there's no constrain) that derives from a base class. The RV vector can then load the required distribution using pointer and static_cast.
This is still an early stage of though, any idea is much welcome.
I'd personally follow Boost's lead as much as possible since that more or less hit as standard in C++11.
@SylvainPlessis, I don't understand what you mean by "handles distributions". Please clarify.
I might have been a little bit too vague on that :)
I mostly mean the way QUESO deals with sampling and calculating a pdf value, (Gsl/TeuchosVector::cwSet_distribution()_ and distributionJointPdf::actualValue()), I don't know for the moments or the cdf, I have not looked at them.
The classes GslVector and TeuchosVector are the ones actually doing the sampling. For instance, a uniform distribution is sampled by Gsl/TeuchosVector::cwSetUniform(), not by a Uniform_something_ class. The actualValue() method also differs, the GaussianJointPdf::actualValue() calculates it explicitely while the GammaJointPdf::actualValue() relies on either gsl or boost to do it.
So I'd be in favor of a rewriting of the sampling scheme, letting each distribution sample on its own and rely exclusively on gsl or boost to calculate anything (or at least comment and explain why the gsl/boost method is not used if it's done in QUESO).