Trevorton27
Hadamard product without using a library?
Looking for a to code the Hadamard product without using a library. Still relatively new to Elixir so feeling a bit lost.
Most Liked
patrickdm
For the non mathematicians like me, here’s the wikipedia definition
In mathematics, the Hadamard product (also known as the element-wise product , entrywise product [1]: ch. 5 or Schur product [2]) is a binary operation that takes two matrices of the same dimensions and produces another matrix of the same dimension as the operands, where each element i, j is the product of elements i, j of the original two matrices.
![]()
I’d start with how to represent the input matrices and make sure they have equal dimensions … ![]()
hauleth
Enum.zip_with(a, b, &*/2), but this will work only on 1D lists.
patrickdm
a very long and indecipherable one I fear
(but I have issues with comprehensions’ comprehension)
josefrichter
I was joking of course
But was pointing towards some sort of multiplying two 1D lists
lud
What is the data structure for your matrices?







