But I do not understand why this is true or, better, why * does not multiply the two vectors the same way. How can I use map to multiply the two vectors?
This is where you use broadcasting instead of map. It broadcasts across singleton dimensions, and in this particular case, it is trivial to express it as
x .* y'
There’s not all that much point to change from x * y' to x .* y' in and of itself. But you can fuse it with other operations, or do it in-place, like this
By definition, map.() is doing map for individual element, if you’re writing this you might as well do
x .* y'
julia> x .* y' == x * y'
true
but THIS IS AN COINCIDENCE,
julia> x' .* y == x' * y
false
like, the point shouldn’t be literally use “map” somewhere in the code, the point is map is doing element operation and the * inside x * y' is conceptually not an element-wise operation
I still don’t understand why you are insisting on showing simple linear algebra concepts like “dot product” and “outer product” can be expressed using something containing the word “map” – how is this helpful for a beginner like OP?
I was only trying to find a Julia function similar to the Router function, where outer(x, y, FUN = "*") == x %*% t(y). FUN is a vectorized function like + or +. That is why I was trying to use map in Julia.
In Julia you don’t use any special function for this, you just broadcast whatever operator you want, like x .* y', x .+ y', x .< y', x .% y', etc etc etc.