18 namespace alps {
namespace alea {
30 std::ostream &operator<<(std::ostream &, const batch_result<T> &);
35 namespace alps {
namespace alea {
52 size_t size()
const {
return batch_.rows(); }
88 batch_acc(
size_t size=1,
size_t num_batches=256,
size_t base_size=1);
98 void set_size(
size_t size);
101 void set_num_batches(
size_t batch_size);
104 void set_batch_size(
size_t batch_size);
107 bool valid()
const {
return (
bool)store_; }
110 size_t size()
const {
return size_; }
116 batch_acc& operator<<(const computed<T>& src){ add(src, 1);
return *
this; }
122 size_t count()
const {
return store_->count().sum(); }
147 size_t size_, num_batches_, base_size_;
148 std::unique_ptr< batch_data<value_type> > store_;
153 template <
typename T>
169 template <
typename T>
187 bool valid()
const {
return (
bool)store_; }
190 size_t size()
const {
return store_->size(); }
196 size_t count()
const {
return store_->count().sum(); }
199 double count2()
const {
return store_->count().squaredNorm(); }
205 template <
typename Strategy=circular_var>
209 template <
typename Strategy=circular_var>
231 friend std::ostream &operator<< <>(std::ostream &,
const batch_result &);
234 void reduce(
const reducer &
r,
bool do_pre_commit,
bool do_post_commit);
237 std::unique_ptr< batch_data<value_type> > store_;
243 template <
typename T>
245 template <
typename T>
254 template <
typename T>
264 const static bool HAVE_MEAN =
true;
265 const static bool HAVE_VAR =
true;
266 const static bool HAVE_COV =
true;
267 const static bool HAVE_TAU =
false;
268 const static bool HAVE_BATCH =
true;
void reduce(const reducer &r)
eigen< T >::matrix & batch()
std::enable_if<!is_sequence< T >::value, std::size_t >::type size(T const &)
void deserialize(deserializer &, const std::string &, autocorr_result< T > &)
eigen< size_t >::row & count()
batch_data< T > & store()
mean_type< T >::type mean(T const &arg)
batch_result< T > result_type
const eigen< size_t >::row & offset() const
void serialize(serializer &, const std::string &, const autocorr_result< T > &)
void reset(accumulator_wrapper &arg)
const eigen< size_t >::row & count() const
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > matrix
size_t num_batches() const
circular_var strategy_type
bool operator==(const autocorr_result< T > &r1, const autocorr_result< T > &r2)
const internal::galois_hopper & cursor() const
make_real< T >::type var_type
traits< Acc >::result_type result(const Acc &acc)
const eigen< T >::matrix & batch() const
size_t num_batches() const
size_t num_batches() const
batch_result(const batch_data< T > &acc_data)
T r(T x, T y=T(), T z=T())
size_t current_batch_size() const
traits< Acc >::result_type finalize(Acc &acc)
const batch_data< T > & store() const
const batch_data< T > & store() const
batch_data< T > store_type
circular_var strategy_type
bool operator!=(const autocorr_result< T > &r1, const autocorr_result< T > &r2)
count_type< T >::type count(T const &arg)