Here you can find the source of multiplyMatrices(float[][] left, float[][] right)
public static float[][] multiplyMatrices(float[][] left, float[][] right)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from w w w. j a va2 s . c om*/ * Returns the matrix product left * right. Dimensions of left and right must match up. */ public static float[][] multiplyMatrices(float[][] left, float[][] right) { if (left[0].length != right.length) { throw new IllegalArgumentException("Columns of left matric must match rows of right matrix."); } float[][] result = new float[left.length][right[0].length]; for (int i = 0; i < left.length; ++i) { for (int j = 0; j < right[0].length; ++j) { result[i][j] = 0; for (int k = 0; k < right.length; ++k) { result[i][j] += left[i][k] * right[k][j]; } } } return result; } }