public double dot(Vector y) { checkSize(y); double ret = 0; for (VectorEntry e : this) ret += e.get() * y.get(e.index()); return ret; }
public Vector add(double alpha, Vector y) { checkSize(y); if (alpha == 0) return this; for (VectorEntry e : y) add(e.index(), alpha * e.get()); return this; }
public Vector add(double alpha, Vector y) { checkSize(y); if (alpha == 0) return this; for (VectorEntry e : y) add(e.index(), alpha * e.get()); return this; }
public double dot(Vector y) { checkSize(y); double ret = 0; for (VectorEntry e : this) ret += e.get() * y.get(e.index()); return ret; }
public Vector set(double alpha, Vector y) { checkSize(y); if (alpha == 0) return zero(); zero(); for (VectorEntry e : y) set(e.index(), alpha * e.get()); return this; }
public Vector set(double alpha, Vector y) { checkSize(y); if (alpha == 0) return zero(); zero(); for (VectorEntry e : y) set(e.index(), alpha * e.get()); return this; }