forked from JavaTX/JavaCompilerCore
26 lines
460 B
Java
Executable File
26 lines
460 B
Java
Executable File
class Matrix extends Vector<Vector<Integer>> {
|
|
|
|
mul(m){
|
|
ret = new Matrix();
|
|
i = 0;
|
|
while(i <size()) {
|
|
v1 = this.elementAt(i);
|
|
v2 = new Vector<Integer>();
|
|
j = 0;
|
|
while(j < v1.size()) {
|
|
erg = 0;
|
|
k = 0;
|
|
while(k < v1.size()) {
|
|
erg = erg + v1.elementAt(k).intValue() * m.elmentAt(k).elementAt(j).intValue();
|
|
k++;
|
|
}
|
|
v2.addElement(new Integer(erg);
|
|
j++;
|
|
}
|
|
ret.addElement(v2);
|
|
i++;
|
|
}
|
|
return ret;
|
|
}
|
|
|
|
} |