Skip to content
Snippets Groups Projects
Commit 4000ff0c authored by Stephan Seitz's avatar Stephan Seitz
Browse files

Fixup: mirror

parent 13ccdeec
No related branches found
No related tags found
No related merge requests found
Pipeline #16970 failed
...@@ -201,7 +201,8 @@ class InterpolatorAccess(TypedSymbol): ...@@ -201,7 +201,8 @@ class InterpolatorAccess(TypedSymbol):
elif str(self.interpolator.address_mode).lower() == 'mirror': elif str(self.interpolator.address_mode).lower() == 'mirror':
def triangle_fun(x, half_period): def triangle_fun(x, half_period):
saw_tooth = sp.Abs(x) % (2 * half_period) saw_tooth = sp.Abs(x) % (2 * half_period)
return (half_period - 1) - sp.Abs(saw_tooth - (half_period - 1)) return sp.Piecewise((saw_tooth, saw_tooth < half_period),
(2 * half_period - 1 - saw_tooth, True))
index = [cast_func(triangle_fun(i, field.shape[dim]), index = [cast_func(triangle_fun(i, field.shape[dim]),
default_int_type) for (dim, i) in enumerate(index)] default_int_type) for (dim, i) in enumerate(index)]
sum[channel_idx] += weight * absolute_access(index, channel_idx if field.index_dimensions else ()) sum[channel_idx] += weight * absolute_access(index, channel_idx if field.index_dimensions else ())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment