Here you can find the source of multiply(double[][] m1, double[][] m2)
private static double[][] multiply(double[][] m1, double[][] m2)
//package com.java2s; /******************************************************************************* * Copyright (c) 2010-2012 ITER Organization. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html ******************************************************************************/ public class Main { private static double[][] multiply(double[][] m1, double[][] m2) { int p1 = m1.length, p2 = m2.length, q2 = m2[0].length; double[][] result = new double[p1][q2]; for (int i = 0; i < p1; i++) for (int j = 0; j < q2; j++) for (int k = 0; k < p2; k++) result[i][j] += m1[i][k] * m2[k][j]; return result; }/* ww w . ja v a 2s . c o m*/ }