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); + } }