Hi Peter. Thanks for the reply. I took your advice and tried using the Equation class. But I still have the same issue. Perhaps I misunderstood? Here is my code:
double[][] a = {{ 1.62434536, -0.61175641},
{-0.52817175, -1.07296862},
{ 0.86540763, -2.3015387}};
SimpleMatrix A = new SimpleMatrix(a);
double[][] w = {{1.74481176, -0.7612069, 0.3190391}};
SimpleMatrix W = new SimpleMatrix(w);
double[][] b = {{-0.24937038}};
SimpleMatrix B = new SimpleMatrix(b);
SimpleMatrix Z = new SimpleMatrix(0,0);
Equation eq = new Equation();
eq.alias(A,"A",W,"W",B,"B",Z,"Z");
eq.process("Z = W*A");
eq.process("Z = Z+B");
Everything works fine until the final line where I get the error 'The matrices are not all the same dimension'. I can't assume that B is 1x1 as this may vary. However, if its not 1x1 I would expect the dims of B to be (Zrows,1) or (1, Zcols). Are you able to assist further?
Thanks