int size = 10;
IDoubleArray D = instance.diag(10, 1);
IDoubleArray matrix = instance.matrix(size, size, 2);
AlgebraUtilities util = new AlgebraUtilities();
IDoubleArray result = util.multiplyElementsToNew(matrix, D);
IDoubleArray expResult = instance.diag(size, 2);
assertArrayEquals(expResult.getArray(), result.getArray(), delta);
}