/** * immutable multiply the vector times this: x' * A, i.e., colwise. * * @param v * @return */ public SparseVector vectorTimes(SparseVector v) { SparseVector w = new SparseVector(); // only the rows in A that v is nonzero for (int i : v.keySet()) { SparseVector a = get(i).copy(); a.factor(v.get(i)); w.add(a); } return w; }