code: public void set(int index, double value) {
          double old = vector.get(index);
          if (value == 0)
              vector.remove(index);
          else 
              vector.put(index, value);
          magnitude = -1;
      }
docs: {@inheritDoc}