Elementwise multiplication two matrices or PrimitiveDenseStores in ojAlgo

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