14 namespace alps {
namespace alea {
48 : store_(other.store_ ? new
mean_data<T>(*other.store_) : nullptr)
55 store_.reset(other.store_ ?
new mean_data<T>(*other.store_) :
nullptr);
65 store_->count() +=
count;
78 store_->data() += other_store.
data();
79 store_->count() += other_store.
count();
101 template <
typename T>
106 result.store_->convert_to_mean();
110 template <
typename T>
118 template <
typename T>
122 result.store_.reset();
123 result.store_.swap(store_);
124 result.store_->convert_to_mean();
132 template <
typename T>
134 : store_(other.store_ ? new
mean_data<T>(*other.store_) : nullptr)
137 template <
typename T>
140 store_.reset(other.store_ ?
new mean_data<T>(*other.store_) :
nullptr);
144 template <
typename T>
159 template <
typename T>
164 store_->convert_to_sum();
165 r.
reduce(
view<T>(store_->data().data(), store_->data().rows()));
168 if (pre_commit && post_commit) {
174 store_->convert_to_mean();
184 template <
typename T>
190 serialize(s,
"@size",
self.store_->data_.size());
191 serialize(s,
"count",
self.store_->count_);
193 serialize(s,
"value",
self.store_->data_);
197 template <
typename T>
205 if (!
self.
valid() ||
self.
size() != new_size)
222 template <
typename T>
223 std::ostream &operator<<(std::ostream &str, const mean_result<T> &
self)
235 template std::ostream &operator<<(std::ostream &, const mean_result<double> &);
236 template std::ostream &operator<<(std::ostream &, const mean_result<std::complex<double>> &);
void add(const computed< T > &source, size_t count)
void check_valid(const Acc &acc)
mean_acc & operator<<(const computed< T > &src)
const mean_data< T > & store() const
void finalize_to(mean_result< T > &result)
void set_size(size_t size)
virtual void commit() const =0
void reset(accumulator_wrapper &arg)
friend void serialize(serializer &, const std::string &, const mean_result &)
T & get_format(std::ios_base &stream, T initial_value=T())
mean_result< T > finalize()
mean_result< T > result() const
virtual void add_to(view< T > out) const =0
mean_acc & operator=(const mean_acc &other)
mean_result & operator=(const mean_result &other)
bool operator==(const autocorr_result< T > &r1, const autocorr_result< T > &r2)
friend void deserialize(deserializer &, const std::string &, mean_result &)
const column< T > & data() const
virtual reducer_setup get_setup() const =0
virtual void enter(const std::string &group)=0
T r(T x, T y=T(), T z=T())
virtual void reduce(view< double > data) const =0
virtual void enter(const std::string &group)=0
void reduce(const reducer &r)