19 namespace alps {
namespace alea {
20 template <
typename T,
typename Str>
class cov_data;
21 template <
typename T,
typename Str>
class cov_acc;
26 template <
typename T,
typename Str>
29 template <
typename T,
typename Str>
32 template <
typename T,
typename Str>
33 std::ostream &operator<<(std::ostream &, const cov_result<T,Str> &);
38 namespace alps {
namespace alea {
48 template <
typename T,
typename Strategy=circular_var>
63 size_t size()
const {
return data_.rows(); }
66 size_t count()
const {
return count_; }
69 size_t &
count() {
return count_; }
72 double count2()
const {
return count2_; }
81 const cov_matrix_type &
data2()
const {
return data2_; }
83 cov_matrix_type &
data2() {
return data2_; }
85 void convert_to_mean();
87 void convert_to_sum();
91 cov_matrix_type data2_;
101 template <
typename T,
typename Strategy>
118 template <
typename T,
typename Strategy=circular_var>
138 void set_size(
size_t size);
141 void set_batch_size(
size_t batch_size);
144 bool valid()
const {
return (
bool)store_; }
147 size_t size()
const {
return current_.size(); }
153 cov_acc& operator<<(const computed<T>& src){ add(src, 1);
return *
this; }
159 size_t count()
const {
return store_->count(); }
180 std::unique_ptr<cov_data<T,Strategy> > store_;
186 template <
typename T,
typename Strategy>
205 template <
typename T,
typename Strategy=circular_var>
217 : store_(new
cov_data<T,Strategy>(acc_data))
225 bool valid()
const {
return (
bool)store_; }
228 size_t size()
const {
return store_->size(); }
231 size_t count()
const {
return store_->count(); }
234 double count2()
const {
return store_->count2(); }
237 double batch_size()
const {
return store_->count2() / store_->count(); }
274 friend std::ostream &operator<< <>(std::ostream &,
const cov_result &);
277 void reduce(
const reducer &,
bool do_pre_commit,
bool do_post_commit);
280 std::unique_ptr<cov_data<T,Strategy> > store_;
286 template <
typename T,
typename Strategy>
288 template <
typename T,
typename Strategy>
303 template <
typename T,
typename Strategy>
311 const static bool HAVE_MEAN =
true;
312 const static bool HAVE_VAR =
true;
313 const static bool HAVE_COV =
true;
314 const static bool HAVE_TAU =
false;
315 const static bool HAVE_BATCH =
false;
cov_result< T, Strategy > result_type
size_t batch_size() const
cov_result(const cov_data< T, Strategy > &acc_data)
bind< Strategy, T >::cov_type cov_type
const cov_matrix_type & data2() const
cov_matrix_type & data2()
column< var_type > var() const
typename eigen< cov_type >::matrix cov_matrix_type
bind< Strategy, T >::var_type var_type
std::enable_if<!is_sequence< T >::value, std::size_t >::type size(T const &)
bind< Strategy, T >::var_type var_type
bind< Strategy, T >::cov_type cov_type
bind< Strategy, T >::cov_type cov_type
double batch_size() const
void deserialize(deserializer &, const std::string &, autocorr_result< T > &)
const bundle< value_type > & current() const
bind< Strategy, T >::value_type value_type
bind< Strategy, T >::value_type value_type
bind< Strategy, T >::cov_type cov_type
void serialize(serializer &, const std::string &, const autocorr_result< T > &)
typename bind< Strategy, T >::cov_type cov_type
cov_data< T, Strategy > & store()
bind< Strategy, T >::var_type var_type
void reset(accumulator_wrapper &arg)
eigen< cov_type >::matrix cov() const
column< value_type > & data()
double observations() const
bind< Strategy, T >::var_type var_type
bind< Strategy, T >::value_type value_type
cov_data< T, Strategy > store_type
const column< value_type > & data() const
bind< Strategy, T >::value_type value_type
void reduce(const reducer &r)
bool operator==(const autocorr_result< T > &r1, const autocorr_result< T > &r2)
eigen< cov_type >::matrix cov_matrix_type
const column< T > & mean() const
bind< Strategy, T >::cov_type cov_type
bind< Strategy, T >::value_type value_type
const cov_data< T, Strategy > & store() const
traits< Acc >::result_type result(const Acc &acc)
T r(T x, T y=T(), T z=T())
traits< Acc >::result_type finalize(Acc &acc)
typename bind< Strategy, T >::var_type var_type
bool operator!=(const autocorr_result< T > &r1, const autocorr_result< T > &r2)
const cov_data< T, Strategy > & store() const
count_type< T >::type count(T const &arg)