JavaCompilerCore/examples/bajo1_usecases/Matrix.jav

36 lines
576 B
Java
Executable File

import de.dhbwstuttgart.typeinference.Menge;
class Matrix extends Menge<Menge<Integer>> {
mul(m){
Menge<Menge<Integer>> ret;
ret = new Matrix();
i;
i = 0;
while(i <size()) {
v1;
v2;
v1 = this.elementAt(i);
v2 = new Menge<Integer>();
j;
j = 0;
while(j < v1.size()) {
erg;
erg = 0;
k;
k = 0;
while(k < v1.size()) {
erg = erg + v1.elementAt(k).intValue() * m.elementAt(k).elementAt(j).intValue();
k++;
}
v2.addElement(new Integer(erg));
j++;
}
ret.addElement(v2);
i++;
}
return ret;
}
}