4

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?

Albert
  • 65,406
  • 61
  • 242
  • 386
  • Unless one of the authors visits stackoverflow you probably won't get a real answer. – bames53 Nov 18 '13 at 20:26
  • @bames53: I expected that. But maybe there is also some good reason which I'm missing here. But if nobody answers, that is also kind of an answer to me in the sense that it was a kind of arbitrary choice by the authors. Maybe I also just ask the authors then. – Albert Nov 19 '13 at 09:34

1 Answers1

0

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.

Albert
  • 65,406
  • 61
  • 242
  • 386