19 namespace alps {
namespace alea {
20 template <
typename T,
typename Str>
class var_data;
21 template <
typename T,
typename Str>
class var_acc;
22 template <
typename T,
typename Str>
class var_result;
29 template <
typename T,
typename Str>
32 template <
typename T,
typename Str>
35 template <
typename T,
typename Str>
36 std::ostream &operator<<(std::ostream &, const var_result<T,Str> &);
41 namespace alps {
namespace alea {
51 template <
typename T,
typename Strategy=circular_var>
65 size_t size()
const {
return data_.rows(); }
68 size_t count()
const {
return count_; }
71 size_t &
count() {
return count_; }
74 double count2()
const {
return count2_; }
87 void convert_to_mean();
89 void convert_to_sum();
103 template <
typename T,
typename Strategy>
118 template <
typename T,
typename Strategy=circular_var>
136 void set_size(
size_t size);
139 void set_batch_size(
size_t batch_size);
142 bool valid()
const {
return (
bool)store_; }
145 size_t size()
const {
return current_.size(); }
151 var_acc &operator<<(const computed<T> &src) { add(src, 1,
nullptr);
return *
this; }
157 size_t count()
const {
return store_->count(); }
173 void add_bundle(
var_acc *cascade);
178 std::unique_ptr< var_data<value_type, Strategy> > store_;
185 template <
typename T,
typename Strategy>
202 template <
typename T,
typename Strategy=circular_var>
213 : store_(new
var_data<T,Strategy>(acc_data))
221 bool valid()
const {
return (
bool)store_; }
224 size_t size()
const {
return store_->size(); }
227 double batch_size()
const {
return store_->count2() / store_->count(); }
230 size_t count()
const {
return store_->count(); }
233 double count2()
const {
return store_->count2(); }
267 friend std::ostream &operator<< <>(std::ostream &,
const var_result &);
270 void reduce(
const reducer &,
bool do_pre_commit,
bool do_post_commit);
273 std::unique_ptr< var_data<T,Strategy> > store_;
280 template <
typename T,
typename Strategy>
282 template <
typename T,
typename Strategy>
297 template <
typename T,
typename Strategy>
304 const static bool HAVE_MEAN =
true;
305 const static bool HAVE_VAR =
true;
306 const static bool HAVE_COV =
false;
307 const static bool HAVE_TAU =
false;
308 const static bool HAVE_BATCH =
false;
bind< Strategy, T >::var_type var_type
bind< Strategy, T >::value_type value_type
bind< Strategy, T >::var_type var_type
bind< Strategy, T >::value_type value_type
const column< value_type > & data() const
std::enable_if<!is_sequence< T >::value, std::size_t >::type size(T const &)
const var_data< T, Strategy > & store() const
size_t batch_size() const
column< var_type > var() const
void deserialize(deserializer &, const std::string &, autocorr_result< T > &)
void reduce(const reducer &r)
const bundle< value_type > & current() const
bind< Strategy, T >::var_type var_type
var_result(const var_data< T, Strategy > &acc_data)
void serialize(serializer &, const std::string &, const autocorr_result< T > &)
const column< var_type > & data2() const
void reset(accumulator_wrapper &arg)
bind< Strategy, T >::var_type var_type
bind< Strategy, T >::var_type var_type
typename bind< Strategy, T >::var_type var_type
const var_data< T, Strategy > & store() const
double batch_size() const
var_result< T, Strategy > result_type
const column< T > & mean() const
bind< Strategy, T >::value_type value_type
column< var_type > & data2()
var_data< T, Strategy > store_type
bool operator==(const autocorr_result< T > &r1, const autocorr_result< T > &r2)
bind< Strategy, T >::value_type value_type
traits< Acc >::result_type result(const Acc &acc)
column< value_type > & data()
T r(T x, T y=T(), T z=T())
bind< Strategy, T >::value_type value_type
traits< Acc >::result_type finalize(Acc &acc)
var_data< T, Strategy > & store()
bool operator!=(const autocorr_result< T > &r1, const autocorr_result< T > &r2)
count_type< T >::type count(T const &arg)
double observations() const