/** * @param A * @param B * @return */ public static float dot(Matrix A, Matrix B) { int aLen = A.m * A.n; int bLen = B.m * B.n; try { if (bLen != aLen) throw new Matrix.WrongDimensionsException(); } catch (Matrix.WrongDimensionsException e) { e.printStackTrace(); System.exit(1); } float[] dotP = new float[1]; Level1.sdot(aLen, dotP, A.getData(), B.getData()); return dotP[0]; }