diff --git a/test/plugindevelopment/MartinTestCases/MatrixWhile.jav b/test/plugindevelopment/MartinTestCases/MatrixWhile.jav new file mode 100644 index 00000000..e696ea61 --- /dev/null +++ b/test/plugindevelopment/MartinTestCases/MatrixWhile.jav @@ -0,0 +1,43 @@ +class Matrix extends Vector> { + + Matrix mul_rec(Matrix m) { + v1; + v1 = new Vector(); + v2; + v2 = new Vector(); + i; + i = 0; + while(i < m.size()) { + v; + v = m.elementAt(i); + v2.addElement(v.remove(v.size()-1)); + i++; + } + Matrix ret; + if (m.elementAt(0).size() > 0) { + ret = this.mul_rec(m); + } + else { + ret = new Matrix(); + i = 0; + while (i < this.size()) { + ret.addElement(new Vector()); + i++; + } + } + i = 0; + while (i < this.size()) { + int erg = 0; + j; + j = 0; + while (j < v2.size()) { + erg = erg + this.elementAt(i).elementAt(j).intValue() + * v2.elementAt(j).intValue(); + j++; + } + ret.elementAt(i).addElement(erg); + i++; + } + return ret; + } +} \ No newline at end of file diff --git a/test/plugindevelopment/MartinTestCases/Tester.java b/test/plugindevelopment/MartinTestCases/Tester.java index d056fc59..923c65e6 100644 --- a/test/plugindevelopment/MartinTestCases/Tester.java +++ b/test/plugindevelopment/MartinTestCases/Tester.java @@ -53,7 +53,7 @@ public class Tester extends TypeInsertTester{ public void runTests(){ Vector testFiles = new Vector(); testFiles.add("AchimTest1.jav"); - + testFiles.add("MatrixWhile.jav"); //testFiles.add("BoundedType1.jav"); testFiles.add("BoundedType2.jav"); testFiles.add("BoundedType.jav");