1
我在想,是否在Apache Math Commons庫中有一個用於元素級乘法的特徵,類似於MATLAB中使用的特徵,即生成的矩陣C
等於矩陣A
乘以矩陣B
中的對應值。我想避免編寫我自己的版本,因爲我知道線性代數包是針對這些類型的操作進行了高度優化的,並且如果已經存在(已優化),我不想在自己的實現上失去性能。Java Apache Common Commons Element-Wise矩陣乘法
在MATLAB中:C = A.*B
和A
的尺寸必須等於B
的s。
我失去了你的問題的一部分,你說你走過去['RealMatrix'接口(https://commons.apache.org/proper/commons-math/ apidocs/org/apache/commons/math3/linear/RealMatrix.html)並沒有找到任何東西。當你做了_that_看看[這裏](http://glimmpse.samplesizeshop.org/documentation/JavaStatistics/1.2/api/edu/cudenver/bios/matrix/MatrixUtils.html#getElementWiseProduct%28org.apache.commons.math3 .linear.RealMatrix,%20org.apache.commons.math3.linear.RealMatrix%29)。 –
對不起,回覆遲了,我看了我不敢相信我沒有找到它!感謝您清理它:) –
請注意,我發佈的最後一個鏈接是發生在實施您所需的第三方庫。沒有理由感覺不好:) –