Here you can find the source of multiply(boolean[][] matrix, boolean[] vector)
public static boolean[] multiply(boolean[][] matrix, boolean[] vector)
//package com.java2s; //License from project: Apache License public class Main { public static boolean[] multiply(boolean[][] matrix, boolean[] vector) { if (matrix == null || vector == null) { return null; }// w ww .ja v a 2s . com if (matrix[0].length != vector.length) { return null; } int n = matrix[0].length; int m = matrix.length; boolean[] result = new boolean[m]; for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { result[i] = result[i] ^ (matrix[i][j] & vector[j]); } } return result; } }