Question

In the doc, they say

We decided to use no operator overloading for ...

They provide prod instead for these. But why? Is there any good reason? I like to do matrix * vector (as in most other languages). I like to understand why they did not overloaded this operator to understand why it might be a bad idea to just do it myself. Or aren't they any drawbacks if I overload it myself?

Était-ce utile?

La solution

Probably, because op* in other languages, e.g. with Numpy in Python, will always be element-wise. In case that one element is a matrix and another one is a vector, it will try to broadcast all the elements in the missing dimension.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top