简体   繁体   中英

ilnumerics matrix multiplication operator

Ilnumerics is great, and I really like it. However, the matrix multiplication operator * is set to ILMath.multiplyElem, the element wise multiplication. I wonder why not make it ILMath.multiply, the normal matrix multiplication which is consistent with matlab, and more natural to use. In mathematics, the element wise multiplication is less often used. I think it will be much better to change the * behavior to normal matrix multiplication.

Here are just some very common examples, where your suggestion would give less convenience:

ILArray<double> A = rand(100,200) * 10 - 5; 

// square of A
A = A * A; 

// multidimensional arrays
rand(10,20,5) * ...

// vector expansion
B = A * linspace(0.0, 9.0, 100); 

In mathematics, the element wise multiplication is less often used

Are you positive about that? It heavily depends on the domain, I suppose.

The decision has been discussed. And your suggestion would be a major breaking change. But you can open a feature request and collect votes for it:

http://ilnumerics.net/mantis

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM