package be.ac.vub.ir.multithreading; import java.util.Random; import java.util.Vector; import javax.swing.JFrame; import be.ac.vub.ir.data.Chart; import be.ac.vub.ir.data.ChartOptions; import be.ac.vub.ir.data.XYRawData; import be.ac.vub.ir.util.Chrono; import edu.cmu.tetrad.data.LongColumn; import flanagan.math.Fmath; public class MatrixMultiplication { public static void main(String[] args) { oneComparison(300, 10, 10, true); // varyThreads(150, 5, 100); // varyMatrixSize(4, 5, 500); } public static double oneComparison(final int N, final int NBR_EXPS, final int NBR_THREADS, final boolean PRINT ) { if (PRINT) System.out.println(" == "+N+" X "+N+" Matrices " +NBR_EXPS+" exps == "); if (PRINT) System.out.println("Sequential:"); LongColumn col = new LongColumn("computation times"); for(int i=0;i Speedup = "+Fmath.truncate(speedup, 3)); return speedup; } public static void varyThreads(final int N, final int NBR_EXPS, final int MAX_THREADS){ XYRawData data = new XYRawData("Nbr Threads","#", "Speedup", ""); data.add(1, 1); for(int t=2;t threads = new Vector(); final int NBR_ROWS = A.rows, NBR_COLUMNS = B.cols; for(int i=0; i