@Override public void subtract(Vector v) { verifyVectorSizesMatch(this, v); for (int i = 0; i < getSize(); i++) { setValue(i, this.getValue(i) - v.getValue(i)); } }
@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; }