3 ms·
That's the most basic feature of broadcasting, but not quite what Julia's broadcasting is all about. There's also the case of things like f(x,y) = cos(x)*s
by ChrisRackauckas 3y ago
That's the most basic feature of broadcasting, but not quite what Julia's broadcasting is all about. There's also the case of things like
f(x,y) = cos(x)*sin(y)
g(x,y) = tan(x)*inv(y)
x, y = (rand(4), rand(4))
z = rand(4)
z .= f.(x,y') .+ g.(x',y)
to create create one loop that creates whole matrix of results and writes in-place into z. Is there a syntax for that in modern Fortran? I know that it has intrinsic functions which accepts vectors but its this fusion of multiple operations mixed with how it handles differently-sized objects that really defines the braodcasting operation.
- ChrisRackauckas 3y agoLooking at https://fortranwiki.org/fortran/show/elemental https://fortranwiki.org/fortran/show/elemental, it doesn't discuss how to fuse elementals with out elemental operations, their behavior on different dimensional inputs, or how to make any operation elemental (for example the use case demonstrated in the blog post of `string.([:hi,:bye])` where a built-in operation for turning something into a strong is transformed into an array operation on-demand by the caller).
- sundarurfriend 3y agohttps://julialang.org/blog/2017/01/moredots/ https://julialang.org/blog/2017/01/moredots/ is a great post for anyone who needs more explanation of this fusion of multiple operations.