Dear all,
I’m trying to find a way to repeat an operation over the fields of tuples, which have consistent size.
For example, let’s consider the sum A = B + C
, but applied to each field of a tuple.
let
size1 = (10, 10)
size2 = (11, 11)
a = (zeros(size1), zeros(size2))
b = ( ones(size1), ones(size2))
c = ( ones(size1), ones(size2))
# Two lines
@. a[1] = b[1] + c[1]
@. a[2] = b[2] + c[2]
end
I would like to replace the two line statement by a single line. Is it possible to write a macro that could used to that end?
e,g,:
@my_macro a = b + c
Thanks for the hints!