25#ifndef quantlib_convergence_statistics_hpp
26#define quantlib_convergence_statistics_hpp
57 template <
class T,
class U = DoublingConvergenceSteps>
61 typedef std::vector<std::pair<Size,value_type> >
table_type;
66 template <
class DataIterator>
68 for (; begin != end; ++begin)
71 template <
class DataIterator,
class WeightIterator>
73 WeightIterator wbegin) {
74 for (; begin != end; ++begin, ++wbegin)
89 template <
class T,
class U>
92 :
T(stats), samplingRule_(rule) {
96 template <
class T,
class U>
98 : samplingRule_(rule) {
103 template <
class T,
class U>
107 T::add(value,weight);
108 if (this->samples() == nextSampleSize_) {
109 table_.push_back(std::make_pair(this->samples(),this->mean()));
110 nextSampleSize_ = samplingRule_.nextSamples(nextSampleSize_);
115 template <
class T,
class U>
118 nextSampleSize_ = samplingRule_.initialSamples();
122 template <
class T,
class U>
statistics class with convergence table
void add(const value_type &value, Real weight=1.0)
std::vector< std::pair< Size, value_type > > table_type
void addSequence(DataIterator begin, DataIterator end)
ConvergenceStatistics(const T &stats, const U &rule=U())
const std::vector< std::pair< Size, value_type > > & convergenceTable() const
void addSequence(DataIterator begin, DataIterator end, WeightIterator wbegin)
Size initialSamples() const
Size nextSamples(Size current)
std::size_t Size
size of a container