12 namespace accumulators {
16 template<
typename A>
struct AccumulatorBase {
17 typedef A accumulator_type;
18 typedef typename A::result_type result_type;
21 template<
typename ArgumentPack>
22 AccumulatorBase(
const ArgumentPack& args,
23 typename std::enable_if<!std::is_base_of<AccumulatorBase,ArgumentPack>::value,
int>::type =0)
24 : name(args[accumulator_name])
25 , wrapper(new accumulator_wrapper(A(args)))
29 template<
typename ArgumentPack>
30 AccumulatorBase(
const ArgumentPack& rhs,
31 typename std::enable_if<std::is_base_of<AccumulatorBase,ArgumentPack>::value,
int>::type =0)
33 wrapper(
std::shared_ptr<accumulator_wrapper>(rhs.wrapper->new_clone()))
38 const AccumulatorBase&
operator<<(
const T& value)
const 45 std::shared_ptr<result_wrapper>
result()
const 47 return wrapper->result();
51 AccumulatorBase& operator=(
const AccumulatorBase& rhs)
55 this->wrapper = std::shared_ptr<accumulator_wrapper>(rhs.wrapper->new_clone());
64 this->wrapper->collective_merge(comm,root);
69 std::shared_ptr<accumulator_wrapper> wrapper;
75 impl::Accumulator<T, mean_tag, impl::Accumulator<T, count_tag, impl::AccumulatorBase<T> > >
78 typedef detail::AccumulatorBase<accumulator_type>
base_type;
80 BOOST_PARAMETER_CONSTRUCTOR(
82 (detail::AccumulatorBase<accumulator_type>),
84 (required (_accumulator_name, (std::string)))
92 typename impl::Accumulator<T, error_tag, typename
MeanAccumulator<T>::accumulator_type>
95 typedef detail::AccumulatorBase<accumulator_type>
base_type;
97 BOOST_PARAMETER_CONSTRUCTOR(
99 (detail::AccumulatorBase<accumulator_type>),
100 accumulator_keywords,
101 (required (_accumulator_name, (std::string)))
108 typename impl::Accumulator<T, binning_analysis_tag, typename
NoBinningAccumulator<T>::accumulator_type>
111 typedef detail::AccumulatorBase<accumulator_type>
base_type;
113 BOOST_PARAMETER_CONSTRUCTOR(
115 (detail::AccumulatorBase<accumulator_type>),
116 accumulator_keywords,
117 (required (_accumulator_name, (std::string)))
124 autocorrelation_type tau() const;
128 typename impl::Accumulator<T, max_num_binning_tag, typename
LogBinningAccumulator<T>::accumulator_type>
131 typedef detail::AccumulatorBase<accumulator_type>
base_type;
133 BOOST_PARAMETER_CONSTRUCTOR(
135 (detail::AccumulatorBase<accumulator_type>),
136 accumulator_keywords,
137 (required (_accumulator_name, (std::string)))
139 (_max_bin_number, (std::size_t))
146 typedef typename autocorrelation_type<accumulator_type>::type autocorrelation_type;
148 autocorrelation_type tau() const;
151 #define ALPS_ACCUMULATOR_REGISTER_OPERATOR(A) \ 152 template<typename T> accumulator_set & operator<<(accumulator_set & set, const A <T> & arg); 158 #undef ALPS_ACCUMULATOR_REGISTER_OPERATOR detail::AccumulatorBase< accumulator_type > base_type
impl::Accumulator< T, mean_tag, impl::Accumulator< T, count_tag, impl::AccumulatorBase< T > > > accumulator_type
detail::AccumulatorBase< accumulator_type > base_type
detail::AccumulatorBase< accumulator_type > base_type
Encapsulation of an MPI communicator and some communicator-related operations.
#define ALPS_ACCUMULATOR_REGISTER_OPERATOR(A)
accumulator_type::result_type result_type
std::ostream & operator<<(std::ostream &os, const result_wrapper &arg)
detail::AccumulatorBase< accumulator_type > base_type
accumulator_type::result_type result_type
accumulator_type::result_type result_type
accumulator_type::result_type result_type
traits< Acc >::result_type result(const Acc &acc)
impl::Accumulator< T, error_tag, typename MeanAccumulator< T >::accumulator_type > accumulator_type
impl::Accumulator< T, binning_analysis_tag, typename NoBinningAccumulator< T >::accumulator_type > accumulator_type
impl::Accumulator< T, max_num_binning_tag, typename LogBinningAccumulator< T >::accumulator_type > accumulator_type
autocorrelation_type< accumulator_type >::type autocorrelation_type
Data type corresponding to autocorrelation.