ALPSCore reference
Classes | Namespaces | Macros | Typedefs | Functions
accumulator.hpp File Reference
#include <alps/config.hpp>
#include <alps/hdf5/vector.hpp>
#include <alps/accumulators/wrappers.hpp>
#include <alps/accumulators/wrapper_set.hpp>
#include <alps/hdf5/archive.hpp>
#include <memory>
#include <boost/variant/variant.hpp>
#include <boost/variant/get.hpp>
#include <typeinfo>
#include <type_traits>
#include <stdexcept>
Include dependency graph for accumulator.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  alps::accumulators::result_wrapper
 
class  alps::accumulators::accumulator_wrapper
 

Namespaces

 alps
 
 alps::accumulators
 

Macros

#define ALPS_ACCUMULATOR_PROPERTY_PROXY(PROPERTY, TYPE)
 
#define ALPS_ACCUMULATOR_OPERATOR_PROXY(OPNAME, AUGOPNAME, AUGOP, FUN)
 
#define ALPS_ACCUMULATOR_PROPERTY_PROXY(PROPERTY, TYPE)
 

Typedefs

typedef impl::wrapper_set< accumulator_wrapper > alps::accumulators::accumulator_set
 
typedef impl::wrapper_set< result_wrapper > alps::accumulators::result_set
 

Functions

result_wrapper alps::accumulators::operator+ (long double arg1, result_wrapper const &arg2)
 
result_wrapper alps::accumulators::operator- (long double arg1, result_wrapper const &arg2)
 
result_wrapper alps::accumulators::operator* (long double arg1, result_wrapper const &arg2)
 
result_wrapper alps::accumulators::operator/ (long double arg1, result_wrapper const &arg2)
 
std::ostream & alps::accumulators::operator<< (std::ostream &os, const result_wrapper &arg)
 
detail::printable_type alps::accumulators::short_print (const result_wrapper &arg)
 Return an "ostream-able" object to print result in a terse format. More...
 
detail::printable_type alps::accumulators::full_print (const result_wrapper &arg)
 Return an "ostream-able" object to print result in a verbose format. More...
 
template<typename A >
A & alps::accumulators::extract (result_wrapper &m)
 Return the "raw result" of type A held in the result_wrapper m, or throw. More...
 
template<typename A >
const A & alps::accumulators::extract (const result_wrapper &m)
 Return the "raw result" of type A held in the result_wrapper m, or throw. More...
 
template<typename AFROM , typename ATO >
result_wrapper alps::accumulators::cast_raw (const result_wrapper &res)
 Cast to the result_wrapper containing another raw result type, or throw. More...
 
template<template< typename > class AFROM, template< typename > class ATO>
result_wrapper alps::accumulators::cast (const result_wrapper &res)
 Cast to the result_wrapper containing another raw result type, or throw. More...
 
result_wrapper alps::accumulators::sin (result_wrapper const &arg)
 
result_wrapper alps::accumulators::cos (result_wrapper const &arg)
 
result_wrapper alps::accumulators::tan (result_wrapper const &arg)
 
result_wrapper alps::accumulators::sinh (result_wrapper const &arg)
 
result_wrapper alps::accumulators::cosh (result_wrapper const &arg)
 
result_wrapper alps::accumulators::tanh (result_wrapper const &arg)
 
result_wrapper alps::accumulators::asin (result_wrapper const &arg)
 
result_wrapper alps::accumulators::acos (result_wrapper const &arg)
 
result_wrapper alps::accumulators::atan (result_wrapper const &arg)
 
result_wrapper alps::accumulators::abs (result_wrapper const &arg)
 
result_wrapper alps::accumulators::sqrt (result_wrapper const &arg)
 
result_wrapper alps::accumulators::log (result_wrapper const &arg)
 
result_wrapper alps::accumulators::sq (result_wrapper const &arg)
 
result_wrapper alps::accumulators::cb (result_wrapper const &arg)
 
result_wrapper alps::accumulators::cbrt (result_wrapper const &arg)
 
std::ostream & alps::accumulators::operator<< (std::ostream &os, const accumulator_wrapper &arg)
 
