Вопрос

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?

Это было полезно?

Решение

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top