improve bounds checks in Chebyshev2
parent
1b909d2eea
commit
b766093022
|
@ -32,7 +32,7 @@ Weights Chebyshev2::CalculateWeights(size_t N, double x, double a, double b) {
|
||||||
const double dj =
|
const double dj =
|
||||||
x - Point(N, j, a, b); // only thing that depends on [a,b]
|
x - Point(N, j, a, b); // only thing that depends on [a,b]
|
||||||
|
|
||||||
if (std::abs(dj) < 1e-10) {
|
if (std::abs(dj) < 1e-12) {
|
||||||
// exceptional case: x coincides with a Chebyshev point
|
// exceptional case: x coincides with a Chebyshev point
|
||||||
weights.setZero();
|
weights.setZero();
|
||||||
weights(j) = 1;
|
weights(j) = 1;
|
||||||
|
@ -73,7 +73,7 @@ Weights Chebyshev2::DerivativeWeights(size_t N, double x, double a, double b) {
|
||||||
for (size_t j = 0; j < N; j++) {
|
for (size_t j = 0; j < N; j++) {
|
||||||
const double dj =
|
const double dj =
|
||||||
x - Point(N, j, a, b); // only thing that depends on [a,b]
|
x - Point(N, j, a, b); // only thing that depends on [a,b]
|
||||||
if (std::abs(dj) < 1e-10) {
|
if (std::abs(dj) < 1e-12) {
|
||||||
// exceptional case: x coincides with a Chebyshev point
|
// exceptional case: x coincides with a Chebyshev point
|
||||||
weightDerivatives.setZero();
|
weightDerivatives.setZero();
|
||||||
// compute the jth row of the differentiation matrix for this point
|
// compute the jth row of the differentiation matrix for this point
|
||||||
|
|
Loading…
Reference in New Issue