JavaPatternMatching/resources/bytecode/javFiles/Scalar.jav
pl@gohorb.ba-horb.de e5ff08e0df modified: resources/bytecode/javFiles/Scalar.jav
modified:   src/main/java/de/dhbwstuttgart/typeinference/unify/RuleSet.java
? extends ty <! Ty' im erase1 korrigiert
2023-04-14 15:12:43 +02:00

28 lines
497 B
Java

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<Integer> {
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);
i = i+1;
}
return ret;
}
}