quick fix
This commit is contained in:
parent
2de0ac5a02
commit
41680b3893
@ -17,6 +17,11 @@ public class Graph {
|
||||
|
||||
public static void main(String[] args) {}
|
||||
|
||||
public Graph(int rowLength, int columnLength) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
public Graph(String file) {
|
||||
adjazenzMatrix = new Matrix(file);
|
||||
calculateDistanzMatrix();
|
||||
@ -29,7 +34,7 @@ public class Graph {
|
||||
}
|
||||
|
||||
public void calculateDistanzMatrix() {
|
||||
distanzMatrix = new Matrix(adjazenzMatrix.getRowLength(), adjazenzMatrix.getColumnLength());
|
||||
distanzMatrix = new Matrix(adjazenzMatrix.getRowLength(), adjazenzMatrix.getColumnLength(), false);
|
||||
Matrix potenzMatrix = adjazenzMatrix;
|
||||
|
||||
for(int columnIndex=0; columnIndex < distanzMatrix.getColumnLength(); columnIndex++) {
|
||||
@ -58,7 +63,7 @@ public class Graph {
|
||||
}
|
||||
|
||||
public void calculateWegMatrix() {
|
||||
wegMatrix = new Matrix(adjazenzMatrix.getRowLength(), adjazenzMatrix.getColumnLength());
|
||||
wegMatrix = new Matrix(adjazenzMatrix.getRowLength(), adjazenzMatrix.getColumnLength(), false);
|
||||
Matrix potenzMatrix = adjazenzMatrix;
|
||||
|
||||
for(int columnIndex=0; columnIndex < wegMatrix.getColumnLength(); columnIndex++) {
|
||||
|
@ -15,11 +15,13 @@ public class Matrix {
|
||||
readCSV(file);
|
||||
}
|
||||
|
||||
public Matrix(int rowLength, int columnLength) {
|
||||
public Matrix(int rowLength, int columnLength, boolean random) {
|
||||
matrix = new int[rowLength][columnLength];
|
||||
this.rowLength = rowLength;
|
||||
this.columnLength = columnLength;
|
||||
randomAdjazenzMatrix();
|
||||
if(random) {
|
||||
randomAdjazenzMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
public Matrix(int[][] matrix) {
|
||||
|
@ -13,7 +13,7 @@ public class TestMatrix {
|
||||
scalarProduct = matrix.multiply(matrix);
|
||||
System.out.println("\nScalarProduct A²: \n" + scalarProduct);
|
||||
|
||||
Matrix bruh = new Matrix(100, 100);
|
||||
Matrix bruh = new Matrix(100, 100, true);
|
||||
System.out.println(bruh);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user