broadcast_function
broadcast_function(f)
Returns a function broadcast_f
such that broadcast_function(f)(As...) === broadcast(f, As...)
. Most useful in the form const broadcast_f = broadcast_function(f)
.
Examples
julia> foo = [1 2];
julia> bar = [1; 2];
julia> function f(x,y)
-(x+y)
end;
julia> g = broadcast_function(f);
julia> baz = g(foo, bar)
2x2 Array{Int64,2}:
-2 -3
-3 -4
julia> g(foo, [3:1:6])
4x2 Array{Int64,2}:
-4 -5
-5 -6
-6 -7
-7 -8
See Also
User Contributed Notes
Add a Note
The format of note supported is markdown, use triple backtick to start and end a code block.