15 namespace alps {
namespace alea {
16 template <
typename Result>
struct joiner;
19 template <
typename T,
typename Str>
class var_data;
20 template <
typename T,
typename Str>
class cov_data;
26 namespace alps {
namespace alea {
42 template <
typename R1,
typename R2,
44 Result
join(
const R1 &first,
const R2 &second)
50 template <
typename Result>
56 template <
typename R1,
typename R2>
59 if (first.store().count() != second.store().count())
63 res.
store().data().topRows(first.size()) = first.store().data();
64 res.
store().data().bottomRows(second.size()) = second.store().data();
65 res.
store().count() = first.store().count();
73 template <
typename R1,
typename R2>
76 if (first.store().count() != second.store().count())
78 if (first.store().count2() != second.store().count2())
82 res.
store().data().topRows(first.size()) = first.store().data();
83 res.
store().data().bottomRows(second.size()) = second.store().data();
84 res.
store().data2().topRows(first.size()) = first.store().data2();
85 res.
store().data2().bottomRows(second.size()) = second.store().data2();
86 res.
store().count() = first.store().count();
87 res.
store().count2() = first.store().count2();
95 template <
typename R1,
typename R2>
98 if (first.store().count() != second.store().count())
100 if (first.store().count2() != second.store().count2())
104 res.
store().data().topRows(first.size()) = first.store().data();
105 res.
store().data().bottomRows(second.size()) = second.store().data();
108 res.
store().data2().topLeftCorner(first.size(), first.size())
109 = first.store().data2();
110 res.
store().data2().bottomRightCorner(second.size(), second.size())
111 = second.store().data2();
112 res.
store().count() = first.store().count();
117 template <
typename T>
120 template <
typename R1,
typename R2>
123 if (first.count() != second.count())
125 if (first.nlevel() != second.nlevel())
130 for (
size_t l = 0; l != first.nlevel(); ++l)
131 res.
level(l) =
join(first.level(l), second.level(l));
136 template <
typename T>
139 template <
typename R1,
typename R2>
142 if (first.store().count() != second.store().count())
144 if (first.store().num_batches() != second.store().num_batches())
148 first.store().num_batches()));
150 res.
store().batch().topRows(first.size()) = first.store().batch();
151 res.
store().batch().bottomRows(second.size()) = second.store().batch();
152 res.
store().count() = first.store().count();
batch_result< T > operator()(const R1 &first, const R2 &second)
const level_result_type & level(size_t i) const
const var_data< T, Strategy > & store() const
const mean_data< T > & store() const
Result join(const R1 &first, const R2 &second)
cov_result< T > operator()(const R1 &first, const R2 &second)
var_result< T > operator()(const R1 &first, const R2 &second)
mean_result< T > operator()(const R1 &first, const R2 &second)
autocorr_result< T > operator()(const R1 &first, const R2 &second)
const batch_data< T > & store() const
const cov_data< T, Strategy > & store() const