why has uBLAS no `operator*(matrix, vector)`?

一世执手 提交于 2020-04-10 22:39:11

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/20056774/why-has-ublas-no-operatormatrix-vector

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!