We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f3e1e79 commit e36d335Copy full SHA for e36d335
src/pfasst-quadrature.hpp
@@ -5,6 +5,7 @@
5
#include <algorithm>
6
#include <cmath>
7
#include <complex>
8
+#include <limits>
9
#include <vector>
10
11
using namespace std;
@@ -105,15 +106,15 @@ namespace pfasst {
105
106
coeffT acc = 0.0;
107
for (int j=0; j<n; j++)
108
acc += abs(z0[j] - z1[j]);
- if (acc < 1e-24)
109
+ if (acc < 2*numeric_limits<coeffT>::epsilon())
110
break;
111
112
z1 = z0;
113
}
114
115
vector<coeffT> roots(n);
116
- roots[j] = abs(z0[j]) < 1e-12 ? 0.0 : real(z0[j]);
117
+ roots[j] = abs(z0[j]) < 4*numeric_limits<coeffT>::epsilon() ? 0.0 : real(z0[j]);
118
119
sort(roots.begin(), roots.end());
120
return roots;
0 commit comments