/** * Returns a copy of this vector. * * @return a copy of this vector. */ public Vector copyVector() { Vector result = new Vector(getRowDimension()); for (int i = 0; i < getRowDimension(); i++) { result.setValue(i, getValue(i)); } return result; }
/** * Returns the result of vector addition. * * @param v * the vector to add * * @return the result of vector addition. */ public Vector plus(Vector v) { Vector result = new Vector(size()); for (int i = 0; i < size(); i++) { result.setValue(i, getValue(i) + v.getValue(i)); } return result; }