12 namespace alps {
namespace alea {
16 typedef bool result_type;
18 template <
typename Res>
19 bool operator() (
const Res &
r)
const {
return r.valid(); }
24 typedef size_t result_type;
26 template <
typename Res>
27 size_t operator() (
const Res &
r)
const {
return r.size(); }
32 typedef size_t result_type;
34 template <
typename Res>
35 size_t operator() (
const Res &
r)
const {
return r.count(); }
41 typedef column<T> result_type;
43 column<T> operator() (
const mean_result<T> &
r)
const {
return r.mean(); }
44 template <
typename Str>
45 column<T> operator() (
const var_result<T,Str> &r)
const {
return r.mean(); }
46 template <
typename Str>
47 column<T> operator() (
const cov_result<T,Str> &r)
const {
return r.mean(); }
48 column<T> operator() (
const autocorr_result<T> &r)
const {
return r.mean(); }
49 column<T> operator() (
const batch_result<T> &r)
const {
return r.mean(); }
52 template <
typename Res>
53 column<T> operator() (
const Res &)
const {
throw estimate_type_mismatch(); }
56 template <
typename T,
typename Str>
59 typedef column<typename bind<Str,T>::var_type> result_type;
61 result_type operator() (
const mean_result<T> &)
const {
throw estimate_unavailable(); }
62 result_type operator() (
const var_result<T,Str> &r)
const {
return r.var(); }
63 result_type operator() (
const cov_result<T,Str> &r)
const {
return r.var(); }
64 result_type operator() (
const autocorr_result<T> &)
const {
throw estimate_type_mismatch(); }
65 result_type operator() (
const batch_result<T> &r)
const {
return r.template var<Str>(); }
68 template <
typename Res>
69 result_type operator() (
const Res &)
const {
throw estimate_type_mismatch(); }
73 struct var_visitor<T, circular_var>
75 typedef circular_var Str;
76 typedef column<typename bind<circular_var,T>::var_type> result_type;
78 result_type operator() (
const mean_result<T> &)
const {
throw estimate_unavailable(); }
79 result_type operator() (
const var_result<T,Str> &r)
const {
return r.var(); }
80 result_type operator() (
const cov_result<T,Str> &r)
const {
return r.var(); }
81 result_type operator() (
const autocorr_result<T> &r)
const {
return r.var(); }
82 result_type operator() (
const batch_result<T> &r)
const {
return r.var(); }
85 template <
typename Res>
86 result_type operator() (
const Res &)
const {
throw estimate_type_mismatch(); }
89 template <
typename T,
typename Str>
92 typedef typename eigen<typename bind<Str,T>::cov_type>::matrix result_type;
94 result_type operator() (
const mean_result<T> &)
const {
throw estimate_unavailable(); }
95 result_type operator() (
const var_result<T,Str> &)
const {
throw estimate_unavailable(); }
96 result_type operator() (
const cov_result<T,Str> &r)
const {
return r.cov(); }
97 result_type operator() (
const autocorr_result<T> &)
const {
throw estimate_unavailable(); }
98 result_type operator() (
const batch_result<T> &r)
const {
return r.template cov<Str>(); }
101 template <
typename Res>
102 result_type operator() (
const Res &)
const {
throw estimate_type_mismatch(); }
105 struct serialize_visitor
107 typedef bool result_type;
109 serialize_visitor(serializer &s,
const std::string &key) : s_(s), key_(key) { }
112 template <
typename Res>
113 bool operator() (
const Res &res)
const 121 const std::string &key_;
139 template <
typename T>
148 template <
typename T,
typename Str>
154 template column<double> result::var<double, circular_var>()
const;
158 template <
typename T,
typename Str>
column< typename bind< Str, T >::var_type > var() const
F::result_type apply_visitor(F &visitor, dictionary::const_iterator it)
Const-access visitor to a value by an iterator.
void serialize(serializer &, const std::string &, const autocorr_result< T > &)
eigen< typename bind< Str, T >::cov_type >::matrix cov() const
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > matrix
T r(T x, T y=T(), T z=T())