问题
Can anyone tell me how to multiply corresponding elements of two matrices in ojAlgo?
Looking for block function for c[i][j] = a[i][j] * b[i][j]
回答1:
There are several ways to do that. Here's one alternative:
matrixA.operateOnMatching(MULTIPLY, matrixB).supplyTo(matrixC);
Where MULTIPLY comes from a static import (org.ojalgo.function.constant.PrimitiveMath).
来源:https://stackoverflow.com/questions/41665158/elementwise-multiplication-two-matrices-or-primitivedensestores-in-ojalgo