Beispiel #1
0
 /** Returns the norm of this vector. */
 public synchronized double norm() {
   ConcurVector aux = new ConcurVector(dimension());
   aux.assign(this);
   aux.mul(this);
   return Math.sqrt(aux.sum());
 }
Beispiel #2
0
 /**
  * Returns the dot product between two vectors (this and v).
  *
  * @param v, second operand of the dot product operation.
  * @precondition dimension() == v.dimension().
  */
 public synchronized double prod(ConcurVector v) {
   ConcurVector aux = new ConcurVector(dimension());
   aux.assign(this);
   aux.mul(v);
   return aux.sum();
 }