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