39 lines
898 B
Java
39 lines
898 B
Java
package VL08.Aufgabe03;
|
|
|
|
/**
|
|
* Vorlesung 8 / Aufgabe 3
|
|
*
|
|
* @author Sebastian Brosch
|
|
*/
|
|
public class Aufgabe03 {
|
|
public static void main(String[] args) {
|
|
|
|
Matrix matrixA = new Matrix(2, 3);
|
|
matrixA.setValue(0, 0, 3);
|
|
matrixA.setValue(0, 1, 2);
|
|
matrixA.setValue(0, 2, 1);
|
|
matrixA.setValue(1, 0, 1);
|
|
matrixA.setValue(1, 1, 0);
|
|
matrixA.setValue(1, 2, 2);
|
|
|
|
Matrix matrixB = new Matrix(3, 2);
|
|
matrixB.setValue(0, 0, 1);
|
|
matrixB.setValue(0, 1, 2);
|
|
matrixB.setValue(1, 0, 0);
|
|
matrixB.setValue(1, 1, 1);
|
|
matrixB.setValue(2, 0, 4);
|
|
matrixB.setValue(2, 1, 0);
|
|
|
|
System.out.println("------------------");
|
|
matrixA.print();
|
|
System.out.println("------------------");
|
|
matrixB.print();
|
|
System.out.println("------------------");
|
|
|
|
matrixA.multiply(matrixB);
|
|
|
|
matrixA.print();
|
|
System.out.println("------------------");
|
|
}
|
|
}
|