2023-04-04 13:54:41 +00:00
|
|
|
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> {
|
|
|
|
|
2024-03-14 12:50:56 +00:00
|
|
|
public Scalar(v) {
|
2023-04-04 13:54:41 +00:00
|
|
|
Integer i;
|
|
|
|
i = 0;
|
|
|
|
while(i < v.size()) {
|
|
|
|
this.add(v.elementAt(i));
|
|
|
|
i=i+1;
|
|
|
|
}
|
|
|
|
}
|
2023-04-14 13:12:43 +00:00
|
|
|
|
2024-03-14 12:50:56 +00:00
|
|
|
public mul(v) {
|
2023-04-04 13:54:41 +00:00
|
|
|
var ret = 0;
|
|
|
|
var i = 0;
|
|
|
|
while(i < size()) {
|
|
|
|
ret = ret + this.elementAt(i) * v.elementAt(i);
|
2023-04-04 14:00:54 +00:00
|
|
|
i = i+1;
|
2023-04-04 13:54:41 +00:00
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
}
|