From d053ce0b089df31d0c7e37d9c33e9ce21dab0003 Mon Sep 17 00:00:00 2001 From: JanUlrich Date: Sat, 26 Apr 2014 16:20:16 +0200 Subject: [PATCH] =?UTF-8?q?Test=20angef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MartinTestCases/MatrixWhile.jav | 43 +++++++++++++++++++ .../MartinTestCases/Tester.java | 2 +- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 test/plugindevelopment/MartinTestCases/MatrixWhile.jav diff --git a/test/plugindevelopment/MartinTestCases/MatrixWhile.jav b/test/plugindevelopment/MartinTestCases/MatrixWhile.jav new file mode 100644 index 000000000..e696ea61e --- /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 d056fc59c..923c65e66 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");