aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2019-12-28 18:51:39 +0100
committerAnton Khirnov <anton@khirnov.net>2020-01-20 14:58:39 +0100
commit869ed8e18efc9ee602f45267776cd179c80ec3af (patch)
tree0ce0b89e8d26a29f95375b042598f4571e80f20f
parent765b385c8c9ab25fe0a9f6fead1be4028e226024 (diff)
transfer: slightly relax the domain overlap check
Allow the destination domain to be outside the source by a small margin (1e-12).
-rw-r--r--transfer.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/transfer.c b/transfer.c
index ee635b9..a791467 100644
--- a/transfer.c
+++ b/transfer.c
@@ -481,7 +481,9 @@ int mg2di_gt_init(GridTransferContext *ctx)
dst_start = ctx->dst.start[i] * ctx->dst.step[i];
dst_end = (ctx->dst.start[i] + ctx->dst.size[i] - 1) * ctx->dst.step[i];
- if (src_start >= src_end || dst_start < src_start || dst_end > src_end)
+ if (src_start >= src_end ||
+ dst_start - src_start < -1e-12 ||
+ src_end - dst_end < -1e-12)
return -EINVAL;
}