JavaCompilerCore/examples/bajo1_usecases/Matrix.jav

36 lines
576 B
Plaintext
Raw Permalink Normal View History

import de.dhbwstuttgart.typeinference.Menge;
2013-10-18 11:33:46 +00:00
class Matrix extends Menge<Menge<Integer>> {
2013-10-18 11:33:46 +00:00
mul(m){
Menge<Menge<Integer>> ret;
2013-10-18 11:33:46 +00:00
ret = new Matrix();
i;
i = 0;
while(i <size()) {
v1;
v2;
v1 = this.elementAt(i);
v2 = new Menge<Integer>();
2013-10-18 11:33:46 +00:00
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;
}
}