Assuming a 1 x M (A) and N x M (B) SimpleMatrix objects in ejml, is there a simple way to subtract A from B? I was looking for a way to repeat the rows of A to be the size of B, but didn't find the method to do this easily.
SimpleMatrix A = new SimpleMatrix(1, 2);
SimpleMatrix B = new SimpleMatrix(2, 2);
A.set(1.0);
B.setRow(0, 0, 2.0, 2.0);
B.setRow(1, 0, 4.0, 4.0);
// Throws java.lang.IllegalArgumentException
// The 'a' and 'b' matrices do not have compatible dimensions
SimpleMatrix C = B.minus(A);
// Expecting
// 1 1
// 3 3
Many answers using matlab (here and here), but I couldn't find a simple syntax for ejml.