detail::printable_type alps::accumulators::short_print (const accumulator_wrapper &arg)
 Return an "ostream-able" object to print accumulator in a terse format. More...
 
detail::printable_type alps::accumulators::full_print (const accumulator_wrapper &arg)
 Return an "ostream-able" object to print accumulator in a verbose format. More...
 
template<typename A >
A & alps::accumulators::extract (accumulator_wrapper &m)
 
void alps::accumulators::reset (accumulator_wrapper &arg)
 

Macro Definition Documentation

#define ALPS_ACCUMULATOR_OPERATOR_PROXY (   OPNAME,
  AUGOPNAME,
  AUGOP,
  FUN 
)
Value:
private: \
struct FUN ## _self_visitor; \
public: \ \
result_wrapper & AUGOPNAME (result_wrapper const & rhs); \ \
result_wrapper & AUGOPNAME (long double arg); \
result_wrapper OPNAME (result_wrapper const & arg) const; \ \
result_wrapper OPNAME (long double arg) const;

Definition at line 263 of file accumulator.hpp.

#define ALPS_ACCUMULATOR_PROPERTY_PROXY (   PROPERTY,
  TYPE 
)
Value:
private: \
template<typename T> struct PROPERTY ## _visitor: public boost::static_visitor<T> { \
template<typename X> T apply(typename std::enable_if< \
detail::is_valid_argument<typename TYPE <X>::type, T>::value, X const & \
>::type arg) const { \
return arg. PROPERTY (); \
} \
template<typename X> T apply(typename std::enable_if<! \
detail::is_valid_argument<typename TYPE <X>::type, T>::value, X const & \
>::type /*arg*/) const { \
throw std::logic_error(std::string("cannot convert: ") \
+ typeid(typename TYPE <X>::type).name() + " to " \
+ typeid(T).name() + ALPS_STACKTRACE); \
} \
template<typename X> T operator()(X const & arg) const { \
return apply<typename X::element_type>(*arg); \
} \
}; \
public: \
template<typename T> typename TYPE <base_wrapper<T> >::type PROPERTY () const { \
PROPERTY ## _visitor<typename TYPE <base_wrapper<T> >::type> visitor; \
return boost::apply_visitor(visitor, m_variant); \
}
F::result_type apply_visitor(F &visitor, dictionary::const_iterator it)
Const-access visitor to a value by an iterator.
Definition: dictionary.hpp:110
#define ALPS_STACKTRACE
Definition: stacktrace.hpp:37

Definition at line 504 of file accumulator.hpp.

#define ALPS_ACCUMULATOR_PROPERTY_PROXY (   PROPERTY,
  TYPE 
)
Value:
private: \
template<typename T> struct PROPERTY ## _visitor: public boost::static_visitor<T> { \
template<typename X> T apply(typename std::enable_if< \
detail::is_valid_argument<typename TYPE <X>::type, T>::value, X const & \
>::type arg) const { \
return arg. PROPERTY (); \
} \
template<typename X> T apply(typename std::enable_if<! \
detail::is_valid_argument<typename TYPE <X>::type, T>::value, X const & \
>::type /*arg*/) const { \
throw std::logic_error(std::string("cannot convert: ") \
+ typeid(typename TYPE <X>::type).name() + " to " \
+ typeid(T).name() + ALPS_STACKTRACE); \
} \
template<typename X> T operator()(X const & arg) const { \
check_ptr(arg); \
return apply<typename X::element_type>(*arg); \
} \
}; \
public: \
template<typename T> typename TYPE <base_wrapper<T> >::type PROPERTY () const { \
PROPERTY ## _visitor<typename TYPE <base_wrapper<T> >::type> visitor; \
return boost::apply_visitor(visitor, m_variant); \
}
F::result_type apply_visitor(F &visitor, dictionary::const_iterator it)
Const-access visitor to a value by an iterator.
Definition: dictionary.hpp:110
#define ALPS_STACKTRACE
Definition: stacktrace.hpp:37

Definition at line 504 of file accumulator.hpp.