This method computes the Hadamard product of two matrices $A, B$ of the same size. The Hadamard product is defined as the componentwise product, i.e., if $A, B$ are $m\times n$ matrices, then the Hadamard product is the $m\times n$ matrix with $(i,j)$ entry equal to $A_{i,j}*B_{i,j}$.
i1 : (A1, A2) = (random(ZZ^2, ZZ^3), random(ZZ^2, ZZ^3)) o1 = (| 8 3 8 |, | 3 8 5 |) | 1 7 3 | | 7 8 7 | o1 : Sequence |
i2 : hadamard(A1, A2) o2 = | 24 24 40 | | 7 56 21 | 2 3 o2 : Matrix ZZ <--- ZZ |
The object hadamard is a method function.