/** * Add the values in the given vector to * this vector and return this * @param vector the vector to add * @return this */ public SparseShortArray addInplace(SparseShortArray vector) { for (Entry e : vector.entries()) { increment(e.index, e.value); } return this; }
/** * Subtract the values in the given vector from * this array and return this * @param vector the vector to add * @return this */ public SparseShortArray subtractInplace(SparseShortArray vector) { for (Entry e : vector.entries()) { increment(e.index, (short)(-e.value)); } return this; }