Elementwise multiplication two matrices or PrimitiveDenseStores in ojAlgo

779 Views Asked by At

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 1 best solutions below

1
On BEST ANSWER

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).