summaryrefslogtreecommitdiff
path: root/hadamard_pt.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'hadamard_pt.hpp')
-rw-r--r--hadamard_pt.hpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/hadamard_pt.hpp b/hadamard_pt.hpp
index 744c866..0b32908 100644
--- a/hadamard_pt.hpp
+++ b/hadamard_pt.hpp
@@ -32,10 +32,12 @@ public:
PT(std::list<range> ranges, unsigned n, ParallelMeasurement& B,
std::vector<Measurement*>& As)
: B(B), As(As) {
+ unsigned count = 0;
for (range r : ranges) {
- for (unsigned i = 0; i < r.N; i++) {
- double β = r.β0 + i * (r.β1 - r.β0) / (r.N - 1);
- Ms.push_back(MCMC(n, β, *As[i]));
+ for (unsigned i = 1; i <= r.N; i++) {
+ double β = r.β0 + i * (r.β1 - r.β0) / r.N;
+ Ms.push_back(MCMC(n, β, *As[count]));
+ count++;
}
}
}