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, 4 insertions, 4 deletions
diff --git a/hadamard_pt.hpp b/hadamard_pt.hpp
index 5500f57..812186d 100644
--- a/hadamard_pt.hpp
+++ b/hadamard_pt.hpp
@@ -64,7 +64,7 @@ public:
}
}
- std::vector<double> tune(unsigned n0, unsigned m, double ε, double ε2) {
+ void tune(unsigned n0, unsigned m, double ε, double ε2) {
unsigned n = n0;
@@ -148,12 +148,12 @@ public:
}
for (unsigned i = 0; i < T1.size(); i++) {
- err += fabs(T1[i] - 1/ Ms[Ms.size() - i - 2].β) / T1[i];
+ err += fabs(T1[i] - 1/ Ms[Ms.size() - i - 2].β);
Ms[Ms.size() - i - 2].β = 1 / T1[i];
}
- if (err / T1.size() < ε2) {
- return f;
+ if (err / T1.size() * Ms.size() / (1/Ms.front().β - 1/Ms.back().β) < ε2) {
+ break;
}
n *= 2;