예제 #1
0
  public Object dot(Vector<Object> v1, Vector<Object> v2) throws ParseException {
    if (v1.size() != v2.size())
      throw new ParseException("Dot: both sides of dot must be same length");
    int len = v1.size();
    if (len < 1) throw new ParseException("Dot: empty vectors parsed");

    Object res = mul.mul(v1.elementAt(0), v2.elementAt(0));
    for (int i = 1; i < len; ++i) {
      res = add.add(res, mul.mul(v1.elementAt(i), v2.elementAt(i)));
    }
    return res;
  }
예제 #2
0
 public double add(double n1, double n2) throws RemoteException {
   return (addService.add(n1, n2));
 }