From f6fe3a68aaf95ab8bdfee269a36fcd2f9cca741e Mon Sep 17 00:00:00 2001 From: "pl@gohorb.ba-horb.de" Date: Tue, 4 Apr 2023 15:54:41 +0200 Subject: [PATCH] new file: resources/bytecode/javFiles/Scalar.jav --- resources/bytecode/javFiles/Scalar.jav | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 resources/bytecode/javFiles/Scalar.jav diff --git a/resources/bytecode/javFiles/Scalar.jav b/resources/bytecode/javFiles/Scalar.jav new file mode 100644 index 000000000..0ef1b5807 --- /dev/null +++ b/resources/bytecode/javFiles/Scalar.jav @@ -0,0 +1,26 @@ +import java.util.Vector; +import java.lang.Integer; +import java.lang.Float; +//import java.lang.Byte; +//import java.lang.Boolean; + +public class Scalar extends Vector { + + Scalar(v) { + Integer i; + i = 0; + while(i < v.size()) { + this.add(v.elementAt(i)); + i=i+1; + } + } + + mul(v) { + var ret = 0; + var i = 0; + while(i < size()) { + ret = ret + this.elementAt(i) * v.elementAt(i); + } + return ret; + } +}