JavaCompilerCore/resources/bytecode/javFiles/Matrix.jav
pl@gohorb.ba-horb.de 2221b559ca
All checks were successful
Build and Test with Maven / Build-and-test-with-Maven (push) Successful in 6m2s
Implementierungen von Interfaces eingefuegt und Overriding ersetzt durch implementierung
modified:   ../src/main/java/de/dhbwstuttgart/syntaxtree/factory/ASTFactory.java

Overriding ersetzt durch implementierung (Umbennennung)
	modified:   ../resources/bytecode/javFiles/Matrix.jav
	modified:   ../src/main/java/de/dhbwstuttgart/syntaxtree/Method.java
	modified:   ../src/main/java/de/dhbwstuttgart/typeinference/constraints/Constraint.java
	modified:   ../src/main/java/de/dhbwstuttgart/typeinference/constraints/ConstraintSet.java
	modified:   ../src/main/java/de/dhbwstuttgart/typeinference/typeAlgo/TYPEStmt.java
	modified:   ../src/main/java/de/dhbwstuttgart/typeinference/unify/RuleSet.java
	modified:   ../src/main/java/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java
2024-05-10 14:16:23 +02:00

47 lines
1.1 KiB
Java

import java.util.List;
import java.util.AbstractList;
import java.util.Vector;
import java.lang.Integer;
//import java.lang.Float;
//import java.lang.Byte;
//import java.lang.Boolean;
public class Matrix extends Vector<Vector<Integer>> {
Matrix () {
}
public Matrix(vv) {
Integer i;
i = 0;
while(i < vv.size()) {
// Boolean a = this.add(vv.elementAt(i));
this.add(vv.elementAt(i));
i=i+1;
}
}
public mul(m) {
var ret = new Matrix();
var i = 0;
while(i < size()) {
var v1 = this.elementAt(i);
var v2 = new Vector<Integer>();
var j = 0;
while(j < v1.size()) {
var erg = 0;
var k = 0;
while(k < v1.size()) {
erg = erg + v1.get(k)
* m.get(k).get(j);
k++; }
// v2.addElement(new Integer(erg));
v2.addElement(erg);
j++; }
ret.addElement(v2);
i++;
}
return ret;
}
}