Esempio n. 1
0
 @Override
 public void subtract(Vector v) {
   verifyVectorSizesMatch(this, v);
   for (int i = 0; i < getSize(); i++) {
     setValue(i, this.getValue(i) - v.getValue(i));
   }
 }
Esempio n. 2
0
 @Override
 public float dotProduct(Vector v) {
   verifyVectorSizesMatch(this, v);
   float dotProduct = 0.0f;
   for (int i = 0; i < getSize(); i++) {
     dotProduct += this.getValue(i) * v.getValue(i);
   }
   return dotProduct;
 }