Sure. Division also is, in exactly the same elementwise way as addition.
For those who typically do matrix calculations? Yes, I guess. For everyone else? I really doubt.
But the thing is - it does not avoid them! See my previous post for example: how should one (having experience with other languages, eg python or R) guess that even though a .+ b
does the expected broadcasting all the way down, a .* b
gives results of the same shape (i.e. no errors anywhere) but completely different content (in case of Array{Array{2}}
)? Note I’m not talking about language designer perspective, only from the user’s point of view.
And regarding division specifically - even you say “some kind of inverse” suggesting it is not obvious. Indeed, I cannot even find in the docs what it does for vectors! Docs say Right division operator: multiplication of x by the inverse of y on the right.
Ok, do we have vector inverses? No: inv([1, 2])
says no method. However, [1, 2] / [1, 2]
gives some result…
UPD: actually, thinking about this I even can see a possible solution to the confusion. If all those matrix operations are defined in LinAlg, then maybe just don’t import (using
) it by default and require explicit action from the user? Then all the arithmetics on 1/2-d arrays will just fail instead of returning some (unexpected to those not doing matrices at this time) result.