From bbe304606aa4a6dfcf5806f143ea158822e89517 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Fuhry?= Date: Fri, 26 May 2023 00:39:13 +0200 Subject: [PATCH] Too tired to write descriptive message --- src/Matrix.java | 10 ++++++++++ src/TestMatrix.java | 15 +++++++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/Matrix.java b/src/Matrix.java index 9104cf8..c79aed9 100644 --- a/src/Matrix.java +++ b/src/Matrix.java @@ -11,6 +11,16 @@ public class Matrix { public static void main(String[] args) {} + public Matrix(int rowLength, int columnLength, boolean random) { + if(!random) { + return; + } + matrix = new int[rowLength][columnLength]; + this.rowLength = rowLength; + this.columnLength = columnLength; + randomAdjazenzMatrix(); + } + public Matrix(String file) { readCSV(file); } diff --git a/src/TestMatrix.java b/src/TestMatrix.java index 7e8b04a..210da69 100644 --- a/src/TestMatrix.java +++ b/src/TestMatrix.java @@ -1,6 +1,11 @@ public class TestMatrix { public static void main(String[] args) { - String pathToProgramRoot = "/home/rene/projects/Java/graphprogram"; + test1(); + test2(); + } + + public static void test1() { + String pathToProgramRoot = ""; Matrix matrix = new Matrix(pathToProgramRoot + "/csv/graph.csv"); Matrix scalarProduct; @@ -12,8 +17,10 @@ public class TestMatrix { scalarProduct = matrix.multiply(matrix); System.out.println("\nScalarProduct A²: \n" + scalarProduct); - - Matrix bruh = new Matrix(100, 100); - System.out.println(bruh); } + + public static void test2() { + Matrix bruh = new Matrix(10, 10, true); + System.out.println(bruh); + } }