public static Matrix elementWiseMultiplication(Matrix a,Matrix b) {
assertSameLength(a,b);
Matrix ret = new DenseMatrix(a.rowSize(),a.columnSize());
Matrix mult = a.rowSize() != b.rowSize() ? b.transpose() : b;
for(int i = 0; i < ret.rowSize(); i++) {
for(int j = 0; j < ret.columnSize(); j++) {
ret.setQuick(i, j, a.getQuick(i, j) * mult.getQuick(i, j));
}
}