forked from JavaTX/JavaCompilerCore
modified: ../../src/de/dhbwstuttgart/typeinference/unify/TypeUnifyTask.java modified: ../../src/de/dhbwstuttgart/typeinference/unify/interfaces/IFiniteClosure.java modified: ../../src/de/dhbwstuttgart/typeinference/unify/model/ExtendsType.java modified: ../../src/de/dhbwstuttgart/typeinference/unify/model/FiniteClosure.java modified: ../../src/de/dhbwstuttgart/typeinference/unify/model/FunNType.java modified: ../../src/de/dhbwstuttgart/typeinference/unify/model/PlaceholderType.java modified: ../../src/de/dhbwstuttgart/typeinference/unify/model/ReferenceType.java modified: ../../src/de/dhbwstuttgart/typeinference/unify/model/SuperType.java modified: ../../src/de/dhbwstuttgart/typeinference/unify/model/UnifyType.java modified: ../../test/javFiles/Matrix.jav F-Bounded angefangen
29 lines
901 B
Java
29 lines
901 B
Java
import java.util.Vector;
|
|
import java.lang.Integer;
|
|
|
|
class Matrix extends Vector<Vector<Integer>> {
|
|
Integer mul1(Integer x, Integer y) { return x;}
|
|
Integer add1(Integer x, Integer y) { return x;}
|
|
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.elementAt(k) * m.elementAt(k).elementAt(j);
|
|
erg = add1(erg, mul1(v1.elementAt(k),
|
|
m.elementAt(k).elementAt(j)));
|
|
k++; }
|
|
v2.addElement(new Integer(erg));
|
|
j++; }
|
|
ret.addElement(v2);
|
|
i++; }
|
|
return ret;
|
|
}
|
|
}
|