Question: Matrix Multiplication Implement two types of algorithms for multiplying two n times n matrices. Assume n is a power of 2: The straight-forward O(n^3) matrix

Matrix Multiplication Implement two types of algorithms for multiplying two n times n matrices. Assume n is a power of 2: The straight-forward O(n^3) matrix multiplication algorithm. Strassen's matrix multiplication algorithm. Evaluate your different algorithms, and write a short report. Create test matrices for different values of n (4, 16, 512 and 1024). Generate matrices using random numbers. Compute the running time of your algorithms. Your report should include the running times and conclusions. Sample Test class public class MatrixMultiplicatonTest {public static void main(String[] args) {//create two double 2-D arrays double[] [] a... double[][] b... Matrix m1 = new Matrix(a); Matrix m2 = new Matrix(b); System.out.println(m1); Matrix productStrassen = ml. multiplyStrassen(m2); Matrix productRegular = m1.multiply(m2); System.out.println("Are matrices the same? " + productStrassen.equals(productRegular)); System.out.println(productStrassen);}}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
