9 #include <alps/config.hpp> 20 #include <boost/preprocessor/tuple/to_seq.hpp> 21 #include <boost/preprocessor/seq/for_each.hpp> 28 #ifndef ALPS_ACCUMULATOR_VALUE_TYPES_SEQ 29 #define ALPS_ACCUMULATOR_VALUE_TYPES_SEQ BOOST_PP_TUPLE_TO_SEQ(ALPS_ACCUMULATOR_VALUE_TYPES_SIZE, (ALPS_ACCUMULATOR_VALUE_TYPES)) 33 namespace accumulators {
36 class accumulator_wrapper;
58 boost::uint64_t
count()
const;
62 #define ALPS_ACCUMULATOR_MEAN_IMPL(r, data, T) \ 65 #undef ALPS_ACCUMULATOR_MEAN_IMPL 67 #define ALPS_ACCUMULATOR_ERROR_IMPL(r, data, T) \ 68 T error_impl(T) const; 70 #undef ALPS_ACCUMULATOR_ERROR_IMPL 75 template<
typename T> T
mean()
const {
76 return mean_impl(T());
80 template<
typename T> T
error()
const {
81 return mean_impl(T());
91 void print(std::ostream & os)
const;
95 std::ptrdiff_t * m_cnt;
116 #define ALPS_ACCUMULATOR_OPERATOR_CALL(r, data, T) \ 117 virtual_accumulator_wrapper & operator()(T const & value); \ 118 virtual_accumulator_wrapper & operator<<(T const & value) { \ 123 #undef ALPS_ACCUMULATOR_OPERATOR_CALL 126 void merge(
const virtual_accumulator_wrapper & rhs);
128 virtual_accumulator_wrapper & operator=(std::shared_ptr<virtual_accumulator_wrapper>
const & rhs);
131 boost::uint64_t
count()
const;
135 #define ALPS_ACCUMULATOR_MEAN_IMPL(r, data, T) \ 136 T mean_impl(T) const; 138 #undef ALPS_ACCUMULATOR_MEAN_IMPL 140 #define ALPS_ACCUMULATOR_ERROR_IMPL(r, data, T) \ 141 T error_impl(T) const; 143 #undef ALPS_ACCUMULATOR_ERROR_IMPL 148 template<
typename T> T
mean()
const {
149 return mean_impl(T());
153 template<
typename T> T
error()
const {
154 return mean_impl(T());
167 std::shared_ptr<virtual_result_wrapper<virtual_accumulator_wrapper> >
result()
const;
170 void print(std::ostream & os)
const;
180 std::ptrdiff_t * m_cnt;
202 std::string
const &
name()
const {
return m_name; }
210 std::string
const &
name()
const {
return m_name; }
218 std::string
const &
name()
const {
return m_name; }
226 std::string
const &
name()
const {
return m_name; }
231 #define ALPS_ACCUMULATOR_ADD_ACCUMULATOR(r, data, T) \ 232 accumulator_set & operator<<(accumulator_set & set, const MeanAccumulator< T > & arg); \ 233 accumulator_set & operator<<(accumulator_set & set, const NoBinningAccumulator< T > & arg); \ 234 accumulator_set & operator<<(accumulator_set & set, const LogBinningAccumulator< T > & arg); \ 235 accumulator_set & operator<<(accumulator_set & set, const FullBinningAccumulator< T > & arg); 237 #undef ALPS_ACCUMULATOR_ADD_ACCUMULATOR
void save(hdf5::archive &ar) const
#define ALPS_ACCUMULATOR_OPERATOR_CALL(r, data, T)
void load(hdf5::archive &ar)
impl::wrapper_set< result_wrapper > result_set
void print(std::ostream &os) const
NoBinningAccumulator(std::string const &name)
LogBinningAccumulator(std::string const &name)
void print(std::ostream &os) const
Encapsulation of an MPI communicator and some communicator-related operations.
void reset(virtual_accumulator_wrapper &arg)
boost::uint64_t count() const
std::string const & name() const
virtual ~virtual_result_wrapper()
#define ALPS_ACCUMULATOR_MEAN_IMPL(r, data, T)
std::string const & name() const
impl::wrapper_set< accumulator_wrapper > accumulator_set
#define ALPS_ACCUMULATOR_ADD_ACCUMULATOR(r, data, T)
MeanAccumulator(std::string const &name)
std::string const & name() const
std::string const & name() const
traits< Acc >::result_type result(const Acc &acc)
#define ALPS_ACCUMULATOR_VALUE_TYPES_SEQ
FullBinningAccumulator(std::string const &name)
#define ALPS_ACCUMULATOR_ERROR_IMPL(r, data, T)
std::vector< T > & merge(std::vector< T > &left, const std::vector< T > &right)
Vector merge.
std::ostream & operator<<(std::ostream &os, const virtual_accumulator_wrapper &arg)